{"version":3,"sources":["configProvider.ts","features/form/ReduxFormKeys.ts","features/form/FormActions.ts","features/project/types.ts","features/project/lookup.ts","features/product/lookup.ts","features/calculation/models/FormModels.ts","features/calculation/CalculationActions.ts","features/calculation/CalculationService.ts","features/calculation/constant.ts","features/auth/AuthService.ts","features/api/JsonRESTApiClient.ts","features/api/simple-validators.ts","features/auth/validators.ts","features/project/ProjectApiV1Client.ts","features/project/validators.ts","features/calculation/ProjectApi.redux.ts","features/product/validators.ts","features/product/ProductApiV1Client.ts","features/calculation/CalculationService/System.ts","features/calculation/CalculationService/SmokeDetection.ts","features/calculation/CalculationService/LiftStatusDetection.ts","features/calculation/CalculationService/LiftArea.ts","features/calculation/CalculationService/AIOBasicSet.ts","features/calculation/CalculationService/VentilationComponents.ts","localization/LocalizationService.ts","localization/hook.tsx","shared/components/error-list.tsx","features/calculation/SelectedProductsBuilder/types.ts","features/calculation/calculation.selector.ts","features/calculation/SelectedProductsBuilder/vent-comp.partial.ts","features/calculation/SelectedProductsBuilder/default.flow.ts","features/calculation/SelectedProductsBuilder/complete-set.flow.ts","features/calculation/CalculationReducer.ts","features/calculation/SelectedProductsBuilder.ts","features/calculation/CalculationSaga.ts","store/saga.ts","features/form/FormReducer.ts","store/reducer.ts","store/store.ts","features/config/validators.ts","features/config/ConfigApiV1Client.ts","shared/useFetchOnce.hook.ts","features/config/Config.hook.ts","features/auth/Auth.hook.ts","features/auth/UserApiV1Client.ts","features/auth/User.hook.ts","features/settings/validators.ts","features/settings/SettingsApiV1Client.ts","features/settings/Settings.hook.ts","shared/components/Spinner.tsx","features/auth/PermissionService.ts","features/freshworks-widget/useFreshworksWidget.hook.ts","localization/RestrictedLanguageMessage.tsx","localization/RestrictedCurrencyMessage.tsx","features/project/_ProjectTable.tsx","features/project/ProjectExplorerPage.tsx","shared/components/FormControls.tsx","shared/components/TabSection.tsx","shared/controls/InputForInteger.tsx","features/calculation/FormUtility.ts","features/calculation/components/01-BasicInputs/_AIOBasicSetsModal.tsx","features/calculation/components/01-BasicInputs/BasicInputsForm.tsx","store/useDispatchCallback.ts","shared/components/ImageModal.tsx","features/calculation/components/02-ConfigurationInputs/_ConfigurationForm.tsx","features/calculation/components/02-ConfigurationInputs/_AccessoriesTable.tsx","features/calculation/components/04-CostCalculation/_TableRowAccordion.tsx","features/calculation/components/04-CostCalculation/_CostCalculationList.tsx","features/calculation/components/02-ConfigurationInputs/_NonStandardComponentsTable.tsx","features/calculation/components/02-ConfigurationInputs/ConfigurationInputsForm.tsx","features/calculation/components/03-VentilationComponents/_ProductsTable.tsx","features/calculation/components/03-VentilationComponents/VentilationComponentsForm.tsx","shared/components/file-uploader/file-uploader-presentational.tsx","shared/components/file-uploader/file-uploader.tsx","features/project-export/ProjectExportApiV1Client.ts","features/project-export/ProjectExport.hook.ts","features/file/FileApiV1Client.ts","features/file/File.hook.ts","features/reporting/ReportingV1Api.ts","features/reporting/Reporting.hook.ts","features/calculation/components/DebugTable.tsx","features/calculation/CalculationApiV1Client.ts","features/calculation/CalculationService/Montage.ts","features/calculation/components/04-CostCalculation/_SaveProjectModal.tsx","features/calculation/components/04-CostCalculation/_CableModal.tsx","features/calculation/components/04-CostCalculation/CostCalculationForm.tsx","features/calculation/calculation.hook.ts","features/calculation/components/CalculationTabs.tsx","features/calculation/CalculationPage.tsx","features/simulator/SimulatorPage.tsx","shared/components/Markdown.tsx","layout/documents/LegalNotice_de.md","layout/documents/LegalNotice_en.md","layout/documents/LegalNotice.tsx","layout/TermsAndConditions.tsx","assets/BlueKit-logo.png","layout/Layout.tsx","layout/AccessControl.tsx","App.tsx","index.tsx"],"names":["simDomains","configProvider","defaultLanguage","manuallySetLanguageLocalStorageKey","manuallySetLanguageLocalStorageTTL","defaultCurrency","enableCurrencySelect","manuallySetCurrencyLocalStorageKey","manuallySetCurrencyLocalStorageTTL","disableKeyCloak","enableE2EToken","disableCtrlKeyFastDelete","backendUrl","window","location","origin","apiUrl","this","bkSimulatorUrl","hostname","Object","entries","find","k","endsWith","Date","now","getSimulatorURL","useConfig","ReduxFormKeys","FormActionTypes","PROJECT_STATE","COUNTRY","PROJECT_TYPE","BUILDING_TYPE","INSTALLATION_POSITION","MACHINE_ROOM","SYSTEM","SMOKE_DETECTION","LIFT_STATUS_DETECTION","REQUEST_TYPE","LIFT_AREA_PERCENTAGE","PRODUCT_TYPE","PRODUCT_GROUP","PRODUCT_CATEGORY","SET_PRODUCT_KEY","PRODUCT_KEY","CHARACTERISTIC_KEY","formActionCreator","form","fields","type","RESET_FIELDS","payload","CalculationActionTypes","BasicInputsFormModel","aioBasicSet","noOfInterfaceAdapters","projectName","country","buildingLocation","buildingType","projectType","plannedImplementationDate","installationPosition","nrwgDelivered","weathershelter","lowEnergyStandard","abzRequired","quiet","systemIntegration","additionalSmokeDetector","mainLevelSmokeDetector","machineRoom","noOfElevators","shaftHeight","shaftWidth","shaftDepth","liftNumber","calculatedVentilationArea","liftAreaPercentage","ConfigurationInputsFormModel","smokeDetection","system","liftStatusDetection","keySwitchLED","ventilationTimer","additionalThermostat","humiditySensor","sirenWithKeySwitch","eightPinInterfaceAdapterSet","VentilationComponentsFormModel","includeEinbauwinkel","CostCalculationFormModel","montageIncluded","montageBuildingLocation","undefined","requestType","remarks","projectState","NEW","orderNumber","offerNumber","defaultFormValues","basicInputsForm","values","hasErrors","configurationInputsForm","ventilationComponentsForm","costCalculationForm","getProductById","productsData","productId","p","id","getProductByKey","key","x","productKey","getIdFromGroupOrId","g","prototype","hasOwnProperty","call","filterProductsByVentilationArea","minArea","maxArea","includeNull","product","ventilationArea","filterProductsByTypes","types","not","includes","productTypeId","filterProductsByGroups","groups","groupIds","map","productGroupId","filterProductsByCharacteristicsAny","characteristics","characteristicsData","filter","filterCharacteristicsByKeys","c","filterProductsByCharacteristicsAll","predicates","every","pred","filterProductGroupsByCategories","categories","productCategoryId","keys","characteristicKey","getFormValues","formValues","forms","cloneDeep","setFormValuesFromArray","formModel","targetFormModel","forEach","formValue","f","value","getFormValuesDictionaryFromForms","kvps","getProjectProductsFromForms","loadedProjectId","calculationState","ventComp","ventilationComponents","startsWith","replace","quantity","projectId","VENTCOMP","nonStandardComponents","description","price","NONSTANDARDCOMPONENTS","concat","calculationActionCreator","processFormValues","productData","PROCESS_FORM_VALUES","extraProductData","initializeForm","INITIALIZE_FORM","switchTab","direction","SWITCH_TAB","requestSwitchTab","REQUEST_SWITCH_TAB","switchTabIndex","index","SWITCH_TAB_INDEX","requestSwitchTabIndex","REQUEST_SWITCH_TAB_INDEX","ignoreAIOBasicSets","ignore","IGNORE_AIO_BASIC_SETS","setAIOBasicSetModalVisibility","isOpen","SET_AIO_BASIC_SET_MODAL_VISIBILITY","setNonStandardComponentList","components","SET_NON_STANDARD_COMPONENT_LIST","addNonStandardComponent","ADD_NON_STANDARD_COMPONENT","removeNonStandardComponent","REMOVE_NON_STANDARD_COMPONENT","calculationTabs","isCalculationTab","v","createAction","prefix","def","meta","getE2EToken","localStorage","getItem","preemptiveRefresh","getPreemptiveRefresh","kc","updateToken","then","catch","console","error","finally","config","authTokenContext","getToken","token","keyCloak","Error","isTokenExpired","reload","timeAhead","useAuthTokenContext","JsonRESTApiClient","_baseUrl","_tokenGetter","input","init","validator","_fetch","response","result","json","SyntaxError","ApiSyntaxError","ApiInternalError","ApiValidationError","fetch","ApiFetchError","ok","ApiStatusCodeError","status","statusText","parts","queryparams","suffix","join","querystring","encodeURIComponent","length","contentType","headers","ApiError","innerError","message","body","ValidationError","path","innerMessage","nested","name","enrichValidator","validatorName","assign","nothrow","e","isArrayOf","elementValidator","Array","isArray","element","idx","fromNested","isObjectWithShape","validators","isNoValue","propertyValue","isUnknown","isString","isNumber","isBoolean","isStringEnum","isOptional","isBoth","validator1","validator2","GetProjectsView","isICompany","isIUser","firstName","lastName","email","company","isIProjectProduct","isIFormValue","isIFile","isIProjectSynopsis","state","createdAt","createdBy","owningCompany","isGetProjectsReponse","isIProject","createdById","owningCompanyId","lastReportingAt","products","files","isIEnrichedProject","ProjectActionTypes","ProjectApiV1Client","project","sendMail","_getUrl","_getHeaders","JSON","stringify","method","_fetchJson","view","query","first","count","queryParams","push","String","trim","isMultilanguageDescription","de","en","isIProduct","dhNo","bxH","width","height","recess","imageUrl","isRecommended","isIProductGroup","recommendationOrder2","planningFileUrl","isICharacteristic","isIProductData","productGroups","ProductApiV1Client","companyId","getLocation","router","pathname","getActiveTabIndex","activeTabIndex","initialState","entity","productDataCompanyId","loading","isUpdating","validationErrorList","ProjectApiActionCreator","autobind","callback","UPDATE_REQUEST","UPDATE_SUCCESS","UPDATE_PENDING","errorDict","UPDATE_ERROR","loadAsTemplate","GET_REQUEST","GET_SUCCESS","GET_ERROR","MAKE_PROJECT","MAKE_PROJECT_INJECT_PRODUCT_DATA","MAKE_PROJECT_SUCCESS","ProjectApi","APP_NAME","projectApiV1BaseUrl","productApiV1BaseUrl","projectApiClient","productApiClient","action","getProjectById","getProductData","put","projectApiActionCreator","getSuccess","nonStandardComponentList","getError","makeProjectInjectProductData","LST_CO2_V3","makeProjectSuccess","select","updatePending","requestObj","saveProject","updateError","change","updateSuccess","newRouteForm","route","log","all","takeLatest","get","makeProject","update","PROJECT_API_PREFIX","projectApi","aioBasicSystemOrPackageNotAvailable","basicInputFormValues","getAvailableSystems","L_AIO","AIO_BASIC","getSystem","basicValues","configValues","getApplicableSmokeDetectionMethods","configurationInputsFormValues","removeMethod","remove","m","methods","NONE","POINTDETECTOR","SDLF1","RAS","getSmokeDetectionMethodsForShaftHeight","DE","_1_0_PERCENT","MANUAL","hasSmokeDetectionMethodNone","NO","getApplicatableLiftStatusDetectionMethods","getLSTRepeaterCount","lst","effectiveHeight","repeaterCount","Math","max","ceil","VENTILATION_AREA_PERCENTAGE_DE_LBO","_2_5_PERCENT","getAvailableLiftAreaPercentages","MODERNIZED","AT","getTotalLiftArea","isNaN","liftFootprint","calculateMinimumLiftArea","AIO_BASIC_SET_RECOMMENDATIONS","PD_12","minLineLength","maxLineLength","machineRoomSupport","SDLF_50","minShaftHeight","maxShaftHeight","SDLF_100","PD_24","PD_36","PD_48","getAIOBasicSetShaftHeightLimits","opts","o","Infinity","min","getApplicableAIOBasicSets","SETAIOB","limits","getAIOBasicSetVent","totalLiftArea","byVentilationAreaAsc","a","b","ventComponentsNewbuilding","sort","ventComponentsModernized","component","getAvailableVentilationComponentsForAIOBasicSet","vent","weatherProtectionComponents","aioBasicSetVentilationArea","potentialWPComponents","WEATHERPROTECTION","VERTICAL","ALAS","ventComponents","getAvailableVentilationComponentsForManualConfig","installationPositionKey","HORIZONTAL","HORIZONTAL_INSTALLATION","VERTICAL_INSTALLATION","projectTypeKey","ventFilterCharacteristics","abZ","LOWENERGY","QUIET","WITH_SPRING_RETURN","productGroupsData","filterProductsByCategories","WEATHERPROTECTION_COMPATIBLE","WEATHERPROTECTION_BUILTIN","recommendedProductId","vc","recommendedGroupId","orderBy","sortedComponents","getRecommendedProductId","getAvailableVentilationComponents","COMPONENT_GROUP_IDS_WITH_EINBAUWINKEL","JK190DB","JK190","getQuantitiesFromVentilationComponentsFormModel","ventilationComponentsValues","PRODUCT_QUANTITY_PREFIX","substring","Number","LanguageKey","ProductLanguageKey","CurrencyKey","fallbackLanguages","forLanguage","language","enableFallback","localize","defaultString","localeString","getLocaleString","debug","substitute","info","localizeEnum","enumToLookup","text","localizeCountry","searchFn","alpha2","alpha3","toLowerCase","world_countries","countriesToLookup","getCountriesAlpha2","subRegex","sourceString","resultString","match","expr","areaValue","parseInt","localizeDistance","localizeArea","slice","thousandSep","decimalSep","localizeNumber","decimals","intPart","formatThousands","floor","fraction","fractStr","toString","toFixed","fractPart","nl2br","lines","split","children","line","React","createElement","Fragment","locale","localization","require","separator","intStr","paddedLen","extraZeroes","padStart","LocalizationContext","selectActiveLanguage","ctx","debugLang","str","lang","getDebugLangFromStr","document","hash","browserLanguages","navigator","languages","browserLanguage","fallbackLang","selectedLanguage","manuallySetLang","restrictedLanguages","LocalizationContextProvider","innerLanguage","innerSetLanguage","expires","setItem","storageGetLanguage","innerCurrency","innerSetCurrency","currency","storageGetCurrency","setCurrency","curr","storageSetCurrency","contextValue","setLanguage","storageSetLanguage","Provider","RestrictLanguages","props","originalContext","useLanguage","useProductLanguage","useCurrency","useLocalization","syncedErrorsToList","syncedErrors","errorToList","FormErrorList","errorList","displayMode","fieldDict","touched","className","style","display","getCalculationState","getForm","isAllFormReady","createSelector","Boolean","selectedAIOBasicSet","isBasicInputsFormValid","syncErrors","canNavigateToConfigurationForm","canNavigateToVentilationForm","isWeatherProtectionNeeded","canNavigateToCostCalculationForm","isConfigurationInputsFormValid","isVentilationComponentsFormValid","StageKey","BuilderRuleExpression","DEFAULT","Symbol","ventCompFlow","stage","exec","addProductById","BRACKET","when","_","selectedProducts","ventProduct","bracketProduct","defaultFlow","BKSYSCTRL","selectOneBy","sealed","options","builtin","args","AIO_BASIC_CENTRAL_UNIT","BK_AIO_CENTRAL_UNIT","ASSEMBLY_SET_BLUE_KIT_LAIO","ADDITIONAL_THERMOSTAT","or","constant","DOWN","LST","addProductByKey","LST_CO2_V3_AB","REPEATER_END_MODULE","REPEATER_CONNECT_MODULE","FAULTALARMCONTACT","empty","SMOKEDECTCOMP","RJ_RAS_MICROS_SENS_42_M","RJ_RAS_PRO_SENS_200_M","RJ_RAS_ACCESSORIES","FILTER_RJ_FEIN_RAS","pipeHeight","and","SD_L_F_1_RJ_AIO_50_END","SD_L_F_1_RJ_AIO_120_END","getPDQuantityFromShaftHeight","PD_RJ_AIO_PG","PD_RJ_AIO_END","equalsAny","UP","RAUCHMELDER_MASCHINENRAUM","MAIN_LEVEL_SMOKE_DETECTOR","RT_45_RJ","makeRuleForProductFromConfigFormValueQuantity","RT_45_LRJ","RJ_45_SPLITTER","KEY_SWITCH_LED","VENTILATION_TIMER","makeRuleForProductFromConfigFormValueFixed","HUMIDITY_SENSOR","SIREN_WITH_KEY_SWITCH","FM_2_M","ventCompCount","NRWG","reduce","excludedCount","is","costCalculationValues","fm2m","estimatedQuantity","BATTERY_PACK","SMOKE_TEST_SPRAY","_1","_2","some","PRODUCT_GROUPS_REQUIRING_8PIN_INTERFACE_ADAPTER_SET","THERMOS9","THERMOTAIRMO","quietProductGroupIds","findIndex","Direction","Tabs","completeSetFlow","SelectedProductsBuilder","builtinExpressions","bind","builtinExecutions","topUpProductByKey","logContext","flowKey","pushContext","flows","SelectedProductsBuilderError","flow","runStage","popContext","runRule","rule","execution","getRuleExecution","errorLevel","executeRule","currentStage","configCtx","ventCtx","indexOf","postCtx","condition","runExpression","selectorValue","ctxArgs","subtype","getSubtype","exp","ctxValue","eq","checkForEmpty","valueIsEmpty","rhsValue","ruleExecution","_addProduct","minimumQuantity","_topUpProduct","existingSelectedProduct","pop","builder","runFlow","cause","isAIOBasicSetModalOpen","isReadyForCalculation","aioBasicSets","filteredVentilationComponents","filteredWeatherProtectionComponents","processFormValuesToStateUpdate","setId","getSelectedAIOBasicSet","selectProductsFromFlow","availableComponents","checkForAIOBasicSets","calculateCostsAndLoadFiles","tryChange","_resetVentilationComponentQuantities","changeForm","saga","tabKey","makeSelectBase","loadedProject","BasicInput","Next","updateRequest","scrollTo","top","behavior","tabIndex","sanitizeFormValuesForInitialize","percentages","smokeDetectionMethods","defaultSmokeDetectionMethod","initialize","availableVentilationComponents","ventComponentIdsToRemove","formValueKeys","costCalculationFormValues","field","recalculatedVentilationArea","previousSystem","systems","defaultSystem","prevSmokeDetectionMethod","prevLiftStatusDetectionMethod","liftStatusDetectionMethods","defaultLiftStatusDetectionMethod","takeEvery","REDUX_FORM_CHANGE","rootSaga","dispatch","calculationSaga","customFormReducerForForm","$unset","reducers","formReducer","plugin","stateOverrides","Previous","CostCalculation","uuidv1","reducer","actionsDenylist","configureStore","history","sagaMiddleware","createSagaMiddleware","loggerMiddleware","createLogger","level","predicate","collapsed","enhancer","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","trace","__REDUX_TRACE__","compose","applyMiddleware","routerMiddleware","allReducers","connectRouter","combineReducers","formReducers","buildRootReducer","store","createStore","run","isIConfig","keycloakPublicBaseUrl","ConfigApiV1Client","intitialState","actions","useFetchOnce","getter","runFetch","reset","ConfigContext","ConfigContextProvider","url","client","getConfig","configError","configLoading","fetchConfig","resetConfig","useConfigV2","AuthContext","AuthContextProvider","isE2EAuthenticated","setIsE2EAuthenticated","isKeycloakAuthenticated","setKeycloakAuthenticated","Keycloak","realm","clientId","enableLogging","onLoad","silentCheckSsoRedirectUri","authenticated","clearToken","logout","isAuthenticated","useAuthenticated","UserApiV1Client","UserContext","UserContextProvider","current","user","userLoading","userError","fetchUser","resetUser","useUser","isISettings","generalRemarks","offerValidityWeeks","deliveryWorkdays","SettingsApiV1Client","SettingsContext","SettingsContextProvider","getSettings","settings","settingsError","settingsLoading","fetchSettings","useSettings","SpinnerOpCode","UserGroup","Spinner","isLoading","isError","escalateTimeoutMs","isEscalateTimeout","setIsEscalateTimeout","timeout","setTimeout","clearTimeout","operation","freshworksOpenWithPrefill","useMemo","FreshworksWidget","onReportClick","custom_fields","classNames","segment","onClick","RestrictedLanguageMessage","Message","color","size","content","selected","RestrictedCurrencyMessage","hasAnyOfGroups","isAdmin","ADMIN","canAccessConnect","CUSTOMER","ProjectTable","tableProps","useHistory","useState","page","setPage","useEffect","params","projectList","projectListHasMore","projectListError","setProjectListAndError","setIsLoading","getProjects","hasMore","requestDelete","useCallback","deleteProjectById","pl","more","useProjectListApiV1Client","onCreateProjectClick","onDeleteProjectConfirm","onAnchorClick","event","data","preventDefault","target","href","paginationElement","Table","Cell","colSpan","textAlign","ButtonGroup","Button","compact","icon","disabled","Header","Row","HeaderCell","Body","primary","labelPosition","Icon","moment","format","popupContent","as","onConfirm","ButtonWithPopup","buttonProps","Popup","trigger","DeleteProjectModal","open","setOpen","onCancelClick","onConfirmClick","onTriggerClick","ctrlKey","skipThisDialogWithCtrlKeyHint","localizedKeyName","localizedHint","part","Label","Modal","dimmer","openOnTriggerClick","closeOnDimmerClick","onOpen","onClose","Content","basic","columns","fixed","Actions","secondary","InnerProjectExplorerPage","OWN","projectView","setProjectView","onSetProjectViewClick","tableQuery","setTableQuery","tableQueryInputValue","setTableQueryInputValue","onTableQueryInputValueChange","_event","q","onTableQueryInputValueClear","timeoutMs","fn","debounceTimer","useDebounce","userIsAdmin","Container","Grid","padded","Column","Segment","Menu","pointing","Item","active","OWN_COMPANY","ALL","position","Input","onChange","placeholder","link","ProjectExplorerPage","renderHidden","Form","Field","renderCheckbox","Checkbox","inputStyle","checked","label","infoText","renderRadio","radioValue","radioProps","Radio","SelectField","search","defaultValue","selectProps","onBlur","Select","warning","renderSelect","renderInput","fluid","hideError","renderTextArea","rows","TextArea","renderQuantity","valueFromAction","minIsDisabled","maxIsDisabled","TabSection","title","InputForInteger","setValue","parsedValue","setParsedValue","updateParsedValue","val","parsedVal","test","addonAfter","onFocus","forceFormat","fieldDisabledReasons","fieldDisabledMappings","reason","fieldDisabled","mutuallyExclusive","defaultTruthy","aTruthy","bTruthy","fieldComponentMapping","fieldProps","isRequired","required","validate","FieldDisabledMessage","reasons","firstReason","opacity","useFormUtility","loc","fieldDisabledReason","defaultProps","showTriggerButton","triggerButtonLabel","mapStateToProps","createStructuredSelector","mapDispatchToProps","onSetOpen","onAIOBasicSetSelect","selection","reduxFormChange","connect","inputProps","previousSelection","setPreviousSelection","productLanguage","requiresVentComponentSelection","getAIOBasicSetRequiresVentComponentSelection","skipDest","skipSteps","Description","Group","inline","set","array","shaftHeightLimit","toLocaleString","ribbon","VentilationComponents","addFlagsToCountries","flag","sortCountries","preferredCountries","preferA","preferB","localeCompare","renderError","normInteger","getFormSyncErrors","reduxForm","touchOnChange","touchOnBlur","keepDirtyOnReinitialize","enableReinitialize","baseMutuallyExclusive","countryOptions","liftAreaPercentageOptions","widths","flex","padding","numericality","int","msg","normalize","useDispatchCallback","creator","ImageModal","setState","close","thumbnailClassName","showThumbnail","src","maxHeight","maxWidth","Component","ConfigurationForm","configurationInputFormValues","formProps","systemOptions","smokeDetectionOptions","liftStatusDetectionOptions","AccessoriesTable","items","TableRowAccordion","rowClassName","rowItemClassName","hasProducts","costs","estimatedQuantities","getEstimatedQuantity","visible","isVisible","setVisible","onClickToggleVisibility","verticalAlign","dangerouslySetInnerHTML","__html","cableModalHandle","start","changed","pos","montage","noShowMontage","list","aggregateCostPositions","positions","nonZeroPositions","incompletePrice","FormatPrice","FormatMontage","CostCalculationList","calculateCostsList","specialRemarks","totalCablingCosts","cabling4m","cabling6m","cabling12m","cablingComponents","totalLogisticCosts","logisticCosts","totalComponentsCosts","blueKitSystemControlComponents","smokeDetectionComponents","assemblyComponents","totalCostsPositions","isMontagePossible","isMontageCalculated","montageCosts","montageLocationCosts","totalCosts","getRowClassName","counter","celled","collapsing","Footer","remark","i","NonStandardComponentsTable","onAddItem","onRemoveItem","userCanEdit","descriptionInputRef","priceInputRef","quantityInputRef","onCreateButtonClick","parseFloat","parsePrice","parseQuantity","itemRows","item","ref","syncedWarnings","getFormSyncWarnings","getFormMeta","errors","rt45lrj","useDispatch","onAddNonStandardComponent","onRemoveNonStandardComponent","stretched","divided","Divider","COLUMNS","ProductsTable","selector","showBracketOptionOnGroups","sortedProducts","availableProducts","sel","s","group","showBracketOption","ProductsTableGroupRows","showAll","setShowAll","onShowAll","productsToShow","rel","FLUSH_MOUNTING","SURFACE_MOUNTING","mounting","BracketOptionRow","PRODUCT_GROUPS_WITH_BRACKET","flatArrayFromQuantities","arr","sortProductsByArea","aArea","bArea","aAreaNull","bAreaNull","productDataList","_values","nrwgProductList","nrwgNoWpComponents","sp","wpComponents","wp","nrwg","validateWpForNrwg","showModernizedOpeningInfo","showModernizedWeathershelterInfo","marginTop","marginBottom","marginLeft","FileUploaderPresentationalComponent","dragging","file","onDrag","onSelectFileClick","onDragStart","onDragEnd","onDragOver","onDragEnter","onDragLeave","onDrop","uploaderClasses","InnerFileUploader","fileUploaderInput","dragEventCounter","dragenterListener","overrideEventDefaults","dataTransfer","dragleaveListener","dropListener","stopPropagation","click","onFileChanged","reader","FileReader","onload","theFileData","fileData","readAsDataURL","filename","addEventListener","removeEventListener","el","FileUploader","PROJECT_EXPORT_FILE_ENDING","ProjectExportApiV1Client","allProducts","selectedNonStandardComponents","LastReportingAtHeader","projectLastReportingAt","has","header","date","isValid","blob","lastReportingString","downloadBlob","fileName","URL","createObjectURL","setAttribute","appendChild","Cypress","parentNode","removeChild","useProjectExport","exportGetter","download","FileApiV1Client","_validateFileForUpload","FormData","append","browserDownloadBlob","Blob","ReportingApiV1Client","useReportingWithRedux","submit","submittedProject","submitError","submitLoading","useReporting","useSelector","submitBase","others","dispatchReduxChange","dispatchUpdateProject","updateRequired","useRef","DebugTable","bottomRow","colKeys","col","makeRow","extraProps","row","cols","makeCommonRow","makeBottomRow","CalculationApiV1Client","calculationInput","isICosts","MONTAGE_UNAVAILABLE_DE_PREFIXES","montagePrice","isAvailableMontageLocation","SaveProjectModal","projectIsUpdating","projectUpdateRequest","save","saveAndInformCustomer","OFFER_CREATED","ORDER_RECEIVED","MESSAGE_FROM_DH","customQuantitiesKeys","CableModal","forwardRef","_props","initialValues","setInitialValues","setEstimatedQuantities","changeFieldValue","resetFields","onOpenClick","initialQuantities","fromEntries","onSaveClick","onCloseClick","onResetClick","useImperativeHandle","isCostCalculationFormValid","isActive","projectError","projectLoading","getProject","getRequest","updateProject","useProjectV1","listFiles","fileList","fileListLoading","fileListError","fetchFileList","resetFileList","opLoading","opError","setOpError","deleteFile","uploadFile","downloadFile","fileLoading","fileError","fileErrorList","useProjectFiles","calculateCosts","costsError","costsLoading","fetchCosts","resetCosts","useCalculateCosts","reportingSubmit","reportingSubmitLoading","reportingSubmitError","pdfError","pdfFetch","pdfLoading","xlsxError","xlsxFetch","xlsxLoading","useSpecialRemarks","formErrorList","projectStateOptions","cableModalRef","C4_SETTINGS","C4_USER","C4_FORM_READY","C4_PROJECT","isCostsValid","isMontageValid","alignSelf","C4_COSTS","C4_FILES","striped","COMPLETED","_data","resize","SUBMITTED","toLocaleDateString","isCustomer","DRAFT","cablingInfoList","cable","category","cable4m","cable6m","cable12m","sumBy","montageInfoList","p2","listPrice","totalPrice","CalculationTabs","panes","menuItem","pane","Tab","menu","tabular","stackable","renderActiveOnly","activeIndex","onTabChange","Configuration","aioBasicSetCutoffTime","InnerCalculationPage","calculationTab","asTemplate","switchToIndex","prevProps","currProject","prevTabIndex","currTabIndex","prevRouteForm","currRouteForm","currRouteProject","newRouteProject","showSetsModal","isSameOrBefore","calcTabsProps","CP_STATE","CP_PRODUCT_DATA","canNext","showNextButton","showPrevButton","onNavigate","LocalizedCalculationPage","localizationProps","subject","CalculationPage","SimulatorPage","frameLoaded","setFrameLoaded","iframeRef","postMessage","frame","contentWindow","updateSimulatorAppToken","interval","setInterval","clearInterval","frameBorder","Markdown","LegalNotice","md","legalNotice_de_md","legalNotice_en_md","getMdForLang","TermsAndConditionsModal","targetTab","setTargetTab","currentTarget","dataset","closeIcon","defaultTab","termsAndConditions","urls","TermsAndConditionsTabs","defaultActiveTabIndex","render","Pane","defaultActiveIndex","TermsAndConditionsLinksTable","entry","List","linklang","floated","Layout","phoneVisible","setPhoneVisible","activeProjectId","mailto","LayoutHeader","resetAuthentication","historyPush","rootMatch","useRouteMatch","calculatorMatch","simulatorMatch","isCalculatorPage","isExact","isSimulatorPage","currentLanguage","languageOptions","toLocaleUpperCase","currentCurrency","currencyOptions","goto","onLogoutClick","Image","logoImage","alt","dp","newLang","newCurr","LayoutFooter","contactUrl","version","process","BUILD_SOURCEVERSION","AccessControl","accessGranted","checkFn","AC_PENDING","negative","App","cf_kundenfirma","useFreshworksWidgetPrefillUser","exact","to","routeProps","AP_AUTH","EverythingProvider","INDEX_CONFIG","appElement","loaderElement","createBrowserHistory","basename","root","ReactDOM","renderApp","getElementById"],"mappings":"osoGAIMA,EAAa,CACf,mBAAoB,gCACpB,mBAAoB,gCACpB,UAAa,yBAKhB,IAqCYC,EAAiB,IAnCV,mDAETC,gBAA+B,KAAK,KACpCC,mCAAqC,iCAAiC,KACtEC,mCAAqC,OAAwB,KAE7DC,gBAA+B,MAAM,KACrCC,sBAAuB,EAAM,K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jD,gBAAC,GAAkB,CAACw1B,MAAOA,GACvB,gBAAC,IAAe,CAACpB,QAASA,GACtB,gBAAC,GAAG,SAapBiyB,SAAgBD,EAAMJ,GAPH,WACXC,IACAA,EAAcz+B,MAAMC,QAAU,QAElCu+B,EAAWx+B,MAAMC,QAAU,OAC/B,GAGJ,CAEA6+B,CACIzhC,SAAS0hC,eAAe,aACxB1hC,SAAS0hC,eAAe,U","file":"static/js/main.9d7db02f.chunk.js","sourcesContent":["import { CurrencyKey, LanguageKey } from \"./localization/LocalizationService\";\n\n\n// @TODO: Fetch these from the backend\nconst simDomains = {\n \".stage.mchst.net\": \"https://bksim.stage.mchst.net\",\n \".prod1.mchst.net\": \"https://bksim.prod1.mchst.net\",\n \"localhost\": \"http://localhost:3002\",\n};\nfunction getSimulatorURL() {\n const hostname = Object.entries(simDomains).find(([k, _]) => window.location.hostname.endsWith(k))?.[1] ?? \"https://simulator.bluekit.de\";\n return `${hostname}/assets/framed.html?t=${Date.now()}`;\n}\n\nclass ConfigProvider {\n // Localization\n public defaultLanguage: LanguageKey = 'de';\n public manuallySetLanguageLocalStorageKey = 'bk.connect.manuallySetLanguage';\n public manuallySetLanguageLocalStorageTTL = 7 * 24 * 60 * 60 * 1000; // 7 days in milliseconds\n\n public defaultCurrency: CurrencyKey = 'EUR';\n public enableCurrencySelect = false;\n public manuallySetCurrencyLocalStorageKey = 'bk.connect.manuallySetCurrency';\n public manuallySetCurrencyLocalStorageTTL = 7 * 24 * 60 * 60 * 1000; // 7 days in milliseconds\n\n // Feature Flags\n public disableKeyCloak: boolean = false;\n public enableE2EToken: boolean = false;\n\n public disableCtrlKeyFastDelete: boolean = true;\n\n // Endpoint URLs\n private backendUrl: string = window.location.origin;\n public apiUrl = {\n 'settings-v1': this.backendUrl + '/api/settings',\n 'user-v1': this.backendUrl + '/api/user',\n 'product-v1': this.backendUrl + '/api/product',\n 'project-v1': this.backendUrl + '/api/project-v1',\n 'project-export-v1': this.backendUrl + '/api/project/export',\n 'file-v1': this.backendUrl + '/api/file',\n 'calculation-v1': this.backendUrl + '/api/calculation-v1',\n 'reporting-v1': this.backendUrl + '/api/reporting-v1',\n };\n\n // External Links\n public bkSimulatorUrl: string = getSimulatorURL();\n}\n\n/** @deprecated Use `useConfig()` hook instead */\nexport const configProvider = new ConfigProvider();\n\nexport function useConfig() {\n return configProvider;\n}\n\nexport type Config = ReturnType;\n","export enum ReduxFormKeys {\n basicInputsForm = 'basicInputsForm',\n configurationInputsForm = 'configurationInputsForm',\n ventilationComponentsForm = 'ventilationComponentsForm',\n costCalculationForm = 'costCalculationForm'\n}\n","export enum FormActionTypes {\r\n RESET_FIELDS = 'RESET_FIELDS',\r\n}\r\n\r\nexport const formActionCreator = {\r\n resetFields(form: string, fields: readonly string[]) {\r\n return {\r\n type: FormActionTypes.RESET_FIELDS,\r\n payload: {\r\n form,\r\n fields,\r\n }\r\n };\r\n },\r\n};\r\n\r\ntype ValueOf = T[keyof T];\r\nexport type KnownFormActions = ReturnType>;\r\n","import {\n INonStandardComponent,\n ISelectedProduct,\n IProjectProduct,\n} from '../calculation/CalculationModels';\nimport { ICompany, IUser } from '../auth/types';\n\n\n/** @see `DH.BlueKitConnect.Backend.Features.File.FileDto` */\nexport interface IFile {\n id: string;\n name: string;\n path: string;\n}\n\n/** @see `DH.BlueKitConnect.Backend.Features.Project.ProjectDto` */\nexport interface IProject {\n id: string;\n name: string;\n state: PROJECT_STATE;\n\n products: IProjectProduct[];\n formValues: IFormValue[];\n files: IFile[];\n\n createdAt: string; // datetime\n createdById: string; // uuid\n createdBy: IUser;\n\n lastReportingAt: string | null; // datetime\n\n owningCompanyId: number | null;\n owningCompany?: ICompany;\n}\n\n/** @see `DH.BlueKitConnect.Backend.Features.Project.EnrichedProjectDto` */\nexport interface IEnrichedProject extends IProject {\n owningCompany: ICompany;\n}\n\nexport interface IProjectForReporting {\n id: string;\n\n products: IProjectProduct[];\n formValues: IFormValue[];\n\n selectedProducts: ISelectedProduct[];\n selectedNonStandardComponents: INonStandardComponent[];\n selectedAIOBasicSet: ISelectedProduct;\n}\n\n/** @see `DH.BlueKitConnect.Backend.Features.Project.FormValueDto` */\nexport interface IFormValue {\n key: string;\n value: any;\n}\n\nexport enum PROJECT_STATE {\n NEW = 'NEW',\n DRAFT = 'DRAFT',\n SUBMITTED = 'SUBMITTED',\n COMPLETED = 'COMPLETED',\n ORDER_RECEIVED = 'ORDER_RECEIVED',\n OFFER_CREATED = 'OFFER_CREATED',\n MESSAGE_FROM_DH = 'MESSAGE_FROM_DH',\n}\n\nexport type IProjectSynopsis = Pick;\n\nexport type GetProjectsResponse = [IProjectSynopsis[], boolean];\n","// Select Lookups\nexport enum COUNTRY {\n DE = 'de',\n AT = 'at',\n};\n\nexport enum PROJECT_TYPE {\n NEWBUILDING = 'NEWBUILDING',\n MODERNIZED = 'MODERNIZED',\n}\n\nexport enum BUILDING_TYPE {\n RESIDENTIAL = 'RESIDENTAL', // @TODO: Fix this type EVERYWHERE(!)\n INDUSTRY = 'INDUSTRY',\n HEALTHCARE = 'HEALTHCARE',\n OFFICE = 'OFFICE',\n};\n\nexport enum INSTALLATION_POSITION {\n VERTICAL = 'V',\n HORIZONTAL = 'H',\n}\n\nexport enum MACHINE_ROOM {\n UP = 'up',\n DOWN = 'down',\n NO = 'no',\n};\n\nexport enum SYSTEM {\n L_AIO = \"L-AIO\",\n AIO_BASIC = \"AIO-Basic\"\n}\n\nexport enum SMOKE_DETECTION {\n NONE = 'NONE',\n POINTDETECTOR = 'POINTDETECTOR',\n SDLF1 = 'SDLF1',\n RAS = 'RAS'\n};\n\nexport enum LIFT_STATUS_DETECTION {\n LST_CO2_V3 = 'LST-CO2-V3',\n FAULTALARMCONTACT = 'FAULTALARMCONTACT',\n};\n\n/*\n// This enum was present in the backend's BaseData, but unused\nexport enum LIFT_FAULT {\n EMERGENCYBUTTON = 'EMERGENCYBUTTON', // Notruftaste\n PIRCABIN = 'PIRCABIN', // PIR Kabine\n TOBEDETERMINED = 'TOBEDETERMINED', // noch festzulegen\n};\n*/\n\nexport enum REQUEST_TYPE {\n QUESTION = 'QUESTION',\n ORDER = 'ORDER',\n OFFER = 'OFFER',\n OTHER = 'OTHER',\n}\n\nexport enum LIFT_AREA_PERCENTAGE {\n _2_5_PERCENT = '2_5_PERCENT',\n _1_0_PERCENT = '1_0_PERCENT',\n MANUAL = 'MANUAL',\n}\n","/** @see `DH.BlueKitConnect.Product.ProductTypeIds` */\nexport enum PRODUCT_TYPE {\n ACCESSORIES = 'ACCESSORIES',\n CABLING = 'CABLING',\n CALIPER = 'CALIPER',\n CENTRALUNIT = 'CENTRALUNIT',\n LST = 'LST',\n NRWG = 'NRWG',\n POINTDETECTOR = 'POINTDETECTOR',\n SDLF1 = 'SDLF1',\n SMOKEASPIRATION = 'SMOKEASPIRATION',\n WEATHERPROTECTION = 'WEATHERPROTECTION',\n\n /** @deprecated Products replaced by SDLF1 */\n LIFTBEAM = 'LIFTBEAM',\n /** @deprecated Products retired */\n AIOBSET = 'AIOBSET',\n}\n\n/** @see `DH.BlueKitConnect.Product.ProductGroupIds` */\nexport enum PRODUCT_GROUP {\n ASSEMMATERIAL = 'ASSEMMATERIAL',\n BKSYSCTRL = 'BKSYSCTRL',\n BRACKET = 'BRACKET',\n CABLINGCOMP = 'CABLINGCOMP',\n DACHHAU = 'DACHHAU',\n JK180 = 'JK180',\n JK180DB = 'JK180DB',\n JK190 = 'JK190',\n JK190DB = 'JK190DB',\n NKSL = 'NKSL',\n LAMHAU = 'LAMHAU',\n NONSTANDARDCOMPONENTS = 'NONSTANDARDCOMPONENTS',\n SETAIOB = 'SETAIOB',\n SLIDEFLAP = 'SLIDEFLAP',\n POINTDETECTOR = 'POINTDETECTOR',\n SDLF1 = 'SDLF1',\n LIFTBEAM = 'LIFTBEAM',\n RAS = 'RAS',\n SMOKEDECTCOMP = 'SMOKEDECTCOMP',\n THERMOFLAP = 'THERMOFLAP',\n THERMOS9 = 'THERMOS9',\n THERMOTAIRMO = 'THERMOTAIRMO',\n VENTTRIGGER = 'VENTTRIGGER',\n LST = 'LST',\n ALAS = 'ALAS',\n}\n\n/** @see `DH.BlueKitConnect.Product.ProductCategoryIds` */\nexport enum PRODUCT_CATEGORY {\n ASSEMMATERIAL = 'ASSEMMATERIAL',\n BKSYSCTRL = 'BKSYSCTRL',\n CABLINGCOMP = 'CABLINGCOMP',\n NONSTANDARDCOMPONENTS = 'NONSTANDARDCOMPONENTS',\n SETAIOB = 'SETAIOB',\n SMOKEDECTCOMP = 'SMOKEDECTCOMP',\n VENTCOMP = 'VENTCOMP',\n VENTCTRLCOMP = 'VENTCTRLCOMP',\n}\n\n// Product Keys\nexport enum SET_PRODUCT_KEY {\n PD_12 = \"AIO-BASIC-PD-12-SET\",\n PD_24 = \"AIO-BASIC-PD-24-SET\",\n PD_36 = \"AIO-BASIC-PD-36-SET\",\n PD_48 = \"AIO-BASIC-PD-48-SET\",\n SDLF_50 = \"AIO-BASIC-SD-L-F1-50-SET\",\n SDLF_100 = \"AIO-BASIC-SD-L-F1-100-SET\"\n}\n\nexport enum PRODUCT_KEY {\n\n // Central Unit\n BK_AIO_CENTRAL_UNIT = 'bk-aio-centralUnit',\n AIO_BASIC_CENTRAL_UNIT = 'aio-basic-centralUnit',\n\n // Cables\n CABLE_12_M = 'cable12m',\n CABLE_4_M = 'cable4m',\n CABLE_6_M = 'cable6m',\n\n // Smoke Detectors\n PD_RJ_AIO_END = 'PD-RJ-AIO-End',\n PD_RJ_AIO_PG = 'PD-RJ-AIO-P&G',\n MAIN_LEVEL_SMOKE_DETECTOR = 'mainLevelSmokeDetector',\n RAUCHMELDER_MASCHINENRAUM = 'Rauchmelder-Maschinenraum',\n\n // LST\n LST_CO2_V3_AB = 'lst-co2-v3-ab',\n REPEATER_CONNECT_MODULE = 'repeaterConnectModule',\n REPEATER_END_MODULE = 'repeaterEndModule',\n\n // SD-L-F1\n SD_L_F_1_RJ_AIO_50_END = 'SD-L-F1-RJ-AIO-50-End',\n SD_L_F_1_RJ_AIO_120_END = 'SD-L-F1-RJ-AIO-120-End',\n\n // RAS\n RJ_RAS_MICROS_SENS_42_M = 'RJ-RAS-Micros-Sens-42m',\n RJ_RAS_PRO_SENS_200_M = 'RJ-RAS-Pro-Sens-200m',\n RJ_RAS_ACCESSORIES = 'RJ-RAS-Accessories',\n FILTER_RJ_FEIN_RAS = 'Filter-RJ-Fein-RAS',\n\n // Smoke Switches\n RT_45_LRJ = 'rt-45l-rj',\n RT_45_RJ = 'rt-45-rj',\n\n // Accessories and misc.\n ADDITIONAL_THERMOSTAT = 'additionalThermostat',\n SIREN_WITH_KEY_SWITCH = 'sirenWithKeySwitch',\n VENTILATION_TIMER = 'ventilationTimer',\n HUMIDITY_SENSOR = 'humiditySensor',\n KEY_SWITCH_LED = 'keySwitchLED',\n SMOKE_TEST_SPRAY = 'SmokeTestSpray',\n BATTERY_PACK = 'batteryPack',\n eightPinInterfaceAdapterSet = '8pol-interface-adapter-set',\n RJ_45_SPLITTER = 'rj-45-splitter',\n FM_2_M = 'fm-2m',\n ASSEMBLY_SET_BLUE_KIT_LAIO = 'AssemblySetBlueKitLAIO',\n}\n\nexport enum CHARACTERISTIC_KEY {\n HORIZONTAL_INSTALLATION = \"HORIZONTAL_INSTALLATION\",\n VERTICAL_INSTALLATION = \"VERTICAL_INSTALLATION\",\n\n NEWBUILDING_INSTALLATION = \"NEWBUILDING_INSTALLATION\",\n MODERNIZED_INSTALLATION = \"MODERNIZED_INSTALLATION\",\n\n WEATHERPROTECTION_BUILTIN = \"WEATHERPROTECTION_BUILTIN\",\n WEATHERPROTECTION_COMPATIBLE = \"WEATHERPROTECTION_COMPATIBLE\",\n\n LOWENERGY = \"LOWENERGY\",\n abZ = \"abZ\",\n QUIET = \"QUIET\",\n\n FLUSH_MOUNTING = \"FLUSH_MOUNTING\",\n SURFACE_MOUNTING = \"SURFACE_MOUNTING\",\n\n WITH_SPRING_RETURN = \"WITH_SPRING_RETURN\",\n};\n","import { BUILDING_TYPE, COUNTRY, INSTALLATION_POSITION, LIFT_AREA_PERCENTAGE, LIFT_STATUS_DETECTION, MACHINE_ROOM, PROJECT_TYPE, SMOKE_DETECTION, SYSTEM } from '../../project/lookup';\nimport { PROJECT_STATE } from '../../project/types';\n\n\nexport class BasicInputsFormModel {\n // AIO-Basic-Set\n /** AIO-Basic-Set: The selected set */\n aioBasicSet: string = null;\n /** AIO-Basic-Set Only: Number of 8-pin interface adapter selected */\n noOfInterfaceAdapters: number = null\n\n // Project & Building Information\n /**\n * Name of the project\n * NOTE: informational only, not used in business logic\n */\n projectName: string = null;\n /** Country of the building */\n country: COUNTRY | string = null;\n /**\n * Location of the building (post code)\n * NOTE: informational only, not used in business logic (except as default value for montageBuildingLocation)\n */\n buildingLocation: string = null;\n /** Usage type of the building */\n buildingType: BUILDING_TYPE = null;\n /** Project type (new construction or modernization) */\n projectType: PROJECT_TYPE = null;\n /** Planned date of project implementation */\n plannedImplementationDate: string = null;\n\n // Requirements\n /** Required installation position of vent (horizontal or vertical) */\n installationPosition: INSTALLATION_POSITION = null;\n /** Whether an NRWG is already installed */\n nrwgDelivered: boolean = false;\n /** Wheter a weather shelter element is required */\n weathershelter: boolean = false;\n /** Whether low energy consumption is required */\n lowEnergyStandard: boolean = false;\n /** Wheter abZ certification is required */\n abzRequired: boolean = false;\n /** Whether a quiet operation is required */\n quiet: boolean = false;\n /** Whether integration with a building or fire management system is required */\n systemIntegration: boolean = false;\n /** Whether an additional smoke detector at the shaft head is required */\n additionalSmokeDetector: boolean = false;\n /** Whether a smoke detector on the main evacuation level is required */\n mainLevelSmokeDetector: boolean = false;\n\n // Elevator Details\n /** Presence and position of machine room */\n machineRoom: MACHINE_ROOM = null;\n /** Number of elevators in the shaft */\n noOfElevators: number = null;\n /** Elevator shaft height in mm (integer) */\n shaftHeight: number = null;\n /** Elevator shaft width in mm (integer) */\n shaftWidth: number = null;\n /** Elevator shaft depth in mm (integer) */\n shaftDepth: number = null;\n /**\n * Elevator's maximum payload in kg\n * NOTE: informational only, not used in business logic\n */\n payload: number = null;\n /**\n * Elevator's serial number\n * NOTE: informational only, not used in business logic\n */\n liftNumber: string = null;\n\n // Ventilation Area\n\n /** The required ventilation area in mm^2 (integer)\n * @note either manually entered or calculated\n * @see `CalculationService/LiftArea:getTotalLiftArea()`\n */\n calculatedVentilationArea: number = null;\n /** The calculation mode for lift area */\n liftAreaPercentage: LIFT_AREA_PERCENTAGE = null;\n}\n\nexport class ConfigurationInputsFormModel {\n // Core Components\n /** The selected smoke detection method */\n smokeDetection: SMOKE_DETECTION = null;\n /** The selected system */\n system: SYSTEM = null;\n /** The selected lift status detection method */\n liftStatusDetection: LIFT_STATUS_DETECTION = null;\n\n // Calipers\n /** The number of required RT-45L-RJ (caliper with ventilation buttons) */\n 'rt-45l-rj': number = 0;\n /** The number of required RT-45-RJ (caliper) */\n 'rt-45-rj': number = 0;\n /** The number of required RJ-45 Splitters */\n 'rj-45-splitter': number = 0;\n\n // Add-on Accessories\n /** The number of required vent control key switches */\n keySwitchLED: number = 0;\n /** Whether a timer module is required */\n ventilationTimer: boolean = false;\n /** Whether a thermostat module is required */\n additionalThermostat: boolean = false;\n /** Whether a humidity sensor is required */\n humiditySensor: boolean = false;\n /** Whether a siren is required */\n sirenWithKeySwitch: boolean = false;\n /** Whether an extra 8-pin interface adapter set is required */\n eightPinInterfaceAdapterSet: boolean = false;\n}\n\nexport class VentilationComponentsFormModel {\n includeEinbauwinkel: boolean = false;\n}\n\nexport class CostCalculationFormModel {\n // Montage / Installation\n /** Whether montage should be included */\n montageIncluded: boolean = false;\n /** The location of montage */\n montageBuildingLocation: string = null;\n\n // Custom Cable Quantities\n 'rj-45-chf-a-4m-custom': number = undefined;\n 'rj-45-chf-a-6m-custom': number = undefined;\n 'rj-45-chf-a-12m-custom': number = undefined;\n 'fm-2m-custom': number = undefined;\n\n // Communication\n requestType: string = null;\n remarks: string = null;\n projectState: string = PROJECT_STATE.NEW;\n orderNumber: string = null;\n offerNumber: string = null;\n}\n\nexport const defaultFormValues = {\n basicInputsForm: {\n values: new BasicInputsFormModel(),\n hasErrors: false\n },\n configurationInputsForm: {\n values: new ConfigurationInputsFormModel(),\n hasErrors: false\n },\n ventilationComponentsForm: {\n values: new VentilationComponentsFormModel(),\n hasErrors: false\n },\n costCalculationForm: {\n values: new CostCalculationFormModel(),\n hasErrors: false\n }\n};\n","import { IProductData } from \"../product/types\";\r\n\r\nimport { ICalculationFormsState, INonStandardComponent } from './CalculationModels';\r\n\r\n\r\nexport enum CalculationActionTypes {\r\n REDUX_FORM_CHANGE = '@@redux-form/CHANGE',\r\n REDUX_FORM_BLUR = '@@redux-form/BLUR',\r\n\r\n SWITCH_TAB = 'SWITCH_TAB',\r\n SWITCH_TAB_INDEX = 'SWITCH_TAB_INDEX',\r\n REQUEST_SWITCH_TAB = 'REQUEST_SWITCH_TAB',\r\n REQUEST_SWITCH_TAB_INDEX = 'REQUEST_SWITCH_TAB_INDEX',\r\n\r\n INITIALIZE_FORM = 'INITIALIZE_FORM',\r\n\r\n PROCESS_FORM_VALUES = 'PROCESS_FORM_VALUES',\r\n\r\n SET_NON_STANDARD_COMPONENT_LIST = 'SET_NON_STANDARD_COMPONENT_LIST',\r\n ADD_NON_STANDARD_COMPONENT = 'ADD_NON_STANDARD_COMPONENT',\r\n REMOVE_NON_STANDARD_COMPONENT = 'REMOVE_NON_STANDARD_COMPONENT',\r\n\r\n IGNORE_AIO_BASIC_SETS = 'IGNORE_AIO_BASIC_SETS',\r\n SET_AIO_BASIC_SET_MODAL_VISIBILITY = 'SET_AIO_BASIC_SET_MODAL_VISIBILITY',\r\n}\r\n\r\n\r\nexport const calculationActionCreator = {\r\n\r\n processFormValues(formValues: ICalculationFormsState, productData: IProductData) {\r\n return {\r\n type: CalculationActionTypes.PROCESS_FORM_VALUES,\r\n payload: formValues,\r\n extraProductData: productData,\r\n };\r\n },\r\n\r\n initializeForm(formValues: ICalculationFormsState, productData: IProductData) {\r\n return {\r\n type: CalculationActionTypes.INITIALIZE_FORM,\r\n formValues: formValues,\r\n productData: productData,\r\n };\r\n },\r\n\r\n switchTab(direction: string) {\r\n return {\r\n type: CalculationActionTypes.SWITCH_TAB,\r\n payload: direction\r\n };\r\n },\r\n\r\n requestSwitchTab(direction: string) {\r\n return {\r\n type: CalculationActionTypes.REQUEST_SWITCH_TAB,\r\n payload: direction\r\n };\r\n },\r\n\r\n switchTabIndex(index: number) {\r\n return {\r\n type: CalculationActionTypes.SWITCH_TAB_INDEX,\r\n payload: index\r\n };\r\n },\r\n\r\n requestSwitchTabIndex(index: number) {\r\n return {\r\n type: CalculationActionTypes.REQUEST_SWITCH_TAB_INDEX,\r\n payload: index\r\n };\r\n },\r\n\r\n ignoreAIOBasicSets(ignore: boolean) {\r\n return {\r\n type: CalculationActionTypes.IGNORE_AIO_BASIC_SETS,\r\n payload: ignore\r\n };\r\n },\r\n\r\n setAIOBasicSetModalVisibility(isOpen: boolean) {\r\n return {\r\n type: CalculationActionTypes.SET_AIO_BASIC_SET_MODAL_VISIBILITY,\r\n payload: isOpen\r\n };\r\n },\r\n\r\n /// Non-Standard Component List\r\n\r\n /** Replace the entire non-standard component list */\r\n setNonStandardComponentList(components: INonStandardComponent[]) {\r\n return {\r\n type: CalculationActionTypes.SET_NON_STANDARD_COMPONENT_LIST,\r\n payload: components,\r\n };\r\n },\r\n\r\n /** Add a non-standard component to the list */\r\n addNonStandardComponent(description: string, price: number, quantity: number) {\r\n return {\r\n type: CalculationActionTypes.ADD_NON_STANDARD_COMPONENT,\r\n payload: {\r\n description,\r\n price,\r\n quantity,\r\n }\r\n };\r\n },\r\n\r\n\r\n /** Remove a non-standard component from the list by its unique `productId` */\r\n removeNonStandardComponent(productId: string) {\r\n return {\r\n type: CalculationActionTypes.REMOVE_NON_STANDARD_COMPONENT,\r\n payload: productId\r\n };\r\n },\r\n}\r\n\r\ntype ValueOf = T[keyof T];\r\nexport type KnownCalculationActions = ReturnType>;\r\n","import {cloneDeep, orderBy} from \"lodash-es\";\n\n\nimport {CHARACTERISTIC_KEY, PRODUCT_CATEGORY, PRODUCT_GROUP, PRODUCT_TYPE} from '../product/lookup';\nimport { ICharacteristic, IProduct, IProductGroup } from \"../product/types\";\nimport {IFormValue} from \"../project/types\";\n\nimport {\n ICalculationFormsState,\n IProjectProduct\n} from \"./CalculationModels\";\nimport {\n BasicInputsFormModel,\n ConfigurationInputsFormModel, \n VentilationComponentsFormModel,\n CostCalculationFormModel,\n defaultFormValues\n} from \"./models/FormModels\";\nimport { ICalculationState } from \"./CalculationReducer\";\n\n\n// Product Data Lookups\n\nexport function getProductById(productsData: readonly IProduct[], productId: string|null): IProduct|null {\n return productId === null ? null : productsData.find(p => p.id === productId);\n}\n\nexport function getProductByKey(productsData: readonly IProduct[], key: string): IProduct|null {\n return productsData.find(x => x.productKey === key);\n}\n\n// Predicates for Array.prototype.filter\n\nfunction getIdFromGroupOrId>(g: T|PRODUCT_GROUP): PRODUCT_GROUP {\n return typeof g === 'object' && Object.prototype.hasOwnProperty.call(g, 'id')\n ? (g as T).id\n : (g as PRODUCT_GROUP)\n}\n\nexport function filterProductsByVentilationArea(minArea: number, maxArea: number|null = null, includeNull: boolean = false) {\n return >(product: T) =>\n (includeNull && product.ventilationArea === null) || (\n product.ventilationArea >= minArea &&\n (maxArea === null || product.ventilationArea < maxArea)\n )\n}\n\nexport function filterProductsByTypes(types: PRODUCT_TYPE[], not: boolean = false) {\n return >(product: T) => not !== types.includes(product.productTypeId);\n}\n\nexport function filterProductsByGroups(groups: (IProductGroup | PRODUCT_GROUP)[], not: boolean = false) {\n const groupIds = groups.map(getIdFromGroupOrId);\n\n return >(product: T) => not !== groupIds.includes(product.productGroupId)\n}\n\nexport function filterProductsByCategories(categories: readonly PRODUCT_CATEGORY[], productGroupsData: readonly IProductGroup[], not: boolean = false) {\n const groups = productGroupsData.filter(filterProductGroupsByCategories(categories))\n return filterProductsByGroups(groups, not);\n}\n\nexport function filterProductsByCharacteristicsAny(characteristics: readonly CHARACTERISTIC_KEY[], characteristicsData: readonly ICharacteristic[], not: boolean = false) {\n return filterProductsByGroups(\n characteristicsData.filter(filterCharacteristicsByKeys(characteristics)).map(c => c.productGroupId),\n not\n );\n}\n\nexport function filterProductsByCharacteristicsAll(characteristics: readonly CHARACTERISTIC_KEY[], characteristicsData: readonly ICharacteristic[], not: boolean = false) {\n const predicates = characteristics.map(c => filterProductsByCharacteristicsAny([c], characteristicsData));\n return >(p: T) => not !== predicates.every(pred => pred(p))\n}\n\nfunction filterProductGroupsByCategories(categories: readonly PRODUCT_CATEGORY[], not: boolean = false) {\n return >(g: T) => not !== categories.includes(g.productCategoryId);\n}\n\nexport function filterProductGroupsByCharacteristicsAll(characteristics: readonly CHARACTERISTIC_KEY[], characteristicsData: readonly ICharacteristic[], not: boolean = false) {\n const groupIds = characteristicsData\n .filter(filterCharacteristicsByKeys(characteristics))\n .map(c => c.productGroupId);\n\n return >(g: T|PRODUCT_GROUP) => not !== groupIds.includes(getIdFromGroupOrId(g));\n}\n\nexport function filterCharacteristicsByKeys(keys: readonly CHARACTERISTIC_KEY[], not: boolean = false) {\n return (c: ICharacteristic) => not !== keys.includes(c.characteristicKey);\n}\n\n// -----\n// FormValues\nexport function getFormValues(formValues: IFormValue[]): ICalculationFormsState {\n const forms: ICalculationFormsState = cloneDeep(defaultFormValues);\n\n setFormValuesFromArray(new BasicInputsFormModel(), formValues, forms, forms.basicInputsForm.values);\n setFormValuesFromArray(new ConfigurationInputsFormModel(), formValues, forms, forms.configurationInputsForm.values);\n setFormValuesFromArray(new VentilationComponentsFormModel(), formValues, forms, forms.ventilationComponentsForm.values);\n setFormValuesFromArray(new CostCalculationFormModel(), formValues, forms, forms.costCalculationForm.values);\n\n return forms;\n}\n\nfunction setFormValuesFromArray(formModel: any, formValues: readonly IFormValue[], forms: ICalculationFormsState, targetFormModel: any) {\n Object.keys(formModel).forEach((key) => {\n const formValue = formValues.find(f => f.key === key);\n if (formValue) {\n targetFormModel[key] = formValue.value;\n }\n });\n}\n\nexport function getFormValuesDictionaryFromForms(form: ICalculationFormsState): IFormValue[] {\n if (!form) {\n return [];\n }\n\n const formValues = {\n ...form.basicInputsForm?.values,\n ...form.configurationInputsForm?.values,\n ...form.ventilationComponentsForm?.values,\n ...form.costCalculationForm?.values\n };\n\n let kvps = Object.keys(formValues).map(key => {\n return {\n key,\n value: formValues[key],\n };\n });\n\n // Filter out undefined values\n kvps = kvps.filter(formValue => formValue.value !== undefined);\n\n return kvps;\n}\n\n\n// -----\n// Recommendation\nexport function getRecommendedProductId(\n ventComponents: readonly IProduct[],\n productGroupsData: readonly IProductGroup[]\n): IProduct['id'] | null {\n const groups = productGroupsData.filter(\n g => !!ventComponents.find(vc => vc.productGroupId === g.id) && g.recommendationOrder2 > 0\n );\n\n if (groups?.length === 0) return null;\n\n const recommendedGroupId = orderBy(groups, 'recommendationOrder2', 'asc')[0].id;\n const sortedComponents = orderBy(\n ventComponents.filter(x => x.productGroupId === recommendedGroupId),\n ['width', 'height'],\n ['asc', 'asc']\n );\n\n return sortedComponents?.length > 0 ? sortedComponents[0].id : null;\n}\n\n\n// -----\n\nexport function getProjectProductsFromForms(\n form: Readonly,\n loadedProjectId: string,\n calculationState: Readonly\n): IProjectProduct[] {\n\n const ventComp = form.ventilationComponentsForm.values;\n const filteredVentilationComponentsKeys = Object.keys(ventComp).filter(x => x.startsWith('quantity-'));\n\n const ventilationComponents = filteredVentilationComponentsKeys.map((key: string) => ({\n productId: key.replace('quantity-', ''),\n quantity: ventComp[key],\n projectId: loadedProjectId,\n productCategoryId: PRODUCT_CATEGORY.VENTCOMP\n }));\n\n const nonStandardComponents = calculationState.nonStandardComponents.map(x => ({\n productId: x.productId,\n description: x.description,\n quantity: x.quantity,\n price: x.price,\n projectId: loadedProjectId,\n productCategoryId: PRODUCT_CATEGORY.NONSTANDARDCOMPONENTS\n }));\n\n return ventilationComponents.concat(nonStandardComponents);\n}\n","export const calculationTabs = [\r\n 'basic-input',\r\n 'configuration',\r\n 'ventilation-components',\r\n 'cost-calculation',\r\n] as const;\r\n// eslint-disable-next-line @typescript-eslint/no-redeclare\r\nexport type calculationTabs = typeof calculationTabs[number];\r\n\r\nexport function isCalculationTab(v: unknown): v is calculationTabs {\r\n return typeof v === 'string' && calculationTabs.includes(v as any);\r\n}\r\n\r\n\r\ninterface IActionDef {\r\n meta: T;\r\n payload?: P;\r\n}\r\n\r\nexport const createAction = (prefix: string, def: IActionDef) => {\r\n return {\r\n ...def,\r\n type: `${prefix}/${def.meta}`,\r\n };\r\n};\r\n","import { Config, configProvider } from \"../../configProvider\";\n\nfunction getE2EToken(): string | null {\n return localStorage.getItem(\"e2e_idtoken\");\n}\n\nlet preemptiveRefresh: Promise|null = null;\nfunction getPreemptiveRefresh(kc: Keycloak.KeycloakInstance): Promise {\n if (!preemptiveRefresh) {\n preemptiveRefresh = kc.updateToken(20)\n .then(() => { /* Swallow return value */})\n .catch(() => {\n console.error('[AuthService] getPreemptiveRefresh() failed');\n })\n .finally(() => {\n preemptiveRefresh = null; // Clear the singleton\n });\n }\n\n return preemptiveRefresh;\n}\n\nfunction makeAuthTokenContext(config: Config): AuthTokenContext {\n return {\n async getToken(): Promise {\n if (config.enableE2EToken) {\n const token = getE2EToken();\n if (token) {\n return token;\n }\n }\n\n if (!config.disableKeyCloak) {\n const kc = window.keyCloak;\n if (!kc) {\n throw new Error(\"KeyCloak not available!\");\n }\n\n // Fire off a preemtive token refresh, but don't await it yet\n const preemptiveRefresh = getPreemptiveRefresh(kc);\n\n const tokenIsExpired = kc.isTokenExpired(0);\n if (tokenIsExpired) {\n // Second chance: a succeful refresh\n await preemptiveRefresh;\n if (kc.isTokenExpired(0)) {\n // Token is expired and refresh failed\n // Discard the current page because the session is no longer authorized\n window.location.reload();\n return null;\n }\n }\n\n // We get here\n // (a) immediately if token is not expired, or\n // (b) after successfully awaiting a refresh\n return kc.token;\n }\n\n throw new Error(\"No token source available!\");\n },\n\n isTokenExpired(timeAhead: number): boolean {\n if (config.enableE2EToken) {\n const token = getE2EToken();\n if (token) {\n return false;\n }\n }\n\n if (!config.disableKeyCloak) {\n const kc = window.keyCloak;\n if (!kc) {\n return true;\n }\n\n return kc.isTokenExpired(timeAhead);\n }\n\n // No token source available\n return true;\n },\n };\n}\n\nexport interface AuthTokenContext {\n getToken: () => Promise;\n isTokenExpired: (minValiditySeconds: number) => boolean;\n}\n\n/** @deprecated Use `useAuthTokenContext()` hook instead */\nexport const authTokenContext = makeAuthTokenContext(configProvider);\n\nexport function useAuthTokenContext() {\n return authTokenContext;\n}\n","/** A base implementation for a client targeting JSON-based REST-ish APIs. */\nexport abstract class JsonRESTApiClient {\n /**\n * @param _baseUrl The URL prefix used by `_getUrl()`\n * @param _tokenGetter A function used by `_getHeaders()` that asynchronously returns a `Bearer` token for the `Authorization` HTTP Request Header\n */\n constructor(\n public readonly _baseUrl: string,\n private readonly _tokenGetter?: (() => Promise),\n ) {}\n\n /** Fetch a JSON value; extends the `fetch()` API.\n * @template T The result type\n * @param input Passed to `fetch()` as-is\n * @param init Passed to `fetch()` as-is\n * @param validator A function that receives the parsed JSON value and validates it to match the result type `T`\n * @returns a parsed JSON value of type `T`\n * @throws ApiFetchError if the internal `fetch()` call fails (network error, etc.)\n * @throws ApiStatusCodeError if the HTTP Status Code is not in the `2xx` range\n * @throws ApiSyntaxError if JSON parsing fails\n * @throws ApiInternalError if an internal call throws\n * @throws ApiValidationError if `validator` rejects the parsed JSON value\n */\n protected async _fetchJson(input: RequestInfo, init?: RequestInit, validator?: (v: unknown) => v is T): Promise {\n const response = await this._fetch(input, init);\n\n let result: any = undefined;\n try {\n result = await response.json();\n } catch (e /* : unknown */) {\n if (e instanceof SyntaxError) {\n throw new ApiSyntaxError(e);\n } else {\n // what/when could this happen?\n throw new ApiInternalError(e);\n }\n }\n\n if (validator) {\n try {\n if (!validator(result)) {\n throw new ApiValidationError(result);\n }\n } catch (e) {\n console.error(e);\n throw new ApiValidationError(result, e);\n }\n }\n\n return result;\n };\n\n /** Fetch something; extends the `fetch()` API.\n * @param input Passed to `fetch()` as-is\n * @param init Passed to `fetch()` as-is\n * @returns the result value of `fetch()` of type `Response`\n * @throws ApiFetchError if the internal `fetch()` call fails (network error, etc.)\n * @throws ApiStatusCodeError if the HTTP Status Code is not in the `2xx` range\n * */\n protected async _fetch(input: RequestInfo, init?: RequestInit) {\n let response: Response = undefined;\n try {\n response = await fetch(input, init);\n } catch (e /* : unknown */) {\n throw new ApiFetchError(e);\n }\n\n if (!response.ok) {\n throw new ApiStatusCodeError(response.status, response.statusText, response);\n }\n return response;\n }\n\n /** Gets a URL by joining the `parts` and (if present) attaching the URI-encoded `queryparams`\n * @param parts URL path parts that are joined together with \"/\"\n * @param queryparams An array of query parameter key-value pairs\n * @example _getUrl([\"a\", \"b\"], [[\"message\", \"Hello?\"], [\"l\", 5]]) produces \n * \"{_baseUrl}/a/b?message=Hello%3F&l=5\"\n */\n protected _getUrl(parts: string[] = [], queryparams: [string,string|number|boolean][] = []) {\n const suffix = parts.join('/'); \n const querystring = queryparams\n .map(([k,v]) => encodeURIComponent(k) + '=' + encodeURIComponent(v))\n .join('&');\n\n return this._baseUrl +\n `${suffix.length?'/':''}${suffix}` +\n `${querystring.length?'?':''}${querystring}`;\n }\n\n /** Get the common headers for requests:\n * - Content-Type: from `contentType` argument (default \"application/json\"), unset if passing `null`\n * - Authorization: constructed with the `_tokenGetter`\n * @param contentType The value of the \"Content-Type\" header\n * @returns An object of headers\n */\n protected async _getHeaders(contentType: string|null = 'application/json') {\n const headers: Record = {};\n\n if (!!contentType) {\n headers['Content-Type'] = contentType;\n }\n\n if (this._tokenGetter) {\n const token = await this._tokenGetter();\n if (!!token) {\n headers['Authorization'] = `Bearer ${token}`;\n }\n }\n\n return headers;\n }\n}\n\n/** Common base error type */\nabstract class ApiError extends Error {}\n\n/** Thrown if the internal `fetch()` call fails (network error, etc.) */\nexport class ApiFetchError extends ApiError {\n constructor(public readonly innerError: Error|unknown) {\n super(`ApiFetchError: ${innerError instanceof Error ? innerError.message : innerError}`);\n }\n}\n\n/** Thrown if the HTTP Status Code is not in the `2xx` range */\nexport class ApiStatusCodeError extends ApiError {\n constructor(public readonly status: number, public readonly statusText: string, public readonly body?: Body) {\n super(`ApiStatusCodeError: ${status} ${statusText}`);\n }\n}\n\n/** Thrown if parsing the response fails (i.e. if `Body.prototype.json()` throws `SyntaxError`) */\nexport class ApiSyntaxError extends ApiError {\n constructor(public readonly innerError: SyntaxError) {\n super(`ApiSyntaxError: ${innerError.message}`);\n }\n}\n\n/** Thrown if the response content validation fails */\nexport class ApiValidationError extends ApiError {\n constructor(public readonly value: any, public readonly error?: any) {\n super(`ApiValidationError: ${error ?? ''}`);\n }\n}\n\n/** Thrown if an internal call throws (from `fetch()` API) */\nexport class ApiInternalError extends ApiError {\n constructor(public readonly v: Error|unknown) {\n super(`ApiInternalError: ${v instanceof Error ? v.message : v}`);\n }\n}\n","/** This file is a library of simple validation functions for Javascript values, producing Typescript type hints.\n * \n * The origin of this library lies in the various API clients based on JsonRESTApiClient.\n * The included functions aid in the creation of functions suitable for\n * the `validator` argument of `protected JsonRESTApiClient._fetchJson()`.\n * \n * This uses zero dependencies outside of the Javascript `===` and `typeof` operators, and runtime functions:\n * - `Array.isArray`\n * - `Array.prototype.every`\n * - `Object.assign`\n * - `Object.entries`\n * - `Object.prototype.hasOwnProperty`\n */\n\ntype ValidatorFn = (value: unknown) => value is T;\nexport type SimpleValidator = ValidatorFn & { validatorName: string; nothrow: ValidatorFn; };\n\nexport class ValidationError extends Error {\n constructor(public readonly path: PropertyKey[], private readonly innerMessage?: string) { super(`${path?.join('.')}: ${innerMessage}`) }\n static fromNested(path: PropertyKey[], nested: Error) {\n return new ValidationError(\n [...(path ?? []), ...(nested instanceof ValidationError ? nested.path ?? [] : [])],\n (nested instanceof ValidationError ? nested.innerMessage : `${nested.name}: ${nested.message}`),\n );\n }\n}\n\n/** Add `validatorName` and `nothrow()` properties to a `ValidatorFn` */\nfunction enrichValidator(validatorName: string, validator: ValidatorFn): SimpleValidator {\n\n const wrapped: ValidatorFn = (value): value is T => {\n if (validator(value)) return true;\n else throw new ValidationError(null, validatorName);\n }\n\n const nothrow: ValidatorFn = (value): value is T => {\n try {\n return validator(value);\n } catch (e) {\n return false;\n }\n };\n\n return Object.assign(wrapped, { validatorName, nothrow });\n}\n\n/** Checks that `value` is an array and that every element passes validation by `elementValidator`\n * @example ```\n * const v: unknown = ...;\n * \n * if (isArrayOf(isNumber)(v)) {\n * // Typescript hint: v is number[]\n * }\n * ```\n */\nexport function isArrayOf(elementValidator: SimpleValidator): SimpleValidator {\n return enrichValidator(\"isArrayOf\", (value): value is T[] => Array.isArray(value) && value.every((element, idx) => {\n try {\n return elementValidator(element);\n } catch (e) {\n throw ValidationError.fromNested([idx], e);\n }\n }));\n}\n\n/** Checks that `value` is a tuple with elements matching the respective validators\n * @example ```\n * const v: unknown = ...;\n * \n * if (isTuple([isString, isNumber])(v)) {\n * // Typescript hint: v is [string, number]\n * }\n * ```\n */\nexport function isTuple(validators: { [K in keyof T]: SimpleValidator }): SimpleValidator<{ [K in keyof T]: T[K] }> {\n return enrichValidator(\"isTuple\", (value): value is { [K in keyof T]: T[K] } => Array.isArray(value) && value.length === validators.length && value.every((v, idx) => {\n try {\n return validators[idx](v);\n } catch (e) {\n throw ValidationError.fromNested([idx], e);\n }\n }));\n}\n\n/** Checks that `value` is an object and that it has all the properties on keys `keys`\n * @deprecated Prefer `isObjectWithShape` instead\n * @example ```\n * const v: unknown = ...;\n * \n * if (isObjectWithProperties('id', 'name')(v)) {\n * // Typescript hint: v is { id: any; name: any; }\n * }\n * ```\n */\nexport function isObjectWithProperties(...keys: KeysT[]): SimpleValidator<{ [x in KeysT]: any; }> {\n return enrichValidator(\"isObjectWithProperties\", (value): value is { [x in KeysT]: any; } => (\n !!value &&\n typeof value === 'object' &&\n keys.every(key => {\n try {\n return Object.prototype.hasOwnProperty.call(value, key);\n } catch (e) {\n throw ValidationError.fromNested([key], e);\n }\n })\n ));\n}\n\n/** Checks that `value` is an object with a properties matching the provided property validators\n * \n * @example ```\n * const v: unknown = ...;\n * \n * if (isObjectWithShape({ id: isNumber, name: isString })(v)) {\n * // Typescript hint: v is { id: number; name: string; }\n * }\n* ```\n */\nexport function isObjectWithShape(validators: { [x in keyof ShapeT]-?: SimpleValidator; }): SimpleValidator {\n return enrichValidator(\"isObjectWithShape\", (value: unknown): value is ShapeT => {\n if (isNoValue.nothrow(value) || typeof value !== 'object') return false;\n return Object.entries(validators).every(([key, validator]) => {\n let propertyValue = undefined;\n if (Object.prototype.hasOwnProperty.call(value, key)) propertyValue = value[key];\n try {\n return (validator as ValidatorFn)(propertyValue);\n } catch (e) {\n throw ValidationError.fromNested([key], e);\n }\n });\n });\n}\n\n/** Passes everything */\nexport const isUnknown = enrichValidator(\"isUnknown\", (value: unknown): value is unknown => true);\n\n/** Checks that `value` is either null or undefined */\nexport const isNoValue = enrichValidator(\"isNoValue\", (value: unknown): value is undefined|null => value === undefined || value === null);\n\nexport const isString = enrichValidator(\"isString\", (value: unknown): value is string => !isNoValue.nothrow(value) && typeof value === 'string');\nexport const isNumber = enrichValidator(\"isNumber\", (value: unknown): value is number => !isNoValue.nothrow(value) && typeof value === 'number');\nexport const isBoolean = enrichValidator(\"isBoolean\", (value: unknown): value is boolean => !isNoValue.nothrow(value) && typeof value === 'boolean');\n\nexport function isStringEnum(...values: ValuesT[]) : SimpleValidator {\n return enrichValidator(\"isStringEnum\", (value): value is ValuesT => isString(value) && values.includes(value as any));\n}\n\nexport function isOptional(validator: (e: unknown) => e is T): SimpleValidator {\n return enrichValidator(\"isOptional\", (value): value is T|null|undefined => isNoValue.nothrow(value) || validator(value));\n}\n\nexport function isEither(validator1: SimpleValidator, validator2: ValidatorFn): SimpleValidator {\n return enrichValidator(\"isEither\", (value): value is T1 | T2 => validator1.nothrow(value) || validator2(value));\n}\n\nexport function isBoth(validator1: ValidatorFn, validator2: ValidatorFn): SimpleValidator {\n return enrichValidator(\"isBoth\", (value): value is T1 & T2 => validator1(value) && validator2(value));\n}\n","import { SimpleValidator, isArrayOf, isNumber, isObjectWithShape, isString } from \"../api/simple-validators\";\n\nimport { ICompany, IUser } from \"./types\";\nimport { UserGroup } from \"./PermissionService\";\n\n\nexport const isICompany: SimpleValidator = isObjectWithShape({\n id: isNumber,\n name: isString,\n});\n\nexport const isIUser: SimpleValidator = isObjectWithShape({\n id: isString,\n firstName: isString,\n lastName: isString,\n email: isString,\n company: isICompany,\n country: isString,\n groups: isArrayOf(isString as SimpleValidator),\n});\n","import { JsonRESTApiClient } from '../api/JsonRESTApiClient';\n\nimport { GetProjectsResponse, IEnrichedProject, IProject } from './types';\nimport { isGetProjectsReponse, isIEnrichedProject } from './validators';\n\n\n/** @see `DH.BlueKitConnect.Backend.Features.Project.GetProjectsView` */\nexport enum GetProjectsView {\n ALL = 'all',\n OWN = 'own',\n OWN_COMPANY = 'own_company',\n}\n\n/** @see `DH.BlueKitConnect.Backend.Features.Project.ProjectApiV1Controller` */\nexport class ProjectApiV1Client extends JsonRESTApiClient {\n\n /// API Endpoints\n\n public async saveProject(project: IProject, sendMail: boolean = false): Promise {\n return await this._fetchJson(this._getUrl(), {\n method: 'POST',\n headers: await this._getHeaders(),\n body: JSON.stringify({\n ...project,\n sendMail,\n }),\n }, isIEnrichedProject);\n }\n\n /**\n * @note As of 2024-02-01, the backend still actually returns IEnrichedProject[],\n * but I want to narrow down the listing API's response interface to the essential project properties,\n * decoupling it from the shape of the individual IProject or IEnrichedProject.\n */\n public async getProjects(\n view: GetProjectsView,\n query: string|null = null,\n first: number = 0,\n count: number|null = null\n ): Promise {\n const queryParams: [string, string][] = [];\n\n queryParams.push(['view', String(view)]);\n\n query = query?.trim();\n if (typeof query === 'string' && query.length) {\n queryParams.push(['query', query]);\n }\n\n queryParams.push(['first', String(first)]);\n\n if (typeof count === 'number') {\n queryParams.push(['count', String(count)]);\n }\n\n return await this._fetchJson(this._getUrl([], queryParams), {\n method: 'GET',\n headers: await this._getHeaders(),\n }, isGetProjectsReponse);\n }\n\n public async deleteProjectById(id: IProject['id']): Promise {\n await this._fetchJson(this._getUrl([id]), {\n method: 'DELETE',\n headers: await this._getHeaders(),\n });\n }\n\n public async getProjectById(id: IProject['id']): Promise {\n return await this._fetchJson(this._getUrl([id]), {\n method: 'GET',\n headers: await this._getHeaders(),\n }, isIEnrichedProject);\n }\n\n}\n","import { isArrayOf, isBoolean, isBoth, isNumber, isObjectWithShape, isOptional, isString, isTuple, isUnknown, SimpleValidator } from \"../api/simple-validators\";\nimport { IUser } from \"../auth/types\";\nimport { isICompany, isIUser } from \"../auth/validators\";\nimport { IProjectProduct } from \"../calculation/CalculationModels\";\n\nimport { GetProjectsResponse, IEnrichedProject, IFile, IFormValue, IProject, IProjectSynopsis, PROJECT_STATE } from \"./types\";\n\n\nexport const isIProjectProduct: SimpleValidator = isObjectWithShape({\n projectId: isString,\n productId: isString,\n productCategoryId: isString,\n price: isOptional(isNumber),\n quantity: isNumber,\n description: isOptional(isString),\n});\n\nexport const isIFormValue: SimpleValidator = isObjectWithShape({\n key: isString,\n value: isUnknown,\n});\n\nexport const isIFile: SimpleValidator = isObjectWithShape({\n id: isString,\n name: isString,\n path: isString,\n});\n\nexport const isIProjectSynopsis: SimpleValidator = isObjectWithShape({\n id: isString,\n name: isString,\n state: isString as SimpleValidator,\n createdAt: isString,\n createdBy: isUnknown as SimpleValidator,\n owningCompany: isOptional(isICompany),\n});\n\nexport const isGetProjectsReponse: SimpleValidator = isTuple([\n isArrayOf(isIProjectSynopsis),\n isBoolean\n] as [SimpleValidator, SimpleValidator]);\n\nexport const isIProject: SimpleValidator = isBoth(isIProjectSynopsis, isObjectWithShape({\n createdById: isString,\n owningCompanyId: isNumber,\n lastReportingAt: isOptional(isString),\n\n products: isArrayOf(isIProjectProduct),\n formValues: isArrayOf(isIFormValue),\n files: isArrayOf(isIFile),\n}));\n\nexport const isIEnrichedProject: SimpleValidator = isBoth(isIProject, isObjectWithShape({\n owningCompany: isICompany,\n}));\n","/**\n * This file is in features/calculation instead of features/project\n * because it's legacy infrastructure only used by the legacy calculation feature.\n */\nimport { change } from \"redux-form\";\nimport { replace } from \"connected-react-router\";\nimport { all, call, put, select, takeLatest } from 'redux-saga/effects';\nimport autobind from \"autobind-decorator\";\n\nimport { configProvider } from \"../../configProvider\";\nimport { ReduxFormKeys } from \"../form/ReduxFormKeys\";\nimport { IApplicationState } from \"../../shared/ApplicationState\";\nimport { IFormErrorDict } from \"../../shared/components/error-list\";\n\nimport { IProject, PROJECT_STATE } from \"../project/types\";\n\nimport { LIFT_STATUS_DETECTION } from '../project/lookup';\nimport { PRODUCT_CATEGORY } from '../product/lookup';\nimport { IProductData } from \"../product/types\";\nimport { ICalculationFormsState, INonStandardComponent } from \"./CalculationModels\";\nimport { BasicInputsFormModel, ConfigurationInputsFormModel, VentilationComponentsFormModel, CostCalculationFormModel } from './models/FormModels';\nimport {\n getFormValues,\n getFormValuesDictionaryFromForms,\n getProjectProductsFromForms,\n} from \"./CalculationService\";\nimport { calculationActionCreator } from \"./CalculationActions\";\nimport { calculationTabs, createAction } from \"./constant\";\n\nimport { authTokenContext } from \"../auth/AuthService\";\n\nimport { ProjectApiV1Client } from \"../project/ProjectApiV1Client\";\nimport { ProductApiV1Client } from \"../product/ProductApiV1Client\";\n\n\nexport const getLocation = (state: any) => state.router.location.pathname;\nexport const getActiveTabIndex = (state) => state.calculationState.activeTabIndex;\n\nexport interface IProjectApiState {\n entity: IProject;\n productData: IProductData;\n productDataCompanyId: number;\n error?: Error|null;\n loading: boolean;\n\n isUpdating: boolean;\n validationErrorList: IFormErrorDict;\n}\n\nconst initialState: IProjectApiState = {\n entity: null,\n productData: null,\n productDataCompanyId: null,\n error: null,\n loading: false,\n\n isUpdating: false,\n validationErrorList: {},\n};\n\nenum ProjectActionTypes {\n GET_REQUEST = 'GET_REQUEST',\n GET_SUCCESS = 'GET_SUCCESS',\n GET_ERROR = 'GET_ERROR',\n\n MAKE_PROJECT = 'MAKE_PROJECT',\n MAKE_PROJECT_INJECT_PRODUCT_DATA = 'MAKE_PROJECT_INJECT_PRODUCT_DATA', // Internal, used my MAKE_PROJECT to inject sideloaded product data into state\n MAKE_PROJECT_SUCCESS = 'MAKE_PROJECT_SUCCESS',\n\n UPDATE_REQUEST = 'UPDATE_REQUEST',\n UPDATE_PENDING = 'UPDATE_PENDING',\n UPDATE_SUCCESS = 'UPDATE_SUCCESS',\n UPDATE_ERROR = 'UPDATE_ERROR',\n}\n\ninterface IActionCallback {\n success: () => void;\n error: (err: any) => void;\n}\n\n@autobind\nclass ProjectApiActionCreator {\n\n constructor(private prefix: string) {\n }\n\n updateRequest(projectId: string, projectState?: PROJECT_STATE, sendMail?: boolean, callback?: IActionCallback) {\n return createAction(this.prefix, {\n meta: ProjectActionTypes.UPDATE_REQUEST,\n payload: {\n projectId,\n projectState,\n sendMail,\n callback,\n },\n });\n }\n\n updateSuccess(project: IProject) {\n return createAction(this.prefix, {\n meta: ProjectActionTypes.UPDATE_SUCCESS,\n payload: project,\n });\n }\n\n updatePending(projectId: string) {\n return createAction(this.prefix, {\n meta: ProjectActionTypes.UPDATE_PENDING,\n payload: {\n projectId,\n },\n });\n }\n\n updateError(errorDict: IFormErrorDict) {\n return createAction(this.prefix, {\n meta: ProjectActionTypes.UPDATE_ERROR,\n payload: errorDict,\n });\n }\n\n getRequest(projectId: string, loadAsTemplate: boolean) {\n return createAction(this.prefix, {\n meta: ProjectActionTypes.GET_REQUEST,\n payload: {\n projectId,\n loadAsTemplate,\n },\n });\n }\n\n getSuccess(project: IProject, loadAsTemplate: boolean, productData: IProductData) {\n return createAction(this.prefix, {\n meta: ProjectActionTypes.GET_SUCCESS,\n payload: {\n project,\n loadAsTemplate,\n productData,\n }\n });\n }\n\n getError(error: Error) {\n return createAction(this.prefix, {\n meta: ProjectActionTypes.GET_ERROR,\n payload: error,\n });\n }\n\n makeProject(companyId: number) {\n return createAction(this.prefix, {\n meta: ProjectActionTypes.MAKE_PROJECT,\n payload: {\n companyId,\n },\n });\n }\n\n makeProjectInjectProductData(companyId: number, productData: IProductData) {\n return createAction(this.prefix, {\n meta: ProjectActionTypes.MAKE_PROJECT_INJECT_PRODUCT_DATA,\n payload: {\n companyId,\n productData,\n },\n });\n }\n\n makeProjectSuccess() {\n return createAction(this.prefix, {\n meta: ProjectActionTypes.MAKE_PROJECT_SUCCESS,\n });\n }\n}\n\nfunction makeNewFormValues() {\n return {\n basicInputsForm: {\n values: {\n ...new BasicInputsFormModel(),\n noOfElevators: 1,\n }\n },\n configurationInputsForm: {\n values: {\n ...new ConfigurationInputsFormModel(),\n liftStatusDetection: LIFT_STATUS_DETECTION.LST_CO2_V3,\n 'rt-45-rj': 1,\n }\n },\n ventilationComponentsForm: {\n values: new VentilationComponentsFormModel(),\n },\n costCalculationForm: {\n values: new CostCalculationFormModel(),\n }\n };\n}\n\nclass ProjectApi {\n private readonly projectApiClient: ProjectApiV1Client;\n private readonly productApiClient: ProductApiV1Client;\n\n constructor(\n private readonly APP_NAME: any,\n projectApiV1BaseUrl: string,\n productApiV1BaseUrl: string,\n getToken: () => Promise,\n ) {\n this.projectApiClient = new ProjectApiV1Client(projectApiV1BaseUrl, getToken);\n this.productApiClient = new ProductApiV1Client(productApiV1BaseUrl, getToken);\n }\n\n @autobind\n reducer(state = initialState, action: KnownProjectApiActions): IProjectApiState {\n if (action.type.startsWith(this.APP_NAME + \"/\")) {\n switch (action.meta) {\n case ProjectActionTypes.GET_ERROR: {\n return {\n ...state,\n error: action.payload,\n loading: false,\n };\n }\n case ProjectActionTypes.GET_SUCCESS: {\n const {project, loadAsTemplate, productData} = action.payload;\n\n if (loadAsTemplate) {\n project.id = null;\n project.state = PROJECT_STATE.NEW;\n }\n\n return {\n ...state,\n entity: project,\n productData,\n productDataCompanyId: project.owningCompanyId,\n error: null,\n loading: false,\n };\n }\n case ProjectActionTypes.MAKE_PROJECT: {\n return {\n ...initialState, // Reset the entity to prevent leakage of old state\n loading: true,\n };\n }\n case ProjectActionTypes.MAKE_PROJECT_INJECT_PRODUCT_DATA: {\n const { productData, companyId } = action.payload;\n return {\n ...state,\n productData,\n productDataCompanyId: companyId,\n };\n }\n case ProjectActionTypes.MAKE_PROJECT_SUCCESS: {\n return {\n ...state,\n loading: false,\n error: null,\n }\n }\n case ProjectActionTypes.UPDATE_PENDING: {\n return {\n ...state,\n isUpdating: true,\n };\n }\n case ProjectActionTypes.UPDATE_SUCCESS: {\n return {\n ...state,\n entity: action.payload,\n isUpdating: false,\n };\n }\n case ProjectActionTypes.UPDATE_ERROR: {\n return {\n ...state,\n validationErrorList: action.payload,\n isUpdating: false,\n };\n }\n default:\n return state;\n }\n }\n return state;\n }\n\n @autobind\n * get(action: ReturnType) {\n try {\n // Get the project and the product data for its owning company\n const project: IProject = yield call([this.projectApiClient, this.projectApiClient.getProjectById], action.payload.projectId);\n const productData: IProductData = yield call([this.productApiClient, this.productApiClient.getProductData], project.owningCompanyId);\n\n // Update state with success\n yield put(projectApiActionCreator.getSuccess(project, action.payload.loadAsTemplate, productData));\n\n // Restore non-standard-components list from products in PRODUCT_CATEGORY.NONSTANDARDCOMPONENTS\n const nonStandardComponentList = project.products\n .filter(x => x.productCategoryId === PRODUCT_CATEGORY.NONSTANDARDCOMPONENTS) as INonStandardComponent[];\n yield put(calculationActionCreator.setNonStandardComponentList(nonStandardComponentList));\n\n // Create form state objects from project\n const forms: ICalculationFormsState = getFormValues(project.formValues);\n\n // Set form values for quantities for products in PRODUCT_CATEGORY.VENTCOMP\n project.products.filter(x => x.productCategoryId === PRODUCT_CATEGORY.VENTCOMP).map(x =>\n forms.ventilationComponentsForm.values['quantity-' + x.productId] = x.quantity\n );\n\n // projectState is treated like a form value, but project.state is the canonical source of truth\n forms.costCalculationForm.values.projectState = project.state;\n\n // Initialize the forms\n yield put(calculationActionCreator.initializeForm(forms, productData));\n } catch (err) {\n yield put(projectApiActionCreator.getError(err));\n console.error(err);\n }\n }\n\n @autobind\n * makeProject(action: ReturnType) {\n const { companyId } = action.payload;\n try {\n const productData: IProductData = yield call([this.productApiClient, this.productApiClient.getProductData], companyId);\n yield put(projectApiActionCreator.makeProjectInjectProductData(companyId, productData));\n \n const forms = makeNewFormValues();\n yield put(calculationActionCreator.initializeForm(forms, productData));\n\n yield put(projectApiActionCreator.makeProjectSuccess());\n\n } catch (err) {\n yield put(projectApiActionCreator.getError(err));\n console.error(err);\n }\n }\n\n @autobind\n * update(action: ReturnType) {\n const state = yield select();\n\n const {projectId, projectState, sendMail} = action.payload;\n\n yield put(projectApiActionCreator.updatePending(projectId));\n\n try {\n\n const requestObj: IProject = {\n id: projectId,\n products: getProjectProductsFromForms(state.form, projectId, state.calculationState),\n formValues: getFormValuesDictionaryFromForms(state.form),\n state: projectState,\n } as any; // @TODO: Fix this any\n\n let result: IProject;\n try {\n result = yield call([this.projectApiClient, this.projectApiClient.saveProject], requestObj, sendMail);\n } catch (e) {\n yield put(projectApiActionCreator.updateError(e));\n action.payload.callback?.error(e);\n return;\n }\n\n yield put(change(ReduxFormKeys.costCalculationForm, 'projectState', result.state));\n yield put(projectApiActionCreator.updateSuccess(result));\n\n const activeTabIndex = yield select(getActiveTabIndex);\n\n const location = yield select(getLocation);\n\n const newRouteForm = calculationTabs[activeTabIndex];\n const route = '/calculation/' + result.id + '/' + newRouteForm;\n\n if (location === route) {\n console.log(\"SAME SAGA -->\", route);\n return;\n }\n\n yield put(replace(route));\n console.log(\"REPLACE ROUTE FROM SAGA -->\", route);\n } catch (err) {\n console.error(err);\n // yield put(this.listError(err));\n }\n }\n\n @autobind\n * saga() {\n yield all([\n takeLatest(this.APP_NAME + \"/\" + ProjectActionTypes.GET_REQUEST, this.get),\n takeLatest(this.APP_NAME + \"/\" + ProjectActionTypes.MAKE_PROJECT, this.makeProject),\n takeLatest(this.APP_NAME + \"/\" + ProjectActionTypes.UPDATE_REQUEST, this.update),\n ]);\n }\n\n @autobind\n makeSelectBase(key: T): (state: IApplicationState) => IProjectApiState[T] {\n return (state) => state[this.APP_NAME][key];\n }\n\n @autobind\n selector(): (state: IApplicationState) => IProjectApiState {\n return (state) => state[this.APP_NAME];\n }\n}\n\ntype ValueOf = T[keyof T];\ntype KnownProjectApiActions = ReturnType>;\n\nconst { apiUrl } = configProvider;\nconst { getToken } = authTokenContext;\n\nconst PROJECT_API_PREFIX = 'project';\nexport const projectApi = new ProjectApi(PROJECT_API_PREFIX, apiUrl['project-v1'], apiUrl['product-v1'], getToken);\nexport const projectApiActionCreator = new ProjectApiActionCreator(PROJECT_API_PREFIX);\n","import { isObjectWithShape, isOptional, isStringEnum, isNoValue, isArrayOf, isString, isNumber, SimpleValidator } from \"../api/simple-validators\";\n\nimport { PRODUCT_KEY, PRODUCT_GROUP, PRODUCT_TYPE, PRODUCT_CATEGORY, CHARACTERISTIC_KEY } from \"./lookup\";\nimport { IProduct, IProductGroup, ICharacteristic, IProductData } from \"./types\";\n\n\nexport const isMultilanguageDescription: SimpleValidator = isObjectWithShape({\n de: isString,\n en: isString,\n});\n\nexport const isIProduct: SimpleValidator = isObjectWithShape({\n id: isString,\n productKey: isOptional(isString as SimpleValidator),\n description: isMultilanguageDescription,\n dhNo: isOptional(isString),\n bxH: isOptional(isString),\n width: isOptional(isNumber),\n height: isOptional(isNumber),\n ventilationArea: isOptional(isNumber),\n recess: isOptional(isString),\n productGroupId: isStringEnum(...Object.values(PRODUCT_GROUP)),\n productTypeId: isStringEnum(...Object.values(PRODUCT_TYPE)),\n imageUrl: isOptional(isString),\n isRecommended: isNoValue,\n});\n\nexport const isIProductGroup: SimpleValidator = isObjectWithShape({\n id: isStringEnum(...Object.values(PRODUCT_GROUP)),\n description: isMultilanguageDescription,\n productCategoryId: isStringEnum(...Object.values(PRODUCT_CATEGORY)),\n recommendationOrder2: isOptional(isNumber),\n imageUrl: isOptional(isString),\n planningFileUrl: isOptional(isString),\n});\n\nexport const isICharacteristic: SimpleValidator = isObjectWithShape({\n characteristicKey: isStringEnum(...Object.values(CHARACTERISTIC_KEY)),\n productGroupId: isStringEnum(...Object.values(PRODUCT_GROUP)),\n});\n\nexport const isIProductData: SimpleValidator = isObjectWithShape({\n products: isArrayOf(isIProduct),\n productGroups: isArrayOf(isIProductGroup),\n characteristics: isArrayOf(isICharacteristic),\n});\n","import { JsonRESTApiClient } from \"../api/JsonRESTApiClient\";\nimport { ICompany } from \"../auth/types\";\n\nimport { IProductData } from \"./types\";\nimport { isIProductData } from \"./validators\";\n\n\n/** @see `DH.BlueKitConnect.Backend.Features.Product.ProductApiV1Controller` */\nexport class ProductApiV1Client extends JsonRESTApiClient {\n\n /// API Endpoints\n\n public async getProductData(companyId: ICompany['id']): Promise {\n return await this._fetchJson(\n this._getUrl(['product-data'], [['companyId', companyId]]),\n {\n method: 'GET',\n headers: await this._getHeaders(),\n },\n isIProductData\n );\n }\n\n}\n","import { SYSTEM } from '../../project/lookup';\nimport { BasicInputsFormModel, ConfigurationInputsFormModel } from '../models/FormModels';\n\n\n/** Check whether AIO-Basic (as a system, or as a set) is applicable */\nexport function aioBasicSystemOrPackageNotAvailable(\n basicInputFormValues: Pick | undefined\n): boolean {\n return basicInputFormValues?.nrwgDelivered\n || basicInputFormValues?.lowEnergyStandard\n || basicInputFormValues?.abzRequired\n || basicInputFormValues?.quiet\n || basicInputFormValues?.noOfElevators > 2\n || basicInputFormValues?.additionalSmokeDetector;\n}\n\n/** Get a list of systems that are applicable */\nexport function getAvailableSystems(basicInputFormValues: Parameters[0]): SYSTEM[] {\n if (aioBasicSystemOrPackageNotAvailable(basicInputFormValues)) {\n return [SYSTEM.L_AIO];\n } else {\n return [SYSTEM.L_AIO, SYSTEM.AIO_BASIC];\n }\n}\n\n/** Get the system from user selection, fall back to the first available system */\nexport function getSystem(\n basicValues: Parameters[0],\n configValues: Pick | undefined\n): SYSTEM {\n return configValues?.system || getAvailableSystems(basicValues)[0];\n}\n","import { BasicInputsFormModel } from \"../models/FormModels\";\n\nimport { getSystem } from \"./System\";\nimport { COUNTRY, LIFT_AREA_PERCENTAGE, MACHINE_ROOM, SMOKE_DETECTION, SYSTEM } from '../../project/lookup';\n\nfunction hasSmokeDetectionMethodNone({ country, liftAreaPercentage, systemIntegration }: Pick) {\n // Not available in Germany\n if (country === COUNTRY.DE) {\n return false;\n }\n\n // Only available if either relaxed ventilation rules, or integrated with building control system\n return systemIntegration || [\n LIFT_AREA_PERCENTAGE._1_0_PERCENT,\n LIFT_AREA_PERCENTAGE.MANUAL,\n ].includes(liftAreaPercentage as any);\n}\n\n/** Get the smoke detection methods for a given shaft height; ordered by preference (descending order). */\nfunction getSmokeDetectionMethodsForShaftHeight(shaftHeight: number): SMOKE_DETECTION[] {\n if (shaftHeight <= 12_000) {\n return [\n SMOKE_DETECTION.NONE,\n SMOKE_DETECTION.POINTDETECTOR,\n SMOKE_DETECTION.SDLF1,\n SMOKE_DETECTION.RAS,\n ];\n } else if (shaftHeight <= 75_000) {\n return [\n SMOKE_DETECTION.NONE,\n SMOKE_DETECTION.SDLF1,\n SMOKE_DETECTION.POINTDETECTOR,\n SMOKE_DETECTION.RAS,\n ];\n } else {\n // BLU-240: RAS can not be configured in Calculator for shaftHeight > 75m\n return [\n SMOKE_DETECTION.NONE,\n SMOKE_DETECTION.SDLF1,\n SMOKE_DETECTION.POINTDETECTOR,\n ];\n }\n}\n\nexport function getApplicableSmokeDetectionMethods(\n basicInputFormValues: Pick\n & Parameters[0]\n & Parameters[0],\n configurationInputsFormValues: Parameters[1],\n): SMOKE_DETECTION[] {\n const { shaftHeight, noOfElevators, machineRoom } = basicInputFormValues;\n const system = getSystem(basicInputFormValues, configurationInputsFormValues);\n\n const removeMethod = (remove: SMOKE_DETECTION) => (m: SMOKE_DETECTION) => m !== remove;\n\n let methods = getSmokeDetectionMethodsForShaftHeight(shaftHeight);\n\n if (!hasSmokeDetectionMethodNone(basicInputFormValues)) {\n methods = methods.filter(removeMethod(SMOKE_DETECTION.NONE));\n }\n\n // No POINTDETECTOR in shaft with more than two elevators\n if (noOfElevators > 2) {\n methods = methods.filter(removeMethod(SMOKE_DETECTION.POINTDETECTOR));\n }\n\n // Only POINTDETECTOR for AIO Basic with machine room; BLU-244\n if (machineRoom !== MACHINE_ROOM.NO && system === SYSTEM.AIO_BASIC) {\n methods = methods.includes(SMOKE_DETECTION.POINTDETECTOR) ? [SMOKE_DETECTION.POINTDETECTOR] : [];\n }\n\n return methods;\n}\n","import { LIFT_STATUS_DETECTION, MACHINE_ROOM, SYSTEM } from \"../../project/lookup\";\nimport { BasicInputsFormModel, ConfigurationInputsFormModel } from \"../models/FormModels\";\n\n\nexport function getApplicatableLiftStatusDetectionMethods(\n { shaftHeight, machineRoom }: Pick,\n { system }: Pick\n): LIFT_STATUS_DETECTION[] {\n let values = Object.values(LIFT_STATUS_DETECTION);\n\n if (system === SYSTEM.AIO_BASIC && getLSTRepeaterCount({ shaftHeight, machineRoom }) > 0) {\n // LST Repeaters currently not supported by AIO Basic/CPL-B; BLU-326\n values = values.filter(lst => lst !== LIFT_STATUS_DETECTION.LST_CO2_V3);\n }\n\n return values;\n}\n\nexport function getLSTRepeaterCount(\n { shaftHeight, machineRoom }: Pick\n): number {\n const BASE_RANGE = 70_000; // LST's range to base/repeater is 70m\n const REPEATER_RANGE = 36_000; // Repeater's range to base/repeater is 36m\n const MR_CEILING_DISTANCE = 5_000; // If base is in machine room, a repeater must be no more than 5m below the ceiling\n\n const machineRoomPresent = machineRoom && machineRoom !== MACHINE_ROOM.NO;\n\n let effectiveHeight = shaftHeight - BASE_RANGE;\n let repeaterCount = 0;\n\n if (machineRoomPresent) {\n // If the base is in a machine room, one repeater must be in the shaft\n // no more than MR_CEILING_DISTANCE from the ceiling\n //\n // Add one repeater, ignore top MR_CEILING_DISTANCE of shaft height.\n effectiveHeight -= MR_CEILING_DISTANCE;\n repeaterCount += 1;\n }\n\n // One repeater each REPEATER_RANGE distance, round up, prevent negative value\n repeaterCount += Math.max(Math.ceil(effectiveHeight / REPEATER_RANGE), 0);\n\n return repeaterCount;\n}\n","import { COUNTRY, LIFT_AREA_PERCENTAGE, PROJECT_TYPE } from \"../../project/lookup\";\nimport { BasicInputsFormModel } from \"../models/FormModels\";\n\n\n/** German LBOs specify a minimum smoke ventilation area of 0.1m^2 == 100_000 mm^2 */\nconst MINIMUM_VENTILATION_AREA_DE_LBO = 100_000;\nconst VENTILATION_AREA_PERCENTAGE_DE_LBO = {\n [LIFT_AREA_PERCENTAGE._2_5_PERCENT]: 2.5,\n [LIFT_AREA_PERCENTAGE._1_0_PERCENT]: 1.0,\n};\n\n/**\n * Returns minimum required ventilation area according to `liftAreaPercentage`.\n * @returns The minimum ventilation area in mm^2, or `null` if no minimum is applicable\n */\nfunction calculateMinimumLiftArea(values: Pick): number | null {\n\n const { liftAreaPercentage, shaftWidth, shaftDepth } = values;\n\n switch (liftAreaPercentage) {\n case LIFT_AREA_PERCENTAGE._2_5_PERCENT: /* fallthrough */\n case LIFT_AREA_PERCENTAGE._1_0_PERCENT: {\n if (isNaN(shaftDepth) || isNaN(shaftWidth)) {\n return null;\n }\n\n const liftFootprint = shaftDepth * shaftWidth;\n const ventilationArea = Math.ceil(liftFootprint * VENTILATION_AREA_PERCENTAGE_DE_LBO[liftAreaPercentage] / 100);\n\n return Math.max(MINIMUM_VENTILATION_AREA_DE_LBO, ventilationArea);\n }\n\n case LIFT_AREA_PERCENTAGE.MANUAL:\n default:\n return null;\n }\n}\n\nexport function getAvailableLiftAreaPercentages({ country, projectType }: Partial>): LIFT_AREA_PERCENTAGE[] {\n switch (country) {\n case COUNTRY.DE: return [\n LIFT_AREA_PERCENTAGE._2_5_PERCENT,\n ...(projectType === PROJECT_TYPE.MODERNIZED ? [LIFT_AREA_PERCENTAGE.MANUAL] : []),\n ];\n case COUNTRY.AT: return [\n LIFT_AREA_PERCENTAGE._2_5_PERCENT,\n LIFT_AREA_PERCENTAGE._1_0_PERCENT,\n ...(projectType === PROJECT_TYPE.MODERNIZED ? [LIFT_AREA_PERCENTAGE.MANUAL] : []),\n ];\n default: return [\n LIFT_AREA_PERCENTAGE.MANUAL,\n // LIFT_AREA_PERCENTAGE._2_5_PERCENT,\n // LIFT_AREA_PERCENTAGE._1_0_PERCENT,\n ];\n }\n}\n\n// For 03-VentilationComponents\nexport function getTotalLiftArea(\n basicValues: (Pick & Parameters[0]) | undefined\n) {\n if (!basicValues) {\n return null;\n }\n\n const {\n country,\n projectType,\n calculatedVentilationArea,\n liftAreaPercentage,\n } = basicValues;\n\n if (\n liftAreaPercentage === LIFT_AREA_PERCENTAGE.MANUAL &&\n getAvailableLiftAreaPercentages({ country, projectType }).includes(LIFT_AREA_PERCENTAGE.MANUAL)\n ) {\n // Ventilation area has been entered manually and this is permitted\n return calculatedVentilationArea;\n }\n\n return calculateMinimumLiftArea(basicValues);\n}\n","import {PRODUCT_GROUP, SET_PRODUCT_KEY } from '../../product/lookup';\nimport { IProduct } from \"../../product/types\";\nimport { INSTALLATION_POSITION, PROJECT_TYPE, MACHINE_ROOM } from '../../project/lookup';\n\nimport { ISelectedProduct } from \"../CalculationModels\";\nimport { BasicInputsFormModel } from \"../models/FormModels\";\nimport { filterProductsByGroups } from \"../CalculationService\";\n\nimport { aioBasicSystemOrPackageNotAvailable } from \"./System\";\n\n/** AIO Basic Sets with PD can support machineRoom by extending the shaft line by 12m into the MR; BLU-244 */\nconst AIO_BASIC_SET_PD_MACHINE_ROOM_LINE_LENGTH = 12_000;\n\nconst AIO_BASIC_SET_RECOMMENDATIONS = [\n { key: SET_PRODUCT_KEY.PD_12, minLineLength: 0, maxLineLength: 12_000, machineRoomSupport: true },\n { key: SET_PRODUCT_KEY.SDLF_50, minShaftHeight: 0, maxShaftHeight: 50_000 },\n { key: SET_PRODUCT_KEY.SDLF_100, minShaftHeight: 50_000, maxShaftHeight: 100_000 },\n { key: SET_PRODUCT_KEY.PD_24, minLineLength: 12_000, maxLineLength: 24_000, machineRoomSupport: true },\n { key: SET_PRODUCT_KEY.PD_36, minLineLength: 24_000, maxLineLength: 36_000, machineRoomSupport: true },\n { key: SET_PRODUCT_KEY.PD_48, minLineLength: 36_000, maxLineLength: 48_000, machineRoomSupport: true },\n];\n\n/** \n * Get the shaft height limits for an AIO Basic Set.\n * \n * If a Set has `machineRoomSupport` and a `machineRoom` is present,\n * the limits are reduced by `AIO_BASIC_SET_PD_MACHINE_ROOM_LINE_LENGTH`\n * \n * @returns [min, max] The minimum and maximum (both inclusive) shaft height limits (in `mm`)\n */\nexport function getAIOBasicSetShaftHeightLimits(key: SET_PRODUCT_KEY, machineRoom: MACHINE_ROOM): [number, number] {\n const opts = AIO_BASIC_SET_RECOMMENDATIONS.find(o => o.key === key);\n if (!opts) return null;\n\n if (!opts.machineRoomSupport && machineRoom !== MACHINE_ROOM.NO) return null;\n\n const minShaftHeight = opts.minShaftHeight ?? 0;\n const maxShaftHeight = opts.maxShaftHeight ?? Infinity;\n\n let minLineLength = opts.minLineLength ?? 0;\n let maxLineLength = opts.maxLineLength ?? Infinity;\n\n if (machineRoom !== MACHINE_ROOM.NO) {\n minLineLength -= AIO_BASIC_SET_PD_MACHINE_ROOM_LINE_LENGTH;\n maxLineLength -= AIO_BASIC_SET_PD_MACHINE_ROOM_LINE_LENGTH;\n }\n\n return [Math.max(minShaftHeight, minLineLength), Math.min(maxShaftHeight, maxLineLength)];\n}\n\n/** Get the applicable AIO Basic Sets for the given form values (requirements) */\nexport function getApplicableAIOBasicSets(\n basicInputFormValues: Pick,\n productsData: readonly IProduct[]\n) {\n const {\n installationPosition,\n mainLevelSmokeDetector,\n shaftHeight,\n machineRoom,\n } = basicInputFormValues;\n\n if (mainLevelSmokeDetector || installationPosition == null) {\n return [];\n }\n\n if (aioBasicSystemOrPackageNotAvailable(basicInputFormValues)) {\n return [];\n }\n\n const setProducts = productsData.filter(filterProductsByGroups([PRODUCT_GROUP.SETAIOB]));\n\n const avaiableProducts = setProducts.filter(product => {\n const productKey = product.productKey as unknown as SET_PRODUCT_KEY;\n\n const limits = getAIOBasicSetShaftHeightLimits(productKey, machineRoom);\n if (!limits) return false;\n \n if (shaftHeight <= limits[0]) return false;\n if (shaftHeight > limits[1]) return false;\n\n return true;\n });\n\n return avaiableProducts;\n}\n\n/** Return type of `getAIOBasicSetVent()` */\ninterface IAIOBasicSetVent {\n productKey: string;\n name: string;\n ventilationArea: number;\n}\n\n/** Get the auto-selected ventilation component for AIO Basic Sets */\nexport function getAIOBasicSetVent(projectType: string, totalLiftArea: number): IAIOBasicSetVent | null {\n const byVentilationAreaAsc = (a: IAIOBasicSetVent, b: IAIOBasicSetVent) => a.ventilationArea - b.ventilationArea;\n\n // Ventilation components for NEWBUILDING and MODERNIZED\n // Ensure these are sorted by ventilationArea ascending\n // so that the first match is the smallest possible component satisfying the given lift area\n const ventComponentsNewbuilding: IAIOBasicSetVent[] = [\n {\n productKey: 'jk-180-360x360',\n name: 'JK-180-HV 360x360',\n ventilationArea: 104000,\n },\n {\n productKey: 'jk-180-470x360',\n name: 'JK-180-HV 470x360',\n ventilationArea: 130000,\n },\n {\n productKey: 'jk-180-530x530',\n name: 'JK-180-HV 530x530',\n ventilationArea: 231000,\n },\n {\n productKey: 'jk-180-700x700',\n name: 'JK-180-HV 700x700',\n ventilationArea: 406000,\n },\n {\n productKey: 'jk-180-860x860',\n name: 'JK-180-HV 860x860',\n ventilationArea: 624000,\n },\n {\n productKey: 'jk-180-1030x1030',\n name: 'JK-180-HV 1030x1030',\n ventilationArea: 896000,\n },\n {\n productKey: 'jk-180-1200x1200',\n name: 'JK-180-HV 1200x1200',\n ventilationArea: 1218000,\n },\n ].sort(byVentilationAreaAsc);\n const ventComponentsModernized: IAIOBasicSetVent[] = [\n {\n productKey: 'jk-190-360x360',\n name: 'JK-190 360x360',\n ventilationArea: 104000,\n },\n {\n productKey: 'jk-190-470x360',\n name: 'JK-190 470x360',\n ventilationArea: 130000,\n },\n {\n productKey: 'jk-190-530x530',\n name: 'JK-190 530x530',\n ventilationArea: 231000,\n },\n {\n productKey: 'jk-190-700x700',\n name: 'JK-190 700x700',\n ventilationArea: 406000,\n },\n {\n productKey: 'jk-190-860x860',\n name: 'JK-190 860x860',\n ventilationArea: 624000,\n },\n {\n productKey: 'jk-190-1030x1030',\n name: 'JK-190 1030x1030',\n ventilationArea: 896000,\n },\n {\n productKey: 'jk-190-1200x1200',\n name: 'JK-190 1200x1200',\n ventilationArea: 1219000,\n },\n ].sort(byVentilationAreaAsc);\n\n const ventComponents = projectType === PROJECT_TYPE.MODERNIZED ? ventComponentsModernized : ventComponentsNewbuilding;\n\n // Return first match (smallest component with sufficient ventilation area)\n return ventComponents.find(component => totalLiftArea <= component.ventilationArea) || null;\n}\n\n// @TODO: Check the purpose of this condition\nexport function getAIOBasicSetRequiresVentComponentSelection({ weathershelter, installationPosition }: Pick) {\n return weathershelter && installationPosition !== INSTALLATION_POSITION.VERTICAL;\n}\n\n// -----\n\n/** Get the `ISelectedProduct` for a selected AIO Basic Set */\nexport function getSelectedAIOBasicSet(\n { aioBasicSet: setId }: Partial>,\n products: readonly IProduct[]\n): ISelectedProduct {\n const product = setId != null\n ? products.find(p => p.id === setId)\n : null;\n\n if (!product) {\n return null;\n }\n\n return {\n id: setId,\n quantity: 1,\n productKey: product.productKey,\n description: product.description,\n dhNo: product.dhNo,\n productTypeId: product.productTypeId,\n productGroupId: product.productGroupId,\n };\n}\n","import { CHARACTERISTIC_KEY, PRODUCT_CATEGORY, PRODUCT_GROUP, PRODUCT_TYPE } from '../../product/lookup';\nimport { IProduct, IProductData } from \"../../product/types\";\nimport { INSTALLATION_POSITION, SYSTEM } from '../../project/lookup';\n\nimport { BasicInputsFormModel, VentilationComponentsFormModel } from \"../models/FormModels\";\nimport {\n filterProductsByCategories,\n filterProductsByCharacteristicsAll,\n filterProductsByCharacteristicsAny,\n filterProductsByTypes,\n filterProductsByVentilationArea,\n getRecommendedProductId,\n} from \"../CalculationService\";\n\nimport { getAIOBasicSetVent } from \"./AIOBasicSet\";\nimport { getSystem } from \"./System\";\n\n\nexport function getAvailableVentilationComponentsForAIOBasicSet(projectType: string, totalLiftArea: number, installationPosition: string, productData: IProductData): IAvailableVentilationComponents {\n const vent = getAIOBasicSetVent(projectType, totalLiftArea);\n let weatherProtectionComponents = [];\n\n if (vent) {\n const aioBasicSetVentilationArea = vent.ventilationArea;\n const potentialWPComponents = productData.products.filter(p => p.productTypeId === PRODUCT_TYPE.WEATHERPROTECTION && p.ventilationArea === aioBasicSetVentilationArea);\n\n if (installationPosition === INSTALLATION_POSITION.VERTICAL) {\n weatherProtectionComponents = potentialWPComponents.filter(product => product.productGroupId === PRODUCT_GROUP.ALAS);\n } else {\n weatherProtectionComponents = potentialWPComponents.filter(product => product.productGroupId !== PRODUCT_GROUP.ALAS);\n }\n }\n\n return {\n ventComponents: [],\n weatherProtectionComponents,\n };\n}\n\nexport type ProductSelector = IProduct & { isRecommended?: boolean };\n\ninterface IAvailableVentilationComponents {\n ventComponents: ProductSelector[];\n weatherProtectionComponents: ProductSelector[];\n}\n\nfunction getAvailableVentilationComponentsForManualConfig(\n minArea: number,\n basicInputFormValues: Pick,\n system: SYSTEM,\n productData: IProductData): IAvailableVentilationComponents {\n\n const { projectType, installationPosition, abzRequired, lowEnergyStandard, quiet, weathershelter } = basicInputFormValues;\n\n // Filter by installation position 'H'==horizontal or 'V'==vertikal\n const installationPositionKey = installationPosition === INSTALLATION_POSITION.HORIZONTAL\n ? CHARACTERISTIC_KEY.HORIZONTAL_INSTALLATION\n : CHARACTERISTIC_KEY.VERTICAL_INSTALLATION;\n\n // Filter by project type \"MODERNIZED\" or \"NEWBUILDING\"\n const projectTypeKey = (projectType + '_INSTALLATION') as CHARACTERISTIC_KEY;\n\n /// ---\n\n const ventFilterCharacteristics: CHARACTERISTIC_KEY[] = [installationPositionKey, projectTypeKey];\n\n // \"System mit abZ ist verlangt\" selected\n if (abzRequired) {\n ventFilterCharacteristics.push(CHARACTERISTIC_KEY.abZ);\n }\n\n // \"Niedrigenergiestandard\" selected\n if (lowEnergyStandard) {\n ventFilterCharacteristics.push(CHARACTERISTIC_KEY.LOWENERGY);\n }\n\n // \"Geräuscharmer Antrieb\" selected\n if (quiet) {\n ventFilterCharacteristics.push(CHARACTERISTIC_KEY.QUIET);\n }\n\n // AIO Basic system does not support battery packs; motors need a builtin self-open spring\n if (system === SYSTEM.AIO_BASIC) {\n ventFilterCharacteristics.push(CHARACTERISTIC_KEY.WITH_SPRING_RETURN);\n }\n\n let ventComponents = productData.products\n .filter(filterProductsByTypes([PRODUCT_TYPE.WEATHERPROTECTION], true))\n .filter(filterProductsByCategories([PRODUCT_CATEGORY.VENTCOMP], productData.productGroups))\n .filter(filterProductsByVentilationArea(minArea, null, true))\n .filter(filterProductsByCharacteristicsAll(ventFilterCharacteristics, productData.characteristics));\n\n if (weathershelter) {\n ventComponents = ventComponents.filter(filterProductsByCharacteristicsAny(\n [CHARACTERISTIC_KEY.WEATHERPROTECTION_COMPATIBLE, CHARACTERISTIC_KEY.WEATHERPROTECTION_BUILTIN],\n productData.characteristics\n ));\n }\n\n const recommendedProductId = getRecommendedProductId(ventComponents, productData.productGroups);\n ventComponents.forEach(c => {\n c.isRecommended = recommendedProductId && c.id === recommendedProductId;\n });\n\n /// ---\n // Wetterschutzkomponenten nur hinzufügen, wenn 'Wetterschutz' aktiv und kompatible Komponenten vorhanden\n\n const hasCompatibleComponents = () => ventComponents\n .filter(filterProductsByCharacteristicsAll([CHARACTERISTIC_KEY.WEATHERPROTECTION_COMPATIBLE], productData.characteristics))\n .length > 0\n\n if (!weathershelter || !hasCompatibleComponents()) {\n return { ventComponents, weatherProtectionComponents: [] };\n }\n\n const weatherProtectionComponents: ProductSelector[] = productData.products\n .filter(filterProductsByTypes([PRODUCT_TYPE.WEATHERPROTECTION]))\n .filter(filterProductsByVentilationArea(minArea, null, true))\n .filter(filterProductsByCharacteristicsAll([installationPositionKey, projectTypeKey], productData.characteristics));\n\n return { ventComponents, weatherProtectionComponents };\n}\n\nexport function getAvailableVentilationComponents(\n totalLiftArea: number,\n minArea: number,\n basicValues:\n Parameters[0] &\n Parameters[1] &\n Pick,\n configValues: Parameters[1],\n productData: IProductData\n): IAvailableVentilationComponents {\n\n if (basicValues.aioBasicSet) {\n const { projectType, installationPosition } = basicValues;\n return getAvailableVentilationComponentsForAIOBasicSet(projectType, totalLiftArea, installationPosition, productData);\n } // else {\n\n const system = getSystem(basicValues, configValues);\n\n return getAvailableVentilationComponentsForManualConfig(minArea, basicValues, system, productData);\n}\n\n// -------\n\nexport const COMPONENT_GROUP_IDS_WITH_EINBAUWINKEL = [PRODUCT_GROUP.JK190DB, PRODUCT_GROUP.JK190];\n\nexport function getQuantitiesFromVentilationComponentsFormModel(ventilationComponentsValues: VentilationComponentsFormModel): [string, number][] {\n if (!ventilationComponentsValues) {\n return [];\n }\n\n const PRODUCT_QUANTITY_PREFIX = \"quantity-\";\n return Object.keys(ventilationComponentsValues)\n .filter(x => x.startsWith(PRODUCT_QUANTITY_PREFIX))\n .map<[string, number]>(key => [key.substring(PRODUCT_QUANTITY_PREFIX.length), Number(ventilationComponentsValues[key])]);\n}\n","import React from \"react\";\n\n\nexport const LanguageKey = ['de', 'en', 'pl', 'fr', 'nl'] as const;\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type LanguageKey = typeof LanguageKey[number];\n\nexport const ProductLanguageKey = ['de', 'en'] as const;\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type ProductLanguageKey = typeof ProductLanguageKey[number];\n\nexport type LocalizationKey = string;\nexport type LocalizationValues = {\n [key: string]: any;\n}\n\nexport const CurrencyKey = ['EUR', 'CHF', 'GBP', 'USD'] as const;\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type CurrencyKey = typeof CurrencyKey[number];\n\nexport const fallbackLanguages: Record = {\n 'de': null,\n 'en': 'de',\n 'pl': 'en',\n 'fr': 'en',\n 'nl': 'en',\n} as const;\n\nexport function forLanguage(language: LanguageKey, enableFallback: boolean = true) {\n function localize(key: LocalizationKey, values: LocalizationValues | \"off\" = {}, defaultString: string = key) {\n // Get the plain localization string\n let localeString = getLocaleString(language, key);\n\n if (enableFallback) {\n if (!localeString && fallbackLanguages[language]) {\n // Try finding a string in the fallback language\n localeString = getLocaleString(fallbackLanguages[language], key);\n if (localeString) {\n console.debug(`[localize] [${language}] Using fallback language [${fallbackLanguages[language]}] for key '${key}'`);\n }\n }\n }\n\n if (!localeString) {\n // Not even a fallback is available\n console.info(`[localize] [${language}] No locale string for key '${key}'!`);\n return defaultString;\n }\n\n return values !== \"off\" ? substitute(localeString, values) : localeString;\n }\n\n function localizeEnum(value: T, prefix: string) {\n return localize(`${prefix}.${value}`, null, null);\n }\n\n function enumToLookup(values: T[], prefix: string): { key: string; value: string; text: string; }[] {\n return values.map(value => ({ key: value, value, text: localizeEnum(value, prefix) }));\n }\n\n function localizeCountry(key: string): string {\n const searchFn: (c: CountryEntry) => boolean = (\n key.length === 2 ? c => c.alpha2 === key :\n key.length === 3 ? c => c.alpha3 === key :\n c => c.name.toLowerCase() === key.toLowerCase()\n );\n\n const result = world_countries[language].find(searchFn)?.name;\n\n return result == null ? '(' + key + ')' : result;\n }\n\n function countriesToLookup(): { key: string; value: string; text: string; }[] {\n const countries = getCountriesAlpha2();\n return countries.map(key => ({\n key,\n value: key,\n text: localizeCountry(key),\n }));\n }\n\n function substitute(localeString: string, values: LocalizationValues): string {\n const subRegex = /\\{([^}]+)\\}/;\n \n let sourceString = localeString;\n let resultString = '';\n \n while (sourceString.length > 0 && localeString.includes(\"{\")) { // .includes() is presumably faster than .match()\n const match = sourceString.match(subRegex);\n if (match === null || match.length < 2) break; // No substitution pattern found\n \n const expr = match[1];\n \n let value = `{${expr}}`;\n if (expr.startsWith('loc:')) {\n value = localize(expr.substring(4) as LocalizationKey, \"off\"); // No nested substitution to protect against infinite recursion\n } else if (expr.startsWith('country:')) {\n const countryKey = expr.substring(8);\n value = localizeCountry(countryKey);\n } else if (expr.startsWith('distance:')) {\n const areaValue = parseInt(expr.substring(9));\n if (!isNaN(areaValue)) {\n value = localizeDistance(areaValue);\n }\n } else if (expr.startsWith('area:')) {\n const areaValue = parseInt(expr.substring(5));\n if (!isNaN(areaValue)) {\n value = localizeArea(areaValue);\n }\n } else if (Object.prototype.hasOwnProperty.call(values, expr)) {\n value = values[expr];\n }\n \n // Put prefix and substitution into resultString\n resultString += sourceString.substring(0, match.index) + value;\n \n // Remove prefix and match from sourceString\n sourceString = sourceString.slice(match.index + match[0].length);\n }\n \n resultString += sourceString; // Append remainder\n \n return resultString;\n }\n\n const thousandSep = '.';\n const decimalSep = ',';\n\n function localizeNumber(value?: number, decimals: number = null): string|null {\n if (value === null || value === undefined) return null;\n\n let intPart = formatThousands(Math.floor(value), thousandSep);\n if (decimals === 0) return intPart;\n\n const fraction = value % 1;\n if (fraction === 0 && decimals === null) return intPart;\n\n const fractStr = decimals === null ? fraction.toString(10) : fraction.toFixed(decimals);\n const fractPart = fractStr.substring(2); // Cut off leading \"0.\"\n\n return intPart + decimalSep + fractPart;\n }\n\n function localizeDistance(value?: number): string|null {\n if (value === null || value === undefined) return null;\n return localizeNumber(value, 0) + ' mm';\n }\n\n function localizeArea(value?: number): string|null {\n if (value === null || value === undefined) return null;\n return localizeNumber(value, 0) + ' mm²';\n }\n\n return {\n /**\n * Localize a string based on a `key`. \n * Allows value substitution: `Hello {name}!` \n * Allows nested localization: `{loc:hello} Alice!`\n * @param key The key to lookup a localization string.\n * @param values Passed to `substitute` alongside the localization string.\n * @param defaultString If no localization for the `key` is available and this value is set, return this string.\n * If not set, the `key` is returned instead.\n * @see `substitute`\n */\n localize,\n /** Localize an enum value with key `prefix.value` */\n localizeEnum,\n /** Map enum values to `ILookup[]` with localized `text` */\n enumToLookup,\n /** Localize a country name by country code (alpha2 or alpha3) */\n localizeCountry,\n /** Create `ILookup[]` of all countries with alpha2 code and localized names */\n countriesToLookup,\n /**\n * Substitute patterns in a string\n * \n * Syntax:\n * - Value substitution: `Hello {name}!`\n * - Nested localization: `{loc:hello} Alice!`\n * - Distance localization: `One meter is {distance:1000}.`\n * - Area localization: `One square meter is {area:1000000}.`\n * \n * Used by `localize`\n */\n substitute,\n /** Format a number according to the locale */\n localizeNumber,\n /** Format a distance value (integer in mm) according to the locale */\n localizeDistance,\n /** Format an area value (integer in mm^2) according to the locale */\n localizeArea,\n language,\n };\n};\n\n\nexport function nl2br(text: string): JSX.Element {\n const lines = text.split(\"\\n\");\n if (lines.length < 1) return null;\n\n const children = [];\n lines.forEach((line, idx) => {\n if (idx > 0) children.push(React.createElement(\"br\", { key: `${idx}-br` }));\n children.push(line);\n })\n\n return React.createElement(React.Fragment, undefined, children);\n}\n\nfunction getLocaleString(locale: keyof typeof localization, key: LocalizationKey): string | null {\n if (!localization[locale]) {\n return null;\n }\n return localization[locale][key] ?? null;\n}\n\nconst localization: Partial>> = {\n 'de': require('./languages/de.json') as Record,\n 'en': require('./languages/en.json') as Record,\n 'pl': require('./languages/pl.json') as Record,\n};\n\ninterface CountryEntry {\n /** ISO 3166-1 numeric country code */\n id: number;\n /** ISO 3166-1 alpha-2 country code (lower case) */\n alpha2: string;\n /** ISO 3166-1 alpha-3 country code (lower case) */\n alpha3: string;\n /** ISO 3166-1 short country name */\n name: string;\n};\n\nconst world_countries: Partial> = {\n // Source: https://github.com/stefangabos/world_countries/tree/master/data/countries\n 'de': require('./world_countries/world.de.json'),\n 'en': require('./world_countries/world.en.json'),\n 'pl': require('./world_countries/world.pl.json'),\n}\n\n/** Get all ISO 3166-1 alpha-2 country codes */\nexport function getCountriesAlpha2(): string[] {\n return world_countries.de.map(c => c.alpha2);\n}\n\nfunction formatThousands(value: number, separator: string) {\n let intStr = value.toFixed(0);\n const paddedLen = Math.ceil(intStr.length / 3) * 3\n const extraZeroes = paddedLen - intStr.length;\n intStr = intStr.padStart(paddedLen, '0');\n let result = '';\n\n while (intStr.length > 0) {\n result = intStr.substring(intStr.length - 3) + separator + result;\n intStr = intStr.substring(0, intStr.length - 3);\n }\n\n return result.substring(extraZeroes, result.length - separator.length); // Cut off leading zeroes and trailing separator\n}\n","import * as React from \"react\";\n\nimport { CurrencyKey, LanguageKey, ProductLanguageKey, fallbackLanguages, forLanguage } from \"./LocalizationService\";\nimport { useConfig } from \"../configProvider\";\n\nfunction getDebugLangFromStr(str: string) {\n if (!str || str.length < 12) {\n return null;\n }\n\n const pattern = /(^|[?#&])debugLang=([a-z]{2})(&|$)/;\n const match = str.match(pattern);\n const lang = match ? match[2]: null;\n\n if (!lang) {\n return null;\n }\n if (!LanguageKey.includes(lang as any)) {\n return null;\n }\n\n return lang as LanguageKey;\n};\n\n/** The type of `LocalizationContext`'s value */\ninterface LocalizationContextType {\n /** The configured default language */\n defaultLanguage: LanguageKey;\n /** The language preference manually set by the user */\n manuallySetLang: LanguageKey | null;\n /** Manually set the language */\n setLanguage: (lang: LanguageKey | null) => unknown;\n\n /** The set of available languages in an area with limited language support; set with `` */\n restrictedLanguages: LanguageKey[] | null;\n\n /** The currency preference manually set by the user */\n currency: CurrencyKey;\n /** Manually set the currency */\n setCurrency: (curr: string) => unknown;\n};\n\n/**\n * The localization context storing the currently active settings\n * for all things related to localization\n */\nconst LocalizationContext = React.createContext(null);\n\n/**\n * Get the selected active language\n * @returns `[string, string]` The active language and the selected language\n*/\nfunction selectActiveLanguage(ctx?: LocalizationContextType): [LanguageKey, LanguageKey] {\n const debugLang = getDebugLangFromStr(document.location.hash);\n\n if (debugLang) {\n return [debugLang, debugLang];\n }\n\n const browserLanguages = !Array.isArray(navigator?.languages) ? [] : navigator.languages\n .map(lang => String(lang).split(\"-\")[0])\n .filter(lang => LanguageKey.includes(lang as any)) as LanguageKey[];\n const browserLanguage = browserLanguages?.length ? browserLanguages[0] : null;\n\n if (!ctx) {\n const fallbackLang = browserLanguage ?? \"en\";\n return [fallbackLang, fallbackLang];\n }\n\n const selectedLanguage = ctx.manuallySetLang ?? browserLanguage ?? ctx.defaultLanguage;\n\n if (ctx.restrictedLanguages && !ctx.restrictedLanguages.includes(selectedLanguage)) {\n if (fallbackLanguages[selectedLanguage] && ctx.restrictedLanguages.includes(fallbackLanguages[selectedLanguage])) {\n return [fallbackLanguages[selectedLanguage], selectedLanguage];\n } else {\n return [ctx.defaultLanguage, selectedLanguage];\n }\n }\n\n return [selectedLanguage, selectedLanguage];\n}\n\nexport const LocalizationContextProvider: React.FC<{}> = ({ children }) => {\n const configProvider = useConfig();\n\n /// Language\n // Use React state as fallback in case window.localStorage is unavailable\n const [innerLanguage, innerSetLanguage] = React.useState(null);\n function storageSetLanguage(lang: LanguageKey) {\n if (!window?.localStorage?.setItem) {\n return false;\n }\n try {\n window.localStorage.setItem(configProvider.manuallySetLanguageLocalStorageKey, lang);\n const expires = Date.now() + configProvider.manuallySetLanguageLocalStorageTTL;\n window.localStorage.setItem(configProvider.manuallySetLanguageLocalStorageKey + '.expires', expires.toString());\n return true;\n } catch {\n return false;\n }\n }\n function storageGetLanguage() {\n if (!window?.localStorage?.getItem) {\n return null;\n }\n try {\n const expires = parseInt(window.localStorage.getItem(configProvider.manuallySetLanguageLocalStorageKey + '.expires'));\n if (!expires || isNaN(expires)) {\n return null;\n }\n if (expires < Date.now()) {\n return null;\n }\n\n const value = window.localStorage.getItem(configProvider.manuallySetLanguageLocalStorageKey);\n if (!value || !LanguageKey.includes(value as any)) {\n return null;\n }\n\n try {\n // Update TTL\n window.localStorage.setItem(configProvider.manuallySetLanguageLocalStorageKey + '.expires', (Date.now() + configProvider.manuallySetLanguageLocalStorageTTL).toString());\n } catch {}\n\n return value as LanguageKey;\n } catch {\n return null;\n }\n }\n\n const manuallySetLang = storageGetLanguage() ?? innerLanguage;\n const setLanguage = (lang: LanguageKey|null) => {\n if (lang != null && !LanguageKey.includes(lang as any)) {\n return;\n }\n innerSetLanguage(lang);\n storageSetLanguage(lang);\n };\n\n /// Currency\n // Use React state as fallback in case window.localStorage is unavailable\n const [innerCurrency, innerSetCurrency] = React.useState(null);\n function storageSetCurrency(curr: CurrencyKey) {\n if (!window?.localStorage?.setItem) {\n return false;\n }\n try {\n window.localStorage.setItem(configProvider.manuallySetCurrencyLocalStorageKey, curr);\n const expires = Date.now() + configProvider.manuallySetCurrencyLocalStorageTTL;\n window.localStorage.setItem(configProvider.manuallySetCurrencyLocalStorageKey + '.expires', expires.toString());\n return true;\n } catch {\n return false;\n }\n }\n function storageGetCurrency(): CurrencyKey {\n if (!window?.localStorage?.getItem) {\n return null;\n }\n try {\n const expires = parseInt(window.localStorage.getItem(configProvider.manuallySetCurrencyLocalStorageKey + '.expires'));\n if (!expires || isNaN(expires)) {\n return null;\n }\n if (expires < Date.now()) {\n return null;\n }\n\n const value = window.localStorage.getItem(configProvider.manuallySetCurrencyLocalStorageKey);\n if (!value || !CurrencyKey.includes(value as any)) {\n return null;\n }\n\n try {\n // Update TTL\n window.localStorage.setItem(configProvider.manuallySetCurrencyLocalStorageKey + '.expires', (Date.now() + configProvider.manuallySetCurrencyLocalStorageTTL).toString());\n } catch {}\n\n return value as CurrencyKey;\n } catch {\n return null;\n }\n }\n\n const { currency, setCurrency } = configProvider.enableCurrencySelect ? {\n currency: storageGetCurrency() ?? innerCurrency ?? configProvider.defaultCurrency,\n setCurrency: (curr: string) => {\n if (typeof curr !== \"string\" || !CurrencyKey.includes(curr as any)) {\n return;\n }\n innerSetCurrency(curr as CurrencyKey);\n storageSetCurrency(curr as CurrencyKey);\n }\n } : {\n currency: configProvider.defaultCurrency,\n setCurrency: () => { /* NOOP */ }\n };\n\n /// Context\n const contextValue: LocalizationContextType = {\n defaultLanguage: configProvider.defaultLanguage,\n manuallySetLang,\n setLanguage,\n restrictedLanguages: null,\n currency,\n setCurrency,\n };\n\n return \n {children}\n \n};\n\nexport interface RestrictLanguagesProps {\n languages: LanguageKey[] | null;\n};\n/** Restrict the available languages */\nexport const RestrictLanguages: React.FC = props => {\n const originalContext = React.useContext(LocalizationContext);\n\n const contextValue: LocalizationContextType = {\n ...originalContext,\n restrictedLanguages: props.languages,\n };\n\n return (\n \n {props.children}\n \n );\n};\n\nexport function useLanguage(): LanguageKey {\n const ctx = React.useContext(LocalizationContext);\n return selectActiveLanguage(ctx)[0];\n}\n\nexport function useSelectedLanguage(): LanguageKey {\n const ctx = React.useContext(LocalizationContext);\n return selectActiveLanguage(ctx)[1];\n}\n\nexport function useSetLanguage(): (lang: LanguageKey|null) => unknown {\n const ctx = React.useContext(LocalizationContext);\n return ctx.setLanguage;\n}\n\n/** Product data is not available in all languages */\nexport function useProductLanguage(): ProductLanguageKey {\n const language = useLanguage();\n return React.useMemo(\n () => ProductLanguageKey.includes(language as any) ? language as ProductLanguageKey : 'en',\n [language]\n );\n}\n\nexport function useCurrency(): CurrencyKey {\n const ctx = React.useContext(LocalizationContext);\n return ctx.currency;\n}\n\nexport function useSetCurrency(): (curr: string) => unknown {\n const ctx = React.useContext(LocalizationContext);\n return ctx.setCurrency;\n}\n\nexport type LocalizationProps = ReturnType;\n\nexport function useLocalization(): LocalizationProps {\n const lang = useLanguage();\n return React.useMemo(() => forLanguage(lang), [lang]);\n}\n","import React from \"react\";\r\nimport { FieldState } from \"redux-form/lib/reducer\";\r\n\r\nimport { useLocalization } from \"../../localization/hook\";\r\n\r\n\r\ninterface IReduxFormFieldStateDict {\r\n [name: string]: FieldState;\r\n}\r\n\r\n\r\ninterface IFormError {\r\n key: string;\r\n message: string;\r\n}\r\n\r\nexport interface IFormErrorDict {\r\n [key: string]: any;\r\n}\r\n\r\nexport function syncedErrorsToList(syncedErrors: IFormErrorDict): IFormError[] {\r\n return Object.keys(syncedErrors).map(key => ({key, message: syncedErrors[key]}));\r\n}\r\n\r\nexport function errorToList(e: Error|null, key: string = '*'): IFormError[] {\r\n if (!e) {\r\n return null;\r\n }\r\n return [{ key, message: e.message }];\r\n}\r\n\r\ninterface FormErrorListProps {\r\n errorList?: IFormError[];\r\n fieldDict?: IReduxFormFieldStateDict;\r\n displayMode?: null | 'plain' | 'single';\r\n}\r\nexport const FormErrorList: React.FC = ({ errorList, displayMode, fieldDict }) => {\r\n\r\n const { localize } = useLocalization();\r\n\r\n errorList = (errorList || []).filter((error) => fieldDict == null || fieldDict[error.key]?.touched);\r\n\r\n switch (displayMode) {\r\n case 'plain': return (\r\n \r\n {errorList.map(({key, message}) => {localize(key) + ' ' + localize(message)})}\r\n \r\n );\r\n case 'single': return (\r\n 0 ? {display: 'block'}:{display: 'none'}}\r\n >\r\n {errorList.map(({key, message}) =>
{localize(message)}
)}\r\n \r\n );\r\n default: return (\r\n 0 ? {display: 'block'}:{display: 'none'}}\r\n >\r\n
    \r\n {errorList.map(({key, message}) =>
  • {localize(key) + ' ' + localize(message)}
  • )}\r\n
\r\n \r\n );\r\n }\r\n}\r\n","import { IProductData } from '../../product/types';\n\nimport {ISelectedProduct} from '../CalculationModels';\nimport {\n BasicInputsFormModel,\n ConfigurationInputsFormModel,\n VentilationComponentsFormModel,\n CostCalculationFormModel\n} from '../models/FormModels';\n\nimport { SelectedProductsBuilder } from '../SelectedProductsBuilder';\n\n\n/// Utility\n\n/** string, number, null, arrays, plain objects; NOT functions, symbols etc. */\nexport type SerializableTypes = string | number | null | SerializableTypes[] | { [k in string|number]: SerializableTypes };\n\n\n/// Flows, Stages, Rules\n\n/** The keys of all flows that can be executed */\nexport type FlowKey = string;\n\n/** The keys of all stages that can be executed, in this order */\nexport const StageKey = ['config', 'vent', 'post', 'custom'] as const;\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type StageKey = typeof StageKey[number];\n\n/** The keys of all rules that can be executed */\nexport type RuleKey = string;\n\n\n/// Builder Rule Flow\n\nexport type BuilderRuleFlow = Record;\n\n\n/// Builder Rule Expression\n\nexport type BuiltinExpressionName = keyof SelectedProductsBuilder['builtinExpressions'];\n\n/** The context type passed to every BuilderRuleExpression */\nexport type BuilderRuleExpressionConfigContext = {\n basicValues: BasicInputsFormModel;\n configValues: ConfigurationInputsFormModel;\n totalLiftArea: number;\n productData: IProductData;\n};\n/** The context type passed to every BuilderRuleExpression in stage vent or later */\nexport type BuilderRuleExpressionVentContext = {\n ventilationComponentsValues: VentilationComponentsFormModel;\n};\n/** The context type passed to every BuilderRuleExpression in stage post or later */\nexport type BuilderRuleExpressionPostContext = {\n costCalculationValues: CostCalculationFormModel;\n selectedProducts: ISelectedProduct[];\n};\n/** @deprecated Can't be serialized */\nexport type BuilderRuleNativeExpression = (configCtx: BuilderRuleExpressionConfigContext, ventCtx: BuilderRuleExpressionVentContext, postCtx: BuilderRuleExpressionPostContext) => ResultT;\nexport type BuilderRuleConstantExpression = {\n constant: ResultT;\n};\nexport type BuilderRuleContextExpression = {\n ctx: keyof BuilderRuleExpressionConfigContext | keyof BuilderRuleExpressionVentContext | keyof BuilderRuleExpressionPostContext,\n key: string;\n};\n\nexport type BuilderRuleEqualsAnyExpression = {\n value: BuilderRuleExpression;\n equalsAny: ResultT extends boolean ? BuilderRuleExpression[] : never;\n};\n\ntype RelationalOperator = '=='|'!='|'>'|'>='|'<'|'<=';\nexport type BuilderRuleRelationalExpression = {\n value: BuilderRuleExpression;\n} & Partial<{\n [k in RelationalOperator]: ResultT extends boolean ? BuilderRuleExpression : never;\n}>;\n\nexport type BuilderRuleIsEmptyExpression = {\n value: BuilderRuleExpression;\n is: 'empty'|'not empty';\n};\n\n/*\ntype BuiltinRHS = Omit<\n BuilderRuleEqualsAnyExpression |\n BuilderRuleRelationalExpression,\n'value'>;\n*/\n\nexport type BuilderRuleAndExpression = ResultT extends boolean ? {\n and: BuilderRuleExpression[];\n} : never;\nexport type BuilderRuleOrExpression = ResultT extends boolean ? {\n or: BuilderRuleExpression[];\n} : never;\n\nexport type BuilderRuleBuiltinExpression = {\n builtin: BuiltinExpressionName | {\n name: BuiltinExpressionName;\n args?: SerializableTypes[];\n };\n};\n\nexport type BuilderRuleExpression =\n| BuilderRuleNativeExpression\n| BuilderRuleConstantExpression\n| BuilderRuleContextExpression\n| BuilderRuleEqualsAnyExpression\n| BuilderRuleRelationalExpression\n| BuilderRuleIsEmptyExpression\n| BuilderRuleAndExpression\n| BuilderRuleOrExpression\n| BuilderRuleBuiltinExpression;\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace BuilderRuleExpression {\n export function getSubtype(e: BuilderRuleExpression) {\n if (typeof e === 'function') return 'native';\n if ('ctx' in e && 'key' in e) return 'context';\n if ('value' in e) {\n return (['equalsAny', '==', '!=', '>', '>=', '<', '<=', 'is'] as const).find(k => k in e);\n }\n return (['constant', 'and', 'or', 'builtin'] as const).find(k => k in e);\n }\n}\n\n\n/// Builder Rule Execution\n\nexport type BuiltinExecutionName = keyof SelectedProductsBuilder['builtinExecutions'];\n\n/** The context type passed to every BuilderRuleExecution */\nexport type BuilderRuleExecutionConfigContext = BuilderRuleExpressionConfigContext & SelectedProductsBuilder['builtinExecutions'];\n/** The context type passed to every BuilderRuleExecution in stage vent or later */\nexport type BuilderRuleExecutionVentContext = BuilderRuleExpressionVentContext;\n/** The context type passed to every BuilderRuleExecution in stage post or later */\nexport type BuilderRuleExecutionPostContext = BuilderRuleExpressionPostContext;\n/**\n * A rule execution using a JS function\n * @deprecated Can't be serialized\n */\nexport type BuilderRuleNativeExecution = (configCtx: BuilderRuleExecutionConfigContext, ventCtx: BuilderRuleExecutionVentContext, postCtx: BuilderRuleExecutionPostContext) => void;\nexport type BuilderRuleBuiltinExecution = {\n builtin: {\n name: BuiltinExecutionName;\n args?: SerializableTypes[];\n };\n};\nexport type BuilderRuleExecution =\n| BuilderRuleNativeExecution\n| BuilderRuleBuiltinExecution;\n\n\n/// Builder Rule\n\n/** A rule that executes nothing */\nexport type EmptyBuilderRule = { empty: true; };\n/** A rule that executes a build action */\nexport type ExecBuilderRule = {\n /** One (or multiple, combined with AND) precondition(s) for this rule to execute */\n when?: BuilderRuleExpression | BuilderRuleExpression[];\n /** A rule execution that adds products */\n exec: BuilderRuleExecution;\n};\n/** Marks the default option for `SelectOneByBuilderRule` */\nexport const DEFAULT = Symbol('default');\n/** Select one rule by matching against a value */\nexport type SelectOneByBuilderRule = {\n /** A function that selects the value to select one rule by */\n selectOneBy: BuilderRuleExpression;\n /** If true, this rule throws if no matching option is present */\n sealed?: true;\n /** A mapping of match values to rules */\n options: Partial>;\n}\nexport type BuilderRuleErrorLevel = 'error'|'log';\nexport type BuilderRule = {\n description?: string;\n} & (EmptyBuilderRule| ExecBuilderRule | SelectOneByBuilderRule);\nexport type RootBuilderRule = BuilderRule & {\n /**\n * - config: Rules that access basic and config form values\n * - vent: Rules that access ventilation component form values\n * - post: Rules that act on products added by default and vent stages\n */\n stage: StageKey;\n /**\n * - error (default):\n * Exceptions thrown by the rule execution bubble all the way up\n * - log:\n * Exceptions thrown by the rule execution are logged and\n * the stage continues with the next rule\n */\n errorLevel?: BuilderRuleErrorLevel;\n}\n","import {createSelector} from \"reselect\";\nimport {IApplicationState} from \"../../shared/ApplicationState\";\nimport {syncedErrorsToList} from \"../../shared/components/error-list\";\nimport { INSTALLATION_POSITION } from \"../project/lookup\";\n\nexport const getCalculationState = (state: IApplicationState) => state.calculationState;\nexport const getActiveTabIndex = (state: IApplicationState) => getCalculationState(state)?.activeTabIndex;\nexport const getProductData = (state: IApplicationState) => state.project.productData;\nexport const getForm = (state: IApplicationState) => state.form;\n\n// --------------------------------\nexport const isAllFormReady = createSelector(\n getForm,\n (forms) => Boolean(\n forms.basicInputsForm &&\n forms.configurationInputsForm &&\n forms.ventilationComponentsForm &&\n forms.costCalculationForm\n )\n);\n\n// -------------------------------\n// Helpers\nconst selectedAIOBasicSet = (state: IApplicationState) => state.calculationState?.selectedAIOBasicSet;\nconst isWeatherProtectionNeeded = (state: IApplicationState) => state.form.basicInputsForm?.values.weathershelter;\nconst installationPosition = (state: IApplicationState) => state.form.basicInputsForm?.values.installationPosition;\n\n// --------------------------------\n// Is ... form valid\nconst isBasicInputsFormValid = (state: IApplicationState) => !state.form.basicInputsForm?.syncErrors;\n\nconst isConfigurationInputsFormValid = (state: IApplicationState) => {\n return !state.form?.configurationInputsForm?.syncErrors ||\n syncedErrorsToList(state.form.configurationInputsForm.syncErrors).length === 0;\n};\n\nconst isVentilationComponentsFormValid = (state: IApplicationState) => !state.form.ventilationComponentsForm?.syncErrors;\n\nexport const isCostCalculationFormValid = (state: IApplicationState) => !state.form.costCalculationForm?.syncErrors;\n// --------------------------------\n// Can navigate to ...\nexport const canNavigateToConfigurationForm = createSelector(\n isBasicInputsFormValid,\n selectedAIOBasicSet,\n (isBasicInputsFormValid, selectedAIOBasicSet) => isBasicInputsFormValid && !selectedAIOBasicSet,\n);\n\n// Show ventilation form when:\n// - No AIOBasicSet selected\n// - AIOBasicSet selected and weather protection needed\n// - Except for vertical weather protection because there is only one option\nexport const canNavigateToVentilationForm = createSelector(\n isBasicInputsFormValid,\n selectedAIOBasicSet,\n isWeatherProtectionNeeded,\n installationPosition,\n (isBasicInputsFormValid, selectedAIOBasicSet, isWeatherProtectionNeeded, installationPosition) => (\n isBasicInputsFormValid && (\n !selectedAIOBasicSet ||\n (isWeatherProtectionNeeded && installationPosition !== INSTALLATION_POSITION.VERTICAL)\n )\n ),\n);\n\nexport const canNavigateToCostCalculationForm = createSelector(\n isBasicInputsFormValid,\n isConfigurationInputsFormValid,\n isVentilationComponentsFormValid,\n selectedAIOBasicSet,\n (isBasicInputsFormValid, isConfigurationInputsFormValid, isVentilationComponentsFormValid, selectedAIOBasicSet) => (\n (isBasicInputsFormValid && isVentilationComponentsFormValid) &&\n // Manual configuration or AIO Basic Set\n (isConfigurationInputsFormValid || selectedAIOBasicSet != null)\n ),\n);\n","import { PRODUCT_GROUP } from \"../../product/lookup\";\nimport { IProduct } from \"../../product/types\";\nimport { getProductById } from \"../CalculationService\";\nimport { COMPONENT_GROUP_IDS_WITH_EINBAUWINKEL, getQuantitiesFromVentilationComponentsFormModel } from \"../CalculationService/VentilationComponents\";\nimport { RuleKey, RootBuilderRule } from \"./types\";\n\n\n/**\n * Rules for adding user-selected ventilation and weather protection components\n */\nconst ventCompFlow: Record = {\n // Includes NRWG, ACCESSORIES, WEATHERPROTECTION\n 'ventcomp-form-quantites': {\n stage: 'vent',\n exec: ({ addProductById, productData: { products } }, { ventilationComponentsValues }) => {\n getQuantitiesFromVentilationComponentsFormModel(ventilationComponentsValues)\n .filter(([_, quantity]) => quantity > 0)\n .map<[IProduct, number]>(([id, quantity]) => {\n const product = getProductById(products, id);\n if (!product) {\n console.debug(`Encountered missing product with id ${id}`);\n return null;\n }\n return [product, quantity];\n })\n .filter(p => p != null)\n .forEach(([product, quantity]) => addProductById(product.id, quantity));\n },\n },\n [PRODUCT_GROUP.BRACKET]: {\n stage: 'post',\n when: { ctx: 'ventilationComponentsValues', key: 'includeEinbauwinkel' },\n exec: ({ addProductById, productData: { products } }, _, { selectedProducts }) => {\n selectedProducts\n .filter(p => p.quantity > 0)\n .filter(p => COMPONENT_GROUP_IDS_WITH_EINBAUWINKEL.includes(p.productGroupId))\n .map<[IProduct, number]>(({ id, quantity }) => {\n const product = getProductById(products, id);\n if (!product) {\n console.debug(`Encountered missing product with id ${id}`);\n return null;\n }\n return [product, quantity];\n })\n .filter(x => x != null)\n .map<[IProduct, number]>(([ventProduct, quantity]) => {\n const bracketProduct = products.find(p => p.bxH === ventProduct.bxH && p.productGroupId === PRODUCT_GROUP.BRACKET);\n if (!bracketProduct) {\n console.debug(`Failed to find a mounting bracket for product ${ventProduct.id}`);\n return null;\n }\n return [bracketProduct, quantity];\n })\n .filter(x => x != null)\n .forEach(([product, quantity]) => addProductById(product.id, quantity));\n },\n },\n};\n\nexport default ventCompFlow;\n","import { SYSTEM, MACHINE_ROOM, LIFT_STATUS_DETECTION, SMOKE_DETECTION, INSTALLATION_POSITION, PROJECT_TYPE } from \"../../project/lookup\";\nimport { PRODUCT_CATEGORY, PRODUCT_KEY, PRODUCT_GROUP, PRODUCT_TYPE, CHARACTERISTIC_KEY } from \"../../product/lookup\";\n\nimport { getProductById } from \"../CalculationService\";\nimport { getLSTRepeaterCount } from \"../CalculationService/LiftStatusDetection\";\nimport { getSystem } from \"../CalculationService/System\";\n\nimport { RuleKey, RootBuilderRule } from \"./types\";\nimport ventCompFlow from \"./vent-comp.partial\";\n\n\n/**\n * Rules for regular BlueKit system configuration\n * @note: rules defined according to document: Abhängigkeiten im Kalkulationstool.pdf\n * as of Feb. 2024, this document has not been seen by the current development team.\n */\nconst defaultFlow: Record = {\n [PRODUCT_CATEGORY.BKSYSCTRL]: {\n stage: 'config',\n selectOneBy: ({ basicValues, configValues }) => getSystem(basicValues, configValues),\n sealed: true,\n options: {\n [SYSTEM.AIO_BASIC]: {\n exec: { builtin: { name: 'addProductByKey', args: [PRODUCT_KEY.AIO_BASIC_CENTRAL_UNIT, 1] }}\n },\n [SYSTEM.L_AIO]: {\n exec: { builtin: { name: 'addProductByKey', args: [PRODUCT_KEY.BK_AIO_CENTRAL_UNIT, 1] }},\n }\n },\n },\n // Rules for Assembly Set, Central Unit, Battery Pack, Additional Thermostat\n [PRODUCT_KEY.ASSEMBLY_SET_BLUE_KIT_LAIO]: {\n stage: 'config',\n exec: { builtin: { name: 'addProductByKey', args: [PRODUCT_KEY.ASSEMBLY_SET_BLUE_KIT_LAIO, 1] }},\n },\n // Rule 4.\n [PRODUCT_KEY.ADDITIONAL_THERMOSTAT]: {\n stage: 'config',\n when: { or: [\n { ctx: 'configValues', key: 'additionalThermostat' },\n { value: { ctx: 'basicValues', key: 'machineRoom' }, '==': { constant: MACHINE_ROOM.DOWN } },\n ]},\n exec: { builtin: { name: 'addProductByKey', args: [PRODUCT_KEY.ADDITIONAL_THERMOSTAT, 1] }},\n },\n\n // Rules for Lift Status Detection\n [PRODUCT_GROUP.LST]: {\n stage: 'config',\n selectOneBy: { ctx: 'configValues', key: 'liftStatusDetection' },\n sealed: true,\n options: {\n [LIFT_STATUS_DETECTION.LST_CO2_V3]: {\n exec: ({ basicValues: { shaftHeight, machineRoom, noOfElevators }, addProductByKey }) => {\n // Rule 3.\n addProductByKey(PRODUCT_KEY.LST_CO2_V3_AB, noOfElevators);\n\n // Rules 6 & 7.\n const repeaterCount = getLSTRepeaterCount({ shaftHeight, machineRoom });\n if (repeaterCount > 0) {\n // One repeater is the end module, all others are connect modules\n addProductByKey(PRODUCT_KEY.REPEATER_END_MODULE, 1);\n addProductByKey(PRODUCT_KEY.REPEATER_CONNECT_MODULE, repeaterCount - 1);\n }\n },\n },\n [LIFT_STATUS_DETECTION.FAULTALARMCONTACT]: { empty: true },\n },\n },\n\n // Rules for Smoke Detection Methods in shaft\n [PRODUCT_CATEGORY.SMOKEDECTCOMP]: {\n stage: 'config',\n selectOneBy: { ctx: 'configValues', key: 'smokeDetection' },\n sealed: true,\n options: {\n [SMOKE_DETECTION.RAS]: {\n exec: ({ basicValues: { shaftHeight, noOfElevators }, addProductByKey }) => {\n // Rules 9 & 10.\n const productKey = shaftHeight <= 42_000\n ? PRODUCT_KEY.RJ_RAS_MICROS_SENS_42_M\n : PRODUCT_KEY.RJ_RAS_PRO_SENS_200_M;\n const quantity = noOfElevators >= 3 ? 2 : 1;\n\n addProductByKey(productKey, quantity);\n\n // RAS Accessories\n // Previously in rule 'RAS-Components'\n addProductByKey(PRODUCT_KEY.RJ_RAS_ACCESSORIES, quantity);\n addProductByKey(PRODUCT_KEY.FILTER_RJ_FEIN_RAS, quantity);\n\n // Pipe height is shaft height rounded up to a multiple of 2500,\n // limited to no less than 5000 and no more than 75000.\n const HEIGHT_STEP = 2_500;\n const HEIGHT_MIN = 5_000;\n const HEIGHT_MAX = 75_000;\n\n const pipeHeight = Math.min(Math.max(Math.ceil(shaftHeight / HEIGHT_STEP) * HEIGHT_STEP, HEIGHT_MIN), HEIGHT_MAX);\n\n addProductByKey(`RJ-RAS-Pipe-${pipeHeight}` as PRODUCT_KEY, quantity);\n }\n },\n [SMOKE_DETECTION.SDLF1]: {\n when: { and: [\n { value: { ctx: 'basicValues' , key: 'shaftHeight' }, '>': { constant: 8_000 }},\n { value: { ctx: 'basicValues' , key: 'shaftHeight' }, '<=': { constant: 120_000 }},\n ]},\n exec: ({ basicValues: { shaftHeight, noOfElevators }, addProductByKey }) => {\n // Rules 11 & 12.\n\n const productKey = shaftHeight <= 50_000\n ? PRODUCT_KEY.SD_L_F_1_RJ_AIO_50_END\n : PRODUCT_KEY.SD_L_F_1_RJ_AIO_120_END;\n const quantity = noOfElevators >= 3 ? 2 : 1;\n \n addProductByKey(productKey, quantity);\n }\n },\n [SMOKE_DETECTION.POINTDETECTOR]: {\n when: { value: { ctx: 'basicValues', key: 'noOfElevators' }, '<=': { constant: 2 }},\n exec: ({ basicValues: { shaftHeight }, addProductByKey }) => {\n function getPDQuantityFromShaftHeight(shaftHeight: number) {\n /** Maximum distance between point detectors */\n const PD_DISTANCE = 12_000;\n /* For every 12m, add a point detector (P&G): 12m, 24m, 36m, ... */\n return Math.max(1, Math.ceil(shaftHeight / PD_DISTANCE));\n }\n\n const quantity = getPDQuantityFromShaftHeight(shaftHeight); // always >= 1\n addProductByKey(PRODUCT_KEY.PD_RJ_AIO_PG, quantity - 1);\n\n // Always add one point detector (End)\n addProductByKey(PRODUCT_KEY.PD_RJ_AIO_END, 1);\n }\n },\n [SMOKE_DETECTION.NONE]: { empty: true }\n },\n },\n\n // Rules for separate Smoke Detectors in Machine Room or Main Level\n 'Rauchmelder-Maschinenraum': {\n stage: 'config',\n selectOneBy: ({ basicValues, configValues }) => getSystem(basicValues, configValues),\n sealed: true,\n options: {\n [SYSTEM.AIO_BASIC]: {\n // BLU-249:\n // Manually configured AIO Basic needs special handling for machine room smoke detection\n // because unlike L-AIO it doesn't have a dedicated port for it.\n // Instead a P&G point detector is inserted into the shaft port line.\n when: { value: { ctx: 'basicValues', key: 'machineRoom' }, equalsAny: [\n { constant: MACHINE_ROOM.UP },\n { constant: MACHINE_ROOM.DOWN },\n ]},\n exec: { builtin: {\n name: 'addProductByKey',\n args: [PRODUCT_KEY.PD_RJ_AIO_PG, 1],\n }}\n },\n [SYSTEM.L_AIO]: {\n // BK-3468 - Rauchmelder in Zusammenhang mit Maschinenraum\n // Add the special machine room point detector if a machine room is present\n // or if additionalSmokeDetector is requested and the smokeDetection is not POINTDETECTOR\n when: { or: [\n { value: { ctx: 'basicValues', key: 'machineRoom' }, equalsAny: [\n { constant: MACHINE_ROOM.UP },\n { constant: MACHINE_ROOM.DOWN },\n ]},\n { and: [\n { value: { ctx: 'basicValues', key: 'machineRoom' }, '==': { constant: MACHINE_ROOM.NO } },\n { ctx: 'basicValues', key: 'additionalSmokeDetector' },\n { value: { ctx: 'configValues', key: 'smokeDetection' }, equalsAny: [\n { constant: SMOKE_DETECTION.SDLF1 },\n { constant: SMOKE_DETECTION.RAS },\n ]},\n ]}\n ]},\n exec: {\n builtin: {\n name: 'addProductByKey',\n args: [PRODUCT_KEY.RAUCHMELDER_MASCHINENRAUM, 1],\n }\n },\n }\n },\n },\n [PRODUCT_KEY.MAIN_LEVEL_SMOKE_DETECTOR]: {\n stage: 'config',\n when: { ctx: 'basicValues', key: 'mainLevelSmokeDetector' },\n exec: {\n builtin: {\n name: 'addProductByKey',\n args: [PRODUCT_KEY.MAIN_LEVEL_SMOKE_DETECTOR, 1],\n }\n },\n },\n\n // Rules for 8pol Interface Adapter Set\n // Rule 34.\n [PRODUCT_KEY.eightPinInterfaceAdapterSet + '-nrwgDelivered']: {\n // Pre-installed NRWG needs adapter to RJ45\n stage: 'config',\n when: { ctx: 'basicValues', key: 'nrwgDelivered' },\n exec: { builtin: {\n name: 'addProductByKey',\n args: [PRODUCT_KEY.eightPinInterfaceAdapterSet, 1],\n }}\n },\n\n [PRODUCT_KEY.eightPinInterfaceAdapterSet + '-systemIntegration']: {\n // System integration (BMZ/GLA) needs adapter to RJ45\n stage: 'config',\n when: { ctx: 'basicValues', key: 'systemIntegration' },\n exec: { builtin: {\n name: 'addProductByKey',\n args: [PRODUCT_KEY.eightPinInterfaceAdapterSet, 1],\n }}\n },\n\n [PRODUCT_KEY.eightPinInterfaceAdapterSet + '-eightPinInterfaceAdapterSet']: {\n // Manual selection (moved here to unify differentiation between systems)\n stage: 'config',\n when: { ctx: 'configValues', key: 'eightPinInterfaceAdapterSet' },\n exec: { builtin: { name: 'addProductByKey', args: [PRODUCT_KEY.eightPinInterfaceAdapterSet, 1] }}\n },\n\n [PRODUCT_KEY.RT_45_RJ]: makeRuleForProductFromConfigFormValueQuantity(PRODUCT_KEY.RT_45_RJ),\n [PRODUCT_KEY.RT_45_LRJ]: makeRuleForProductFromConfigFormValueQuantity(PRODUCT_KEY.RT_45_LRJ),\n [PRODUCT_KEY.RJ_45_SPLITTER]: makeRuleForProductFromConfigFormValueQuantity(PRODUCT_KEY.RJ_45_SPLITTER),\n [PRODUCT_KEY.KEY_SWITCH_LED]: makeRuleForProductFromConfigFormValueQuantity(PRODUCT_KEY.KEY_SWITCH_LED),\n [PRODUCT_KEY.VENTILATION_TIMER]: makeRuleForProductFromConfigFormValueFixed(PRODUCT_KEY.VENTILATION_TIMER),\n [PRODUCT_KEY.HUMIDITY_SENSOR]: makeRuleForProductFromConfigFormValueFixed(PRODUCT_KEY.HUMIDITY_SENSOR),\n [PRODUCT_KEY.SIREN_WITH_KEY_SWITCH]: makeRuleForProductFromConfigFormValueFixed(PRODUCT_KEY.SIREN_WITH_KEY_SWITCH),\n\n // Rules for FM-2M (function module for additional ventilation component motors)\n [PRODUCT_KEY.FM_2_M]: {\n stage: 'post',\n exec: ({ basicValues: { machineRoom }, addProductByKey }, _, { selectedProducts }) => {\n // BK-3450 - Neues Zubehör-Produkt FM-2M\n // Add a FM-2M for each ventilation component except the first one (if no machine room) or two (if machine room)\n const ventComponents = selectedProducts.filter(p => p.productTypeId === PRODUCT_TYPE.NRWG);\n const ventCompCount = ventComponents.map(p => p.quantity).reduce((a, e) => a + e, 0);\n\n const excludedCount = machineRoom === MACHINE_ROOM.NO ? 1 : 2;\n const quantity = Math.max(ventCompCount - excludedCount, 0);\n\n addProductByKey(PRODUCT_KEY.FM_2_M, quantity);\n }\n },\n [PRODUCT_KEY.FM_2_M + '-custom']: {\n stage: 'custom',\n when: { value: { ctx: 'costCalculationValues', key: 'fm-2m-custom' }, is: 'not empty'},\n exec: ({ addProductByKey }, _, { costCalculationValues, selectedProducts }) => {\n // BK-3450 - Neues Zubehör-Produkt FM-2M\n // Override FM-2M quantity with custom value if present\n const fm2m = selectedProducts.find(x => x.productKey === PRODUCT_KEY.FM_2_M);\n if (fm2m) {\n fm2m.estimatedQuantity = fm2m.quantity;\n fm2m.quantity = costCalculationValues['fm-2m-custom'];\n } else {\n addProductByKey(PRODUCT_KEY.FM_2_M, costCalculationValues['fm-2m-custom']);\n }\n }\n },\n\n [PRODUCT_KEY.RJ_45_SPLITTER + '-accessories']: {\n stage: 'post',\n exec: ({ addProductByKey }, _, { selectedProducts }) => {\n // For the accumulate count `n` of\n // - key switches,\n // - thermostats,\n // - timers,\n // - humidity sensors,\n // add `n - 1` splitters.\n\n const count = selectedProducts\n .filter(p => [\n PRODUCT_KEY.KEY_SWITCH_LED,\n PRODUCT_KEY.ADDITIONAL_THERMOSTAT,\n PRODUCT_KEY.VENTILATION_TIMER,\n PRODUCT_KEY.HUMIDITY_SENSOR,\n ].includes(p.productKey))\n .map(p => p.quantity)\n .reduce((a, b) => a + b, 0);\n\n if (count > 1) {\n addProductByKey(PRODUCT_KEY.RJ_45_SPLITTER, count - 1);\n }\n },\n },\n\n [PRODUCT_KEY.BATTERY_PACK + '-topUp']: {\n stage: 'post',\n when: [\n // Battery packs are incompatible with system == AIO-Basic;\n // ensure all cases handled here are either\n // (a) mutually exclusive with AIO-Basic, or\n // (b) approved to be fine without battery packs.\n // - nrwgDelivered: Excludes AIO-Basic.\n // - smokeDetection == RAS: The setup will not be EN 54 compliant,\n // but this is only relevant with systemIntegration (BMA).\n // Explicitly permitted. (BLU-270)\n { value: { builtin: 'getSystem' }, '!=': { constant: SYSTEM.AIO_BASIC }},\n { or: [\n { ctx: 'basicValues', key: 'nrwgDelivered' },\n { value: { ctx: 'configValues', key: 'smokeDetection' }, '==': { constant: SMOKE_DETECTION.RAS } },\n ]},\n ],\n exec: { builtin: { name: 'topUpProductByKey', args: [PRODUCT_KEY.BATTERY_PACK, 2] }},\n },\n\n // Rule 36.\n [PRODUCT_KEY.SMOKE_TEST_SPRAY]: {\n stage: 'post',\n when: [\n // POINTDETECTORs and RAS require smoke test spray, if montage is not included\n { value: { ctx: 'costCalculationValues', key: 'montageIncluded' }, '==': { constant: false } },\n (_1, _2, { selectedProducts }) => selectedProducts.some(p => (\n [PRODUCT_GROUP.POINTDETECTOR, PRODUCT_GROUP.RAS].includes(p.productGroupId) ||\n [PRODUCT_KEY.RAUCHMELDER_MASCHINENRAUM, PRODUCT_KEY.MAIN_LEVEL_SMOKE_DETECTOR].includes(p.productKey)\n )),\n ],\n exec: { builtin: { name: 'topUpProductByKey', args: [PRODUCT_KEY.SMOKE_TEST_SPRAY, 1] }},\n },\n\n ...ventCompFlow,\n\n // rule 34.: Add 8pol Interface Adapter Set for S9 or Tairmo Sets\n [PRODUCT_KEY.eightPinInterfaceAdapterSet + '-ventcomp-S9-Tairmo']: {\n stage: 'post',\n exec: ({ addProductByKey }, _, { selectedProducts }) => {\n const PRODUCT_GROUPS_REQUIRING_8PIN_INTERFACE_ADAPTER_SET = [PRODUCT_GROUP.THERMOS9, PRODUCT_GROUP.THERMOTAIRMO];\n\n selectedProducts\n .filter(p => PRODUCT_GROUPS_REQUIRING_8PIN_INTERFACE_ADAPTER_SET.includes(p.productGroupId))\n .map(p => p.quantity)\n .filter(quantity => quantity > 0)\n .forEach(quantity => addProductByKey(PRODUCT_KEY.eightPinInterfaceAdapterSet, quantity));\n },\n },\n\n // rule 8.: Battery pack\n // If we have any QUIET components, two battery packs are required.\n // This should only top-up to two bps (i.e. don't stack with other requirements for bps).\n [PRODUCT_KEY.BATTERY_PACK + '-topUp-ventcomp-quiet']: {\n stage: 'post',\n when: ({ productData: { characteristics }}, _, { selectedProducts }) => {\n const quietProductGroupIds = characteristics\n .filter(x => x.characteristicKey === CHARACTERISTIC_KEY.QUIET)\n .map(x => x.productGroupId);\n\n return selectedProducts.findIndex(p => p.quantity > 0 && quietProductGroupIds.includes(p.productGroupId)) !== -1;\n },\n exec: { builtin: { name: 'topUpProductByKey', args: [PRODUCT_KEY.BATTERY_PACK, 2] }},\n },\n};\n\nexport default defaultFlow;\n\nfunction makeRuleForProductFromConfigFormValueFixed(productKey: PRODUCT_KEY, quantity: number = 1): RootBuilderRule {\n return {\n stage: 'config',\n when: { ctx: 'configValues', key: productKey },\n exec: { builtin: { name: 'addProductByKey', args: [productKey, quantity] }},\n };\n}\n\nfunction makeRuleForProductFromConfigFormValueQuantity(productKey: PRODUCT_KEY): RootBuilderRule {\n return {\n stage: 'config',\n when: { value: { ctx: 'configValues', key: productKey }, '>': { constant: 0 }},\n exec: ({ configValues, addProductByKey }) => addProductByKey(productKey, configValues[productKey]),\n };\n}\n","import { getAIOBasicSetVent } from \"../CalculationService/AIOBasicSet\";\nimport { getAvailableVentilationComponentsForAIOBasicSet } from \"../CalculationService/VentilationComponents\";\nimport { INSTALLATION_POSITION } from \"../../project/lookup\";\nimport { PRODUCT_CATEGORY, PRODUCT_KEY } from \"../../product/lookup\";\n\nimport { RuleKey, RootBuilderRule } from \"./types\";\nimport ventCompFlow from \"./vent-comp.partial\";\n\n\n/**\n * Rules for AIO Basic Sets\n * @note: rules defined according to document: Abhängigkeiten im Kalkulationstool.pdf\n * as of Feb. 2024, this document has not been seen by the current development team.\n */\nconst completeSetFlow: Record = {\n [PRODUCT_CATEGORY.SETAIOB + '-vent']: {\n stage: 'config',\n when: { ctx: 'basicValues', key: 'aioBasicSet' },\n exec: ({ basicValues: { projectType }, totalLiftArea, addProductByKey }) => {\n const vent = getAIOBasicSetVent(projectType, totalLiftArea);\n if (vent) {\n addProductByKey(vent.productKey as PRODUCT_KEY, 1);\n }\n }\n },\n\n [PRODUCT_CATEGORY.SETAIOB + '-noOfInterfaceAdapters']: {\n stage: 'config',\n when: [\n { ctx: 'basicValues', key: 'aioBasicSet' },\n { value: { ctx: 'basicValues', key: 'noOfInterfaceAdapters' }, '>': { constant: 0 } },\n ],\n exec: ({ basicValues: { noOfInterfaceAdapters }, addProductByKey }) =>\n addProductByKey(PRODUCT_KEY.eightPinInterfaceAdapterSet, noOfInterfaceAdapters),\n },\n\n [PRODUCT_CATEGORY.SETAIOB + '-weathershelter']: {\n // ALAS weathershelter for AIO Basic Sets\n stage: 'config',\n when: [\n { ctx: 'basicValues', key: 'aioBasicSet' },\n { ctx: 'basicValues', key: 'weathershelter' },\n { value: { ctx: 'basicValues', key: 'installationPosition' }, '==': { constant: INSTALLATION_POSITION.VERTICAL }},\n ],\n exec: ({ basicValues: { projectType, installationPosition }, totalLiftArea, productData, addProductById }) => {\n const weatherProtectionComponents = getAvailableVentilationComponentsForAIOBasicSet(\n projectType, totalLiftArea, installationPosition, productData\n ).weatherProtectionComponents;\n addProductById(weatherProtectionComponents[0].id, 1);\n },\n },\n\n ...ventCompFlow,\n};\n\nexport default completeSetFlow;\n","import { v1 as uuidv1 } from \"uuid\";\n\nimport { IProduct, IProductData } from \"../product/types\";\n\nimport {\n INonStandardComponent,\n ISelectedProduct,\n} from './CalculationModels';\nimport { SelectedProductsBuilder } from \"./SelectedProductsBuilder\";\nimport { CalculationActionTypes, KnownCalculationActions } from './CalculationActions';\nimport { getTotalLiftArea } from \"./CalculationService/LiftArea\";\nimport {\n getApplicableAIOBasicSets,\n getSelectedAIOBasicSet,\n} from \"./CalculationService/AIOBasicSet\";\nimport {\n getAvailableVentilationComponents,\n ProductSelector\n} from \"./CalculationService/VentilationComponents\";\nimport {\n BasicInputsFormModel,\n ConfigurationInputsFormModel,\n VentilationComponentsFormModel,\n CostCalculationFormModel\n} from \"./models/FormModels\";\n\n\nexport interface ICalculationState {\n /** The index of the currently open tab (0-3) */\n activeTabIndex: number;\n\n /** The products selected by business logic rules */\n selectedProducts: ISelectedProduct[];\n\n /** Manually added non-standard components */\n nonStandardComponents: INonStandardComponent[];\n\n /// Ventilation Components\n\n /** The total lift area relevant for component selection */\n totalLiftArea: number;\n\n /**Suitable ventilation components */\n filteredVentilationComponents: ProductSelector[];\n\n /**Suitable weather protection components */\n filteredWeatherProtectionComponents: ProductSelector[];\n\n /// AIO Basic Sets\n\n /** The Set that has been selected by the user */\n selectedAIOBasicSet: ISelectedProduct;\n\n /** The Sets that are suitable for the customer given current form values */\n aioBasicSets: IProduct[];\n\n /** The user's choice to ignore proposed Sets */\n ignoreAIOBasicSets: boolean;\n\n /** AIO Basic Sets modal open state flags */\n isAIOBasicSetModalOpen: boolean;\n\n /// Interface to hook-based calculation API\n\n /**\n * Signifies that this state has been sufficiently initialized to enable fetching a cost calculation.\n * \n * This was introduced to stop the new `useCalculateCosts()` hook in `CostCalculationForm`\n * from calling the HTTP API before this state has been rehydrated via a `PROCESS_FORM_VALUES` action.\n * This was broken when cold-loading `/calculation/:projectId/cost-calculation`.\n */\n isReadyForCalculation: boolean;\n};\n\nexport enum Direction {\n Next = 'next',\n Previous = 'previous'\n}\n\nexport enum Tabs {\n BasicInput = 0,\n Configuration = 1,\n VentilationComponents = 2,\n CostCalculation = 3\n}\n\n\nconst initialState: ICalculationState = {\n // UI State\n activeTabIndex: 0,\n ignoreAIOBasicSets: false,\n isAIOBasicSetModalOpen: false,\n isReadyForCalculation: false,\n\n // Calculation State\n aioBasicSets: [],\n selectedProducts: [],\n selectedAIOBasicSet: null,\n totalLiftArea: 0,\n filteredVentilationComponents: [],\n filteredWeatherProtectionComponents: [],\n nonStandardComponents: []\n};\n\nfunction processFormValuesToStateUpdate(\n basicValues: BasicInputsFormModel,\n configValues: ConfigurationInputsFormModel,\n ventilationComponentsValues: VentilationComponentsFormModel,\n costCalculationValues: CostCalculationFormModel,\n productData: IProductData,\n): Partial {\n const totalLiftArea = getTotalLiftArea(basicValues);\n if (!totalLiftArea) {\n return {\n selectedProducts: [],\n selectedAIOBasicSet: null,\n totalLiftArea,\n filteredVentilationComponents: [],\n filteredWeatherProtectionComponents: [],\n aioBasicSets: [],\n isReadyForCalculation: false,\n };\n }\n\n const selectedAIOBasicSet = getSelectedAIOBasicSet(basicValues, productData.products);\n\n let selectedProducts: ISelectedProduct[] = [];\n let isReadyForCalculation = false;\n\n if (configValues && ventilationComponentsValues) {\n const flow = selectedAIOBasicSet ? 'complete-set' : 'default';\n try {\n selectedProducts = SelectedProductsBuilder.selectProductsFromFlow(flow,\n totalLiftArea,\n basicValues,\n configValues,\n ventilationComponentsValues,\n costCalculationValues,\n productData\n );\n isReadyForCalculation = true;\n } catch (e) {\n console.error(`SelectedProductsBuilder.selectProductsFromFlow('${flow}') failed`, e);\n }\n }\n\n const minArea = totalLiftArea;\n const availableComponents = getAvailableVentilationComponents(totalLiftArea, minArea, basicValues, configValues, productData);\n\n return {\n totalLiftArea,\n selectedAIOBasicSet,\n selectedProducts,\n aioBasicSets: getApplicableAIOBasicSets(basicValues, productData.products),\n filteredVentilationComponents: availableComponents.ventComponents,\n filteredWeatherProtectionComponents: availableComponents.weatherProtectionComponents,\n isReadyForCalculation,\n };\n}\n\nexport const reducer = (state = initialState, action: KnownCalculationActions): ICalculationState => {\n const { activeTabIndex } = state;\n\n switch (action.type) {\n case CalculationActionTypes.PROCESS_FORM_VALUES: {\n\n const basicValues = action?.payload?.basicInputsForm?.values;\n const configValues = action?.payload?.configurationInputsForm?.values;\n const ventilationComponentsValues = action?.payload?.ventilationComponentsForm?.values;\n const costCalculationValues = action?.payload?.costCalculationForm?.values;\n const productData = action?.extraProductData;\n\n const stateOverrides = processFormValuesToStateUpdate(\n basicValues, configValues,\n ventilationComponentsValues, costCalculationValues,\n productData\n );\n\n return {\n ...state,\n ...stateOverrides,\n };\n\n }\n\n case CalculationActionTypes.SWITCH_TAB:\n\n if (action.payload === Direction.Previous && activeTabIndex === Tabs.CostCalculation && state.selectedAIOBasicSet) {\n // when a set is selected and navigating backwards from cost calculation tab,\n // then go to basic inputs form\n return {\n ...state,\n activeTabIndex: Tabs.BasicInput,\n isAIOBasicSetModalOpen: true,\n };\n }\n\n if (action.payload === Direction.Next && activeTabIndex === Tabs.BasicInput) {\n // when on basic inputs form and clicking on next button, ignore sets\n return {\n ...state,\n activeTabIndex: activeTabIndex + 1,\n ignoreAIOBasicSets: true\n };\n }\n\n if (action.payload === Direction.Next && activeTabIndex < Tabs.CostCalculation) {\n return {...state, activeTabIndex: activeTabIndex + 1};\n }\n\n if (action.payload === Direction.Previous && activeTabIndex > Tabs.BasicInput) {\n return {...state, activeTabIndex: activeTabIndex - 1};\n }\n\n break;\n\n case CalculationActionTypes.SWITCH_TAB_INDEX:\n return {...state, activeTabIndex: action.payload};\n\n\n case CalculationActionTypes.IGNORE_AIO_BASIC_SETS:\n const ignoreAIOBasicSets = !!action.payload;\n return {\n ...state,\n ignoreAIOBasicSets,\n selectedAIOBasicSet: ignoreAIOBasicSets ? null : state.selectedAIOBasicSet,\n };\n\n case CalculationActionTypes.SET_AIO_BASIC_SET_MODAL_VISIBILITY:\n return {\n ...state,\n isAIOBasicSetModalOpen: action.payload,\n };\n\n case CalculationActionTypes.SET_NON_STANDARD_COMPONENT_LIST:\n return {\n ...state,\n nonStandardComponents: action.payload,\n };\n\n case CalculationActionTypes.ADD_NON_STANDARD_COMPONENT: \n return {\n ...state,\n nonStandardComponents: [\n ...state.nonStandardComponents,\n {\n productId: uuidv1(),\n description: action.payload.description,\n price: action.payload.price,\n quantity: action.payload.quantity,\n },\n ],\n };\n\n case CalculationActionTypes.REMOVE_NON_STANDARD_COMPONENT:\n return {\n ...state,\n nonStandardComponents: state.nonStandardComponents.filter(c => c.productId !== action.payload),\n };\n }\n\n return state;\n};\n","import { PRODUCT_KEY } from '../product/lookup';\nimport { IProductData, IProduct } from '../product/types';\n\nimport { ISelectedProduct } from './CalculationModels';\nimport { getProductById, getProductByKey } from './CalculationService';\n\nimport { BasicInputsFormModel, ConfigurationInputsFormModel, VentilationComponentsFormModel, CostCalculationFormModel } from './models/FormModels';\n\nimport { FlowKey, StageKey, RuleKey, BuilderRule, BuilderRuleExecution, DEFAULT, BuilderRuleErrorLevel, BuilderRuleFlow, BuilderRuleExpression, BuilderRuleNativeExpression, BuilderRuleConstantExpression, BuilderRuleBuiltinExpression, BuilderRuleContextExpression, BuilderRuleAndExpression, BuilderRuleOrExpression, BuilderRuleRelationalExpression, BuilderRuleEqualsAnyExpression, BuilderRuleIsEmptyExpression } from './SelectedProductsBuilder/types';\nimport defaultFlow from './SelectedProductsBuilder/default.flow';\nimport completeSetFlow from './SelectedProductsBuilder/complete-set.flow';\nimport { getSystem } from './CalculationService/System';\n\n\nexport class SelectedProductsBuilder {\n\n /// Public API\n\n public static selectProductsFromFlow(flow: FlowKey, ...args: PrivateConstructorParameters) {\n const builder = new SelectedProductsBuilder(...args);\n builder.runFlow(flow);\n return builder.selectedProducts;\n }\n\n /// Internal Execution State\n\n private selectedProducts: ISelectedProduct[] = [];\n\n private constructor(\n private readonly totalLiftArea: number,\n private readonly basicValues: BasicInputsFormModel,\n private readonly configValues: ConfigurationInputsFormModel,\n private readonly ventilationComponentsValues: VentilationComponentsFormModel,\n private readonly costCalculationValues: CostCalculationFormModel,\n private readonly productData: IProductData,\n ) {}\n\n /// Rule Engine\n\n private runFlow(flowKey: FlowKey) {\n this.pushContext(`flow=${flowKey}`);\n try {\n if (!(flowKey in flows)) {\n throw new SelectedProductsBuilderError(this.logContext, `Flow with key \"${flowKey}\" not found`);\n }\n const flow = flows[flowKey];\n StageKey.forEach(stage => this.runStage(flow, stage));\n } finally {\n this.popContext();\n }\n }\n\n private runStage(flow: BuilderRuleFlow, stage: StageKey) {\n this.pushContext(`stage=${stage}`);\n try {\n Object.keys(flow).forEach(key => {\n this.runRule(flow, stage, key);\n });\n } finally {\n this.popContext();\n }\n }\n\n private runRule(flow: BuilderRuleFlow, stage: StageKey, key: RuleKey) {\n this.pushContext(`rule=${key}`);\n try {\n if (!(key in flow)) {\n throw new SelectedProductsBuilderError(this.logContext, `Rule with key \"${key}\" not found`);\n }\n const rule = flow[key];\n\n if (rule.stage !== stage) {\n return null;\n }\n\n // this.log(`def=${JSON.stringify(rule, null, '')}`);\n\n const execution = this.getRuleExecution(rule, stage);\n if (execution) {\n const errorLevel = 'errorLevel' in rule ? rule.errorLevel : 'error';\n this.executeRule(execution, errorLevel, stage);\n } else {\n this.pushContext('skip');\n this.log();\n this.popContext();\n }\n } finally {\n this.popContext();\n }\n }\n\n private getRuleExecution(rule: BuilderRule, currentStage: StageKey): BuilderRuleExecution|null {\n this.pushContext(`getRuleExecution`);\n try {\n const configCtx = {\n basicValues: this.basicValues,\n configValues: this.configValues,\n productData: this.productData,\n totalLiftArea: this.totalLiftArea,\n };\n const ventCtx = StageKey.indexOf(currentStage) >= StageKey.indexOf('vent') ? {\n ventilationComponentsValues: this.ventilationComponentsValues,\n } : null;\n const postCtx = StageKey.indexOf(currentStage) >= StageKey.indexOf('post') ? {\n costCalculationValues: this.costCalculationValues,\n selectedProducts: this.selectedProducts,\n } : null;\n\n if ('empty' in rule && rule.empty) {\n return null;\n } else if ('exec' in rule) {\n if ('when' in rule) {\n const when = Array.isArray(rule.when) ? rule.when : [rule.when];\n if (!when.every(condition => this.runExpression(condition, configCtx, ventCtx, postCtx))) {\n return null;\n }\n }\n\n return rule.exec;\n } else if ('selectOneBy' in rule && 'options' in rule) {\n const selectorValue = this.runExpression(rule.selectOneBy, configCtx, ventCtx, postCtx);\n if (selectorValue in rule.options) {\n return this.getRuleExecution(rule.options[selectorValue], currentStage);\n } else if (DEFAULT in rule.options) {\n return this.getRuleExecution(rule.options[DEFAULT], currentStage);\n } else if (rule.sealed) {\n throw new SelectedProductsBuilderError(this.logContext, `Selector value \"${selectorValue}\" has no matching case in a sealed selection`);\n }\n\n return null;\n }\n\n throw new SelectedProductsBuilderError(this.logContext, 'Illformed rule');\n } finally {\n this.popContext();\n }\n }\n\n private runExpression(e: BuilderRuleExpression, ...ctxArgs: Parameters>) {\n const subtype = BuilderRuleExpression.getSubtype(e);\n switch (subtype) {\n case null:\n throw new SelectedProductsBuilderError(this.logContext, 'Illformed expression');\n case 'native':\n return (e as BuilderRuleNativeExpression)(...ctxArgs);\n case 'constant':\n return (e as BuilderRuleConstantExpression).constant;\n case 'builtin': {\n const exp = e as BuilderRuleBuiltinExpression;\n const name = typeof exp.builtin !== 'string' ? exp.builtin.name : exp.builtin;\n const args = typeof exp.builtin !== 'string' ? exp.builtin.args ?? [] : [];\n\n if (!(name in this.builtinExpressions)) {\n throw new SelectedProductsBuilderError(this.logContext, `Unknown builtin \"${name}\"`);\n }\n\n const builtin = this.builtinExpressions[name] as ((...args: any[]) => void);\n return builtin(...args);\n }\n case 'and':\n return (e as BuilderRuleAndExpression).and\n .every(e => this.runExpression(e, ...ctxArgs));\n case 'or':\n return (e as BuilderRuleOrExpression).or\n .some(e => this.runExpression(e, ...ctxArgs));\n case 'context': {\n const { ctx, key } = e as BuilderRuleContextExpression;\n const ctxValue = this[ctx];\n\n if (typeof ctxValue !== 'object') {\n throw new SelectedProductsBuilderError(this.logContext, `Illegal property access on non-object: ${ctx}[${key}]`);\n }\n if (!(key in ctxValue)) {\n return null;\n }\n\n return ctxValue[key];\n }\n case 'equalsAny': {\n const exp = e as BuilderRuleEqualsAnyExpression;\n const value = this.runExpression(exp.value, ...ctxArgs);\n const eq = Array.isArray(exp.equalsAny) ? exp.equalsAny : [exp.equalsAny];\n\n return eq.some(e => value === this.runExpression(e, ...ctxArgs));\n }\n case 'is': { // null or undefined (empty) / not null or undefined (not empty)\n const exp = e as BuilderRuleIsEmptyExpression;\n const value = this.runExpression(exp.value, ...ctxArgs);\n\n /** Whether to check for empty or not empty */\n const checkForEmpty = (exp.is === 'empty');\n /** Whether the value is empty (null or undefined) */\n const valueIsEmpty = (value === null || value === undefined)\n\n return checkForEmpty === valueIsEmpty;\n }\n default: { // Relational expressions\n const exp = e as BuilderRuleRelationalExpression;\n const value = this.runExpression(exp.value, ...ctxArgs);\n const rhsValue = this.runExpression(exp[subtype], ...ctxArgs);\n\n switch (subtype) {\n case '==': return value === rhsValue;\n case '!=': return value !== rhsValue;\n case '>': return value > rhsValue;\n case '<': return value < rhsValue;\n case '>=': return value >= rhsValue;\n case '<=': return value <= rhsValue;\n default: const _completeCheck: never = subtype;\n }\n }\n }\n\n throw new SelectedProductsBuilderError(this.logContext, 'Illformed expression');\n }\n\n private executeRule(ruleExecution: BuilderRuleExecution, errorLevel: BuilderRuleErrorLevel, currentStage: StageKey) {\n this.pushContext(`execute`);\n this.log();\n try {\n if ('builtin' in ruleExecution) {\n if (!(ruleExecution.builtin.name in this.builtinExecutions)) {\n throw new SelectedProductsBuilderError(this.logContext, `Unknown builtin \"${ruleExecution.builtin.name}\"`);\n }\n const builtin = this.builtinExecutions[ruleExecution.builtin.name] as ((...args: any[]) => void);\n const args = ruleExecution.builtin.args ?? [];\n builtin(...args);\n } else if (typeof ruleExecution === 'function') {\n const configCtx = {\n basicValues: this.basicValues,\n configValues: this.configValues,\n productData: this.productData,\n totalLiftArea: this.totalLiftArea,\n ...this.builtinExecutions,\n };\n const ventCtx = StageKey.indexOf(currentStage) >= StageKey.indexOf('vent') ? {\n ventilationComponentsValues: this.ventilationComponentsValues,\n } : null;\n const postCtx = StageKey.indexOf(currentStage) >= StageKey.indexOf('post') ? {\n costCalculationValues: this.costCalculationValues,\n selectedProducts: this.selectedProducts,\n } : null;\n\n ruleExecution(configCtx, ventCtx, postCtx);\n }\n } catch (e) {\n switch (errorLevel) {\n case 'log':\n this.log(`Log`, e);\n return;\n case 'error':\n default:\n this.log(`Error`, e);\n throw e;\n\n }\n } finally {\n this.popContext();\n }\n }\n\n\n /// Builtin Expressions\n\n private builtinExpressions = {\n 'getSystem': this.getSystem.bind(this) as typeof SelectedProductsBuilder.prototype.getSystem,\n };\n\n private getSystem() {\n return getSystem(this.basicValues, this.configValues);\n }\n\n /// Builtin Executions\n\n private builtinExecutions = {\n 'addProductByKey': this.addProductByKey.bind(this) as typeof SelectedProductsBuilder.prototype.addProductByKey,\n 'addProductById': this.addProductById.bind(this) as typeof SelectedProductsBuilder.prototype.addProductById,\n 'topUpProductByKey': this.topUpProductByKey.bind(this) as typeof SelectedProductsBuilder.prototype.topUpProductByKey,\n };\n\n private addProductByKey(key: PRODUCT_KEY, quantity: number) {\n const product = getProductByKey(this.productData.products, key);\n if (!product) throw new SelectedProductsBuilderError(this.logContext, `no product matching product key \"${key}\"`);\n this._addProduct(product, quantity);\n }\n\n private topUpProductByKey(key: PRODUCT_KEY, minimumQuantity: number) {\n const product = getProductByKey(this.productData.products, key);\n if (!product) throw new SelectedProductsBuilderError(this.logContext, `no product matching product key \"${key}\"`);\n this._topUpProduct(product, minimumQuantity);\n }\n\n private addProductById(id: string, quantity: number) {\n const product = getProductById(this.productData.products, id);\n if (!product) throw new SelectedProductsBuilderError(this.logContext, `no product matching product id \"${id}\"`);\n this._addProduct(product, quantity);\n }\n\n /// Implementation\n\n private _addProduct(product: IProduct, quantity: number) {\n this.pushContext(`addProduct?product=${product.productKey ?? product.id}&quantity=${quantity}`);\n this.log();\n try {\n if (quantity <= 0) return;\n if (product === undefined) throw new SelectedProductsBuilderError(this.logContext, \"product is undefined\");\n\n const existingSelectedProduct = this.selectedProducts.find(p => p.id === product.id);\n if (existingSelectedProduct) {\n existingSelectedProduct.estimatedQuantity += quantity;\n existingSelectedProduct.quantity += quantity;\n } else {\n this.selectedProducts.push({\n id: product.id,\n productKey: product.productKey,\n description: product.description,\n estimatedQuantity: quantity,\n quantity: quantity,\n dhNo: product.dhNo,\n productTypeId: product.productTypeId,\n productGroupId: product.productGroupId,\n });\n }\n } finally {\n this.popContext();\n }\n }\n\n /**\n * Make sure that at least `minimumQuantity` units of `product` are selected\n * @note Only use this is `post` stage rules\n */\n private _topUpProduct(product: IProduct, minimumQuantity: number) {\n this.pushContext(`topUpProduct?product=${product.productKey ?? product.id}?minimumQuantity=${minimumQuantity}`);\n this.log();\n try {\n if (minimumQuantity <= 0) return;\n const existingSelectedProduct = this.selectedProducts.find(p => p.id === product.id);\n if (existingSelectedProduct) {\n existingSelectedProduct.estimatedQuantity = Math.max(existingSelectedProduct.estimatedQuantity, minimumQuantity);\n existingSelectedProduct.quantity = Math.max(existingSelectedProduct.quantity, minimumQuantity);\n } else {\n this.selectedProducts.push({\n id: product.id,\n productKey: product.productKey,\n description: product.description,\n estimatedQuantity: minimumQuantity,\n quantity: minimumQuantity,\n dhNo: product.dhNo,\n productTypeId: product.productTypeId,\n productGroupId: product.productGroupId,\n });\n }\n } finally {\n this.popContext();\n }\n }\n\n /// Logging\n\n private log(...args: any[]) {\n // console.debug('[SelectedProductsBuilder]', this.logContext.join('/'), ...args);\n }\n\n private logContext: string[] = [];\n\n private pushContext(v: string) {\n this.logContext.push(v);\n }\n\n private popContext() {\n this.logContext.pop();\n }\n}\n\nclass SelectedProductsBuilderError extends Error {\n constructor(\n public readonly logContext: string[],\n public readonly cause: Error|string,\n ) {\n super(`[${logContext.join('/')}] ${cause}`)\n }\n}\n\nconst flows: Record = {\n 'default': defaultFlow,\n 'complete-set': completeSetFlow,\n};\n","import {put, select, takeEvery} from 'redux-saga/effects';\nimport {change, initialize} from \"redux-form\";\n\nimport {IApplicationState} from '../../shared/ApplicationState';\nimport { IProductData } from '../product/types';\nimport {ReduxFormKeys} from \"../form/ReduxFormKeys\";\nimport {formActionCreator, FormActionTypes} from \"../form/FormActions\";\n\nimport {projectApi, projectApiActionCreator} from \"./ProjectApi.redux\";\nimport {calculationActionCreator, CalculationActionTypes} from './CalculationActions';\nimport { ICalculationFormsState } from \"./CalculationModels\";\nimport {\n getProductById,\n} from \"./CalculationService\";\nimport { getApplicableSmokeDetectionMethods } from \"./CalculationService/SmokeDetection\";\nimport { getApplicatableLiftStatusDetectionMethods } from './CalculationService/LiftStatusDetection';\nimport {\n getAvailableLiftAreaPercentages,\n getTotalLiftArea,\n} from \"./CalculationService/LiftArea\";\nimport { getAvailableSystems } from \"./CalculationService/System\";\nimport {\n getAvailableVentilationComponents,\n getQuantitiesFromVentilationComponentsFormModel\n} from \"./CalculationService/VentilationComponents\";\nimport {COUNTRY, LIFT_AREA_PERCENTAGE, SMOKE_DETECTION} from '../project/lookup';\nimport { getActiveTabIndex, getForm, getProductData } from './calculation.selector';\nimport { Direction, Tabs } from './CalculationReducer';\n\n\ninterface ReduxFormChangeAction {\n type: CalculationActionTypes.REDUX_FORM_CHANGE;\n payload: any;\n meta: {\n field: string;\n form: string;\n touch: boolean;\n };\n}\n\n/** @see `CalculationActionTypes.REQUEST_SWITCH_TAB` */\nfunction* requestSwitchTab({ payload: tabKey }: ReturnType) {\n const activeTabIndex = yield select(getActiveTabIndex);\n const loadedProject = yield select(projectApi.makeSelectBase('entity'));\n\n if (activeTabIndex === Tabs.BasicInput && tabKey === Direction.Next) {\n if (loadedProject?.id == null) {\n // Send update request to create the project\n yield put(projectApiActionCreator.updateRequest(loadedProject?.id, loadedProject?.state));\n }\n }\n\n window.scrollTo({top: 0, behavior: 'smooth'});\n\n yield put(calculationActionCreator.switchTab(tabKey));\n yield calculateCostsAndLoadFiles();\n}\n\n/** @see `CalculationActionTypes.REQUEST_SWITCH_TAB_INDEX` */\nfunction* requestSwitchTabIndex({ payload: tabIndex }: ReturnType) {\n const activeTabIndex = yield select(getActiveTabIndex);\n\n if (activeTabIndex === tabIndex) return;\n\n const loadedProject = yield select(projectApi.makeSelectBase('entity'));\n const form = yield select(getForm);\n\n if (form.ventilationComponentsForm) {\n if (activeTabIndex === Tabs.BasicInput && tabIndex !== Tabs.BasicInput) {\n if (loadedProject?.id == null) {\n // Send update request to create the project\n yield put(projectApiActionCreator.updateRequest(loadedProject?.id, loadedProject?.state));\n }\n }\n }\n\n window.scrollTo({top: 0, behavior: 'smooth'});\n\n yield put(calculationActionCreator.switchTabIndex(tabIndex));\n yield calculateCostsAndLoadFiles();\n}\n\nfunction* checkForAIOBasicSets() {\n const aioBasicSet = yield select((state: IApplicationState) => state.form.basicInputsForm.values.aioBasicSet);\n const activeTabIndex = yield select(getActiveTabIndex);\n\n if (aioBasicSet != null && activeTabIndex === 0) {\n yield put(calculationActionCreator.ignoreAIOBasicSets(false));\n yield put(calculationActionCreator.setAIOBasicSetModalVisibility(true));\n }\n}\n\nfunction sanitizeFormValuesForInitialize(formValues: ICalculationFormsState, productData: IProductData) {\n /* eslint-disable no-lone-blocks */\n\n // Force liftAreaPercentage to legal value\n {\n const { liftAreaPercentage } = formValues.basicInputsForm.values;\n const percentages = getAvailableLiftAreaPercentages(formValues.basicInputsForm.values);\n if (!liftAreaPercentage || !percentages.includes(liftAreaPercentage as LIFT_AREA_PERCENTAGE)) {\n formValues.basicInputsForm.values.liftAreaPercentage = percentages[0];\n }\n }\n\n // Revalidate lift area\n formValues.basicInputsForm.values.calculatedVentilationArea = getTotalLiftArea(formValues.basicInputsForm.values);\n\n const basicInputFormValues = formValues.basicInputsForm.values;\n\n // Revalidate smoke detection method selection\n {\n const smokeDetectionMethods = getApplicableSmokeDetectionMethods(basicInputFormValues, formValues.configurationInputsForm.values);\n const defaultSmokeDetectionMethod = smokeDetectionMethods.length ? smokeDetectionMethods[0] : null;\n\n if (formValues.configurationInputsForm.values.smokeDetection == null) {\n if (!!defaultSmokeDetectionMethod) {\n formValues.configurationInputsForm.values.smokeDetection = defaultSmokeDetectionMethod;\n }\n } else if (!smokeDetectionMethods.find(x => x === formValues.configurationInputsForm.values.smokeDetection)) {\n // The selected smoke detection method is not applicable, replace with default\n if (!!defaultSmokeDetectionMethod) {\n formValues.configurationInputsForm.values.smokeDetection = defaultSmokeDetectionMethod;\n }\n }\n }\n\n // Revalidate system selection\n {\n if (formValues.configurationInputsForm.values.system !== null) {\n if (!getAvailableSystems(basicInputFormValues).find(x => x === formValues.configurationInputsForm.values.system)) {\n formValues.configurationInputsForm.values.system = null\n }\n }\n if (formValues.configurationInputsForm.values.system == null) {\n formValues.configurationInputsForm.values.system = getAvailableSystems(basicInputFormValues)[0];\n }\n }\n\n // No montage outside Germany\n {\n if (basicInputFormValues.country !== COUNTRY.DE) {\n formValues.costCalculationForm.values.montageIncluded = false;\n formValues.costCalculationForm.values.montageBuildingLocation = null;\n }\n }\n\n /* eslint-enable no-lone-blocks */\n}\n\n/** @see `CalculationActionTypes.INITIALIZE_FORM` */\nfunction* initializeForm({ formValues, productData }: ReturnType) {\n console.log(\"---> INITIALIZE FORM\");\n\n sanitizeFormValuesForInitialize(formValues, productData);\n\n yield put(initialize(ReduxFormKeys.basicInputsForm, formValues.basicInputsForm.values));\n yield put(initialize(ReduxFormKeys.configurationInputsForm, formValues.configurationInputsForm.values));\n yield put(initialize(ReduxFormKeys.ventilationComponentsForm, formValues.ventilationComponentsForm.values));\n yield put(initialize(ReduxFormKeys.costCalculationForm, formValues.costCalculationForm.values));\n\n console.log(\"---> PROCESS FORM: INIT\");\n yield put(calculationActionCreator.processFormValues(formValues, productData));\n\n yield put(change(ReduxFormKeys.ventilationComponentsForm, 'validationTrigger', new Date()));\n\n yield checkForAIOBasicSets();\n\n yield calculateCostsAndLoadFiles();\n}\n\nfunction* calculateCostsAndLoadFiles() {\n const activeTabIndex = yield select(getActiveTabIndex);\n const loadedProject = yield select(projectApi.makeSelectBase('entity'));\n\n if (!loadedProject) {\n return;\n }\n\n if (activeTabIndex === 2) {\n const formValues: ICalculationFormsState = yield select(getForm);\n const productData: IProductData = yield select(getProductData);\n\n const basicValues = formValues?.basicInputsForm?.values;\n const configValues = formValues?.configurationInputsForm?.values;\n const ventilationComponentsValues = formValues?.ventilationComponentsForm?.values;\n\n const minArea = getTotalLiftArea(basicValues);\n\n const availableVentilationComponents = getAvailableVentilationComponents(minArea, minArea, basicValues, configValues, productData);\n\n // Ventilation components that are not available due to slider min/max\n const ventComponentIdsToRemove = getQuantitiesFromVentilationComponentsFormModel(ventilationComponentsValues).filter(([id, _]) =>\n getProductById(availableVentilationComponents.ventComponents, id) == null &&\n getProductById(availableVentilationComponents.weatherProtectionComponents, id) == null\n );\n\n yield put(formActionCreator.resetFields(ReduxFormKeys.ventilationComponentsForm, ventComponentIdsToRemove.map(id => `quantity-${id}`)));\n yield put(change(ReduxFormKeys.ventilationComponentsForm, 'validationTrigger', new Date()));\n }\n}\n\n/**\n * Change form value with `key` in `form` to `value`. \n * Dispatches a change action.\n * @param formValues The current form values\n * @param form The form key\n * @param key The form value key\n * @param value The new value\n * @returns `true` if the value has been changed, `false` if the previous value is equal to `value`.\n */\nfunction* tryChange(formValues: ICalculationFormsState, form: keyof ICalculationFormsState, key: string, value: any) {\n if (value !== formValues[form].values[key]) {\n // console.log(`CHANGE NOW ${form}.${key}`, value);\n yield put(change(form, key, value));\n return true;\n }\n // console.log(`CHANGE NOT NOW ${form}.${key}`, value);\n return false;\n}\n\n/**\n * Reset the product quantity form values in `ventilationComponentsForm`. \n * Dispatches `resetFields` and `change` actions.\n */\nfunction* _resetVentilationComponentQuantities(formValues: ICalculationFormsState) {\n // Get selected ventilation and weather components\n const formValueKeys = getQuantitiesFromVentilationComponentsFormModel(formValues.ventilationComponentsForm?.values).map(([id, _]) => `quantity-${id}`);\n // Reset the quantity fields of all selected ventilation components\n yield put(formActionCreator.resetFields(ReduxFormKeys.ventilationComponentsForm, formValueKeys));\n\n // Trigger re-validation\n yield put(change(ReduxFormKeys.ventilationComponentsForm, 'validationTrigger', new Date()));\n};\n\n/** @see `CalculationActionTypes.REDUX_FORM_CHANGE` @see `FormActionTypes.RESET_FIELDS` */\nfunction* changeForm(action: ReduxFormChangeAction) {\n // console.log(\"---> CHANGE FORM\");\n\n let formValues: ICalculationFormsState = yield select(getForm);\n\n const basicInputFormValues = formValues.basicInputsForm.values;\n const configurationInputsFormValues = formValues.configurationInputsForm.values;\n const costCalculationFormValues = formValues.costCalculationForm.values;\n\n const productData: IProductData = yield select(getProductData);\n\n // Field updates that may change the available lift area percentages\n if (['country', 'projectType'].includes(action.meta?.field)) {\n const projectType = action.meta.field === 'projectType' ? action.payload : basicInputFormValues.projectType;\n const country = action.meta.field === 'country' ? action.payload : basicInputFormValues.country;\n\n const { liftAreaPercentage } = basicInputFormValues;\n\n const percentages = getAvailableLiftAreaPercentages({ projectType, country });\n if (!liftAreaPercentage || !percentages.includes(liftAreaPercentage as LIFT_AREA_PERCENTAGE)) {\n yield put(change(ReduxFormKeys.basicInputsForm, 'liftAreaPercentage', percentages[0]));\n return;\n }\n }\n\n if ('calculatedVentilationArea' === action.meta?.field) {\n // Make sure no previously selected ventilation components get stuck\n yield _resetVentilationComponentQuantities(formValues);\n }\n\n // Recalculate ventilation area; short-circuit on a change\n const recalculatedVentilationArea = getTotalLiftArea(basicInputFormValues);\n if (yield tryChange(formValues, ReduxFormKeys.basicInputsForm, 'calculatedVentilationArea', recalculatedVentilationArea)) {\n if (basicInputFormValues.calculatedVentilationArea < recalculatedVentilationArea) {\n // Make sure no previously selected ventilation components get stuck\n yield _resetVentilationComponentQuantities(formValues);\n }\n return;\n }\n\n // No montage outside Germany\n if (action.meta?.field === 'country' && action.payload !== COUNTRY.DE) {\n yield put(change(ReduxFormKeys.costCalculationForm, 'montageIncluded', false));\n yield put(change(ReduxFormKeys.costCalculationForm, 'montageBuildingLocation', null));\n }\n\n // Field updates that may change the available systems\n if (['abzRequired', 'nrwgDelivered', 'lowEnergyStandard', 'quiet', 'noOfElevators', 'additionalSmokeDetector'].includes(action.meta?.field)) {\n const previousSystem = configurationInputsFormValues.system;\n\n const systems = getAvailableSystems(basicInputFormValues);\n const defaultSystem = systems.length ? systems[0] : null;\n\n if (!previousSystem || !systems.includes(previousSystem)) {\n // If a system wasn't specified, or is no longer applicable, replace with default system\n if (yield tryChange(formValues, ReduxFormKeys.configurationInputsForm, 'system', defaultSystem)) return;\n }\n }\n\n // Determine applicable smoke detection methods\n {\n const smokeDetectionMethods = getApplicableSmokeDetectionMethods(basicInputFormValues, configurationInputsFormValues);\n const defaultSmokeDetectionMethod = smokeDetectionMethods.length ? smokeDetectionMethods[0] : null;\n\n // If only one smoke detection method is applicable, select it\n if (smokeDetectionMethods.length === 1) {\n if (yield tryChange(formValues, ReduxFormKeys.configurationInputsForm, 'smokeDetection', defaultSmokeDetectionMethod)) return;\n }\n // If the selected smoke detection method is not applicable, select the default\n if (!smokeDetectionMethods.find(x => x === configurationInputsFormValues.smokeDetection)) {\n if (yield tryChange(formValues, ReduxFormKeys.configurationInputsForm, 'smokeDetection', defaultSmokeDetectionMethod)) return;\n }\n\n // Field updates that may change the available smoke detection methods\n if (['shaftHeight', 'payload', 'country', 'liftAreaPercentage', 'systemIntegration', 'machineRoom', 'system'].includes(action.meta?.field)) {\n const prevSmokeDetectionMethod = configurationInputsFormValues.smokeDetection;\n\n if (!prevSmokeDetectionMethod || !smokeDetectionMethods.includes(prevSmokeDetectionMethod)) {\n // If a smoke detection method wasn't specified, or is no longer applicable, replace with default method\n if (yield tryChange(formValues, ReduxFormKeys.configurationInputsForm, 'smokeDetection', defaultSmokeDetectionMethod)) return;\n }\n }\n }\n\n // Field updates that may change the available lift status detection methods\n if (['shaftHeight', 'machineRoom', 'system'].includes(action.meta?.field)) {\n const prevLiftStatusDetectionMethod = configurationInputsFormValues.liftStatusDetection;\n\n // Determine applicable lift status detection methods\n const liftStatusDetectionMethods = getApplicatableLiftStatusDetectionMethods(basicInputFormValues, configurationInputsFormValues);\n const defaultLiftStatusDetectionMethod = liftStatusDetectionMethods.length ? liftStatusDetectionMethods[0] : null;\n\n if (!prevLiftStatusDetectionMethod || !liftStatusDetectionMethods.includes(prevLiftStatusDetectionMethod)) {\n if (yield tryChange(formValues, ReduxFormKeys.configurationInputsForm, 'liftStatusDetection', defaultLiftStatusDetectionMethod)) return;\n }\n }\n\n // On montage enable, copy building location into montage location as a default\n if (action.meta?.field === 'montageIncluded' && action.payload && !costCalculationFormValues.montageBuildingLocation) {\n yield put(change(ReduxFormKeys.costCalculationForm, 'montageBuildingLocation', basicInputFormValues.buildingLocation));\n }\n\n // Field updates that cause a reset on the `ventilationComponentsForm`\n if (action.meta?.field === 'aioBasicSet') {\n yield _resetVentilationComponentQuantities(formValues);\n\n // If a set is selected, attempt to update `smokeDetection` to the set's detection method\n if (action.payload) {\n const aioBasicSet = getProductById(productData.products, basicInputFormValues.aioBasicSet);\n if (!aioBasicSet) {\n console.debug(`Encountered missing product with id ${basicInputFormValues.aioBasicSet}`);\n } else {\n const smokeDetectionMethods = getApplicableSmokeDetectionMethods(basicInputFormValues, configurationInputsFormValues);\n\n if (aioBasicSet.productKey.includes('PD')) {\n if (yield tryChange(formValues, ReduxFormKeys.configurationInputsForm, 'smokeDetection', smokeDetectionMethods.find(x => x === SMOKE_DETECTION.POINTDETECTOR))) return;\n }\n if (aioBasicSet.productKey.includes('SD-L-F1')) {\n if (yield tryChange(formValues, ReduxFormKeys.configurationInputsForm, 'smokeDetection', smokeDetectionMethods.find(x => x === SMOKE_DETECTION.SDLF1))) return;\n }\n }\n }\n }\n if (['installationPosition', 'nrwgDelivered', 'projectType', 'system', 'weathershelter', 'quiet', 'lowEnergyStandard', 'abzRequired'].includes(action.meta?.field)) {\n yield _resetVentilationComponentQuantities(formValues);\n }\n\n console.log(`---> PROCESS FORM: CHANGE ${action.meta?.field}`);\n formValues = yield select(getForm);\n yield put(calculationActionCreator.processFormValues(formValues, productData));\n}\n\n/** @see `CalculationActionTypes.IGNORE_AIO_BASIC_SETS` */\nfunction* ignoreAIOBasicSets(action: ReturnType) {\n console.log(\"---> IGNORE AIO BASIC SETS\");\n\n const formValues: ICalculationFormsState = yield select(getForm);\n\n // Delete selected AIO Basic Set when ignoring Sets (e.g. by closing modal)\n if (action.payload === true) {\n if (yield tryChange(formValues, ReduxFormKeys.basicInputsForm, 'aioBasicSet', null)) return;\n }\n\n console.log(\"---> PROCESS FORM: IGN_SET\");\n const productData: IProductData = yield select(getProductData);\n yield put(calculationActionCreator.processFormValues(formValues, productData));\n}\n\n\nexport function* saga() {\n yield takeEvery(CalculationActionTypes.REQUEST_SWITCH_TAB, requestSwitchTab);\n yield takeEvery(CalculationActionTypes.REQUEST_SWITCH_TAB_INDEX, requestSwitchTabIndex);\n\n yield takeEvery(CalculationActionTypes.INITIALIZE_FORM, initializeForm);\n yield takeEvery(CalculationActionTypes.REDUX_FORM_CHANGE, changeForm);\n // yield takeEvery(CalculationActionTypes.REDUX_FORM_BLUR, blurForm); // unused\n yield takeEvery(FormActionTypes.RESET_FIELDS, changeForm);\n\n yield takeEvery(CalculationActionTypes.IGNORE_AIO_BASIC_SETS, ignoreAIOBasicSets);\n}\n","import { all } from 'redux-saga/effects';\r\n\r\nimport { saga as calculationSaga } from '../features/calculation/CalculationSaga';\r\nimport { projectApi } from '../features/calculation/ProjectApi.redux';\r\n\r\n\r\nexport default function* rootSaga(dispatch: any) {\r\n return yield all([\r\n calculationSaga(),\r\n projectApi.saga(),\r\n ]);\r\n}\r\n","import { AnyAction, Reducer } from 'redux';\r\nimport { FormState, reducer as formReducer } from 'redux-form'\r\nimport update from \"immutability-helper\";\r\n\r\nimport { ICalculationFormsState } from '../calculation/CalculationModels';\r\n\r\nimport { ReduxFormKeys } from \"./ReduxFormKeys\";\r\nimport { FormActionTypes, KnownFormActions } from \"./FormActions\";\r\n\r\n\r\nfunction customFormReducerForForm(form: ReduxFormKeys): Reducer {\r\n return (state, action) => {\r\n if (action.payload?.form !== form) return state;\r\n\r\n switch (action.type) {\r\n case FormActionTypes.RESET_FIELDS:\r\n return update(state, {\r\n values: { $unset: action.payload.fields },\r\n });\r\n default: return state\r\n }\r\n }\r\n}\r\n\r\nexport const customFormReducer = formReducer.plugin({\r\n [ReduxFormKeys.basicInputsForm]: customFormReducerForForm(ReduxFormKeys.basicInputsForm),\r\n [ReduxFormKeys.configurationInputsForm]: customFormReducerForForm(ReduxFormKeys.configurationInputsForm),\r\n [ReduxFormKeys.ventilationComponentsForm]: customFormReducerForForm(ReduxFormKeys.ventilationComponentsForm),\r\n [ReduxFormKeys.costCalculationForm]: customFormReducerForForm(ReduxFormKeys.costCalculationForm),\r\n}) as Reducer, AnyAction> as Reducer;\r\n","import { projectApi } from '../features/calculation/ProjectApi.redux';\r\nimport { reducer as calculationReducer } from '../features/calculation/CalculationReducer';\r\nimport { customFormReducer } from \"../features/form/FormReducer\";\r\n\r\n\r\nexport const reducers = {\r\n form: customFormReducer,\r\n calculationState: calculationReducer,\r\n project: projectApi.reducer,\r\n};\r\n","import { applyMiddleware, combineReducers, compose, createStore, ReducersMapObject } from 'redux';\nimport createSagaMiddleware from 'redux-saga';\nimport { reducer as formReducers } from 'redux-form';\nimport { createLogger } from \"redux-logger\";\n\nimport { History } from 'history';\nimport { connectRouter, routerMiddleware } from 'connected-react-router'\n\nimport { IApplicationState } from \"../shared/ApplicationState\";\n\nimport rootSaga from './saga';\nimport { reducers } from \"./reducer\";\n\n\nconst actionsDenylist = [\n \"@@redux-form/UPDATE_SYNC_ERRORS\",\n \"@@redux-form/REGISTER_FIELD\",\n \"@@redux-form/UNREGISTER_FIELD\",\n];\n\n/** Get the compose() function,\n * either the default `import { compose } from 'redux',\n * or the DevTools-created one if present.\n */\nfunction getCompose(): typeof compose {\n // Try to get the `compose()` factory from Redux DevTools browser extension\n if (typeof window === \"object\" && typeof window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ === \"function\") {\n return window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({\n actionsDenylist,\n trace: typeof window === \"object\" && !!window.__REDUX_TRACE__,\n });\n }\n\n return compose;\n}\n\n/** Build the root reducer by combining `allReducers` with reducers from 'connected-react-router' and 'redux-form' */\nfunction buildRootReducer(allReducers: ReducersMapObject>, history: History) {\n const router = connectRouter(history);\n return combineReducers({ ...allReducers, router, ...formReducers });\n}\n\nexport function configureStore(history: History) {\n\n const sagaMiddleware = createSagaMiddleware();\n\n const loggerMiddleware = createLogger({\n level: 'debug',\n predicate: (_, action) => !actionsDenylist.includes(action.type),\n collapsed: true,\n });\n\n const enhancer = getCompose()(\n applyMiddleware(\n sagaMiddleware,\n routerMiddleware(history),\n loggerMiddleware,\n ),\n );\n\n const allReducers = buildRootReducer(reducers, history);\n const store = createStore(allReducers, enhancer);\n\n sagaMiddleware.run(rootSaga, store.dispatch);\n\n return store;\n}\n\nexport type ApplicationStore = ReturnType;\n","import { isObjectWithShape, isString, SimpleValidator } from \"../api/simple-validators\";\n\nimport { IConfig } from \"./types\";\n\n\nexport const isIConfig: SimpleValidator = isObjectWithShape({\n keycloakPublicBaseUrl: isString,\n});\n","import { JsonRESTApiClient } from \"../api/JsonRESTApiClient\";\n\nimport { IConfig } from \"./types\";\nimport { isIConfig } from \"./validators\";\n\n\n/** @see `DH.BlueKitConnect.Backend.Features.Config.ConfigController` */\nexport class ConfigApiV1Client extends JsonRESTApiClient {\n\n /// API Endpoints\n\n public async getConfig(): Promise {\n return await this._fetchJson(\n this._getUrl(),\n {\n method: 'GET',\n headers: await this._getHeaders(),\n },\n isIConfig\n );\n }\n\n}\n","import * as React from 'react';\n\n\ninterface FetchOnceState {\n value: T|null;\n error: Error|null;\n token: Symbol|null;\n}\nconst intitialState = >{\n value: null,\n error: null,\n token: null,\n};\n\nconst actions = {\n reset() {\n return { type: 'reset' };\n },\n fetchStart(token: Symbol) {\n return { type: 'fetchStart', token };\n },\n fetchError(token: Symbol, error: Error) {\n return { type: 'fetchError', token, error };\n },\n fetchSuccess(token: Symbol, value: T) {\n return { type: 'fetchSuccess', token, value };\n },\n}\ntype Action = ReturnType;\n\n/** Call getter() surrounded by action dispatches */\nfunction runFetch(dispatch: React.Dispatch, getter: () => Promise) {\n const token = Symbol();\n\n dispatch(actions.fetchStart(token));\n\n getter().then(\n value => dispatch(actions.fetchSuccess(token, value)),\n error => dispatch(actions.fetchError(token, error))\n )\n}\n\nfunction reducer(state: FetchOnceState, action: Action): FetchOnceState {\n console.debug('reducer', state, action);\n switch (action?.type) {\n case 'reset':\n return {\n ...intitialState,\n }\n case 'fetchStart':\n if (state.token !== null) {\n return state;\n }\n\n return {\n ...state,\n token: action.token,\n }\n case 'fetchError':\n if (state.token !== action.token){\n return state;\n }\n\n return {\n ...intitialState,\n error: action.error,\n }\n case 'fetchSuccess':\n if (state.token !== action.token){\n return state;\n }\n\n return {\n ...intitialState,\n value: action.value as T,\n }\n default:\n return state;\n }\n}\n\n\nexport interface UseFetchOnce {\n /** The value once it was fetched; or null */\n value: T|null;\n /** The fetch error; or null */\n error: Error|null;\n /** The fetch operation is loading */\n loading: boolean;\n /** Start fetching the value; no-op after first invocation (until reset() is used) */\n fetch: () => void;\n /** Reset the state by wiping out the value and error, an ongoing fetch's result (value or error) will be discarded */\n reset: () => void;\n}\n\nexport function useFetchOnce(getter: () => Promise): UseFetchOnce {\n const [state, dispatch] = React.useReducer, Action>>(reducer, intitialState);\n\n const fetch = React.useCallback((): void => {\n runFetch(dispatch, getter);\n }, [dispatch, getter]);\n\n const reset = React.useCallback((): void => {\n dispatch(actions.reset());\n }, [dispatch]);\n\n return {\n value: state.value,\n error: state.error,\n loading: state.token !== null,\n fetch,\n reset,\n };\n}\n","import * as React from \"react\";\n\nimport { IConfig } from \"./types\";\nimport { ConfigApiV1Client } from \"./ConfigApiV1Client\";\nimport { useFetchOnce } from \"../../shared/useFetchOnce.hook\";\n\n\ninterface ConfigContextType {\n config?: IConfig;\n configError?: Error;\n configLoading: boolean;\n}\nconst ConfigContext = React.createContext(null);\n\nexport const ConfigContextProvider: React.FC<{ url: string; }> = ({ children, url }) => {\n const client = React.useMemo(() => new ConfigApiV1Client(url), [url]);\n const configGetter = React.useCallback(() => {\n console.debug(`[ConfigContextProvider] Loading config for ${client._baseUrl}`)\n return client.getConfig()\n }, [client]);\n\n const {\n value: config,\n error: configError,\n loading: configLoading,\n fetch: fetchConfig,\n reset: resetConfig,\n } = useFetchOnce(configGetter);\n\n React.useEffect(() => {\n fetchConfig();\n return () => resetConfig();\n }, [fetchConfig, resetConfig]);\n\n const value = React.useMemo(() => ({\n config,\n configError,\n configLoading,\n }), [\n config,\n configError,\n configLoading,\n ])\n\n return React.createElement(ConfigContext.Provider, { value }, children);\n}\n\nexport function useConfigV2() {\n return React.useContext(ConfigContext);\n}\n","import * as React from \"react\";\nimport Keycloak from \"keycloak-js\";\nimport { useConfig } from \"../../configProvider\";\nimport { useConfigV2 } from \"../config/Config.hook\";\n\n\ninterface AuthContextType {\n /** Reset the session */\n reset: () => void;\n /** The user is authenticated */\n isAuthenticated: boolean;\n /** The user is authenticated via an E2E Token */\n isE2EAuthenticated: boolean;\n /** The user is authenticated via KeyCloak SSO */\n isKeycloakAuthenticated: boolean;\n}\n\nconst AuthContext = React.createContext(null);\n\nexport const AuthContextProvider: React.FC<{}> = ({ children }) => {\n const config = useConfig();\n\n // E2E Token Authentication\n const [isE2EAuthenticated, setIsE2EAuthenticated] = React.useState(false);\n React.useEffect(() => {\n if (!config.enableE2EToken) return;\n setIsE2EAuthenticated(!!localStorage.getItem('e2e_idtoken'));\n }, [config.enableE2EToken, setIsE2EAuthenticated]);\n\n // KeyCloak SSO Authentication\n const { config: { keycloakPublicBaseUrl } } = useConfigV2();\n const [isKeycloakAuthenticated, setKeycloakAuthenticated] = React.useState(false);\n React.useEffect(() => {\n if (config.disableKeyCloak) return;\n\n const kc = window.keyCloak = new Keycloak({\n realm: 'DH',\n clientId: 'bluekit-connect',\n url: keycloakPublicBaseUrl,\n });\n\n kc.init({\n enableLogging: false,\n onLoad: 'login-required',\n silentCheckSsoRedirectUri: window.location.origin + '/silent-check-sso.html',\n }).then((authenticated: boolean) => {\n setKeycloakAuthenticated(authenticated);\n });\n\n return () => {\n kc.clearToken();\n window.keyCloak = undefined;\n setKeycloakAuthenticated(false);\n };\n }, [keycloakPublicBaseUrl, config.disableKeyCloak, setKeycloakAuthenticated, window.location.origin]);\n\n const reset = React.useCallback(() => {\n if (config.disableKeyCloak) return;\n\n window.keyCloak?.clearToken();\n window.keyCloak?.logout();\n }, [config.disableKeyCloak]);\n\n const value = {\n reset,\n isAuthenticated: isE2EAuthenticated || isKeycloakAuthenticated,\n isE2EAuthenticated,\n isKeycloakAuthenticated,\n };\n\n return React.createElement(AuthContext.Provider, { value }, children);\n};\n\nexport function useAuthenticated() {\n return React.useContext(AuthContext);\n}\n","import { JsonRESTApiClient } from \"../api/JsonRESTApiClient\";\n\nimport { IUser } from \"./types\";\nimport { isIUser } from \"./validators\";\n\n\n/** @see `DH.BlueKitConnect.Backend.Features.User.UserController` */\nexport class UserApiV1Client extends JsonRESTApiClient {\n\n /// API Endpoints\n\n public async current(): Promise {\n return await this._fetchJson(\n this._getUrl(['current']),\n {\n method: 'GET',\n headers: await this._getHeaders(),\n },\n isIUser\n );\n }\n\n}\n","import * as React from \"react\";\n\nimport { useConfig } from \"../../configProvider\";\nimport { useFetchOnce } from \"../../shared/useFetchOnce.hook\";\n\nimport { UserApiV1Client } from \"./UserApiV1Client\";\nimport { IUser } from \"./types\";\nimport { useAuthTokenContext } from \"./AuthService\";\n\n\ninterface UserContextType {\n user: IUser|null;\n userLoading: boolean;\n userError: Error|null,\n fetchUser: () => void;\n resetUser: () => void;\n}\nconst UserContext = React.createContext(null);\n\nexport const UserContextProvider: React.FC<{}> = ({ children }) => {\n const { apiUrl } = useConfig();\n const { getToken } = useAuthTokenContext();\n const client = React.useMemo(() => new UserApiV1Client(apiUrl['user-v1'], getToken), [apiUrl, getToken]);\n const userGetter = React.useCallback(() => client.current(), [client]);\n\n const {\n value: user,\n loading: userLoading,\n error: userError,\n fetch: fetchUser,\n reset: resetUser,\n } = useFetchOnce(userGetter);\n\n const value = React.useMemo(() => ({\n user,\n userLoading,\n userError,\n fetchUser,\n resetUser,\n }), [\n user,\n userLoading,\n userError,\n fetchUser,\n resetUser,\n ]);\n\n return React.createElement(UserContext.Provider, { value }, children);\n};\n\nexport function useUser() {\n return React.useContext(UserContext);\n}\n","import { isNumber, isObjectWithShape, isString, SimpleValidator } from \"../api/simple-validators\";\n\nimport { ISettings } from \"./types\";\n\n\nexport const isISettings: SimpleValidator = isObjectWithShape({\n generalRemarks: isString,\n offerValidityWeeks: isNumber,\n deliveryWorkdays: isNumber,\n});\n","import { JsonRESTApiClient } from \"../api/JsonRESTApiClient\";\n\nimport { ISettings } from \"./types\";\nimport { isISettings } from \"./validators\";\n\n\n/** @see `DH.BlueKitConnect.Backend.Features.Settings.SettingsController` */\nexport class SettingsApiV1Client extends JsonRESTApiClient {\n\n /// API Endpoints\n\n public async getSettings(): Promise {\n return await this._fetchJson(\n this._getUrl(),\n {\n method: 'GET',\n headers: await this._getHeaders(),\n },\n isISettings\n );\n }\n\n}\n\n","import * as React from 'react';\n\nimport { useConfig } from '../../configProvider';\nimport { useFetchOnce } from '../../shared/useFetchOnce.hook';\nimport { useAuthTokenContext } from '../auth/AuthService';\n\nimport { SettingsApiV1Client } from './SettingsApiV1Client';\nimport { ISettings } from './types';\n\n\ninterface SettingsContextType {\n settings: ISettings;\n settingsError: Error|null;\n settingsLoading: boolean;\n fetchSettings: () => void;\n}\nconst SettingsContext = React.createContext(null);\n\nexport const SettingsContextProvider: React.FC<{}> = ({ children }) => {\n const { apiUrl } = useConfig();\n const { getToken } = useAuthTokenContext();\n const client = React.useMemo(() => new SettingsApiV1Client(apiUrl['settings-v1'], getToken), [apiUrl, getToken]);\n const settingsGetter = React.useCallback(() => client.getSettings(), [client]);\n\n const {\n value: settings,\n error: settingsError,\n loading: settingsLoading,\n fetch: fetchSettings,\n } = useFetchOnce(settingsGetter);\n\n const value = React.useMemo(() => ({\n settings,\n settingsError,\n settingsLoading,\n fetchSettings,\n }), [\n settings,\n settingsError,\n settingsLoading,\n fetchSettings,\n ]);\n\n return React.createElement(SettingsContext.Provider, { value }, children);\n}\n\nexport function useSettings() {\n return React.useContext(SettingsContext);\n}\n","import * as React from 'react';\r\n\r\nimport { useLocalization } from '../../localization/hook';\r\nimport { useFreshworksOpenWithPrefill } from '../../features/freshworks-widget/useFreshworksWidget.hook';\r\n\r\nimport './Spinner.scss';\r\n\r\n\r\n// To support new operations, add an option to this enum by chosing a unique opcode\r\nexport enum SpinnerOpCode {\r\n INDEX_CONFIG = \"BKCC-I9C\",\r\n // Authentication\r\n AP_AUTH = \"BKCC-AP1\",\r\n AC_PENDING = \"BKCC-AC1\",\r\n // CalculationPage\r\n CP_STATE = \"BKCC-C9S\",\r\n CP_PRODUCT_DATA = \"BKCC-C9P\",\r\n // CostCalculationForm (\"calculation page 4\")\r\n C4_SETTINGS = \"BKCC-C4S\",\r\n C4_USER = \"BKCC-C4U\",\r\n C4_FORM_READY = \"BKCC-C4R\",\r\n C4_PROJECT = \"BKCC-C4P\",\r\n C4_COSTS = \"BKCC-C4C\",\r\n C4_FILES = \"BKCC-C4F\",\r\n}\r\n\r\nexport interface SpinnerProps {\r\n /** Show the spinner loading state */\r\n loading: boolean;\r\n /** Show the spinner error state with a message */\r\n error?: Error|string;\r\n /** The operation code */\r\n operation: SpinnerOpCode;\r\n /** Override the timeout during the loading state when the spinner message will escalate; 0 disables escalation; default 5000 ms */\r\n escalateTimeoutMs?: number;\r\n\r\n /**\r\n * Add `ui segment` CSS classes \r\n * `small`: Also `small` add CSS class\r\n */\r\n segment?: boolean|'small';\r\n}\r\n\r\n/**\r\n * Show a loading spinner during a loading operation,\r\n * escalate to an error message in a failure or after a timeout.\r\n * \r\n * Renders nothing if in neither loading nor error state.\r\n * \r\n * If Freshdesk Widget is available, show a link that opens and prefills it for an error report to Web-App Support.\r\n */\r\nexport const Spinner: React.FC = props => {\r\n const isLoading = props.loading;\r\n const isError = !props.loading && !!props.error;\r\n\r\n const escalateTimeoutMs = props.escalateTimeoutMs ?? 5000;\r\n const [isEscalateTimeout, setIsEscalateTimeout] = React.useState(false);\r\n\r\n React.useEffect(() => {\r\n if (escalateTimeoutMs === 0) {\r\n return;\r\n }\r\n\r\n if (!isLoading) {\r\n return;\r\n }\r\n\r\n const timeout = setTimeout(() => {\r\n setIsEscalateTimeout(true);\r\n }, escalateTimeoutMs);\r\n\r\n return () => {\r\n clearTimeout(timeout);\r\n setIsEscalateTimeout(false);\r\n }\r\n }, [escalateTimeoutMs, setIsEscalateTimeout, props.operation, isLoading]);\r\n\r\n const freshworksOpenWithPrefill = useFreshworksOpenWithPrefill();\r\n\r\n const onReportClick = React.useCallback(() => {\r\n const description = isError\r\n ? `Loading Error with Code [${props.operation}]:\\n${props.error?.toString()}`\r\n : `Loading Spinner with Code [${props.operation}]`;\r\n freshworksOpenWithPrefill?.({\r\n description,\r\n custom_fields: {\r\n 'cf_bereich_bluekit': 'Web-App Support',\r\n },\r\n });\r\n }, [freshworksOpenWithPrefill, props.operation, isError, props.error]);\r\n\r\n const { localize } = useLocalization();\r\n\r\n const className = React.useMemo(() => {\r\n const classNames = [\"Spinner\"];\r\n if (props.segment) classNames.push(\"ui segment\");\r\n if (props.segment === \"small\") classNames.push(\"small\");\r\n return classNames.join(\" \");\r\n }, [props.segment]);\r\n\r\n if (!isLoading && !isError) {\r\n return null;\r\n }\r\n\r\n return (\r\n
\r\n

\r\n
\r\n
\r\n {isError ? props.error?.toString() : localize('loading...')}\r\n {(isError || isEscalateTimeout) && !!freshworksOpenWithPrefill && <>\r\n
\r\n {`[${props.operation}]`}\r\n
\r\n Report this to Web-Application Support\r\n }\r\n
\r\n
\r\n
\r\n );\r\n};\r\n","import { IUser } from \"./types\";\n\n\nexport enum UserGroup {\n CUSTOMER = 'Customer',\n ADMIN = 'Admin',\n}\n\nfunction hasAnyOfGroups(groups: UserGroup[], user: IUser|null): boolean {\n if (!user) {\n return false;\n }\n\n for (const g of groups) {\n if (user.groups.includes(g)) {\n return true;\n }\n }\n\n return false;\n}\n\nexport function isCustomer(user: IUser|null) {\n return hasAnyOfGroups([UserGroup.CUSTOMER], user);\n}\n\nexport function isAdmin(user: IUser|null) {\n return hasAnyOfGroups([UserGroup.ADMIN], user);\n}\n\nexport function canAccessConnect(user: IUser|null) {\n return hasAnyOfGroups([UserGroup.CUSTOMER, UserGroup.ADMIN], user);\n}\n","import React from \"react\";\n\nimport { IUser } from \"../auth/types\";\nimport { isICompany, isIUser } from \"../auth/validators\";\nimport { IProject } from \"../project/types\";\n\n\nexport function useFreshworksWidgetPrefillUser(user: IUser) {\n React.useEffect(() => {\n if (isIUser.nothrow(user) && window.FreshworksWidget) {\n window.FreshworksWidget('identify', 'ticketForm', {\n name: `${user.firstName} ${user.lastName}`,\n email: user.email,\n });\n\n return () => {\n window.FreshworksWidget?.('logout');\n };\n }\n }, [window.FreshworksWidget, user]);\n\n const company = user?.company;\n React.useEffect(() => {\n if (isICompany.nothrow(company) && window.FreshworksWidget) {\n window.FreshworksWidget('prefill', 'ticketForm', { custom_fields: {\n cf_kundenfirma: `${company.name} (ID ${company.id})`,\n }});\n\n return () => {\n window.FreshworksWidget?.('prefill', 'ticketForm', { custom_fields: {\n cf_kundenfirma: '',\n }});\n };\n }\n }, [window.FreshworksWidget, company?.id, company?.name]);\n}\n\nexport function useFreshworksWidgetPrefillProjectId(projectId: IProject['id'] | 'new') {\n React.useEffect(() => {\n if (window.FreshworksWidget && !!projectId) {\n window.FreshworksWidget('prefill', 'ticketForm', {\n subject: projectId === 'new' ? 'Neues Projekt: ' : `Projekt ${projectId}: `,\n custom_fields: {\n 'cf_projekt_id': projectId,\n },\n });\n\n return () => {\n window.FreshworksWidget?.('prefill', 'ticketForm', { 'subject': '' });\n };\n }\n }, [window.FreshworksWidget, projectId]);\n}\n\nexport function useFreshworksOpenWithPrefill(): null|((fields: any) => void) {\n return React.useMemo(() => {\n if (!window.FreshworksWidget) {\n return null; // widget not available, return nothing\n }\n\n return (fields: any) => {\n window.FreshworksWidget?.('prefill', 'ticketForm', {\n ...fields\n });\n window.FreshworksWidget?.('open', 'ticketForm');\n };\n }, [window.FreshworksWidget]);\n}\n\ndeclare global {\n interface Window {\n FreshworksWidget?: (\n action: 'open'|'close'|'destroy'|'boot'|'identify'|'logout'|'hide'|'show'|'disable'|'enable'/*??<--not documented??*/|'prefill',\n target?: 'ticketForm'|'article'|'launcher',\n ...args: any[]\n ) => unknown;\n }\n}\n","import * as React from \"react\";\nimport { Message } from \"semantic-ui-react\";\n\nimport { nl2br } from \"./LocalizationService\";\nimport { useLanguage, useLocalization, useSelectedLanguage } from \"./hook\";\n\nimport \"./RestrictedLanguageMessage.scss\";\n\nexport const RestrictedLanguageMessage: React.FC<{ className?: string }> = ({ className = \"\" }) => {\n const { localize } = useLocalization();\n const language = useLanguage();\n const selectedLanguage = useSelectedLanguage();\n\n return language !== selectedLanguage && ;\n};\n","import * as React from \"react\";\nimport { Message } from \"semantic-ui-react\";\n\nimport { nl2br } from \"./LocalizationService\";\nimport { useCurrency, useLocalization } from \"./hook\";\n\nimport \"./RestrictedCurrencyMessage.scss\";\n\nexport const RestrictedCurrencyMessage: React.FC<{ className?: string }> = ({ className = \"\" }) => {\n const { localize } = useLocalization();\n const currency = \"EUR\";\n const selected = useCurrency();\n\n return currency !== selected && ;\n};\n","import React from 'react';\nimport moment from 'moment';\nimport { useHistory } from 'react-router-dom';\nimport { Button, ButtonGroup, ButtonProps, Icon, Label, Modal, Popup, PopupProps, Table, TableProps } from 'semantic-ui-react';\n\nimport { useConfig } from '../../configProvider';\nimport { useLocalization } from '../../localization/hook';\n\nimport { useAuthTokenContext } from '../auth/AuthService';\nimport { useUser } from '../auth/User.hook';\n\nimport { GetProjectsView, ProjectApiV1Client } from './ProjectApiV1Client';\nimport { IProjectSynopsis } from './types';\n\nimport './_ProjectTable.scss';\n\n\nexport type ProjectTableProps = TableProps & {\n view: GetProjectsView;\n query?: string|null;\n};\nexport const ProjectTable: React.FC = ({ view, query, className, ...tableProps }) => {\n const { localize, localizeEnum } = useLocalization();\n const history = useHistory();\n\n const ITEMS_PER_PAGE = 100;\n const [page, setPage] = React.useState(0);\n React.useEffect(() => {\n // reset page when the view changes\n setPage?.(0);\n }, [view, setPage]);\n\n const {\n projectList,\n projectListHasMore,\n projectListError,\n isLoading,\n requestDelete,\n } = useProjectListApiV1Client(view, query, page * ITEMS_PER_PAGE, ITEMS_PER_PAGE);\n\n const onCreateProjectClick = React.useCallback(() => {\n history.push('/calculation/new/basic-input');\n }, [history]);\n\n const onDeleteProjectConfirm = requestDelete;\n\n const onAnchorClick = React.useCallback((event: React.UIEvent, data: ButtonProps) => {\n event.preventDefault();\n\n const target = data.href;\n if (!target) return;\n\n history.push(target);\n }, [history]);\n\n const paginationElement = React.useMemo(() => (\n \n \n \n \n \n \n );\n};\n\n\nfunction useProjectListApiV1Client(...params: Parameters) {\n const { user } = useUser();\n const { apiUrl } = useConfig();\n const { getToken } = useAuthTokenContext();\n\n const client = React.useMemo(\n () => !user ? null : new ProjectApiV1Client(apiUrl['project-v1'], getToken),\n [user, apiUrl, getToken]\n );\n\n const [\n [projectList, projectListHasMore, projectListError],\n setProjectListAndError\n ] = React.useState<[IProjectSynopsis[]|null, boolean|null, any|null]>([null, null, null]);\n const [isLoading, setIsLoading] = React.useState(false);\n\n React.useEffect(() => {\n setIsLoading(true);\n\n if (!client) return;\n\n client.getProjects(...params).then(([projectList, hasMore]) => {\n setProjectListAndError([projectList, hasMore, null]);\n }).catch(e => {\n setProjectListAndError([null, null, e]);\n }).finally(() => {\n setIsLoading(false);\n });\n }, [client, ...params]);\n\n const requestDelete: (id: string) => unknown = React.useCallback(async (id: string) => {\n if (!client) return;\n\n try {\n setIsLoading(true);\n await client.deleteProjectById(id);\n\n setProjectListAndError(([pl, more, e]) => [\n pl ? [...pl.filter(p => p.id !== id)] : null,\n more,\n e,\n ]);\n } catch (e) {\n console.error(e);\n } finally {\n setIsLoading(false);\n }\n }, [client]);\n\n return React.useMemo(() => ({\n projectList,\n projectListHasMore,\n projectListError,\n isLoading,\n requestDelete,\n }), [\n projectList,\n projectListHasMore,\n projectListError,\n isLoading,\n requestDelete,\n ]);\n}\n","import * as React from 'react';\nimport { Container, Grid, Icon, Input, InputOnChangeData, Menu, Segment } from \"semantic-ui-react\";\n\nimport { RestrictLanguages, useLocalization } from '../../localization/hook';\nimport { RestrictedLanguageMessage } from '../../localization/RestrictedLanguageMessage';\nimport { RestrictedCurrencyMessage } from '../../localization/RestrictedCurrencyMessage';\n\nimport { isAdmin } from \"../auth/PermissionService\";\nimport { useUser } from '../auth/User.hook';\n\nimport { ProjectTable } from \"./_ProjectTable\";\nimport { GetProjectsView } from './ProjectApiV1Client';\n\nimport './ProjectExplorerPage.scss';\n\n\nexport const InnerProjectExplorerPage: React.FC = () => {\n const { localize } = useLocalization();\n const { user } = useUser();\n\n const [projectView, setProjectView] = React.useState(GetProjectsView.OWN);\n const onSetProjectViewClick = React.useCallback((view: GetProjectsView) => () => {\n setProjectView(view);\n }, []);\n\n // The query parameter passed to ProjectTable\n const [tableQuery, setTableQuery] = React.useState('');\n\n // The query text from the search input\n const [tableQueryInputValue, setTableQueryInputValue] = React.useState('');\n const onTableQueryInputValueChange = React.useCallback((_event, data: InputOnChangeData) => {\n const q = data.value?.trim().length ? data.value : '';\n setTableQueryInputValue(q);\n }, [setTableQueryInputValue]);\n const onTableQueryInputValueClear = React.useCallback(() => {\n setTableQueryInputValue('');\n }, [setTableQueryInputValue]);\n\n // Update ProjectTable's query no more than once every 500ms\n useDebounce(500, setTableQuery, tableQueryInputValue);\n\n const userIsAdmin = isAdmin(user);\n\n return (\n \n \n \n\n \n \n \n \n {userIsAdmin && (\n \n )}\n \n \n \n \n {!!tableQueryInputValue?.length && (\n \n )}\n \n \n \n \n \n \n \n );\n}\n\nexport const ProjectExplorerPage: React.FC = () => {\n return (\n \n \n \n );\n};\n\n/** Calls `fn` after `timeoutMs`; timer resets whenever any of `...args` change */\nfunction useDebounce(timeoutMs: number, fn: (...args: T) => unknown, ...args: T) {\n React.useEffect(() => {\n const debounceTimer = setTimeout(() => fn(...args), timeoutMs);\n return () => clearTimeout(debounceTimer);\n }, [timeoutMs, fn, ...args]);\n}\n","import React from 'react';\nimport { WrappedFieldProps } from 'redux-form';\nimport {\n Button,\n Checkbox,\n DropdownItemProps as SemanticDropdownItemProps,\n DropdownProps as SemanticDropdownProps,\n Form,\n Input,\n InputProps as SemanticInputProps,\n Popup,\n Select,\n SemanticShorthandContent,\n TextAreaProps as SemanticTextAreaProps,\n CheckboxProps as SemanticCheckboxProps,\n} from 'semantic-ui-react';\n\n\n/////////////////////////////\n// Hidden Input\n/////////////////////////////\n\nexport type HiddenFieldProps = WrappedFieldProps & {};\n\nexport const renderHidden: React.FC = ({ input }) => (\n
\n \n \n \n
\n);\n\n\n/////////////////////////////\n// Checkbox\n/////////////////////////////\n\nexport type CheckboxFieldProps = WrappedFieldProps & {};\n\nexport const renderCheckbox = field => (\n \n field.input.onChange(checked)}\n label={field.label}\n />\n {field.infoText && }/>}\n \n);\n\n\n/////////////////////////////\n// Radio\n/////////////////////////////\n\nexport type RadioFieldProps = WrappedFieldProps & {\n radioValue: string;\n disabled: boolean;\n label: string;\n};\n\nexport const renderRadio: React.FC = ({ input, radioValue, disabled, label }) => {\n const radioProps = {\n disabled,\n label,\n name: input.name,\n checked: input.value === radioValue,\n \"data-cy\": `${input.name}-${radioValue}`,\n onChange: () => {\n input.onChange(radioValue);\n },\n };\n\n return ;\n};\n\n\n/////////////////////////////\n// Select Dropdown\n/////////////////////////////\n\nexport type SelectFieldProps = WrappedFieldProps & {\n options: SemanticDropdownItemProps[];\n defaultValue?: any;\n placeholder?: string;\n disabled?: boolean;\n infoText?: SemanticShorthandContent;\n label: string;\n search?: boolean;\n};\n\nconst SelectField: React.FC = ({ input, meta, options, search, placeholder, disabled, defaultValue, label, infoText }) => {\n const selectProps = {\n name: input.name,\n options,\n search,\n placeholder,\n disabled,\n value: input.value || defaultValue,\n onBlur: (_event: unknown, { value }: SemanticDropdownProps) => input.onBlur(value),\n onChange: (_event: unknown, { value }: SemanticDropdownProps) => input.onChange(value),\n };\n return (\n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \r\n {/*{this.state.filename}*/}\r\n (this.fileUploaderInput = el)}\r\n type=\"file\"\r\n className=\"file-uploader__input\"\r\n onChange={this.onFileChanged}\r\n />\r\n \r\n );\r\n }\r\n}\r\n\r\nexport const FileUploader: React.FC = props => {\r\n const { localize } = useLocalization();\r\n\r\n return \r\n};\r\n","import moment from \"moment\";\n\nimport { JsonRESTApiClient } from \"../api/JsonRESTApiClient\";\nimport { IProject } from \"../project/types\";\nimport { getFormValuesDictionaryFromForms, getProjectProductsFromForms } from \"../calculation/CalculationService\";\nimport { ICalculationFormsState } from \"../calculation/CalculationModels\";\nimport { ICalculationState } from \"../calculation/CalculationReducer\";\n\n\nconst PROJECT_EXPORT_FILE_ENDING = {\n 'pdf': 'pdf',\n 'xlsx': 'xlsx',\n};\n// eslint-disable-next-line @typescript-eslint/no-redeclare\ntype PROJECT_EXPORT_FILE_ENDING = keyof typeof PROJECT_EXPORT_FILE_ENDING;\n\n/** @see `DH.BlueKitConnect.Backend.Features.Project.Export.ExportController` */\nexport class ProjectExportApiV1Client extends JsonRESTApiClient {\n\n /// API Endpoints\n\n public async download(\n format: PROJECT_EXPORT_FILE_ENDING,\n project: IProject,\n form: ICalculationFormsState,\n calculationState: ICalculationState,\n language: string\n ): Promise {\n const allProducts = getProjectProductsFromForms(form, project.id, calculationState);\n\n const requestObj = {\n id: project.id,\n products: allProducts,\n formValues: getFormValuesDictionaryFromForms(form),\n selectedProducts: calculationState.selectedProducts,\n selectedAIOBasicSet: calculationState.selectedAIOBasicSet,\n selectedNonStandardComponents: calculationState.nonStandardComponents,\n owningCompanyId: project.owningCompanyId,\n };\n\n const response = await this._fetch(\n this._getUrl([format], [['lang', language]]), {\n method: 'POST',\n body: JSON.stringify(requestObj),\n headers: await this._getHeaders(),\n },\n );\n\n const LastReportingAtHeader = 'X-LastReportingAt';\n let projectLastReportingAt: string | null = null\n if (response.headers.has(LastReportingAtHeader)) {\n const header = response.headers.get(LastReportingAtHeader);\n if (header != null && header.length > 0) {\n const date = moment(header);\n if (date.isValid()) {\n projectLastReportingAt = date.format(\"DD.MM.YYYY\");\n }\n }\n }\n\n const blob: Blob = await response.blob(); // Get the response body blob\n const lastReportingString = !!projectLastReportingAt ? \"_\" + projectLastReportingAt : \"\"\n const filename = `Kostenkalkulation_${project.name}${lastReportingString}.${PROJECT_EXPORT_FILE_ENDING[format]}`;\n\n downloadBlob(blob, filename); // \"Download\" the file to the user's device\n }\n}\n\n/** Downloads a the `blob` as a file with `fileName`\n * Creates, clicks, then removes an `` element\n */\nfunction downloadBlob(blob: Blob, fileName: string): void {\n const url = URL.createObjectURL(blob);\n \n const link = document.createElement('a');\n link.href = url;\n link.setAttribute('download', fileName);\n link.setAttribute('data-cy', 'file-download');\n\n document.body.appendChild(link);\n\n link.click();\n\n if ((window as any).Cypress) {\n // Do not attempt to actually download the file in test.\n // Just leave the anchor in there. Ensure your code doesn't\n // automatically remove it either.\n console.log(\"Leave the href here for cypress.\");\n return;\n }\n\n link.parentNode.removeChild(link);\n}\n","import React from \"react\";\n\nimport { useConfig } from \"../../configProvider\";\nimport { errorToList } from \"../../shared/components/error-list\";\nimport { useFetchOnce } from \"../../shared/useFetchOnce.hook\";\n\nimport { useAuthTokenContext } from \"../auth/AuthService\";\n\nimport { ProjectExportApiV1Client } from \"./ProjectExportApiV1Client\";\n\n\nexport function useProjectExport(...params: Parameters) {\n const { apiUrl } = useConfig();\n const { getToken } = useAuthTokenContext();\n const client = React.useMemo(() => new ProjectExportApiV1Client(apiUrl['project-export-v1'], getToken), [apiUrl, getToken]);\n\n const exportGetter = React.useCallback(() => {\n if (params[1] == null || params[2] == null || params[3] == null) return;\n return client.download(...params);\n }, [client, ...params]);\n\n const { error, fetch, loading } = useFetchOnce(exportGetter);\n\n return React.useMemo(() => ({\n error: errorToList(error),\n fetch,\n loading,\n }), [\n error,\n fetch,\n loading,\n ]);\n}\n","import { JsonRESTApiClient } from \"../api/JsonRESTApiClient\";\nimport { isArrayOf } from \"../api/simple-validators\";\nimport { IFile } from \"../project/types\";\nimport { isIFile } from \"../project/validators\";\n\n/** @see `DH.BlueKitConnect.Backend.Features.File.FileController` */\nexport class FileApiV1Client extends JsonRESTApiClient {\n\n /// API Endpoints\n\n public async uploadFile(projectId: string, file: File, fileName: string): Promise {\n this._validateFileForUpload(file);\n\n const body = new FormData();\n body.append(\"File\", file, fileName);\n\n return await this._fetchJson(this._getUrl([projectId]), {\n method: 'POST',\n headers: await this._getHeaders(null),\n body,\n }, isIFile);\n }\n\n public async listFiles(projectId: string): Promise {\n return await this._fetchJson(\n this._getUrl([projectId]),\n {\n method: 'GET',\n headers: await this._getHeaders(),\n },\n isArrayOf(isIFile)\n );\n }\n\n public async downloadFile(projectId: string, fileName: string): Promise {\n const response = await this._fetch(this._getUrl([projectId, fileName, 'download']), {\n method: 'GET',\n headers: await this._getHeaders(),\n });\n\n return await response.blob();\n }\n\n public async deleteFile(projectId: string, fileName: string): Promise {\n await this._fetch(this._getUrl([projectId, fileName]), {\n method: 'DELETE',\n headers: await this._getHeaders(),\n });\n }\n\n /// Utilities\n\n private _validateFileForUpload(file: File) {\n if (file.size > 10 * 1024 * 1024) {\n throw new Error('Datei ist zu groß. Erlaubt sind max. 10MB.');\n }\n }\n}\n","import React from \"react\";\n\nimport { useFetchOnce } from \"../../shared/useFetchOnce.hook\";\nimport { errorToList } from \"../../shared/components/error-list\";\nimport { useConfig } from \"../../configProvider\";\n\nimport { useAuthTokenContext } from \"../auth/AuthService\";\n\nimport { FileApiV1Client } from \"./FileApiV1Client\";\n\n\nexport function useProjectFiles(projectId: string|null) {\n const { apiUrl } = useConfig();\n const { getToken } = useAuthTokenContext();\n const client = React.useMemo(() => new FileApiV1Client(apiUrl['file-v1'], getToken), [apiUrl, getToken]);\n const fileListGetter = React.useCallback(async () => {\n if (projectId == null) return null;\n return client.listFiles(projectId);\n }, [projectId, client]);\n\n const {\n value: fileList,\n loading: fileListLoading,\n error: fileListError,\n fetch: fetchFileList,\n reset: resetFileList,\n } = useFetchOnce(fileListGetter);\n\n const opLoading = React.useRef(false);\n const [opError, setOpError] = React.useState(null);\n\n const deleteFile = React.useCallback(async (fileName: string) => {\n if (opLoading.current) return;\n opLoading.current = true;\n\n setOpError(null);\n resetFileList();\n\n try {\n await client.deleteFile(projectId, fileName);\n resetFileList();\n fetchFileList();\n setOpError(null);\n } catch (e) {\n setOpError(e);\n } finally {\n opLoading.current = false;\n }\n }, [client, projectId, opLoading, setOpError, resetFileList]);\n\n const uploadFile = React.useCallback(async (file: File) => {\n if (opLoading.current) return;\n opLoading.current = true;\n\n setOpError(null);\n resetFileList();\n\n try {\n await client.uploadFile(projectId, file, file.name);\n resetFileList();\n fetchFileList();\n setOpError(null);\n } catch (e) {\n setOpError(e);\n } finally {\n opLoading.current = false;\n }\n }, [client, projectId, opLoading, setOpError, resetFileList]);\n\n const downloadFile = React.useCallback(async (fileName: string) => {\n if (opLoading.current) return;\n opLoading.current = true;\n\n setOpError(null);\n\n try {\n const blob = await client.downloadFile(projectId, fileName);\n setOpError(null);\n\n browserDownloadBlob(blob, fileName);\n } catch (e) {\n setOpError(e);\n } finally {\n opLoading.current = false;\n }\n }, [client, projectId, opLoading, setOpError]);\n\n return React.useMemo(() => ({\n fileList,\n fileLoading: opLoading.current || fileListLoading,\n fileError: opError ?? fileListError,\n fileErrorList: errorToList(opError, 'File') ?? errorToList(fileListError, 'File'),\n fetchFileList,\n resetFileList,\n deleteFile,\n uploadFile,\n downloadFile,\n }), [\n fileList,\n fileListLoading,\n fileListError,\n opLoading,\n opError,\n fetchFileList,\n resetFileList,\n deleteFile,\n uploadFile,\n downloadFile,\n ]);\n}\n\nfunction browserDownloadBlob(blob: Blob, fileName: string) {\n const link = document.createElement('a');\n link.href = window.URL.createObjectURL(new Blob([blob]));\n link.setAttribute('download', fileName);\n link.setAttribute('data-cy', 'file-download');\n\n document.body.appendChild(link);\n link.click();\n\n if ((window as any).Cypress) {\n // Do not attempt to actually download the file in test.\n // Just leave the anchor in there. Ensure your code doesn't\n // automatically remove it either.\n console.log(\"Leave the href here for cypress.\");\n return;\n }\n\n link.parentNode.removeChild(link);\n}\n","import { JsonRESTApiClient } from \"../api/JsonRESTApiClient\";\n\nimport { IProject, IProjectForReporting } from \"../project/types\";\nimport { isIProject } from \"../project/validators\";\n\n\n/** @see `DH.BlueKitConnect.Backend.Features.Reporting.ReportingApiV1Controller` */\nexport class ReportingApiV1Client extends JsonRESTApiClient {\n\n public async submit(project: IProjectForReporting): Promise {\n return await this._fetchJson(this._getUrl(['submit']), {\n method: 'POST',\n headers: await this._getHeaders(),\n body: JSON.stringify(project),\n }, isIProject);\n }\n}\n","import React from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { change as reduxFormChange } from \"redux-form\";\n\nimport { useConfig } from \"../../configProvider\";\nimport { useFetchOnce } from \"../../shared/useFetchOnce.hook\";\nimport { errorToList } from \"../../shared/components/error-list\";\nimport { useDispatchCallback } from '../../store/useDispatchCallback';\n\nimport { useAuthTokenContext } from \"../auth/AuthService\";\nimport { IProject } from \"../project/types\";\nimport { projectApi, projectApiActionCreator } from \"../calculation/ProjectApi.redux\";\nimport { ICalculationFormsState } from \"../calculation/CalculationModels\";\nimport { getFormValuesDictionaryFromForms, getProjectProductsFromForms } from \"../calculation/CalculationService\";\nimport { getCalculationState, getForm } from \"../calculation/calculation.selector\";\nimport { ICalculationState } from \"../calculation/CalculationReducer\";\nimport { ReduxFormKeys } from \"../form/ReduxFormKeys\";\n\nimport { ReportingApiV1Client } from \"./ReportingV1Api\";\n\n\nfunction useReporting(\n projectId: IProject['id'],\n calculationState: ICalculationState,\n form: ICalculationFormsState,\n) {\n const { apiUrl } = useConfig();\n const { getToken } = useAuthTokenContext();\n const client = React.useMemo(() => new ReportingApiV1Client(apiUrl['reporting-v1'], getToken), [apiUrl, getToken]);\n\n const submitGetter = React.useCallback(() => {\n if (projectId == null || !calculationState || !form) return;\n\n return client.submit({\n id: projectId,\n products: getProjectProductsFromForms(form, projectId, calculationState),\n formValues: getFormValuesDictionaryFromForms(form),\n selectedProducts: calculationState.selectedProducts,\n selectedAIOBasicSet: calculationState.selectedAIOBasicSet,\n selectedNonStandardComponents: calculationState.nonStandardComponents,\n });\n }, [client, projectId, calculationState, form]);\n\n const {\n value: submittedProject,\n error: submitError,\n loading: submitLoading,\n fetch: submit,\n reset,\n } = useFetchOnce(submitGetter);\n\n return React.useMemo(() => ({\n submittedProject,\n submitError: errorToList(submitError),\n submitLoading,\n submit,\n reset,\n }), [\n submittedProject,\n submitError,\n submitLoading,\n submit,\n reset,\n ]);\n}\n\n/** Integrate Reporting API (see `useReporting()`) with Project and Calculation State in Redux */\nexport function useReportingWithRedux() {\n const projectId = useSelector(projectApi.makeSelectBase('entity'))?.id;\n const calculationState = useSelector(getCalculationState);\n const form = useSelector(getForm);\n\n const {\n submit: submitBase,\n submittedProject,\n ...others\n } = useReporting(projectId, calculationState, form);\n\n const dispatch = useDispatch();\n const dispatchReduxChange = useDispatchCallback(dispatch, reduxFormChange);\n const dispatchUpdateProject = useDispatchCallback(dispatch, projectApiActionCreator.updateSuccess);\n\n const updateRequired = React.useRef(false);\n\n const submit = React.useCallback(async (...params: Parameters) => {\n await submitBase(...params);\n updateRequired.current = true;\n }, [submitBase, dispatchUpdateProject]);\n\n React.useEffect(() => {\n if (!updateRequired.current) return;\n if (!submittedProject) return;\n\n dispatchReduxChange(ReduxFormKeys.costCalculationForm, 'projectState', submittedProject.state);\n dispatchUpdateProject(submittedProject);\n\n updateRequired.current = false;\n }, [submittedProject, updateRequired.current]);\n\n return {\n submit,\n ...others\n };\n}\n","import * as React from \"react\";\n\nexport interface DebugTableCol {\n key: string | number;\n header?: string;\n}\n\nexport interface DebugTableRow {\n key: string | number;\n cols: (string | JSX.Element)[];\n};\n\nexport interface DebugTableProps {\n title: string;\n header?: boolean;\n columns: DebugTableCol[];\n rows: DebugTableRow[];\n bottomRow?: DebugTableRow;\n};\n\nexport const DebugTable: React.FC = (props) =>{\n const { title, header, columns, rows, bottomRow } = {\n header: true,\n ...props\n };\n const colKeys = columns.map(col => col.key)\n\n const makeRow = (extraProps: Partial = {}) => (row: DebugTableRow) => (\n \n {row.cols.map((col, idx) => (\n {col}\n ))}\n \n );\n const makeCommonRow = makeRow();\n const makeBottomRow = makeRow({ className: \"midBlueRow boldRow\" });\n\n return (\n
\n

{title}

\n
\n \n {!!header && (\n \n \n {columns.map(col => (\n \n ))}\n \n \n )}\n \n {rows.map(makeCommonRow)}\n {!!bottomRow && makeBottomRow(bottomRow)}\n \n
{col.header}
\n
\n
\n );\n};\n\nexport default DebugTable;\n","import { JsonRESTApiClient } from \"../api/JsonRESTApiClient\";\nimport { isEither, isObjectWithShape, isUnknown, SimpleValidator } from \"../api/simple-validators\";\nimport { ICalculationInput, ICosts } from \"./CalculationModels\";\n\n\n/** @see `DH.BlueKitConnect.Backend.Features.Calculation.CalculationController` */\nexport class CalculationApiV1Client extends JsonRESTApiClient {\n\n /// API Endpoints\n\n public async calculateCosts(calculationInput: ICalculationInput): Promise {\n return await this._fetchJson(\n this._getUrl(['calculate-costs']),\n {\n method: 'POST',\n headers: await this._getHeaders(),\n body: JSON.stringify(calculationInput),\n },\n isICosts\n );\n }\n\n}\n\n// @TODO: A more precise validation\nconst isICosts: SimpleValidator = isEither(\n isObjectWithShape({ blueKitSystemControlComponents: isUnknown }),\n isObjectWithShape({ aioBasicSet: isUnknown })\n) as SimpleValidator;\n","import { COUNTRY } from \"../../project/lookup\";\nimport { ICosts } from \"../CalculationModels\";\nimport { BasicInputsFormModel, CostCalculationFormModel } from \"../models/FormModels\";\n\n\nconst MONTAGE_UNAVAILABLE_DE_PREFIXES = ['00', '05', '43', '62'];\n\nfunction isAvailableMontageLocation(country: string, montageBuildingLocation: string): boolean | null {\n switch (country?.toLowerCase()) {\n case COUNTRY.DE:\n if (!montageBuildingLocation) {\n return null;\n }\n return !MONTAGE_UNAVAILABLE_DE_PREFIXES.some(prefix => montageBuildingLocation.startsWith(prefix));\n default:\n return null;\n }\n \n};\n\nexport function isMontagePossible(\n { country, projectType, shaftHeight }: Pick,\n { montageBuildingLocation }: Pick,\n { montageCosts }: Pick,\n) {\n const montagePrice = montageCosts?.costs?.price;\n\n // Disqualified: MODERNIZED, shaft higher than 50m, montage cost higher than 2000€, montage not available at location\n return projectType !== 'MODERNIZED'\n && shaftHeight <= 50_000\n && montagePrice <= 2_000\n && isAvailableMontageLocation(country, montageBuildingLocation);\n}\n","import React, { Fragment, useState } from 'react';\nimport { Button, Modal } from 'semantic-ui-react';\nimport { getFormValues } from \"redux-form\";\nimport { useDispatch, useSelector } from \"react-redux\";\n\nimport { useLocalization } from '../../../../localization/hook';\nimport { useDispatchCallback } from '../../../../store/useDispatchCallback';\n\nimport { ReduxFormKeys } from '../../../form/ReduxFormKeys';\nimport { projectApi, projectApiActionCreator } from '../../ProjectApi.redux';\nimport { PROJECT_STATE } from '../../../project/types';\nimport { isAdmin } from '../../../auth/PermissionService';\nimport { useUser } from '../../../auth/User.hook';\n\nimport { COST_CALCULATION_FORM_VALUES_SELECTOR } from '../02-ConfigurationInputs/ConfigurationInputsForm';\n\n\nexport const SaveProjectModal: React.FC = (props: any) => {\n const { disabled } = props;\n\n const dispatch = useDispatch();\n const { user } = useUser();\n const { entity: { id: projectId }, isUpdating: projectIsUpdating } = useSelector(projectApi.selector());\n const projectUpdateRequest = useDispatchCallback(dispatch, projectApiActionCreator.updateRequest);\n\n const costCalculationFormValues = useSelector(getFormValues(ReduxFormKeys.costCalculationForm) as COST_CALCULATION_FORM_VALUES_SELECTOR);\n\n const [isOpen, setOpen] = useState(false);\n\n const { localize } = useLocalization();\n\n const state = costCalculationFormValues.projectState as PROJECT_STATE;\n\n const save = React.useCallback(() => {\n projectUpdateRequest(projectId, state, false);\n setOpen(false);\n }, [setOpen, projectUpdateRequest, projectId, state]);\n\n const saveAndInformCustomer = React.useCallback(() => {\n projectUpdateRequest(projectId, state, true);\n setOpen(false);\n }, [setOpen, projectUpdateRequest, projectId, state]);\n\n const init = React.useCallback(() => {\n if (isAdmin(user) && [PROJECT_STATE.OFFER_CREATED, PROJECT_STATE.ORDER_RECEIVED, PROJECT_STATE.MESSAGE_FROM_DH].includes(state)) {\n setOpen(true);\n } else {\n save();\n }\n }, [setOpen, save, user, state]);\n\n return (\n \n \n {localize('projectManage.button.save')}\n \n }\n open={isOpen}\n onClose={() => setOpen(false)}\n >\n \n
{localize('projectManage.button.save')}
\n
setOpen(false)}>
\n
\n \n \n

{localize('projectManage.modal.save.emailCustomer?')}

\n
\n \n \n
\n
\n
\n \n
\n );\n}\n","import React from 'react';\nimport { change, Field, getFormValues } from 'redux-form';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { Button, Form, Modal } from 'semantic-ui-react';\n\nimport { TabSection } from '../../../../shared/components/TabSection';\nimport { renderQuantity } from '../../../../shared/components/FormControls';\nimport { useDispatchCallback } from '../../../../store/useDispatchCallback';\nimport { useLocalization } from '../../../../localization/hook';\n\nimport { ReduxFormKeys } from '../../../form/ReduxFormKeys';\nimport { formActionCreator } from '../../../form/FormActions';\n\nimport { COST_CALCULATION_FORM_VALUES_SELECTOR } from '../02-ConfigurationInputs/ConfigurationInputsForm';\n\nexport interface ICableModalHandle {\n /** Open the modal (with choice to reset to estimatedQuantities) */\n start: (estimatedQuantities: ICustomQuantities) => void;\n /** Whether the quantities have been changed from their estimates */\n changed: boolean;\n}\n\nconst customQuantitiesKeys = [\n 'rj-45-chf-a-4m-custom',\n 'rj-45-chf-a-6m-custom',\n 'rj-45-chf-a-12m-custom',\n 'fm-2m-custom',\n] as const;\nexport type ICustomQuantities = Record;\n\nconst CableModal = React.forwardRef((_props, ref) => {\n const [isOpen, setOpen] = React.useState(false);\n const [initialValues, setInitialValues] = React.useState(null);\n const [estimatedQuantities, setEstimatedQuantities] = React.useState(null);\n\n const costCalculationFormValues = useSelector(getFormValues(ReduxFormKeys.costCalculationForm) as COST_CALCULATION_FORM_VALUES_SELECTOR);\n\n const dispatch = useDispatch();\n const changeFieldValue = useDispatchCallback(dispatch, (field: string, value: any) => change(ReduxFormKeys.costCalculationForm, field, value))\n const resetFields = useDispatchCallback(dispatch, (fields: readonly string[]) => formActionCreator.resetFields(ReduxFormKeys.costCalculationForm, fields));\n\n // Event handlers\n\n const onOpenClick = React.useCallback((estimatedQuantities: ICustomQuantities) => {\n setOpen(true);\n\n const initialQuantities = Object.fromEntries(customQuantitiesKeys.map(k => [k, costCalculationFormValues[k]]));\n setInitialValues(initialQuantities);\n setEstimatedQuantities(estimatedQuantities);\n\n // Apply estimated quantities where no custom choice has been made\n if (!estimatedQuantities) return;\n customQuantitiesKeys.forEach(key => {\n if (costCalculationFormValues[key] == null) {\n changeFieldValue(key as any, estimatedQuantities[key]);\n }\n });\n }, [\n setOpen, costCalculationFormValues, setInitialValues, setEstimatedQuantities, changeFieldValue,\n ]);\n\n const onSaveClick = React.useCallback(() => {\n setOpen(false);\n }, [setOpen]);\n\n const onCloseClick = React.useCallback(() => {\n setOpen(false);\n\n Object.keys(initialValues).forEach(key => {\n changeFieldValue(key, initialValues[key]);\n });\n }, [setOpen, changeFieldValue, initialValues]);\n\n const onResetClick = React.useCallback(() => {\n setOpen(false);\n resetFields(customQuantitiesKeys);\n }, [setOpen, resetFields]);\n\n const { localize } = useLocalization();\n\n // Pass a start function and changed flag to a ref\n\n React.useImperativeHandle(ref, () => ({\n start: onOpenClick,\n changed: customQuantitiesKeys.map(k => costCalculationFormValues[k]).some(v => v != null),\n }), [onOpenClick, costCalculationFormValues]);\n\n return (\n <>\n \n \n
{localize('cableAdjust.title')}
\n
\n
\n \n \n \n
\n \n ({localize('cableAdjust.calculated')}: {estimatedQuantities?.['rj-45-chf-a-4m-custom']})\n \n \n \n ({localize('cableAdjust.calculated')}: {estimatedQuantities?.['rj-45-chf-a-6m-custom']})\n \n \n \n ({localize('cableAdjust.calculated')}: {estimatedQuantities?.['rj-45-chf-a-12m-custom']})\n \n \n \n ({localize('cableAdjust.calculated')}: {estimatedQuantities?.['fm-2m-custom']})\n \n \n
\n
\n
\n
\n \n \n
\n\n
\n
\n \n \n );\n});\n\nexport default CableModal;\n","import * as React from 'react';\nimport {connect, useSelector} from 'react-redux';\nimport {createStructuredSelector} from \"reselect\";\nimport {Field, getFormSyncErrors, getFormValues, InjectedFormProps, reduxForm} from 'redux-form';\nimport {numericality, required, length} from 'redux-form-validators';\nimport {Button, Form, Grid, Table} from 'semantic-ui-react';\nimport sumBy from 'lodash-es/sumBy';\n\nimport {ReduxFormKeys} from '../../../form/ReduxFormKeys';\nimport {IApplicationState} from '../../../../shared/ApplicationState';\nimport {Spinner, SpinnerOpCode} from '../../../../shared/components/Spinner';\nimport {TabSection} from '../../../../shared/components/TabSection';\nimport {renderCheckbox, renderInput, renderSelect, renderTextArea} from '../../../../shared/components/FormControls';\nimport {FileUploader} from \"../../../../shared/components/file-uploader/file-uploader\";\nimport {FormErrorList, syncedErrorsToList} from \"../../../../shared/components/error-list\";\nimport { useLocalization } from '../../../../localization/hook';\nimport {isAdmin, isCustomer} from \"../../../auth/PermissionService\";\n\nimport {PROJECT_STATE} from \"../../../project/types\";\n\nimport { useUser } from '../../../auth/User.hook';\nimport { useSettings } from '../../../settings/Settings.hook';\nimport { useProjectExport } from '../../../project-export/ProjectExport.hook';\nimport { useProjectFiles } from '../../../file/File.hook';\nimport { useReportingWithRedux } from '../../../reporting/Reporting.hook';\n\nimport DebugTable from '../DebugTable';\nimport { useCalculateCosts, useProjectV1 } from '../../calculation.hook';\nimport { COUNTRY, PROJECT_TYPE, REQUEST_TYPE } from '../../../project/lookup';\nimport {\n getCalculationState,\n getForm,\n isAllFormReady,\n isCostCalculationFormValid\n} from \"../../calculation.selector\";\nimport { ICalculationInput } from '../../CalculationModels';\nimport { BasicInputsFormModel } from '../../models/FormModels';\nimport { getFormValuesDictionaryFromForms } from '../../CalculationService';\nimport { isMontagePossible } from '../../CalculationService/Montage';\nimport {\n BASIC_INPUTS_FORM_VALUES_SELECTOR,\n COST_CALCULATION_FORM_VALUES_SELECTOR\n} from \"../02-ConfigurationInputs/ConfigurationInputsForm\";\n\nimport {SaveProjectModal} from './_SaveProjectModal';\nimport {CostCalculationList} from \"./_CostCalculationList\";\nimport CableModal, { ICableModalHandle } from './_CableModal';\n\n\nfunction useSpecialRemarks(\n { projectType, aioBasicSet }: Partial>,\n) {\n const { localize } = useLocalization();\n\n return React.useMemo(() => {\n const remarks: string[] = [];\n\n if (projectType === PROJECT_TYPE.MODERNIZED && !!aioBasicSet) {\n // BLU-314\n remarks.push(localize('info.modernized_check_suitable'));\n }\n\n return remarks;\n }, [\n localize,\n projectType,\n aioBasicSet,\n ]);\n}\n\nconst CostCalculationForm: React.FC = props => {\n const {\n isAllFormReady,\n basicInputFormValues,\n costCalculationFormValues,\n syncedErrors,\n isCostCalculationFormValid,\n isActive,\n } = props;\n\n const { settings, settingsError, settingsLoading } = useSettings();\n const { user, userError, userLoading } = useUser();\n\n const { \n project,\n projectError,\n projectLoading,\n projectIsUpdating,\n updateProject\n } = useProjectV1();\n\n const form = useSelector(getForm);\n const calculationState = useSelector(getCalculationState);\n\n const {\n fileList,\n fileLoading,\n fileError,\n fileErrorList,\n fetchFileList,\n resetFileList,\n deleteFile,\n uploadFile,\n downloadFile,\n } = useProjectFiles(isActive ? project?.id : null);\n\n React.useEffect(() => {\n if (!isActive) return;\n fetchFileList();\n return () => {\n resetFileList();\n };\n }, [isActive, fetchFileList, resetFileList]);\n\n const calculationInput: ICalculationInput = React.useMemo(() => {\n if (!isActive || !calculationState.isReadyForCalculation) {\n return null;\n };\n\n return {\n formValues: getFormValuesDictionaryFromForms(form),\n selectedProducts: calculationState.selectedProducts,\n selectedAIOBasicSet: calculationState.selectedAIOBasicSet,\n selectedNonStandardComponents: calculationState.nonStandardComponents,\n owningCompanyId: project?.owningCompanyId,\n }\n }, [\n isActive,\n calculationState.isReadyForCalculation,\n form, calculationState.selectedProducts,\n calculationState.selectedAIOBasicSet, calculationState.nonStandardComponents,\n project?.owningCompanyId\n ]);\n\n const {\n costs,\n costsLoading,\n costsError,\n fetchCosts,\n resetCosts,\n } = useCalculateCosts(calculationInput);\n\n React.useEffect(() => {\n if (!isActive) return;\n\n fetchCosts();\n return () => {\n resetCosts();\n };\n }, [isActive, fetchCosts, resetCosts]);\n\n const {\n submit: reportingSubmit,\n submitLoading: reportingSubmitLoading,\n submitError: reportingSubmitError\n } = useReportingWithRedux();\n\n const { localize, enumToLookup, language } = useLocalization();\n\n const {\n error: pdfError,\n fetch: pdfFetch,\n loading: pdfLoading\n } = useProjectExport('pdf', project, form, calculationState, language);\n\n const {\n error: xlsxError,\n fetch: xlsxFetch,\n loading: xlsxLoading\n } = useProjectExport('xlsx', project, form, calculationState, language);\n\n const specialRemarks = useSpecialRemarks({\n projectType: basicInputFormValues?.projectType,\n aioBasicSet: basicInputFormValues?.aioBasicSet,\n });\n\n const formErrorList = React.useMemo(\n () => syncedErrorsToList(syncedErrors).map(({ key, message }) => ({ key: 'field.' + key, message })),\n [syncedErrors]\n );\n\n const projectStateOptions = React.useMemo(\n () => enumToLookup(Object.values(PROJECT_STATE), 'projectState'),\n [enumToLookup]\n );\n\n const cableModalRef = React.useRef(null);\n\n if (!settings) return ;\n if (!user) return ;\n if (!isAllFormReady) return ;\n if (!project) return ;\n\n const isCostsValid = !!costs && !costsLoading && !costsError;\n\n const isMontageValid = isCostsValid && (\n !costCalculationFormValues.montageIncluded ||\n isMontagePossible(basicInputFormValues, costCalculationFormValues, costs)\n );\n\n return (\n <>\n \n \n \n \n \n
\n {basicInputFormValues.country === COUNTRY.DE && \n \n \n }\n\n

\n {\n !isCostCalculationFormValid &&\n \n }\n {\n isCostsValid && isCostCalculationFormValid && !isMontageValid &&\n localize('info.montage_calculation_unavailable')\n }\n

\n
\n\n \n {\n isCostsValid && \n }\n {\n isCostsValid && isMontageValid &&\n

\n \n

\n }\n {\n isCostsValid && isMontageValid &&\n \n }\n \n \n
\n
\n
\n \n \n

{localize('documentUpload.title')}

\n {localize('documentUpload.text')}\n
\n \n \n
\n \n {\n fileList?.length > 0 &&\n \n \n \n \n {localize('documentUpload.table.column.name')}\n \n \n {localize('documentUpload.table.column.action')}\n \n \n \n\n \n {fileList.map(file =>\n \n \n downloadFile(file.name)} target=\"_blank\"\n >\n {file.name}\n \n \n \n deleteFile(file.name)}\n />\n \n \n )}\n \n
\n }\n\n {\n project.state !== PROJECT_STATE.COMPLETED &&\n
\n uploadFile(file)}/>\n
\n }\n \n \n
\n
\n
\n \n \n

{localize('projectSubmit.title')}

\n {localize('projectSubmit.text')}\n
\n \n {\n project.state !== PROJECT_STATE.COMPLETED &&\n \n
\n
\n { basicInputFormValues.projectType === 'MODERNIZED'\n && basicInputFormValues.installationPosition === 'V'\n && basicInputFormValues.weathershelter &&\n

{localize('info.modernized_weathershelter')}

\n }\n
\n \n \n \n \n \n \n
\n }\n
\n
\n \n \n \n \n
\n {\n isAdmin(user) &&\n <>\n

\n {localize('projectManage.lastReportingAt') + ': '}\n {!!project.lastReportingAt\n ? (new Date(project.lastReportingAt)).toLocaleDateString('de-DE')\n : localize('never')\n }\n

\n \n {\n costCalculationFormValues.projectState === PROJECT_STATE.OFFER_CREATED &&\n \n }\n {\n costCalculationFormValues.projectState === PROJECT_STATE.ORDER_RECEIVED &&\n \n }\n \n \n \n }\n {\n isCustomer(user) && !isAdmin(user) &&\n <>\n

\n {localize('projectState')}: {localize('projectState.' + project.state)} {(!project.state || project.state === PROJECT_STATE.DRAFT || project.state === PROJECT_STATE.NEW)}\n

\n {\n project.state === PROJECT_STATE.OFFER_CREATED && costCalculationFormValues.offerNumber &&\n

{localize('projectManage.offerNumber')}: {costCalculationFormValues.offerNumber}

\n }\n {\n project.state === PROJECT_STATE.ORDER_RECEIVED && costCalculationFormValues.orderNumber &&\n

{localize('projectManage.orderNumber')}: {costCalculationFormValues.orderNumber}

\n }\n {\n (!project.state || project.state === PROJECT_STATE.DRAFT || project.state === PROJECT_STATE.NEW) &&\n
\n \n \n
\n }\n \n }\n \n
\n
\n
\n
\n\n \n\n {costs && costs.cablingInfoList && (\n ({ ...c, header: localize('debugTable.cables.column.' + c.key) }))}\n rows={costs.cablingInfoList.map(cable => ({ key: cable.category, cols: [\n localize(\"cabling.category.\" + cable.category),\n String(cable.cable4m),\n String(cable.cable6m),\n String(cable.cable12m),\n ]}))} bottomRow={{ key: \"total\", cols: [\n localize('debugTable.cables.total'),\n String(sumBy(costs.cablingInfoList, info => info.cable4m)),\n String(sumBy(costs.cablingInfoList, info => info.cable6m)),\n String(sumBy(costs.cablingInfoList, info => info.cable12m)),\n ]}} />\n )}\n\n {isAdmin(user) && costs?.montageCosts?.montageInfoList?.length > 0 && (\n ({ ...c, header: localize('debugTable.montage.column.' + c.key) }))}\n rows={costs.montageCosts.montageInfoList.map((p,i) => ({ key: i, cols: [\n <>\n {p.title &&\n
{p.title}
\n }\n {p.products && p.products.map(p2 =>\n
{p2.quantity !== 1 ? p2.quantity + ' x ' + p2.description[language] : p2.description[language]}
\n )}\n ,\n <>\n {p.quantity !== 1 && `${p.quantity} x ${p.listPrice} € = `}\n {p.totalPrice} €\n ,\n ]}))} bottomRow={{ key: \"total\", cols: [\n localize('debugTable.montage.total'),\n String(sumBy(costs.montageCosts.montageInfoList, info => info.totalPrice)),\n ]}} />\n )}\n\n {isAdmin(user) && costs?.montageLocationCosts?.montageInfoList?.length > 0 && (\n ({ ...c, header: localize('debugTable.montageLocation.column.' + c.key) }))}\n rows={costs.montageLocationCosts.montageInfoList.map((p,i) => ({ key: i, cols: [\n <>\n {p.title &&\n
{p.title}
\n }\n {p.products && p.products.map(p2 =>\n
{p2.quantity !== 1 ? p2.quantity + ' x ' + p2.description[language] : p2.description[language]}
\n )}\n ,\n p.quantity !== 1 ? p.quantity + ' x ' + p.listPrice + ' € = ' + p.totalPrice + ' €' : p.totalPrice + ' €',\n ]}))} bottomRow={{ key: \"total\", cols: [\n localize('debugTable.montageLocation.total'),\n String(sumBy(costs.montageLocationCosts.montageInfoList, info => info.totalPrice)),\n ]}} />\n )}\n \n );\n}\n\nconst mapStateToProps = createStructuredSelector({\n isAllFormReady,\n isCostCalculationFormValid,\n syncedErrors: getFormSyncErrors(ReduxFormKeys.costCalculationForm),\n\n basicInputFormValues: getFormValues(ReduxFormKeys.basicInputsForm) as BASIC_INPUTS_FORM_VALUES_SELECTOR,\n costCalculationFormValues: getFormValues(ReduxFormKeys.costCalculationForm) as COST_CALCULATION_FORM_VALUES_SELECTOR,\n\n selectedProducts: (state: IApplicationState) => state.calculationState?.selectedProducts,\n nonStandardComponents: (state: IApplicationState) => state.calculationState?.nonStandardComponents,\n});\n\nexport default connect(mapStateToProps)(\n reduxForm<{}, OwnProps & ReduxProps>({\n form: ReduxFormKeys.costCalculationForm,\n touchOnChange: true,\n touchOnBlur: true,\n keepDirtyOnReinitialize: true,\n enableReinitialize: true,\n })(CostCalculationForm)\n)\n\ntype OwnProps = {\n isActive: boolean;\n};\ntype ReduxProps = ReturnType;\ntype ReduxFormProps = InjectedFormProps<{}, OwnProps & ReduxProps>;\ntype Props = OwnProps & ReduxProps & ReduxFormProps;\n","import * as React from 'react';\nimport {useDispatch, useSelector} from 'react-redux';\n\nimport { useConfig } from '../../configProvider';\nimport { useFetchOnce } from '../../shared/useFetchOnce.hook';\nimport { useDispatchCallback } from '../../store/useDispatchCallback';\n\nimport {\n projectApi,\n projectApiActionCreator,\n} from \"./ProjectApi.redux\";\nimport { useAuthTokenContext } from '../auth/AuthService';\n\nimport { CalculationApiV1Client } from './CalculationApiV1Client';\nimport { ICalculationInput } from './CalculationModels';\n\n\n/** Use Project State in Redux */\nexport function useProjectV1() {\n const dispatch = useDispatch();\n\n const {\n productData: productDataList,\n entity: project,\n error: projectError,\n loading: projectLoading,\n isUpdating: projectIsUpdating,\n } = useSelector(projectApi.selector());\n\n const getProject = useDispatchCallback(dispatch, projectApiActionCreator.getRequest);\n const makeProject = useDispatchCallback(dispatch, projectApiActionCreator.makeProject);\n const updateProject = useDispatchCallback(dispatch, projectApiActionCreator.updateRequest);\n\n return React.useMemo(() => ({\n productDataList,\n project,\n projectError,\n projectLoading,\n projectIsUpdating,\n getProject,\n makeProject,\n updateProject,\n }), [\n productDataList,\n project,\n projectError,\n projectLoading,\n projectIsUpdating,\n getProject,\n makeProject,\n updateProject,\n ]);\n}\n\nexport function useCalculateCosts(calculationInput: ICalculationInput) {\n const { apiUrl } = useConfig();\n const { getToken } = useAuthTokenContext();\n const client = React.useMemo(() => new CalculationApiV1Client(apiUrl['calculation-v1'], getToken), [apiUrl, getToken]);\n\n const calculationGetter = React.useCallback(async () => {\n if (calculationInput == null) return null;\n return client.calculateCosts(calculationInput);\n }, [client, calculationInput]);\n\n const {\n value: costs,\n error: costsError,\n loading: costsLoading,\n fetch: fetchCosts,\n reset: resetCosts,\n } = useFetchOnce(calculationGetter);\n\n return React.useMemo(() => ({\n costs,\n costsError,\n costsLoading,\n fetchCosts,\n resetCosts,\n }), [\n costs,\n costsError,\n costsLoading,\n fetchCosts,\n resetCosts,\n ]);\n}\n","import * as React from 'react';\nimport * as classNames from 'classnames';\nimport { SemanticShorthandItem, Tab, TabPaneProps, TabProps } from 'semantic-ui-react';\n\nimport { useLocalization } from '../../../localization/hook';\nimport { ISelectedProduct } from \"../CalculationModels\";\nimport { Tabs } from '../CalculationReducer';\n\nimport BasicInputsForm from './01-BasicInputs/BasicInputsForm';\nimport ConfigurationInputsForm from './02-ConfigurationInputs/ConfigurationInputsForm';\nimport VentilationComponentsForm from './03-VentilationComponents/VentilationComponentsForm';\nimport CostCalculationForm from './04-CostCalculation/CostCalculationForm';\n\nimport './CalculationTabs.scss';\n\n\ninterface CalculationTabsProps {\n activeTabIndex: number;\n selectedAIOBasicSet: ISelectedProduct;\n canNavigateToConfigurationForm: boolean;\n canNavigateToVentilationForm: boolean;\n canNavigateToCostCalculationForm: boolean;\n\n requestSwitchTabIndex: (index: number) => unknown;\n setAIOBasicSetModalVisibility: (isOpen: boolean) => unknown;\n};\nexport const CalculationTabs: React.FC = ({\n activeTabIndex,\n selectedAIOBasicSet,\n canNavigateToConfigurationForm,\n canNavigateToVentilationForm,\n canNavigateToCostCalculationForm,\n requestSwitchTabIndex,\n setAIOBasicSetModalVisibility,\n}) => {\n const { localize } = useLocalization();\n\n const onTabChanged = (event: React.MouseEvent, data: TabProps) => {\n switch (data.activeIndex) {\n case Tabs.BasicInput:\n requestSwitchTabIndex(Tabs.BasicInput);\n if (selectedAIOBasicSet) {\n setAIOBasicSetModalVisibility(true);\n }\n break;\n case Tabs.Configuration:\n if (!canNavigateToConfigurationForm) return;\n requestSwitchTabIndex(Tabs.Configuration);\n break;\n case Tabs.VentilationComponents:\n if (!canNavigateToVentilationForm) return;\n requestSwitchTabIndex(Tabs.VentilationComponents);\n break;\n case Tabs.CostCalculation:\n if (!canNavigateToCostCalculationForm) return;\n requestSwitchTabIndex(Tabs.CostCalculation);\n break;\n }\n };\n\n const panes: ({ menuItem?: any;} & (\n | { pane: SemanticShorthandItem; }\n | { render: () => React.ReactNode; }\n ))[] = [\n {\n menuItem: {\n key: 'basicInputs',\n content: (\n \n 1\n {localize('page.title.basicInputs')}\n \n )\n },\n pane: {\n key: 'basicInputs',\n content: \n }\n },\n {\n menuItem: {\n key: 'configurationInputs',\n content: (\n \n 2\n {localize('page.title.configurationInputs')}\n \n )\n },\n pane: {\n key: 'configurationInputs',\n content: \n }\n },\n {\n menuItem: {\n key: 'ventilationComponents',\n content: (\n \n 3\n {localize('page.title.ventilationComponents')}\n \n )\n },\n pane: {\n key: 'ventilationComponents',\n content: \n }\n },\n {\n menuItem: {\n key: 'costCalculation',\n content: (\n \n 4\n {localize('page.title.costCalculation')}\n \n )\n },\n pane: {\n key: 'costCalculation',\n content: \n }\n }\n ];\n\n return (\n
\n \n
\n );\n}\n","import * as React from 'react';\nimport { useHistory } from 'react-router-dom';\nimport { History } from 'history';\nimport { connect } from 'react-redux';\nimport { createStructuredSelector } from \"reselect\";\nimport { getFormValues } from 'redux-form';\nimport { Button } from 'semantic-ui-react';\nimport moment from 'moment';\n\nimport { LocalizationProps, RestrictLanguages, useLocalization, useProductLanguage } from '../../localization/hook';\nimport { LanguageKey } from '../../localization/LocalizationService';\nimport { RestrictedLanguageMessage } from '../../localization/RestrictedLanguageMessage';\nimport { RestrictedCurrencyMessage } from '../../localization/RestrictedCurrencyMessage';\nimport { Spinner, SpinnerOpCode } from '../../shared/components/Spinner';\nimport { IApplicationState } from \"../../shared/ApplicationState\";\n\nimport { ReduxFormKeys } from '../form/ReduxFormKeys';\nimport { isAdmin } from '../auth/PermissionService';\nimport { useUser } from '../auth/User.hook';\nimport { IUser } from '../auth/types';\nimport { projectApi, projectApiActionCreator } from './ProjectApi.redux';\n\nimport { calculationTabs, isCalculationTab } from \"./constant\";\nimport { CalculationTabs } from './components/CalculationTabs';\nimport { calculationActionCreator } from \"./CalculationActions\";\nimport { Direction, Tabs } from './CalculationReducer';\nimport * as select from \"./calculation.selector\";\nimport { COST_CALCULATION_FORM_VALUES_SELECTOR } from './components/02-ConfigurationInputs/ConfigurationInputsForm';\nimport DebugTable from './components/DebugTable';\n\nimport \"./CalculationPage.scss\";\nimport { useFreshworksWidgetPrefillProjectId } from '../freshworks-widget/useFreshworksWidget.hook';\n\n\nconst aioBasicSetCutoffTime = moment(\"2024-04-17 13:00:00+02:00\");\n\nclass InnerCalculationPage extends React.Component {\n\n componentDidMount(): void {\n const props = this.props;\n const { projectId, calculationTab, user } = this.props; \n\n // Populate project data (existing or fresh)\n if (projectId !== 'new') {\n // Load existing project, maybe as a template\n const asTemplate = calculationTab === 'as-template';\n props.getProject(projectId, asTemplate);\n\n } else {\n props.makeProject(user.company.id);\n }\n\n // Switch to the right tab\n const switchToIndex = isCalculationTab(calculationTab) ? calculationTabs.indexOf(calculationTab) : 0;\n this.props.switchTabIndex(switchToIndex);\n\n }\n\n componentDidUpdate(prevProps: InnerProps) {\n const prevProject = prevProps.project;\n const currProject = this.props.project;\n\n const prevTabIndex = prevProps.activeTabIndex;\n const currTabIndex = this.props.activeTabIndex;\n\n const prevRouteForm = prevProps.calculationTab;\n const currRouteForm = this.props.calculationTab;\n\n const prevRouteProject = prevProps.projectId;\n const currRouteProject = this.props.projectId || 'new';\n\n if (prevTabIndex !== currTabIndex) {\n // form tab changed, push history entry\n const newRouteProject = currProject ? currProject.id : currRouteProject;\n const newRouteForm = calculationTabs[currTabIndex];\n if (newRouteForm !== currRouteForm) {\n this.props.history.push('/calculation/' + currRouteProject + '/' + newRouteForm);\n console.log(\"PUSH -->\", '/calculation/' + currRouteProject + '/' + newRouteForm, \"newRouteProject\", newRouteProject);\n }\n }\n\n if (prevRouteForm !== currRouteForm) {\n // URL route form parameter changed\n console.log(\"FORM -->\", prevRouteForm, ' --> ', currRouteForm);\n // Only switch tab when old form was a valid tab. Do not switch when old form was 'as-template'.\n if (isCalculationTab(prevRouteForm)) {\n this.props.requestSwitchTabIndex(calculationTabs.indexOf(currRouteForm as calculationTabs));\n }\n }\n }\n\n /** When either button is clicked, navigate towards the requested direction */\n onNavigate(event: React.MouseEvent, direction: string) {\n event.preventDefault();\n\n\n const isAdvancingFromBasicInput = this.props.activeTabIndex === Tabs.BasicInput && direction === Direction.Next;\n let showSetsModal = isAdvancingFromBasicInput && this.props.aioBasicSets?.length > 0;\n\n if (\n !this.props.project?.createdAt?.length\n || aioBasicSetCutoffTime.isSameOrBefore(this.props.project?.createdAt)\n || !this.props.calculationState?.selectedAIOBasicSet\n ) {\n // Disable AIO Basic Set dialog for new projects\n showSetsModal = false;\n }\n\n if (showSetsModal) {\n this.props.setAIOBasicSetModalVisibility(true);\n } else {\n this.props.requestSwitchTab(direction);\n }\n }\n\n public render() {\n const {\n user,\n calculationState,\n activeTabIndex,\n selectedProducts,\n selectedAIOBasicSet,\n project,\n projectError,\n projectIsUpdating,\n productData,\n canNavigateToConfigurationForm,\n canNavigateToVentilationForm,\n canNavigateToCostCalculationForm,\n requestSwitchTabIndex,\n setAIOBasicSetModalVisibility,\n localize,\n productLanguage,\n } = this.props;\n\n const calcTabsProps = {\n activeTabIndex,\n selectedAIOBasicSet,\n canNavigateToConfigurationForm,\n canNavigateToVentilationForm,\n canNavigateToCostCalculationForm,\n requestSwitchTabIndex,\n setAIOBasicSetModalVisibility,\n }\n\n if (!calculationState) {\n return ;\n }\n\n if (!productData) {\n return ;\n }\n\n let canNext = false;\n switch (activeTabIndex + 1) {\n case Tabs.Configuration:\n canNext = canNavigateToConfigurationForm;\n break;\n case Tabs.VentilationComponents:\n canNext = canNavigateToVentilationForm;\n break;\n case Tabs.CostCalculation:\n canNext = canNavigateToCostCalculationForm;\n break;\n }\n\n const showNextButton = activeTabIndex < 3;\n const showPrevButton = activeTabIndex > 0;\n\n return (\n
\n \n \n\n
\n \n
\n
\n {showNextButton && (\n \n )}\n {showPrevButton && (\n \n )}\n
\n\n
\n\n {isAdmin(user) && project && (\n \n )}\n\n {isAdmin(user) && !!selectedAIOBasicSet && (\n ({ ...c, header: localize('debugTable.products.column.' + c.key) }))}\n rows={[{ key: selectedAIOBasicSet.id, cols: [\n selectedAIOBasicSet.description[productLanguage],\n selectedAIOBasicSet.dhNo,\n String(selectedAIOBasicSet.quantity),\n ]}]} />\n )}\n\n {isAdmin(user) && selectedProducts && selectedProducts.length > 0 && (\n ({ ...c, header: localize('debugTable.products.column.' + c.key) }))}\n rows={selectedProducts.filter(p => p.quantity > 0).map(p => ({ key: p.id, cols: [\n p.description[productLanguage],\n p.dhNo,\n String(p.quantity),\n ]}))} />\n )}\n
\n );\n }\n}\n\nconst LocalizedCalculationPage: React.FC> = (props) => {\n const localizationProps = useLocalization();\n const productLanguage = useProductLanguage();\n\n // @TODO: Move to InnerCalculationPage once it's a functional component\n useFreshworksWidgetPrefillProjectId(props.projectId);\n\n return ;\n};\n\nconst ProtectedCalculationPage: React.FC> = (props) => {\n const { user } = useUser();\n const history = useHistory();\n\n return (\n \n \n \n );\n};\n\nconst {\n canNavigateToConfigurationForm,\n canNavigateToVentilationForm,\n canNavigateToCostCalculationForm,\n} = select;\n\nconst mapStateToProps = createStructuredSelector({\n canNavigateToConfigurationForm,\n canNavigateToVentilationForm,\n canNavigateToCostCalculationForm,\n\n project: projectApi.makeSelectBase('entity'),\n projectLoading: projectApi.makeSelectBase('loading'),\n projectError: projectApi.makeSelectBase('error'),\n projectIsUpdating: projectApi.makeSelectBase('isUpdating'),\n productData: select.getProductData,\n\n form: select.getForm,\n calculationState: (state: IApplicationState) => state.calculationState,\n activeTabIndex: select.getActiveTabIndex,\n aioBasicSets: (state: IApplicationState) => state.calculationState?.aioBasicSets,\n selectedProducts: (state: IApplicationState) => state.calculationState?.selectedProducts,\n selectedAIOBasicSet: (state: IApplicationState) => state.calculationState?.selectedAIOBasicSet,\n\n costCalculationFormValues: getFormValues(ReduxFormKeys.costCalculationForm) as COST_CALCULATION_FORM_VALUES_SELECTOR,\n});\n\nconst mapDispatchToProps = {\n setAIOBasicSetModalVisibility: calculationActionCreator.setAIOBasicSetModalVisibility,\n switchTabIndex: calculationActionCreator.switchTabIndex,\n requestSwitchTab: calculationActionCreator.requestSwitchTab,\n requestSwitchTabIndex: calculationActionCreator.requestSwitchTabIndex,\n\n getProject: projectApiActionCreator.getRequest,\n makeProject: projectApiActionCreator.makeProject,\n} as const;\n\nexport const CalculationPage = connect(\n mapStateToProps,\n mapDispatchToProps\n)(ProtectedCalculationPage);\n\ntype ReduxProps = ReturnType & typeof mapDispatchToProps;\ntype OwnProps = {\n projectId: string | 'new';\n calculationTab: calculationTabs | 'as-template';\n};\ntype InnerProps = ReduxProps & LocalizationProps & { productLanguage: LanguageKey, history: History, user: IUser, } & OwnProps;\n","import * as React from 'react';\nimport { Grid } from 'semantic-ui-react';\n\nimport { useConfig } from '../../configProvider';\nimport { useCurrency, useLocalization } from '../../localization/hook';\nimport { useAuthTokenContext } from \"../auth/AuthService\";\n\nimport \"./SimulatorPage.scss\";\n\ndeclare global {\n namespace JSX {\n interface IntrinsicElements {\n 'app-simulation': React.DetailedHTMLProps, HTMLElement>;\n }\n }\n}\n\nexport const SimulatorPage: React.FC<{}> = () => {\n const { bkSimulatorUrl } = useConfig();\n const { getToken, isTokenExpired } = useAuthTokenContext();\n\n const [frameLoaded, setFrameLoaded] = React.useState(false);\n\n const iframeRef = React.useRef(null);\n\n function postMessage(frame: HTMLIFrameElement|null, msg: any) {\n if (!frame) {\n return false;\n }\n frame.contentWindow.postMessage(msg, '*');\n return true;\n }\n \n function loadSimulatorApp() {\n getToken().then(token => postMessage(iframeRef.current, { method: 'init', token }));\n \n return setInterval(updateSimulatorAppToken, 1000);\n }\n \n function updateSimulatorAppToken() {\n if (isTokenExpired(20)) {\n getToken().then(token => postMessage(iframeRef.current, { method: 'updateToken', token }));\n }\n }\n\n const onFrameLoad = () => {\n setFrameLoaded(true);\n }\n\n // Load App\n React.useEffect(() => {\n if (!frameLoaded) return;\n\n const interval = loadSimulatorApp();\n\n return () => {\n interval && clearInterval(interval);\n }\n }, [frameLoaded, iframeRef.current]);\n\n // Language\n const { language, localize } = useLocalization();\n React.useEffect(() => {\n if (!frameLoaded) return;\n\n postMessage(iframeRef.current, { method: 'setLanguage', language });\n }, [frameLoaded, language]);\n\n // Currency\n const currency = useCurrency();\n React.useEffect(() => {\n if (!frameLoaded) return;\n\n postMessage(iframeRef.current, { method: 'setCurrency', currency })\n }, [frameLoaded, currency]);\n\n // Render\n return <>\n \n
\n \n
\n
\n ;\n};\n","import * as React from 'react';\nimport ReactMarkdown from 'react-markdown';\n\n\nexport const Markdown: React.FC<{ children: string; }> = ({ children }) => {\n return \n};\n","export default \"## BlueKit CONNECT Impressum\\n\\nBlueKit CONNECT ist ein Angebot der\\n\\n**D+H Mechatronic AG** \\nGeorg-Sasse-Str. 28-32 \\n22949 Ammersbek, Deutschland\\n\\nWeb: [https://www.dh-partner.com/group/de](https://www.dh-partner.com/group/de) \\nE-Mail: [info@dh-partner.com](mailto:info@dh-partner.com)\\n\\n##### Vorstand\\n\\nDirk Dingfelder (Vorsitzender),\\nChristoph Kern (Vertrieb),\\nMirko Matenia (Finanzen),\\nMaik Schmees (Technik)\\n\\n##### Aufsichtsratvorsitzender\\n\\nDr. Stefan Papirow\\n\\n##### Handelsregister\\n\\nHRB 115942 beim Amtsgericht Hamburg\\n\\n##### Umsatzsteuer-Identifikationsnummer\\n\\nDE118648151\\n\\n##### WEEE-Registrierungsnummer\\n\\nDE40082044\\n\\n##### Inhaltlich Verantwortlicher i.S.d. § 18 Abs. 2 MStV\\n\\nChristoph Kern\\n\";","export default \"## BlueKit CONNECT Legal Notice\\n\\nBlueKit CONNECT is a service offered by\\n\\n**D+H Mechatronic AG** \\nGeorg-Sasse-Str. 28-32 \\n22949 Ammersbek, Germany\\n\\nWeb: [https://www.dh-partner.com/group/en](https://www.dh-partner.com/group/en) \\nE-Mail: [info@dh-partner.com](mailto:info@dh-partner.com)\\n\\n##### Executive management board\\n\\nDirk Dingfelder (CEO),\\nChristoph Kern (CSO),\\nMirko Matenia (CFO),\\nMaik Schmees (CTO)\\n\\n##### Chairman of the supervisory board\\n\\nDr. Stefan Papirow\\n\\n##### Company register\\n\\nHRB 115942 with Hamburg Local Court\\n\\n##### VAT ID number\\n\\nDE118648151\\n\\n##### WEEE registration number\\n\\nDE40082044\\n\\n##### Responsible for content according to § 18 Abs. 2 MStV\\n\\nChristoph Kern\\n\";","import * as React from 'react';\n\nimport { Markdown } from '../../shared/components/Markdown';\nimport { RestrictLanguages, useLanguage } from '../../localization/hook';\nimport { RestrictedLanguageMessage } from '../../localization/RestrictedLanguageMessage';\n\n/* eslint import/no-webpack-loader-syntax: off */\nimport legalNotice_de_md from '!!raw-loader!./LegalNotice_de.md';\nimport legalNotice_en_md from '!!raw-loader!./LegalNotice_en.md';\n\n\nexport const LegalNotice: React.FC<{}> = () => {\n const language = useLanguage();\n const md = React.useMemo(() => getMdForLang(language), [language]);\n\n return \n \n \n ;\n};\n\nfunction getMdForLang(lang: string) {\n switch (lang) {\n case 'de':\n return legalNotice_de_md;\n case 'en':\n default:\n return legalNotice_en_md;\n }\n}\n","import * as React from 'react';\nimport {Icon, Modal, Tab, Table, List, Label} from 'semantic-ui-react';\n\nimport { useLocalization } from '../localization/hook';\nimport { LanguageKey, forLanguage } from '../localization/LocalizationService';\n\nimport { DataProtectionDeclaration } from './documents/DataProtectionDeclaration';\nimport { LegalNotice } from './documents/LegalNotice';\n\n\nimport './TermsAndConditions.scss';\n\nexport const TermsAndConditionsModal: React.FC<{ className?: string }> = ({ className }) => {\n const { localizeEnum } = useLocalization();\n\n const [open, setOpen] = React.useState(false);\n const [targetTab, setTargetTab] = React.useState(null);\n\n const onClose = React.useCallback(() => {\n setOpen(false);\n setTargetTab(null);\n }, [setOpen]);\n\n const onTriggerClick = React.useCallback((e: React.MouseEvent) => {\n e.preventDefault();\n\n setTargetTab(e.currentTarget.dataset['link'] as TermsAndConditionsTabKey);\n setOpen(true);\n }, [setTargetTab, setOpen]);\n\n return (\n {['termsandconditions', /* 'data_protection_declaration', */ 'legal_notice'].map(key => (\n {localizeEnum(key, 'link')}\n ))}}>\n \n \n \n \n );\n};\n\ntype CompanyUrls = { company: string, country: string, urls: { type: string, language: LanguageKey, url: string }[], }[];\nconst termsAndConditions: CompanyUrls = [\n { company: 'D+H Deutschland GmbH', country: 'de', urls: [\n { type: 'termsofservice', language: 'de', url: 'https://www.bluekit.de/agb' },\n { type: 'termsofinstallation', language: 'de', url: '/static/BlueKit_DH_Deutschland_Montagebedingungen_2024_02_20.pdf' },\n ]},\n { company: 'D+H Österreich GmbH', country: 'at', urls: [\n { type: 'termsofservice', language: 'de', url: 'https://www.dh-partner.com/Website/D-H-Oesterreich/Downloads/AGB_DH-Oesterreich-GmbH.pdf' },\n ]},\n { company: 'D+H Mechatronic AG', country: 'int', urls: [\n { type: 'termsofsaleanddelivery', language: 'de', url: 'https://www.dh-partner.com/group/de/meta/rechtliches/Verkaufs-und-Lieferbedingungen' },\n { type: 'termsofsaleanddelivery', language: 'en', url: 'https://www.dh-partner.com/group/en/meta/legal/Terms-of-sale-and-delivery' },\n ]}\n];\n\ntype TermsAndConditionsTabKey = 'termsandconditions'|'data_protection_declaration'|'legal_notice';\nconst TermsAndConditionsTabs: React.FC<{ defaultTab?: TermsAndConditionsTabKey; }> = ({ defaultTab }) => {\n const { localize } = useLocalization();\n\n const defaultActiveTabIndex = React.useMemo(() => {\n switch (defaultTab) {\n case 'termsandconditions': return 0;\n case 'data_protection_declaration': return 1;\n case 'legal_notice': return 2;\n default: return null;\n }\n }, [defaultTab]);\n\n return (\n \n \n },\n {/* @TODO: Legal review // menuItem: localize('link.data_protection_declaration'), render: () => \n \n */},\n { menuItem: localize('link.legal_notice'), render: () => \n \n },\n ]} defaultActiveIndex={defaultActiveTabIndex}/>\n );\n};\n\nconst TermsAndConditionsLinksTable: React.FC<{}> = () => {\n const { language, localizeCountry, localizeEnum } = useLocalization();\n\n return (\n \n \n {termsAndConditions.map(entry => (\n {entry.company}\n {entry.country === 'int' ? 'International' : localizeCountry(entry.country)}\n {entry.urls.map(({ type, language: linklang, url }) => (\n \n \n \n \n \n \n \n {forLanguage(linklang).localizeEnum(type, 'link')}\n \n {linklang !== language && (\n {localizeEnum(type, 'link')}\n )}\n \n \n ))}\n ))}\n \n
\n );\n};\n","export default __webpack_public_path__ + \"static/media/BlueKit-logo.1e88e775.png\";","import * as React from 'react';\nimport {Image, Icon, Select, DropdownProps} from 'semantic-ui-react';\nimport * as classNames from 'classnames';\n\nimport {useSelector} from 'react-redux';\nimport {useHistory, useRouteMatch} from \"react-router-dom\";\n\nimport { useConfig } from '../configProvider';\nimport { IApplicationState } from '../shared/ApplicationState';\nimport {projectApi} from '../features/calculation/ProjectApi.redux';\nimport { useAuthenticated } from '../features/auth/Auth.hook';\nimport { useUser } from '../features/auth/User.hook';\nimport {canAccessConnect} from \"../features/auth/PermissionService\";\n\nimport { useCurrency, useLanguage, useLocalization, useSetCurrency, useSetLanguage } from '../localization/hook';\nimport { CurrencyKey, forLanguage, LanguageKey } from '../localization/LocalizationService';\n\nimport { TermsAndConditionsModal } from './TermsAndConditions';\n\n\nimport './Layout.scss';\nimport logoImage from '../assets/BlueKit-logo.png';\n\n\nexport const Layout: React.FC<{}> = props => {\n // Contact information\n const [phoneVisible, setPhoneVisible] = React.useState(false);\n const togglePhone = () => {\n setPhoneVisible(!phoneVisible);\n };\n\n const activeProjectId = useActiveProjectId();\n\n const mailto = React.useMemo(() => 'mailto:kundencenter@dh-partner.com' + (\n !!activeProjectId ? `?subject=${encodeURIComponent(activeProjectId)}` : ''\n ), [activeProjectId]);\n\n const contactPhone = '+49 40 530039-0';\n\n return (\n
\n
\n \n
\n {props.children}\n\n
\n
\n \n \n \n \n \n {contactPhone}\n \n \n \n
\n
\n
\n
\n\n \n
\n );\n}\n\nconst LayoutHeader: React.FC<{}> = () => {\n const { localize } = useLocalization();\n const { reset: resetAuthentication } = useAuthenticated();\n const { user } = useUser();\n const { push: historyPush } = useHistory();\n\n // Routing\n const rootMatch = useRouteMatch('/');\n const calculatorMatch = useRouteMatch('/calculation');\n const simulatorMatch = useRouteMatch('/simulator');\n\n const isCalculatorPage = rootMatch?.isExact || calculatorMatch;\n const isSimulatorPage = simulatorMatch;\n\n const currentLanguage = useLanguage();\n const setLanguage = useSetLanguage();\n const languageOptions = React.useMemo(() => LanguageKey.map(key => ({\n key,\n value: key,\n text: `(${key.toLocaleUpperCase()}) ${forLanguage(key).localize('language.' + key, {}, key)}`\n })), []);\n\n const { enableCurrencySelect } = useConfig();\n const currentCurrency = useCurrency();\n const setCurrency = useSetCurrency();\n const currencyOptions = React.useMemo(() => CurrencyKey.map(key => ({ key, value: key, text: key })), []);\n\n\n // Events\n function onLanguageChange(_event, dp: DropdownProps) {\n if (!LanguageKey.includes(dp.value as any)) {\n return;\n }\n const newLang = dp.value as LanguageKey;\n setLanguage(newLang);\n }\n\n function onCurrencyChange(_event, dp: DropdownProps) {\n if (!currencyOptions.find(c => c.key === dp.value as any)) {\n return;\n }\n const newCurr = dp.value as string;\n setCurrency(newCurr);\n }\n\n function goto(path: string) {\n return (e: React.MouseEvent) => {\n e.preventDefault();\n historyPush(path);\n };\n }\n\n const onLogoutClick = React.useCallback(() => {\n resetAuthentication();\n }, [resetAuthentication]);\n\n\n return (\n
\n
\n \"BlueKit\n
\n
\n

{localize('header.title')}

\n
\n {\n canAccessConnect(user) && <>\n \n
\n {localize('header.menu.calc')}\n
\n \n
\n {localize('header.menu.sim')}\n
\n \n }\n {\n !!user && <>\n \n
\n {localize('header.menu.logout')}\n
\n \n }\n \n )}\n
\n );\n};\n\nconst LayoutFooter: React.FC<{}> = () => {\n const { localize } = useLocalization();\n const { user } = useUser();\n\n const contactUrl = React.useMemo(() => countryIsAustria(user?.country)\n ? 'https://www.bluekit.at/kontakt/'\n : 'https://www.bluekit.de/kontakt/',\n [user?.country]\n );\n\n const version = process.env.BUILD_SOURCEVERSION || '';\n\n return (\n
\n
\n
\n \n {localize('link.contact')}\n \n \n {version ?
Version: {version.slice(0, 6)}
: null}\n
\n
\n
\n );\n};\n\n\nfunction useActiveProjectId(): string|null {\n return useSelector(s => projectApi.makeSelectBase('entity')(s)?.id);\n}\n\nfunction countryIsAustria(country: string): boolean {\n if (typeof country !== 'string' || !country.length) return false;\n\n country = country.toLowerCase();\n return country === 'at' || country === 'österreich';\n}\n","import * as React from 'react';\nimport { Message } from 'semantic-ui-react';\n\nimport { IUser } from '../features/auth/types';\nimport { useUser } from '../features/auth/User.hook';\nimport { useLocalization } from '../localization/hook';\nimport { Spinner, SpinnerOpCode } from '../shared/components/Spinner';\n\n\nexport interface AccessControlProps {\n checkFn: (user: IUser) => boolean;\n}\n\nexport const AccessControl: React.FC = (props) => {\n const { localize } = useLocalization();\n const { user, userLoading, userError } = useUser();\n\n const accessGranted = React.useMemo(() => !!user && props.checkFn(user), [props.checkFn, user]);\n\n if (!user || (userError && userLoading)) {\n return \n }\n\n if (!accessGranted) {\n return ;\n }\n\n return <>{props.children};\n};\n","import React from 'react';\nimport { Redirect, Route, Switch } from 'react-router-dom';\n\nimport { Spinner, SpinnerOpCode } from \"./shared/components/Spinner\";\nimport { ProjectExplorerPage } from \"./features/project/ProjectExplorerPage\";\nimport { CalculationPage } from \"./features/calculation/CalculationPage\";\nimport { calculationTabs } from './features/calculation/constant';\nimport { SimulatorPage } from \"./features/simulator/SimulatorPage\";\n\nimport { Layout as LayoutV1 } from './layout/Layout';\nimport { AccessControl } from './layout/AccessControl';\n\nimport { canAccessConnect } from './features/auth/PermissionService';\nimport { useUser } from './features/auth/User.hook';\nimport { useAuthenticated } from \"./features/auth/Auth.hook\";\nimport { useSettings } from './features/settings/Settings.hook';\nimport { useFreshworksWidgetPrefillUser } from './features/freshworks-widget/useFreshworksWidget.hook';\n\n\nconst App: React.FC<{}> = () => {\n const { isAuthenticated } = useAuthenticated();\n const { fetchSettings } = useSettings();\n const { fetchUser, user } = useUser();\n\n // Once authenticated, fetch settings and user\n React.useEffect(() => {\n if (isAuthenticated) {\n console.debug('[App] Loading settings');\n fetchSettings();\n console.debug('[App] Loading user');\n fetchUser();\n }\n }, [isAuthenticated]);\n\n useFreshworksWidgetPrefillUser(user);\n\n if (!isAuthenticated) {\n return ;\n }\n\n return (<>\n \n \n \n \n \n \n \n \n \n\n \n \n (\n \n )}/>\n\n {\n const projectId = routeProps.match.params[\"projectId\"];\n const calculationTab = routeProps.match.params[\"form\"] as (calculationTabs|'as-template');\n return (\n \n \n \n \n \n );\n }}\n />\n\n \n \n \n \n \n \n \n \n );\n}\n\nexport default App;\n","import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\n\nimport {Provider} from 'react-redux';\nimport {ConnectedRouter} from 'connected-react-router'\nimport {createBrowserHistory} from 'history';\n\nimport {configProvider} from \"./configProvider\";\nimport { configureStore, ApplicationStore } from './store/store';\n\nimport { LocalizationContextProvider } from './localization/hook';\nimport { AuthContextProvider } from './features/auth/Auth.hook';\nimport { UserContextProvider } from './features/auth/User.hook';\nimport { SettingsContextProvider } from './features/settings/Settings.hook';\nimport { ConfigContextProvider, useConfigV2 } from './features/config/Config.hook';\n\nimport { Spinner, SpinnerOpCode } from './shared/components/Spinner';\n\nimport App from './App';\n\nimport 'antd/dist/antd.min.css';\nimport 'semantic-ui-less/semantic.less';\nimport './global.scss';\n\n\nif (process.env.NODE_ENV === 'development') {\n // @DEV: Development environment overrides\n configProvider.disableKeyCloak = true;\n configProvider.enableE2EToken = true;\n console.debug('=== Development Environment ===');\n}\n\n/** Wraps `children` in Redux store provider and all global React context providers */\nconst EverythingProvider: React.FC> = ({ children, store }) => {\n const { config, configError, configLoading } = useConfigV2();\n\n if (!config) {\n return (\n
\n
\n
\n \n
\n
\n
\n );\n }\n\n return (\n \n \n \n \n \n {children}\n \n \n \n \n \n );\n};\n\nfunction renderApp(appElement: HTMLElement, loaderElement?: HTMLElement) {\n\n const history = createBrowserHistory({basename: '/'});\n const store = window.store = configureStore(history);\n\n const root = (\n \n \n \n \n \n \n \n );\n\n const onRendered = () => {\n if (loaderElement) {\n loaderElement.style.display = 'none';\n }\n appElement.style.display = 'block';\n }\n\n ReactDOM.render(root, appElement, onRendered);\n}\n\nrenderApp(\n document.getElementById('react-app'),\n document.getElementById('loader')\n);\n"],"sourceRoot":""}