{"version":3,"sources":["types/CreateOrderSteps.ts","overmind/state.ts","../../common/src/types/Page.ts","../../common/src/types/User.ts","../../common/src/styles/constants.ts","../../common/src/elements/Link/Link.tsx","../../common/src/elements/Page/Page.tsx","overmind/index.ts","../../common/src/elements/Grid/Grid.ts","../../common/src/styles/baseInput.ts","../../common/src/elements/FormInput/FormInput.styles.ts","../../common/src/elements/Label/Label.tsx","../../common/src/elements/FormControl/FormControl.tsx","../../common/src/elements/RequiredFieldIndicator/RequiredFieldIndicator.styles.ts","../../common/src/elements/RequiredFieldIndicator/RequiredFieldIndicator.tsx","../../common/src/elements/FormInput/FormInput.tsx","../../common/src/elements/Buttons/Buttons.styles.ts","elements/FormControl/FormControl.tsx","styles/constants.ts","styles/baseInput.ts","components/Select/Select.styles.tsx","elements/RequiredFieldIndicator/RequiredFieldIndicator.styles.ts","elements/RequiredFieldIndicator/RequiredFieldIndicator.tsx","components/Select/Select.tsx","components/Checkbox/Checkbox.styles.ts","components/Checkbox/Checkbox.tsx","pages/order/OrderListPage/components/OrderFilter/OrderFilter.tsx","hooks/useOnClickOutside.ts","../../common/src/components/Table/components/ColumPicker/ColumnPicker.tsx","../../common/src/components/Table/Direction.ts","../../common/src/components/Table/elements/SortIcon/SortIcon.tsx","../../common/src/types/EmployeeMessage.ts","../../common/src/components/Table/Table.styles.tsx","../../common/src/components/Table/Table.tsx","../../common/src/elements/ExpandIcon/ExpandIcon.tsx","../../common/src/helpers/date.ts","elements/Link/Link.tsx","helpers/money.ts","helpers/order.ts","components/EmployeeLink/EmployeeLink.tsx","components/OrderList/OrderList.tsx","components/Pager/Pager.tsx","../../common/src/types/CMSArticle.ts","pages/Guest/UnauthForm.styles.ts","components/ButtonGroup/ButtonGroup.styles.ts","pages/Guest/ForgotPasswordPage/ForgotPasswordPage.tsx","components/CMSContent/CMSContent.tsx","elements/Header/Header.styles.ts","elements/Header/Header.tsx","components/Buttons/Buttons.styles.ts","components/ShortcutCard/ShortcutCard.styles.ts","components/ShortcutCard/ShortcutCard.tsx","elements/VBox/VBox.ts","assets/img/banner.jpg","pages/Home/HomePage.styles.ts","hooks/useWindowDimensions.ts","pages/Home/HomePage.tsx","services/pretreAPI/BaseService.ts","../../common/src/components/PhoneLink/PhoneLink.tsx","elements/HBox/HBox.ts","components/DocumentList/DocumentList.tsx","components/DetailsBox/DetailsBox.tsx","components/SketchFabEmbed/SketchFabEmbed.tsx","services/pretreAPI/endpoints.ts","services/pretreAPI/Auth/AuthService.ts","helpers/draftOrder.ts","services/pretreAPI/order/OrderService.ts","services/pretreAPI/employee/EmployeeService.ts","services/pretreAPI/customerEmployee/CustomerEmployeeService.ts","services/pretreAPI/lookups/LookupsService.ts","services/pretreAPI/customer/CustomerService.ts","overmind/effects.ts","services/cms/CMS.ts","../../common/src/components/Modal/Modal.styles.tsx","../../common/src/elements/Header/Header.styles.ts","types/OfferOption.ts","../../common/src/elements/Header/Header.tsx","../../common/src/components/Modal/Modal.tsx","../../common/src/hooks/useKeyDown.ts","../../common/src/hooks/useOnClickOutside.ts","assets/img/Mellometasje.png","modals/PrecutModal/PrecutModalForm.tsx","modals/PrecutModal/PrecutPlans.tsx","modals/PrecutModal/PrecutModal.tsx","../../common/src/elements/FileInput/FileInput.styles.ts","../../common/src/elements/FileInput/FileInput.tsx","modals/FileUploadModal/FileUploadModal.tsx","pages/order/ChooseProductPage/CreateOrderPage.styles.ts","components/BreadCrumbs/BreadCrumbs.tsx","../../common/src/validators/index.ts","app/pages.ts","data/selectOptions.ts","components/FormInput/FormInput.styles.ts","pages/order/CreateOrderPage/CustomerInformation.tsx","../../common/src/components/TextArea/TextArea.styles.ts","../../common/src/components/TextArea/TextArea.tsx","helpers/GenerateId.ts","pages/order/ChooseProductPage/RoofForm.tsx","pages/order/ChooseProductPage/SubProjects.tsx","pages/order/ChooseProductPage/JointsForm.tsx","pages/order/ChooseProductPage/PrecutForm.tsx","pages/order/ChooseProductPage/TechnicalServicesForm.tsx","modals/CalculatePriceModal/CalculatePriceModal.tsx","assets/img/A-takstol med rafthøgde.png","assets/img/A-takstol standard.png","assets/img/A-takstol undergurt ut.png","assets/img/Blank.png","assets/img/Pulttakstol standard.png","assets/img/Pulttakstol undergurt ut.png","assets/img/Saksetakstol.png","assets/img/W-takstol standard.png","assets/img/W-takstol undergurt ut.png","pages/order/ChooseProductPage/Tooltip.tsx","pages/order/ChooseProductPage/CalcConditions.tsx","helpers/PriceCalculatorConfig.ts","pages/order/ChooseProductPage/CalculationPriceAndError.tsx","pages/order/ChooseProductPage/ExtendedRoofForm.tsx","pages/order/ChooseProductPage/PrecutOpening.tsx","pages/order/ChooseProductPage/ExtendedPrecutForm.tsx","pages/order/ChooseProductPage/ExtendedBeamLayerForm.tsx","pages/order/ChooseProductPage/ChooseProductPage.tsx","components/FormInput/FormInput.tsx","pages/order/ChooseProductPage/Attachments.tsx","pages/order/ChooseProductPage/Summary.tsx","pages/order/ChooseProductPage/Receipt.tsx","components/SelectionGrid/SelectionGrid.tsx","modals/SelectionGridModal/SelectionGridModal.tsx","pages/order/CreateOrderPage/ChooseProjectType.tsx","components/forms/UserForm/UserForm.tsx","components/UserList/UserList.tsx","elements/Grid/Grid.ts","pages/company/components/CompanyForm/CompanyForm.tsx","modals/EditEmployeeModal/EditEmployeeModal.tsx","../../common/src/elements/Callout/Callout.tsx","components/SalesPersonBox/SalesPersonBox.tsx","pages/Auth/Auth.tsx","pages/user/CompanySelectorPage.tsx","pages/Guest/LoginPage/LoginPage.tsx","pages/TechnicalServicesPage/TechnicalServicesPage.tsx","pages/order/OrderListPage/OrderListPage.tsx","pages/order/ViewOrderPage/ViewOrderPage.tsx","pages/order/ViewOrderProjectPage/ViewOrderProjectPage.tsx","pages/order/CreateOrderPage/CreateOrderPage.tsx","pages/user/UserPage.tsx","pages/company/CompanyPage.tsx","pages/Documentation/DocumentationPage.tsx","pages/error/ErrorPage.tsx","helpers/ExtendedPrecutHelper.ts","overmind/actions.ts","overmind/navigation/actions.ts","overmind/navigation/state.ts","overmind/auth/actions.ts","overmind/auth/state.ts","errors/FileUploadError.ts","overmind/orders/actions.ts","overmind/orders/helpers/filterOrders.ts","overmind/orders/state.ts","overmind/createModals.ts","types/Order.ts","overmind/modals/config.ts","overmind/config.ts","assets/img/pretre_logo.png","hooks/useMediaQuery.ts","app/layouts/components/MainMenu.styles.tsx","app/layouts/components/MainMenu.tsx","app/layouts/GuestLayout/GuestLayout.tsx","modals/SendMessageModal/SendMessageModal.tsx","app/layouts/MainLayout/MainLayout.tsx","app/App.tsx","helpers/axiosTokenInterceptor.ts","i18n.ts","serviceWorker.ts","components/ErrorBoundary/ErrorBoundary.tsx","index.tsx"],"names":["CreateOrderSteps","Page","UserRole","UserType","state","isInitialLoadComplete","pretreEmplyees","customerEmployees","customer","currentEmployeeId","currentEmployee","derived","find","e","id","activeCreateOrderStep","CUSTOMER_INFO","mesterIdCustomers","buildingTypes","offerOptions","technicalServices","cms","error","mesterIdLogin","PreTreColors","Link","styled","PageContainer","PageTitle","PageHeaderWrapper","PageBackLink","BackSvg","svg","LinkButton","PageHeader","BackLink","label","url","viewBox","fill","xmlns","d","href","title","children","headerItems","backLink","useAppState","createStateHook","useActions","createActionsHook","useEffects","createEffectsHook","Grid","div","Row","props","size","flex","Col","baseInputStyles","css","Input","Label","FormControl","suffix","Error","RequiredFieldAsterisk","RequiredFieldIndicator","FormInput","htmlFor","name","type","placeholder","defaultValue","inputRef","required","onChange","disabled","readonly","readOnly","ref","target","value","disabledStyle","BlockButton","secondary","row","align","LayoutConstants","SelectElement","selectWidth","Select","options","onSelectionChanged","selectedValue","noDefault","t","useTranslation","map","o","Icon","HiddenCheckbox","input","attrs","StyledCheckbox","checked","CheckboxContainer","Checkbox","style","marginLeft","OrderFilter","orders","useState","projectOptions","setProjectOptions","peopleOptions","setPeopleOptions","yearOptions","setYearOptions","statusOptions","setStatusOptions","productOptions","setProductOptions","actions","useEffect","projects","people","years","statuses","products","forEach","isProjectMaster","employee","customerEmployeeId","delivery","date","getFullYear","status","valueChainStatus","subProjects","x","product","thisYear","Date","Object","values","reverse","sort","a","b","localeCompare","orderFilter","projectId","changeOrderFilter","freeText","customerOrderNumber","parseInt","contactId","deliveryYear","projectName","display","flexDirection","justifyContent","marginTop","hideDeliveredOrders","textAlign","onClick","clearOrderFilter","useOnClickOutside","handler","listener","event","current","contains","closest","document","addEventListener","removeEventListener","Direction","ColumnPickerContainer","activeItemStyle","ColumnItem","isActive","ColumnPicker","availableColumns","selectedColumns","onColumnsChanged","onClose","useRef","fontWeight","c","includes","newColumns","filter","col","push","EmployeeMessageReferenceType","Wrapper","down","width","height","up","upDown","SortIcon","direction","TableHead","TableContainer","TableRow","notVisible","alternate","child","hasOpenHandler","TableCell","TableHeading","TableHeadingText","Table","columns","data","keyField","onRowSelected","noResultsText","onSortChanged","currentSortOption","openRows","pickColumnsOpen","setPickColumnsOpen","currentColumns","setCurrentColumns","position","idx","alignItems","alignEnd","field","ascending","descending","headerName","initial","length","padding","colSpan","rowIdx","render","undefined","subRow","i","index","plus","minus","ExpandIcon","expanded","DateFormat","formatDate","dateFormat","REGULAR","trim","parseISO","test","fnsFormat","locale","nb","formatMoney","amount","Intl","NumberFormat","minimumFractionDigits","maximumFractionDigits","currency","format","getDeliveryDateText","order","EmployeeLink","employe","referenceId","referenceType","hide","onContactPerson","employeeId","OrderList","allColumns","page","VIEW_ORDER_PROJECT","VIEW_ORDER","createUrl","orderDate","engineerId","ORDER","salesPersonId","price","sum","float","isOrderPriceCalculated","createColumns","columnsToUse","setOpenRows","setSortOption","currentOrderSortOption","selected","copy","List","Step","currentLinkStyle","Ellipsis","Pagination","renderLink","pageNumber","key","link","renderPrev","currentPage","pageCount","renderNext","renderLinks","items","CMSArticles","Pager","mode","Form","ButtonGroup","loginSchema","yup","shape","email","CMSContent","contentId","markup","content","dangerouslySetInnerHTML","__html","Heading","theme","Header","rest","ChooseProductPageButton","active","extended","Card","CardHeader","ShortcutLink","ArrowIcon","ShortcutCardLink","to","ShortcutArrowIcon","fullHeightStyle","VBox","fullHeight","Shader","BannerImage","BackgroundImage","Container","ItemContainer","VerticalCenterBox","SubText","BtnWrapper","getWindowDimensions","window","innerWidth","innerHeight","Verb","PhoneLink","number","formatted","substring","HBox","DocumentList","documents","as","openDocument","file","description","downloadDocument","DetailsBox","Legend","Text","Group","SketchFabEmbed","embedId","embedHash","className","src","frameBorder","allow","allowFullScreen","fontSize","margin","color","rel","ROOT_ENDPOINT","process","BaseService","route","body","responseType","headers","cancelToken","indexOf","verb","Promise","reject","path","params","method","replaceParameters","token","axios","catch","response","message","files","routeParams","FormData","append","paramsToReplace","match","lastMissingOptionalKey","slice","parts","split","isOptional","param","pop","prePath","hasParamToReplaceKey","hasOwnProperty","paramToReplaceKey","replace","endpoints","auth","login","POST","checkToken","GET","forgotPassword","getByUsername","project","getAllForCustomerId","getById","getByIdWithoutCustomer","getOrderFromOfferId","postCommitDraftOrder","postCommitSubprojects","getDocumentsforOrder","getDocumentforOrder","addFiles","calculateRoof","lookups","getLookups","zipcodeLookup","getConfigValue","getAll","sendMessage","customerEmployee","search","update","PUT","create","resetPassword","getForToken","AuthService","username","password","this","makeRequest","brukernavn","passord","then","r","mapDraftOrderToBackendModel","offerId","customerId","loggedInEmail","model","kundeId","tilbudNr","kundeKontaktId","customerContactId","merkes","marked","kommentar","levering","deliveryTerms","kundesBestillingsnr","bestbekr","onsketLevering","leveringsadresse","byggeplass","adresse","deliveryAddress","postnummer","zipCode","toString","lat","lng","gardsnr","farmNumber","bruksnr","subFarmNumber","hoydeOverHavet","mamsl","sammeSomByggeplass","deliveryAddressSameAsBuilding","tilkomstSemi","arrivalSemi","kontpers2","contactPersonSite","tlflevkunde","contactPersonPhoneNr","tilbudsvalg","byggtype","buildingType","quotation","additionalInfo","preferredDeliveryDate","toISOString","isValid","expectedDrawingDate","setHours","getHours","deliveryAddress2","zipCode2","OrderService","orderId","results","convertDocument","filename","convert","uploadFile","payload","navn","folder","mappe","links","lenker","l","linkType","embed","prosjektNr","ordrenr","produktType_Navn","deliveryDay","leverdag","deliveryWeek","leveruke","levaar","prosjektMaster","leveringsdato","leveringsbetingelse","ordredato","parse","statusNavn","kundepris","levAdre1","lev_Postnr","lev_Poststed","constructionContactPhone","byggeplass_Tlf","constructionContactName","byggePlass_Epost","kontaktPerson_ID","ansvarligSelgerID","customerNumber","kundenr","calculationName","constructionName","EmployeeService","createEmployeeMessage","melding","referanseId","referanseType","fixed","ansattID","ansattNavn","ansattEpost","phone","ansattMobil","isEngieer","ingenior","isSalesEngineer","ingenior_Salg","skjul","isSales","salgssjef","isAdmin","crM_Admin","photoUrl","doC_ID","CustomerEmployeeService","kontakt_Navn","kontakt_Epost","kontakt_Telefon","kontakt_Mobiltlf","mobile","kontakt_Stilling","kontakt_BlokkerPortaltilgang","kontakt_Slutta","hasQuit","nyttPassord","newPassword","kontakt_Passord_Portal","kontaktID","hasPassword","LookupsService","byggTyper","convertBuildingType","convertOfferOption","tekniskeTjenester","orderStatuses","ordreStatuser","offerStatuses","tilbudsStatuser","zipcode","poststed","configKey","beskrivelse","note","notat","typeNr","byggTypeNr","CustomerService","address","epost","epostBestillingsbekreftelse","orderConfimEmail","epostOrdrebekreftelse","orderConfrimEmailAlt","epostTegninger","drawingsEmail","kundenavn","adresse1","postnrk","city","epost_Tegninger","epost_Bestillingsbekreftelse","epost_Ordrebekreftelse","telefon","constructionInformation","std_konstr_opplysn","ansvarligSelger_ID","fetch","text","xmlDoc","DOMParser","parseFromString","nodes","evaluate","XPathResult","ANY_TYPE","blobs","result","iterateNext","childNodes","element","nodeName","textContent","api","employees","router","action","next","pathname","routePath","redirect","start","click","navigateTo","tokenService","get","localStorage","getItem","defaults","common","Authorization","set","setItem","clear","removeItem","localFileStorage","_files","toast","duration","Toastify","gravity","backgroundColor","showToast","persistentCache","remove","Backdrop","InnerContainer","OfferOptionType","Modal","callback","keysToListenTo","isOpen","scrollRef","onKeyDown","which","svills","PrecutModalForm","setPlans","plans","selectedPlan","setSelectedPlan","setFormActive","modals","dimensions","PRECUT_DIMENSION","useForm","defaultValues","register","handleSubmit","onSubmit","newPlans","bruttoVegghoyde","hoydeOverkantApning","dimensjonToppsvill","dimensjonStender","dimensjonBunnsvill","klaringTilKarm","biv1","dimToppsvill1","dimBunnsvill1","biv2","dimToppsvill2","dimBunnsvill2","biv3","dimToppsvill3","dimBunnsvill3","newPlan","precutModal","Logo","alt","alignContent","marginBottom","PrecutPlans","autoFill","borderRadius","minHeight","maxHeight","overflowY","plan","deleted","onClickPlan","textDecoration","precuts","deleteProject","PrecutModal","formActive","modalsActions","isCurrent","close","justifySelf","FileInput","multiple","FileUploadModal","setFiles","fileUploadModal","f","concat","Array","from","marginRight","ColumnWrapper","PageFlexConstraint","itemWidth","HeaderWrapper","BoldText","ButtonWrapper","StyledList","li","StyledSection","section","ChooseProductPageMainContainer","BreadCrumbs","activeStep","steps","alignSelf","step","slug","string","requiredField","dateInFuture","typeError","min","nextWeek","setDate","getDate","when","Number","isNaN","optional","PageAccess","dateTwoWeekInFutureRequired","positiveNumeric","nullable","transform","originalValue","String","positive","decimalField","parseFloat","max","requiredEmail","phoneNumber8digits","matches","yesNoOptions","InputWrapper","CustomerInformation","effects","sameAddressSelection","setSameAddressSelection","isSameAddress","useMemo","opt","customerInformationSchema","validators","currentNewOrder","city2","resolver","yupResolver","autofill","ISO_DATE","errors","watch","setValue","streetAddress","contactPersons","deliveryOptions","getCountyForZipcode","county","updateDraftOrder","CREATE_ORDER","gridTemplateColumns","paddingTop","gap","val","p","bottom","cancelCreateOrder","InputArea","TextArea","rows","cols","makeId","characters","charactersLength","charAt","Math","floor","random","RoofForm","setSubProjects","setActiveForm","selectedSubProject","setSelectedSubProject","roof","roofType","roofingType","angle","rangeDistance","protrusion","additionalCrane","workingWidth","roofTypes","ROOF","roofingTypes","ROOFING","newProjs","comment","SubProjects","joistsTypes","JOIST_TYPE","deterimineProductName","subProj","returnVal","joist","joistsType","dim","minWidth","proj","subProject","unDeleteProject","JoistsForm","joists","submergeWetRoom","millimetersImmersed","submergeWetRooms","SUBMERGE_WETROOM","precut","PrecutForm","PRECUT_INFO","technical","TechnicalServicesForm","quickChoice","onMainCancel","technicalType","CalculatePriceModal","cancelCalculation","calculatePriceModal","cursor","Tooltip","show","background","zIndex","top","left","borderWidth","borderStyle","borderColor","CalcConditions","calc","preconditions","conditions","approvedRoofTypes","configParams","minProtrusion","maxProtrusion","minAngle","maxAngle","minRangeDistance","maxRangeDistance","ww","CalculationPriceAndError","freight","priceConditions","ExtendedRoofForm","setCalc","def","img","setImg","priceDisabled","setPriceDisabled","showPriceButton","setShowPriceButton","configParam","setConfigParam","showToolTip","setShowToolTip","numberOfTrusses","roomWidth","roomHeight","getValues","watcher","uid","calculationId","specifications","roof1","roof2","roof4","roof6","roof10","roof11","roof12","roof13","approvedRoof","roofParams","trusses","range","validatePriceButton","flexWrap","onMouseEnter","onMouseLeave","open","CancelToken","source","formValues","street","projectType","CustomerId","deliveryterms","trussInfo","trussType","Quantity","SpanWidth","RoofAngle","TimberWidth","RoofSheeting","roofOverhang","calclulatePrice","cancel","numOfOpenings","PrecutOpeningRow","opening","deleteOpening","changeOpening","openings","h","w","columnGap","quantity","bearing","ExtendedPrecutForm","setOpenings","precutOpenings","op","roofs","dimensionOuter","lengthOuter","numberOfCornersOuter","dimensionInner","lengthInner","numberOfCornersInner","wallHeight","roofRef","dimensionGavl","numberOfGavl","some","addOpening","PrecutOpening","ExtendedBeamLayerForm","totalAmountImmersed","totalAmountJoists","steelBeamLength","ChooseProductPage","activeForm","setSubProjectsOnDraftOrder","onBackButtonClicked","onFormButtonClick","form","ORDER_SELECTION_HELPER","isQuote","Attachments","setComment","is","control","hasDrawings","setDraftOfferFiles","ATTACHMENT_INFO_ORDERS","ORDER_NO_DRAWINGS","Summary","requiredCheckboxItems","checkboxes","setChecboxes","submitting","setSumbitting","onConfirm","cb","commitDraftOrder","finally","deliveryText","paddingLeft","ORDER_SUMMARY_MULTIPLE","option","Receipt","orderConverted","setOrderId","commitSubProjs","clearAutofillAndDraftOrder","OFFER_SUMMARY","ORDER_SUMMARY","ORDER_LIST","paddingRight","Menu","MenuItem","MenuItemHeader","h4","MenuItemImg","isSelected","SelectionGrid","onItemClicked","elements","setElements","setSelected","renderer","SelectionGridModal","selectedItem","setSelectedItem","modalsAction","modalsState","closeModal","selectionGridModal","ChooseProjectType","setQuotationOnDraftOrder","isQuotation","setOrderConverted","validationSchema","UserForm","requiresVerifyPassword","user","EMPLOYEE","preventDefault","UserList","users","stopPropagation","changeUserActive","userId","activeState","onResetPassword","CompanyForm","changeCustomer","EditEmployeeModal","editEmployeeModal","changeCustomerEmployee","createCustomerEmployee","Callout","SalesPersonBox","CUSTOMER","Auth","schema","CompanySelectorPage","onMesterIdSelectCustomer","pages","LOGIN","component","loginWithRedirect","useAuth0","restrictedTo","GUEST","RESET_PASSWORD","maxWidth","HOME","windowDimensions","setWindowDimensions","handleResize","useWindowDimensions","isGuest","WELCOME_GUEST_1","WELCOME_LOGGED_IN_1","WELCOME_GUEST_2","WELCOME_LOGGED_IN_2","TECHNICAL_SERVICES","service","bildeURL","pris","AUTH","isFetching","currentPageItems","PageConstants","currentOrder","masterProjects","customerContact","ordersInSameProject","onNewOrderClicked","getOrderAutofill","toLowerCase","encodeURI","NOT_CALCULATED","onPrecutForm","openedFromProjectPage","promptFileUpload","currentOrderProject","customerContactPerson","projectSum","reduce","lastCompletedOrderStep","PROJECT_TYPE","CHOOSE_PRODUCT","ATTACHMENTS","SUMMARY","RECEIPT","createSteps","USER","COMPANY","companyName","onEditEmployee","DOCUMENTATION","ERROR","EMULATE","CUSTOMER_SELECTOR","getNavigationRoute","stringCheck","str","mapBiv","stender","toppsvill","bunnsvill","dimStender","dimToppsvill","dimBunnsvill","mapToBackend","backendList","backendObj","biv","JSON","stringify","sendMessageModal","emulateEmployee","emulation","emulatedType","emulateCustomer","formInfo","console","log","getDocumentsForOrder","docs","openSelectionGridModal","onSelected","updateCustomer","onInitializeOvermind","navigation","openHome","openTechnicalServices","openLogin","openForgotPassword","openOrderList","openViewOrder","openViewOrderProject","openCreateOrderStep","openUser","openCompanyPage","openDocumentationPage","emulate","openCompanySelector","routeArgs","side","currentOrderId","currentOrderProjectId","velg","velgny","kundeinfo","produktvalg","vedlegg","oppsummering","kvittering","ADMIN","dataOwner","credentials","onLoggedIn","returnUrl","decodedToken","jwt_decode","nameid","unique_name","role","mockLoginWithToken","logout","location","alert","logoutMesterId","onMesterIdLoggedIn","updateToken","getByToken","customers","getByUserName","locations","stateUser","newToken","FileUploadError","change","showOnlyMyOrdersAndProjects","getDocument","contents","fileDownload","fileX","Blob","fileURL","URL","createObjectURL","commitSubProjects","isset","numPerPage","ceil","filteredOrders","rootState","currentUserId","or","showOnlyProjects","filterOrder","sortedItems","config","merge","namespaced","keys","aggr","modal","newState","assign","resolve","stateKey","_","root","createModal","useMediaQuery","mediaQuery","matchMedia","isVerified","setIsVerified","mediaQueryList","documentChangeHandler","addListener","removeListener","Item","overlayMenu","column","isOverlay","DropdownItem","BurgerBar","BurgerButton","MainMenu","displayName","showAsActiveFor","getMenuItems","toggleMenu","isSmall","hover","setHover","stroke","strokeWidth","strokeLinecap","strokeLinejoin","x1","y1","x2","y2","right","returnTo","origin","GuestLayout","SendMessageModal","setMessage","MainLayout","App","isLoading","isAuthenticated","getAccessTokenSilently","loading","setLoading","setTimeout","interceptorId","triggerLogout","interceptors","request","use","decoded","jwtDecode","tokenExpiry","exp","currentTime","getTime","ignoreCache","axiosTokenInterceptor","eject","CurrentPage","CurrentPageComponent","i18n","initReactI18next","init","resources","translation","Login","Password","Status","Constructor","Product","Delivery","Price","Contact","Choose","Logout","Created","Marked","Loading","Phone","Documents","Description","Folder","Documentation","Done","Customers","Username","Role","Email","Search","Joist","Dimension","Roof","Roofing","Protrusion","Elements","Yes","No","Next","Comment","FreeText","TechnicalType","AddRoof","AddExtendedRoof","AddBeamlayer","AddPrecut","AddTechnical","beamlayer","keySeparator","interpolation","escapeValue","Boolean","hostname","ErrorBoundary","hasError","errorInfo","React","overmind","createOvermind","devtools","ReactDOM","StrictMode","currentVersion","version","isEnabled","domain","clientId","redirectUri","audience","getElementById","navigator","serviceWorker","ready","registration","unregister"],"mappings":"2mHACYA,E,qGAAAA,O,+BAAAA,I,iCAAAA,I,mCAAAA,I,6BAAAA,I,qBAAAA,I,sBAAAA,M,KC0BL,IC1BKC,ICAAC,EAIAC,EFsBCC,EAAe,CAC1BC,uBAAuB,EACvBC,eAAgB,GAChBC,kBAAmB,GACnBC,SAAU,KACVC,kBAAmB,KAEnBC,gBAAiBC,aAAQ,SAACP,GACxB,OAAOA,EAAMI,SACTJ,EAAMG,kBAAkBK,MAAK,SAACC,GAAD,OAAOA,EAAEC,KAAOV,EAAMK,qBACnD,QAGNM,sBAAuBf,EAAiBgB,cACxCC,kBAAmB,GACnBC,cAAe,GACfC,aAAc,GACdC,kBAAmB,GACnBC,IAAK,GACLC,MAAO,KACPC,eAAe,G,+BC9CLtB,Q,KAAAA,E,iBAAAA,I,eAAAA,I,mCAAAA,I,2BAAAA,I,2BAAAA,I,2CAAAA,I,+BAAAA,I,2CAAAA,I,yBAAAA,I,iBAAAA,I,kCAAAA,I,gBAAAA,I,sBAAAA,I,kBAAAA,I,cAAAA,I,sBAAAA,I,gBAAAA,I,mDCAAC,K,cAAAA,E,aAAAA,M,cAIAC,K,kBAAAA,E,qBAAAA,M,sICLCqB,GACH,UADGA,GAED,UAFCA,GAIL,UAJKA,GAMA,UANAA,GAOK,UCJLC,GAAOC,aAAO,IAAPA,CAAH,kGACNF,GAGEA,I,IAIaE,aAAO,IAAPA,CAAH,yPAOZF,I,MCZLG,GAAgBD,aAAO,MAAPA,CAAH,iIAQbE,GAAYF,aAAO,MAAPA,CAAH,0JACOF,IAOhBK,GAAoBH,aAAO,MAAPA,CAAH,sDAIjBI,GAAeJ,aAAO,MAAPA,CAAH,0HASZK,GAAUL,KAAOM,IAAV,2GAOPC,GAAaP,aAAOD,GAAPC,CAAH,4IASVQ,GAAaR,aAAO,KAAPA,CAAH,4KFxCA,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ACVC,cAAe,gBACfC,QAAS,QACTC,gBAAiB,sBACjBC,aAAc,eACdC,UAAW,WACXC,aAAc,uBACd5gB,KAAM,MACN6gB,UAAW,YACX5e,OAAQ,SACRG,UAAW,qBASb9Y,IAAK,KAELw3B,cAAc,EAEdC,cAAe,CACbC,aAAa,KAIJjD,GAAf,EC7HoBkD,QACW,cAA7BpgC,OAAOs2B,SAAS+J,UAEe,UAA7BrgC,OAAOs2B,SAAS+J,UAEhBrgC,OAAOs2B,SAAS+J,SAAS38B,MACvB,2DCZC,IAAM48B,GAAb,oDACE,WAAYjzC,GAAa,IAAD,+BACtB,cAAMA,IACDpD,MAAQ,CAAEs2C,UAAU,GAFH,EAD1B,sDAUE,SAAkBp1C,EAAYq1C,MAVhC,oBAYE,WACE,IAAQD,EAAa75B,KAAKzc,MAAlBs2C,SACA9zC,EAAaia,KAAKrZ,MAAlBZ,SACR,OAAI8zC,EACK,sFAEF9zC,KAlBX,uCAME,SAAgCtB,GAC9B,MAAO,CAAEo1C,UAAU,OAPvB,GAAmCE,a,UCa7BC,GAAWC,YAAepI,GAAQ,CACtCqI,SAAU,mBAOZC,IAAS9nC,OACP,eAAC,IAAM+nC,WAAP,UACE,eAAC,IAAD,CAAaC,eAAgBC,KAASC,WAJrBh/B,EAIjB,SACE,eAAC,IAAD,CAAUjT,MAAO0xC,GAAjB,SACE,eAAC,IAAD,CACEQ,OATKj/B,6BAULk/B,SATOl/B,mCAUPm/B,YAAW,UAAKphC,OAAOs2B,SAASgF,OAArB,SACX+F,SAAS,SAJX,SAOE,eAAC,GAAD,UACE,eAAC,GAAD,cAMVxsC,SAASysC,eAAe,SF2FpB,kBAAmBC,WACrBA,UAAUC,cAAcC,MACrB36B,MAAK,SAAC46B,GACLA,EAAaC,gBAEdz+B,OAAM,SAAC/X,GACNsoC,QAAQtoC,MAAMA,EAAMiY,c","file":"static/js/main.b6dc3633.chunk.js","sourcesContent":["// eslint-disable-next-line no-shadow\nexport enum CreateOrderSteps {\n PROJECT_TYPE = 0,\n CUSTOMER_INFO = 1,\n CHOOSE_PRODUCT = 2,\n ATTACHMENTS = 3,\n SUMMARY = 4,\n RECEIPT = 5,\n}\n","import { derived } from \"overmind\";\nimport { CustomerEmployee } from \"@frontend/common/src/types/CustomerEmployee\";\nimport { Customer } from \"@frontend/common/src/types/Customer\";\nimport { Employee } from \"@frontend/common/src/types/Employee\";\nimport { CMSArticle } from \"@frontend/common/src/types/CMSArticle\";\nimport { OfferOption } from \"../types/OfferOption\";\nimport { BuildingType } from \"../types/BuildingType\";\nimport { TechnicalService } from \"../types/TechnicalService\";\nimport { CreateOrderSteps } from \"../types/CreateOrderSteps\";\n\ntype State = {\n isInitialLoadComplete: boolean;\n pretreEmplyees: Employee[];\n customerEmployees: CustomerEmployee[];\n customer: Customer;\n currentEmployeeId: string;\n currentEmployee: CustomerEmployee;\n activeCreateOrderStep: CreateOrderSteps;\n mesterIdCustomers: Customer[];\n buildingTypes: BuildingType[];\n offerOptions: OfferOption[];\n technicalServices: TechnicalService[];\n mesterIdLogin: boolean;\n cms: { [index: number]: CMSArticle };\n error: { message: string };\n};\n\nexport const state: State = {\n isInitialLoadComplete: false,\n pretreEmplyees: [],\n customerEmployees: [],\n customer: null,\n currentEmployeeId: null,\n // eslint-disable-next-line no-shadow\n currentEmployee: derived((state: State) => {\n return state.customer\n ? state.customerEmployees.find((e) => e.id === state.currentEmployeeId)\n : null;\n }),\n // The active step in \"create offer\"\n activeCreateOrderStep: CreateOrderSteps.CUSTOMER_INFO,\n mesterIdCustomers: [],\n buildingTypes: [],\n offerOptions: [],\n technicalServices: [],\n cms: {},\n error: null,\n mesterIdLogin: false,\n};\n","// eslint-disable-next-line no-shadow\nexport enum Page {\n LOGIN,\n HOME,\n RESET_PASSWORD,\n\n ORDER_LIST,\n VIEW_ORDER,\n VIEW_ORDER_PROJECT,\n CREATE_ORDER,\n\n TECHNICAL_SERVICES,\n\n CUSTOMERS,\n ADMIN,\n DOCUMENTATION,\n\n USER,\n COMPANY,\n\n ERROR,\n CRM = 18,\n EMULATE,\n AUTH,\n CUSTOMER_SELECTOR,\n}\n","/* eslint-disable no-shadow */\nexport enum UserRole {\n ADMIN = \"ADMIN\",\n USER = \"USER\",\n}\nexport enum UserType {\n COMPANY = \"COMPANY\",\n EMPLOYEE = \"EMPLOYEE\",\n}\n\nexport type User = {\n id: string;\n customerId: string;\n username: string;\n role: UserRole;\n type: UserType;\n emulatedType?: UserType;\n isAdmin: boolean;\n};\n","export const PreTreColors = {\n pretre: \"#CA0000\",\n redbrown: \"#441B17\",\n grillaBrite: \"#C24E44\",\n beis: \"#430A03\",\n piemonte: \"#891F0C\",\n weakBrite: \"#FBF4F4\",\n borderlineGray: \"#D9D9D9\",\n};\n\nexport const LayoutConstants = {\n sidebarBreak: 900,\n};\n","import styled from \"styled-components\";\nimport { PreTreColors } from \"../../styles/constants\";\n\nexport const Link = styled(\"a\")`\n color: ${PreTreColors.pretre};\n cursor: pointer;\n &:hover {\n color: ${PreTreColors.beis};\n }\n`;\n\nexport const ActionLink = styled(\"a\")`\n margin: 1rem;\n background: none;\n border: none;\n width: 100%;\n text-align: center;\n font-size: 1.125rem;\n color: ${PreTreColors.beis};\n cursor: pointer;\n text-decoration: underline;\n &:hover {\n opacity: 0.8;\n }\n`;\n","import React, { FunctionComponent, ReactNode } from \"react\";\nimport styled from \"styled-components\";\nimport { Link } from \"../Link/Link\";\n\nimport { PreTreColors, LayoutConstants } from \"../../styles/constants\";\n\nconst PageContainer = styled(\"div\")`\n margin: 1rem;\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n overflow-x: auto;\n`;\n\nconst PageTitle = styled(\"div\")`\n background-color: ${PreTreColors.beis};\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n overflow: hidden;\n`;\n\nconst PageHeaderWrapper = styled(\"div\")`\n padding: 1rem 2.5rem;\n`;\n\nconst PageBackLink = styled(\"div\")`\n color: white;\n font-size: 0.1rem;\n display: flex;\n a {\n font-size: 1.5rem;\n }\n`;\n\nconst BackSvg = styled.svg`\n align-self: center;\n width: 11px;\n height: 12px;\n margin-right: 4px;\n`;\n\nconst LinkButton = styled(Link)`\n color: white;\n font-size: 0.875rem;\n text-decoration: underline;\n &:hover {\n color: #f2f2f2;\n }\n`;\n\nconst PageHeader = styled(\"h1\")`\n color: white;\n\n font-size: 2rem;\n font-weight: 700;\n\n @media only screen and (max-width: ${`${LayoutConstants.sidebarBreak}px`}) {\n font-size: 2rem;\n }\n`;\n\ntype Props = {\n title?: string;\n backLink?: { label: string; url: string };\n children?: ReactNode;\n headerItems?: ReactNode;\n};\n\ntype BackLinkProps = {\n label: string;\n url: string;\n};\n\nconst BackLink: FunctionComponent<BackLinkProps> = ({ label, url }) => {\n return (\n <PageBackLink>\n <BackSvg\n viewBox=\"0 0 11 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M10.0288 5.10421H3.40251L7.25336 1.25422L5.99914 0L0 6L5.99914 12L7.25336 10.7458L3.40251 6.89579H10.0288V5.10421Z\"\n fill=\"white\"\n />\n </BackSvg>\n <LinkButton href={url}>{label}</LinkButton>\n </PageBackLink>\n );\n};\n\nexport const Page: FunctionComponent<Props> = ({\n title,\n children,\n headerItems,\n backLink,\n}) => {\n return (\n <>\n {title ? (\n <PageTitle>\n <PageHeaderWrapper>\n {backLink ? (\n <BackLink url={backLink.url} label={backLink.label} />\n ) : null}\n <PageHeader>{title}</PageHeader>\n </PageHeaderWrapper>\n\n {headerItems}\n </PageTitle>\n ) : null}\n <PageContainer>{children}</PageContainer>\n </>\n );\n};\n","import {\n createActionsHook,\n createStateHook,\n createEffectsHook,\n} from \"overmind-react\";\nimport { IContext } from \"overmind\";\n\nimport { config } from \"./config\";\n\nexport type Context = IContext<{\n state: typeof config.state;\n actions: typeof config.actions;\n effects: typeof config.effects;\n}>;\n\nexport type RootState = typeof config.state;\n\nexport const useAppState = createStateHook<Context>();\nexport const useActions = createActionsHook<Context>();\nexport const useEffects = createEffectsHook<Context>();\n// export const useReaction = createReactionHook<Context>()\n","import styled from \"styled-components\";\n\nexport const Grid = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: start;\n`;\ntype RowProps = {\n size?: number;\n};\nexport const Row = styled(\"div\")<RowProps>`\n display: flex;\n ${(props) => (props.size ? { flex: props.size } : null)};\n @media only screen and (max-width: 850px) {\n flex-direction: column;\n }\n`;\ntype ColProps = {\n size: number;\n};\nexport const Col = styled(\"div\")<ColProps>`\n flex: ${(props) => props.size};\n margin: 1rem;\n`;\n","import { css } from \"styled-components\";\nimport { PreTreColors } from \"./constants\";\n\ntype Props = {\n error?: boolean;\n};\nexport const baseInputStyles = css<Props>`\n border: 1px solid\n ${({ error }) => (error ? `red` : PreTreColors.borderlineGray)};\n background: #f4f4f4;\n\n box-sizing: border-box;\n border-radius: 5px;\n color: ${PreTreColors.beis};\n\n font-size: 1.125rem;\n font-weight: 700;\n padding: 0.7rem;\n`;\n","import styled from \"styled-components\";\nimport { PreTreColors } from \"../../styles/constants\";\n\nimport { baseInputStyles } from \"../../styles/baseInput\";\n\ntype Props = {\n error?: boolean;\n};\nexport const Input = styled(\"input\")<Props>`\n ${baseInputStyles}\n display: inline-block;\n position: relative;\n width: 100%;\n ::placeholder {\n color: ${PreTreColors.beis};\n opacity: 0.7;\n }\n\n &:disabled {\n background: #ddd;\n border: 1px solid #b7b7b7;\n }\n`;\nexport const InputWrapper = styled(\"div\")`\n width: 100%;\n`;\nexport const Suffix = styled(\"span\")`\n width: 100%;\n justify-content: end;\n`;\n","import styled from \"styled-components\";\nimport { PreTreColors } from \"../../styles/constants\";\n\nexport const Label = styled(\"label\")`\n color: ${PreTreColors.beis};\n font-size: 1.125rem;\n margin-bottom: 0.5rem;\n`;\n","import styled, { css } from \"styled-components\";\n\ntype Props = {\n suffix?: string;\n};\n\nconst getSuffixStyle = (suffix: string) => {\n return css`\n position: relative;\n\n ::after {\n position: absolute;\n top: 50px;\n right: 1.5rem;\n transition: all 0.05s ease-in-out;\n }\n :hover::after,\n :focus-within::after {\n right: 1.5em;\n }\n\n ::after {\n content: \"${suffix}\";\n }\n `;\n};\n\nexport const FormControl = styled(\"div\")<Props>`\n display: flex;\n flex-direction: column;\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n\n ${(props: Props) => props.suffix && getSuffixStyle(props.suffix)}\n`;\n\nexport const Error = styled(\"p\")`\n color: red;\n margin-top: 0.5rem;\n &:first-letter {\n text-transform: uppercase;\n }\n`;\n","import styled from \"styled-components\";\n\nexport const RequiredFieldAsterisk = styled(\"span\")`\n color: red;\n`;\n","import React, { FunctionComponent } from \"react\";\nimport { RequiredFieldAsterisk } from \"./RequiredFieldIndicator.styles\";\n\nexport const RequiredFieldIndicator: FunctionComponent = () => {\n return <RequiredFieldAsterisk>*</RequiredFieldAsterisk>;\n};\n","import React, { FunctionComponent } from \"react\";\nimport { Input } from \"./FormInput.styles\";\nimport { Label } from \"../Label/Label\";\nimport { FormControl, Error } from \"../FormControl/FormControl\";\nimport { RequiredFieldIndicator } from \"../RequiredFieldIndicator/RequiredFieldIndicator\";\n\ntype Props = {\n htmlFor?: string;\n label?: string;\n name: string;\n type: string;\n placeholder?: string;\n defaultValue?: string;\n inputRef?: any;\n error?: any;\n required?: boolean;\n suffix?: string;\n onChange?: (value: string) => void;\n readonly?: any;\n disabled?: any;\n};\nexport const FormInput: FunctionComponent<Props> = ({\n htmlFor,\n label,\n name,\n type,\n placeholder,\n defaultValue,\n inputRef,\n error,\n required,\n suffix,\n onChange,\n disabled,\n readonly,\n}) => {\n return (\n <FormControl suffix={suffix}>\n <Label htmlFor={htmlFor}>\n {label || null}\n {required ? <RequiredFieldIndicator /> : \"\"}\n </Label>\n <Input\n readOnly={readonly}\n name={name}\n type={type}\n placeholder={placeholder}\n defaultValue={defaultValue}\n ref={inputRef}\n error={!!error}\n disabled={disabled}\n onChange={(e) => (onChange ? onChange(e.target.value) : () => {})}\n />\n\n {error ? <Error>{error}</Error> : null}\n </FormControl>\n );\n};\n","import styled, { css } from \"styled-components\";\nimport { PreTreColors } from \"../../styles/constants\";\n\ntype ButtonProps = {\n secondary?: boolean;\n disabled?: boolean;\n};\n\nexport const Label = styled(\"label\")`\n font-size: 18px;\n color: white;\n`;\n\nconst disabledStyle = css`\n background-color: ${PreTreColors.borderlineGray};\n color: white;\n cursor: not-allowed;\n\n &:hover {\n background-color: ${PreTreColors.borderlineGray};\n }\n`;\n\nexport const BlockButton = styled(\"button\")<ButtonProps>`\n background-color: ${(props: ButtonProps) =>\n props.secondary ? PreTreColors.beis : PreTreColors.pretre};\n height: auto;\n width: 100%;\n font-size: 1.5rem;\n font-weight: 700;\n color: white;\n padding: 15px 0;\n border-radius: 10px;\n border: 0;\n cursor: pointer;\n &:hover {\n background-color: ${(props: ButtonProps) =>\n props.secondary ? \"#310802\" : \"#b30000\"};\n }\n &:focus {\n outline: none;\n border: none;\n border-color: inherit;\n box-shadow: none;\n }\n\n ${(props: ButtonProps) => props.disabled && disabledStyle}\n`;\n\nexport const LinkButton = styled(\"button\")`\n margin: 1rem;\n background: none;\n border: none;\n width: 100%;\n text-align: center;\n font-size: 1.125rem;\n color: ${PreTreColors.beis};\n cursor: pointer;\n text-decoration: underline;\n &:hover {\n opacity: 0.8;\n }\n`;\n\nexport const SelectableBlockButton = styled(\"button\")<ButtonProps>`\n background-color: ${PreTreColors.weakBrite};\n height: auto;\n width: 100%;\n font-size: 1.5rem;\n font-weight: 700;\n color: ${PreTreColors.pretre};\n padding: 15px 0;\n border-radius: 10px;\n border: 1px solid ${PreTreColors.pretre};\n cursor: pointer;\n &:hover {\n background-color: ${PreTreColors.pretre};\n color: white;\n }\n\n ${(props: ButtonProps) => props.disabled && disabledStyle}\n`;\n","import styled from \"styled-components\";\n\ntype Props = {\n row?: boolean;\n align?: boolean;\n};\nexport const FormControl = styled(\"div\")<Props>`\n display: flex;\n flex-direction: ${(props: Props) => (props.row ? \"row\" : \"column\")};\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n align-items: ${(props: Props) => (props.align ? \"center\" : \"\")};\n`;\n\nexport const Error = styled(\"p\")`\n color: red;\n margin-top: 0.5rem;\n &:first-letter {\n text-transform: uppercase;\n }\n`;\n","export const PreTreColors = {\n pretre: \"#CA0000\",\n redbrown: \"#441B17\",\n grillaBrite: \"#C24E44\",\n beis: \"#430A03\",\n piemonte: \"#891F0C\",\n weakBrite: \"#FBF4F4\",\n borderlineGray: \"#D9D9D9\",\n};\n\nexport const LayoutConstants = {\n sidebarBreak: 900,\n};\n","import { css } from \"styled-components\";\nimport { PreTreColors } from \"./constants\";\n\ntype Props = {\n error?: boolean;\n};\nexport const baseInputStyles = css<Props>`\n border: 1px solid\n ${({ error }) => (error ? `red` : PreTreColors.borderlineGray)};\n background: #f4f4f4;\n\n box-sizing: border-box;\n border-radius: 5px;\n color: ${PreTreColors.beis};\n\n font-size: 1.125rem;\n font-weight: 700;\n padding: 0.7rem;\n`;\n","import styled from \"styled-components\";\nimport { baseInputStyles } from \"../../styles/baseInput\";\n\ntype Props = {\n error?: boolean;\n selectWidth?: string;\n readonly?: boolean;\n};\n\nexport const SelectElement = styled(\"select\")<Props>`\n ${baseInputStyles}\n font-size: 1rem;\n padding: 0.7rem;\n width: ${({ selectWidth }) => selectWidth || \"100%\"};\n appearance: none;\n font-weight: 700;\n background: #f4f4f4\n url(\"data:image/svg+xml;utf8,<svg width='14' height='19' viewBox='0 0 14 19' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M8.04526 0L8.04526 16.193L5.95613 16.193L5.95613 -9.13186e-08L8.04526 0Z' fill='%23CA0000'/><path d='M-6.39614e-08 11.7015L1.46327 10.2383L7 15.776L12.5367 10.2383L14 11.7015L6.99997 18.7006L-6.39614e-08 11.7015Z' fill='%23CA0000'/></svg>\")\n no-repeat;\n background-position: right 5px top 50%;\n pointer-events: ${(props: Props) => (props.readonly ? \"none\" : \"\")};\n\n &:disabled {\n background: #ddd;\n border: 1px solid #b7b7b7;\n }\n`;\n","import styled from \"styled-components\";\n\nexport const RequiredFieldAsterisk = styled(\"span\")`\n color: red;\n`;\n","import React, { FunctionComponent } from \"react\";\nimport { RequiredFieldAsterisk } from \"./RequiredFieldIndicator.styles\";\n\nexport const RequiredFieldIndicator: FunctionComponent = () => {\n return <RequiredFieldAsterisk>*</RequiredFieldAsterisk>;\n};\n","import React, { FunctionComponent } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { Label } from \"@frontend/common/src/elements/Label/Label\";\nimport { FormControl, Error } from \"../../elements/FormControl/FormControl\";\nimport { SelectElement } from \"./Select.styles\";\n\nimport { RequiredFieldIndicator } from \"../../elements/RequiredFieldIndicator/RequiredFieldIndicator\";\n\ntype SelectOption = {\n label: string;\n value: any;\n};\n\ntype Props = {\n name?: string;\n label?: string;\n options: SelectOption[];\n error?: string;\n inputRef?: any;\n selectedValue?: string | number;\n required?: boolean;\n disabled?: boolean;\n // eslint-disable-next-line no-unused-vars\n onSelectionChanged?: (value: any) => void;\n row?: boolean;\n selectWidth?: string;\n align?: boolean;\n readonly?: boolean;\n noDefault?: boolean;\n};\n\nexport const Select: FunctionComponent<Props> = ({\n name,\n label,\n options,\n onSelectionChanged,\n error,\n inputRef,\n selectedValue,\n required,\n disabled,\n row,\n selectWidth,\n align,\n readonly,\n noDefault = false,\n}) => {\n const { t } = useTranslation();\n return (\n <FormControl align={align} row={row}>\n {label ? (\n <Label>\n {label}\n {required ? <RequiredFieldIndicator /> : \"\"}\n </Label>\n ) : null}\n <SelectElement\n readonly={readonly}\n selectWidth={selectWidth}\n name={name}\n ref={inputRef}\n value={selectedValue}\n disabled={disabled}\n onChange={(e) => {\n if (!onSelectionChanged) {\n return;\n }\n if (!e.target.value) {\n onSelectionChanged(null);\n } else {\n onSelectionChanged(e.target.value);\n }\n }}\n error={!!error}\n >\n {!noDefault ? <option value={null} label={t(\"Choose\")} /> : null}\n\n {options.map((o) => (\n <option key={o.value} label={o.label} value={o.value} />\n ))}\n </SelectElement>\n {error ? <Error>{error}</Error> : null}\n </FormControl>\n );\n};\n","import styled from \"styled-components\";\nimport { Label } from \"@frontend/common/src/elements/Label/Label\";\nimport { baseInputStyles } from \"../../styles/baseInput\";\n\nexport const Icon = styled.svg``;\n\n// Hide checkbox visually but remain accessible to screen readers.\n// Source: https://polished.js.org/docs/#hidevisually\nexport const HiddenCheckbox = styled.input.attrs({ type: \"checkbox\" })`\n border: 0;\n clip: rect(0 0 0 0);\n clippath: inset(50%);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n`;\n\ntype StyledCheckboxProps = {\n checked: boolean;\n error?: boolean;\n};\n\nexport const StyledCheckbox = styled(\"div\")<StyledCheckboxProps>`\n ${baseInputStyles}\n cursor:pointer;\n display: inline-block;\n width: 2rem;\n height: 2rem;\n padding: 0.35rem;\n transition: all 150ms;\n\n ${HiddenCheckbox}:focus + & {\n box-shadow: 0 0 0 3px pink;\n }\n\n ${Icon} {\n visibility: ${(props: any) => (props.checked ? \"visible\" : \"hidden\")};\n }\n`;\n\nexport const CheckboxContainer = styled.div`\n display: inline-block;\n vertical-align: middle;\n\n ${Label} {\n margin-left: 1.5rem;\n display: flex;\n align-items: center;\n\n ${StyledCheckbox} {\n margin-right: 0.5rem;\n }\n }\n`;\n","import React, { FunctionComponent } from \"react\";\nimport { Label } from \"@frontend/common/src/elements/Label/Label\";\nimport { FormControl, Error } from \"../../elements/FormControl/FormControl\";\nimport {\n CheckboxContainer,\n HiddenCheckbox,\n StyledCheckbox,\n Icon,\n} from \"./Checkbox.styles\";\n\ntype Props = {\n checked?: boolean;\n name?: string;\n label?: string;\n error?: string;\n required?: any;\n inputRef?: any;\n value?: any;\n // eslint-disable-next-line no-unused-vars\n onChange?: (e: any) => void;\n};\n// https://codesandbox.io/s/building-a-checkbox-component-with-react-and-styled-components-forked-fc4rc?file=/src/index.js:200-257\nexport const Checkbox: FunctionComponent<Props> = ({\n checked,\n label,\n error,\n inputRef,\n ...props\n}) => {\n return (\n <FormControl>\n <CheckboxContainer>\n <Label style={{ marginLeft: \"0rem\" }}>\n <HiddenCheckbox checked={checked} {...props} ref={inputRef} />\n <StyledCheckbox checked={checked} error={!!error}>\n <Icon viewBox=\"0 0 24 18\">\n <path\n d=\"M0 9.91357L2.60829 6.52202L9.39163 12.2615L20.3488 0L23.4791 2.86985L9.65201 18L0 9.91357Z\"\n fill=\"#CA0000\"\n />\n </Icon>\n </StyledCheckbox>\n {label || null}\n </Label>\n {error ? <Error>{error}</Error> : null}\n </CheckboxContainer>\n </FormControl>\n );\n};\n","import React, { FunctionComponent, useEffect, useState } from \"react\";\nimport { Col, Grid, Row } from \"@frontend/common/src/elements/Grid/Grid\";\nimport { FormInput } from \"@frontend/common/src/elements/FormInput/FormInput\";\nimport { useTranslation } from \"react-i18next\";\nimport { LinkButton } from \"@frontend/common/src/elements/Buttons/Buttons.styles\";\nimport { Select } from \"../../../../../components/Select/Select\";\nimport { Checkbox } from \"../../../../../components/Checkbox/Checkbox\";\nimport { Order } from \"../../../../../types/Order\";\nimport { useActions, useAppState } from \"../../../../../overmind\";\n\ntype Props = {\n orders: Order[];\n};\n\nexport const OrderFilter: FunctionComponent<Props> = ({ orders }) => {\n const { t } = useTranslation();\n const [projectOptions, setProjectOptions] = useState([]);\n const [peopleOptions, setPeopleOptions] = useState([]);\n const [yearOptions, setYearOptions] = useState([]);\n const [statusOptions, setStatusOptions] = useState([]);\n const [productOptions, setProductOptions] = useState([]);\n\n const actions = useActions();\n\n const state = useAppState();\n\n useEffect(() => {\n const projects: {\n [index: string]: { label: string; value: string };\n } = {};\n const people: { [index: string]: { label: string | number; value: any } } =\n {};\n const years: { [index: number]: { label: string | number; value: any } } =\n {};\n const statuses: {\n [index: number]: { label: string | number; value: any };\n } = {};\n const products: {\n [index: string]: { label: string; value: any };\n } = {};\n orders.forEach((o) => {\n if (o.isProjectMaster) {\n projects[o.id] = {\n label: o.id,\n value: o.id,\n };\n }\n\n const employee = state.customerEmployees.find(\n (e) => e.id === o.customerEmployeeId\n );\n\n if (employee) {\n people[employee.id as any] = {\n label: `${employee.name} `,\n value: employee.id,\n };\n }\n\n if (o.delivery) {\n const date = o.delivery;\n years[date.getFullYear()] = {\n label:\n date.getFullYear() === 1900\n ? \"Ukjent leveringsdato\"\n : date.getFullYear(),\n value: date.getFullYear(),\n };\n }\n\n if (!statuses[o.status]) {\n statuses[o.status] = {\n label: o.status,\n value: o.valueChainStatus,\n };\n }\n o.subProjects.forEach((x) => {\n if (!products[x.product] && x.product !== \"\") {\n products[x.product] = {\n label: x.product,\n value: x.product,\n };\n }\n });\n });\n\n const thisYear = new Date().getFullYear();\n years[thisYear] = {\n label: thisYear,\n value: thisYear,\n };\n\n setProjectOptions(Object.values(projects).reverse());\n setPeopleOptions(\n Object.values(people).sort((a, b) =>\n `${a.label}`.localeCompare(`${b.label}`)\n )\n );\n setYearOptions(Object.values(years).reverse());\n setStatusOptions(Object.values(statuses).sort((a, b) => a.value - b.value));\n setProductOptions(Object.values(products));\n }, [orders, state.customerEmployees, state.pretreEmplyees]);\n\n return (\n <Grid>\n <Row>\n <Col size={1}>\n <Select\n label={t(\"Project no.\")}\n options={projectOptions}\n selectedValue={state.orders.orderFilter.projectId || \"\"}\n onSelectionChanged={(value) =>\n actions.orders.changeOrderFilter({\n projectId: value || null,\n })\n }\n />\n <FormInput\n label={t(\"FreeText\")}\n type=\"text\"\n name=\"freeText\"\n defaultValue={`${state.orders.orderFilter.freeText || \"\"}`}\n onChange={(value) =>\n actions.orders.changeOrderFilter({\n freeText: value || null,\n })\n }\n />\n <FormInput\n label={t(\"Customer Order no.\")}\n type=\"text\"\n name=\"customerOrderNumber\"\n defaultValue={`${\n state.orders.orderFilter.customerOrderNumber || \"\"\n }`}\n onChange={(value) =>\n actions.orders.changeOrderFilter({\n customerOrderNumber: value || null,\n })\n }\n />\n <Select\n label={t(\"Status\")}\n options={statusOptions}\n selectedValue={state.orders.orderFilter.status || \"\"}\n onSelectionChanged={(value) =>\n actions.orders.changeOrderFilter({\n status: parseInt(value, 10) || null,\n })\n }\n />\n </Col>\n <Col size={1}>\n <Select\n label={t(\"Contact\")}\n options={peopleOptions}\n selectedValue={state.orders.orderFilter.contactId || \"\"}\n onSelectionChanged={(value) =>\n actions.orders.changeOrderFilter({\n contactId: value || null,\n })\n }\n />\n <Select\n label={t(\"Product Group\")}\n options={productOptions}\n selectedValue={state.orders.orderFilter.product || \"\"}\n onSelectionChanged={(value) =>\n actions.orders.changeOrderFilter({\n product: value,\n })\n }\n />\n <Select\n label={t(\"Delivery year\")}\n options={yearOptions}\n selectedValue={state.orders.orderFilter.deliveryYear || \"\"}\n onSelectionChanged={(value) =>\n actions.orders.changeOrderFilter({\n deliveryYear: parseInt(value, 10) || null,\n })\n }\n />\n <FormInput\n label=\"Prosjektnavn\"\n type=\"text\"\n name=\"marked\"\n defaultValue={`${state.orders.orderFilter.projectName || \"\"}`}\n onChange={(value) =>\n actions.orders.changeOrderFilter({ projectName: value })\n }\n />\n </Col>\n <Col\n size={1}\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"space-between\",\n marginTop: \"3.1rem\",\n }}\n >\n <Checkbox\n checked={state.orders.orderFilter.hideDeliveredOrders || false}\n label={t(\"Hide delivered orders\")}\n onChange={(e) =>\n actions.orders.changeOrderFilter({\n hideDeliveredOrders: e.target.checked,\n })\n }\n />\n <LinkButton\n style={{ textAlign: \"left\" }}\n onClick={() => actions.orders.clearOrderFilter()}\n >\n Tøm filter\n </LinkButton>\n </Col>\n </Row>\n </Grid>\n );\n};\n","import { useEffect } from \"react\";\n\n// https://usehooks.com/useOnClickOutside/\nexport function useOnClickOutside(ref: any, handler: any) {\n useEffect(\n () => {\n const listener = (event: any) => {\n // Do nothing if clicking ref's element or descendent elements. Also checks for Material UI menu.\n if (\n !ref.current ||\n ref.current.contains(event.target) ||\n event.target.closest(\".MuiDialog-root\") !== null ||\n event.target.closest(\".MuiPopover-root\") !== null\n ) {\n return;\n }\n\n handler(event);\n };\n\n document.addEventListener(\"mousedown\", listener);\n document.addEventListener(\"touchstart\", listener);\n\n return () => {\n document.removeEventListener(\"mousedown\", listener);\n document.removeEventListener(\"touchstart\", listener);\n };\n }, // ... but to optimize you can wrap handler in useCallback before ... // ... callback/cleanup to run every render. It's not a big deal ... // ... function on every render that will cause this effect ... // It's worth noting that because passed in handler is a new ... // Add ref and handler to effect dependencies\n // ... passing it into this hook.\n [ref, handler]\n );\n}\n","import React, { FunctionComponent, useRef } from \"react\";\nimport styled, { css } from \"styled-components\";\nimport { useOnClickOutside } from \"webapp/src/hooks/useOnClickOutside\";\n\nexport const ColumnPickerContainer = styled(\"div\")`\n position: absolute;\n top: 0;\n left: 0;\n padding: 1rem;\n background: #f4f4f4;\n display: flex;\n flex-direction: column;\n`;\n\nconst activeItemStyle = css`\n font-weight: bold;\n`;\n\ntype ItemProps = {\n isActive?: boolean;\n};\n\nexport const ColumnItem = styled(\"span\")<ItemProps>`\n cursor: pointer;\n ${(props: ItemProps) => props.isActive && activeItemStyle}\n`;\ntype Props = {\n availableColumns: string[];\n selectedColumns: string[];\n onColumnsChanged: (columns: string[]) => void;\n onClose: () => void;\n};\n\nexport const ColumnPicker: FunctionComponent<Props> = ({\n availableColumns,\n selectedColumns,\n onColumnsChanged,\n onClose,\n}) => {\n const ref = useRef();\n useOnClickOutside(ref, () => {\n onClose();\n });\n return (\n <ColumnPickerContainer>\n <span style={{ fontWeight: \"bold\" }}>Velg kolonner:</span>\n {availableColumns.map((c) => {\n return (\n <ColumnItem\n isActive={!!selectedColumns.includes(c)}\n onClick={() => {\n let newColumns: string[] = [...selectedColumns];\n if (newColumns.includes(c)) {\n newColumns = newColumns.filter((col) => c !== col);\n } else {\n newColumns.push(c);\n }\n\n onColumnsChanged(newColumns);\n }}\n >\n {c}\n </ColumnItem>\n );\n })}\n </ColumnPickerContainer>\n );\n};\n","// eslint-disable-next-line no-shadow\nexport enum Direction {\n ascending = \"ascending\",\n descending = \"descending\",\n initial = \"initial\",\n}\n","import React, { FunctionComponent } from \"react\";\nimport styled from \"styled-components\";\nimport { Direction } from \"../../Direction\";\n\nexport const Wrapper = styled.svg`\n vertical-align: middle;\n margin-left: 1rem;\n display: inline-block;\n`;\n\nconst down = (\n <svg\n width=\"9\"\n height=\"16\"\n viewBox=\"0 0 9 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M0.956859 12.2062C1.88121 13.2401 2.80212 14.2706 3.72654 15.3046C3.85834 15.4535 3.98928 15.5981 4.1211 15.747C4.42322 16.0843 5.05912 16.0843 5.36126 15.747C6.28561 14.7131 7.20652 13.6827 8.13094 12.6487C8.26274 12.4998 8.39369 12.3552 8.5255 12.2062C8.83189 11.8647 8.88925 11.299 8.5255 10.9661C8.19257 10.6597 7.61399 10.6023 7.28533 10.9661C6.36098 12 5.44007 13.0304 4.51566 14.0644C4.38385 14.2133 4.25291 14.358 4.1211 14.5069H5.36126C4.43691 13.473 3.516 12.4425 2.59158 11.4085C2.45978 11.2596 2.32884 11.115 2.19702 10.9661C1.89063 10.6246 1.26327 10.6288 0.956859 10.9661C0.623932 11.3298 0.632477 11.8374 0.956859 12.2062Z\"\n fill=\"#CA0000\"\n />\n <path\n d=\"M5.61958 14.9578V10.2992V2.88476V1.19784C5.61958 0.737376 5.21648 0.29917 4.74317 0.321431C4.26987 0.343683 3.86676 0.707424 3.86676 1.19784V5.8564V13.2708V14.9578C3.86676 15.4182 4.26987 15.8564 4.74317 15.8342C5.21648 15.8119 5.61958 15.4482 5.61958 14.9578Z\"\n fill=\"#CA0000\"\n />\n </svg>\n);\n\nconst up = (\n <svg\n width=\"9\"\n height=\"16\"\n viewBox=\"0 0 9 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M1.49193 5.03389C2.41628 3.99999 3.33719 2.96953 4.26161 1.93556C4.39341 1.78664 4.52435 1.64201 4.65617 1.49308H3.416C4.34035 2.52698 5.26126 3.55744 6.18568 4.59141C6.31748 4.74033 6.44843 4.88497 6.58024 5.03389C6.88663 5.37538 7.51399 5.37111 7.8204 5.03389C8.15763 4.66586 8.14906 4.16175 7.8204 3.79373C6.89605 2.75982 5.97514 1.72936 5.05073 0.695394C4.91892 0.546472 4.78798 0.40184 4.65617 0.252916C4.35405 -0.0843053 3.71814 -0.0843053 3.416 0.252916C2.49165 1.28682 1.57074 2.31728 0.646324 3.35125C0.51452 3.50017 0.383576 3.6448 0.251764 3.79373C-0.0546293 4.13522 -0.11199 4.70094 0.251764 5.03389C0.589839 5.34114 1.1684 5.40192 1.49193 5.03389Z\"\n fill=\"#CA0000\"\n />\n <path\n d=\"M3.16174 1.04232V5.70089V13.1153V14.8022C3.16174 15.2627 3.56485 15.7009 4.03815 15.6786C4.51146 15.6564 4.91457 15.2927 4.91457 14.8022V10.1437V2.72924V1.04232C4.91457 0.581858 4.51146 0.143653 4.03815 0.165914C3.56485 0.188166 3.16174 0.551907 3.16174 1.04232Z\"\n fill=\"#CA0000\"\n />\n </svg>\n);\nconst upDown = (\n <svg\n width=\"15\"\n height=\"18\"\n viewBox=\"0 0 15 18\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M1.49193 5.03389C2.41628 3.99999 3.33719 2.96953 4.26161 1.93556C4.39341 1.78664 4.52435 1.64201 4.65617 1.49308H3.416C4.34035 2.52698 5.26126 3.55744 6.18568 4.59141C6.31748 4.74033 6.44843 4.88497 6.58024 5.03389C6.88663 5.37538 7.51399 5.37111 7.8204 5.03389C8.15763 4.66586 8.14906 4.16175 7.8204 3.79373C6.89605 2.75982 5.97514 1.72936 5.05073 0.695394C4.91892 0.546472 4.78798 0.40184 4.65617 0.252916C4.35405 -0.0843053 3.71814 -0.0843053 3.416 0.252916C2.49165 1.28682 1.57074 2.31728 0.646324 3.35125C0.51452 3.50017 0.383576 3.6448 0.251764 3.79373C-0.0546293 4.13522 -0.11199 4.70094 0.251764 5.03389C0.589839 5.34114 1.1684 5.40192 1.49193 5.03389Z\"\n fill=\"#CA0000\"\n />\n <path\n d=\"M3.16174 1.04232V5.70089V13.1153V14.8022C3.16174 15.2627 3.56485 15.7009 4.03815 15.6786C4.51146 15.6564 4.91457 15.2927 4.91457 14.8022V10.1437V2.72924V1.04232C4.91457 0.581858 4.51146 0.143653 4.03815 0.165914C3.56485 0.188166 3.16174 0.551907 3.16174 1.04232Z\"\n fill=\"#CA0000\"\n />\n <path\n d=\"M6.95686 14.2062C7.88121 15.2401 8.80212 16.2706 9.72654 17.3046C9.85834 17.4535 9.98928 17.5981 10.1211 17.747C10.4232 18.0843 11.0591 18.0843 11.3613 17.747C12.2856 16.7131 13.2065 15.6827 14.1309 14.6487C14.2627 14.4998 14.3937 14.3552 14.5255 14.2062C14.8319 13.8647 14.8893 13.299 14.5255 12.9661C14.1926 12.6597 13.614 12.6023 13.2853 12.9661C12.361 14 11.4401 15.0304 10.5157 16.0644C10.3839 16.2133 10.2529 16.358 10.1211 16.5069H11.3613C10.4369 15.473 9.516 14.4425 8.59158 13.4085C8.45978 13.2596 8.32884 13.115 8.19702 12.9661C7.89063 12.6246 7.26327 12.6288 6.95686 12.9661C6.62393 13.3298 6.63248 13.8374 6.95686 14.2062Z\"\n fill=\"#CA0000\"\n />\n <path\n d=\"M11.6196 16.9578V12.2992V4.88476V3.19784C11.6196 2.73738 11.2165 2.29917 10.7432 2.32143C10.2699 2.34368 9.86676 2.70742 9.86676 3.19784V7.8564V15.2708V16.9578C9.86676 17.4182 10.2699 17.8564 10.7432 17.8342C11.2165 17.8119 11.6196 17.4482 11.6196 16.9578Z\"\n fill=\"#CA0000\"\n />\n </svg>\n);\n\ntype Props = {\n direction: Direction;\n};\nexport const SortIcon: FunctionComponent<Props> = ({ direction }) => {\n return (\n <Wrapper\n width=\"15\"\n height=\"18\"\n viewBox=\"0 0 15 18\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n {direction === \"ascending\" ? down : null}\n {direction === \"descending\" ? up : null}\n {direction === \"initial\" ? upDown : null}\n </Wrapper>\n );\n};\n","// eslint-disable-next-line no-shadow\nexport enum EmployeeMessageReferenceType {\n \"ORDER\" = 3,\n \"ORDER_PROJECT\" = 4,\n \"CUSTOMER\" = 5,\n}\nexport type CreateEmployeeMessage = {\n employeeId: string;\n referenceId: string;\n referenceType: EmployeeMessageReferenceType;\n message?: string;\n loggedInEmail?: string;\n};\n","import styled from \"styled-components\";\n\nimport { PreTreColors } from \"../../styles/constants\";\n\nexport const TableHead = styled(\"thead\")`\n background-color: ${PreTreColors.weakBrite};\n text-align: left;\n`;\n\nexport const TableContainer = styled(\"table\")`\n border-collapse: collapse;\n width: 100%;\n overflow-x: auto;\n`;\n\ntype TableRowProps = {\n alternate?: any;\n hasOpenHandler?: any;\n notVisible?: boolean;\n child?: boolean;\n};\n\ntype TableCellProps = {\n child?: boolean;\n};\n\nexport const TableRow = styled(\"tr\")<TableRowProps>`\n display: ${(props: TableRowProps) =>\n props.notVisible ? \"none\" : \"table-row\"};\n background-color: ${(props: TableRowProps) =>\n props.alternate === true\n ? \"#F4F4F5\"\n : props.child === true\n ? \"#eaeaec\"\n : \"\"};\n cursor: ${(props: TableRowProps) =>\n props.hasOpenHandler === true ? \"pointer\" : \"arrow\"};\n`;\n\nexport const TableCell = styled(\"td\")<TableCellProps>`\n padding: 0.5rem 0.5rem 0.5rem\n ${(props: TableCellProps) => (props.child ? \"4rem\" : \"0.5rem\")};\n`;\n\nexport const TableHeading = styled(\"td\")`\n padding: 0.5rem;\n font-weight: bold;\n cursor: pointer;\n`;\nexport const TableHeadingText = styled(\"span\")`\n vertical-align: middle;\n`;\n","/* eslint-disable no-shadow */\nimport React, { useState } from \"react\";\nimport { ColumnPicker } from \"./components/ColumPicker/ColumnPicker\";\nimport { Direction } from \"./Direction\";\nimport { SortIcon } from \"./elements/SortIcon/SortIcon\";\n\nimport {\n TableHead,\n TableContainer,\n TableRow,\n TableCell,\n TableHeading,\n TableHeadingText,\n} from \"./Table.styles\";\n\nexport type Column<T> = {\n headerName: string;\n field?: keyof T;\n alignEnd?: boolean;\n render?: (row: T, openRows?: string[]) => any;\n};\n\ntype Props<T> = {\n columns: Column<T>[];\n availableColumns: Column<T>[];\n data: T[];\n keyField: any;\n onRowSelected?: (row: T) => void;\n noResultsText?: string;\n onSortChanged?: (field: keyof T, direction: Direction) => void;\n currentSortOption?: { field: keyof T; direction: Direction };\n openRows?: string[];\n};\n\nexport const Table = <T extends { [index: string]: any }>({\n columns,\n data,\n keyField,\n onRowSelected,\n availableColumns,\n noResultsText,\n onSortChanged,\n currentSortOption,\n openRows,\n}: Props<T>) => {\n const [pickColumnsOpen, setPickColumnsOpen] = useState(false);\n const [currentColumns, setCurrentColumns] = useState(columns);\n return (\n <div style={{ position: \"relative\" }}>\n {/* <button onClick={() => setPickColumnsOpen(!pickColumnsOpen)}>Velg kolonner</button> */}\n <TableContainer>\n <TableHead>\n <TableRow>\n {columns.map((c, idx) => {\n const style: any = { display: \"flex\", alignItems: \"center\" };\n if (c.alignEnd) {\n style.justifyContent = \"flex-end\";\n }\n if (c.field) {\n return (\n <TableHeading\n onClick={() => {\n if (onSortChanged) {\n onSortChanged(\n c.field,\n currentSortOption\n ? currentSortOption.direction ===\n Direction.ascending\n ? Direction.descending\n : Direction.ascending\n : Direction.descending\n );\n }\n }}\n key={idx}\n >\n <div style={style}>\n <TableHeadingText>{c.headerName}</TableHeadingText>\n {onSortChanged ? (\n <SortIcon\n direction={\n currentSortOption &&\n c.field === currentSortOption.field\n ? currentSortOption.direction\n : Direction.initial\n }\n />\n ) : null}\n </div>\n </TableHeading>\n );\n }\n\n return (\n <TableHeading key={idx}>\n <TableHeadingText>{c.headerName}</TableHeadingText>\n </TableHeading>\n );\n })}\n </TableRow>\n </TableHead>\n <tbody>\n {!data.length && (\n <tr>\n <td\n style={{ textAlign: \"center\", padding: \"2rem\" }}\n colSpan={currentColumns.length}\n >\n {noResultsText}\n </td>\n </tr>\n )}\n {data.map((row, rowIdx) => (\n <>\n <TableRow\n key={row[keyField]}\n hasOpenHandler={!!onRowSelected}\n alternate={rowIdx % 2 === 0}\n onClick={() => {\n if (onRowSelected) {\n onRowSelected(row);\n }\n }}\n >\n {columns.map((c, idx) => {\n if (c.render) {\n return (\n <TableCell key={idx}>{c.render(row, openRows)}</TableCell>\n );\n }\n return <TableCell key={idx}>{row[c.field]}</TableCell>;\n })}\n </TableRow>\n {row.subProjects !== undefined &&\n row.subProjects.map((subRow: any, i: number) => {\n return (\n <TableRow\n child\n notVisible={!openRows.includes(`${row[keyField]}`)}\n key={subRow[keyField]}\n alternate={(i + 1) % 2 === 0}\n >\n {columns.map((col, index) => {\n if (col.render) {\n return (\n <TableCell child={index === 0} key={index}>\n {col.render(subRow)}\n </TableCell>\n );\n }\n return (\n <TableCell key={index}>{subRow[col.field]}</TableCell>\n );\n })}\n </TableRow>\n );\n })}\n </>\n ))}\n </tbody>\n </TableContainer>\n {pickColumnsOpen ? (\n <ColumnPicker\n onClose={() => setPickColumnsOpen(false)}\n onColumnsChanged={(currentColumns: string[]) => {\n setCurrentColumns(\n availableColumns.filter((a) =>\n currentColumns.includes(a.headerName)\n )\n );\n }}\n availableColumns={availableColumns.map((c) => c.headerName)}\n selectedColumns={currentColumns.map((c) => c.headerName)}\n />\n ) : null}\n </div>\n );\n};\n","import React, { FunctionComponent } from \"react\";\nimport { Wrapper } from \"../../components/Table/elements/SortIcon/SortIcon\";\n\nconst plus = (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path fill=\"#CA0000\" d=\"M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z\" />\n </svg>\n);\nconst minus = (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path fill=\"#CA0000\" d=\"M19,13H5V11H19V13Z\" />\n </svg>\n);\n\ntype Props = {\n expanded: boolean;\n};\nexport const ExpandIcon: FunctionComponent<Props> = ({ expanded }) => {\n return (\n <Wrapper\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n {expanded ? minus : plus}\n </Wrapper>\n );\n};\n","/* eslint-disable import/no-duplicates */\nimport { format as fnsFormat, parseISO, parse } from \"date-fns\";\nimport { nb } from \"date-fns/locale\";\n\n// eslint-disable-next-line no-shadow\nexport enum DateFormat {\n // eslint-disable-next-line no-unused-vars\n LONG = \"d. LLL yyyy\",\n // eslint-disable-next-line no-unused-vars\n ISO_DATE = \"yyyy-MM-dd\",\n REGULAR = \"dd.MM.yyyy\",\n INPUT = \"yyyy-mm-dd\",\n}\n\nexport function string2date(date: string): Date {\n return parseISO(date);\n}\n\nexport function parsePretre(date: string): string {\n if (!date || !date.trim().length) {\n return null;\n }\n return parse(date, \"MM/dd/yyyy HH:mm:ss\", new Date()).toISOString();\n}\n\nexport function formatDate(\n date: string | Date,\n dateFormat = DateFormat.REGULAR\n) {\n let d = date;\n if (!d || (typeof d === \"string\" && !d.trim().length)) {\n return null;\n }\n\n if (typeof date === \"string\") {\n d = parseISO(date);\n }\n const test = fnsFormat(d as Date, dateFormat, { locale: nb });\n return test;\n}\n","import styled from \"styled-components\";\nimport { PreTreColors } from \"../../styles/constants\";\n\nexport const Link = styled(\"a\")`\n color: ${PreTreColors.pretre};\n cursor: pointer;\n &:hover {\n color: ${PreTreColors.beis};\n }\n`;\n\nexport const ActionLink = styled(\"a\")`\n margin: 1rem;\n background: none;\n border: none;\n width: 100%;\n text-align: center;\n font-size: 1.125rem;\n color: ${PreTreColors.beis};\n cursor: pointer;\n text-decoration: underline;\n &:hover {\n opacity: 0.8;\n }\n`;\n","export function formatMoney(amount: number): string {\n return new Intl.NumberFormat(\"no-NB\", {\n minimumFractionDigits: 0,\n maximumFractionDigits: 0,\n style: \"currency\",\n currency: \"NOK\",\n }).format(amount);\n}\n","import { formatDate } from \"@frontend/common/src/helpers/date\";\nimport { Order } from \"../types/Order\";\n\nexport const getDeliveryDateText = (order: Order) => {\n if (order.delivery.getFullYear() < 2000) {\n return \"Ukjent leveringsdato\";\n }\n return formatDate(order.delivery);\n};\n","import React, { FunctionComponent } from \"react\";\n\nimport { EmployeeMessageReferenceType } from \"@frontend/common/src/types/EmployeeMessage\";\nimport { Employee } from \"@frontend/common/src/types/Employee\";\nimport { Link } from \"@frontend/common/src/elements/Link/Link\";\nimport { useActions } from \"../../overmind\";\n\ntype Props = {\n employee: Employee;\n referenceId: string;\n referenceType: EmployeeMessageReferenceType;\n};\nexport const EmployeeLink: FunctionComponent<Props> = ({\n employee: employe,\n referenceId,\n referenceType,\n}) => {\n const actions = useActions();\n\n if (!employe) {\n return <span>Ikke satt</span>;\n }\n if (employe.hide) {\n return <span>{employe.name}</span>;\n }\n return (\n <Link\n onClick={() =>\n actions.onContactPerson({\n employeeId: employe.id,\n referenceId,\n referenceType,\n })\n }\n >{`${employe.name}`}</Link>\n );\n};\n","import React, { FunctionComponent, useState } from \"react\";\nimport { Column, Table } from \"@frontend/common/src/components/Table/Table\";\nimport { ExpandIcon } from \"@frontend/common/src/elements/ExpandIcon/ExpandIcon\";\nimport { useTranslation } from \"react-i18next\";\nimport { Page } from \"@frontend/common/src/types/Page\";\nimport { EmployeeMessageReferenceType } from \"@frontend/common/src/types/EmployeeMessage\";\nimport { formatDate } from \"@frontend/common/src/helpers/date\";\nimport { Order } from \"../../types/Order\";\nimport { Link } from \"../../elements/Link/Link\";\n\nimport { createUrl } from \"../../app/pages\";\nimport { RootState, useActions, useAppState } from \"../../overmind\";\nimport { formatMoney } from \"../../helpers/money\";\nimport { getDeliveryDateText } from \"../../helpers/order\";\nimport { EmployeeLink } from \"../EmployeeLink/EmployeeLink\";\n\ntype ColumnKey = keyof Order;\n\ntype Props = {\n orders: Order[];\n columns?: ColumnKey[];\n noResultsText?: string;\n};\n\nconst createColumns = (\n actions: any,\n state: RootState,\n t: any\n): Column<Order>[] => {\n const allColumns: Column<Order>[] = [\n {\n headerName: t(\"Project no.\"),\n field: \"id\",\n render: (row, openRows) => {\n const page =\n row.projectId === null ? Page.VIEW_ORDER_PROJECT : Page.VIEW_ORDER;\n if (row.isProjectMaster) {\n return (\n <div>\n <ExpandIcon expanded={openRows.includes(row.id)} />\n <Link href={createUrl(page, { id: row.id })}>{row.id}</Link>\n </div>\n );\n }\n return <Link href={createUrl(page, { id: row.id })}>{row.id}</Link>;\n },\n },\n {\n headerName: t(\"Product\"),\n field: \"projectName\",\n },\n {\n headerName: t(\"Status\"),\n field: \"status\",\n },\n {\n headerName: t(\"Marked\"),\n field: \"marked\",\n },\n {\n headerName: t(\"Order date\"),\n field: \"orderDate\",\n render: (row) => formatDate(row.orderDate),\n },\n {\n headerName: \"Ønsket levering\",\n field: \"delivery\",\n render: (row) => getDeliveryDateText(row),\n },\n {\n headerName: t(\"Constructor\"),\n field: \"engineerId\",\n render: (row) => {\n const employee = state.pretreEmplyees.find(\n (e) => e.id === row.engineerId\n );\n return (\n <EmployeeLink\n employee={employee}\n referenceId={row.id}\n referenceType={EmployeeMessageReferenceType.ORDER}\n />\n );\n },\n },\n {\n headerName: t(\"Constructor\"),\n field: \"constructionName\",\n },\n {\n headerName: t(\"Sales engineer\"),\n field: \"calculationName\",\n },\n {\n headerName: t(\"Sales engineer\"),\n field: \"salesPersonId\",\n render: (row) => {\n const employee = state.pretreEmplyees.find(\n (e) => e.id === row.salesPersonId\n );\n return (\n <EmployeeLink\n employee={employee}\n referenceId={row.id}\n referenceType={EmployeeMessageReferenceType.ORDER}\n />\n );\n },\n },\n {\n headerName: t(\"Customer Order no.\"),\n field: \"customerOrderNumber\",\n },\n {\n headerName: t(\"Order confirmation\"),\n field: \"id\",\n render: () => <Link href=\"#\">Klikk for OB</Link>,\n },\n {\n headerName: t(\"Price\"),\n field: \"sum\",\n alignEnd: true,\n render: (row) => {\n let price = row.sum;\n if (row.isProjectMaster) {\n price = 0;\n row.subProjects.forEach((x) => {\n price += x.sum;\n });\n }\n return (\n <span style={{ textAlign: \"right\", float: \"right\" }}>\n {row.isOrderPriceCalculated && row.sum > 0 ? (\n <span style={{ display: \"flex\" }}>{formatMoney(price)}*</span>\n ) : (\n formatMoney(price)\n )}\n </span>\n );\n },\n },\n ];\n\n return allColumns;\n};\n\nexport const OrderList: FunctionComponent<Props> = ({\n orders,\n columns,\n noResultsText,\n}) => {\n const { t } = useTranslation();\n const actions = useActions();\n const state = useAppState();\n const allColumns = createColumns(actions, state, t);\n let columnsToUse = null;\n if (!columns) {\n columnsToUse = allColumns;\n } else {\n columnsToUse = columns.map((c) => allColumns.find((a) => a.field === c));\n }\n const [openRows, setOpenRows] = useState<string[]>([]);\n const onSelected = (selected: Order) => {\n if (openRows.includes(selected.id)) {\n const copy = openRows.filter((x) => x !== selected.id);\n setOpenRows(copy);\n } else {\n setOpenRows([...openRows, selected.id]);\n }\n };\n return (\n <Table\n noResultsText={noResultsText}\n keyField=\"id\"\n data={orders}\n columns={columnsToUse}\n availableColumns={allColumns}\n onSortChanged={(field, direction) =>\n actions.orders.setSortOption({ field, direction })\n }\n currentSortOption={state.orders.currentOrderSortOption}\n openRows={openRows}\n onRowSelected={onSelected}\n />\n );\n};\n","import React, { FunctionComponent } from \"react\";\nimport styled, { css } from \"styled-components\";\nimport { PreTreColors } from \"../../styles/constants\";\n\nconst List = styled(\"div\")`\n flex-wrap: wrap;\n align-items: center;\n display: flex;\n margin-left: 2em;\n margin-right: 2em;\n justify-content: center;\n text-align: center;\n`;\n\ntype StepProps = {\n align: any;\n};\n\nconst Step = styled(\"a\")<StepProps>`\n color: #fff;\n\n margin: 0.25rem;\n padding-left: 0.5em;\n padding-right: 0.5em;\n border-radius: 4px;\n display: inline-flex;\n background-color: ${PreTreColors.pretre};\n &[disabled] {\n background-color: #dbdbdb;\n border-color: #cccccc;\n color: #7a7a7a;\n opacity: 0.5;\n cursor: not-allowed;\n }\n`;\n\nconst currentLinkStyle = css`\n background-color: ${PreTreColors.pretre};\n color: white;\n`;\n\ntype LinkProps = {\n current?: any;\n} & React.HTMLProps<HTMLAnchorElement>;\nconst Link = styled(\"a\")<LinkProps>`\n color: #363636;\n border: 1px solid ${PreTreColors.grillaBrite};\n min-width: auto;\n margin: 0.25rem;\n padding-left: 0.5em;\n padding-right: 0.5em;\n border-radius: 4px;\n display: inline-flex;\n\n ${(props: LinkProps) => props.current && currentLinkStyle}\n`;\nconst Ellipsis = styled(\"a\")`\n font-size: 1em;\n justify-content: center;\n margin: 0.25rem;\n padding-left: 0.5em;\n padding-right: 0.5em;\n text-align: center;\n\n align-items: center;\n border: 1px solid transparent;\n border-radius: 4px;\n box-shadow: none;\n display: inline-flex;\n font-size: 1rem;\n height: 2.25em;\n justify-content: flex-start;\n line-height: 1.5;\n padding: calc(0.375em - 1px) calc(0.625em - 1px);\n position: relative;\n vertical-align: top;\n`;\n\ntype PaginationProps = {\n align: any;\n};\n\nconst Pagination = styled(\"div\")<PaginationProps>`\n align-items: center;\n display: flex;\n justify-content: center;\n text-align: center;\n`;\n\nfunction renderLink(pageNumber: number, key: string, link: string) {\n return (\n <Link key={key} href={`${link}${pageNumber}`}>\n {pageNumber}\n </Link>\n );\n}\n\nfunction renderPrev(currentPage: number, pageCount: number, link: string) {\n return [\n <Step\n key=\"prev\"\n {...(currentPage === 1 ? { disabled: true } : {})}\n align=\"previous\"\n href={currentPage === 1 ? \"#\" : `${link}${currentPage - 1}`}\n >\n Forrige\n </Step>,\n ];\n}\n\nfunction renderNext(currentPage: number, pageCount: number, link: string) {\n return [\n <Step\n key=\"next\"\n {...(currentPage >= pageCount ? { disabled: true } : {})}\n align=\"next\"\n href={currentPage >= pageCount ? \"#\" : `${link}${currentPage + 1}`}\n >\n Neste\n </Step>,\n ];\n}\n\nfunction renderLinks(currentPage: number, pageCount: number, link: string) {\n const items = [];\n if (currentPage !== 1 && pageCount > 1) {\n items.push(renderLink(1, \"first\", link));\n if (currentPage !== 2) {\n items.push(<Ellipsis key=\"space-before\">…</Ellipsis>);\n items.push(renderLink(currentPage - 1, \"prev-current\", link));\n }\n }\n\n items.push(\n <Link key=\"current\" current>\n {currentPage}\n </Link>\n );\n\n if (currentPage !== pageCount && pageCount > currentPage) {\n items.push(renderLink(currentPage + 1, \"next-current\", link));\n if (currentPage !== pageCount - 1) {\n items.push(<Ellipsis key=\"space-after\" />);\n items.push(renderLink(pageCount, \"last\", link));\n }\n }\n return items;\n}\n\ntype Props = {\n currentPage: number;\n pageCount: number;\n link: string;\n mode?: \"tiny\";\n};\n\nexport const Pager: FunctionComponent<Props> = ({\n currentPage,\n pageCount,\n link,\n mode,\n}) => {\n return (\n <Pagination align=\"centered\">\n {renderPrev(currentPage, pageCount, link)}\n {(!mode || mode !== \"tiny\") && (\n <List>{renderLinks(currentPage, pageCount, link)}</List>\n )}\n {renderNext(currentPage, pageCount, link)}\n </Pagination>\n );\n};\n","// eslint-disable-next-line no-shadow\nexport enum CMSArticles {\n DOCUMENTATION = 1402,\n ADMIN = 1403,\n WELCOME_LOGGED_IN_1 = 1404,\n WELCOME_GUEST_1 = 1405,\n WELCOME_LOGGED_IN_2 = 1406,\n WELCOME_GUEST_2 = 1407,\n NEW_USER_INFO = 1408,\n TECHNICAL_SERVICES = 1409,\n ATTACHMENT_INFO_OFFERS = 1410,\n ATTACHMENT_INFO_ORDERS = 1426,\n OFFER_SUMMARY = 1411,\n PRECUT_INFO = 1427,\n MAP_INFO = 1413,\n OFFER_SELECTION_HELPER = 1414,\n NOT_CALCULATED = 1424,\n AMOUNT_DAYS_NEW_OFFER = 1423,\n ORDER_NO_DRAWINGS = 1428,\n ORDER_SUMMARY_MULTIPLE = 1429,\n ORDER_SELECTION_HELPER = 1430,\n ORDER_SUMMARY = 1431,\n}\nexport type CMSArticle = {\n title: string;\n content: string;\n};\n","import styled from \"styled-components\";\nimport { PreTreColors } from \"../../styles/constants\";\n\nexport const Form = styled(\"form\")`\n padding: 24px 24px 0 24px;\n height: auto;\n`;\nexport const FormHeader = styled(\"h1\")`\n font-size: 2.625rem;\n color: ${PreTreColors.beis};\n text-align: center;\n`;\n","import styled from \"styled-components\";\n\ntype Props = {\n direction?: \"row\" | \"column\";\n};\nexport const ButtonGroup = styled(\"div\")<Props>`\n display: flex;\n margin-top: 2rem;\n flex-direction: ${(props) => props.direction || \"row\"};\n`;\n","import React, { FunctionComponent } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { yupResolver } from \"@hookform/resolvers/yup\";\nimport * as yup from \"yup\";\n\nimport { FormInput } from \"@frontend/common/src/elements/FormInput/FormInput\";\nimport { Page } from \"@frontend/common/src/elements/Page/Page\";\nimport {\n BlockButton,\n LinkButton,\n} from \"@frontend/common/src/elements//Buttons/Buttons.styles\";\nimport { useActions, useEffects } from \"../../../overmind\";\n\n// Components\nimport { Form } from \"../UnauthForm.styles\";\n\nimport { ButtonGroup } from \"../../../components/ButtonGroup/ButtonGroup.styles\";\n\nconst loginSchema = yup.object().shape({\n email: yup.string().email().required(\"Vennligst fyll inn epost\"),\n});\n\nexport const ForgotPasswordPage: FunctionComponent = () => {\n // const [email, setEmail] = React.useState(\"\");\n // const [password, setPassword] = React.useState(\"\");\n\n const actions = useActions();\n const effects = useEffects();\n\n const { register, handleSubmit, errors } = useForm<{ email: string }>({\n resolver: yupResolver(loginSchema),\n });\n const onSubmit = (data: { email: string }) => {\n actions.auth.forgotPassword(data);\n };\n\n return (\n <Page title=\"Glemt Passord\">\n <Form>\n <div style={{ maxWidth: \"450px\" }}>\n <FormInput\n htmlFor=\"email\"\n name=\"email\"\n label=\"Epost\"\n type=\"text\"\n defaultValue=\"\"\n placeholder=\"Din epost..\"\n inputRef={register}\n error={errors.email?.message}\n />\n <ButtonGroup>\n <BlockButton onClick={handleSubmit(onSubmit)}>\n Reset passord\n </BlockButton>\n <LinkButton onClick={() => effects.router.navigateTo(\"/\")}>\n Avbryt\n </LinkButton>\n </ButtonGroup>\n </div>\n </Form>\n </Page>\n );\n};\n","import React, { FunctionComponent } from \"react\";\nimport { useAppState } from \"../../overmind\";\n\ntype Props = {\n contentId: number;\n};\nexport const CMSContent: FunctionComponent<Props> = ({ contentId }) => {\n const state = useAppState();\n\n let markup = \"\";\n if (!state.cms[contentId]) {\n markup = \"Fant ikke innhold..\";\n } else {\n markup = state.cms[contentId].content;\n }\n return <div dangerouslySetInnerHTML={{ __html: markup }} />;\n};\n","import styled from \"styled-components\";\nimport { PreTreColors } from \"../../styles/constants\";\n\ntype Props = {\n theme?: string;\n type?: string;\n};\n\nexport const Heading = styled(\"h1\")<Props>`\n font-size: ${(props: Props) =>\n props.type === \"secondary\" ? \"1.25rem\" : \"2.625rem\"};\n font-weight: 700;\n color: ${(props: Props) =>\n props.theme === \"light\" ? \"white\" : PreTreColors.beis};\n font-family: \"Kumbh Sans Normal\", sans-serif;\n line-height: normal;\n`;\n","import React, { FunctionComponent } from \"react\";\nimport { Heading } from \"./Header.styles\";\n\ntype Props = {\n rest?: any;\n type?: string;\n theme?: string;\n style?: any;\n};\nexport const Header: FunctionComponent<Props> = ({\n children,\n type,\n theme,\n ...rest\n}) => {\n return (\n <Heading theme={theme} type={type} {...rest}>\n {children}\n </Heading>\n );\n};\n","import styled, { css } from \"styled-components\";\nimport { PreTreColors } from \"../../styles/constants\";\n\ntype ButtonProps = {\n secondary?: boolean;\n disabled?: boolean;\n};\n\ntype ProductButton = {\n active: boolean;\n disabled: boolean;\n extended?: boolean;\n};\n\nexport const Label = styled(\"label\")`\n font-size: 18px;\n color: white;\n`;\n\nconst disabledStyle = css`\n background-color: ${PreTreColors.borderlineGray};\n color: white;\n cursor: not-allowed;\n\n &:hover {\n background-color: ${PreTreColors.borderlineGray};\n }\n`;\n\nexport const BlockButton = styled(\"button\")<ButtonProps>`\n background-color: ${(props: ButtonProps) =>\n props.secondary ? PreTreColors.beis : PreTreColors.pretre};\n height: auto;\n width: 100%;\n font-size: 1.5rem;\n min-width: 10em;\n font-weight: 700;\n color: white;\n padding: 15px 0;\n border-radius: 10px;\n border: 0;\n cursor: pointer;\n &:hover {\n background-color: ${(props: ButtonProps) =>\n props.secondary ? \"#310802\" : \"#b30000\"};\n }\n &:focus {\n outline: none;\n border: none;\n border-color: inherit;\n box-shadow: none;\n }\n\n ${(props: ButtonProps) => props.disabled && disabledStyle}\n`;\n\nexport const LinkButton = styled(\"button\")`\n margin: 1rem;\n background: none;\n border: none;\n width: 100%;\n text-align: center;\n font-size: 1.125rem;\n color: ${PreTreColors.beis};\n cursor: pointer;\n text-decoration: underline;\n &:hover {\n opacity: 0.8;\n }\n`;\n\nexport const SelectableBlockButton = styled(\"button\")<ButtonProps>`\n background-color: ${PreTreColors.weakBrite};\n height: auto;\n width: 100%;\n font-size: 1.5rem;\n font-weight: 700;\n color: ${PreTreColors.pretre};\n padding: 15px 0;\n border-radius: 10px;\n border: 1px solid ${PreTreColors.pretre};\n cursor: pointer;\n &:hover {\n background-color: ${PreTreColors.pretre};\n color: white;\n }\n\n ${(props: ButtonProps) => props.disabled && disabledStyle}\n`;\n\nexport const ChooseProductPageButton = styled(\"button\")<ProductButton>`\n background-color: ${(props: ProductButton) =>\n props.active\n ? PreTreColors.beis\n : props.extended\n ? PreTreColors.piemonte\n : \"gray\"};\n height: 3.5em;\n width: 10vw;\n font-size: 1rem;\n font-weight: 700;\n color: #fff;\n padding: 10px 0;\n border-radius: 10px;\n cursor: pointer;\n @media (max-width: 1024px) {\n width: 9em;\n }\n &:hover {\n background-color: ${PreTreColors.pretre};\n color: white;\n }\n ${(props: ProductButton) => props.disabled && disabledStyle}\n`;\n","import styled from \"styled-components\";\nimport { PreTreColors } from \"../../styles/constants\";\n\nexport const Card = styled(\"div\")`\n max-width: 100%;\n height: auto;\n max-height: 100%;\n padding: 2.375rem 2.875rem;\n background-color: ${PreTreColors.weakBrite};\n border-radius: 10px;\n`;\nexport const CardHeader = styled(\"h1\")`\n margin-top: 0;\n margin-bottom: 3px;\n font-size: 2.625rem;\n font-weight: 700;\n color: ${PreTreColors.beis};\n`;\nexport const ShortcutLink = styled(\"a\")`\n margin-top: 15px;\n color: ${PreTreColors.beis};\n font-size: 1.125rem;\n font-weight: 700;\n padding-bottom: 2px;\n text-decoration: underline;\n cursor: pointer;\n`;\nexport const ArrowIcon = styled.svg`\n width: 27px;\n height: 20px;\n margin-right: 0.6875rem;\n margin-top: 4px;\n float: left;\n`;\n","import React, { FunctionComponent } from \"react\";\nimport { ShortcutLink, ArrowIcon } from \"./ShortcutCard.styles\";\n\ntype ItemProps = {\n to?: string;\n ref?: any;\n as?: any;\n} & React.HTMLProps<HTMLDivElement>;\n\nexport const ShortcutCardLink: FunctionComponent<ItemProps> = ({\n to,\n children,\n ...props\n}) => {\n return (\n <ShortcutLink href={to} {...props}>\n {children}\n </ShortcutLink>\n );\n};\n\nexport const ShortcutArrowIcon: FunctionComponent = () => {\n return (\n <ArrowIcon\n viewBox=\"0 0 27 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M0 8.50708H23.1328V11.4915H0V8.50708Z\" fill=\"#CA0000\" />\n <path\n d=\"M16.7161 20L14.6257 17.9096L22.5368 10L14.6257 2.09038L16.7161 0L26.7147 10L16.7161 20Z\"\n fill=\"#CA0000\"\n />\n </ArrowIcon>\n );\n};\n","import styled, { css } from \"styled-components\";\n\ntype Props = {\n fullHeight?: boolean;\n};\nconst fullHeightStyle = css`\n flex-grow: 1;\n`;\nexport const VBox = styled(\"div\")<Props>`\n display: flex;\n flex: 1;\n flex-direction: column;\n ${(props: Props) => props.fullHeight && fullHeightStyle}\n`;\n","export default __webpack_public_path__ + \"static/media/banner.b5a05349.jpg\";","import styled from \"styled-components\";\nimport BackgroundImage from \"../../assets/img/banner.jpg\";\n\nexport const Page = styled(\"div\")`\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n`;\nexport const Shader = styled(\"div\")`\n width: 100%;\n height: calc(100vw * 0.22);\n min-height: 430px;\n content: \"\";\n position: relative;\n left: 0;\n top: 0;\n background: rgba(67, 10, 3, 0.5);\n`;\nexport const BannerImage = styled(\"div\")`\n width: 100%;\n height: calc(100vw * 0.22);\n min-height: 430px;\n background: url(${BackgroundImage});\n background-size: cover;\n background-repeat: no-repeat;\n position: relative;\n`;\nexport const Container = styled(\"div\")`\n width: 80%;\n height: auto;\n margin: 0 auto;\n display: flex;\n justify-content: space-between;\n`;\nexport const ItemContainer = styled(\"div\")`\n display: flex;\n height: calc(100vw * 0.22);\n min-height: 430px;\n`;\nexport const VerticalCenterBox = styled(\"div\")`\n align-self: center;\n`;\nexport const SubText = styled(\"h4\")`\n margin-bottom: 26px;\n font-size: 1.5rem;\n color: white;\n font-weight: 400;\n`;\nexport const BtnWrapper = styled(\"div\")`\n width: 100%;\n max-width: 200px;\n`;\n","import { useState, useEffect } from \"react\";\n\n/**\n * Nifty little utility function for getting the window height and width. Useful for creating responsive websites\n */\nfunction getWindowDimensions() {\n const { innerWidth: width, innerHeight: height } = window;\n return {\n width,\n height,\n };\n}\n\nexport function useWindowDimensions() {\n const [windowDimensions, setWindowDimensions] = useState(\n getWindowDimensions()\n );\n\n useEffect(() => {\n function handleResize() {\n setWindowDimensions(getWindowDimensions());\n }\n\n window.addEventListener(\"resize\", handleResize);\n return () => window.removeEventListener(\"resize\", handleResize);\n }, []);\n\n return windowDimensions;\n}\n","import React, { FunctionComponent } from \"react\";\nimport { CMSArticles } from \"@frontend/common/src/types/CMSArticle\";\nimport { useAuth0 } from \"@auth0/auth0-react\";\nimport { CMSContent } from \"../../components/CMSContent/CMSContent\";\nimport { PreTreColors, LayoutConstants } from \"../../styles/constants\";\nimport { Header } from \"../../elements/Header/Header\";\nimport { BlockButton } from \"../../components/Buttons/Buttons.styles\";\n\nimport {\n Card,\n CardHeader,\n} from \"../../components/ShortcutCard/ShortcutCard.styles\";\nimport {\n ShortcutCardLink,\n ShortcutArrowIcon,\n} from \"../../components/ShortcutCard/ShortcutCard\";\nimport { VBox } from \"../../elements/VBox/VBox\";\nimport {\n Page,\n Shader,\n BannerImage,\n Container,\n ItemContainer,\n VerticalCenterBox,\n SubText,\n BtnWrapper,\n} from \"./HomePage.styles\";\nimport { useAppState } from \"../../overmind\";\n\n// TODO Remove this if dont wanna use\nimport { useWindowDimensions } from \"../../hooks/useWindowDimensions\";\n\nexport const HomePage: FunctionComponent = () => {\n const state = useAppState();\n\n // TODO Remove this if dont wanna use\n const { width } = useWindowDimensions();\n\n const isGuest = state.auth.user === null;\n\n const { loginWithRedirect } = useAuth0();\n return (\n <Page>\n <BannerImage>\n <Shader>\n <Container>\n {/* Left Side */}\n <ItemContainer\n style={{\n textAlign:\n width >= LayoutConstants.sidebarBreak ? \"left\" : \"center\",\n }}\n >\n <VerticalCenterBox>\n <SubText>\n <CMSContent\n contentId={\n isGuest\n ? CMSArticles.WELCOME_GUEST_1\n : CMSArticles.WELCOME_LOGGED_IN_1\n }\n />\n </SubText>\n <BtnWrapper\n style={{\n maxWidth:\n width >= LayoutConstants.sidebarBreak ? \"200px\" : \"100%\",\n }}\n >\n {!isGuest ? null : (\n <BlockButton onClick={() => loginWithRedirect()}>\n Logg inn\n </BlockButton>\n )}\n </BtnWrapper>\n </VerticalCenterBox>\n </ItemContainer>\n {/* Right Side */}\n {width >= LayoutConstants.sidebarBreak ? (\n <ItemContainer>\n <VerticalCenterBox>\n <Card>\n <CardHeader>Nyttige snarveier</CardHeader>\n {!isGuest ? (\n <VBox>\n <ShortcutCardLink href=\"/mine-prosjekt\">\n <ShortcutArrowIcon />\n Mine prosjekt\n </ShortcutCardLink>\n <ShortcutCardLink href=\"/nytt-prosjekt\">\n <ShortcutArrowIcon />\n Nytt prosjekt\n </ShortcutCardLink>\n\n {/* <ShortcutCardLink>\n <ShortcutArrowIcon />\n Avvik\n </ShortcutCardLink> */}\n <ShortcutCardLink\n href=\"https://www.pretre.no/kontakt/administrasjon/\"\n target=\"_blank\"\n >\n <ShortcutArrowIcon />\n Kontaktinformasjon Pretre\n </ShortcutCardLink>\n </VBox>\n ) : (\n <VBox>\n <ShortcutCardLink\n href=\"https://kjorelister.pretre.no/\"\n target=\"_blank\"\n >\n <ShortcutArrowIcon />\n Pålogging Kjørelister\n </ShortcutCardLink>\n <ShortcutCardLink href=\"/glemt-passord\">\n <ShortcutArrowIcon />\n Er bruker, glemt passord\n </ShortcutCardLink>\n <ShortcutCardLink\n href=\"https://www.pretre.no/kontakt/administrasjon/\"\n target=\"_blank\"\n >\n <ShortcutArrowIcon />\n Kontaktinformasjon Pretre\n </ShortcutCardLink>\n </VBox>\n )}\n </Card>\n </VerticalCenterBox>\n </ItemContainer>\n ) : null}\n </Container>\n </Shader>\n </BannerImage>\n {width < LayoutConstants.sidebarBreak ? (\n <div\n style={{\n width: \"80%\",\n marginLeft: \"auto\",\n marginRight: \"auto\",\n marginTop: -25,\n marginBottom: -70,\n }}\n >\n <ItemContainer style={{ justifyContent: \"center\" }}>\n <VerticalCenterBox>\n <Card style={{ padding: \"20px 25px\" }}>\n <CardHeader style={{ fontSize: 26 }}>\n Nyttige snarveier\n </CardHeader>\n\n {!isGuest ? (\n <VBox>\n <ShortcutCardLink\n style={{ fontSize: 16 }}\n href=\"/mine-prosjekt\"\n >\n <ShortcutArrowIcon />\n Mine prosjekt\n </ShortcutCardLink>\n <ShortcutCardLink\n style={{ fontSize: 16 }}\n href=\"/nytt-prosjekt\"\n >\n <ShortcutArrowIcon />\n Nytt prosjekt\n </ShortcutCardLink>\n {/* <ShortcutCardLink>\n <ShortcutArrowIcon />\n Avvik\n </ShortcutCardLink> */}\n <ShortcutCardLink\n style={{ fontSize: 16 }}\n href=\"https://www.pretre.no/kontakt/administrasjon/\"\n target=\"_blank\"\n >\n <ShortcutArrowIcon />\n Kontaktinformasjon Pretre\n </ShortcutCardLink>\n </VBox>\n ) : (\n <VBox>\n <ShortcutCardLink\n href=\"https://kjorelister.pretre.no/\"\n target=\"_blank\"\n >\n <ShortcutArrowIcon />\n Pålogging Kjørelister\n </ShortcutCardLink>\n <ShortcutCardLink href=\"/glemt-passord\">\n <ShortcutArrowIcon />\n Er bruker, glemt passord\n </ShortcutCardLink>\n <ShortcutCardLink\n href=\"https://www.pretre.no/kontakt/administrasjon/\"\n target=\"_blank\"\n >\n <ShortcutArrowIcon />\n Kontaktinformasjon Pretre\n </ShortcutCardLink>\n </VBox>\n )}\n </Card>\n </VerticalCenterBox>\n </ItemContainer>\n </div>\n ) : null}\n <div\n style={{\n width: \"80%\",\n margin: \"50px auto\",\n textAlign: \"center\",\n }}\n >\n <div\n style={{\n maxWidth: 800,\n textAlign:\n width >= LayoutConstants.sidebarBreak ? \"left\" : \"center\",\n }}\n >\n <Header>\n Velkommen til <br />\n Pretre AS kundeportal\n </Header>\n <div\n style={{\n color: PreTreColors.beis,\n fontSize: 18,\n fontWeight: 400,\n marginTop: 16,\n }}\n >\n <CMSContent\n contentId={\n isGuest\n ? CMSArticles.WELCOME_GUEST_2\n : CMSArticles.WELCOME_LOGGED_IN_2\n }\n />\n </div>\n </div>\n </div>\n </Page>\n );\n};\n","import axios, { CancelTokenSource } from \"axios\";\n\nconst ROOT_ENDPOINT = process.env.REACT_APP_API_BASE;\n\n// eslint-disable-next-line no-shadow\nexport enum Verb {\n POST = \"POST\",\n PUT = \"PUT\",\n GET = \"GET\",\n DELETE = \"DELETE\",\n UPDATE = \"UPDATE\",\n PATCH = \"PATCH\",\n}\n\nexport type Endpoint = {\n path: string;\n verb: Verb;\n};\n\nexport class BaseService {\n static replaceParameters(url: string, data: any) {\n if (!data) {\n return url;\n }\n // match patterns like foo/{bar}/{?baz}{/?foobar} and replace {bar} with supplied params\n const paramsToReplace = url.match(/\\{(([^?}]+)?\\?)?[a-z0-9-_]+\\}/gi);\n if (paramsToReplace) {\n let lastMissingOptionalKey;\n for (let i = 0; i < paramsToReplace.length; i++) {\n const key = paramsToReplace[i].slice(1, -1);\n const parts = key.split(\"?\");\n const isOptional = parts.length > 1;\n const param = parts.pop();\n const prePath = parts.pop();\n // eslint-disable-next-line no-prototype-builtins\n const hasParamToReplaceKey = data.hasOwnProperty(param);\n let paramToReplaceKey = \"\";\n\n if (isOptional && hasParamToReplaceKey && lastMissingOptionalKey) {\n throw new Error(\n `Missing previous optional key ${lastMissingOptionalKey}`\n );\n }\n if (!isOptional && !hasParamToReplaceKey) {\n throw new Error(`Missing parameter ${param}`);\n } else if (hasParamToReplaceKey) {\n paramToReplaceKey = data[param];\n if (prePath) {\n paramToReplaceKey = prePath + paramToReplaceKey;\n }\n // eslint-disable-next-line no-param-reassign\n delete data[param];\n }\n\n // eslint-disable-next-line no-param-reassign\n url = url.replace(`{${key}}`, paramToReplaceKey);\n\n if (isOptional && !hasParamToReplaceKey) {\n lastMissingOptionalKey = param;\n }\n }\n }\n return url;\n }\n\n // eslint-disable-next-line class-methods-use-this\n makeRequest(\n route: Endpoint,\n body: any = null,\n responseType: string = null,\n headers: { [index: string]: string } = null,\n cancelToken: CancelTokenSource | null = null\n ): Promise<any> {\n if ([\"PUT\", \"DELETE\", \"POST\", \"GET\"].indexOf(route.verb) === -1) {\n return Promise.reject(new Error(\"Invalid verb\"));\n }\n if (!route.path) {\n return Promise.reject(new Error(\"Path was not specified\"));\n }\n const params: any = {\n method: route.verb,\n url: ROOT_ENDPOINT + BaseService.replaceParameters(route.path, body),\n };\n\n if (body !== null) {\n params.data = body;\n }\n\n if (responseType !== null) {\n params.responseType = responseType;\n }\n if (headers !== null) {\n params.headers = headers;\n }\n if (cancelToken !== null) {\n params.cancelToken = cancelToken.token;\n }\n\n return axios(params).catch((error) => {\n return Promise.reject(error.response?.data?.message || error.message);\n });\n }\n\n // eslint-disable-next-line class-methods-use-this\n uploadFile(\n route: Endpoint,\n files: File[],\n routeParams: any = null\n ): Promise<any> {\n if ([\"PUT\", \"DELETE\", \"POST\", \"GET\"].indexOf(route.verb) === -1) {\n return Promise.reject(new Error(\"Invalid verb\"));\n }\n if (!route.path) {\n return Promise.reject(new Error(\"Path was not specified\"));\n }\n const params: any = {\n method: route.verb,\n url:\n ROOT_ENDPOINT + BaseService.replaceParameters(route.path, routeParams),\n };\n\n const data = new FormData();\n for (let i = 0; i < files.length; i++) {\n // get item\n const file = files[i];\n data.append(\"files\", file, file.name);\n }\n params.data = data;\n\n return axios(params).catch((error) => {\n return Promise.reject(error.response?.data?.message || error.message);\n });\n }\n}\n","import React, { FunctionComponent } from \"react\";\n\nimport { Link } from \"../../elements/Link/Link\";\n\ntype Props = {\n number: string;\n};\nexport const PhoneLink: FunctionComponent<Props> = ({ number }) => {\n if (!number) {\n return <span>N/A</span>;\n }\n // only attempt to format for valid norwegian / 8 digit numbers. Should pull in some lib here if we need more\n if (number.trim().length === 8) {\n const formatted = `${number.substring(0, 3)} ${number.substring(\n 3,\n 5\n )} ${number.substring(5, 8)}`;\n return <Link href={`tel:${number}`}>{`${formatted}`}</Link>;\n }\n return <Link href={`tel:${number}`}>{`${number}`}</Link>;\n};\n","import styled from \"styled-components\";\n\nexport const HBox = styled(\"div\")`\n display: flex;\n flex: 1;\n flex-direction: row;\n justify-content: space-between;\n align-items: flex-start;\n`;\n","import React, { FunctionComponent } from \"react\";\nimport { Column, Table } from \"@frontend/common/src/components/Table/Table\";\nimport { useTranslation } from \"react-i18next\";\nimport { Link } from \"../../elements/Link/Link\";\nimport { Document } from \"../../types/Document\";\nimport { useActions } from \"../../overmind\";\nimport { HBox } from \"../../elements/HBox/HBox\";\n\ntype Props = {\n documents: Document[];\n};\n\nexport const DocumentList: FunctionComponent<Props> = ({ documents }) => {\n const { t } = useTranslation();\n const actions = useActions();\n\n const columns: Column<Document>[] = [\n {\n headerName: t(\"Description\"),\n field: \"description\",\n render: (row) => (\n <HBox>\n <Link\n as=\"span\"\n onClick={() => {\n actions.orders.openDocument({ file: row });\n }}\n >\n {row.description}\n </Link>\n <Link\n as=\"span\"\n onClick={() => {\n actions.orders.downloadDocument({ file: row });\n }}\n >\n Last ned\n </Link>\n </HBox>\n ),\n },\n /*\n {\n headerName: t(\"Doc type\"),\n field: \"type\",\n },\n {\n headerName: t(\"Folder\"),\n field: \"folder\",\n },\n */\n ];\n return (\n <Table\n noResultsText=\"Ingen dokumenter\"\n keyField=\"id\"\n data={documents}\n availableColumns={columns}\n columns={columns}\n />\n );\n};\n","import styled from \"styled-components\";\n\nimport { PreTreColors } from \"../../styles/constants\";\n\nexport const DetailsBox = styled(\"table\")`\n border-collapse: collapse;\n`;\n\nexport const Legend = styled(\"th\")`\n color: ${PreTreColors.beis};\n text-align: left;\n vertical-align: top;\n padding-right: 2rem;\n`;\n\nexport const Text = styled(\"td\")``;\n\nexport const Group = styled(\"tr\")``;\n","import React, { FunctionComponent } from \"react\";\n\ntype Props = {\n embedId: string | number;\n embedHash: string;\n};\nexport const SketchFabEmbed: FunctionComponent<Props> = ({\n embedId,\n embedHash,\n}) => {\n return (\n <div className=\"sketchfab-embed-wrapper\">\n <iframe\n title=\"A 3D model\"\n width=\"421\"\n height=\"258\"\n src={`https://sketchfab.com/models/${embedHash}/embed?autostart=0&ui_controls=0&ui_infos=0&ui_inspector=0&ui_stop=0&ui_watermark=1&ui_watermark_link=1`}\n frameBorder=\"0\"\n allow=\"autoplay; fullscreen; vr\"\n allowFullScreen\n />\n <p\n style={{\n fontSize: \"13px\",\n fontWeight: \"normal\",\n margin: \"5px\",\n color: \"#4A4A4A\",\n }}\n >\n <a\n href={`https://sketchfab.com/3d-models/${embedId}-${embedHash}?utm_medium=embed&utm_source=website&utm_campaign=share-popup`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n style={{ fontWeight: \"bold\", color: \"#1CAAD9\" }}\n >\n {embedId}\n </a>\n by{\" \"}\n <a\n href=\"https://sketchfab.com/pretre?utm_medium=embed&utm_source=website&utm_campaign=share-popup\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n style={{ fontWeight: \"bold\", color: \"#1CAAD9\" }}\n >\n Pretre AS\n </a>\n on{\" \"}\n <a\n href=\"https://sketchfab.com?utm_medium=embed&utm_source=website&utm_campaign=share-popup\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n style={{ fontWeight: \"bold\", color: \"#1CAAD9\" }}\n >\n Sketchfab\n </a>\n </p>\n </div>\n );\n};\n","import { Endpoint, Verb } from \"./BaseService\";\n\nexport const endpoints: { [index: string]: { [index: string]: Endpoint } } = {\n auth: {\n login: {\n path: \"/auth/logg-inn\",\n verb: Verb.POST,\n },\n checkToken: {\n path: \"/auth/sjekk-token\",\n verb: Verb.GET,\n },\n forgotPassword: {\n path: \"/auth/glemt-passord\",\n verb: Verb.POST,\n },\n getByUsername: {\n path: \"/auth/getUser\",\n verb: Verb.POST,\n },\n },\n project: {\n getAllForCustomerId: {\n path: \"/kunde/{customerId}/project\",\n verb: Verb.GET,\n },\n getById: {\n path: \"/kunde/{customerId}/project/{id}\",\n verb: Verb.GET,\n },\n getByIdWithoutCustomer: {\n path: \"/kunde/placeholder/project/getWithoutCustomer/{id}\",\n verb: Verb.GET,\n },\n getOrderFromOfferId: {\n path: \"/kunde/{customerId}/project/{offerId}/populate\",\n verb: Verb.GET,\n },\n postCommitDraftOrder: {\n path: \"/kunde/{customerId}/project/\",\n verb: Verb.POST,\n },\n postCommitSubprojects: {\n path: \"/kunde/{customerId}/project/{projectId}/subprojects\",\n verb: Verb.POST,\n },\n getDocumentsforOrder: {\n path: \"/kunde/{customerId}/project/{orderId}/filer\",\n verb: Verb.GET,\n },\n getDocumentforOrder: {\n path: \"/file/{customerId}/filer/{orderId}\",\n verb: Verb.POST,\n },\n addFiles: {\n path: \"/file/{orderId}/upload/order/{customerId}\",\n verb: Verb.POST,\n },\n calculateRoof: {\n path: \"/kunde/placeholder/project/calculateRoof\",\n verb: Verb.POST,\n },\n },\n lookups: {\n getLookups: {\n path: \"/oppslag\",\n verb: Verb.GET,\n },\n zipcodeLookup: {\n path: \"/oppslag/zip/{zipcode}\",\n verb: Verb.GET,\n },\n getConfigValue: {\n path: \"/oppslag/config/{configKey}\",\n verb: Verb.GET,\n },\n },\n employee: {\n getAll: {\n path: \"/ansatt\",\n verb: Verb.GET,\n },\n sendMessage: {\n path: \"/ansatt/{employeeId}/melding/{customerId}\",\n verb: Verb.POST,\n },\n },\n customerEmployee: {\n getAll: {\n path: \"/kunde/{customerId}/kontakt\",\n verb: Verb.GET,\n },\n search: {\n path: \"/admin/sok/kunder\",\n verb: Verb.POST,\n },\n update: {\n path: \"/kunde/{customerId}/kontakt/{employeeId}\",\n verb: Verb.PUT,\n },\n create: {\n path: \"/kunde/{customerId}/kontakt\",\n verb: Verb.POST,\n },\n resetPassword: {\n path: \"/kunde/{customerId}/kontakt/{customerEmployeeId}/resetPassword\",\n verb: Verb.GET,\n },\n },\n customer: {\n getById: {\n path: \"/kunde/{customerId}\",\n verb: Verb.GET,\n },\n update: {\n path: \"/kunde/{customerId}\",\n verb: Verb.PUT,\n },\n getForToken: {\n path: \"/kunde/\",\n verb: Verb.GET,\n },\n },\n};\n","import { BaseService } from \"../BaseService\";\nimport { endpoints } from \"../endpoints\";\nimport { IAuthService } from \"./IAuthService\";\n\nexport class AuthService extends BaseService implements IAuthService {\n async login(username: string, password: string): Promise<string> {\n const response = await this.makeRequest(endpoints.auth.login, {\n brukernavn: username,\n passord: password,\n }).then((r) => r.data);\n return response.token;\n }\n\n async checkToken(): Promise<boolean> {\n return this.makeRequest(endpoints.auth.checkToken).then((r) => r.data);\n }\n\n async forgotPassword(username: string): Promise<boolean> {\n return this.makeRequest(endpoints.auth.forgotPassword, {\n username,\n });\n }\n}\n","import { isValid } from \"date-fns\";\nimport { DraftOrderRoof } from \"../types/DraftOrder/DraftOrderRoof\";\nimport { DraftOrderJoists } from \"../types/DraftOrder/DraftOrderJoists\";\nimport { DraftOrderPrecut } from \"../types/DraftOrder/DraftOrderPrecut\";\nimport { DraftOrder } from \"../types/DraftOrder/DraftOrder\";\n\nexport const mapNotatB2b = (\n noteB2b: any\n): {\n roof: DraftOrderRoof;\n joists: DraftOrderJoists;\n precut: DraftOrderPrecut;\n} => {\n if (!noteB2b) return null;\n let json;\n if (typeof noteB2b === \"string\") {\n const fixed = noteB2b.replace(\",\\n}\", \"\\n}\");\n json = JSON.parse(fixed);\n } else if (typeof noteB2b === \"object\") {\n json = noteB2b;\n } else {\n // invalid variable\n return null;\n }\n const model: {\n roof: DraftOrderRoof;\n joists: DraftOrderJoists;\n precut: DraftOrderPrecut;\n } = { roof: null, joists: null, precut: null };\n\n model.roof = {\n hasRoof: json.HarTak,\n roofType: json.TakType,\n roofingType: json.Taktekking,\n angle: json.Takvinkel,\n rangeDistance: json.Spennvidde,\n protrusion: json.Utstikk,\n comment: json.KommentarTak,\n } as DraftOrderRoof;\n\n model.joists = {\n hasJoists: json.HarBjelkelag,\n joistsChoice: json.BjelkelagType,\n joistsType: json.BjelkelagValg,\n submergeWetRoom: json.NedsenkVaatrom,\n comment: json.KommentarBjelkelag,\n } as DraftOrderJoists;\n\n model.precut = {\n hasPrecut: json.HarPrecut,\n dimensions: json.PrecutDimensjon,\n comment: json.KommentarPrecut,\n } as DraftOrderPrecut;\n\n return model;\n};\nexport const mapDraftOrder = (data: any): DraftOrder => {\n if (!data) return null;\n\n return data as unknown as DraftOrder;\n};\n\nexport const mapDraftOrderToBackendModel: any = (\n offerId: number,\n customerId: number,\n order: DraftOrder,\n loggedInEmail: string,\n projectId: string\n) => {\n if (!order) return null;\n const model = {\n kundeId: customerId,\n customerId, // for endpoint\n tilbudNr: offerId,\n kundeKontaktId: order.customerContactId,\n merkes: order.marked,\n kommentar: \"\",\n levering: order.deliveryTerms,\n kundesBestillingsnr: order.customerOrderNumber,\n // @ts-ignore\n bestbekr: null,\n // @ts-ignore\n onsketLevering: null,\n // @ts-ignore\n leveringsadresse: null,\n byggeplass: {\n adresse: order.deliveryAddress,\n postnummer: order.zipCode?.toString(),\n lat: 0,\n lng: 0,\n gardsnr: order.farmNumber?.toString(),\n bruksnr: order.subFarmNumber?.toString(),\n hoydeOverHavet: order.mamsl,\n sammeSomByggeplass: order.deliveryAddressSameAsBuilding,\n tilkomstSemi: order.arrivalSemi === \"1\",\n kontpers2: order.contactPersonSite,\n tlflevkunde: order.contactPersonPhoneNr,\n },\n loggedInEmail,\n tilbudsvalg: order.subProjects,\n byggtype: order.buildingType,\n quotation: order.quotation,\n additionalInfo: order.additionalInfo,\n projectId,\n };\n\n model.onsketLevering =\n typeof order.preferredDeliveryDate === \"string\" &&\n // @ts-ignore\n order.preferredDeliveryDate.length > 0\n ? new Date(order.preferredDeliveryDate).toISOString()\n : isValid(order.preferredDeliveryDate)\n ? order.preferredDeliveryDate\n : null;\n\n if (order.expectedDrawingDate) {\n let date;\n switch (typeof order.expectedDrawingDate) {\n case \"string\":\n date = new Date(order.expectedDrawingDate);\n date = date.setHours(date.getHours() + 3);\n model.bestbekr = new Date(date).toISOString();\n break;\n default:\n date = order.expectedDrawingDate;\n date = date.setHours(date.getHours() + 3);\n model.bestbekr = new Date(date).toISOString();\n break;\n }\n }\n\n let leveringsadresse = {};\n\n if (!order.deliveryAddressSameAsBuilding) {\n leveringsadresse = {\n adresse: order.deliveryAddress2,\n postnummer: order.zipCode2?.toString(),\n sammeSomByggeplass: order.deliveryAddressSameAsBuilding,\n tilkomstSemi: order.arrivalSemi === \"1\",\n };\n } else {\n leveringsadresse = {\n adresse: order.deliveryAddress,\n postnummer: order.zipCode?.toString(),\n sammeSomByggeplass: order.deliveryAddressSameAsBuilding,\n tilkomstSemi: order.arrivalSemi === \"1\",\n };\n }\n\n model.leveringsadresse = leveringsadresse;\n return model;\n};\n","/* eslint-disable prefer-destructuring */\nimport { parsePretre } from \"@frontend/common/src/helpers/date\";\nimport { parseISO } from \"date-fns\";\nimport { CancelTokenSource } from \"axios\";\nimport { Document } from \"../../../types/Document\";\nimport { Link } from \"../../../types/Link\";\nimport { Order } from \"../../../types/Order\";\nimport { BaseService } from \"../BaseService\";\nimport { endpoints } from \"../endpoints\";\nimport { IOrderService } from \"./IOrderService\";\nimport { DraftOrder } from \"../../../types/DraftOrder/DraftOrder\";\nimport {\n mapDraftOrder,\n mapDraftOrderToBackendModel,\n} from \"../../../helpers/draftOrder\";\nimport {\n Calculation,\n CalculationPayload,\n} from \"../../../types/DraftOrder/Calculation\";\n\nexport class OrderService extends BaseService implements IOrderService {\n async getDocumentsForOrder(\n customerId: string,\n orderId: string\n ): Promise<Document[]> {\n const results: any[] = await this.makeRequest(\n endpoints.project.getDocumentsforOrder,\n { customerId, orderId }\n ).then((r) => r.data);\n\n return results.map((r) => OrderService.convertDocument(r, customerId));\n }\n\n async getDocument(\n customerId: string,\n orderId: string,\n filename: string\n ): Promise<string> {\n return await this.makeRequest(\n endpoints.project.getDocumentforOrder,\n { customerId, orderId, filename },\n \"blob\"\n ).then((r) => {\n return r.data;\n });\n }\n\n async getAllForCustomerId(customerId: string): Promise<Order[]> {\n const results: any[] = await this.makeRequest(\n endpoints.project.getAllForCustomerId,\n { customerId }\n ).then((r) => r.data);\n return results.map(OrderService.convert);\n }\n\n async getById(id: number): Promise<Order> {\n const results: any = await this.makeRequest(endpoints.project.getById, {\n id,\n }).then((r) => r.data);\n return OrderService.convert(results);\n }\n\n async getByIdWithoutCustomer(id: number): Promise<Order> {\n const results: any = await this.makeRequest(\n endpoints.project.getByIdWithoutCustomer,\n {\n id,\n }\n ).then((r) => r.data);\n return OrderService.convert(results);\n }\n\n async getOrderFromOfferId(\n customerId: string,\n offerId: string\n ): Promise<DraftOrder> {\n const results: DraftOrder = await this.makeRequest(\n endpoints.project.getOrderFromOfferId,\n {\n customerId,\n offerId,\n }\n ).then((r) => mapDraftOrder(r.data));\n return results;\n }\n\n async commitDraftOrder(\n customerId: string,\n order: DraftOrder,\n loggedInEmail: string,\n offerId?: string\n ): Promise<string> {\n const model = mapDraftOrderToBackendModel(\n offerId,\n customerId,\n order,\n loggedInEmail\n );\n return await this.makeRequest(\n endpoints.project.postCommitDraftOrder,\n model\n ).then((r) => r.data);\n }\n\n async commitSubProjects(\n customerId: string,\n order: DraftOrder,\n loggedInEmail: string,\n projectId: string,\n offerId?: string\n ): Promise<string> {\n const model = mapDraftOrderToBackendModel(\n offerId,\n customerId,\n order,\n loggedInEmail,\n projectId\n );\n return await this.makeRequest(\n endpoints.project.postCommitSubprojects,\n model\n ).then((r) => r.data);\n }\n\n async addFiles(\n orderId: string,\n files: File[],\n customerId: string\n ): Promise<any> {\n return await this.uploadFile(endpoints.project.addFiles, files, {\n orderId,\n customerId,\n }).then((r) => r.data);\n }\n\n async calculateRoof(\n payload: CalculationPayload,\n cancelToken: CancelTokenSource | null\n ): Promise<Calculation> {\n return await this.makeRequest(\n endpoints.project.calculateRoof,\n payload,\n null,\n null,\n cancelToken\n ).then((r) => r.data);\n }\n\n static convertDocument(d: any, customerId: string): Document {\n return {\n id: d.navn,\n type: d.type,\n folder: d.mappe,\n description: d.navn,\n customerId,\n orderId: d.projectId,\n };\n }\n\n static convert(order: any): Order {\n let embedHash = null;\n let embedId = null;\n const links: Link[] = [];\n if (order.lenker) {\n order.lenker.forEach((l: any) => {\n if (l.linkType === 1) {\n const embed = l.adresse.match(\n /https:\\/\\/sketchfab.com\\/3d-models\\/(.+)-(.+)/i\n );\n if (embed) {\n embedId = embed[1];\n embedHash = embed[2];\n }\n } else {\n links.push(l);\n }\n });\n }\n const projectId = order.prosjektNr !== \"\" ? order.prosjektNr : null;\n return {\n id: order.ordrenr,\n projectId,\n product: order.produktType_Navn,\n deliveryDay: order.leverdag,\n deliveryWeek: order.leveruke,\n deliveryYear: order.levaar,\n isProjectMaster: order.prosjektNr === null || order.prosjektMaster === 1,\n customerOrderNumber: order.kundesBestillingsnr,\n delivery: parseISO(order.leveringsdato),\n deliveryTerms: order.leveringsbetingelse,\n orderDate: parsePretre(order.ordredato),\n status: order.statusNavn,\n sum: order.kundepris,\n marked: order.merkes,\n deliveryAddress: `${order.levAdre1} ${order.lev_Postnr} ${order.lev_Poststed}`,\n constructionContactPhone:\n order.byggeplass_Tlf !== \"0\" ? order.byggeplass_Tlf : \"\",\n constructionContactName: order.byggePlass_Epost,\n customerEmployeeId:\n order.kontaktPerson_ID !== 0 ? order.kontaktPerson_ID : null,\n engineerId: order[\"konstruktør_ID\"],\n isOrderPriceCalculated: order.isOrderPriceCalculated,\n embedHash,\n embedId,\n documents: [],\n links,\n subProjects: order.subProjects.map((x: any) => OrderService.convert(x)),\n salesPersonId: order.ansvarligSelgerID,\n valueChainStatus: order.valueChainStatus,\n customerNumber: order.kundenr,\n projectName: order.projectName,\n calculationName: order.calculationName,\n constructionName: order.constructionName,\n };\n }\n}\n","import { CreateEmployeeMessage } from \"@frontend/common/src/types/EmployeeMessage\";\nimport { Employee } from \"@frontend/common/src/types/Employee\";\nimport { BaseService } from \"../BaseService\";\nimport { endpoints } from \"../endpoints\";\nimport { IEmployeeService } from \"./IEmployeeService\";\n\nexport class EmployeeService extends BaseService implements IEmployeeService {\n async sendMessage(\n createEmployeeMessage: CreateEmployeeMessage,\n customerId: number\n ): Promise<any> {\n return await this.makeRequest(endpoints.employee.sendMessage, {\n employeeId: createEmployeeMessage.employeeId,\n melding: createEmployeeMessage.message,\n referanseId: createEmployeeMessage.referenceId,\n referanseType: createEmployeeMessage.referenceType,\n customerId,\n }).then((r) => r.data);\n }\n\n async getAll(): Promise<Employee[]> {\n const results: any[] = await this.makeRequest(\n endpoints.employee.getAll\n ).then((r) => r.data);\n const fixed = results.map(EmployeeService.convert);\n return fixed;\n }\n\n static convert(employee: any): Employee {\n return {\n id: employee.ansattID,\n name: employee.ansattNavn,\n email: employee.ansattEpost,\n phone: employee.ansattMobil,\n isEngieer: employee.ingenior !== 0,\n isSalesEngineer: employee.ingenior_Salg !== 0,\n hide: employee.skjul === 1,\n isSales: employee.salgssjef !== 0,\n isAdmin: employee.crM_Admin !== 0,\n photoUrl: employee.doC_ID\n ? `https://www.pretre.no/prod_images/doc_${employee.doC_ID}_13.jpg`\n : null,\n };\n }\n}\n","import {\n CustomerEmployee,\n UpdateCustomerEmployee,\n} from \"@frontend/common/src/types/CustomerEmployee\";\nimport { BaseService } from \"../BaseService\";\nimport { endpoints } from \"../endpoints\";\nimport { ICustomerEmployeeService } from \"./ICustomerEmployeeService\";\n\nexport class CustomerEmployeeService\n extends BaseService\n implements ICustomerEmployeeService\n{\n async getAllForCustomerId(customerId: string): Promise<CustomerEmployee[]> {\n const results: any[] = await this.makeRequest(\n endpoints.customerEmployee.getAll,\n { customerId }\n ).then((r) => r.data);\n return results.map(CustomerEmployeeService.convert);\n }\n\n async getByUserName(username: string): Promise<CustomerEmployee> {\n const results: any = await this.makeRequest(endpoints.auth.getByUsername, {\n username,\n }).then((r) => r.data);\n return CustomerEmployeeService.convert(results);\n }\n\n async update(\n customerId: string,\n customerEmployee: UpdateCustomerEmployee,\n loggedInEmail: string\n ): Promise<boolean> {\n return await this.makeRequest(endpoints.customerEmployee.update, {\n customerId,\n employeeId: customerEmployee.id,\n kundenr: customerId,\n kontakt_Navn: customerEmployee.name,\n kontakt_Epost: customerEmployee.email,\n kontakt_Telefon: customerEmployee.phone,\n kontakt_Mobiltlf: customerEmployee.mobile,\n kontakt_Stilling: customerEmployee.position,\n kontakt_BlokkerPortaltilgang: !customerEmployee.active,\n kontakt_Slutta: customerEmployee.hasQuit,\n passord: customerEmployee.password,\n nyttPassord: customerEmployee.newPassword,\n loggedInEmail,\n }).then((r) => r.data);\n }\n\n async create(\n customerId: string,\n customerEmployee: UpdateCustomerEmployee\n ): Promise<CustomerEmployee> {\n return await this.makeRequest(endpoints.customerEmployee.create, {\n customerId,\n kontakt_Navn: customerEmployee.name,\n kontakt_Epost: customerEmployee.email,\n kontakt_Telefon: customerEmployee.phone,\n kontakt_Mobiltlf: customerEmployee.mobile,\n kontakt_Stilling: customerEmployee.position,\n kontakt_Passord_Portal: customerEmployee.newPassword,\n }).then((r) => r.data);\n }\n\n async resetPassword(\n customerId: string,\n customerEmployeeId: number\n ): Promise<void> {\n return await this.makeRequest(endpoints.customerEmployee.resetPassword, {\n customerId,\n customerEmployeeId,\n }).then((r) => r.data);\n }\n\n static convert(employee: any): CustomerEmployee {\n return {\n id: employee.kontaktID,\n name: employee.kontakt_Navn,\n email: employee.kontakt_Epost,\n phone: employee.kontakt_Telefon,\n mobile: employee.kontakt_Mobiltlf,\n position: employee.kontakt_Stilling,\n active: !employee.kontakt_BlokkerPortaltilgang,\n hasQuit: employee.kontakt_Slutta,\n customerId: employee.kundenr,\n hasPassword: employee.hasPassword,\n };\n }\n}\n","import { BuildingType } from \"../../../types/BuildingType\";\nimport { OfferOption } from \"../../../types/OfferOption\";\nimport { TechnicalService } from \"../../../types/TechnicalService\";\nimport { BaseService } from \"../BaseService\";\nimport { endpoints } from \"../endpoints\";\nimport { ILookupsService } from \"./ILookupsService\";\n\ntype LookupResponse = {\n byggTyper: any[];\n tilbudsvalg: any[];\n tekniskeTjenester: any[];\n tilbudsStatuser: any[];\n ordreStatuser: any[];\n};\nexport class LookupsService extends BaseService implements ILookupsService {\n async getLookups(): Promise<{\n buildingTypes: BuildingType[];\n offerOptions: OfferOption[];\n technicalServices: TechnicalService[];\n orderStatuses: any[];\n offerStatuses: any[];\n }> {\n const results: LookupResponse = await this.makeRequest(\n endpoints.lookups.getLookups\n ).then((r) => r.data);\n\n return {\n buildingTypes: results.byggTyper.map(LookupsService.convertBuildingType),\n offerOptions: results.tilbudsvalg.map(LookupsService.convertOfferOption),\n technicalServices: results.tekniskeTjenester,\n orderStatuses: results.ordreStatuser,\n offerStatuses: results.tilbudsStatuser,\n };\n }\n\n async getCountyForZipcode(zipcode: string): Promise<string> {\n return await this.makeRequest(endpoints.lookups.zipcodeLookup, {\n zipcode,\n }).then((r) => r.data.poststed);\n }\n\n async getConfigValue(configKey: string): Promise<string> {\n return await this.makeRequest(endpoints.lookups.getConfigValue, {\n configKey,\n }).then((r) => r.data);\n }\n\n static convertOfferOption(o: any): OfferOption {\n return {\n id: o.id,\n description: o.beskrivelse,\n note: o.notat,\n type: o.type,\n };\n }\n\n static convertBuildingType(b: any): BuildingType {\n return {\n id: b.id,\n typeNr: b.byggTypeNr,\n name: b.byggtype,\n };\n }\n}\n","import { Customer } from \"@frontend/common/src/types/Customer\";\nimport { BaseService } from \"../BaseService\";\nimport { endpoints } from \"../endpoints\";\nimport { ICustomerService } from \"./ICustomerService\";\n\nexport class CustomerService extends BaseService implements ICustomerService {\n async updateCustomer(customer: Customer): Promise<boolean> {\n return await this.makeRequest(endpoints.customer.update, {\n customerId: customer.id,\n adresse: customer.address,\n postnummer: customer.zipcode,\n epost: customer.email,\n epostBestillingsbekreftelse: customer.orderConfimEmail || null,\n epostOrdrebekreftelse: customer.orderConfrimEmailAlt || null,\n epostTegninger: customer.drawingsEmail || null,\n });\n }\n\n async getById(customerId: string): Promise<Customer> {\n const results: any = await this.makeRequest(endpoints.customer.getById, {\n customerId,\n }).then((r) => r.data);\n return CustomerService.convert(results);\n }\n\n async getByToken(): Promise<Customer[]> {\n const results: any = await this.makeRequest(\n endpoints.customer.getForToken\n ).then((r) => r.data);\n return results.map((x: Customer) => CustomerService.convert(x));\n }\n\n static convert(customer: any): Customer {\n return {\n id: customer.kundenr,\n name: customer.kundenavn,\n address: customer.adresse1,\n zipcode: customer.postnrk,\n city: customer.poststed,\n email: customer.epost,\n drawingsEmail: customer.epost_Tegninger,\n orderConfimEmail: customer.epost_Bestillingsbekreftelse,\n orderConfrimEmailAlt: customer.epost_Ordrebekreftelse,\n phone: customer.telefon,\n constructionInformation: customer.std_konstr_opplysn,\n salesPersonId: customer.ansvarligSelger_ID,\n };\n }\n}\n","/* eslint-disable no-underscore-dangle */\nimport page from \"page\";\nimport axios from \"axios\";\n\nimport Toastify from \"toastify-js\";\nimport { RouteContext } from \"@frontend/common/src/types/RouteContext\";\nimport { AuthService } from \"../services/pretreAPI/Auth/AuthService\";\nimport { OrderService } from \"../services/pretreAPI/order/OrderService\";\nimport \"toastify-js/src/toastify.css\";\nimport { EmployeeService } from \"../services/pretreAPI/employee/EmployeeService\";\nimport { CustomerEmployeeService } from \"../services/pretreAPI/customerEmployee/CustomerEmployeeService\";\nimport { LookupsService } from \"../services/pretreAPI/lookups/LookupsService\";\nimport { CustomerService } from \"../services/pretreAPI/customer/CustomerService\";\n\nimport { PreTreColors } from \"../styles/constants\";\nimport { fetchCms } from \"../services/cms/CMS\";\n\nexport const cms = {\n fetch: fetchCms,\n};\n\nexport const api = {\n auth: new AuthService(),\n order: new OrderService(),\n employees: new EmployeeService(),\n customerEmployee: new CustomerEmployeeService(),\n lookups: new LookupsService(),\n customer: new CustomerService(),\n};\n\nexport const router = {\n route(\n url: string,\n action: (payload: RouteContext<{} | void>, next: any) => void\n ) {\n page(url, ({ params, path, pathname, routePath }, next) => {\n action({ params, path, pathname, routePath }, next);\n });\n },\n redirect: page.redirect,\n start: () =>\n page.start({\n click: true,\n }),\n navigateTo: (path: string) => page(path),\n};\n\nexport const tokenService = {\n get: () => {\n const token = localStorage.getItem(\"api_token\") || null;\n axios.defaults.headers.common.Authorization = `Bearer ${token}`;\n return token;\n },\n set: (token: string) => {\n localStorage.setItem(\"api_token\", token);\n axios.defaults.headers.common.Authorization = `Bearer ${token}`;\n },\n clear: () => {\n localStorage.removeItem(\"api_token\");\n axios.defaults.headers.common.Authorization = \"\";\n },\n};\n\nexport const localFileStorage = {\n // @ts-ignore\n _files: undefined,\n set: (files: File[]) => {\n localFileStorage._files = files;\n },\n get: () => localFileStorage._files,\n};\n\nexport const toast = (text: string, duration: number = 3000) => {\n Toastify({\n text,\n duration,\n gravity: \"bottom\",\n backgroundColor: PreTreColors.pretre,\n }).showToast();\n};\n\nexport const persistentCache = {\n get: (key: string, defaultValue: any = null): any => {\n return localStorage.getItem(key) || defaultValue;\n },\n set: (key: string, value: any): void => {\n localStorage.setItem(key, value);\n },\n remove: (key: string): void => {\n return localStorage.removeItem(key);\n },\n clear: (): void => {\n localStorage.clear();\n },\n};\n","import { CMSArticle } from \"@frontend/common/src/types/CMSArticle\";\n\nexport const fetchCms = (\n url: string\n): Promise<{ [index: number]: CMSArticle }> => {\n return fetch(url)\n .then((r) => r.text())\n .then((r) => {\n const parser = new DOMParser();\n const xmlDoc = parser.parseFromString(r, \"text/xml\");\n const nodes = xmlDoc.evaluate(\n \"/ROOT/DATA/ARRAY\",\n xmlDoc,\n null,\n XPathResult.ANY_TYPE,\n null\n );\n const blobs: { [index: number]: CMSArticle } = {};\n let result = nodes.iterateNext();\n while (result) {\n let id: number = null;\n let value: string = null;\n let title: string = null;\n result.childNodes.forEach((element) => {\n if (element.nodeName === \"DOC_ID\") {\n id = parseInt(element.textContent, 10);\n }\n if (element.nodeName === \"TITLE\") {\n title = element.textContent;\n }\n if (element.nodeName === \"CONTENT\") {\n value = element.textContent;\n }\n });\n blobs[id] = {\n title,\n content: value,\n };\n result = nodes.iterateNext();\n }\n return blobs;\n });\n};\n","import styled from \"styled-components\";\nimport { PreTreColors } from \"../../styles/constants\";\n\nexport const Wrapper = styled.div`\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n display: flex;\n justify-content: center;\n align-items: center;\n opacity: 1;\n transition: opacity 0.25s ease-in;\n z-index: 30;\n`;\n\nexport const Backdrop = styled.div`\n position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background-color: ${PreTreColors.redbrown};\n opacity: 0.3;\n z-index: -1;\n animation: fadeIn 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;\n`;\n\nexport const Container = styled.div`\n animation: blowUpModal 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;\n max-width: 80vw;\n max-height: 90vh;\n background: ${PreTreColors.weakBrite};\n z-index: 4;\n padding: 1rem 1rem 1rem 1rem;\n border-radius: 8px;\n overflow: hidden;\n\n box-sizing: content-box;\n\n @media (min-width: 320px) {\n min-width: 320px;\n }\n\n @media (max-width: 320px) {\n margin: 0 5px;\n padding: 36px 15px;\n width: inherit;\n }\n`;\n\nexport const InnerContainer = styled.div`\n overflow-x: hidden;\n overflow-y: auto;\n height: 100%;\n width: 100%;\n max-height: calc(95vh);\n max-width: inherit;\n`;\n","import styled from \"styled-components\";\nimport { PreTreColors } from \"../../styles/constants\";\n\ntype Props = {\n theme?: string;\n type?: string;\n};\n\nexport const Heading = styled(\"h1\")<Props>`\n font-size: ${(props: Props) =>\n props.type === \"secondary\" ? \"1.25rem\" : \"2.625rem\"};\n font-weight: 700;\n color: ${(props: Props) =>\n props.theme === \"light\" ? \"white\" : PreTreColors.beis};\n font-family: \"Kumbh Sans Normal\", sans-serif;\n line-height: normal;\n`;\n","// eslint-disable-next-line no-shadow\nexport enum OfferOptionType {\n ROOF = 1,\n ROOFING = 2,\n JOIST_TYPE = 3,\n JOISTING = 4,\n PRECUT_DIMENSION = 5,\n SUBMERGE_WETROOM = 6,\n}\n\nexport type OfferOption = {\n id: number;\n description: string;\n note: string;\n type: number;\n};\n","import React, { FunctionComponent } from \"react\";\nimport { Heading } from \"./Header.styles\";\n\ntype Props = {\n rest?: any;\n type?: string;\n theme?: string;\n};\nexport const Header: FunctionComponent<Props> = ({\n children,\n type,\n theme,\n ...rest\n}) => {\n return (\n <Heading theme={theme} type={type} {...rest}>\n {children}\n </Heading>\n );\n};\n","import React, { FunctionComponent, useRef } from \"react\";\nimport { Backdrop, Container, InnerContainer, Wrapper } from \"./Modal.styles\";\nimport { useKeyDown } from \"../../hooks/useKeyDown\";\nimport { useOnClickOutside } from \"../../hooks/useOnClickOutside\";\nimport { Header } from \"../../elements/Header/Header\";\n\ntype Props = {\n children: any;\n isOpen: boolean;\n onClose: any;\n title?: string;\n};\n\nconst Modal: FunctionComponent<Props> = ({\n title,\n children,\n isOpen,\n onClose,\n}) => {\n const ref = useRef();\n const scrollRef = useRef<HTMLDivElement>();\n\n useKeyDown(() => {\n if (ref.current) {\n onClose();\n }\n }, [27]);\n\n useOnClickOutside(ref, () => {\n onClose();\n });\n\n if (!isOpen) {\n return null;\n }\n return (\n <Wrapper>\n <Backdrop />\n <Container id=\"mainmodal\" ref={ref}>\n <InnerContainer ref={scrollRef}>\n {title && <Header>{title}</Header>}\n {children}\n </InnerContainer>\n </Container>\n </Wrapper>\n );\n};\n\nexport default Modal;\n","import { useEffect } from \"react\";\n\nexport function useKeyDown(callback: () => void, keysToListenTo: number[]) {\n useEffect(() => {\n function onKeyDown(e: any) {\n if (keysToListenTo.indexOf(e.which) !== -1) {\n callback();\n }\n }\n document.addEventListener(\"keydown\", onKeyDown);\n return () => document.removeEventListener(\"keydown\", onKeyDown);\n });\n}\n","import { useEffect } from \"react\";\n\n// https://usehooks.com/useOnClickOutside/\nexport function useOnClickOutside(ref: any, handler: any) {\n useEffect(\n () => {\n const listener = (event: any) => {\n // Do nothing if clicking ref's element or descendent elements. Also checks for Material UI menu.\n if (\n !ref.current ||\n ref.current.contains(event.target) ||\n event.target.closest(\".MuiDialog-root\") !== null ||\n event.target.closest(\".MuiPopover-root\") !== null\n ) {\n return;\n }\n\n handler(event);\n };\n\n document.addEventListener(\"mousedown\", listener);\n document.addEventListener(\"touchstart\", listener);\n\n return () => {\n document.removeEventListener(\"mousedown\", listener);\n document.removeEventListener(\"touchstart\", listener);\n };\n }, // ... but to optimize you can wrap handler in useCallback before ... // ... callback/cleanup to run every render. It's not a big deal ... // ... function on every render that will cause this effect ... // It's worth noting that because passed in handler is a new ... // Add ref and handler to effect dependencies\n // ... passing it into this hook.\n [ref, handler]\n );\n}\n","export default __webpack_public_path__ + \"static/media/Mellometasje.ed6a3eae.png\";","import React, { FunctionComponent } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { FormInput } from \"@frontend/common/src/elements/FormInput/FormInput\";\nimport { Select } from \"../../components/Select/Select\";\nimport Logo from \"../../assets/img/Mellometasje.png\";\nimport { OfferOptionType } from \"../../types/OfferOption\";\nimport { ExtendedPrecut } from \"../../types/DraftOrder/ExtendedPrecut\";\nimport { useAppState } from \"../../overmind\";\nimport { BlockButton } from \"../../components/Buttons/Buttons.styles\";\n\ninterface PrecutModalFormProps {\n setPlans: (plans: ExtendedPrecut[]) => void;\n plans: ExtendedPrecut[];\n setSelectedPlan: (plans: ExtendedPrecut) => void;\n selectedPlan: ExtendedPrecut | undefined;\n setFormActive: (active: boolean) => void;\n}\n\nconst svills = [\n {\n label: \"36mm\",\n value: \"36mm\",\n },\n {\n label: \"2x36mm\",\n value: \"2x36mm\",\n },\n {\n label: \"48mm\",\n value: \"48mm\",\n },\n {\n label: \"2x48mm\",\n value: \"2x48mm\",\n },\n];\nconst PrecutModalForm: FunctionComponent<PrecutModalFormProps> = ({\n setPlans,\n plans,\n selectedPlan,\n setSelectedPlan,\n setFormActive,\n}) => {\n const { modals, offerOptions } = useAppState();\n\n const dimensions = offerOptions\n .filter((o) => o.type === OfferOptionType.PRECUT_DIMENSION)\n .map((o) => ({ label: o.description, value: o.description }));\n\n const onSubmit = (data: ExtendedPrecut) => {\n if (selectedPlan !== undefined) {\n const newPlans = plans.map((x) => {\n if (x.name === data.name) {\n return {\n ...x,\n bruttoVegghoyde: data.bruttoVegghoyde,\n hoydeOverkantApning: data.hoydeOverkantApning,\n dimensjonToppsvill: data.dimensjonToppsvill,\n dimensjonStender: data.dimensjonStender,\n dimensjonBunnsvill: data.dimensjonBunnsvill,\n klaringTilKarm: data.klaringTilKarm,\n biv1: data.biv1,\n dimToppsvill1: data.dimToppsvill1,\n dimBunnsvill1: data.dimBunnsvill1,\n biv2: data.biv2,\n dimToppsvill2: data.dimToppsvill2,\n dimBunnsvill2: data.dimBunnsvill2,\n biv3: data.biv3,\n dimToppsvill3: data.dimToppsvill3,\n dimBunnsvill3: data.dimBunnsvill3,\n };\n }\n return x;\n });\n setPlans(newPlans);\n } else {\n const newPlan = {\n ...data,\n name: `Plan ${plans.length + 1}`,\n projectId: modals.precutModal.projectId,\n };\n setPlans([...plans, newPlan]);\n }\n setSelectedPlan(undefined);\n setFormActive(false);\n };\n const onCancel = () => {\n setFormActive(false);\n setSelectedPlan(undefined);\n };\n const { register, handleSubmit } = useForm<ExtendedPrecut>({\n defaultValues: selectedPlan,\n });\n return (\n <form onSubmit={handleSubmit(onSubmit)} style={{ width: \"100%\" }}>\n <div style={{ display: \"flex\" }}>\n <div>\n <input ref={register} type=\"hidden\" name=\"projectId\" />\n <input ref={register} type=\"hidden\" name=\"name\" />\n <FormInput\n label=\"Brutto vegghøyde\"\n type=\"number\"\n name=\"bruttoVegghoyde\"\n suffix=\"mm\"\n inputRef={register}\n />\n <FormInput\n label=\"Høyde overkant åpning\"\n type=\"number\"\n name=\"hoydeOverkantApning\"\n suffix=\"mm\"\n inputRef={register}\n />\n <Select\n name=\"dimensjonToppsvill\"\n label=\"Dimensjon toppsvill\"\n options={svills}\n inputRef={register}\n />\n <Select\n name=\"dimensjonStender\"\n label=\"Dimensjon stender\"\n options={dimensions}\n inputRef={register}\n />\n <Select\n name=\"dimensjonBunnsvill\"\n label=\"Dimensjon bunnsvill\"\n options={svills}\n inputRef={register}\n />\n <FormInput\n label=\"Klaring til karm\"\n type=\"number\"\n name=\"klaringTilKarm\"\n suffix=\"mm\"\n inputRef={register}\n />\n </div>\n <div>\n <img style={{ margin: \"0.5rem\" }} src={Logo} alt=\"logo\" />\n </div>\n <div\n style={{\n display: \"flex\",\n alignContent: \"center\",\n alignItems: \"center\",\n flexDirection: \"column\",\n justifyContent: \"center\",\n width: \"30%\",\n }}\n >\n <BlockButton style={{ marginBottom: \"2em\" }} type=\"submit\">\n {selectedPlan !== undefined\n ? ` Oppdater ${selectedPlan.name}`\n : `Legg til Plan ${plans.length + 1}`}\n </BlockButton>\n <BlockButton onClick={() => onCancel()} type=\"button\">\n Avbryt\n </BlockButton>\n </div>\n </div>\n <div style={{ fontSize: \"1.125rem\", fontWeight: \"bolder\" }}>\n Bærende innervegger:\n </div>\n <div\n style={{\n width: \"100%\",\n display: \"flex\",\n alignContent: \"flex-start\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n }}\n >\n <Select\n align\n selectWidth=\"12em\"\n name=\"biv1\"\n label=\"Dimensjon stender\"\n options={dimensions}\n inputRef={register}\n />\n <Select\n selectWidth=\"12em\"\n name=\"biv2\"\n options={dimensions}\n inputRef={register}\n />\n <Select\n selectWidth=\"12em\"\n name=\"biv3\"\n options={dimensions}\n inputRef={register}\n />\n </div>\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n marginLeft: \"4em\",\n }}\n >\n <Select\n align\n selectWidth=\"12em\"\n name=\"dimToppsvill1\"\n label=\"Dimensjon toppsvill\"\n options={svills}\n inputRef={register}\n />\n <Select\n selectWidth=\"12em\"\n name=\"dimToppsvill2\"\n options={svills}\n inputRef={register}\n />\n <Select\n selectWidth=\"12em\"\n name=\"dimToppsvill3\"\n options={svills}\n inputRef={register}\n />\n </div>\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n marginLeft: \"4em\",\n }}\n >\n <Select\n align\n selectWidth=\"12em\"\n name=\"dimBunnsvill1\"\n label=\"Dimensjon bunnsvill\"\n options={svills}\n inputRef={register}\n />\n <Select\n selectWidth=\"12em\"\n name=\"dimBunnsvill2\"\n options={svills}\n inputRef={register}\n />\n <Select\n selectWidth=\"12em\"\n name=\"dimBunnsvill3\"\n options={svills}\n inputRef={register}\n />\n </div>\n </div>\n </form>\n );\n};\n\nexport default PrecutModalForm;\n","import React, { FunctionComponent } from \"react\";\nimport { BlockButton } from \"@frontend/common/src/elements/Buttons/Buttons.styles\";\nimport { ExtendedPrecut } from \"../../types/DraftOrder/ExtendedPrecut\";\nimport { PreTreColors } from \"../../styles/constants\";\n\ninterface props {\n setPlans: (plans: ExtendedPrecut[]) => void;\n plans: ExtendedPrecut[];\n selectedPlan: ExtendedPrecut;\n setSelectedPlan: (plan: ExtendedPrecut) => void;\n setFormActive: (form: boolean) => void;\n autoFill: boolean;\n}\nexport const PrecutPlans: FunctionComponent<props> = ({\n plans,\n setPlans,\n selectedPlan,\n setSelectedPlan,\n setFormActive,\n autoFill,\n}) => {\n const deleteProject = (plan: ExtendedPrecut) => {\n if (autoFill) {\n const precuts = plans.filter((x) => x.name !== plan.name);\n setPlans([...precuts, { ...plan, deleted: true }]);\n } else {\n const projects = plans.filter((x) => x.name !== plan.name);\n setPlans(projects);\n }\n };\n /*\n const unDeleteProject = (subProject: DraftOrderSubProject) => {\n const map = subProjects.map((x) => {\n if (x.projectId === subProject.projectId) {\n return {\n ...x,\n deleted: false,\n };\n }\n return x;\n });\n setSubProjects(map);\n };\n\n */\n const onClickPlan = (plan: ExtendedPrecut) => {\n if (plan.deleted !== true) {\n setSelectedPlan(plan);\n setFormActive(true);\n }\n };\n return (\n <div\n style={{\n width: \"20vw\",\n backgroundColor: PreTreColors.borderlineGray,\n borderRadius: \"10px\",\n minHeight: \"50vh\",\n maxHeight: \"50vh\",\n }}\n >\n <div\n style={{\n backgroundColor: PreTreColors.pretre,\n color: \"white\",\n fontSize: \"1.2rem\",\n padding: \"15px 0\",\n borderRadius: \"10px\",\n textAlign: \"center\",\n height: \"3.5em\",\n }}\n >\n Etasjehøyder\n </div>\n <div style={{ overflowY: \"auto\", maxHeight: \"45vh\" }}>\n {plans.map((plan) => {\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n padding: \"1em\",\n }}\n key={plan.name}\n >\n <div\n style={{\n backgroundColor: selectedPlan === plan ? \"gray\" : \"white\",\n display: \"flex\",\n justifyContent: \"space-between\",\n color: plan.deleted !== true ? \"black\" : \"gray\",\n padding: \"1em\",\n borderRadius: \"10px\",\n }}\n >\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */}\n <div\n style={{ display: \"flex\", flexDirection: \"column\", flex: 1 }}\n onClick={() => onClickPlan(plan)}\n >\n <span\n style={{ fontSize: \"1.2rem\", textDecoration: \"underline\" }}\n >\n {plan.name}\n </span>\n </div>\n\n <BlockButton\n type=\"button\"\n style={{ width: \"20%\", height: \"2.5em\" }}\n onClick={() => deleteProject(plan)}\n >\n Fjern\n </BlockButton>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n );\n};\n","import React, { FunctionComponent, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport Modal from \"@frontend/common/src/components/Modal/Modal\";\nimport { useActions, useAppState } from \"../../overmind\";\nimport {\n BlockButton,\n LinkButton,\n} from \"../../components/Buttons/Buttons.styles\";\nimport { ExtendedPrecut } from \"../../types/DraftOrder/ExtendedPrecut\";\nimport PrecutModalForm from \"./PrecutModalForm\";\nimport { PrecutPlans } from \"./PrecutPlans\";\n\nexport const PrecutModal: FunctionComponent = () => {\n const { modals } = useAppState();\n const { t } = useTranslation();\n const [plans, setPlans] = useState<ExtendedPrecut[]>([]);\n const [selectedPlan, setSelectedPlan] = useState<ExtendedPrecut | undefined>(\n undefined\n );\n const [formActive, setFormActive] = useState<boolean>(true);\n const { modals: modalsActions } = useActions();\n\n if (!modals.precutModal.isCurrent) {\n return null;\n }\n\n const onSubmit = () => {\n modalsActions.precutModal.close(plans);\n };\n return (\n <Modal\n isOpen={modals.precutModal.isCurrent}\n onClose={() => modalsActions.precutModal.close(null)}\n >\n <div\n style={{\n width: \"80vw\",\n display: \"flex\",\n flexDirection: \"column\",\n minHeight: \"90vh\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n flexDirection: \"row\",\n minHeight: \"85vh\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"space-between\",\n }}\n >\n <PrecutPlans\n setPlans={setPlans}\n plans={plans}\n selectedPlan={selectedPlan}\n setSelectedPlan={setSelectedPlan}\n setFormActive={setFormActive}\n autoFill={false}\n />\n <BlockButton\n onClick={() => setFormActive(true)}\n disabled={formActive}\n >\n Legg til plan\n </BlockButton>\n </div>\n <div style={{ display: \"flex\", flex: \"1\", marginLeft: \"4em\" }}>\n {formActive && (\n <PrecutModalForm\n plans={plans}\n setPlans={setPlans}\n selectedPlan={selectedPlan}\n setFormActive={setFormActive}\n setSelectedPlan={setSelectedPlan}\n />\n )}\n </div>\n </div>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"space-evenly\",\n justifySelf: \"flex-end\",\n width: \"100%\",\n }}\n >\n <div style={{ display: \"flex\", width: \"20%\" }}>\n <BlockButton type=\"button\" onClick={() => onSubmit()}>\n {t(\"Done\")}\n </BlockButton>\n <LinkButton\n as=\"a\"\n onClick={() => modalsActions.precutModal.close(null)}\n >\n {t(\"Avbryt\")}\n </LinkButton>\n </div>\n </div>\n </div>\n </Modal>\n );\n};\n","import styled from \"styled-components\";\nimport { PreTreColors } from \"../../styles/constants\";\n\nimport { baseInputStyles } from \"../../styles/baseInput\";\n\ntype Props = {\n error?: boolean;\n};\nexport const Input = styled(\"input\")<Props>`\n ${baseInputStyles}\n display: inline-block;\n position: relative;\n width: 100%;\n ::placeholder {\n color: ${PreTreColors.beis};\n opacity: 0.7;\n }\n`;\nexport const InputWrapper = styled(\"div\")`\n width: 100%;\n`;\nexport const Suffix = styled(\"span\")`\n width: 100%;\n justify-content: end;\n`;\n","import React, { ChangeEvent, FunctionComponent } from \"react\";\nimport { Input } from \"./FileInput.styles\";\nimport { Label } from \"../Label/Label\";\nimport { FormControl, Error } from \"../FormControl/FormControl\";\nimport { RequiredFieldIndicator } from \"../RequiredFieldIndicator/RequiredFieldIndicator\";\n\ntype Props = {\n htmlFor?: string;\n label?: string;\n name: string;\n inputRef?: any;\n error?: any;\n required?: boolean;\n onChange?: (value: FileList) => void;\n multiple?: any;\n};\n\nexport const FileInput: FunctionComponent<Props> = ({\n htmlFor,\n label,\n name,\n inputRef,\n error,\n required,\n onChange,\n multiple,\n}) => {\n return (\n <FormControl>\n <Label htmlFor={htmlFor}>\n {label || null}\n {required ? <RequiredFieldIndicator /> : \"\"}\n </Label>\n <Input\n name={name}\n type=\"file\"\n ref={inputRef}\n error={!!error}\n multiple={multiple}\n onChange={(e: ChangeEvent<HTMLInputElement>) =>\n onChange ? onChange(e.target.files) : () => {}\n }\n />\n {error ? <Error>{error}</Error> : null}\n </FormControl>\n );\n};\n","import React, { FunctionComponent, useState } from \"react\";\nimport { FileInput } from \"@frontend/common/src/elements/FileInput/FileInput\";\nimport { useTranslation } from \"react-i18next\";\nimport Modal from \"@frontend/common/src/components/Modal/Modal\";\nimport { useActions, useAppState } from \"../../overmind\";\nimport {\n BlockButton,\n LinkButton,\n} from \"../../components/Buttons/Buttons.styles\";\n\nexport const FileUploadModal: FunctionComponent = () => {\n const { modals } = useAppState();\n\n const { modals: modalsActions } = useActions();\n\n const { t } = useTranslation();\n\n const [files, setFiles] = useState<File[]>([]);\n\n if (!modals.fileUploadModal.isCurrent) {\n return null;\n }\n const addFiles = (f: FileList) => {\n const file = files.concat(Array.from(f));\n setFiles(file);\n };\n const removeFile = (name: string) => {\n setFiles(files.filter((x) => x.name !== name));\n };\n return (\n <Modal\n isOpen={modals.fileUploadModal.isCurrent}\n onClose={() => modalsActions.fileUploadModal.close(null)}\n >\n <div\n style={{\n minHeight: \"20vh\",\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"space-between\",\n }}\n >\n <FileInput\n name=\"upload\"\n label={t(\"Attach document\")}\n multiple\n onChange={(f) => {\n addFiles(f);\n }}\n />\n {files.map((x) => {\n return (\n <div style={{ marginBottom: \"0.5em\" }}>\n <button\n type=\"button\"\n onClick={() => removeFile(x.name)}\n style={{ marginRight: \"2em\" }}\n >\n Fjern fil\n </button>\n {x.name}\n </div>\n );\n })}\n <div style={{ display: \"flex\", justifySelf: \"flex-end\" }}>\n <BlockButton\n type=\"button\"\n onClick={() => modalsActions.fileUploadModal.close(files)}\n >\n {t(\"Done\")}\n </BlockButton>\n <LinkButton\n as=\"a\"\n onClick={() => modalsActions.fileUploadModal.close(null)}\n >\n {t(\"Avbryt\")}\n </LinkButton>\n </div>\n </div>\n </Modal>\n );\n};\n","import styled from \"styled-components\";\n\nimport { PreTreColors } from \"../../../styles/constants\";\n\nexport const ColumnWrapper = styled(\"div\")`\n padding: 20px;\n width: 100%;\n max-width: 550px;\n`;\nexport const PageFlexConstraint = styled.div<{ itemWidth?: string }>`\n display: flex;\n flex-wrap: wrap;\n gap: 2rem;\n width: 100%;\n padding: 0 2rem 0 2rem;\n & > * {\n min-width: 300px;\n width: ${(props) => props.itemWidth ?? \"20vw\"};\n }\n`;\nexport const HeaderWrapper = styled(\"div\")`\n width: 100%;\n padding: 20px 0 0 20px;\n`;\nexport const Text = styled(\"p\")`\n font-size: 1.125rem;\n color: ${PreTreColors.beis};\n`;\nexport const BoldText = styled(\"p\")`\n font-size: 1.125rem;\n color: ${PreTreColors.beis};\n font-weight: bold;\n margin-top: 15px;\n`;\nexport const ButtonSectionWrapper = styled(\"div\")`\n max-width: 30vw;\n margin-left: 20px;\n`;\n\nexport const ButtonWrapper = styled(\"div\")`\n display: flex;\n justify-content: space-between;\n margin-left: 2em;\n width: 80%;\n @media (max-width: 1024px) {\n width: 100%;\n margin-left: 0;\n margin-top: 1em;\n }\n`;\n\nexport const StyledList = styled.li`\n list-style: none;\n margin: 0;\n padding: 0;\n &:before {\n content: \"-\";\n margin: 0 0.5rem;\n }\n`;\n\nexport const StyledSection = styled.section`\n display: flex;\n flex-direction: column;\n gap: 2rem;\n`;\n\nexport const ChooseProductPageMainContainer = styled.div`\n display: flex;\n min-height: 50vh;\n margin-top: 2em;\n margin-left: 2rem;\n @media (max-width: 1024px) {\n flex-direction: column;\n }\n`;\n","import React, { FunctionComponent } from \"react\";\n\ntype Props = {\n activeStep: any;\n steps: { title: string; slug: string }[];\n};\nexport const BreadCrumbs: FunctionComponent<Props> = ({\n activeStep,\n steps,\n}) => {\n return (\n <div\n style={{\n alignSelf: \"center\",\n padding: \"2rem\",\n color: \"white\",\n fontSize: \"1rem\",\n display: \"inherit\",\n }}\n >\n {steps.map((step, idx) => (\n <div key={idx}>\n <a\n style={{\n padding: \"0 0.5rem\",\n fontWeight:\n steps.indexOf(step) === activeStep ? \"bold\" : \"normal\",\n }}\n href={step.slug}\n >\n {step.title}\n </a>\n {steps.indexOf(step) < steps.length - 1 ? \">\" : \"\"}\n </div>\n ))}\n </div>\n );\n};\n","import * as yup from \"yup\";\n\nexport const string = yup.string();\nexport const boolean = yup.boolean();\nexport const requiredField = yup.string().required(\"Påkrevd\");\n\nexport const dateInFuture = yup\n .date()\n .typeError(\"Vennligst velg en dato\")\n .min(new Date(), \"Dato kan ikke være i fortiden\");\n\nconst nextWeek = new Date();\n\nnextWeek.setDate(nextWeek.getDate() + 13);\nexport const dateTwoWeekInFuture = yup\n .date()\n .when(\"preferredDeliveryDate\", (value) => {\n if (value && value instanceof Date && !Number.isNaN(value)) {\n return yup\n .date()\n .typeError(\"Vennligst velg en dato\")\n .min(nextWeek, \"Må være minst to uker frem i tid\");\n }\n return yup.string().optional();\n });\n\nexport const dateTwoWeekInFutureRequired = yup\n .date()\n .typeError(\"Vennligst velg en dato\")\n .min(nextWeek, \"Må være minst to uker frem i tid\")\n .required();\nexport const positiveNumeric = yup\n .number()\n .nullable()\n .transform((value, originalValue) =>\n String(originalValue).trim() === \"\" ? null : value\n )\n .typeError(\"Må være tall\")\n .positive(\"Vennligst velg en gyldig verdi\");\n\nexport const decimalField = yup\n .number()\n .nullable()\n .typeError(\"Må være tall\")\n .positive(\"Vennligst velg en gyldig verdi\")\n .transform((value: string, originalValue: string) => {\n if (String(originalValue).trim() === \"\") {\n return null;\n }\n return parseFloat(originalValue.replace(\",\", \".\"));\n })\n .min(0.0, \"Må være mellom 0 - 60\")\n .max(60.0, \"Må være mellom 0 - 60\")\n .typeError(\"Må være tall\");\n\nexport const positiveRequiredNumeric = positiveNumeric.required(\"Påkrevd\");\n\nexport const name = requiredField;\nexport const address = requiredField;\nexport const zipcode = requiredField;\nexport const city = requiredField;\nexport const email = yup.string().email();\nexport const requiredEmail = yup\n .string()\n .email()\n .required(\"Vennligst fyll inn epost\");\nexport const deliveryDate = yup\n .date()\n .typeError(\"Vennligst velg en gyldig dato\")\n .min(new Date(), \"Vennligst velg en gyldig dato\")\n .required(\"Vennligst velg en gyldig dato\");\nexport const customerOrderNumber = yup\n .number()\n .typeError(\"Vennligst fyll inn gyldig nummer\")\n .positive(\"Vennligst fyll inn et positivt nummer\")\n .required(\"Vennligst fyll inn kundens ordrenummer\");\n\nexport const heightAboveSeaLevel = yup\n .number()\n .typeError(\"Vennligst fyll inn gyldig nummer\")\n .positive(\"Vennligst fyll inn et positivt nummer\")\n .required(\"Vennligst fyll inn moh\");\n\nexport const phoneNumber8digits = yup\n .string()\n .max(8, \"Telefonnummer kan ikke være lengre enn 8 tegn\")\n .matches(/^\\d*$/, \"Vennligst fyll inn gyldig telefonnummer\");\n","import { Page } from \"@frontend/common/src/types/Page\";\nimport { OrderListPage } from \"../pages/order/OrderListPage/OrderListPage\";\nimport { ForgotPasswordPage } from \"../pages/Guest/ForgotPasswordPage/ForgotPasswordPage\";\nimport { LoginPage } from \"../pages/Guest/LoginPage/LoginPage\";\nimport { HomePage } from \"../pages/Home/HomePage\";\n\nimport { ViewOrderPage } from \"../pages/order/ViewOrderPage/ViewOrderPage\";\nimport { ViewOrderProjectPage } from \"../pages/order/ViewOrderProjectPage/ViewOrderProjectPage\";\nimport { TechnicalServicesPage } from \"../pages/TechnicalServicesPage/TechnicalServicesPage\";\nimport { CreateOrderPage } from \"../pages/order/CreateOrderPage/CreateOrderPage\";\nimport { UserPage } from \"../pages/user/UserPage\";\nimport { CompanyPage } from \"../pages/company/CompanyPage\";\nimport { DocumentationPage } from \"../pages/Documentation/DocumentationPage\";\n\nimport { ErrorPage } from \"../pages/error/ErrorPage\";\nimport Auth from \"../pages/Auth/Auth\";\nimport CompanySelectorPage from \"../pages/user/CompanySelectorPage\";\n\n// eslint-disable-next-line no-shadow\nexport enum PageAccess {\n GUEST,\n AUTH,\n}\n\ntype PageConfig = {\n component: any;\n restrictedTo: PageAccess | null;\n route: string;\n};\nexport const pages: { [index: string]: PageConfig } = {\n [Page.LOGIN]: {\n component: LoginPage,\n restrictedTo: PageAccess.GUEST,\n route: \"/logg-inn\",\n },\n [Page.RESET_PASSWORD]: {\n component: ForgotPasswordPage,\n restrictedTo: PageAccess.GUEST,\n route: \"/glemt-passord\",\n },\n\n [Page.HOME]: {\n component: HomePage,\n restrictedTo: null,\n route: \"/\",\n },\n\n [Page.TECHNICAL_SERVICES]: {\n component: TechnicalServicesPage,\n restrictedTo: PageAccess.AUTH,\n route: \"/tekniske-tjenester\",\n },\n\n [Page.ORDER_LIST]: {\n component: OrderListPage,\n restrictedTo: PageAccess.AUTH,\n route: \"/mine-prosjekt/:side?\",\n },\n [Page.VIEW_ORDER]: {\n component: ViewOrderPage,\n restrictedTo: PageAccess.AUTH,\n route: \"/mine-prosjekt/vis/:id\",\n },\n [Page.VIEW_ORDER_PROJECT]: {\n component: ViewOrderProjectPage,\n restrictedTo: PageAccess.AUTH,\n route: \"/mine-prosjekt/prosjekt/:id\",\n },\n\n [Page.CREATE_ORDER]: {\n component: CreateOrderPage,\n restrictedTo: PageAccess.AUTH,\n route: \"/nytt-prosjekt/:slug?\",\n },\n [Page.USER]: {\n component: UserPage,\n restrictedTo: PageAccess.AUTH,\n route: \"/profil\",\n },\n [Page.COMPANY]: {\n component: CompanyPage,\n restrictedTo: PageAccess.AUTH,\n route: \"/bedrift\",\n },\n [Page.DOCUMENTATION]: {\n component: DocumentationPage,\n restrictedTo: PageAccess.AUTH, // TODO Set this to ADMIN when implemented\n route: \"/dokumentasjon\",\n },\n [Page.ERROR]: {\n component: ErrorPage,\n restrictedTo: null,\n route: \"/error\",\n },\n [Page.EMULATE]: {\n restrictedTo: PageAccess.AUTH,\n route: \"/emulate/:customerId/:customerEmployeeId?\",\n component: null,\n },\n [Page.AUTH]: {\n restrictedTo: PageAccess.GUEST,\n route: \"/auth\",\n component: Auth,\n },\n [Page.CUSTOMER_SELECTOR]: {\n restrictedTo: PageAccess.AUTH,\n route: \"/kundevelger\",\n component: CompanySelectorPage,\n },\n};\n\nexport const getNavigationRoute = (page: Page): string => {\n const p = pages[page];\n\n if (!pages[page]) {\n throw new Error(`Page not found: ${page}`);\n }\n\n return p.route;\n};\n\nexport const createUrl = (\n page: Page,\n params: { [index: string]: string | number } = null\n): string => {\n const p = pages[page];\n\n if (!pages[page]) {\n throw new Error(`Page not found: ${page}`);\n }\n\n let { route } = p;\n if (params) {\n // eslint-disable-next-line guard-for-in,no-restricted-syntax\n for (const key in params) {\n route = route.replace(`:${key}`, params[key] as string); // replace required key\n route = route.replace(`:${key}?`, params[key] as string); // replace optional key\n }\n }\n\n route = route.replace(/:.+\\?/gi, \"\");\n route = route.replace(/\\/\\//gi, \"/\");\n\n return route;\n};\n","// TODO: kan ikke bruke i18next.t her..\nexport const yesNoOptions = [\n { label: \"Ja\", value: \"1\" },\n { label: \"Nei\", value: \"2\" },\n];\n","import styled from \"styled-components\";\nimport { PreTreColors } from \"../../styles/constants\";\n\nimport { baseInputStyles } from \"../../styles/baseInput\";\n\ntype Props = {\n error?: boolean;\n};\nexport const Input = styled(\"input\")<Props>`\n ${baseInputStyles}\n display: inline-block;\n position: relative;\n width: 100%;\n ::placeholder {\n color: ${PreTreColors.beis};\n opacity: 0.7;\n }\n &[disabled] {\n background-color: #ccc;\n }\n`;\nexport const InputWrapper = styled(\"div\")`\n width: 100%;\n`;\nexport const Suffix = styled(\"span\")`\n width: 100%;\n justify-content: end;\n`;\n","import React, { FunctionComponent, useEffect, useMemo, useState } from \"react\";\nimport { FormInput } from \"@frontend/common/src/elements/FormInput/FormInput\";\nimport { useForm } from \"react-hook-form\";\nimport { yupResolver } from \"@hookform/resolvers/yup\";\nimport * as yup from \"yup\";\nimport { useTranslation } from \"react-i18next\";\nimport { Label } from \"@frontend/common/src/elements/Label/Label\";\nimport {\n BlockButton,\n LinkButton,\n} from \"@frontend/common/src/elements/Buttons/Buttons.styles\";\nimport * as validators from \"@frontend/common/src/validators/index\";\nimport { Page } from \"@frontend/common/src/types/Page\";\nimport { DateFormat, formatDate } from \"@frontend/common/src/helpers/date\";\nimport { Header } from \"../../../elements/Header/Header\";\nimport { useActions, useAppState, useEffects } from \"../../../overmind\";\nimport { Select } from \"../../../components/Select/Select\";\n\nimport { createUrl } from \"../../../app/pages\";\nimport { PageFlexConstraint } from \"../ChooseProductPage/CreateOrderPage.styles\";\nimport { DraftOrder } from \"../../../types/DraftOrder/DraftOrder\";\nimport { yesNoOptions } from \"../../../data/selectOptions\";\nimport { InputWrapper } from \"../../../components/FormInput/FormInput.styles\";\n\nexport const CustomerInformation: FunctionComponent = () => {\n const { router } = useEffects();\n const actions = useActions();\n const state = useAppState();\n const effects = useEffects();\n const { t } = useTranslation();\n const [sameAddressSelection, setSameAddressSelection] = useState(\n yesNoOptions[0].value\n );\n const isSameAddress = useMemo(\n () =>\n sameAddressSelection ===\n yesNoOptions.find((opt) => opt.label === \"Ja\").value,\n [sameAddressSelection]\n );\n const customerInformationSchema = useMemo(() => {\n return yup.object().shape(\n {\n // Customer information\n customerContactId: validators.requiredField,\n marked: validators.requiredField,\n\n // Construction site\n deliveryAddress: validators.address,\n zipCode: validators.requiredField,\n city: validators.requiredField,\n // city: validators.requiredField, // not required.\n farmNumber: validators.positiveNumeric,\n subFarmNumber: validators.positiveNumeric,\n mamsl: validators.positiveNumeric,\n\n // deliveryAddressSameAsBuilding: validators.requiredField,\n arrivalSemi: !state.orders.currentNewOrder.quotation\n ? validators.requiredField\n : null,\n buildingType: !state.orders.currentNewOrder.quotation\n ? validators.requiredField\n : null,\n deliveryTerms: !state.orders.currentNewOrder.quotation\n ? validators.requiredField\n : null,\n preferredDeliveryDate: !state.orders.currentNewOrder.quotation\n ? validators.dateTwoWeekInFutureRequired\n : null,\n\n deliveryAddress2:\n !isSameAddress && !state.orders.currentNewOrder.quotation\n ? validators.requiredField\n : null,\n zipCode2:\n !isSameAddress && !state.orders.currentNewOrder.quotation\n ? validators.requiredField\n : null,\n city2:\n !isSameAddress && !state.orders.currentNewOrder.quotation\n ? validators.requiredField\n : null,\n\n contactPersonPhoneNr: validators.phoneNumber8digits,\n },\n [[\"preferredDeliveryDate\", \"preferredDeliveryDate\"]]\n );\n }, [isSameAddress, state.orders.currentNewOrder.quotation]);\n\n const { register, handleSubmit, errors, watch, setValue } =\n useForm<DraftOrder>({\n resolver: yupResolver(customerInformationSchema),\n defaultValues: {\n ...state.orders.autofill,\n customerContactId: state.orders.autofill?.customerContactId,\n preferredDeliveryDate: formatDate(\n state.orders.autofill?.preferredDeliveryDate,\n DateFormat.ISO_DATE\n ),\n ...state.orders.currentNewOrder,\n },\n });\n const streetAddress = watch(\"deliveryAddress\");\n const zipCode = watch(\"zipCode\");\n const zipCode2 = watch(\"zipCode2\");\n const city = watch(\"city\");\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const city2 = watch(\"city2\");\n\n const contactPersons: { label: string; value: any }[] = useMemo(() => {\n return state.customerEmployees\n .filter((c) => c.hasQuit === false)\n .map((c) => ({ label: `${c.name}`, value: c.id }));\n }, []);\n\n const deliveryOptions: { label: string; value: any }[] = useMemo(() => {\n return [\n { label: \"Hentes fabrikk\", value: \"Hentes fabrikk\" },\n {\n label: \"Pretre leverer ihht. standard\",\n value: \"Pretre leverer ihht. standard\",\n },\n ];\n }, []);\n\n const onSubmit = (data: DraftOrder) => {\n actions.orders.updateDraftOrder(data);\n router.navigateTo(createUrl(Page.CREATE_ORDER, { slug: \"produktvalg\" }));\n };\n\n useEffect(() => {\n if (zipCode && zipCode.length === 4) {\n effects.api.lookups\n .getCountyForZipcode(zipCode)\n .then((county) => {\n setValue(\"city\", county);\n })\n .catch(() => {});\n }\n }, [zipCode]);\n\n useEffect(() => {\n if (zipCode2 && zipCode2.length === 4) {\n effects.api.lookups\n .getCountyForZipcode(zipCode2)\n .then((county) => {\n setValue(\"city2\", county);\n })\n .catch(() => {});\n }\n }, [zipCode2]);\n\n const onDeliveryAddressSameAsBuildingChanged = (value: string) =>\n actions.orders.updateDraftOrder({\n deliveryAddressSameAsBuilding: value === \"1\",\n } as DraftOrder);\n\n useEffect(\n () => onDeliveryAddressSameAsBuildingChanged(sameAddressSelection),\n [sameAddressSelection]\n );\n\n return (\n <form onSubmit={handleSubmit(onSubmit)}>\n <PageFlexConstraint>\n <div>\n <Header type=\"secondary\">1. {t(\"Kundeinformasjon\")}</Header>\n <FormInput\n disabled\n label=\"Kundenavn\"\n type=\"text\"\n name=\"customerName\"\n defaultValue={state.customer.name}\n />\n <Select\n name=\"customerContactId\"\n required\n label=\"Kontaktperson\"\n options={contactPersons}\n inputRef={register}\n error={errors.customerContactId?.message}\n />\n <FormInput\n required\n label=\"Prosjektnavn\"\n type=\"text\"\n name=\"marked\"\n inputRef={register}\n error={errors.marked?.message}\n />\n <FormInput\n name=\"preferredDeliveryDate\"\n type=\"date\"\n label={t(\"Ønsket leveringsdato\")}\n inputRef={register}\n error={errors.preferredDeliveryDate?.message}\n required={!state.orders.currentNewOrder.quotation}\n />\n <FormInput\n label=\"Kundes bestillingsnr\"\n type=\"text\"\n name=\"customerOrderNumber\"\n inputRef={register}\n />\n </div>\n\n {/** ********** */}\n {/* Section 2 */}\n {/** ********** */}\n\n <div>\n <Header type=\"secondary\">2. Byggeplass</Header>\n <FormInput\n required\n label=\"Addresse\"\n type=\"text\"\n name=\"deliveryAddress\"\n inputRef={register}\n error={errors.deliveryAddress?.message}\n />\n <div>\n <InputWrapper style={{ display: \"flex\" }}>\n <div style={{ marginRight: 10 }}>\n <FormInput\n name=\"zipCode\"\n label=\"Postnummer\"\n type=\"number\"\n required\n inputRef={register}\n error={errors.zipCode?.message}\n />\n </div>\n <div style={{ marginLeft: 10 }}>\n <FormInput\n name=\"city\"\n label=\"Poststed\"\n required\n type=\"text\"\n inputRef={register}\n error={errors.city?.message}\n />\n </div>\n </InputWrapper>\n </div>\n <div style={{ marginTop: 10 }}>\n <InputWrapper style={{ display: \"flex\" }}>\n <div style={{ marginRight: 10 }}>\n <FormInput\n label=\"Gardsnr\"\n name=\"farmNumber\"\n inputRef={register}\n type=\"text\"\n />\n </div>\n <div style={{ marginLeft: 10 }}>\n <FormInput\n label=\"Bruksnr\"\n name=\"subFarmNumber\"\n inputRef={register}\n type=\"text\"\n />\n </div>\n </InputWrapper>\n </div>\n <div style={{ marginTop: 10 }}>\n <Label>Høyde over havet</Label>\n <div style={{ display: \"grid\", gridTemplateColumns: \"1fr 1fr\" }}>\n <div style={{ marginRight: 10 }}>\n <FormInput\n type=\"number\"\n name=\"mamsl\"\n inputRef={register}\n error={errors.mamsl?.message}\n />\n </div>\n\n {streetAddress && zipCode && city ? (\n <BlockButton\n as=\"a\"\n style={{\n fontSize: \"1rem\",\n padding: \"0rem\",\n margin: \"1rem 0.5rem .5rem\",\n textAlign: \"center\",\n paddingTop: \".9rem\",\n }}\n href={`https://www.norgeskart.no/#!?project=norgeskart&zoom=13&layers=panel=searchOptionsPanel&sok=${streetAddress}, ${zipCode} ${city}`}\n target=\"_blank\"\n >\n Norgeskart\n </BlockButton>\n ) : (\n <BlockButton\n disabled\n style={{\n fontSize: \"1rem\",\n padding: \"0rem\",\n margin: \"1rem 0.5rem .5rem\",\n }}\n >\n Norgeskart\n </BlockButton>\n )}\n </div>\n </div>\n <FormInput\n label=\"Kontaktperson byggeplass\"\n type=\"text\"\n name=\"contactPersonSite\"\n inputRef={register}\n />\n <FormInput\n label=\"Telefon byggeplass\"\n type=\"text\"\n name=\"contactPersonPhoneNr\"\n inputRef={register}\n error={errors.contactPersonPhoneNr?.message}\n />\n </div>\n\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: \"2rem\" }}>\n <div>\n <Header type=\"secondary\">3. Leveringsaddresse</Header>\n\n <Select\n name=\"deliveryAddressSameAsBuilding\"\n required={!state.orders.currentNewOrder.quotation}\n label=\"Samme som byggeplass?\"\n options={yesNoOptions}\n onSelectionChanged={(val) => setSameAddressSelection(val)}\n error={errors.deliveryAddressSameAsBuilding?.message}\n />\n\n <FormInput\n label=\"Adresse\"\n name=\"deliveryAddress2\"\n type=\"text\"\n inputRef={register}\n required={!isSameAddress}\n disabled={isSameAddress}\n error={errors?.deliveryAddress2?.message}\n />\n\n <div>\n <InputWrapper style={{ display: \"flex\" }}>\n <div style={{ marginRight: 10 }}>\n <FormInput\n label=\"Postnummer\"\n name=\"zipCode2\"\n type=\"number\"\n required={!isSameAddress}\n inputRef={register}\n disabled={isSameAddress}\n error={errors?.zipCode2?.message}\n />\n </div>\n <div style={{ marginLeft: 10 }}>\n <FormInput\n label=\"Poststed\"\n name=\"city2\"\n type=\"text\"\n required={!isSameAddress}\n inputRef={register}\n disabled={isSameAddress}\n error={errors?.city2?.message}\n />\n </div>\n </InputWrapper>\n </div>\n </div>\n\n <div>\n <Header type=\"secondary\">4. Annet</Header>\n <Select\n required={!state.orders.currentNewOrder.quotation}\n name=\"arrivalSemi\"\n label=\"Tilkomst for semi på byggeplass?\"\n options={yesNoOptions}\n inputRef={register}\n error={errors.arrivalSemi?.message}\n />\n <Select\n name=\"deliveryTerms\"\n required={!state.orders.currentNewOrder.quotation}\n label=\"Levering\"\n inputRef={register}\n options={deliveryOptions}\n error={errors.deliveryTerms?.message}\n />\n\n <Select\n name=\"buildingType\"\n required={!state.orders.currentNewOrder.quotation}\n label=\"Byggtype\"\n inputRef={register}\n options={state.buildingTypes.map((p) => ({\n label: p.name,\n value: p.id,\n }))}\n error={errors.buildingType?.message}\n />\n\n <div\n style={{\n display: \"flex\",\n width: \"30vw\",\n marginTop: \"2rem\",\n position: \"relative\",\n bottom: 0,\n }}\n >\n <BlockButton\n // onClick={() => router.navigateTo(createUrl(Page.CREATE_ORDER, { slug: \"produktvalg\" }))}\n onClick={() => false}\n style={{ width: \"1000px\" }}\n type=\"submit\"\n >\n Neste\n </BlockButton>\n <LinkButton onClick={() => actions.orders.cancelCreateOrder()}>\n Avbryt\n </LinkButton>\n </div>\n </div>\n </div>\n </PageFlexConstraint>\n </form>\n );\n};\n","import styled from \"styled-components\";\n\nimport { baseInputStyles } from \"webapp/src/styles/baseInput\";\n\nexport const InputArea = styled(\"textarea\")`\n ${baseInputStyles}\n width: 100%;\n &[disabled] {\n background: #ddd;\n border: 1px solid #b7b7b7;\n }\n`;\n","import React, { FunctionComponent } from \"react\";\nimport { Label } from \"@frontend/common/src/elements/Label/Label\";\nimport { FormControl } from \"@frontend/common/src/elements/FormControl/FormControl\";\nimport { InputArea } from \"./TextArea.styles\";\n\ntype Props = {\n label?: string;\n name?: string;\n rows?: number;\n cols?: number;\n htmlFor?: string;\n inputRef?: any;\n as?: any;\n} & React.HTMLProps<HTMLTextAreaElement>;\n\nexport const TextArea: FunctionComponent<Props> = ({\n label,\n name,\n rows,\n cols,\n htmlFor,\n inputRef,\n ...props\n}) => {\n return (\n <FormControl>\n {label ? <Label htmlFor={htmlFor}>{label}</Label> : null}\n <InputArea\n name={name}\n rows={rows}\n cols={cols}\n ref={inputRef}\n {...props}\n />\n </FormControl>\n );\n};\n","export const makeId = (length: number) => {\n let result = \"\";\n const characters =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n const charactersLength = characters.length;\n for (let i = 0; i < length; i++) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n};\n","import React, { FunctionComponent } from \"react\";\n\nimport { FormInput } from \"@frontend/common/src/elements/FormInput/FormInput\";\nimport { useTranslation } from \"react-i18next\";\nimport { useForm } from \"react-hook-form\";\nimport { TextArea } from \"@frontend/common/src/components/TextArea/TextArea\";\nimport * as validators from \"@frontend/common/src/validators\";\nimport * as yup from \"yup\";\nimport { yupResolver } from \"@hookform/resolvers/yup\";\nimport { Select } from \"../../../components/Select/Select\";\n\nimport { useAppState } from \"../../../overmind\";\nimport { OfferOptionType } from \"../../../types/OfferOption\";\n\nimport { yesNoOptions } from \"../../../data/selectOptions\";\nimport { BlockButton } from \"../../../components/Buttons/Buttons.styles\";\nimport { DraftOrderSubProject } from \"../../../types/DraftOrder/DraftOrderSubProject\";\nimport { makeId } from \"../../../helpers/GenerateId\";\n\nexport type FormProps = {\n subProjects: DraftOrderSubProject[];\n setSubProjects: (projects: DraftOrderSubProject[]) => void;\n setActiveForm: (form: string) => void;\n selectedSubProject: DraftOrderSubProject | undefined;\n setSelectedSubProject: (project: DraftOrderSubProject | undefined) => void;\n autoFill: boolean;\n};\n\nexport const RoofForm: FunctionComponent<FormProps> = ({\n setSubProjects,\n setActiveForm,\n subProjects,\n selectedSubProject,\n setSelectedSubProject,\n autoFill,\n}) => {\n const { t } = useTranslation();\n\n const { offerOptions, orders } = useAppState();\n\n const onSubmit = (data: DraftOrderSubProject) => {\n if (data.projectId === undefined || data.projectId.length < 1) {\n // eslint-disable-next-line no-param-reassign\n data.projectId = makeId(8);\n }\n if (selectedSubProject !== undefined) {\n const newProjs = subProjects.map((x) => {\n if (x.projectId === data.projectId) {\n return {\n ...x,\n comment: data.comment,\n rangeDistance:\n data.rangeDistance ?? selectedSubProject.rangeDistance,\n roofType: data.roofType ?? selectedSubProject.roofType,\n roofingType: data.roofingType ?? selectedSubProject.roofingType,\n angle: data.angle ?? selectedSubProject.angle,\n protrusion: data.protrusion ?? selectedSubProject.protrusion,\n workingWidth: data.workingWidth ?? selectedSubProject.workingWidth,\n additionalCrane:\n data.additionalCrane ?? selectedSubProject.additionalCrane,\n };\n }\n return x;\n });\n setSubProjects(newProjs);\n } else {\n setSubProjects([...subProjects, data]);\n }\n setActiveForm(\"\");\n setSelectedSubProject(undefined);\n };\n const onCancel = () => {\n setActiveForm(\"\");\n setSelectedSubProject(undefined);\n };\n\n const roof = yup.object().shape({\n roofType: validators.requiredField,\n roofingType: validators.requiredField,\n angle: validators.decimalField,\n rangeDistance: validators.positiveNumeric,\n protrusion: validators.positiveNumeric.min(0, \"Må være over 0\"),\n additionalCrane: !orders.currentNewOrder.quotation\n ? validators.requiredField\n : null,\n workingWidth: validators.positiveNumeric,\n });\n const { register, handleSubmit, errors } = useForm<DraftOrderSubProject>({\n // @ts-ignore\n resolver: yupResolver(roof),\n defaultValues: selectedSubProject,\n });\n const roofTypes = offerOptions\n .filter((o) => o.type === OfferOptionType.ROOF)\n .map((o) => ({ label: o.description, value: o.id }));\n\n const roofingTypes = offerOptions\n .filter((o) => o.type === OfferOptionType.ROOFING)\n .map((o) => ({ label: o.description, value: o.id }));\n\n return (\n <form onSubmit={handleSubmit(onSubmit)}>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"space-evenly\",\n width: \"100%\",\n }}\n >\n <div>\n <input ref={register} type=\"hidden\" value=\"roof\" name=\"type\" />\n <input ref={register} type=\"hidden\" name=\"projectId\" />\n\n <Select\n name=\"roofType\"\n label={t(\"Pick roof type\")}\n options={roofTypes}\n required\n inputRef={register}\n error={errors.roofType?.message}\n disabled={\n autoFill &&\n selectedSubProject.roofType !== null &&\n selectedSubProject.roofType.length > 0\n }\n />\n <Select\n name=\"roofingType\"\n label={t(\"Roofing\")}\n options={roofingTypes}\n inputRef={register}\n error={errors.roofingType?.message}\n disabled={\n autoFill &&\n selectedSubProject.roofingType !== null &&\n selectedSubProject.roofType.length > 0\n }\n required\n />\n <div\n style={{\n display: \"grid\",\n gridTemplateColumns: \"1fr 1fr\",\n gap: \"1rem\",\n }}\n >\n <FormInput\n label={t(\"Roof angle\")}\n type=\"number\"\n name=\"angle\"\n suffix=\"grader\"\n inputRef={register}\n disabled={autoFill}\n error={errors.angle?.message}\n />\n <FormInput\n label={t(\"Range distance\")}\n type=\"number\"\n suffix=\"mm\"\n name=\"rangeDistance\"\n inputRef={register}\n disabled={autoFill}\n error={errors.rangeDistance?.message}\n />\n </div>\n <div\n style={{\n display: \"grid\",\n gridTemplateColumns: \"1fr 1fr\",\n gap: \"1rem\",\n }}\n >\n <FormInput\n label={t(\"Protrusion\")}\n type=\"number\"\n name=\"protrusion\"\n suffix=\"mm\"\n inputRef={register}\n disabled={autoFill}\n error={errors.protrusion?.message}\n />\n\n <FormInput\n label={t(\"Virkesbredde\")}\n type=\"number\"\n name=\"workingWidth\"\n suffix=\"mm\"\n inputRef={register}\n disabled={autoFill}\n error={errors.workingWidth?.message}\n />\n </div>\n\n <Select\n name=\"additionalCrane\"\n label={t(\"Ekstra kraning \")}\n options={yesNoOptions}\n inputRef={register}\n error={errors.additionalCrane?.message}\n disabled={\n autoFill &&\n selectedSubProject.additionalCrane !== null &&\n selectedSubProject.additionalCrane.length > 0\n }\n required={!orders.currentNewOrder.quotation}\n />\n\n <TextArea\n label={t(\"Kommentar\")}\n name=\"comment\"\n rows={3}\n inputRef={register}\n placeholder={t(\"Write other required info here\")}\n />\n </div>\n <div\n style={{\n display: \"flex\",\n alignContent: \"center\",\n alignItems: \"center\",\n flexDirection: \"column\",\n justifyContent: \"center\",\n width: \"30%\",\n }}\n >\n <BlockButton style={{ marginBottom: \"2em\" }} type=\"submit\">\n {selectedSubProject !== undefined ? \"Oppdater\" : \"Legg til\"}\n </BlockButton>\n <BlockButton onClick={() => onCancel()} type=\"button\">\n Avbryt\n </BlockButton>\n </div>\n </div>\n </form>\n );\n};\n","import React, { FunctionComponent, useMemo } from \"react\";\nimport { BlockButton } from \"../../../components/Buttons/Buttons.styles\";\nimport { PreTreColors } from \"../../../styles/constants\";\nimport { DraftOrderSubProject } from \"../../../types/DraftOrder/DraftOrderSubProject\";\nimport { OfferOptionType } from \"../../../types/OfferOption\";\nimport { useAppState } from \"../../../overmind\";\n\ninterface props {\n subProjects: DraftOrderSubProject[];\n setSubProjects: (projects: DraftOrderSubProject[]) => void;\n selectedSubProject: DraftOrderSubProject;\n setSelectedSubProject: (project: DraftOrderSubProject) => void;\n setActiveForm: (form: string) => void;\n autoFill: boolean;\n}\n\nexport const SubProjects: FunctionComponent<props> = ({\n subProjects,\n setSubProjects,\n selectedSubProject,\n setSelectedSubProject,\n setActiveForm,\n autoFill,\n}) => {\n const state = useAppState();\n const roofTypes = state.offerOptions\n .filter((o) => o.type === OfferOptionType.ROOF)\n .map((o) => ({ label: o.description, value: o.id }));\n\n const joistsTypes = useMemo(\n () =>\n state.offerOptions\n .filter((o) => o.type === OfferOptionType.JOIST_TYPE)\n .map((o) => ({ label: o.description, value: o.id })),\n [state.offerOptions]\n );\n\n const dimensions = useMemo(\n () =>\n state.offerOptions\n .filter((o) => o.type === OfferOptionType.PRECUT_DIMENSION)\n .map((o) => ({ label: o.description, value: o.id })),\n [state.offerOptions]\n );\n\n const deterimineProductName = (subProj: DraftOrderSubProject) => {\n let returnVal = \"\";\n if (subProj.type === \"technical\") {\n returnVal = \"Tekniske tjenester\";\n } else if (subProj.type === \"roof\" || subProj.type === \"extendedRoof\") {\n const roof = roofTypes.find(\n (x) => x.value.toString() === subProj.roofType\n );\n returnVal = roof ? roof.label : \"\";\n } else if (\n subProj.type === \"beamlayer\" ||\n subProj.type === \"extendedBeamlayer\"\n ) {\n const joist = joistsTypes.find(\n (x) => x.value.toString() === subProj.joistsType\n );\n returnVal = joist ? joist.label : \"\";\n } else if (subProj.type === \"precut\" || subProj.type === \"extendedPrecut\") {\n const dim = dimensions.find(\n (x) => x.value.toString() === subProj.dimensions\n );\n returnVal = `Precut ${dim ? dim.label : \"\"}`;\n } else {\n returnVal = subProj.type;\n }\n return returnVal !== \"\" ? returnVal : subProj.type;\n };\n const deleteProject = (subProject: DraftOrderSubProject) => {\n if (autoFill) {\n const projects = subProjects.filter(\n (x) => x.projectId !== subProject.projectId\n );\n setSubProjects([...projects, { ...subProject, deleted: true }]);\n } else {\n const projects = subProjects.filter(\n (x) => x.projectId !== subProject.projectId\n );\n setSubProjects(projects);\n }\n };\n\n const unDeleteProject = (subProject: DraftOrderSubProject) => {\n const map = subProjects.map((x) => {\n if (x.projectId === subProject.projectId) {\n return {\n ...x,\n deleted: false,\n };\n }\n return x;\n });\n setSubProjects(map);\n };\n const onClickProject = (subProject: DraftOrderSubProject) => {\n if (subProject.deleted !== true) {\n setSelectedSubProject(subProject);\n setActiveForm(subProject.type);\n }\n };\n return (\n <div\n style={{\n minWidth: \"20vw\",\n backgroundColor: PreTreColors.borderlineGray,\n borderRadius: \"10px\",\n height: \"50vh\",\n }}\n >\n <div\n style={{\n backgroundColor: PreTreColors.pretre,\n color: \"white\",\n fontSize: \"1.2rem\",\n padding: \"15px 0\",\n borderRadius: \"10px\",\n textAlign: \"center\",\n height: \"3.5em\",\n }}\n >\n Valgte produkter i prosjektet:\n </div>\n <div style={{ overflowY: \"auto\", maxHeight: \"45vh\" }}>\n {subProjects.map((proj, index) => {\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n padding: \"1em\",\n }}\n >\n <div\n style={{\n backgroundColor:\n selectedSubProject === proj ? \"gray\" : \"white\",\n display: \"flex\",\n justifyContent: \"space-between\",\n color: proj.deleted !== true ? \"black\" : \"gray\",\n padding: \"1em\",\n borderRadius: \"10px\",\n }}\n >\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */}\n <div\n style={{ display: \"flex\", flexDirection: \"column\", flex: 1 }}\n onClick={() => onClickProject(proj)}\n >\n <span\n style={{ fontSize: \"1.2rem\", textDecoration: \"underline\" }}\n >\n {index + 1}. {deterimineProductName(proj)}\n </span>\n <span>\n {proj.comment?.length > 0 ? `(${proj.comment})` : \"\"}\n </span>\n </div>\n {proj.deleted === true ? (\n <BlockButton\n type=\"button\"\n style={{ width: \"30%\", height: \"2.5em\", fontSize: \"1rem\" }}\n onClick={() => unDeleteProject(proj)}\n >\n Legg til\n </BlockButton>\n ) : (\n <BlockButton\n type=\"button\"\n style={{ width: \"20%\", fontSize: \"1rem\" }}\n onClick={() => deleteProject(proj)}\n >\n Fjern\n </BlockButton>\n )}\n </div>\n </div>\n );\n })}\n </div>\n </div>\n );\n};\n","import React, { FunctionComponent, useMemo } from \"react\";\n\nimport { useTranslation } from \"react-i18next\";\nimport { useForm } from \"react-hook-form\";\nimport { TextArea } from \"@frontend/common/src/components/TextArea/TextArea\";\nimport { yupResolver } from \"@hookform/resolvers/yup\";\nimport * as yup from \"yup\";\nimport * as validators from \"@frontend/common/src/validators\";\nimport { Select } from \"../../../components/Select/Select\";\n\nimport { useAppState } from \"../../../overmind\";\nimport { OfferOptionType } from \"../../../types/OfferOption\";\nimport { FormProps } from \"./RoofForm\";\nimport { BlockButton } from \"../../../components/Buttons/Buttons.styles\";\nimport { DraftOrderSubProject } from \"../../../types/DraftOrder/DraftOrderSubProject\";\nimport { makeId } from \"../../../helpers/GenerateId\";\n\nexport const JoistsForm: FunctionComponent<FormProps> = ({\n setSubProjects,\n setActiveForm,\n subProjects,\n setSelectedSubProject,\n selectedSubProject,\n autoFill,\n}) => {\n const { t } = useTranslation();\n const { offerOptions } = useAppState();\n const joists = yup.object().shape({\n joistsType: validators.string,\n submergeWetRoom: autoFill ? validators.string : validators.requiredField,\n millimetersImmersed: validators.positiveNumeric,\n });\n const onSubmit = (data: DraftOrderSubProject) => {\n if (data.projectId === undefined || data.projectId.length < 1) {\n // eslint-disable-next-line no-param-reassign\n data.projectId = makeId(8);\n }\n if (selectedSubProject !== undefined) {\n const newProjs = subProjects.map((x) => {\n if (x.projectId === data.projectId) {\n return {\n ...x,\n comment: data.comment,\n joistsType: data.joistsType ?? selectedSubProject.joistsType,\n submergeWetRoom:\n data.submergeWetRoom ?? selectedSubProject.submergeWetRoom,\n };\n }\n return x;\n });\n setSubProjects(newProjs);\n } else {\n setSubProjects([...subProjects, data]);\n }\n setActiveForm(\"\");\n setSelectedSubProject(undefined);\n };\n const onCancel = () => {\n setActiveForm(\"\");\n setSelectedSubProject(undefined);\n };\n\n const { register, handleSubmit, errors } = useForm<DraftOrderSubProject>({\n // @ts-ignore\n resolver: yupResolver(joists),\n defaultValues: selectedSubProject,\n });\n const joistsTypes = useMemo(\n () =>\n offerOptions\n .filter((o) => o.type === OfferOptionType.JOIST_TYPE)\n .map((o) => ({ label: o.description, value: o.id })),\n [offerOptions]\n );\n\n const submergeWetRooms = useMemo(\n () =>\n offerOptions\n .filter((o) => o.type === OfferOptionType.SUBMERGE_WETROOM)\n .map((o) => ({ label: o.description, value: o.id })),\n [offerOptions]\n );\n\n return (\n <form onSubmit={handleSubmit(onSubmit)}>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"space-evenly\",\n width: \"100%\",\n }}\n >\n <div>\n <input ref={register} type=\"hidden\" value=\"beamlayer\" name=\"type\" />\n <input ref={register} type=\"hidden\" name=\"projectId\" />\n\n <Select\n name=\"joistsType\"\n label={t(\"Pick joist type\")}\n options={joistsTypes}\n inputRef={register}\n disabled={\n autoFill &&\n selectedSubProject.joistsType !== null &&\n selectedSubProject.joistsType.length > 0\n }\n error={errors.joistsType?.message}\n />\n <Select\n name=\"submergeWetRoom\"\n label={t(\"Immerse wetroom\")}\n options={submergeWetRooms}\n inputRef={register}\n disabled={\n autoFill &&\n selectedSubProject.submergeWetRoom !== null &&\n selectedSubProject.submergeWetRoom.length > 0\n }\n error={errors.submergeWetRoom?.message}\n required={!autoFill}\n />\n\n <TextArea\n label={t(\"Kommentar\")}\n name=\"comment\"\n rows={3}\n inputRef={register}\n placeholder={t(\"Write other required info here\")}\n />\n </div>\n <div\n style={{\n display: \"flex\",\n alignContent: \"center\",\n alignItems: \"center\",\n flexDirection: \"column\",\n justifyContent: \"center\",\n width: \"30%\",\n }}\n >\n <BlockButton style={{ marginBottom: \"2em\" }} type=\"submit\">\n {selectedSubProject !== undefined ? \"Oppdater\" : \"Legg til\"}\n </BlockButton>\n <BlockButton onClick={() => onCancel()} type=\"button\">\n Avbryt\n </BlockButton>\n </div>\n </div>\n </form>\n );\n};\n","import React, { FunctionComponent } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { useForm } from \"react-hook-form\";\nimport { TextArea } from \"@frontend/common/src/components/TextArea/TextArea\";\nimport { CMSArticles } from \"@frontend/common/src/types/CMSArticle\";\nimport * as validators from \"@frontend/common/src/validators\";\nimport * as yup from \"yup\";\nimport { yupResolver } from \"@hookform/resolvers/yup\";\nimport { CMSContent } from \"../../../components/CMSContent/CMSContent\";\nimport { useAppState } from \"../../../overmind\";\n\nimport { Select } from \"../../../components/Select/Select\";\n\nimport { OfferOptionType } from \"../../../types/OfferOption\";\nimport { FormProps } from \"./RoofForm\";\nimport { BlockButton } from \"../../../components/Buttons/Buttons.styles\";\nimport { DraftOrderSubProject } from \"../../../types/DraftOrder/DraftOrderSubProject\";\nimport { makeId } from \"../../../helpers/GenerateId\";\n\nconst precut = yup.object().shape({\n dimensions: validators.string.required(),\n comment: validators.string,\n});\n\nexport const PrecutForm: FunctionComponent<FormProps> = ({\n setSubProjects,\n setActiveForm,\n subProjects,\n selectedSubProject,\n setSelectedSubProject,\n autoFill,\n}) => {\n const { t } = useTranslation();\n const { offerOptions } = useAppState();\n const onSubmit = (data: DraftOrderSubProject) => {\n if (data.projectId === undefined || data.projectId.length < 1) {\n // eslint-disable-next-line no-param-reassign\n data.projectId = makeId(8);\n }\n if (selectedSubProject !== undefined) {\n const newProjs = subProjects.map((x) => {\n if (x.projectId === data.projectId) {\n return {\n ...x,\n comment: data.comment,\n dimensions: data.dimensions ?? selectedSubProject.dimensions,\n };\n }\n return x;\n });\n setSubProjects(newProjs);\n } else {\n setSubProjects([...subProjects, data]);\n }\n setActiveForm(\"\");\n setSelectedSubProject(undefined);\n };\n const onCancel = () => {\n setActiveForm(\"\");\n setSelectedSubProject(undefined);\n };\n const dimensions = offerOptions\n .filter((o) => o.type === OfferOptionType.PRECUT_DIMENSION)\n .map((o) => ({ label: o.description, value: o.id }));\n const { register, handleSubmit, errors } = useForm<DraftOrderSubProject>({\n resolver: yupResolver(precut),\n defaultValues: selectedSubProject,\n });\n return (\n <form onSubmit={handleSubmit(onSubmit)}>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"space-evenly\",\n width: \"100%\",\n }}\n >\n <div>\n <input ref={register} type=\"hidden\" value=\"precut\" name=\"type\" />\n <input ref={register} type=\"hidden\" name=\"projectId\" />\n\n <Select\n name=\"dimensions\"\n label={t(\"Dimension\")}\n options={dimensions}\n inputRef={register}\n error={errors.dimensions?.message}\n required\n disabled={\n autoFill &&\n selectedSubProject.dimensions !== null &&\n selectedSubProject.dimensions.length > 0\n }\n />\n\n <TextArea\n label={t(\"Kommentar\")}\n name=\"comment\"\n rows={3}\n inputRef={register}\n placeholder={t(\"Write other required info here\")}\n defaultValue={errors.comment?.message}\n />\n <CMSContent contentId={CMSArticles.PRECUT_INFO} />\n </div>\n <div\n style={{\n display: \"flex\",\n alignContent: \"center\",\n alignItems: \"center\",\n flexDirection: \"column\",\n justifyContent: \"center\",\n width: \"30%\",\n }}\n >\n <BlockButton style={{ marginBottom: \"2em\" }} type=\"submit\">\n {selectedSubProject !== undefined ? \"Oppdater\" : \"Legg til\"}\n </BlockButton>\n <BlockButton onClick={() => onCancel()} type=\"button\">\n Avbryt\n </BlockButton>\n </div>\n </div>\n </form>\n );\n};\n","import React, { FunctionComponent } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { useForm } from \"react-hook-form\";\nimport { TextArea } from \"@frontend/common/src/components/TextArea/TextArea\";\nimport * as validators from \"@frontend/common/src/validators\";\nimport * as yup from \"yup\";\nimport { yupResolver } from \"@hookform/resolvers/yup\";\nimport { useAppState } from \"../../../overmind\";\n\nimport { Select } from \"../../../components/Select/Select\";\n\nimport { FormProps } from \"./ExtendedRoofForm\";\nimport { BlockButton } from \"../../../components/Buttons/Buttons.styles\";\nimport { DraftOrderSubProject } from \"../../../types/DraftOrder/DraftOrderSubProject\";\nimport { makeId } from \"../../../helpers/GenerateId\";\n\nconst technicalServices = yup.object().shape({\n technical: validators.string,\n comment: validators.string,\n});\n\nexport const TechnicalServicesForm: FunctionComponent<FormProps> = ({\n setSubProjects,\n setActiveForm,\n subProjects,\n selectedSubProject,\n setSelectedSubProject,\n autoFill,\n quickChoice,\n onMainCancel,\n}) => {\n const { t } = useTranslation();\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { offerOptions } = useAppState();\n const onSubmit = (data: DraftOrderSubProject) => {\n if (data.projectId === undefined || data.projectId.length < 1) {\n // eslint-disable-next-line no-param-reassign\n data.projectId = makeId(8);\n }\n if (selectedSubProject !== undefined) {\n const newProjs = subProjects.map((x) => {\n if (x.projectId === data.projectId) {\n return {\n ...x,\n comment: data.comment,\n technicalType: data.technicalType,\n };\n }\n return x;\n });\n setSubProjects(newProjs);\n } else {\n setSubProjects([...subProjects, data]);\n }\n setActiveForm(\"\");\n setSelectedSubProject(undefined);\n };\n const onCancel = () => {\n setActiveForm(\"\");\n setSelectedSubProject(undefined);\n if (quickChoice !== null) {\n onMainCancel();\n }\n };\n\n const technical = [\n {\n label: \"Arbeidstegninger\",\n value: \"1\",\n },\n {\n label: \"Søknadstegninger\",\n value: \"2\",\n },\n {\n label: \"Teknisk rådgiving\",\n value: \"3\",\n },\n {\n label: \"Byggesøknad\",\n value: \"4\",\n },\n {\n label: \"Mengdeberegning\",\n value: \"5\",\n },\n {\n label: \"Energiberegning\",\n value: \"6\",\n },\n {\n label: \"Energimerking\",\n value: \"7\",\n },\n {\n label: \"Statiske beregninger\",\n value: \"8\",\n },\n {\n label: \"Stabilitetsberegning\",\n value: \"9\",\n },\n ];\n const { register, handleSubmit, errors } = useForm<DraftOrderSubProject>({\n resolver: yupResolver(technicalServices),\n defaultValues: selectedSubProject,\n });\n return (\n <form onSubmit={handleSubmit(onSubmit)}>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"space-evenly\",\n width: \"100%\",\n }}\n >\n <div>\n <input ref={register} type=\"hidden\" value=\"technical\" name=\"type\" />\n\n <Select\n name=\"technicalType\"\n label={t(\"TechnicalType\")}\n options={technical}\n inputRef={register}\n error={errors.dimensions?.message}\n required\n disabled={\n autoFill && selectedSubProject.technicalType !== undefined\n }\n />\n\n <TextArea\n label={t(\"Kommentar\")}\n name=\"comment\"\n rows={3}\n inputRef={register}\n placeholder={t(\"Write other required info here\")}\n defaultValue={errors.comment?.message}\n />\n </div>\n <div\n style={{\n display: \"flex\",\n alignContent: \"center\",\n alignItems: \"center\",\n flexDirection: \"column\",\n justifyContent: \"center\",\n width: \"30%\",\n }}\n >\n <BlockButton style={{ marginBottom: \"2em\" }} type=\"submit\">\n {selectedSubProject !== undefined ? \"Oppdater\" : \"Legg til\"}\n </BlockButton>\n <BlockButton onClick={() => onCancel()} type=\"button\">\n Avbryt\n </BlockButton>\n </div>\n </div>\n </form>\n );\n};\n","import React, { FunctionComponent } from \"react\";\nimport Modal from \"@frontend/common/src/components/Modal/Modal\";\nimport { useAppState } from \"../../overmind\";\nimport { CMSContent } from \"../../components/CMSContent/CMSContent\";\nimport { PreTreColors } from \"../../styles/constants\";\n\ninterface ModalProps {\n cancelCalculation: () => void;\n}\n\nexport const CalculatePriceModal: FunctionComponent<ModalProps> = ({\n cancelCalculation,\n}: ModalProps) => {\n const { modals } = useAppState();\n\n if (!modals.calculatePriceModal.isCurrent) {\n return null;\n }\n\n return (\n <Modal\n isOpen={modals.calculatePriceModal.isCurrent}\n onClose={() => cancelCalculation()}\n >\n <div\n style={{\n backgroundColor: PreTreColors.pretre,\n color: \"white\",\n fontSize: \"2.2rem\",\n padding: \"2rem\",\n borderRadius: \"10px\",\n textAlign: \"center\",\n height: \"3.5em\",\n width: \"100%\",\n display: \"flex\",\n justifyContent: \"center\",\n }}\n >\n <span style={{ marginLeft: \"auto\", marginRight: \"auto\" }}>\n <CMSContent contentId={1465} />\n </span>\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */}\n <span\n style={{\n display: \"flex\",\n fontSize: \"2.2rem\",\n cursor: \"pointer\",\n }}\n onClick={() => cancelCalculation()}\n >\n X\n </span>\n </div>\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"space-evenly\",\n fontSize: \"2rem\",\n height: \"10em\",\n }}\n >\n <CMSContent contentId={1466} />\n </div>\n </Modal>\n );\n};\n","export default __webpack_public_path__ + \"static/media/A-takstol med rafthøgde.0f234c3d.png\";","export default __webpack_public_path__ + \"static/media/A-takstol standard.e9299cac.png\";","export default __webpack_public_path__ + \"static/media/A-takstol undergurt ut.2d7cf607.png\";","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA5gAAAHgCAYAAADAJsI4AAAAx3pUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjabVDbDcMgDPxnio7gF8QehyRU6gYdvwaMlEQ9ifPFdg7j1L6fd3p1EEqSvGmxUsAhJkbVhcJEHYwggwdMgSN7y6e2JHnsLbMNtMyIKx8/rIjVVb4Y6RGF/V4wmZH0YRQXcZ+IXJxhZGHENAsYBnU+C4rpdn3C3uAOnSd1OtrwBozbnt+y+fb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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz7CGy2yAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAB3RJTUUH5wUJCxgpvoGutAAACWZJREFUeNrt1zEBAAAIwzDAv+ehgIs3kdCvnSQFAAAATyMBAAAABhMAA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AAAAgwkAAIDBBAAAwGACAACAwQQAAMBgAgAAYDABAAAwmAAAAGAwAQAAMJgAAAAYTAAAAAwmAAAAGEwAAAAMJgAAAAYTAAAAgykBAAAABhMAAACDCQAAgMEEAAAAgwkAAIDBBAAAwGACAABgMAEAAMBgAgAAYDABAAAwmAAAABhMAAAAMJgAAAAYTAAAAAwmAAAAGEwAAAAMJgAAAAYTAAAAgwkAAAAGEwAAAIMJAACAwQQAAMBgAgAAgMEEAADAYAIAAGAwAQAAMJgAAABgMAEAADCYAAAAGEwAAAAwmAAAABhMAAAADCYAAAAGEwAAAAwmAAAABhMAAACDCQAAgMEEAAAAgwkAAIDBBAAAwGACAABgMAEAAMBgAgAAYDABAAAwmAAAAGAwAQAAMJgAAAAYTAAAAAwmAAAAGEwAAAAMJgAAAAYTAAAAgwkAAAAGEwAAAIMJAACAwQQAAMBgAgAAgMEEAADAYAIAAGAwAQAAwGACAABgMAEAADCYAAAAGEwAAAAwmAAAABhMAAAADCYAAAAGEwAAAAwmAAAABhMAAACDCQAAgMEEAAAAgwkAAIDBBAAAwGACAACAwQQAAMBgAgAAYDABAAAwmAAAAGAwAQAAMJgAAAAYTAAAAAwmAAAAGEwAAAAMJgAAAAYTAAAAgykBAAAABhMAAACDCQAAgMEEAAAAgwkAAIDBBAAAwGACAABgMAEAAMBgAgAAYDABAAAwmAAAABhMAAAAMJgAAAAYTAAAAAwmAAAAGEwAAAAMJgAAAAYTAAAAgwkAAAAGEwAAAIMJAACAwQQAAMBgAgAAgMEEAADAYAIAAGAwAQAAMJgAAABgMAEAADCYAAAAGEwAAAAwmAAAABhMAAAADCYAAAAGEwAAAAwmAAAABhMAAACDCQAAgMEEAAAAgwkAAIDBBAAAwGACAABgMAEAAMBgAgAAYDABAAAwmAAAAGAwAQAAMJgAAAAYTAAAAAwmAAAA3BbcDge8dfNuEgAAAABJRU5ErkJggg==\"","export default __webpack_public_path__ + \"static/media/Pulttakstol standard.79e85040.png\";","export default __webpack_public_path__ + \"static/media/Pulttakstol undergurt ut.128433ea.png\";","export default __webpack_public_path__ + \"static/media/Saksetakstol.b0bc8384.png\";","export default __webpack_public_path__ + \"static/media/W-takstol standard.46d384da.png\";","export default __webpack_public_path__ + \"static/media/W-takstol undergurt ut.7b44bf4b.png\";","import React, { FunctionComponent } from \"react\";\n\ninterface props {\n show: boolean;\n}\nconst Tooltip: FunctionComponent<props> = ({ children, show }) => {\n return (\n <div\n style={{\n display: show ? \"\" : \"none\",\n position: \"absolute\",\n background: \"rgba(0, 0, 0, 0.7)\",\n color: \"white\",\n padding: \"5px\",\n borderRadius: \"5px\",\n bottom: \"250%\",\n zIndex: \"100\",\n }}\n >\n {children}\n <span\n style={{\n position: \"absolute\",\n top: \"100%\",\n left: \"50%\",\n borderWidth: \"5px\",\n borderStyle: \"solid\",\n borderColor: \"rgba(0, 0, 0, 0.7) transparent transparent\",\n }}\n />\n </div>\n );\n};\n\nexport default Tooltip;\n","import React from \"react\";\nimport { Calculation } from \"../../../types/DraftOrder/Calculation\";\nimport { Header } from \"../../../elements/Header/Header\";\n\nexport const CalcConditions = ({ calc }: { calc: Calculation }) => {\n return (\n // eslint-disable-next-line react/jsx-no-useless-fragment\n <>\n {calc !== undefined &&\n (calc.error === undefined || calc.error === null) ? (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n marginTop: \"2em\",\n }}\n >\n <div>\n <Header type=\"secondary\">Forutsetninger</Header>\n <ul>\n {calc.preconditions !== null\n ? calc.preconditions.map((x) => <li>{x}</li>)\n : null}\n </ul>\n </div>\n <Header type=\"secondary\">Forbehold</Header>\n <ul>\n {calc.conditions !== null\n ? calc.conditions.map((x) => <li>{x}</li>)\n : null}\n </ul>\n </div>\n ) : null}\n </>\n );\n};\n","export const approvedRoofTypes = [\"1\", \"10\", \"11\", \"2\", \"12\", \"4\", \"13\", \"6\"];\nexport const configParams = [\n {\n roofType: \"1\",\n minProtrusion: 0,\n maxProtrusion: 800,\n minAngle: 30,\n maxAngle: 45,\n minRangeDistance: 3000,\n maxRangeDistance: 9000,\n },\n {\n roofType: \"10\",\n minProtrusion: 0,\n maxProtrusion: 800,\n minAngle: 30,\n maxAngle: 45,\n minRangeDistance: 3000,\n maxRangeDistance: 9000,\n },\n {\n roofType: \"11\",\n minProtrusion: 0,\n maxProtrusion: 800,\n minAngle: 30,\n maxAngle: 45,\n minRangeDistance: 3000,\n maxRangeDistance: 9000,\n },\n {\n roofType: \"2\",\n minProtrusion: 0,\n maxProtrusion: 650,\n minAngle: 15,\n maxAngle: 40,\n minRangeDistance: 2000,\n maxRangeDistance: 9000,\n },\n {\n roofType: \"12\",\n minProtrusion: 0,\n maxProtrusion: 650,\n minAngle: 15,\n maxAngle: 40,\n minRangeDistance: 2000,\n maxRangeDistance: 9000,\n },\n {\n roofType: \"4\",\n minProtrusion: 0,\n maxProtrusion: 650,\n minAngle: 15,\n maxAngle: 40,\n minRangeDistance: 2000,\n maxRangeDistance: 8000,\n },\n {\n roofType: \"13\",\n minProtrusion: 0,\n maxProtrusion: 650,\n minAngle: 15,\n maxAngle: 40,\n minRangeDistance: 2000,\n maxRangeDistance: 8000,\n },\n {\n roofType: \"6\",\n minProtrusion: 0,\n maxProtrusion: 650,\n minAngle: 0,\n maxAngle: 360,\n minRangeDistance: 2000,\n maxRangeDistance: 8000,\n },\n];\n\nexport const ww = [\n {\n label: \"36mm\",\n value: 36,\n },\n {\n label: \"48mm\",\n value: 48,\n },\n];\n","import React from \"react\";\nimport { Calculation } from \"../../../types/DraftOrder/Calculation\";\nimport { Header } from \"../../../elements/Header/Header\";\nimport { CMSContent } from \"../../../components/CMSContent/CMSContent\";\nimport { formatMoney } from \"../../../helpers/money\";\n\nexport const CalculationPriceAndError = ({ calc }: { calc: Calculation }) => {\n return (\n // eslint-disable-next-line react/jsx-no-useless-fragment\n <>\n {calc && calc.error !== null && calc.error !== undefined ? (\n <div>\n <Header type=\"secondary\">Feil</Header>\n <div>{calc.error} </div>\n </div>\n ) : calc === undefined ? (\n <div>\n <Header type=\"secondary\">Informasjon</Header>\n <CMSContent contentId={1464} />\n </div>\n ) : (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"row\",\n width: \"100%\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n marginBottom: \"2em\",\n }}\n >\n <Header type=\"secondary\">Pris</Header>\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"space-evenly\",\n height: \"100%\",\n }}\n >\n <div>\n <span\n style={{\n display: \"flex\",\n flexDirection: \"row\",\n }}\n >\n <CMSContent contentId={1467} />\n <span style={{ fontWeight: \"bolder\", marginLeft: \"0.5rem\" }}>\n {formatMoney(calc.price)} eks mva.\n </span>\n </span>\n {calc.freight > 0 ? (\n <span>\n Herav frakt\n <span\n style={{\n fontWeight: \"bolder\",\n marginLeft: \"1.5rem\",\n }}\n >\n {formatMoney(calc.freight)} eks mva.{\" \"}\n </span>\n </span>\n ) : null}\n {calc.priceConditions !== null ? (\n <div style={{ fontSize: \"0.75rem\" }}>\n {calc.priceConditions.map((x) => (\n <p>{x}</p>\n ))}\n </div>\n ) : null}\n </div>\n </div>\n </div>\n </div>\n )}\n </>\n );\n};\n","/* eslint-disable @typescript-eslint/no-unused-vars */\n\nimport React, { FunctionComponent, useEffect, useRef, useState } from \"react\";\n\nimport { FormInput } from \"@frontend/common/src/elements/FormInput/FormInput\";\nimport { useTranslation } from \"react-i18next\";\nimport { useForm } from \"react-hook-form\";\nimport { TextArea } from \"@frontend/common/src/components/TextArea/TextArea\";\nimport * as validators from \"@frontend/common/src/validators\";\nimport * as yup from \"yup\";\nimport { yupResolver } from \"@hookform/resolvers/yup\";\nimport axios, { CancelTokenSource } from \"axios\";\nimport { Select } from \"../../../components/Select/Select\";\n\nimport { useActions, useAppState, useEffects } from \"../../../overmind\";\nimport { OfferOptionType } from \"../../../types/OfferOption\";\n\nimport { yesNoOptions } from \"../../../data/selectOptions\";\nimport { BlockButton } from \"../../../components/Buttons/Buttons.styles\";\nimport { DraftOrderSubProject } from \"../../../types/DraftOrder/DraftOrderSubProject\";\nimport { makeId } from \"../../../helpers/GenerateId\";\nimport { CMSContent } from \"../../../components/CMSContent/CMSContent\";\nimport { CalculatePriceModal } from \"../../../modals/CalculatePriceModal/CalculatePriceModal\";\nimport {\n Address,\n Calculation,\n CalculationPayload,\n} from \"../../../types/DraftOrder/Calculation\";\nimport roof11 from \"../../../assets/img/A-takstol med rafthøgde.png\";\nimport roof1 from \"../../../assets/img/A-takstol standard.png\";\nimport roof10 from \"../../../assets/img/A-takstol undergurt ut.png\";\nimport def from \"../../../assets/img/Blank.png\";\nimport roof4 from \"../../../assets/img/Pulttakstol standard.png\";\nimport roof13 from \"../../../assets/img/Pulttakstol undergurt ut.png\";\nimport roof6 from \"../../../assets/img/Saksetakstol.png\";\nimport roof2 from \"../../../assets/img/W-takstol standard.png\";\nimport roof12 from \"../../../assets/img/W-takstol undergurt ut.png\";\nimport Tooltip from \"./Tooltip\";\nimport { CalcConditions } from \"./CalcConditions\";\nimport {\n approvedRoofTypes,\n configParams,\n ww,\n} from \"../../../helpers/PriceCalculatorConfig\";\nimport { CalculationPriceAndError } from \"./CalculationPriceAndError\";\n\nexport type FormProps = {\n subProjects: DraftOrderSubProject[];\n setSubProjects: (projects: DraftOrderSubProject[]) => void;\n setActiveForm: (form: string) => void;\n selectedSubProject: DraftOrderSubProject | undefined;\n setSelectedSubProject: (project: DraftOrderSubProject | undefined) => void;\n autoFill: boolean;\n quickChoice?: string;\n onMainCancel: () => void;\n};\n\nexport const ExtendedRoofForm: FunctionComponent<FormProps> = ({\n setSubProjects,\n setActiveForm,\n subProjects,\n selectedSubProject,\n setSelectedSubProject,\n autoFill,\n quickChoice,\n onMainCancel,\n}) => {\n const { t } = useTranslation();\n const [calc, setCalc] = useState<Calculation | undefined>(undefined);\n const { offerOptions, orders, modals, customer } = useAppState();\n const actions = useActions();\n const effects = useEffects();\n const [img, setImg] = useState(def);\n const [priceDisabled, setPriceDisabled] = useState<boolean>(true);\n const [showPriceButton, setShowPriceButton] = useState<boolean>(false);\n const [configParam, setConfigParam] = useState(undefined);\n const [showToolTip, setShowToolTip] = useState<boolean>(false);\n const cancelToken: React.MutableRefObject<CancelTokenSource | null> =\n useRef(null);\n\n const onSubmit = (data: DraftOrderSubProject) => {\n if (data.projectId === undefined || data.projectId.length < 1) {\n // eslint-disable-next-line no-param-reassign\n data.projectId = makeId(8);\n }\n if (calc !== undefined) {\n // eslint-disable-next-line no-param-reassign\n data.conditions = calc.conditions;\n // eslint-disable-next-line no-param-reassign\n data.preconditions = calc.preconditions;\n // eslint-disable-next-line no-param-reassign\n data.priceConditions = calc.priceConditions;\n }\n if (selectedSubProject !== undefined) {\n const newProjs = subProjects.map((x) => {\n if (x.projectId === data.projectId) {\n return {\n ...x,\n comment: data.comment,\n rangeDistance:\n data.rangeDistance ?? selectedSubProject.rangeDistance,\n roofType: data.roofType ?? selectedSubProject.roofType,\n roofingType: data.roofingType ?? selectedSubProject.roofingType,\n angle: data.angle ?? selectedSubProject.angle,\n protrusion: data.protrusion ?? selectedSubProject.protrusion,\n workingWidth: data.workingWidth ?? selectedSubProject.workingWidth,\n additionalCrane:\n data.additionalCrane ?? selectedSubProject.additionalCrane,\n roomHeight: data.roomHeight ?? selectedSubProject.roomHeight,\n roomWidth: data.roomWidth ?? selectedSubProject.roomWidth,\n numberOfTrusses:\n data.numberOfTrusses ?? selectedSubProject.numberOfTrusses,\n price: data.price ?? selectedSubProject.price,\n calculationId:\n data.calculationId ?? selectedSubProject.calculationId,\n priceConditions:\n data.priceConditions ?? selectedSubProject.priceConditions,\n conditions: data.conditions ?? selectedSubProject.conditions,\n preconditions:\n data.preconditions ?? selectedSubProject.preconditions,\n };\n }\n return x;\n });\n setSubProjects(newProjs);\n } else {\n setSubProjects([...subProjects, data]);\n }\n setActiveForm(\"\");\n setSelectedSubProject(undefined);\n };\n const onCancel = () => {\n setActiveForm(\"\");\n setSelectedSubProject(undefined);\n if (quickChoice !== undefined) {\n onMainCancel();\n }\n };\n\n const cancelCalculation = () => {\n if (cancelToken.current != null) {\n cancelToken.current.cancel();\n }\n actions.modals.calculatePriceModal.close();\n };\n\n const roof = yup.object().shape({\n roofType: validators.requiredField,\n roofingType: validators.requiredField,\n angle: validators.decimalField,\n rangeDistance: validators.positiveNumeric,\n protrusion: validators.positiveNumeric.min(0, \"Må være over 0\"),\n additionalCrane: !orders.currentNewOrder.quotation\n ? validators.requiredField\n : null,\n workingWidth: validators.positiveNumeric,\n numberOfTrusses: validators.positiveNumeric,\n roomWidth: validators.positiveNumeric,\n roomHeight: validators.positiveNumeric,\n });\n const { register, handleSubmit, errors, setValue, watch, getValues } =\n useForm<DraftOrderSubProject>({\n // @ts-ignore\n resolver: yupResolver(roof),\n defaultValues: selectedSubProject,\n });\n\n const roofType = watch(\"roofType\");\n\n const watcher = watch([\n \"numberOfTrusses\",\n \"protrusion\",\n \"rangeDistance\",\n \"angle\",\n \"roofingType\",\n ]);\n\n useEffect(() => {\n if (selectedSubProject) {\n if (selectedSubProject.price) {\n setCalc({\n price: selectedSubProject.price,\n uid: selectedSubProject.calculationId,\n conditions: selectedSubProject.conditions ?? [],\n preconditions: selectedSubProject.preconditions ?? [],\n specifications: [],\n freight: selectedSubProject.freight,\n priceConditions: selectedSubProject.priceConditions ?? [],\n });\n }\n }\n }, [selectedSubProject]);\n useEffect(() => {\n switch (roofType) {\n case \"1\":\n setImg(roof1);\n break;\n case \"2\":\n setImg(roof2);\n break;\n case \"4\":\n setImg(roof4);\n break;\n case \"6\":\n setImg(roof6);\n break;\n case \"10\":\n setImg(roof10);\n break;\n case \"11\":\n setImg(roof11);\n break;\n case \"12\":\n setImg(roof12);\n break;\n case \"13\":\n setImg(roof13);\n break;\n default:\n setImg(def);\n }\n }, [roofType]);\n const roofTypes = offerOptions\n .filter((o) => o.type === OfferOptionType.ROOF)\n .map((o) => ({\n label:\n o.description +\n (approvedRoofTypes.includes(o.id.toString()) ? \" (K)\" : \"\"),\n value: o.id,\n }))\n .sort((a, b) => a.label.localeCompare(b.label));\n const roofingTypes = offerOptions\n .filter((o) => o.type === OfferOptionType.ROOFING)\n .map((o) => ({ label: o.description, value: o.id }));\n\n const calclulatePrice = () => {\n actions.modals.calculatePriceModal.open();\n cancelToken.current = axios.CancelToken.source();\n const formValues = getValues([\n \"projectId\",\n \"numberOfTrusses\",\n \"angle\",\n \"workingWidth\",\n \"roofType\",\n \"rangeDistance\",\n \"roofingType\",\n \"protrusion\",\n \"roomHeight\",\n \"roomWidth\",\n ]);\n const uid =\n formValues.projectId !== null && formValues.projectId.length > 0\n ? formValues.projectId\n : makeId(4);\n const { currentNewOrder } = orders;\n const address: Address = {\n street: currentNewOrder.deliveryAddress,\n height: Number(currentNewOrder.mamsl),\n city: currentNewOrder.city,\n zipCode: currentNewOrder.zipCode,\n gardsnr:\n currentNewOrder.farmNumber !== null\n ? currentNewOrder.farmNumber.toString()\n : null,\n bruksnr:\n currentNewOrder.subFarmNumber !== null\n ? currentNewOrder.subFarmNumber.toString()\n : null,\n };\n const body: CalculationPayload = {\n uid,\n projectType: \"Takstol\",\n buildingType:\n currentNewOrder.buildingType.length > 0\n ? currentNewOrder.buildingType\n : null,\n CustomerId: customer.id,\n deliveryterms: currentNewOrder.deliveryTerms,\n trussInfo: {\n trussType: formValues.roofType,\n Quantity: Number(formValues.numberOfTrusses),\n SpanWidth: Number(formValues.rangeDistance),\n RoofAngle: Number(formValues.angle),\n TimberWidth: Number(formValues.workingWidth),\n RoofSheeting: formValues.roofingType,\n roofOverhang: Number(formValues.protrusion),\n // roomHeight: Number(formValues.roomHeight),\n // roomWidth: Number(formValues.roomWidth),\n },\n address,\n };\n effects.api.order\n .calculateRoof(body, cancelToken.current)\n .then((data) => {\n setCalc(data);\n setValue(\"price\", data.price);\n setValue(\"calculationId\", data.uid);\n setValue(\"freight\", data.freight);\n cancelToken.current = null;\n actions.modals.calculatePriceModal.close();\n })\n .catch(() => {\n effects.toast(\"Noe gikk galt, vennligst prøv igjen senere\", 5000);\n cancelToken.current = null;\n actions.modals.calculatePriceModal.close();\n });\n };\n const validatePriceButton = (roofParams: {\n numberOfTrusses?: number;\n rangeDistance?: number;\n protrusion?: number;\n angle?: number;\n roofingType?: string;\n }): boolean => {\n if (configParam === undefined) {\n return true;\n }\n if (\n roofParams.roofingType === undefined ||\n roofParams.roofingType === null ||\n roofParams.roofingType.length === 0\n ) {\n return true;\n }\n const trusses = Number(roofParams.numberOfTrusses);\n if (trusses >= 1 && trusses <= 99) {\n const range = Number(roofParams.rangeDistance);\n if (\n range >= configParam.minRangeDistance &&\n range <= configParam.maxRangeDistance\n ) {\n const protrusion = parseInt(roofParams.protrusion.toString(), 10);\n\n if (\n protrusion >= configParam.minProtrusion &&\n protrusion <= configParam.maxProtrusion\n ) {\n const angle = Number(roofParams.angle);\n if (angle >= configParam.minAngle && angle <= configParam.maxAngle) {\n return false;\n }\n }\n }\n }\n return true;\n };\n\n useEffect(() => {\n const approvedRoof = approvedRoofTypes.includes(roofType);\n if (approvedRoof) {\n const param = configParams.find((x) => x.roofType === roofType);\n setConfigParam(param);\n }\n setShowPriceButton(approvedRoof);\n const disabled = validatePriceButton(watcher) && approvedRoof;\n setPriceDisabled(disabled);\n }, [roofType, watcher]);\n\n const toolTipContent = () => {\n if (configParam === undefined) return null;\n\n return (\n <div style={{ display: \"flex\", flexDirection: \"column\" }}>\n <span>\n Nødvendige felter for{\" \"}\n {roofTypes.find((x) => x.value.toString() === roofType).label}{\" \"}\n </span>\n <span>Antall takstoler: 1-99</span>\n <span>\n Takvinkel: {configParam.minAngle} - {configParam.maxAngle}\n </span>\n <span>\n Spennvidde: {configParam.minRangeDistance} -{\" \"}\n {configParam.maxRangeDistance}\n </span>\n <span>\n Utstikk: {configParam.minProtrusion} - {configParam.maxProtrusion}{\" \"}\n </span>\n </div>\n );\n };\n return (\n <form onSubmit={handleSubmit(onSubmit)}>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"space-evenly\",\n width: \"100%\",\n fontSize: \"1rem\",\n flexWrap: \"wrap\",\n }}\n >\n <div>\n <input\n ref={register}\n type=\"hidden\"\n value=\"extendedRoof\"\n name=\"type\"\n />\n <input ref={register} type=\"hidden\" name=\"projectId\" />\n <input ref={register} type=\"hidden\" name=\"price\" />\n <input ref={register} type=\"hidden\" name=\"calculationId\" />\n <input ref={register} type=\"hidden\" name=\"freight\" />\n <Select\n name=\"roofType\"\n label={t(\"Pick roof type\")}\n options={roofTypes}\n required\n inputRef={register}\n readonly={calc !== undefined}\n error={errors.roofType?.message}\n disabled={\n autoFill &&\n selectedSubProject.roofType !== null &&\n selectedSubProject.roofType.length > 0\n }\n />\n <div style={{ fontSize: \"0.75rem\" }}>\n <CMSContent contentId={1470} />\n </div>\n <div\n style={{\n display: \"grid\",\n gridTemplateColumns: \"1fr 1fr\",\n gap: \"1rem\",\n }}\n >\n <Select\n name=\"roofingType\"\n label={t(\"Roofing\")}\n options={roofingTypes}\n inputRef={register}\n readonly={calc !== undefined}\n error={errors.roofingType?.message}\n disabled={\n autoFill &&\n selectedSubProject.roofingType !== null &&\n selectedSubProject.roofType.length > 0\n }\n required\n />\n <FormInput\n readonly={calc !== undefined}\n label={t(\"Antall takstoler\")}\n type=\"number\"\n name=\"numberOfTrusses\"\n suffix=\"stk\"\n inputRef={register}\n disabled={autoFill}\n error={errors.angle?.message}\n />\n </div>\n <div\n style={{\n display: \"grid\",\n gridTemplateColumns: \"1fr 1fr\",\n gap: \"1rem\",\n }}\n >\n <FormInput\n label={t(\"Roof angle\")}\n type=\"number\"\n name=\"angle\"\n suffix=\"grader\"\n inputRef={register}\n readonly={calc !== undefined}\n disabled={autoFill}\n error={errors.angle?.message}\n />\n <FormInput\n readonly={calc !== undefined}\n label={t(\"Range distance\")}\n type=\"number\"\n suffix=\"mm\"\n name=\"rangeDistance\"\n inputRef={register}\n disabled={autoFill}\n error={errors.rangeDistance?.message}\n />\n </div>\n\n <div\n style={{\n display: \"grid\",\n gridTemplateColumns: \"1fr 1fr\",\n gap: \"1rem\",\n }}\n >\n <FormInput\n label={t(\"Protrusion\")}\n type=\"number\"\n name=\"protrusion\"\n suffix=\"mm\"\n inputRef={register}\n readonly={calc !== undefined}\n disabled={autoFill}\n error={errors.protrusion?.message}\n />\n\n <Select\n label={t(\"Virkesbredde\")}\n options={ww}\n name=\"workingWidth\"\n inputRef={register}\n readonly={calc !== undefined}\n disabled={autoFill}\n error={errors.workingWidth?.message}\n noDefault\n />\n </div>\n <div\n style={{\n display: \"grid\",\n gridTemplateColumns: \"1fr 1fr\",\n gap: \"1rem\",\n }}\n >\n {/*\n <FormInput\n label={t(\"Romhøyde\")}\n type=\"number\"\n name=\"roomHeight\"\n suffix=\"mm\"\n inputRef={register}\n readonly={calc !== undefined}\n disabled={autoFill}\n error={errors.protrusion?.message}\n />\n\n <FormInput\n label={t(\"Rombredde\")}\n type=\"number\"\n name=\"roomWidth\"\n suffix=\"mm\"\n inputRef={register}\n readonly={calc !== undefined}\n disabled={autoFill}\n error={errors.workingWidth?.message}\n />\n */}\n </div>\n {!orders.currentNewOrder.quotation && (\n <Select\n name=\"additionalCrane\"\n label={t(\"Ekstra kraning \")}\n options={yesNoOptions}\n inputRef={register}\n error={errors.additionalCrane?.message}\n disabled={\n autoFill &&\n selectedSubProject.additionalCrane !== null &&\n selectedSubProject.additionalCrane.length > 0\n }\n required={!orders.currentNewOrder.quotation}\n />\n )}\n\n <TextArea\n label={t(\"Kommentar\")}\n name=\"comment\"\n rows={3}\n inputRef={register}\n placeholder={t(\"Write other required info here\")}\n />\n {calc === undefined && showPriceButton ? (\n <div\n style={{\n display: \"inline\",\n position: \"relative\",\n }}\n onMouseEnter={() => setShowToolTip(true)}\n onMouseLeave={() => setShowToolTip(false)}\n >\n <Tooltip show={showToolTip}>{toolTipContent()}</Tooltip>\n <BlockButton\n style={{\n marginRight: \"2em\",\n backgroundColor: priceDisabled ? \"gray\" : \"green\",\n width: \"12em\",\n }}\n onClick={() => calclulatePrice()}\n type=\"button\"\n disabled={priceDisabled}\n >\n Beregn pris\n </BlockButton>\n </div>\n ) : calc ? (\n <BlockButton\n style={{\n marginRight: \"2em\",\n backgroundColor: \"green\",\n width: \"12em\",\n }}\n onClick={() => setCalc(undefined)}\n type=\"button\"\n >\n Rediger\n </BlockButton>\n ) : null}\n </div>\n\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"space-between\",\n }}\n >\n <div style={{ width: \"576px\" }}>\n <img\n style={{ width: \"576px\", height: \"288px\" }}\n alt=\"takstol\"\n src={img}\n />\n <CalculationPriceAndError calc={calc} />\n </div>\n <div\n style={{\n display: \"flex\",\n alignContent: \"center\",\n alignItems: \"flex-end\",\n flexDirection: \"row\",\n justifyContent: \"flex-start\",\n marginTop: \"auto\",\n }}\n >\n <BlockButton\n style={{ marginRight: \"2em\", width: \"12em\", fontSize: \"1rem\" }}\n type=\"submit\"\n >\n {selectedSubProject !== undefined ? \"Oppdater\" : \"Legg til\"}\n </BlockButton>\n <BlockButton\n style={{ width: \"12em\", fontSize: \"1rem\" }}\n onClick={() => onCancel()}\n type=\"button\"\n >\n Avbryt\n </BlockButton>\n </div>\n <CalcConditions calc={calc} />\n </div>\n </div>\n {modals.calculatePriceModal.isCurrent ? (\n <CalculatePriceModal cancelCalculation={cancelCalculation} />\n ) : null}\n </form>\n );\n};\n","import React, { FunctionComponent } from \"react\";\nimport { PrecutOpening } from \"../../../types/DraftOrder/DraftOrderSubProject\";\nimport { Select } from \"../../../components/Select/Select\";\nimport { Checkbox } from \"../../../components/Checkbox/Checkbox\";\n\ninterface Props {\n opening: PrecutOpening;\n changeOpening: (id: string, field: string, value: any) => void;\n deleteOpening: (id: string) => void;\n idx: number;\n}\nconst numOfOpenings = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];\n\nconst height = [\n 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700,\n 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900, 3000,\n 3100, 3200, 3300, 3400, 3500, 3600, 3700, 3800, 3900, 4000, 4100, 4200, 4300,\n 4400, 4500, 4600, 4700, 4800, 4900, 5000, 5100, 5200,\n];\nconst width = [\n 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700,\n 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900, 3000,\n 3100, 3200, 3300, 3400, 3500, 4000, 4500, 5000, 5500,\n];\nconst PrecutOpeningRow: FunctionComponent<Props> = ({\n opening,\n deleteOpening,\n changeOpening,\n idx,\n}) => {\n const openings = numOfOpenings.map((o) => ({\n label: o.toString(),\n value: o,\n }));\n const h = height.map((x) => ({ label: x.toString(), value: x }));\n const w = width.map((x) => ({ label: x.toString(), value: x }));\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"row\",\n columnGap: \"2rem\",\n alignItems: \"center\",\n alignContent: \"center\",\n }}\n >\n <span style={{ fontWeight: \"bold\", width: \"5rem\" }}>\n Åpning #{idx + 1}{\" \"}\n </span>\n <Select\n selectedValue={opening.quantity}\n selectWidth=\"8rem\"\n options={openings}\n onSelectionChanged={(x) => changeOpening(opening.id, \"quantity\", x)}\n />\n <Select\n selectedValue={opening.width}\n selectWidth=\"8rem\"\n options={w}\n onSelectionChanged={(x) => changeOpening(opening.id, \"width\", x)}\n />\n <Select\n selectedValue={opening.height}\n selectWidth=\"8rem\"\n options={h}\n onSelectionChanged={(x) => changeOpening(opening.id, \"height\", x)}\n />\n <span style={{ alignSelf: \"end\" }}>\n <Checkbox\n checked={opening.bearing}\n onChange={(x) =>\n changeOpening(opening.id, \"bearing\", x.target.checked)\n }\n />\n </span>\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */}\n <span\n style={{ cursor: \"pointer\" }}\n onClick={() => deleteOpening(opening.id)}\n >\n {\" \"}\n Fjern{\" \"}\n </span>\n </div>\n );\n};\n\nexport default PrecutOpeningRow;\n","/* eslint-disable @typescript-eslint/no-unused-vars */\nimport React, { FunctionComponent, useEffect, useRef, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { useForm } from \"react-hook-form\";\nimport { TextArea } from \"@frontend/common/src/components/TextArea/TextArea\";\nimport { CMSArticles } from \"@frontend/common/src/types/CMSArticle\";\nimport * as validators from \"@frontend/common/src/validators\";\nimport * as yup from \"yup\";\nimport { yupResolver } from \"@hookform/resolvers/yup\";\nimport axios, { CancelTokenSource } from \"axios\";\nimport { FormInput } from \"@frontend/common/src/elements/FormInput/FormInput\";\nimport { CMSContent } from \"../../../components/CMSContent/CMSContent\";\nimport { useActions, useAppState, useEffects } from \"../../../overmind\";\n\nimport { Select } from \"../../../components/Select/Select\";\n\nimport { OfferOptionType } from \"../../../types/OfferOption\";\nimport { FormProps } from \"./RoofForm\";\nimport { BlockButton } from \"../../../components/Buttons/Buttons.styles\";\nimport {\n DraftOrderSubProject,\n PrecutOpening,\n} from \"../../../types/DraftOrder/DraftOrderSubProject\";\nimport { makeId } from \"../../../helpers/GenerateId\";\nimport { CalculatePriceModal } from \"../../../modals/CalculatePriceModal/CalculatePriceModal\";\nimport {\n Address,\n Calculation,\n CalculationPayload,\n} from \"../../../types/DraftOrder/Calculation\";\nimport { CalculationPriceAndError } from \"./CalculationPriceAndError\";\nimport { CalcConditions } from \"./CalcConditions\";\nimport Tooltip from \"./Tooltip\";\n\nimport { Header } from \"../../../elements/Header/Header\";\nimport PrecutOpeningRow from \"./PrecutOpening\";\n\nconst precut = yup.object().shape({\n // dimensions: validators.string.required(),\n comment: validators.string,\n});\n\nexport const ExtendedPrecutForm: FunctionComponent<FormProps> = ({\n setSubProjects,\n setActiveForm,\n subProjects,\n selectedSubProject,\n setSelectedSubProject,\n autoFill,\n}) => {\n const { t } = useTranslation();\n const { offerOptions, modals, customer, orders } = useAppState();\n const actions = useActions();\n const effects = useEffects();\n const cancelToken: React.MutableRefObject<CancelTokenSource | null> =\n useRef(null);\n const [calc, setCalc] = useState<Calculation | undefined>(undefined);\n const [priceDisabled, setPriceDisabled] = useState<boolean>(true);\n const [showPriceButton, setShowPriceButton] = useState<boolean>(false);\n const [showToolTip, setShowToolTip] = useState<boolean>(false);\n const [openings, setOpenings] = useState<PrecutOpening[]>([\n {\n id: makeId(4),\n bearing: false,\n height: 400,\n width: 400,\n quantity: 0,\n },\n ]);\n const cancelCalculation = () => {\n if (cancelToken.current != null) {\n cancelToken.current.cancel();\n }\n // TODO remove\n setPriceDisabled(false);\n setShowPriceButton(false);\n actions.modals.calculatePriceModal.close();\n };\n\n const onSubmit = (data: DraftOrderSubProject) => {\n if (data.projectId === undefined || data.projectId.length < 1) {\n // eslint-disable-next-line no-param-reassign\n data.projectId = makeId(8);\n }\n if (calc !== undefined) {\n // eslint-disable-next-line no-param-reassign\n data.conditions = calc.conditions;\n // eslint-disable-next-line no-param-reassign\n data.preconditions = calc.preconditions;\n // eslint-disable-next-line no-param-reassign\n data.priceConditions = calc.priceConditions;\n }\n // eslint-disable-next-line no-param-reassign\n data.precutOpenings = openings;\n if (selectedSubProject !== undefined) {\n const newProjs = subProjects.map((x) => {\n if (x.projectId === data.projectId) {\n return {\n ...x,\n comment: data.comment,\n dimensionOuter:\n data.dimensionOuter ?? selectedSubProject.dimensionOuter,\n lengthOuter: data.lengthOuter ?? selectedSubProject.lengthOuter,\n numberOfCornersOuter:\n data.numberOfCornersOuter ??\n selectedSubProject.numberOfCornersOuter,\n dimensionInner:\n data.dimensionInner ?? selectedSubProject.dimensionInner,\n lengthInner: data.lengthInner ?? selectedSubProject.lengthInner,\n numberOfCornersInner:\n data.numberOfCornersInner ??\n selectedSubProject.numberOfCornersInner,\n wallHeight: data.wallHeight ?? selectedSubProject.wallHeight,\n precutOpenings: data.precutOpenings,\n price: data.price ?? selectedSubProject.price,\n calculationId:\n data.calculationId ?? selectedSubProject.calculationId,\n priceConditions:\n data.priceConditions ?? selectedSubProject.priceConditions,\n conditions: data.conditions ?? selectedSubProject.conditions,\n preconditions:\n data.preconditions ?? selectedSubProject.preconditions,\n roofRef: data.roofRef ?? selectedSubProject.roofRef,\n dimensionGavl:\n data.dimensionGavl ?? selectedSubProject.dimensionGavl,\n numberOfGavl: data.numberOfGavl ?? selectedSubProject.numberOfGavl,\n };\n }\n return x;\n });\n setSubProjects(newProjs);\n } else {\n setSubProjects([...subProjects, data]);\n }\n setActiveForm(\"\");\n setSelectedSubProject(undefined);\n };\n const onCancel = () => {\n setActiveForm(\"\");\n setSelectedSubProject(undefined);\n };\n const dimensions = offerOptions\n .filter(\n (o) =>\n o.type === OfferOptionType.PRECUT_DIMENSION &&\n !o.description.includes(\"Annet\")\n )\n .map((o) => ({ label: o.description, value: o.id }));\n const { register, handleSubmit, errors, setValue, getValues } =\n useForm<DraftOrderSubProject>({\n resolver: yupResolver(precut),\n defaultValues: selectedSubProject,\n });\n useEffect(() => {\n if (selectedSubProject) {\n if (selectedSubProject.price) {\n setCalc({\n price: selectedSubProject.price,\n uid: selectedSubProject.calculationId,\n conditions: selectedSubProject.conditions ?? [],\n preconditions: selectedSubProject.preconditions ?? [],\n specifications: [],\n freight: selectedSubProject.freight,\n priceConditions: selectedSubProject.priceConditions ?? [],\n });\n }\n if (selectedSubProject.precutOpenings !== undefined) {\n setOpenings(selectedSubProject.precutOpenings);\n }\n }\n }, [selectedSubProject]);\n const calclulatePrice = () => {\n actions.modals.calculatePriceModal.open();\n cancelToken.current = axios.CancelToken.source();\n const formValues = getValues([\n \"projectId\",\n \"numberOfTrusses\",\n \"angle\",\n \"workingWidth\",\n \"roofType\",\n \"rangeDistance\",\n \"roofingType\",\n \"protrusion\",\n \"roomHeight\",\n \"roomWidth\",\n ]);\n const uid =\n formValues.projectId !== null && formValues.projectId.length > 0\n ? formValues.projectId\n : makeId(4);\n const { currentNewOrder } = orders;\n const address: Address = {\n street: currentNewOrder.deliveryAddress,\n height: Number(currentNewOrder.mamsl),\n city: currentNewOrder.city,\n zipCode: currentNewOrder.zipCode,\n gardsnr:\n currentNewOrder.farmNumber !== null\n ? currentNewOrder.farmNumber.toString()\n : null,\n bruksnr:\n currentNewOrder.subFarmNumber !== null\n ? currentNewOrder.subFarmNumber.toString()\n : null,\n };\n const body: CalculationPayload = {\n uid,\n projectType: \"Takstol\",\n buildingType:\n currentNewOrder.buildingType.length > 0\n ? currentNewOrder.buildingType\n : null,\n CustomerId: customer.id,\n deliveryterms: currentNewOrder.deliveryTerms,\n\n address,\n };\n effects.api.order\n .calculateRoof(body, cancelToken.current)\n .then((data) => {\n setCalc(data);\n setValue(\"price\", data.price);\n setValue(\"calculationId\", data.uid);\n setValue(\"freight\", data.freight);\n cancelToken.current = null;\n actions.modals.calculatePriceModal.close();\n })\n .catch(() => {\n effects.toast(\"Noe gikk galt, vennligst prøv igjen senere\", 5000);\n cancelToken.current = null;\n actions.modals.calculatePriceModal.close();\n });\n };\n const toolTipContent = () => {\n return <div />;\n };\n const changeOpening = (id: string, field: string, value: any) => {\n const op = openings.map((x) => {\n if (x.id === id) {\n return { ...x, [field]: value };\n }\n return x;\n });\n setOpenings(op);\n };\n const deleteOpening = (id: string) => {\n const op = openings.filter((x) => x.id !== id);\n setOpenings(op);\n };\n const roofs = subProjects\n .filter((x) => x.type === \"extendedRoof\")\n .map((o) => ({\n label: o.comment.length > 0 ? o.comment : \"Tak\",\n value: o.projectId,\n }));\n const addOpening = () => {\n const opening: PrecutOpening = {\n id: makeId(4),\n bearing: false,\n height: 400,\n width: 400,\n quantity: 0,\n };\n setOpenings([...openings, opening]);\n };\n return (\n <form onSubmit={handleSubmit(onSubmit)}>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"space-evenly\",\n width: \"100%\",\n }}\n >\n <div>\n <input\n ref={register}\n type=\"hidden\"\n value=\"extendedPrecut\"\n name=\"type\"\n />\n <input ref={register} type=\"hidden\" name=\"projectId\" />\n <input ref={register} type=\"hidden\" name=\"price\" />\n <input ref={register} type=\"hidden\" name=\"calculationId\" />\n <input ref={register} type=\"hidden\" name=\"freight\" />\n {subProjects.some(\n (x) => x.calculationId !== undefined && x.type === \"extendedRoof\"\n ) ? (\n <div>\n <Header type=\"secondary\">Gavl</Header>\n <Select\n name=\"roofRef\"\n label=\"Velg tak\"\n options={roofs}\n inputRef={register}\n noDefault\n error={errors.dimensions?.message}\n disabled={\n autoFill &&\n selectedSubProject.dimensions !== null &&\n selectedSubProject.dimensions.length > 0\n }\n />\n <Select\n name=\"dimensionGavl\"\n label=\"Dimensjon precut\"\n options={dimensions}\n inputRef={register}\n error={errors.dimensions?.message}\n disabled={\n autoFill &&\n selectedSubProject.dimensions !== null &&\n selectedSubProject.dimensions.length > 0\n }\n />\n <FormInput\n label=\"Antall gavler\"\n type=\"number\"\n name=\"numberOfGavl\"\n inputRef={register}\n readonly={calc !== undefined}\n disabled={autoFill}\n error={errors.angle?.message}\n />\n </div>\n ) : null}\n <Header type=\"secondary\">Precut</Header>\n <div\n style={{\n display: \"flex\",\n flexDirection: \"row\",\n width: \"100%\",\n justifyContent: \"space-between\",\n }}\n >\n <div style={{ width: \"45%\" }}>\n <Select\n name=\"dimensionOuter\"\n label=\"Dimensjon yttervegg\"\n options={dimensions}\n inputRef={register}\n error={errors.dimensions?.message}\n required\n disabled={\n autoFill &&\n selectedSubProject.dimensions !== null &&\n selectedSubProject.dimensions.length > 0\n }\n />\n <FormInput\n label=\"Total vegglengde yttervegg\"\n type=\"number\"\n name=\"lengthOuter\"\n suffix=\"m\"\n inputRef={register}\n readonly={calc !== undefined}\n disabled={autoFill}\n error={errors.angle?.message}\n />\n <FormInput\n label=\"Antall ender / hjørner (yttervegg)\"\n type=\"number\"\n name=\"numberOfCornersOuter\"\n inputRef={register}\n readonly={calc !== undefined}\n disabled={autoFill}\n error={errors.angle?.message}\n />\n </div>\n <div style={{ width: \"45%\" }}>\n <Select\n name=\"dimensionInner\"\n label=\"Dimensjon innervegg\"\n options={dimensions}\n inputRef={register}\n error={errors.dimensions?.message}\n required\n disabled={\n autoFill &&\n selectedSubProject.dimensions !== null &&\n selectedSubProject.dimensions.length > 0\n }\n />\n <FormInput\n label=\"Total vegglengde innervegg\"\n type=\"number\"\n name=\"lengthInner\"\n suffix=\"m\"\n inputRef={register}\n readonly={calc !== undefined}\n disabled={autoFill}\n error={errors.angle?.message}\n />\n <FormInput\n label=\"Antall ender / hjørner (innervegg)\"\n type=\"number\"\n name=\"numberOfCornersInner\"\n inputRef={register}\n readonly={calc !== undefined}\n disabled={autoFill}\n error={errors.angle?.message}\n />\n </div>\n </div>\n <div\n style={{\n display: \"flex\",\n flexDirection: \"row\",\n columnGap: \"2rem\",\n alignItems: \"center\",\n alignContent: \"center\",\n }}\n >\n <FormInput\n label=\"Vegghøyde\"\n type=\"number\"\n name=\"wallHeight\"\n suffix=\"mm\"\n inputRef={register}\n readonly={calc !== undefined}\n disabled={autoFill}\n error={errors.angle?.message}\n />\n\n <BlockButton\n style={{\n width: \"12em\",\n fontSize: \"1rem\",\n alignSelf: \"center\",\n marginTop: \"2rem\",\n }}\n disabled={openings.length >= 6}\n type=\"button\"\n onClick={() => addOpening()}\n >\n Legg til ny åpning\n </BlockButton>\n </div>\n {openings.length > 0 ? (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"row\",\n columnGap: \"2rem\",\n alignItems: \"center\",\n alignContent: \"center\",\n }}\n >\n <span style={{ width: \"5rem\" }} />\n <span style={{ width: \"8rem\" }}>Antall åpninger</span>\n <span style={{ width: \"8rem\" }}>Bredde(mm)</span>\n <span style={{ width: \"8rem\" }}>Høyde(mm)</span>\n <span>Bærende</span>\n <span />\n </div>\n ) : null}\n {openings.map((x, idx) => {\n return (\n <PrecutOpeningRow\n key={x.id}\n opening={x}\n changeOpening={changeOpening}\n deleteOpening={deleteOpening}\n idx={idx}\n />\n );\n })}\n <TextArea\n label={t(\"Kommentar\")}\n name=\"comment\"\n rows={3}\n inputRef={register}\n placeholder={t(\"Write other required info here\")}\n defaultValue={errors.comment?.message}\n />\n {/* calc === undefined && showPriceButton ? (\n <div\n style={{\n display: \"inline\",\n position: \"relative\",\n }}\n onMouseEnter={() => setShowToolTip(true)}\n onMouseLeave={() => setShowToolTip(false)}\n >\n <Tooltip show={showToolTip}>{toolTipContent()}</Tooltip>\n {<BlockButton\n style={{\n marginRight: \"2em\",\n backgroundColor: priceDisabled ? \"gray\" : \"green\",\n width: \"12em\",\n }}\n onClick={() => calclulatePrice()}\n type=\"button\"\n disabled={priceDisabled}\n >\n Beregn pris\n </BlockButton> }\n </div>\n ) : calc ? (\n <BlockButton\n style={{\n marginRight: \"2em\",\n backgroundColor: \"green\",\n width: \"12em\",\n }}\n onClick={() => setCalc(undefined)}\n type=\"button\"\n >\n Rediger\n </BlockButton>\n ) : null */}\n <CMSContent contentId={1475} />\n <CMSContent contentId={CMSArticles.PRECUT_INFO} />\n </div>\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"space-between\",\n }}\n >\n <div style={{ width: \"576px\" }}>\n <CalculationPriceAndError calc={calc} />\n </div>\n <div\n style={{\n display: \"flex\",\n alignContent: \"center\",\n alignItems: \"flex-end\",\n flexDirection: \"row\",\n justifyContent: \"flex-start\",\n marginTop: \"auto\",\n }}\n >\n <BlockButton\n style={{ marginRight: \"2em\", width: \"12em\", fontSize: \"1rem\" }}\n type=\"submit\"\n >\n {selectedSubProject !== undefined ? \"Oppdater\" : \"Legg til\"}\n </BlockButton>\n <BlockButton\n style={{ width: \"12em\", fontSize: \"1rem\" }}\n onClick={() => onCancel()}\n type=\"button\"\n >\n Avbryt\n </BlockButton>\n </div>\n <CalcConditions calc={calc} />\n </div>\n </div>\n {modals.calculatePriceModal.isCurrent ? (\n <CalculatePriceModal cancelCalculation={cancelCalculation} />\n ) : null}\n </form>\n );\n};\n","/* eslint-disable @typescript-eslint/no-unused-vars */\nimport React, {\n FunctionComponent,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\n\nimport { useTranslation } from \"react-i18next\";\nimport { useForm } from \"react-hook-form\";\nimport { TextArea } from \"@frontend/common/src/components/TextArea/TextArea\";\nimport { yupResolver } from \"@hookform/resolvers/yup\";\nimport * as yup from \"yup\";\nimport * as validators from \"@frontend/common/src/validators\";\nimport axios, { CancelTokenSource } from \"axios\";\nimport { FormInput } from \"@frontend/common/src/elements/FormInput/FormInput\";\nimport { Select } from \"../../../components/Select/Select\";\n\nimport { useActions, useAppState, useEffects } from \"../../../overmind\";\nimport { OfferOptionType } from \"../../../types/OfferOption\";\nimport { FormProps } from \"./RoofForm\";\nimport { BlockButton } from \"../../../components/Buttons/Buttons.styles\";\nimport { DraftOrderSubProject } from \"../../../types/DraftOrder/DraftOrderSubProject\";\nimport { makeId } from \"../../../helpers/GenerateId\";\nimport { CalculationPriceAndError } from \"./CalculationPriceAndError\";\nimport { CalcConditions } from \"./CalcConditions\";\nimport { CalculatePriceModal } from \"../../../modals/CalculatePriceModal/CalculatePriceModal\";\nimport {\n Address,\n Calculation,\n CalculationPayload,\n} from \"../../../types/DraftOrder/Calculation\";\nimport Tooltip from \"./Tooltip\";\nimport { CMSContent } from \"../../../components/CMSContent/CMSContent\";\n\nexport const ExtendedBeamLayerForm: FunctionComponent<FormProps> = ({\n setSubProjects,\n setActiveForm,\n subProjects,\n setSelectedSubProject,\n selectedSubProject,\n autoFill,\n}) => {\n const { t } = useTranslation();\n const { offerOptions, modals, orders, customer } = useAppState();\n const actions = useActions();\n const effects = useEffects();\n const cancelToken: React.MutableRefObject<CancelTokenSource | null> =\n useRef(null);\n const [calc, setCalc] = useState<Calculation | undefined>(undefined);\n const [priceDisabled, setPriceDisabled] = useState<boolean>(true);\n const [showPriceButton, setShowPriceButton] = useState<boolean>(false);\n const [showToolTip, setShowToolTip] = useState<boolean>(false);\n const joists = yup.object().shape({\n joistsType: validators.string,\n // submergeWetRoom: autoFill ? validators.string : validators.requiredField,\n millimetersImmersed: validators.positiveNumeric,\n });\n\n const cancelCalculation = () => {\n if (cancelToken.current != null) {\n cancelToken.current.cancel();\n }\n // TODO remove\n setPriceDisabled(false);\n setShowPriceButton(false);\n actions.modals.calculatePriceModal.close();\n };\n const onSubmit = (data: DraftOrderSubProject) => {\n if (data.projectId === undefined || data.projectId.length < 1) {\n // eslint-disable-next-line no-param-reassign\n data.projectId = makeId(8);\n }\n if (calc !== undefined) {\n // eslint-disable-next-line no-param-reassign\n data.conditions = calc.conditions;\n // eslint-disable-next-line no-param-reassign\n data.preconditions = calc.preconditions;\n // eslint-disable-next-line no-param-reassign\n data.priceConditions = calc.priceConditions;\n }\n // eslint-disable-next-line no-param-reassign\n data.submergeWetRoom = data.totalAmountImmersed > 0 ? \"Ja\" : \"Nei\";\n if (selectedSubProject !== undefined) {\n const newProjs = subProjects.map((x) => {\n if (x.projectId === data.projectId) {\n return {\n ...x,\n comment: data.comment,\n joistsType: data.joistsType ?? selectedSubProject.joistsType,\n submergeWetRoom:\n data.submergeWetRoom ?? selectedSubProject.submergeWetRoom,\n totalAmountJoists:\n data.totalAmountJoists ?? selectedSubProject.totalAmountJoists,\n totalAmountImmersed:\n data.totalAmountImmersed ??\n selectedSubProject.totalAmountImmersed,\n steelBeamLength:\n data.steelBeamLength ?? selectedSubProject.steelBeamLength,\n };\n }\n return x;\n });\n setSubProjects(newProjs);\n } else {\n setSubProjects([...subProjects, data]);\n }\n setActiveForm(\"\");\n setSelectedSubProject(undefined);\n };\n const onCancel = () => {\n setActiveForm(\"\");\n setSelectedSubProject(undefined);\n };\n\n const { register, handleSubmit, errors, getValues, setValue } =\n useForm<DraftOrderSubProject>({\n // @ts-ignore\n resolver: yupResolver(joists),\n defaultValues: selectedSubProject,\n });\n const joistsTypes = useMemo(\n () =>\n offerOptions\n .filter((o) => o.type === OfferOptionType.JOIST_TYPE)\n .map((o) => ({ label: o.description, value: o.id })),\n [offerOptions]\n );\n\n useEffect(() => {\n if (selectedSubProject) {\n if (selectedSubProject.price) {\n setCalc({\n price: selectedSubProject.price,\n uid: selectedSubProject.calculationId,\n conditions: selectedSubProject.conditions ?? [],\n preconditions: selectedSubProject.preconditions ?? [],\n specifications: [],\n freight: selectedSubProject.freight,\n priceConditions: selectedSubProject.priceConditions ?? [],\n });\n }\n }\n }, [selectedSubProject]);\n const calclulatePrice = () => {\n actions.modals.calculatePriceModal.open();\n cancelToken.current = axios.CancelToken.source();\n const formValues = getValues([\n \"projectId\",\n \"numberOfTrusses\",\n \"angle\",\n \"workingWidth\",\n \"roofType\",\n \"rangeDistance\",\n \"roofingType\",\n \"protrusion\",\n \"roomHeight\",\n \"roomWidth\",\n ]);\n const uid =\n formValues.projectId !== null && formValues.projectId.length > 0\n ? formValues.projectId\n : makeId(4);\n const { currentNewOrder } = orders;\n const address: Address = {\n street: currentNewOrder.deliveryAddress,\n height: Number(currentNewOrder.mamsl),\n city: currentNewOrder.city,\n zipCode: currentNewOrder.zipCode,\n gardsnr:\n currentNewOrder.farmNumber !== null\n ? currentNewOrder.farmNumber.toString()\n : null,\n bruksnr:\n currentNewOrder.subFarmNumber !== null\n ? currentNewOrder.subFarmNumber.toString()\n : null,\n };\n const body: CalculationPayload = {\n uid,\n projectType: \"Takstol\",\n buildingType:\n currentNewOrder.buildingType.length > 0\n ? currentNewOrder.buildingType\n : null,\n CustomerId: customer.id,\n deliveryterms: currentNewOrder.deliveryTerms,\n\n address,\n };\n effects.api.order\n .calculateRoof(body, cancelToken.current)\n .then((data) => {\n setCalc(data);\n setValue(\"price\", data.price);\n setValue(\"calculationId\", data.uid);\n setValue(\"freight\", data.freight);\n cancelToken.current = null;\n actions.modals.calculatePriceModal.close();\n })\n .catch(() => {\n effects.toast(\"Noe gikk galt, vennligst prøv igjen senere\", 5000);\n cancelToken.current = null;\n actions.modals.calculatePriceModal.close();\n });\n };\n const toolTipContent = () => {\n return <div />;\n };\n return (\n <form onSubmit={handleSubmit(onSubmit)}>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"space-evenly\",\n width: \"100%\",\n }}\n >\n <div>\n <input\n ref={register}\n type=\"hidden\"\n value=\"extendedBeamlayer\"\n name=\"type\"\n />\n <input ref={register} type=\"hidden\" name=\"projectId\" />\n\n <Select\n name=\"joistsType\"\n label={t(\"Pick joist type\")}\n options={joistsTypes}\n inputRef={register}\n disabled={\n autoFill &&\n selectedSubProject.joistsType !== null &&\n selectedSubProject.joistsType.length > 0\n }\n error={errors.joistsType?.message}\n />\n <FormInput\n label=\"Total mengde bjelkelag\"\n type=\"number\"\n name=\"totalAmountJoists\"\n suffix=\"m2\"\n inputRef={register}\n readonly={calc !== undefined}\n disabled={autoFill}\n error={errors.angle?.message}\n />\n <FormInput\n label=\"Andel nedsenket bjelkelag\"\n type=\"number\"\n name=\"totalAmountImmersed\"\n suffix=\"m2\"\n inputRef={register}\n readonly={calc !== undefined}\n disabled={autoFill}\n error={errors.angle?.message}\n />\n <FormInput\n label=\"Lengde innfelt stålbjelke\"\n type=\"number\"\n name=\"steelBeamLength\"\n suffix=\"m\"\n inputRef={register}\n readonly={calc !== undefined}\n disabled={autoFill}\n error={errors.angle?.message}\n />\n\n <TextArea\n label={t(\"Kommentar\")}\n name=\"comment\"\n rows={3}\n inputRef={register}\n placeholder={t(\"Write other required info here\")}\n />\n {/* calc === undefined && showPriceButton ? (\n <div\n style={{\n display: \"inline\",\n position: \"relative\",\n }}\n onMouseEnter={() => setShowToolTip(true)}\n onMouseLeave={() => setShowToolTip(false)}\n >\n <Tooltip show={showToolTip}>{toolTipContent()}</Tooltip>\n <BlockButton\n style={{\n marginRight: \"2em\",\n backgroundColor: priceDisabled ? \"gray\" : \"green\",\n width: \"12em\",\n }}\n onClick={() => calclulatePrice()}\n type=\"button\"\n disabled={priceDisabled}\n >\n Beregn pris\n </BlockButton>\n </div>\n ) : calc ? (\n <BlockButton\n style={{\n marginRight: \"2em\",\n backgroundColor: \"green\",\n width: \"12em\",\n }}\n onClick={() => setCalc(undefined)}\n type=\"button\"\n >\n Rediger\n </BlockButton>\n ) : null */}\n <CMSContent contentId={1475} />\n </div>\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"space-between\",\n }}\n >\n <div style={{ width: \"576px\" }}>\n <CalculationPriceAndError calc={calc} />\n </div>\n <div\n style={{\n display: \"flex\",\n alignContent: \"center\",\n alignItems: \"flex-end\",\n flexDirection: \"row\",\n justifyContent: \"flex-start\",\n marginTop: \"auto\",\n }}\n >\n <BlockButton\n style={{ marginRight: \"2em\", width: \"12em\", fontSize: \"1rem\" }}\n type=\"submit\"\n >\n {selectedSubProject !== undefined ? \"Oppdater\" : \"Legg til\"}\n </BlockButton>\n <BlockButton\n style={{ width: \"12em\", fontSize: \"1rem\" }}\n onClick={() => onCancel()}\n type=\"button\"\n >\n Avbryt\n </BlockButton>\n </div>\n <CalcConditions calc={calc} />\n </div>\n </div>\n {modals.calculatePriceModal.isCurrent ? (\n <CalculatePriceModal cancelCalculation={cancelCalculation} />\n ) : null}\n </form>\n );\n};\n","import React, { FunctionComponent, useEffect, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { Page } from \"@frontend/common/src/types/Page\";\nimport { CMSArticles } from \"@frontend/common/src/types/CMSArticle\";\nimport { CMSContent } from \"../../../components/CMSContent/CMSContent\";\nimport { RoofForm } from \"./RoofForm\";\nimport {\n BlockButton,\n ChooseProductPageButton,\n LinkButton,\n} from \"../../../components/Buttons/Buttons.styles\";\nimport { createUrl } from \"../../../app/pages\";\nimport { useActions, useAppState, useEffects } from \"../../../overmind\";\nimport {\n ButtonWrapper,\n ChooseProductPageMainContainer,\n PageFlexConstraint,\n} from \"./CreateOrderPage.styles\";\n\nimport { SubProjects } from \"./SubProjects\";\nimport { JoistsForm } from \"./JointsForm\";\nimport { PrecutForm } from \"./PrecutForm\";\nimport { DraftOrderSubProject } from \"../../../types/DraftOrder/DraftOrderSubProject\";\nimport { TechnicalServicesForm } from \"./TechnicalServicesForm\";\nimport { Header } from \"../../../elements/Header/Header\";\nimport { ExtendedRoofForm } from \"./ExtendedRoofForm\";\nimport { ExtendedPrecutForm } from \"./ExtendedPrecutForm\";\nimport { ExtendedBeamLayerForm } from \"./ExtendedBeamLayerForm\";\n\nexport const ChooseProductPage: FunctionComponent = () => {\n const effects = useEffects();\n const actions = useActions();\n const { t } = useTranslation();\n const { orders } = useAppState();\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const [subProjects, setSubProjects] = useState<DraftOrderSubProject[]>([]);\n const [selectedSubProject, setSelectedSubProject] = useState<\n DraftOrderSubProject | undefined\n >(undefined);\n const [activeForm, setActiveForm] = useState<string>(\"\");\n useEffect(() => {\n if (orders.quickChoice !== null) {\n setActiveForm(orders.quickChoice);\n }\n }, [orders.quickChoice]);\n useEffect(() => {\n if (orders.currentNewOrder.subProjects) {\n setSubProjects(orders.currentNewOrder.subProjects);\n if (\n orders.quickChoice !== undefined &&\n orders.currentNewOrder.subProjects.length > 0 &&\n orders.autofill !== null\n ) {\n setSelectedSubProject(orders.currentNewOrder.subProjects[0]);\n }\n } else if (orders.autofill?.subProjects !== undefined) {\n setSubProjects(orders.autofill.subProjects);\n }\n }, [orders.currentNewOrder.subProjects, orders.autofill]);\n\n const onSubmit = () => {\n actions.orders.setSubProjectsOnDraftOrder(subProjects);\n effects.router.navigateTo(\n createUrl(Page.CREATE_ORDER, { slug: \"vedlegg\" })\n );\n };\n useEffect(() => {\n if (\n subProjects.length === 1 &&\n orders.quickChoice !== undefined &&\n activeForm.length === 0\n ) {\n onSubmit();\n }\n }, [subProjects, activeForm]);\n const onBackButtonClicked = () => {\n actions.orders.setSubProjectsOnDraftOrder(subProjects);\n effects.router.navigateTo(\n createUrl(Page.CREATE_ORDER, { slug: \"kundeinfo\" })\n );\n };\n const onFormButtonClick = (form: string) => {\n setActiveForm(form);\n setSelectedSubProject(undefined);\n };\n return (\n <div\n style={{\n width: \"100%\",\n }}\n >\n <PageFlexConstraint>\n <div\n style={{\n width: \"100%\",\n }}\n >\n <Header type=\"secondary\">4. Produktvalg</Header>\n <CMSContent contentId={CMSArticles.ORDER_SELECTION_HELPER} />\n </div>\n </PageFlexConstraint>\n\n <ChooseProductPageMainContainer>\n {orders.quickChoice !== undefined ? null : (\n <SubProjects\n selectedSubProject={selectedSubProject}\n setSelectedSubProject={setSelectedSubProject}\n subProjects={subProjects}\n setSubProjects={setSubProjects}\n setActiveForm={setActiveForm}\n autoFill={orders.autofill?.offerId !== undefined}\n />\n )}\n <div style={{ width: \"100%\" }}>\n {orders.quickChoice !== undefined ||\n (activeForm !== \"\" && activeForm !== undefined) ? null : (\n <ButtonWrapper>\n {orders.isQuote ? (\n <ChooseProductPageButton\n onClick={() => onFormButtonClick(\"extendedRoof\")}\n active={false}\n disabled={orders.autofill?.offerId !== undefined}\n extended\n >\n {t(\"AddRoof\")}\n </ChooseProductPageButton>\n ) : (\n <ChooseProductPageButton\n onClick={() => onFormButtonClick(\"roof\")}\n active={false}\n disabled={orders.autofill?.offerId !== undefined}\n >\n {t(\"AddRoof\")}\n </ChooseProductPageButton>\n )}\n\n <ChooseProductPageButton\n onClick={() => onFormButtonClick(\"beamlayer\")}\n active={false}\n disabled={orders.autofill?.offerId !== undefined}\n >\n {t(\"AddBeamlayer\")}\n </ChooseProductPageButton>\n\n <ChooseProductPageButton\n onClick={() => onFormButtonClick(\"precut\")}\n active={false}\n disabled={orders.autofill?.offerId !== undefined}\n >\n {t(\"AddPrecut\")}\n </ChooseProductPageButton>\n\n <ChooseProductPageButton\n onClick={() => onFormButtonClick(\"technical\")}\n active={false}\n disabled={orders.autofill?.offerId !== undefined}\n >\n {t(\"AddTechnical\")}\n </ChooseProductPageButton>\n </ButtonWrapper>\n )}\n {activeForm === \"roof\" && (\n <RoofForm\n setSelectedSubProject={setSelectedSubProject}\n selectedSubProject={selectedSubProject}\n setActiveForm={setActiveForm}\n setSubProjects={setSubProjects}\n subProjects={subProjects}\n autoFill={orders.autofill?.offerId !== undefined}\n />\n )}\n {activeForm === \"extendedRoof\" && (\n <ExtendedRoofForm\n setSelectedSubProject={setSelectedSubProject}\n selectedSubProject={selectedSubProject}\n setActiveForm={setActiveForm}\n setSubProjects={setSubProjects}\n subProjects={subProjects}\n autoFill={orders.autofill?.offerId !== undefined}\n quickChoice={orders.quickChoice}\n onMainCancel={onBackButtonClicked}\n />\n )}\n {activeForm === \"beamlayer\" && (\n <JoistsForm\n setSelectedSubProject={setSelectedSubProject}\n selectedSubProject={selectedSubProject}\n setActiveForm={setActiveForm}\n setSubProjects={setSubProjects}\n subProjects={subProjects}\n autoFill={orders.autofill?.offerId !== undefined}\n />\n )}\n {activeForm === \"extendedBeamlayer\" && (\n <ExtendedBeamLayerForm\n setSelectedSubProject={setSelectedSubProject}\n selectedSubProject={selectedSubProject}\n setActiveForm={setActiveForm}\n setSubProjects={setSubProjects}\n subProjects={subProjects}\n autoFill={orders.autofill?.offerId !== undefined}\n />\n )}\n {activeForm === \"precut\" && (\n <PrecutForm\n setSelectedSubProject={setSelectedSubProject}\n selectedSubProject={selectedSubProject}\n setActiveForm={setActiveForm}\n setSubProjects={setSubProjects}\n subProjects={subProjects}\n autoFill={orders.autofill?.offerId !== undefined}\n />\n )}\n {activeForm === \"extendedPrecut\" && (\n <ExtendedPrecutForm\n setSelectedSubProject={setSelectedSubProject}\n selectedSubProject={selectedSubProject}\n setActiveForm={setActiveForm}\n setSubProjects={setSubProjects}\n subProjects={subProjects}\n autoFill={orders.autofill?.offerId !== undefined}\n />\n )}\n {activeForm === \"technical\" && (\n <TechnicalServicesForm\n setSelectedSubProject={setSelectedSubProject}\n selectedSubProject={selectedSubProject}\n setActiveForm={setActiveForm}\n setSubProjects={setSubProjects}\n subProjects={subProjects}\n autoFill={orders.autofill?.offerId !== undefined}\n quickChoice={orders.quickChoice}\n onMainCancel={onBackButtonClicked}\n />\n )}\n </div>\n </ChooseProductPageMainContainer>\n <div\n style={{\n display: activeForm ? \"none\" : \"flex\",\n justifyContent: \"flex-end\",\n }}\n >\n <div style={{ display: \"flex\", width: \"30vw\", marginTop: \"2rem\" }}>\n <BlockButton\n disabled={subProjects.length === 0}\n style={{ width: \"1000px\" }}\n onClick={() => onSubmit()}\n >\n Neste\n </BlockButton>\n <LinkButton as=\"a\" onClick={onBackButtonClicked}>\n {t(\"Tilbake\")}\n </LinkButton>\n </div>\n </div>\n </div>\n );\n};\n","import React, { FunctionComponent } from \"react\";\nimport { Label } from \"@frontend/common/src/elements/Label/Label\";\nimport { Input } from \"./FormInput.styles\";\nimport { FormControl, Error } from \"../../elements/FormControl/FormControl\";\nimport { RequiredFieldIndicator } from \"../../elements/RequiredFieldIndicator/RequiredFieldIndicator\";\n\ntype Props = {\n htmlFor?: string;\n label?: string;\n name: string;\n type: string;\n placeholder?: string;\n defaultValue?: string;\n inputRef?: any;\n error?: any;\n required?: boolean;\n // eslint-disable-next-line no-unused-vars\n onChange?: (value: string) => void;\n readonly?: any;\n disabled?: any;\n};\nexport const FormInput: FunctionComponent<Props> = ({\n htmlFor,\n label,\n name,\n type,\n placeholder,\n defaultValue,\n inputRef,\n error,\n required,\n onChange,\n disabled,\n readonly,\n}) => {\n return (\n <FormControl>\n <Label htmlFor={htmlFor}>\n {label || null}\n {required ? <RequiredFieldIndicator /> : \"\"}\n </Label>\n {/* <InputWrapper> */}\n <Input\n readOnly={readonly}\n name={name}\n type={type}\n placeholder={placeholder}\n defaultValue={defaultValue}\n ref={inputRef}\n error={!!error}\n disabled={disabled}\n onChange={(e) => (onChange ? onChange(e.target.value) : () => {})}\n />\n {/* {suffix ? <Suffix>test</Suffix> : null} */}\n {/* </InputWrapper> */}\n\n {error ? <Error>{error}</Error> : null}\n </FormControl>\n );\n};\n","import React, { ChangeEvent, FunctionComponent, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { FileInput } from \"@frontend/common/src/elements/FileInput/FileInput\";\nimport { Controller, useForm } from \"react-hook-form\";\nimport { yupResolver } from \"@hookform/resolvers/yup\";\nimport * as yup from \"yup\";\nimport * as validators from \"@frontend/common/src/validators\";\nimport { TextArea } from \"@frontend/common/src/components/TextArea/TextArea\";\nimport {\n BlockButton,\n LinkButton,\n} from \"@frontend/common/src/elements/Buttons/Buttons.styles\";\n\nimport { Page } from \"@frontend/common/src/types/Page\";\nimport { CMSArticles } from \"@frontend/common/src/types/CMSArticle\";\nimport { Header } from \"../../../elements/Header/Header\";\nimport { useActions, useEffects } from \"../../../overmind\";\nimport { CMSContent } from \"../../../components/CMSContent/CMSContent\";\nimport { createUrl } from \"../../../app/pages\";\n\nimport { FormInput } from \"../../../components/FormInput/FormInput\";\nimport { Checkbox } from \"../../../components/Checkbox/Checkbox\";\nimport { DraftOrder } from \"../../../types/DraftOrder/DraftOrder\";\nimport { ColumnWrapper, HeaderWrapper, Text } from \"./CreateOrderPage.styles\";\n\nexport const Attachments: FunctionComponent = () => {\n const { t } = useTranslation();\n const effects = useEffects();\n const actions = useActions();\n\n const [comment, setComment] = useState(\"\");\n\n const [files, setFiles] = useState<File[]>([]);\n\n const { register, control, handleSubmit, errors, watch } =\n useForm<DraftOrder>({\n resolver: yupResolver(\n yup.object().shape({\n expectedDrawingDate: yup.mixed().when(\"hasDrawings\", {\n is: true,\n then: validators.dateInFuture.required(),\n }),\n })\n ),\n });\n\n const hasDrawings = watch(\"hasDrawings\") as boolean;\n const addFiles = (f: FileList) => {\n const file = files.concat(Array.from(f));\n setFiles(file);\n };\n const removeFile = (name: string) => {\n setFiles(files.filter((x) => x.name !== name));\n };\n const onSubmit = (data: DraftOrder) => {\n actions.orders.updateDraftOrder({ ...data, additionalInfo: comment });\n actions.orders.setDraftOfferFiles(files);\n effects.router.navigateTo(\n createUrl(Page.CREATE_ORDER, { slug: \"oppsummering\" })\n );\n };\n\n return (\n <form\n onSubmit={handleSubmit(onSubmit)}\n style={{ display: \"flex\", flexDirection: \"row\" }}\n >\n <div>\n <HeaderWrapper>\n <Header type=\"secondary\">5. {t(\"Attachments\")}</Header>\n </HeaderWrapper>\n <ColumnWrapper>\n <Text>\n <CMSContent contentId={CMSArticles.ATTACHMENT_INFO_ORDERS} />\n </Text>\n <FileInput\n name=\"upload\"\n label={t(\"Attach document\")}\n multiple\n onChange={(f) => {\n addFiles(f);\n }}\n />\n <TextArea\n label={t(\"Add additional info here\")}\n name=\"additionalInfo\"\n rows={7}\n value={comment}\n onChange={(e: ChangeEvent<HTMLTextAreaElement>) =>\n setComment(e.target.value)\n }\n />\n <div style={{ display: \"flex\" }}>\n <BlockButton style={{ width: \"1000px\" }} type=\"submit\">\n Neste\n </BlockButton>\n <LinkButton\n as=\"a\"\n href={createUrl(Page.CREATE_ORDER, { slug: \"produktvalg\" })}\n >\n {t(\"Tilbake\")}\n </LinkButton>\n </div>\n </ColumnWrapper>\n </div>\n\n <ColumnWrapper>\n <Controller\n name=\"expectedDrawingDate\"\n control={control}\n render={(props) => (\n <Checkbox\n name=\"hasDrawings\"\n checked={props.value}\n onChange={(e) => props.onChange(e.target.checked)}\n label=\"Har ikke tegninger\"\n inputRef={register}\n />\n )}\n />\n <CMSContent contentId={CMSArticles.ORDER_NO_DRAWINGS} />\n <FormInput\n name=\"expectedDrawingDate\"\n type=\"date\"\n label={t(\"Forventet levering på tegninger\")}\n inputRef={register}\n error={errors.expectedDrawingDate?.message}\n required={hasDrawings}\n disabled={!hasDrawings}\n />\n <Text>Valgte filer for prosjekt: </Text>\n {files.map((x) => {\n return (\n <div style={{ marginBottom: \"0.5em\" }}>\n <button\n type=\"button\"\n onClick={() => removeFile(x.name)}\n style={{ marginRight: \"2em\" }}\n >\n Fjern fil\n </button>\n {x.name}\n </div>\n );\n })}\n </ColumnWrapper>\n </form>\n );\n};\n","import React, { useMemo, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { CMSArticles } from \"@frontend//common/src/types/CMSArticle\";\nimport { Page } from \"@frontend/common/src/types/Page\";\nimport { DateFormat, formatDate } from \"@frontend/common/src/helpers/date\";\nimport { CMSContent } from \"../../../components/CMSContent/CMSContent\";\nimport { Checkbox } from \"../../../components/Checkbox/Checkbox\";\nimport { Header } from \"../../../elements/Header/Header\";\nimport {\n BlockButton,\n LinkButton,\n} from \"../../../components/Buttons/Buttons.styles\";\nimport { useActions, useAppState, useEffects } from \"../../../overmind\";\nimport { createUrl } from \"../../../app/pages\";\nimport {\n PageFlexConstraint,\n StyledList,\n StyledSection,\n} from \"./CreateOrderPage.styles\";\nimport { OfferOptionType } from \"../../../types/OfferOption\";\nimport { DraftOrderSubProject } from \"../../../types/DraftOrder/DraftOrderSubProject\";\n\nexport const Summary: React.FunctionComponent = () => {\n const { t } = useTranslation();\n const actions = useActions();\n const effects = useEffects();\n const {\n customer,\n offerOptions,\n orders: { currentNewOrder: order, autofill },\n } = useAppState();\n\n const roofTypes = offerOptions\n .filter((o) => o.type === OfferOptionType.ROOF)\n .map((o) => ({ label: o.description, value: o.id }));\n\n const joistsTypes = useMemo(\n () =>\n offerOptions\n .filter((o) => o.type === OfferOptionType.JOIST_TYPE)\n .map((o) => ({ label: o.description, value: o.id })),\n [offerOptions]\n );\n\n const dimensions = useMemo(\n () =>\n offerOptions\n .filter((o) => o.type === OfferOptionType.PRECUT_DIMENSION)\n .map((o) => ({ label: o.description, value: o.id })),\n [offerOptions]\n );\n\n const deterimineProductName = (subProj: DraftOrderSubProject) => {\n let returnVal = \"\";\n if (subProj.type === \"technical\") {\n returnVal = \"Tekniske tjenester\";\n } else if (subProj.type === \"roof\" || subProj.type === \"extendedRoof\") {\n const roof = roofTypes.find(\n (x) => x.value.toString() === subProj.roofType\n );\n returnVal = roof ? roof.label : \"\";\n } else if (\n subProj.type === \"beamlayer\" ||\n subProj.type === \"extendedBeamlayer\"\n ) {\n const joist = joistsTypes.find(\n (x) => x.value.toString() === subProj.joistsType\n );\n returnVal = joist ? joist.label : \"\";\n } else if (subProj.type === \"precut\" || subProj.type === \"extendedPrecut\") {\n const dim = dimensions.find(\n (x) => x.value.toString() === subProj.dimensions\n );\n returnVal = `Precut ${dim ? dim.label : \"\"}`;\n } else {\n returnVal = subProj.type;\n }\n return returnVal !== \"\" ? returnVal : subProj.type;\n };\n const requiredCheckboxItems = offerOptions.filter((o) => o.type === 10);\n\n const [checkboxes, setChecboxes] = useState<{ [index: string]: boolean }>({});\n const [submitting, setSumbitting] = useState(false);\n const onConfirm = async () => {\n const cb = Object.values(checkboxes);\n if (cb.length !== requiredCheckboxItems.length || cb.some((c) => !c)) {\n effects.toast(\"Se over sjekkliste\", 5000);\n return;\n }\n setSumbitting(true);\n await actions.orders\n .commitDraftOrder({\n customerId: customer.id,\n order,\n offerId: autofill?.offerId,\n })\n .finally(() => {\n setSumbitting(false);\n });\n };\n const deliveryText = (deleted: boolean) => {\n if (deleted) {\n return \", fjernet\";\n }\n if (\n order.preferredDeliveryDate !== null &&\n order.preferredDeliveryDate !== undefined\n ) {\n const formatted = formatDate(\n order.preferredDeliveryDate,\n DateFormat.REGULAR\n );\n if (formatted === null) return \"\";\n return `, levering ${formatted}`;\n }\n return \"\";\n };\n return (\n <PageFlexConstraint\n itemWidth=\"40vw\"\n style={{ display: \"grid\", gridTemplateColumns: \"1fr 1fr\" }}\n >\n <StyledSection>\n <Header type=\"secondary\">6. {t(\"Oppsummering\")}</Header>\n <article>\n <p>Oppsummering: </p>\n <ul style={{ paddingLeft: \"20px\" }}>\n {order.subProjects.map((x) => {\n return (\n <StyledList key={x.projectId}>\n {deterimineProductName(x)} {deliveryText(x.deleted)}\n </StyledList>\n );\n })}\n </ul>\n {order.subProjects.length > 1 ? (\n <CMSContent contentId={CMSArticles.ORDER_SUMMARY_MULTIPLE} />\n ) : null}\n </article>\n\n <article>\n <b>Byggeaddresse:</b>\n <p>{order.deliveryAddress}</p>\n <p>{`${order.zipCode} ${order.city}`}</p>\n </article>\n\n {order.deliveryTerms === \"Hentes fabrikk\" ? (\n <article>\n <p>{order.deliveryTerms}</p>\n </article>\n ) : (\n <article>\n <b>Leveringsadresse:</b>\n <p>{order.deliveryAddress2 ?? order.deliveryAddress}</p>\n <p>\n {order.deliveryAddress2\n ? `${order.zipCode2} ${order.city2}`\n : `${order.zipCode} ${order.city}`}\n </p>\n </article>\n )}\n\n <article>\n {offerOptions\n .filter((o) => o.type === 10)\n .map((option) => (\n <Checkbox\n key={option.id}\n label={option.description}\n checked={checkboxes[option.id]}\n onChange={(e) => {\n setChecboxes({\n ...checkboxes,\n [option.id]: e.target.checked,\n });\n }}\n />\n ))}\n </article>\n\n <section\n style={{\n display: \"grid\",\n gridTemplateColumns: \"2fr 1fr\",\n gap: \"1rem\",\n }}\n >\n <BlockButton onClick={onConfirm} type=\"submit\" disabled={submitting}>\n {t(\"Done\")}\n </BlockButton>\n <LinkButton\n as=\"a\"\n href={createUrl(Page.CREATE_ORDER, { slug: \"vedlegg\" })}\n >\n {t(\"Tilbake\")}\n </LinkButton>\n </section>\n </StyledSection>\n </PageFlexConstraint>\n );\n};\n","import React, { FunctionComponent, useEffect, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { Page } from \"@frontend/common/src/types/Page\";\nimport { CMSArticles } from \"@frontend/common/src/types/CMSArticle\";\nimport { CMSContent } from \"../../../components/CMSContent/CMSContent\";\nimport { createUrl } from \"../../../app/pages\";\nimport { BlockButton } from \"../../../components/Buttons/Buttons.styles\";\nimport { Header } from \"../../../elements/Header/Header\";\nimport { useActions, useAppState } from \"../../../overmind\";\nimport {\n Text,\n BoldText,\n PageFlexConstraint,\n StyledSection,\n} from \"./CreateOrderPage.styles\";\n\nexport const Receipt: FunctionComponent = () => {\n const { t } = useTranslation();\n const actions = useActions();\n\n const {\n orders: { currentNewOrder: order, orderConverted, isQuote, autofill },\n customer,\n } = useAppState();\n const [orderId, setOrderId] = useState<string>();\n\n useEffect(() => {\n if (order.orderId) {\n actions.orders.commitSubProjs({\n customerId: customer.id,\n order,\n projectId: order.orderId,\n offerId: autofill?.offerId,\n });\n setOrderId(order.orderId);\n }\n actions.orders.clearAutofillAndDraftOrder();\n }, []);\n return (\n <PageFlexConstraint>\n <StyledSection>\n <Header type=\"secondary\">7. {t(\"Summary\")}</Header>\n <article>\n <Text>\n <CMSContent\n contentId={\n orderConverted\n ? 1457\n : isQuote\n ? CMSArticles.OFFER_SUMMARY\n : CMSArticles.ORDER_SUMMARY\n }\n />\n </Text>\n <BoldText>Ditt referansenummer er #{orderId}</BoldText>\n </article>\n <article style={{ padding: \"1rem 0\" }}>\n <BlockButton\n as=\"a\"\n href={createUrl(Page.ORDER_LIST)}\n style={{ paddingLeft: \"1rem\", paddingRight: \"1rem\" }}\n >\n {t(\"Back to my orders\")}\n </BlockButton>\n </article>\n </StyledSection>\n </PageFlexConstraint>\n );\n};\n","import React, { FunctionComponent, useState, useEffect } from \"react\";\nimport styled from \"styled-components\";\n\nconst Menu = styled.section`\n display: grid;\n grid-template-columns: 1fr 1fr 1fr;\n gap: 1rem;\n`;\n\nconst MenuItem = styled.section`\n text-align: center;\n padding: 0.25rem;\n`;\n\nconst MenuItemHeader = styled.h4``;\n\nconst MenuItemImg = styled.img<{ isSelected?: boolean }>`\n max-width: 200px;\n border-radius: 0.25rem;\n border: 0.125rem solid\n ${(props) => (props.isSelected ? \"red\" : \"transparent\")};\n`;\n\ninterface Props {\n key: number;\n /** Header text */\n text: string;\n /** The URL for the image */\n src: string;\n}\n\nexport const SelectionGrid: FunctionComponent<{\n items: Props[];\n // eslint-disable-next-line no-unused-vars\n onItemClicked: (i: Props, e: any) => void;\n}> = ({ items, onItemClicked }) => {\n const [elements, setElements]: any[] = useState<Element[]>();\n const [selected, setSelected] = useState<Props | undefined>();\n\n const renderer = (i: Props) => {\n return (\n <MenuItem\n onClick={(e) => {\n setSelected(i);\n onItemClicked(i, e);\n }}\n >\n <MenuItemHeader>{i.text}</MenuItemHeader>\n <MenuItemImg\n isSelected={selected && selected.key === i.key}\n src={i.src}\n alt={i.text}\n />\n </MenuItem>\n );\n };\n\n useEffect(() => setElements(items.map(renderer)), [items, selected]);\n\n return <Menu>{elements}</Menu>;\n};\n","import React, { useState, FunctionComponent } from \"react\";\nimport Modal from \"@frontend/common/src/components/Modal/Modal\";\nimport { SelectionGrid } from \"../../components/SelectionGrid/SelectionGrid\";\nimport {\n BlockButton,\n LinkButton,\n} from \"../../components/Buttons/Buttons.styles\";\nimport { useActions, useAppState } from \"../../overmind\";\n\ninterface Props {\n key: number;\n /** Header text */\n text: string;\n /** The URL for the image */\n src: string;\n}\n\n/**\n * Creates a modal which the user picks one of the items and returns the element to parent when user submits.\n * @param items a pool of items\n * @constructor -\n */\nexport const SelectionGridModal: FunctionComponent = () => {\n const [selectedItem, setSelectedItem] = useState<Props>();\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const onItemClicked = (i: Props, e: any) => setSelectedItem(i);\n const { modals: modalsAction } = useActions();\n const { modals: modalsState } = useAppState();\n /**\n * Sends the selected item to parent.\n */\n const emitOnSubmit = () => {\n modalsAction.selectionGridModal.close(selectedItem);\n };\n\n const closeModal = () => {\n modalsAction.selectionGridModal.close(null);\n };\n\n const { items } = modalsState.selectionGridModal;\n\n return (\n <Modal\n isOpen={modalsState.selectionGridModal.isCurrent}\n onClose={() => closeModal()}\n >\n <SelectionGrid items={items} onItemClicked={onItemClicked} />\n\n <div style={{ display: \"grid\", gridTemplateColumns: \"2fr 1fr 1fr\" }}>\n <span />\n <BlockButton onClick={() => emitOnSubmit()}>Velg</BlockButton>\n <LinkButton onClick={() => closeModal()}>Avbryt</LinkButton>\n </div>\n </Modal>\n );\n};\n","import React, { useEffect } from \"react\";\nimport { Page } from \"@frontend/common/src/types/Page\";\nimport { BlockButton } from \"../../../components/Buttons/Buttons.styles\";\nimport { createUrl } from \"../../../app/pages\";\nimport { useActions, useAppState, useEffects } from \"../../../overmind\";\nimport { CMSContent } from \"../../../components/CMSContent/CMSContent\";\nimport { PreTreColors } from \"../../../styles/constants\";\n\nexport const ChooseProjectType = () => {\n const actions = useActions();\n const effects = useEffects();\n const state = useAppState();\n\n useEffect(() => {\n if (state.orders.autofill?.offerId !== undefined) {\n actions.orders.setQuotationOnDraftOrder({\n isQuotation: false,\n quickChoice: undefined,\n });\n actions.orders.setOrderConverted(false);\n effects.router.navigateTo(\n createUrl(Page.CREATE_ORDER, { slug: \"kundeinfo\" })\n );\n }\n }, [state.orders.autofill]);\n const onSubmit = (isQuotation: boolean, quickChoice?: string) => {\n actions.orders.setQuotationOnDraftOrder({ isQuotation, quickChoice });\n actions.orders.setOrderConverted(false);\n effects.router.navigateTo(\n createUrl(Page.CREATE_ORDER, { slug: \"kundeinfo\" })\n );\n };\n\n return (\n <div\n style={{\n display: \"flex\",\n justifyContent: \"center\",\n marginTop: \"2em\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n width: \"35vw\",\n justifyContent: \"space-evenly\",\n }}\n >\n <div>\n <div style={{ color: PreTreColors.beis, fontSize: \"1.5rem\" }}>\n Forespørsel\n </div>\n <CMSContent contentId={1454} />\n <BlockButton onClick={() => onSubmit(true, undefined)}>\n Lag ny forespørsel\n </BlockButton>\n </div>\n <div style={{ marginTop: \"5em\" }}>\n <div style={{ color: PreTreColors.beis, fontSize: \"1.5rem\" }}>\n Bestilling\n </div>\n <CMSContent contentId={1455} />\n <BlockButton onClick={() => onSubmit(false, undefined)}>\n Lag ny bestilling\n </BlockButton>\n </div>\n\n <div style={{ marginTop: \"5em\" }}>\n <div style={{ color: PreTreColors.beis, fontSize: \"1.5rem\" }}>\n Hurtigvalg\n </div>\n <div\n style={{\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-evenly\",\n flexWrap: \"wrap\",\n }}\n >\n <BlockButton\n onClick={() => onSubmit(true, \"extendedRoof\")}\n style={{ width: \"10em\", marginTop: \"1em\" }}\n >\n Takstolkalkulator\n </BlockButton>\n <BlockButton\n onClick={() => onSubmit(true, \"technical\")}\n style={{ width: \"10em\", marginTop: \"1em\" }}\n >\n Tekniske tjenester\n </BlockButton>\n </div>\n </div>\n </div>\n </div>\n );\n};\n","import React, { FunctionComponent } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { yupResolver } from \"@hookform/resolvers/yup\";\nimport * as yup from \"yup\";\nimport { Grid, Row, Col } from \"@frontend/common/src/elements/Grid/Grid\";\nimport { FormInput } from \"@frontend/common/src/elements/FormInput/FormInput\";\nimport * as validators from \"@frontend//common/src/validators\";\nimport {\n CustomerEmployee,\n UpdateCustomerEmployee,\n} from \"@frontend/common/src/types/CustomerEmployee\";\nimport { UserType } from \"@frontend/common/src/types/User\";\nimport { useAppState } from \"../../../overmind\";\nimport { BlockButton } from \"../../Buttons/Buttons.styles\";\n\nconst validationSchema = yup.object().shape({\n name: validators.name,\n email: validators.requiredEmail,\n phone: validators.string,\n mobile: validators.string,\n position: validators.string,\n password: validators.string,\n newPassword: validators.string,\n});\n\ntype Props = {\n customerEmployee: CustomerEmployee;\n // eslint-disable-next-line no-unused-vars\n onSubmit: (data: UpdateCustomerEmployee) => void;\n};\nexport const UserForm: FunctionComponent<Props> = ({\n customerEmployee,\n onSubmit,\n}) => {\n const state = useAppState();\n\n const requiresVerifyPassword =\n state.auth.user.type === UserType.EMPLOYEE && customerEmployee != null;\n\n const { register, handleSubmit, errors } = useForm<UpdateCustomerEmployee>({\n resolver: yupResolver(validationSchema),\n defaultValues: customerEmployee,\n });\n\n // AnsvarligSelger_ID\n return (\n <form\n onSubmit={(e) => {\n e.preventDefault();\n handleSubmit(onSubmit)(e);\n }}\n >\n <Grid>\n <Row>\n <Col size={1}>\n <input type=\"hidden\" name=\"active\" ref={register} />\n <FormInput\n required\n label=\"Navn\"\n type=\"text\"\n name=\"name\"\n inputRef={register}\n error={errors.name?.message}\n />\n\n <FormInput\n required\n label=\"Epost\"\n type=\"text\"\n name=\"email\"\n inputRef={register}\n error={errors.email?.message}\n />\n\n <FormInput\n label=\"Telefon\"\n type=\"text\"\n name=\"phone\"\n inputRef={register}\n error={errors.phone?.message}\n />\n <FormInput\n label=\"Mobil\"\n type=\"text\"\n name=\"mobile\"\n inputRef={register}\n error={errors.mobile?.message}\n />\n <FormInput\n label=\"Stilling\"\n type=\"text\"\n name=\"position\"\n inputRef={register}\n error={errors.position?.message}\n />\n\n {requiresVerifyPassword ? (\n <FormInput\n label=\"Gammelt passord\"\n type=\"text\"\n name=\"password\"\n inputRef={register}\n error={errors.password?.message}\n />\n ) : null}\n\n <FormInput\n label=\"Nytt passord\"\n type=\"text\"\n name=\"newPassword\"\n inputRef={register}\n error={errors.newPassword?.message}\n />\n </Col>\n </Row>\n </Grid>\n\n <div style={{ display: \"flex\" }}>\n <BlockButton type=\"submit\">\n {customerEmployee != null ? \"Oppdater\" : \"Opprett\"}\n </BlockButton>\n </div>\n </form>\n );\n};\n","import React, { FunctionComponent } from \"react\";\nimport { Table, Column } from \"@frontend/common/src/components/Table/Table\";\nimport { CustomerEmployee } from \"@frontend/common/src/types/CustomerEmployee\";\nimport { Link } from \"../../elements/Link/Link\";\nimport { useActions } from \"../../overmind\";\nimport { BlockButton } from \"../Buttons/Buttons.styles\";\n\ntype ColumnKey = keyof CustomerEmployee;\n\ntype Props = {\n users: CustomerEmployee[];\n columns?: ColumnKey[];\n // eslint-disable-next-line no-unused-vars\n onRowSelected?: (row: CustomerEmployee) => void;\n};\n\nconst createColumns = (actions: any): Column<CustomerEmployee>[] => {\n const allColumns: Column<CustomerEmployee>[] = [\n {\n headerName: \"Navn\",\n field: \"name\",\n render: (row) => `${row.name}`,\n },\n {\n headerName: \"Epost\",\n field: \"email\",\n },\n {\n headerName: \"Telefon\",\n field: \"phone\",\n render: (row) => <Link href=\"tel:row.phone\">{row.phone}</Link>,\n },\n {\n headerName: \"Stilling\",\n field: \"position\",\n },\n\n {\n headerName: \"Aktiv\",\n field: \"active\",\n render: (row) => (\n <BlockButton\n style={{ fontSize: \".75rem\", padding: \".2rem\" }}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n\n actions.changeUserActive({\n userId: row.id,\n activeState: !row.active,\n });\n }}\n >\n {row.active ? \"Deaktiver\" : \"Aktiver\"}\n </BlockButton>\n ),\n },\n {\n headerName: \"Har Passord\",\n field: \"hasPassword\",\n render: (row: CustomerEmployee) =>\n row.hasPassword ? (\n <svg height=\"1rem\" viewBox=\"0 0 24 18\">\n <path\n d=\"M0 9.91357L2.60829 6.52202L9.39163 12.2615L20.3488 0L23.4791 2.86985L9.65201 18L0 9.91357Z\"\n fill=\"#CA0000\"\n />\n </svg>\n ) : (\n \"\"\n ),\n },\n {\n headerName: \"Handlinger\",\n field: \"hasPassword\",\n render: (row) => (\n <div style={{ display: \"flex\" }}>\n <BlockButton\n style={{\n fontSize: \".75rem\",\n padding: \".2rem\",\n marginRight: \"1rem\",\n }}\n onClick={(e: any) => {\n e.preventDefault();\n e.stopPropagation();\n\n actions.onResetPassword(row.id);\n }}\n >\n Send passord\n </BlockButton>\n </div>\n ),\n },\n ];\n\n return allColumns;\n};\n\nexport const UserList: FunctionComponent<Props> = ({\n users,\n columns,\n onRowSelected,\n}) => {\n const actions = useActions();\n const allColumns = createColumns(actions);\n let columnsToUse = null;\n if (!columns) {\n columnsToUse = allColumns;\n } else {\n columnsToUse = columns.map((c) => allColumns.find((a) => a.field === c));\n }\n\n return (\n <Table\n keyField=\"id\"\n data={users}\n columns={columnsToUse}\n availableColumns={allColumns}\n onRowSelected={onRowSelected}\n />\n );\n};\n","import styled from \"styled-components\";\n\nexport const Grid = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: start;\n`;\ntype RowProps = {\n size?: number;\n};\nexport const Row = styled(\"div\")<RowProps>`\n display: flex;\n ${(props) => (props.size ? { flex: props.size } : null)};\n @media only screen and (max-width: 850px) {\n flex-direction: column;\n }\n`;\ntype ColProps = {\n size: number;\n};\nexport const Col = styled(\"div\")<ColProps>`\n flex: ${(props) => props.size};\n margin: 1rem;\n`;\n","import React, { FunctionComponent } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { yupResolver } from \"@hookform/resolvers/yup\";\nimport * as yup from \"yup\";\n\nimport { Grid, Row, Col } from \"@frontend/common/src/elements/Grid/Grid\";\nimport { FormInput } from \"@frontend/common/src/elements/FormInput/FormInput\";\nimport * as validators from \"@frontend//common/src/validators\";\nimport { BlockButton } from \"@frontend/common/src/elements/Buttons/Buttons.styles\";\nimport { Customer } from \"@frontend/common/src/types/Customer\";\nimport { useActions, useAppState } from \"../../../../overmind\";\n\nconst validationSchema = yup.object().shape({\n address: validators.address,\n zipcode: validators.zipcode,\n email: validators.requiredEmail,\n drawingsEmail: validators.email,\n orderConfimEmail: validators.email,\n orderConfrimEmailAlt: validators.email,\n});\n\nexport const CompanyForm: FunctionComponent = () => {\n const actions = useActions();\n const state = useAppState();\n\n const { register, handleSubmit, errors } = useForm<Customer>({\n resolver: yupResolver(validationSchema),\n defaultValues: state.customer,\n });\n\n const onSubmitData = (data: Customer) => {\n // eslint-disable-next-line no-param-reassign\n data.id = state.customer.id;\n actions.changeCustomer(data);\n };\n\n return (\n <form onSubmit={handleSubmit(onSubmitData)}>\n <Grid>\n <Row>\n <Col size={1}>\n <FormInput\n required\n label=\"Kundenavn\"\n type=\"text\"\n name=\"name\"\n readonly\n inputRef={register}\n error={errors.name?.message}\n />\n <FormInput\n required\n label=\"Adresse\"\n type=\"text\"\n name=\"address\"\n inputRef={register}\n error={errors.address?.message}\n />\n <FormInput\n required\n label=\"Postnummer\"\n type=\"text\"\n name=\"zipcode\"\n inputRef={register}\n error={errors.zipcode?.message}\n />\n <FormInput\n required\n label=\"Sted\"\n type=\"text\"\n name=\"city\"\n readonly\n inputRef={register}\n error={errors.city?.message}\n />\n <FormInput\n required\n label=\"Epost\"\n type=\"text\"\n name=\"email\"\n inputRef={register}\n error={errors.email?.message}\n />\n </Col>\n <Col size={1}>\n <FormInput\n label=\"Epost tegninger\"\n type=\"text\"\n name=\"drawingsEmail\"\n inputRef={register}\n error={errors.drawingsEmail?.message}\n />\n <FormInput\n label=\"Epost ordrebekreftelse\"\n type=\"text\"\n name=\"orderConfimEmail\"\n inputRef={register}\n error={errors.orderConfimEmail?.message}\n />\n <FormInput\n label=\"Epost ordresbekreftelse\"\n type=\"text\"\n name=\"orderConfrimEmailAlt\"\n inputRef={register}\n error={errors.orderConfrimEmailAlt?.message}\n />\n </Col>\n </Row>\n </Grid>\n\n <div style={{ display: \"flex\" }}>\n <BlockButton type=\"submit\">Lagre endringer</BlockButton>\n </div>\n </form>\n );\n};\n","import React, { FunctionComponent } from \"react\";\nimport Modal from \"@frontend/common/src/components/Modal/Modal\";\nimport { UpdateCustomerEmployee } from \"@frontend/common/src/types/CustomerEmployee\";\nimport { useActions, useAppState } from \"../../overmind\";\nimport { UserForm } from \"../../components/forms/UserForm/UserForm\";\n\nexport const EditEmployeeModal: FunctionComponent = () => {\n const state = useAppState();\n const actions = useActions();\n const { modals } = useAppState();\n\n const { modals: modalsActions } = useActions();\n\n if (!modals.editEmployeeModal.isCurrent) {\n return null;\n }\n\n const onSubmitData = (data: UpdateCustomerEmployee) => {\n if (modals.editEmployeeModal.employeeId) {\n // eslint-disable-next-line no-param-reassign\n data.id = modals.editEmployeeModal.employeeId;\n actions\n .changeCustomerEmployee(data)\n .then(() => modalsActions.editEmployeeModal.close());\n } else {\n actions\n .createCustomerEmployee(data)\n .then(() => modalsActions.editEmployeeModal.close());\n }\n };\n\n return (\n <Modal\n isOpen={modals.editEmployeeModal.isCurrent}\n onClose={() => modalsActions.editEmployeeModal.close()}\n >\n <UserForm\n customerEmployee={state.customerEmployees.find(\n (e) => e.id === modals.editEmployeeModal.employeeId\n )}\n onSubmit={onSubmitData}\n />\n </Modal>\n );\n};\n","import styled from \"styled-components\";\n\nexport const Callout = styled(\"label\")`\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n width: 100%;\n padding: 1rem;\n border: 1px solid yellow;\n background: lightyellow;\n margin-top: 1rem;\n a {\n display: inline-block;\n }\n`;\n","import React from \"react\";\nimport { EmployeeMessageReferenceType } from \"@frontend/common/src/types/EmployeeMessage\";\nimport { Callout } from \"@frontend/common/src/elements/Callout/Callout\";\nimport { useAppState } from \"../../overmind\";\nimport { EmployeeLink } from \"../EmployeeLink/EmployeeLink\";\n\ntype Props = {\n employeeId?: string;\n};\nexport const SalesPersonBox = ({ employeeId }: Props) => {\n const state = useAppState();\n const employee = state.pretreEmplyees.find((e) => e.id === employeeId);\n\n return (\n <Callout>\n <span>Ansvarlig uteselger</span>\n\n {employee ? (\n <EmployeeLink\n employee={employee}\n referenceId=\"0\"\n referenceType={EmployeeMessageReferenceType.CUSTOMER}\n />\n ) : (\n <div>Ingen ansvarlig uteselger</div>\n )}\n </Callout>\n );\n};\n","import React from \"react\";\n\nconst Auth = () => {\n return <div>Autentiserer....</div>;\n};\n\nexport default Auth;\n","import { Page } from \"@frontend/common/src/elements/Page/Page\";\nimport React, { FunctionComponent } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { yupResolver } from \"@hookform/resolvers/yup\";\nimport * as yup from \"yup\";\nimport { BlockButton } from \"@frontend/common/src/elements/Buttons/Buttons.styles\";\nimport { useActions, useAppState } from \"../../overmind\";\nimport { Select } from \"../../components/Select/Select\";\n\nconst schema = yup.object().shape({\n customerId: yup.string().required(),\n});\n\nconst CompanySelectorPage: FunctionComponent = () => {\n const state = useAppState();\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const actions = useActions();\n const onSubmit = (data: any) => {\n actions.auth.onMesterIdSelectCustomer(data.customerId);\n };\n\n const { register, handleSubmit } = useForm({\n resolver: yupResolver(schema),\n });\n return (\n <Page title=\"Velg kunde\">\n <form onSubmit={handleSubmit(onSubmit)}>\n <Select\n name=\"customerId\"\n required\n label=\"Kunde\"\n options={state.mesterIdCustomers.map((a) => {\n return { label: `${a.name}`, value: a.id };\n })}\n inputRef={register}\n />\n <BlockButton type=\"submit\"> Velg kunde</BlockButton>\n </form>\n </Page>\n );\n};\n\nexport default CompanySelectorPage;\n","import React, { FunctionComponent, useEffect } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { Page } from \"@frontend/common/src/elements/Page/Page\";\nimport { LinkButton } from \"@frontend/common/src/elements/Buttons/Buttons.styles\";\nimport { useAuth0 } from \"@auth0/auth0-react\";\n\nconst buildVersion = process.env.REACT_APP_BUILD_VERSION;\n\nexport const LoginPage: FunctionComponent = () => {\n const { t } = useTranslation();\n const { loginWithRedirect } = useAuth0();\n // eslint-disable-next-line no-undef\n useEffect(() => {\n loginWithRedirect();\n }, []);\n // TODO: Sjekk om maxwidth kan ligge i form\n return (\n <Page title={t(\"Login\")}>\n <LinkButton onClick={() => loginWithRedirect()}>\n Logg inn med MesterID\n </LinkButton>\n <p style={{ marginTop: \"1rem\" }}> Versjon: {buildVersion}</p>\n </Page>\n );\n};\n","import React, { FunctionComponent } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { CMSArticles } from \"@frontend/common/src/types/CMSArticle\";\nimport { Page } from \"@frontend/common/src/elements/Page/Page\";\nimport { CMSContent } from \"../../components/CMSContent/CMSContent\";\nimport { Heading } from \"../../elements/Header/Header.styles\";\nimport { useAppState } from \"../../overmind\";\nimport {\n ColumnWrapper,\n Text,\n BoldText,\n} from \"../order/ChooseProductPage/CreateOrderPage.styles\";\n\nexport const TechnicalServicesPage: FunctionComponent = () => {\n const { t } = useTranslation();\n const state = useAppState();\n\n return (\n <Page title={t(\"Technical services\")}>\n <CMSContent contentId={CMSArticles.TECHNICAL_SERVICES} />\n\n <div style={{ display: \"flex\", flexWrap: \"wrap\" }}>\n {state.technicalServices.map((service) => (\n <ColumnWrapper key={service.id}>\n <img src={service.bildeURL} alt=\"bilde av tjeneste\" /> : <div />\n <Heading type=\"secondary\">{service.navn}</Heading>\n <Text>{service.beskrivelse}</Text>\n <BoldText>Fra kr: {service.pris},-</BoldText>\n </ColumnWrapper>\n ))}\n </div>\n </Page>\n );\n};\n","import React, { FunctionComponent } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { Page as PageConstants } from \"@frontend/common/src/types/Page\";\nimport { Page } from \"@frontend/common/src/elements/Page/Page\";\nimport { useAppState } from \"../../../overmind\";\nimport { OrderFilter } from \"./components/OrderFilter/OrderFilter\";\nimport { OrderList } from \"../../../components/OrderList/OrderList\";\nimport { Pager } from \"../../../components/Pager/Pager\";\nimport { createUrl } from \"../../../app/pages\";\n\nexport const OrderListPage: FunctionComponent = () => {\n const state = useAppState();\n const { t } = useTranslation();\n return (\n <Page title={t(\"My orders and projects\")}>\n <OrderFilter orders={state.orders.orders} />\n {state.orders.isFetching ? (\n <div>Laster</div>\n ) : (\n <>\n <OrderList\n noResultsText=\"Fant ingen ordre, sjekk filter over\"\n orders={state.orders.currentPageItems}\n columns={[\n \"id\",\n \"projectName\",\n \"status\",\n \"constructionName\",\n \"calculationName\",\n \"customerOrderNumber\",\n \"delivery\",\n \"sum\",\n ]}\n />\n <Pager\n pageCount={state.orders.pageCount}\n currentPage={state.orders.currentPage}\n link={createUrl(PageConstants.ORDER_LIST)}\n />\n </>\n )}\n </Page>\n );\n};\n","import React, { FunctionComponent } from \"react\";\n\nimport { Grid, Row, Col } from \"@frontend/common/src/elements/Grid/Grid\";\nimport { useTranslation } from \"react-i18next\";\nimport { Page } from \"@frontend/common/src/elements/Page/Page\";\n\nimport { formatDate } from \"@frontend/common/src/helpers/date\";\nimport { Page as PageConstants } from \"@frontend/common/src/types/Page\";\nimport { CMSArticles } from \"@frontend/common/src/types/CMSArticle\";\nimport { PhoneLink } from \"@frontend/common/src/components/PhoneLink/PhoneLink\";\nimport { CMSContent } from \"../../../components/CMSContent/CMSContent\";\nimport { DocumentList } from \"../../../components/DocumentList/DocumentList\";\nimport { OrderList } from \"../../../components/OrderList/OrderList\";\n\nimport {\n DetailsBox,\n Legend,\n Text,\n Group,\n} from \"../../../components/DetailsBox/DetailsBox\";\nimport { SketchFabEmbed } from \"../../../components/SketchFabEmbed/SketchFabEmbed\";\nimport { useActions, useAppState } from \"../../../overmind\";\nimport { Link } from \"../../../elements/Link/Link\";\nimport { Header } from \"../../../elements/Header/Header\";\nimport { createUrl } from \"../../../app/pages\";\nimport { formatMoney } from \"../../../helpers/money\";\nimport { getDeliveryDateText } from \"../../../helpers/order\";\nimport { router } from \"../../../overmind/effects\";\nimport {\n BlockButton,\n LinkButton,\n} from \"../../../components/Buttons/Buttons.styles\";\nimport { PrecutModal } from \"../../../modals/PrecutModal/PrecutModal\";\nimport { FileUploadModal } from \"../../../modals/FileUploadModal/FileUploadModal\";\n\nexport const ViewOrderPage: FunctionComponent = () => {\n const { t } = useTranslation();\n const actions = useActions();\n const {\n customerEmployees,\n customer,\n orders: { orders, currentOrder, masterProjects },\n modals: { precutModal, fileUploadModal },\n } = useAppState();\n\n if (!currentOrder) {\n return <div>{t(\"Loading\")}</div>;\n }\n\n const customerContact = customerEmployees.find(\n (e) => e.id === currentOrder.customerEmployeeId\n );\n\n const ordersInSameProject = orders\n .find((x) => x.id === currentOrder.projectId)\n .subProjects.filter((o) => o.id !== currentOrder.id);\n\n const backLink = masterProjects[currentOrder.projectId]\n ? {\n label: `Prosjekt #${currentOrder.projectId}`,\n url: createUrl(PageConstants.VIEW_ORDER_PROJECT, {\n id: masterProjects[currentOrder.projectId],\n }),\n }\n : null;\n\n const onNewOrderClicked = async () => {\n await actions.orders.getOrderAutofill({\n customerId: customer.id,\n offerId: currentOrder.projectId,\n });\n actions.orders.setOrderConverted(true);\n router.navigateTo(\n createUrl(PageConstants.CREATE_ORDER, { slug: \"kundeinfo\" })\n );\n };\n return (\n <Page title={`Prosjekt #${currentOrder.id}`} backLink={backLink}>\n <Grid>\n <Row>\n <Col size={1}>\n <DetailsBox>\n <tbody>\n <Group>\n <Legend>{t(\"Created\")}</Legend>\n <Text>{formatDate(currentOrder.orderDate)}</Text>\n </Group>\n <Group>\n <Legend>{t(\"Product\")}</Legend>\n <Text>\n {currentOrder.product && currentOrder.product !== \"\"\n ? currentOrder.product\n : \"Ukjent\"}\n </Text>\n </Group>\n <Group>\n <Legend>{t(\"Status\")}</Legend>\n <Text>{currentOrder.status}</Text>\n </Group>\n <Group>\n <Legend>{t(\"Delivery date\")}</Legend>\n <Text>{getDeliveryDateText(currentOrder)}</Text>\n </Group>\n\n <Group>\n <Legend>Prosjektnavn</Legend>\n <Text>{currentOrder.projectName}</Text>\n </Group>\n <Group>\n <Legend>{t(\"Customer order no\")}</Legend>\n <Text>{currentOrder.customerOrderNumber || \"Ikke satt\"}</Text>\n </Group>\n <Group>\n <Legend>{t(\"Customer ref.\")}</Legend>\n <Text>\n {customerContact ? customerContact.name : \"Ikke satt\"}\n </Text>\n </Group>\n <Group>\n <Legend>{t(\"Delivery addr.\")}</Legend>\n {currentOrder.deliveryTerms.toLowerCase() === \"avhentet\" ? (\n <Text>Avhentet</Text>\n ) : (\n <Text>\n <Link\n target=\"_blank\"\n href={`https://www.google.no/maps/search/${encodeURI(\n currentOrder.deliveryAddress\n )}`}\n >\n {currentOrder.deliveryAddress}\n </Link>\n </Text>\n )}\n </Group>\n <Group>\n <Legend>{t(\"Order price\")}</Legend>\n <Text>\n {currentOrder.isOrderPriceCalculated &&\n currentOrder.sum > 0 ? (\n <span style={{ display: \"flex\" }}>\n {formatMoney(currentOrder.sum)}\n <CMSContent contentId={CMSArticles.NOT_CALCULATED} />\n </span>\n ) : (\n formatMoney(currentOrder.sum)\n )}\n </Text>\n </Group>\n </tbody>\n </DetailsBox>\n </Col>\n <Col size={1}>\n <DetailsBox>\n <tbody>\n <Group>\n <Legend>{t(\"Constructor\")}</Legend>\n <Text>{currentOrder.constructionName}</Text>\n </Group>\n <Group>\n <Legend>{t(\"Site phone\")}</Legend>\n <Text>\n <PhoneLink number={currentOrder.constructionContactPhone} />\n </Text>\n </Group>\n <Group>\n <Legend>{t(\"Site contact\")}</Legend>\n <Text>{currentOrder.constructionContactName}</Text>\n </Group>\n <Group>\n <Legend>Ønsket leveringsdato</Legend>\n <Text>{getDeliveryDateText(currentOrder)}</Text>\n </Group>\n </tbody>\n </DetailsBox>\n {currentOrder.valueChainStatus === 1 && (\n <BlockButton\n style={{\n width: \"33%\",\n height: \"25%\",\n fontSize: \"1rem\",\n padding: \"10px 0\",\n }}\n onClick={() => onNewOrderClicked()}\n >\n {\" \"}\n Sett tilbud til ordre{\" \"}\n </BlockButton>\n )}\n {currentOrder.valueChainStatus === 4 && (\n <BlockButton\n style={{\n width: \"33%\",\n height: \"25%\",\n fontSize: \"1rem\",\n padding: \"10px 0\",\n }}\n >\n {\" \"}\n Godkjenn ordre{\" \"}\n </BlockButton>\n )}\n {currentOrder.product.toLowerCase() === \"precut\" && (\n <BlockButton\n style={{\n width: \"33%\",\n height: \"25%\",\n fontSize: \"1rem\",\n padding: \"10px 0\",\n }}\n onClick={() =>\n actions.onPrecutForm({\n projectId: currentOrder.id,\n openedFromProjectPage: true,\n })\n }\n >\n Åpne Precut-skjema\n </BlockButton>\n )}\n </Col>\n\n <Col size={1}>\n {currentOrder.embedId ? (\n <SketchFabEmbed\n embedHash={currentOrder.embedHash}\n embedId={currentOrder.embedId}\n />\n ) : null}\n </Col>\n </Row>\n <Row>\n <Col size={2}>\n <div style={{ marginBottom: 10 }}>\n <Header type=\"secondary\">{t(\"Other orders in project\")}</Header>\n </div>\n <OrderList\n noResultsText=\"Ingen andre ordre i prosjektet\"\n orders={ordersInSameProject}\n columns={[\n \"id\",\n \"projectName\",\n \"status\",\n \"delivery\",\n \"constructionName\",\n ]}\n />\n </Col>\n\n <Col size={1}>\n <div style={{ marginBottom: 10 }}>\n <Header type=\"secondary\">{t(\"Documents\")}</Header>\n </div>\n {currentOrder.valueChainStatus === 0 && (\n <LinkButton\n as=\"a\"\n onClick={() => actions.promptFileUpload(currentOrder.projectId)}\n >\n Legg til\n </LinkButton>\n )}\n <DocumentList documents={currentOrder.documents} />\n </Col>\n </Row>\n </Grid>\n {fileUploadModal.isCurrent ? <FileUploadModal /> : null}\n {precutModal.isCurrent ? <PrecutModal /> : null}\n </Page>\n );\n};\n","import React, { FunctionComponent } from \"react\";\n\nimport { Grid, Row, Col } from \"@frontend/common/src/elements/Grid/Grid\";\nimport { useTranslation } from \"react-i18next\";\nimport { Page } from \"@frontend/common/src/elements/Page/Page\";\nimport { formatDate } from \"@frontend/common/src/helpers/date\";\nimport { PhoneLink } from \"@frontend/common/src/components/PhoneLink/PhoneLink\";\nimport { Page as PageConstants } from \"@frontend/common/src/types/Page\";\nimport { Link } from \"../../../elements/Link/Link\";\n\nimport { DocumentList } from \"../../../components/DocumentList/DocumentList\";\nimport { OrderList } from \"../../../components/OrderList/OrderList\";\n\nimport {\n DetailsBox,\n Legend,\n Text,\n Group,\n} from \"../../../components/DetailsBox/DetailsBox\";\nimport { SketchFabEmbed } from \"../../../components/SketchFabEmbed/SketchFabEmbed\";\nimport { useActions, useAppState } from \"../../../overmind\";\nimport { Header } from \"../../../elements/Header/Header\";\nimport { formatMoney } from \"../../../helpers/money\";\nimport {\n BlockButton,\n LinkButton,\n} from \"../../../components/Buttons/Buttons.styles\";\nimport { router } from \"../../../overmind/effects\";\nimport { createUrl } from \"../../../app/pages\";\nimport { FileUploadModal } from \"../../../modals/FileUploadModal/FileUploadModal\";\nimport { getDeliveryDateText } from \"../../../helpers/order\";\n\nexport const ViewOrderProjectPage: FunctionComponent = () => {\n const { t } = useTranslation();\n const actions = useActions();\n const {\n customerEmployees,\n orders,\n customer,\n modals: { fileUploadModal },\n } = useAppState();\n\n const { currentOrderProject } = orders;\n if (!currentOrderProject) {\n return <div>{t(\"Loading\")}</div>;\n }\n\n const customerContactPerson = customerEmployees.find(\n (e) => e.id === currentOrderProject.customerEmployeeId\n );\n\n const projectSum =\n currentOrderProject.subProjects.length > 0\n ? currentOrderProject.subProjects\n .map((o) => o.sum)\n .reduce((sum, val) => sum + val)\n : 0;\n const onNewOrderClicked = async () => {\n await actions.orders.getOrderAutofill({\n customerId: customer.id,\n offerId: currentOrderProject.id,\n });\n actions.orders.setOrderConverted(true);\n router.navigateTo(\n createUrl(PageConstants.CREATE_ORDER, { slug: \"kundeinfo\" })\n );\n };\n return (\n <Page title={`Prosjekt #${currentOrderProject.id}`}>\n <Grid>\n <Row>\n <Col size={1}>\n <DetailsBox>\n <tbody>\n <Group>\n <Legend>{t(\"Created\")}</Legend>\n <Text>{formatDate(currentOrderProject.orderDate)}</Text>\n </Group>\n\n <Group>\n <Legend>Prosjektnavn</Legend>\n <Text>{currentOrderProject.projectName}</Text>\n </Group>\n <Group>\n <Legend>{t(\"Status\")}</Legend>\n <Text>{currentOrderProject.status}</Text>\n </Group>\n <Group>\n <Legend>{t(\"Customer order no\")}</Legend>\n <Text>\n {currentOrderProject.customerOrderNumber || \"Ikke satt\"}\n </Text>\n </Group>\n <Group>\n <Legend>{t(\"Customer ref.\")}</Legend>\n <Text>\n {customerContactPerson\n ? customerContactPerson.name\n : \"Ikke satt\"}\n </Text>\n </Group>\n <Group>\n <Legend>{t(\"Delivery terms\")}</Legend>\n <Text>{currentOrderProject.deliveryTerms}</Text>\n </Group>\n <Group>\n <Legend>{t(\"Delivery addr.\")}</Legend>\n {currentOrderProject.deliveryAddress.toLowerCase() ===\n \"avhentet\" ? (\n <Text>Avhentet</Text>\n ) : (\n <Text>\n <Link\n target=\"_blank\"\n href={`https://www.google.no/maps/search/${encodeURI(\n currentOrderProject.deliveryAddress\n )}`}\n >\n {currentOrderProject.deliveryAddress}\n </Link>\n </Text>\n )}\n </Group>\n <Group>\n <Legend>{t(\"Project price\")}</Legend>\n <Text>{formatMoney(projectSum)}</Text>\n </Group>\n </tbody>\n </DetailsBox>\n </Col>\n <Col size={1}>\n <DetailsBox>\n <tbody>\n <Group>\n <Legend>{t(\"Constructor\")}</Legend>\n <Text>{currentOrderProject.constructionName}</Text>\n </Group>\n\n <Group>\n <Legend>{t(\"Site phone\")}</Legend>\n <Text>\n <PhoneLink\n number={currentOrderProject.constructionContactPhone}\n />\n </Text>\n </Group>\n <Group>\n <Legend>{t(\"Site contact\")}</Legend>\n <Text>{currentOrderProject.constructionContactName}</Text>\n </Group>\n <Group>\n <Legend>Ønsket leveringsdato</Legend>\n <Text>{getDeliveryDateText(currentOrderProject)}</Text>\n </Group>\n </tbody>\n </DetailsBox>\n {currentOrderProject.valueChainStatus === 1 && (\n <BlockButton\n style={{\n width: \"33%\",\n height: \"25%\",\n fontSize: \"1rem\",\n padding: \"10px 0\",\n }}\n onClick={() => onNewOrderClicked()}\n >\n {\" \"}\n Sett tilbud til ordre{\" \"}\n </BlockButton>\n )}\n {currentOrderProject.valueChainStatus === 4 && (\n <BlockButton\n style={{\n width: \"33%\",\n height: \"25%\",\n fontSize: \"1rem\",\n padding: \"10px 0\",\n }}\n >\n {\" \"}\n Godkjenn ordre{\" \"}\n </BlockButton>\n )}\n </Col>\n\n <Col size={1}>\n {currentOrderProject.embedId ? (\n <SketchFabEmbed\n embedHash={currentOrderProject.embedHash}\n embedId={currentOrderProject.embedId}\n />\n ) : null}\n </Col>\n </Row>\n <Row>\n <Col size={2}>\n <div style={{ marginBottom: 10 }}>\n <Header type=\"secondary\">{t(\"Orders in project\")}</Header>\n </div>\n <OrderList\n noResultsText=\"Ingen ordre i prosjektet\"\n orders={currentOrderProject.subProjects}\n columns={[\n \"id\",\n \"projectName\",\n \"status\",\n \"delivery\",\n \"constructionName\",\n ]}\n />\n </Col>\n <Col size={1}>\n <div style={{ marginBottom: 10 }}>\n <Header type=\"secondary\" style={{ display: \"inline\" }}>\n {t(\"Documents\")}\n </Header>\n {currentOrderProject.valueChainStatus === 0 && (\n <LinkButton\n as=\"a\"\n onClick={() =>\n actions.promptFileUpload(currentOrderProject.id)\n }\n >\n Legg til\n </LinkButton>\n )}\n </div>\n <DocumentList documents={currentOrderProject.documents} />\n </Col>\n </Row>\n </Grid>\n {fileUploadModal.isCurrent ? <FileUploadModal /> : null}\n </Page>\n );\n};\n","import React, { FunctionComponent, ReactChild } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { Page as PageConstants } from \"@frontend/common/src/types/Page\";\nimport { Page } from \"@frontend/common/src/elements/Page/Page\";\nimport { createUrl } from \"../../../app/pages\";\n// Elements\nimport { useAppState } from \"../../../overmind\";\nimport { CreateOrderSteps } from \"../../../types/CreateOrderSteps\";\nimport { BreadCrumbs } from \"../../../components/BreadCrumbs/BreadCrumbs\";\nimport { CustomerInformation } from \"./CustomerInformation\";\nimport { ChooseProductPage } from \"../ChooseProductPage/ChooseProductPage\";\n\nimport { Attachments } from \"../ChooseProductPage/Attachments\";\nimport { Summary } from \"../ChooseProductPage/Summary\";\nimport { Receipt } from \"../ChooseProductPage/Receipt\";\n\nimport { SelectionGridModal } from \"../../../modals/SelectionGridModal/SelectionGridModal\";\nimport { ChooseProjectType } from \"./ChooseProjectType\";\n\nconst createSteps = (t: any, lastCompletedOrderStep: number) => {\n const steps: {\n // eslint-disable-next-line no-unused-vars\n [key in CreateOrderSteps]: {\n title: string;\n component: ReactChild;\n slug: string;\n };\n } = {\n [CreateOrderSteps.PROJECT_TYPE]: {\n title: \"Start\",\n component: <ChooseProjectType />,\n slug:\n lastCompletedOrderStep >= CreateOrderSteps.PROJECT_TYPE\n ? createUrl(PageConstants.CREATE_ORDER, { slug: \"velg\" })\n : \"#\",\n },\n [CreateOrderSteps.CUSTOMER_INFO]: {\n title: t(\"Kundeinfo\"),\n component: <CustomerInformation />,\n slug:\n lastCompletedOrderStep >= CreateOrderSteps.CUSTOMER_INFO\n ? createUrl(PageConstants.CREATE_ORDER, { slug: \"kundeinfo\" })\n : \"#\",\n },\n [CreateOrderSteps.CHOOSE_PRODUCT]: {\n title: t(\"Produktvalg\"),\n component: <ChooseProductPage />,\n slug:\n lastCompletedOrderStep >= CreateOrderSteps.CHOOSE_PRODUCT\n ? createUrl(PageConstants.CREATE_ORDER, { slug: \"produktvalg\" })\n : \"#\",\n },\n [CreateOrderSteps.ATTACHMENTS]: {\n title: t(\"Vedlegg\"),\n component: <Attachments />,\n slug:\n lastCompletedOrderStep >= CreateOrderSteps.ATTACHMENTS\n ? createUrl(PageConstants.CREATE_ORDER, { slug: \"vedlegg\" })\n : \"#\",\n },\n [CreateOrderSteps.SUMMARY]: {\n title: t(\"Oppsummering\"),\n component: <Summary />,\n slug:\n lastCompletedOrderStep >= CreateOrderSteps.SUMMARY\n ? createUrl(PageConstants.CREATE_ORDER, { slug: \"oppsummering\" })\n : \"#\",\n },\n [CreateOrderSteps.RECEIPT]: {\n title: t(\"Kvittering\"),\n component: <Receipt />,\n slug:\n lastCompletedOrderStep >= CreateOrderSteps.RECEIPT\n ? createUrl(PageConstants.CREATE_ORDER, { slug: \"kvittering\" })\n : \"#\",\n },\n };\n\n return steps;\n};\n\nexport const CreateOrderPage: FunctionComponent = () => {\n const { t } = useTranslation();\n const {\n orders,\n activeCreateOrderStep,\n modals: { selectionGridModal },\n } = useAppState();\n const steps = createSteps(t, orders.lastCompletedOrderStep);\n\n return (\n <>\n <Page\n title={\n activeCreateOrderStep === 0\n ? \"Nytt prosjekt\"\n : orders.isQuote\n ? \"Ny forespørsel\"\n : \"Ny bestilling\"\n }\n headerItems={\n <BreadCrumbs\n steps={Object.values(steps)}\n activeStep={activeCreateOrderStep}\n />\n }\n >\n <div>{steps[activeCreateOrderStep].component}</div>\n </Page>\n {selectionGridModal.isCurrent ? <SelectionGridModal /> : null}\n </>\n );\n};\n","import React, { FunctionComponent } from \"react\";\nimport { UpdateCustomerEmployee } from \"@frontend/common/src/types/CustomerEmployee\";\nimport { Page } from \"@frontend/common/src/elements/Page/Page\";\nimport { UserForm } from \"../../components/forms/UserForm/UserForm\";\nimport { useActions, useAppState } from \"../../overmind\";\n\nexport const UserPage: FunctionComponent = () => {\n const state = useAppState();\n const actions = useActions();\n\n if (!state.currentEmployee) {\n return <Page title=\"\">Fant ikke bruker...</Page>;\n }\n\n const onSubmitData = (data: UpdateCustomerEmployee) => {\n // eslint-disable-next-line no-param-reassign\n data.id = state.currentEmployee.id;\n actions.changeCustomerEmployee(data);\n };\n\n return (\n <Page\n title={`#${state.currentEmployee.id} - ${state.currentEmployee.name}`}\n >\n <UserForm\n customerEmployee={state.currentEmployee}\n onSubmit={onSubmitData}\n />\n </Page>\n );\n};\n","import React, { FunctionComponent } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { BlockButton } from \"@frontend/common/src/elements/Buttons/Buttons.styles\";\nimport { Page } from \"@frontend/common/src/elements/Page/Page\";\nimport { UserList } from \"../../components/UserList/UserList\";\nimport { Grid, Row, Col } from \"../../elements/Grid/Grid\";\nimport { useActions, useAppState } from \"../../overmind\";\nimport { CompanyForm } from \"./components/CompanyForm/CompanyForm\";\nimport { EditEmployeeModal } from \"../../modals/EditEmployeeModal/EditEmployeeModal\";\nimport { SalesPersonBox } from \"../../components/SalesPersonBox/SalesPersonBox\";\n\nexport const CompanyPage: FunctionComponent = () => {\n const state = useAppState();\n const actions = useActions();\n\n const { t } = useTranslation();\n\n return (\n <Page\n title={t(\"My profile - {{companyName}}\", {\n companyName: state.customer.name,\n })}\n >\n <Grid>\n <Row>\n <Col size={1}>\n <CompanyForm />\n <SalesPersonBox employeeId={state.customer.salesPersonId} />\n </Col>\n <Col size={1}>\n <BlockButton\n onClick={() => actions.onEditEmployee()}\n style={{\n width: \"100%\",\n maxWidth: \"11rem\",\n padding: \"0.5rem\",\n fontSize: \"1rem\",\n marginBottom: \"1rem\",\n }}\n >\n Ny kontaktperson\n </BlockButton>\n <UserList\n users={state.customerEmployees.filter((e) => e.hasQuit === false)}\n onRowSelected={(customerEmployee) => {\n actions.onEditEmployee(customerEmployee.id);\n }}\n />\n </Col>\n </Row>\n </Grid>\n\n {state.modals.editEmployeeModal.isCurrent ? <EditEmployeeModal /> : null}\n </Page>\n );\n};\n","import React, { FunctionComponent } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { Page } from \"@frontend/common/src/elements/Page/Page\";\nimport { CMSArticles } from \"@frontend/common/src/types/CMSArticle\";\nimport { CMSContent } from \"../../components/CMSContent/CMSContent\";\n\nexport const DocumentationPage: FunctionComponent = () => {\n const { t } = useTranslation();\n return (\n <Page title={t(\"Documentation\")}>\n <CMSContent contentId={CMSArticles.DOCUMENTATION} />\n </Page>\n );\n};\n","import React, { FunctionComponent } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { Page } from \"@frontend/common/src/elements/Page/Page\";\nimport { useAppState } from \"../../overmind\";\n\nexport const ErrorPage: FunctionComponent = () => {\n const { t } = useTranslation();\n const state = useAppState();\n\n return <Page title={t(\"Error\")}>{state.error && state.error.message}</Page>;\n};\n","import {\n BIV,\n ExtendedPrecut,\n ExtendedPrecutBackend,\n} from \"../types/DraftOrder/ExtendedPrecut\";\n\nconst stringCheck = (str: string): boolean => {\n return str !== null && str !== \"\";\n};\nconst mapBiv = (\n stender?: string,\n toppsvill?: string,\n bunnsvill?: string\n): BIV | null => {\n if (\n stringCheck(stender) ||\n stringCheck(toppsvill) ||\n stringCheck(bunnsvill)\n ) {\n return {\n dimStender: stender,\n dimToppsvill: toppsvill,\n dimBunnsvill: bunnsvill,\n };\n }\n return null;\n};\n\nexport const mapToBackend = (plans: ExtendedPrecut[]) => {\n const backendList = plans.map((x) => {\n const backendObj: ExtendedPrecutBackend = {\n bruttoVegghoyde: x.bruttoVegghoyde,\n hoydeOverkantApning: x.hoydeOverkantApning,\n dimensjonToppsvill: x.dimensjonToppsvill,\n dimensjonStender: x.dimensjonStender,\n dimensjonBunnsvill: x.dimensjonBunnsvill,\n klaringTilKarm: x.klaringTilKarm,\n name: x.name,\n projectId: x.projectId,\n biv: [],\n };\n const biv1 = mapBiv(x.biv1, x.dimToppsvill1, x.dimBunnsvill1);\n if (biv1 !== null) {\n backendObj.biv.push(biv1);\n }\n const biv2 = mapBiv(x.biv2, x.dimToppsvill2, x.dimBunnsvill2);\n if (biv2 !== null) {\n backendObj.biv.push(biv2);\n }\n const biv3 = mapBiv(x.biv3, x.dimToppsvill3, x.dimBunnsvill3);\n if (biv3 !== null) {\n backendObj.biv.push(biv3);\n }\n return backendObj;\n });\n return JSON.stringify(backendList);\n};\n","/* eslint-disable no-param-reassign */\nimport { CreateEmployeeMessage } from \"@frontend/common/src/types/EmployeeMessage\";\nimport { Page } from \"@frontend/common/src/types/Page\";\nimport { UpdateCustomerEmployee } from \"@frontend/common/src/types/CustomerEmployee\";\nimport { Customer } from \"@frontend/common/src/types/Customer\";\nimport { UserType } from \"@frontend/common/src/types/User\";\n\nimport { Context } from \".\";\nimport { getNavigationRoute } from \"../app/pages\";\nimport { mapToBackend } from \"../helpers/ExtendedPrecutHelper\";\nimport { ExtendedPrecut } from \"../types/DraftOrder/ExtendedPrecut\";\n// import { OnInitialize } from \"./index\";\n\nexport const onContactPerson = async (\n { actions, effects, state }: any,\n createEmployeeMessage: CreateEmployeeMessage\n) => {\n const message = await actions.modals.sendMessageModal.open({\n userId: createEmployeeMessage.employeeId,\n });\n createEmployeeMessage.loggedInEmail = state.auth.user.username;\n if (message && message.length) {\n createEmployeeMessage.message = message;\n try {\n await effects.api.employees.sendMessage(\n createEmployeeMessage,\n state.customer.id\n );\n effects.toast(\"Melding sendt\", 5000);\n } catch (error) {\n effects.toast(error, 5000);\n }\n }\n};\nexport const emulateEmployee = async (\n { state, effects }: Context,\n emulation: { customerId: string; customerEmployeeId: string }\n) => {\n state.currentEmployeeId = emulation.customerEmployeeId;\n state.customer = await effects.api.customer.getById(emulation.customerId);\n state.customerEmployees =\n await effects.api.customerEmployee.getAllForCustomerId(\n emulation.customerId\n );\n state.auth.user.emulatedType = UserType.COMPANY;\n};\n\nexport const emulateCustomer = async (\n { state, effects }: Context,\n customerId: string\n) => {\n state.customer = await effects.api.customer.getById(customerId);\n state.customerEmployees =\n await effects.api.customerEmployee.getAllForCustomerId(customerId);\n state.auth.user.emulatedType = UserType.COMPANY;\n};\nexport const onEditEmployee = async (\n { actions }: Context,\n employeeId: string\n) => {\n actions.modals.editEmployeeModal.open({ employeeId });\n};\nexport const onPrecutForm = async (\n { actions }: Context,\n formInfo: { projectId: string; openedFromProjectPage: boolean }\n) => {\n const form = await actions.modals.precutModal.open({\n projectId: formInfo.projectId,\n });\n if (formInfo.openedFromProjectPage) {\n if (form !== null) {\n console.log(mapToBackend(form as ExtendedPrecut[]));\n }\n\n // post directly\n } else if (form !== null) {\n console.log(mapToBackend(form as ExtendedPrecut[]));\n }\n};\n\nexport const promptFileUpload = async (\n { actions, effects, state }: any,\n projectId: string\n) => {\n const files = await actions.modals.fileUploadModal.open({});\n if (files && files.length) {\n try {\n await effects.api.order.addFiles(projectId, files, state.customer.id);\n effects.toast(\"Filer er lastet opp\", 5000);\n const docs = await effects.api.order.getDocumentsForOrder(\n state.customer.id,\n projectId\n );\n if (state.orders.currentOrder !== undefined) {\n state.orders.currentOrder.documents = docs;\n } else {\n state.orders.currentOrderProject.documents = docs;\n }\n } catch (error) {\n effects.toast(\"Feil ved opplasting\", 5000);\n }\n }\n};\n\nexport const openSelectionGridModal = async (\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n { actions, effects, state }: Context,\n params: { items: any[]; onSelected: (item: any) => void }\n) => {\n const { items, onSelected } = params;\n const selectedItem = await actions.modals.selectionGridModal.open({ items });\n\n if (selectedItem && onSelected) {\n onSelected(selectedItem);\n }\n};\n\nexport const changeUserActive = async (\n { state, effects }: Context,\n params: { userId: string; activeState: boolean }\n) => {\n const employee = state.customerEmployees.find((c) => c.id === params.userId);\n employee.active = params.activeState;\n try {\n await effects.api.customerEmployee.update(\n state.customer.id,\n {\n ...employee,\n },\n state.auth.user.username\n );\n state.customerEmployees =\n await effects.api.customerEmployee.getAllForCustomerId(state.customer.id);\n } catch (errorMessage: any) {\n effects.toast(errorMessage, 5000);\n }\n};\n\nexport const changeCustomer = async (\n { state, effects }: Context,\n customer: Customer\n) => {\n try {\n await effects.api.customer.updateCustomer(customer);\n\n state.customer = {\n ...state.customer,\n ...customer,\n };\n effects.toast(\"Lagret\", 5000);\n } catch (errorMessage: any) {\n effects.toast(errorMessage, 5000);\n }\n};\n\nexport const changeCustomerEmployee = async (\n { state, effects }: Context,\n customerEmployee: UpdateCustomerEmployee\n) => {\n try {\n await effects.api.customerEmployee.update(\n state.customer.id,\n customerEmployee,\n state.auth.user.username\n );\n state.customerEmployees =\n await effects.api.customerEmployee.getAllForCustomerId(state.customer.id);\n effects.toast(\"Lagret\", 5000);\n } catch (errorMessage: any) {\n effects.toast(errorMessage, 5000);\n }\n};\n\nexport const createCustomerEmployee = async (\n { state, effects }: Context,\n customerEmployee: UpdateCustomerEmployee\n) => {\n try {\n await effects.api.customerEmployee.create(\n state.customer.id,\n customerEmployee\n );\n state.customerEmployees =\n await effects.api.customerEmployee.getAllForCustomerId(state.customer.id);\n effects.toast(\"Opprettet!\", 5000);\n } catch (errorMessage: any) {\n effects.toast(errorMessage, 5000);\n }\n};\n\nexport const onInitializeOvermind = async ({\n state,\n actions,\n effects,\n}: Context) => {\n const cms = await effects.cms.fetch(\n \"https://www.pretre.no/kundeportal/?xml=document\"\n );\n state.cms = cms;\n\n state.isInitialLoadComplete = true;\n\n const { router } = effects;\n\n router.route(getNavigationRoute(Page.HOME), actions.navigation.openHome);\n router.route(\n getNavigationRoute(Page.TECHNICAL_SERVICES),\n actions.navigation.openTechnicalServices\n );\n router.route(getNavigationRoute(Page.LOGIN), actions.navigation.openLogin);\n router.route(\n getNavigationRoute(Page.RESET_PASSWORD),\n actions.navigation.openForgotPassword\n );\n router.route(\n getNavigationRoute(Page.ORDER_LIST),\n actions.navigation.openOrderList\n );\n router.route(\n getNavigationRoute(Page.VIEW_ORDER),\n actions.navigation.openViewOrder\n );\n router.route(\n getNavigationRoute(Page.VIEW_ORDER_PROJECT),\n actions.navigation.openViewOrderProject\n );\n router.route(\n getNavigationRoute(Page.CREATE_ORDER),\n actions.navigation.openCreateOrderStep\n );\n router.route(getNavigationRoute(Page.USER), actions.navigation.openUser);\n router.route(\n getNavigationRoute(Page.COMPANY),\n actions.navigation.openCompanyPage\n );\n router.route(\n getNavigationRoute(Page.DOCUMENTATION),\n actions.navigation.openDocumentationPage\n );\n router.route(getNavigationRoute(Page.EMULATE), actions.navigation.emulate);\n router.route(getNavigationRoute(Page.AUTH), actions.navigation.auth);\n router.route(\n getNavigationRoute(Page.CUSTOMER_SELECTOR),\n actions.navigation.openCompanySelector\n );\n try {\n router.start();\n } catch (error) {\n console.error(error);\n }\n};\n","/* eslint-disable no-param-reassign */\nimport { Page } from \"@frontend/common/src/types/Page\";\nimport { Context } from \"..\";\nimport { CreateOrderSteps } from \"../../types/CreateOrderSteps\";\nimport { createUrl } from \"../../app/pages\";\n\nexport const openLogin = async ({ state }: Context) => {\n state.navigation.currentPage = Page.LOGIN;\n};\n\nexport const openForgotPassword = async ({ state }: Context) => {\n state.navigation.currentPage = Page.RESET_PASSWORD;\n};\n\nexport const openHome = async ({ state }: Context) => {\n state.navigation.currentPage = Page.HOME;\n};\n\nexport const openTechnicalServices = async ({ state }: Context) => {\n state.navigation.currentPage = Page.TECHNICAL_SERVICES;\n};\n\nexport const openOrderList = async (\n { state, effects }: Context,\n routeArgs: any\n) => {\n const url = createUrl(Page.ORDER_LIST);\n effects.persistentCache.set(\"returnUrl\", url);\n if (state.mesterIdLogin && state.customer == null) {\n effects.router.navigateTo(createUrl(Page.CUSTOMER_SELECTOR));\n } else {\n state.navigation.currentPage = Page.ORDER_LIST;\n\n if (routeArgs.params && routeArgs.params.side) {\n state.orders.currentPage = parseInt(routeArgs.params.side, 10);\n } else {\n state.orders.currentPage = 1;\n }\n\n try {\n state.orders.isFetching = true;\n state.orders.orders = await effects.api.order.getAllForCustomerId(\n state.customer.id\n );\n state.orders.isFetching = false;\n } catch (error) {\n console.log(error);\n }\n }\n};\n\nexport const openViewOrder = async (\n { state, effects }: Context,\n routeArgs: any\n) => {\n state.navigation.currentPage = Page.VIEW_ORDER;\n state.orders.currentOrderId = routeArgs.params.id;\n\n try {\n let projectId = routeArgs.params.id;\n if (projectId.includes(\"_\")) {\n // eslint-disable-next-line prefer-destructuring\n projectId = projectId.split(\"_\")[0];\n }\n let customerId = state.customer?.id;\n if (customerId === undefined) {\n const proj = await effects.api.order.getByIdWithoutCustomer(projectId);\n customerId = proj.customerNumber;\n\n const customer = state.mesterIdCustomers.find((x) => x.id === customerId);\n state.customer = { ...customer };\n state.customerEmployees =\n await effects.api.customerEmployee.getAllForCustomerId(customer.id);\n }\n state.orders.orders = await effects.api.order.getAllForCustomerId(\n customerId\n );\n\n if (!state.orders.orders.find((order) => order.id === projectId)) {\n state.error = { message: \"Fant ikke ordre\" };\n state.navigation.currentPage = Page.ERROR;\n } else {\n state.orders.currentOrder.documents =\n await effects.api.order.getDocumentsForOrder(customerId, projectId);\n }\n } catch (error) {\n const cast = error as string;\n if (cast.includes(\"401\")) {\n const url = createUrl(Page.VIEW_ORDER, {\n id: routeArgs.params.id,\n });\n effects.persistentCache.set(\"returnUrl\", url);\n }\n console.log(error);\n }\n};\n\nexport const openViewOrderProject = async (\n { state, effects }: Context,\n routeArgs: any\n) => {\n if (state.auth.user === null) {\n effects.router.navigateTo(createUrl(Page.HOME));\n return;\n }\n\n state.navigation.currentPage = Page.VIEW_ORDER_PROJECT;\n state.orders.currentOrderProjectId = routeArgs.params.id;\n try {\n let projectId = routeArgs.params.id;\n if (projectId.includes(\"_\")) {\n // eslint-disable-next-line prefer-destructuring\n projectId = projectId.split(\"_\")[0];\n }\n let customerId = state.customer?.id;\n if (customerId === undefined) {\n const proj = await effects.api.order.getByIdWithoutCustomer(projectId);\n customerId = proj.customerNumber;\n\n const customer = state.mesterIdCustomers.find((x) => x.id === customerId);\n state.customer = { ...customer };\n state.customerEmployees =\n await effects.api.customerEmployee.getAllForCustomerId(customer.id);\n }\n state.orders.orders = await effects.api.order.getAllForCustomerId(\n customerId\n );\n if (\n !state.orders.orders.find(\n (order) => order.id === state.orders.currentOrderProjectId\n )\n ) {\n state.error = { message: \"Fant ikke ordre\" };\n state.navigation.currentPage = Page.ERROR;\n } else {\n const documents = await effects.api.order.getDocumentsForOrder(\n customerId,\n state.orders.currentOrderProjectId\n );\n state.orders.currentOrderProject.documents = documents;\n }\n } catch (error) {\n const cast = error as string;\n if (cast.includes(\"401\")) {\n const url = createUrl(Page.VIEW_ORDER_PROJECT, {\n id: routeArgs.params.id,\n });\n effects.persistentCache.set(\"returnUrl\", url);\n }\n console.log(error);\n }\n};\n\nexport const openCreateOrderStep = async (\n { state, effects, actions }: Context,\n routeArgs: any\n) => {\n if (state.mesterIdLogin && state.customer == null) {\n effects.router.navigateTo(createUrl(Page.CUSTOMER_SELECTOR));\n } else {\n // eslint-disable-next-line no-shadow\n const steps: { [index: string]: any } = {\n velg: CreateOrderSteps.PROJECT_TYPE,\n velgny: CreateOrderSteps.PROJECT_TYPE,\n kundeinfo: CreateOrderSteps.CUSTOMER_INFO,\n produktvalg: CreateOrderSteps.CHOOSE_PRODUCT,\n vedlegg: CreateOrderSteps.ATTACHMENTS,\n oppsummering: CreateOrderSteps.SUMMARY,\n kvittering: CreateOrderSteps.RECEIPT,\n };\n state.navigation.currentPage = Page.CREATE_ORDER;\n // eslint-disable-next-line no-prototype-builtins\n if (routeArgs.params.slug && steps.hasOwnProperty(routeArgs.params.slug)) {\n if (routeArgs.params.slug === \"velgny\") {\n actions.orders.clearAutofillAndDraftOrder();\n }\n state.activeCreateOrderStep = steps[routeArgs.params.slug];\n if (state.activeCreateOrderStep > state.orders.lastCompletedOrderStep) {\n state.orders.lastCompletedOrderStep = state.activeCreateOrderStep;\n }\n } else {\n // eslint-disable-next-line no-multi-assign\n state.activeCreateOrderStep = state.orders.lastCompletedOrderStep = 0;\n }\n }\n};\n\nexport const openUser = async ({ state }: Context) => {\n state.navigation.currentPage = Page.USER;\n};\n\nexport const openCompanyPage = async ({ state }: Context) => {\n state.navigation.currentPage = Page.COMPANY;\n};\n\nexport const openDocumentationPage = async ({ state }: Context) => {\n state.navigation.currentPage = Page.DOCUMENTATION;\n};\n\nexport const emulate = async ({ effects, state }: Context, routeArgs: any) => {\n const { customerId } = routeArgs.params;\n effects.tokenService.clear();\n state.customer = null;\n state.currentEmployeeId = null;\n state.auth.user = null;\n effects.persistentCache.set(\"customerId\", customerId);\n effects.router.navigateTo(createUrl(Page.LOGIN));\n};\n\nexport const auth = async ({ state }: Context) => {\n state.navigation.currentPage = Page.AUTH;\n};\n\nexport const openCompanySelector = async ({ state, effects }: Context) => {\n if (state.mesterIdLogin && state.mesterIdCustomers.length > 1) {\n state.navigation.currentPage = Page.CUSTOMER_SELECTOR;\n } else {\n effects.router.navigateTo(createUrl(Page.ORDER_LIST));\n }\n};\n","import { Page } from \"@frontend/common/src/types/Page\";\n\nexport type State = {\n currentPage: Page;\n};\n\nexport const state: State = {\n currentPage: Page.ADMIN,\n};\n","/* eslint-disable no-param-reassign */\nimport jwt_decode from \"jwt-decode\";\nimport { Page } from \"@frontend/common/src/types/Page\";\nimport { User, UserRole, UserType } from \"@frontend/common/src/types/User\";\nimport { LoginCredentials } from \"@frontend/common/src/types/LoginCredentials\";\nimport { createUrl } from \"../../app/pages\";\n\nimport { Context } from \"..\";\n\nconst dataOwner = process.env.REACT_APP_AUTH0_ADMINLOCATION;\n\nexport const login = async (\n { effects, actions }: Context,\n credentials: LoginCredentials\n) => {\n try {\n const token = await effects.api.auth.login(\n credentials.username,\n credentials.password\n );\n if (token) {\n await actions.auth.onLoggedIn(token);\n if (effects.persistentCache.get(\"returnUrl\")) {\n const returnUrl = effects.persistentCache.get(\"returnUrl\");\n effects.persistentCache.remove(\"returnUrl\");\n effects.router.navigateTo(returnUrl);\n } else {\n effects.router.navigateTo(createUrl(Page.ORDER_LIST));\n }\n } else {\n effects.toast(\"Innlogging feilet\");\n }\n } catch (errorMessage: any) {\n effects.toast(errorMessage, 5000);\n }\n};\n\n// called on successfull login\nexport const onLoggedIn = async (\n { state, effects }: Context,\n token: string\n) => {\n const decodedToken: {\n customerId: string;\n nameid: string;\n unique_name: string;\n role: UserRole;\n type: UserType;\n } = jwt_decode(token);\n\n const user: User = {\n id: decodedToken.nameid,\n customerId: decodedToken.customerId, // parseInt(decodedToken.customerId, 10),\n username: decodedToken.unique_name,\n role: decodedToken.role,\n type: decodedToken.type,\n isAdmin: decodedToken.role === UserRole.ADMIN,\n };\n state.auth.token = token;\n effects.tokenService.set(token);\n\n state.customer = await effects.api.customer.getById(user.customerId);\n state.pretreEmplyees = await effects.api.employees.getAll();\n state.customerEmployees =\n await effects.api.customerEmployee.getAllForCustomerId(user.customerId);\n\n const lookups = await effects.api.lookups.getLookups();\n state.buildingTypes = lookups.buildingTypes;\n state.technicalServices = lookups.technicalServices;\n state.offerOptions = lookups.offerOptions;\n state.mesterIdLogin = false;\n state.auth.user = user;\n if (user.type === UserType.EMPLOYEE) {\n state.currentEmployeeId = user.id;\n }\n if (effects.persistentCache.get(\"returnUrl\")) {\n const returnUrl = effects.persistentCache.get(\"returnUrl\");\n effects.persistentCache.remove(\"returnUrl\");\n effects.router.navigateTo(returnUrl);\n } else {\n effects.router.navigateTo(createUrl(Page.ORDER_LIST));\n }\n};\n\nexport const mockLoginWithToken = async (\n { actions }: Context,\n token: string\n) => {\n await actions.auth.onLoggedIn(token);\n};\n\nexport const logout = async ({ state, effects }: Context) => {\n try {\n effects.tokenService.clear();\n\n state.customer = null;\n state.currentEmployeeId = null;\n state.auth.user = null;\n\n // effects.router.navigateTo(createUrl(Page.LOGIN));\n // perform hard navigate to clear state.\n window.location.href = createUrl(Page.LOGIN);\n } catch (error: any) {\n alert(error.message);\n }\n};\n\nexport const logoutMesterId = async ({ state, effects }: Context) => {\n try {\n effects.tokenService.clear();\n state.customer = null;\n state.currentEmployeeId = null;\n state.auth.user = null;\n } catch (error: any) {\n alert(error.message);\n }\n};\ninterface mesterIdLogin {\n token: string;\n username: string;\n}\nexport const onMesterIdLoggedIn = async (\n { state, effects, actions }: Context,\n { token, username }: mesterIdLogin\n) => {\n try {\n const decodedToken = jwt_decode(token);\n actions.auth.updateToken(token);\n\n let customer;\n const customerId = effects.persistentCache.get(\"customerId\");\n if (customerId !== undefined && customerId !== null) {\n customer = await effects.api.customer.getById(customerId);\n }\n const customers = await effects.api.customer.getByToken();\n if (customers.length < 1) {\n effects.router.navigateTo(createUrl(Page.HOME));\n throw new Error(\"Ingen kunde-tilgang. Ta kontakt med administrator\");\n }\n const user = await effects.api.customerEmployee.getByUserName(username);\n state.mesterIdCustomers = customers;\n state.pretreEmplyees = await effects.api.employees.getAll();\n state.mesterIdLogin = true;\n const lookups = await effects.api.lookups.getLookups();\n state.buildingTypes = lookups.buildingTypes;\n state.offerOptions = lookups.offerOptions;\n state.technicalServices = lookups.technicalServices;\n state.mesterIdLogin = true;\n const { locations } =\n // @ts-ignore\n decodedToken[\"https://mestergruppen.no/authorization\"];\n const stateUser: User = {\n id: user.id,\n customerId: customers[0].id,\n username: user.email,\n role: locations.includes(dataOwner) ? UserRole.ADMIN : UserRole.USER,\n type: UserType.EMPLOYEE,\n isAdmin: locations.includes(dataOwner),\n };\n state.auth.user = stateUser;\n if (stateUser.type === UserType.EMPLOYEE) {\n state.currentEmployeeId = user.id;\n }\n if (customer !== undefined && stateUser.isAdmin) {\n effects.persistentCache.remove(\"customerId\");\n state.mesterIdCustomers = [...state.mesterIdCustomers, customer];\n state.customer = customer;\n state.customerEmployees =\n await effects.api.customerEmployee.getAllForCustomerId(customer.id);\n effects.router.navigateTo(createUrl(Page.HOME));\n } else if (customers.length === 1) {\n // eslint-disable-next-line prefer-destructuring\n state.customer = customers[0];\n state.customerEmployees =\n await effects.api.customerEmployee.getAllForCustomerId(customers[0].id);\n if (effects.persistentCache.get(\"returnUrl\")) {\n const returnUrl = effects.persistentCache.get(\"returnUrl\");\n effects.persistentCache.remove(\"returnUrl\");\n effects.router.navigateTo(returnUrl);\n } else {\n effects.router.navigateTo(createUrl(Page.HOME));\n }\n } else if (effects.persistentCache.get(\"returnUrl\")) {\n const returnUrl = effects.persistentCache.get(\"returnUrl\");\n effects.persistentCache.remove(\"returnUrl\");\n effects.router.navigateTo(returnUrl);\n } else {\n effects.router.navigateTo(createUrl(Page.HOME));\n }\n } catch (error: any) {\n effects.tokenService.clear();\n effects.router.navigateTo(createUrl(Page.HOME));\n effects.toast(error, 5000);\n }\n};\n\nexport const onMesterIdSelectCustomer = async (\n { state, effects }: Context,\n customerId: string\n) => {\n const customer = state.mesterIdCustomers.find((x) => x.id === customerId);\n state.customer = { ...customer };\n state.customerEmployees =\n await effects.api.customerEmployee.getAllForCustomerId(customer.id);\n\n if (effects.persistentCache.get(\"returnUrl\")) {\n const returnUrl = effects.persistentCache.get(\"returnUrl\");\n effects.persistentCache.remove(\"returnUrl\");\n effects.router.navigateTo(returnUrl);\n } else {\n effects.router.navigateTo(createUrl(Page.HOME));\n }\n};\nexport const forgotPassword = async (\n { effects, actions }: Context,\n credentials: { email: string }\n) => {\n try {\n await effects.api.auth.forgotPassword(credentials.email);\n effects.toast(\"Nytt passord er sendt\");\n actions.navigation.openLogin();\n } catch (error: any) {\n effects.toast(error, 5000);\n }\n};\n\nexport const updateToken = ({ state, effects }: Context, newToken: string) => {\n state.auth.token = null;\n effects.tokenService.clear();\n state.auth.token = newToken;\n effects.tokenService.set(newToken);\n};\n","import { User } from \"@frontend/common/src/types/User\";\n\ntype State = {\n token: string;\n user: User;\n};\n\nexport const state: State = {\n token: null,\n user: null,\n};\n","export class FileUploadError extends Error {}\n","/* eslint-disable no-param-reassign */\nimport fileDownload from \"js-file-download\";\nimport { UserType } from \"@frontend/common/src/types/User\";\nimport { Page } from \"@frontend/common/src/types/Page\";\nimport { Context } from \"..\";\nimport { OrderFilter, OrderSortOption } from \"../../types/Order\";\nimport { Document } from \"../../types/Document\";\nimport { createUrl } from \"../../app/pages\";\nimport { DraftOrder } from \"../../types/DraftOrder/DraftOrder\";\nimport { CreateOrderSteps } from \"../../types/CreateOrderSteps\";\nimport { FileUploadError } from \"../../errors/FileUploadError\";\nimport { DraftOrderSubProject } from \"../../types/DraftOrder/DraftOrderSubProject\";\n\nexport const changeOrderFilter = async (\n { state, effects }: Context,\n change: OrderFilter\n) => {\n state.orders.orderFilter = {\n ...state.orders.orderFilter,\n ...change,\n };\n\n effects.router.navigateTo(\n createUrl(Page.ORDER_LIST, { side: state.orders.currentPage })\n );\n};\n\nexport const clearOrderFilter = async ({ state }: Context) => {\n state.orders.currentPage = 1;\n state.orders.orderFilter = {\n hideDeliveredOrders: true,\n deliveryYear: null,\n showOnlyMyOrdersAndProjects: state.auth.user.type === UserType.EMPLOYEE,\n };\n};\n\nexport const downloadDocument = async (\n { effects }: Context,\n payload: docDownload\n) => {\n const filename = `${payload.file.description}`;\n const contents = await effects.api.order.getDocument(\n payload.file.customerId,\n payload.file.orderId,\n filename\n );\n fileDownload(contents, payload.file.description);\n};\n\nexport const setSortOption = async (\n { state }: Context,\n option: OrderSortOption\n) => {\n state.orders.currentOrderSortOption = option;\n};\nexport type docDownload = {\n file: Document;\n};\n\nexport const openDocument = async (\n { effects }: Context,\n payload: docDownload\n) => {\n const filename = `${payload.file.description}`;\n const contents = await effects.api.order.getDocument(\n payload.file.customerId,\n payload.file.orderId,\n filename\n );\n const fileX = new Blob([contents], { type: \"application/pdf;base64\" });\n const fileURL = URL.createObjectURL(fileX);\n window.open(fileURL);\n};\n\nexport const getOrderAutofill = async (\n { state, effects }: Context,\n params: { customerId: string; offerId: string }\n) => {\n const data = await effects.api.order.getOrderFromOfferId(\n params.customerId,\n params.offerId\n );\n if (data) {\n state.orders.autofill = {\n ...data,\n offerId: params.offerId,\n } as DraftOrder;\n state.orders.currentNewOrder = {\n ...state.orders.currentNewOrder,\n };\n }\n};\n\nexport const commitDraftOrder = async (\n { state, effects }: Context,\n payload: {\n customerId: string;\n order: DraftOrder;\n offerId?: string;\n }\n) => {\n try {\n const orderId = await effects.api.order.commitDraftOrder(\n payload.customerId,\n payload.order,\n state.auth.user.username,\n payload?.offerId\n );\n state.orders.currentNewOrder.orderId = orderId;\n effects.router.navigateTo(\n createUrl(Page.CREATE_ORDER, { slug: \"kvittering\" })\n );\n } catch (error) {\n effects.toast(error as string, 5000);\n }\n};\n\nexport const commitSubProjs = async (\n { state, effects }: Context,\n payload: {\n customerId: string;\n order: DraftOrder;\n projectId: string;\n offerId?: string;\n }\n) => {\n try {\n await effects.api.order.commitSubProjects(\n payload.customerId,\n payload.order,\n state.auth.user.username,\n payload.projectId,\n payload?.offerId\n );\n const files = effects.localFileStorage.get();\n\n if (files && files.length) {\n try {\n await effects.api.order.addFiles(\n payload.projectId,\n files,\n payload.customerId\n );\n effects.localFileStorage.set(undefined);\n } catch (error) {\n effects.localFileStorage.set(undefined);\n throw new FileUploadError();\n }\n }\n } catch (e) {\n if (e instanceof FileUploadError) {\n effects.toast(\"Tilbud opprettet, men ikke alle filer ble sendt.\", 5000);\n }\n }\n};\n\nexport const updateDraftOrder = ({ state }: Context, payload: DraftOrder) => {\n state.orders.currentNewOrder = {\n ...state.orders.currentNewOrder,\n ...payload,\n };\n};\nexport const setSubProjectsOnDraftOrder = (\n { state }: Context,\n subProjects: DraftOrderSubProject[]\n) => {\n state.orders.currentNewOrder = {\n ...state.orders.currentNewOrder,\n subProjects,\n };\n state.orders.autofill = {\n ...state.orders.autofill,\n subProjects: [],\n };\n};\n\nexport const setQuotationOnDraftOrder = (\n { state }: Context,\n payload: { isQuotation: boolean; quickChoice?: string }\n) => {\n state.orders.currentNewOrder = {\n ...state.orders.currentNewOrder,\n quotation: payload.isQuotation,\n };\n state.orders.isQuote = payload.isQuotation;\n state.orders.quickChoice = payload.quickChoice;\n};\n\nexport const setOrderConverted = ({ state }: Context, payload: boolean) => {\n state.orders.orderConverted = payload;\n};\n\nexport const setDraftOfferFiles = ({ effects }: Context, files: File[]) => {\n effects.localFileStorage.set(files);\n};\n\nexport const cancelCreateOrder = ({ effects, state }: Context) => {\n state.orders.currentNewOrder = {} as DraftOrder;\n state.orders.autofill = null;\n state.orders.lastCompletedOrderStep = CreateOrderSteps.CUSTOMER_INFO;\n effects.router.navigateTo(createUrl(Page.HOME));\n};\n\nexport const clearAutofillAndDraftOrder = ({ state }: Context) => {\n state.orders.currentNewOrder = {} as DraftOrder;\n state.orders.autofill = null;\n state.orders.lastCompletedOrderStep = CreateOrderSteps.PROJECT_TYPE;\n};\n","import {\n MIN_ORDER_STATUS_WHEN_COMPLETED,\n Order,\n OrderFilter,\n} from \"../../../types/Order\";\n\nconst isset = (value: any) => value !== undefined && value !== null;\n\nexport function filterOrder(\n order: Order,\n filter: OrderFilter,\n currentUserId: string\n) {\n if (isset(filter.status) && order.valueChainStatus !== filter.status) {\n return false;\n }\n\n if (isset(filter.projectId) && order.id !== filter.projectId) {\n return false;\n }\n\n if (isset(filter.freeText)) {\n const mainOrderContains = Object.values(order).some((x) => {\n return (\n x !== null &&\n x !== undefined &&\n x.toString().toLowerCase().indexOf(filter.freeText.toLowerCase()) > -1\n );\n });\n if (mainOrderContains) {\n return true;\n }\n return order.subProjects.some((or) => {\n return Object.values(or).some((x) => {\n return (\n x !== null &&\n x !== undefined &&\n x.toString().toLowerCase().indexOf(filter.freeText.toLowerCase()) > -1\n );\n });\n });\n }\n\n if (\n isset(filter.projectName) &&\n !`${order.projectName}`\n .toLowerCase()\n .includes(filter.projectName.toLowerCase())\n ) {\n return false;\n }\n\n if (\n isset(filter.customerOrderNumber) &&\n !order.customerOrderNumber\n ?.toString()\n .includes(filter.customerOrderNumber.toString())\n ) {\n return false;\n }\n\n if (\n isset(filter.showOnlyMyOrdersAndProjects) &&\n filter.showOnlyMyOrdersAndProjects === true &&\n order.customerEmployeeId !== currentUserId\n ) {\n return false;\n }\n if (\n isset(filter.product) &&\n !order.subProjects.some((x) => x.product === filter.product)\n ) {\n return false;\n }\n if (isset(filter.deliveryYear)) {\n const year = order.delivery.getFullYear();\n\n if (year !== filter.deliveryYear) {\n return false;\n }\n }\n\n if (\n isset(filter.contactId) &&\n order.customerEmployeeId !== filter.contactId\n ) {\n return false;\n }\n\n if (\n isset(filter.hideDeliveredOrders) &&\n filter.hideDeliveredOrders === true &&\n order.status >= MIN_ORDER_STATUS_WHEN_COMPLETED\n ) {\n return false;\n }\n if (\n isset(filter.showOnlyProjects) &&\n filter.showOnlyProjects === true &&\n order.isProjectMaster === false\n ) {\n return false;\n }\n\n return true;\n}\n","/* eslint-disable no-shadow */\nimport { derived } from \"overmind\";\nimport { Direction } from \"@frontend/common/src/components/Table/Direction\";\nimport { filterOrder } from \"./helpers/filterOrders\";\nimport { Order, OrderFilter, OrderSortOption } from \"../../types/Order\";\nimport { RootState } from \"..\";\nimport { DraftOrder } from \"../../types/DraftOrder/DraftOrder\";\n\ntype State = {\n numPerPage: number;\n currentPage: number;\n pageCount: number;\n orders: Order[];\n\n masterProjects: { [index: string]: any };\n filteredOrders: Order[];\n currentPageItems: Order[];\n orderFilter: OrderFilter;\n\n currentOrderId: string;\n currentOrder: Order;\n\n currentOrderProjectId: string;\n currentOrderProject: Order;\n currentOrderSortOption: OrderSortOption;\n\n lastCompletedOrderStep: number;\n\n autofill: DraftOrder;\n currentNewOrder: DraftOrder;\n orderConverted: boolean;\n isQuote: boolean;\n quickChoice?: string;\n isFetching: boolean;\n};\n\nexport const state: State = {\n numPerPage: 20,\n currentPage: 1,\n pageCount: derived((state: State) => {\n return Math.ceil(state.filteredOrders.length / state.numPerPage);\n }),\n orderConverted: false,\n orders: [],\n isQuote: true,\n masterProjects: derived((state: State) => {\n const projects: { [index: string]: any } = {};\n state.orders\n .filter((o) => o.isProjectMaster)\n .forEach((o) => {\n projects[o.id] = o.id;\n });\n return projects;\n }),\n\n orderFilter: {\n hideDeliveredOrders: true,\n deliveryYear: null,\n },\n\n // memoized results of filter\n filteredOrders: derived((state: State, rootState: RootState) => {\n return state.orders.filter((o) =>\n filterOrder(o, state.orderFilter, rootState.currentEmployeeId)\n );\n }),\n\n currentOrderSortOption: null,\n currentPageItems: derived((state: State) => {\n let sortedItems: Order[];\n\n if (state.currentOrderSortOption) {\n sortedItems = state.filteredOrders.sort((a, b) => {\n if (\n a[state.currentOrderSortOption.field] <\n b[state.currentOrderSortOption.field]\n )\n return state.currentOrderSortOption.direction === Direction.ascending\n ? 1\n : -1;\n if (\n a[state.currentOrderSortOption.field] >\n b[state.currentOrderSortOption.field]\n )\n return state.currentOrderSortOption.direction === Direction.ascending\n ? -1\n : 1;\n return 0;\n });\n } else {\n sortedItems = state.filteredOrders;\n }\n\n if (Math.ceil(state.filteredOrders.length / state.numPerPage) > 1) {\n return sortedItems.slice(\n (state.currentPage - 1) * state.numPerPage,\n (state.currentPage - 1) * state.numPerPage + state.numPerPage\n );\n }\n return sortedItems;\n }),\n\n currentOrderId: null,\n currentOrderProjectId: null,\n\n currentOrder: derived((state: State) => {\n let projectId = state.currentOrderId;\n if (state.orders.length === 0) return null;\n\n if (projectId !== null && projectId.includes(\"_\")) {\n // eslint-disable-next-line prefer-destructuring\n projectId = projectId.split(\"_\")[0];\n const project = state.orders.find((o) => o.id === projectId);\n return project.subProjects.find((o) => o.id === state.currentOrderId);\n }\n return state.orders.find((o) => o.id === state.currentOrderId);\n }),\n\n currentOrderProject: derived((state: State) => {\n return state.orders.find((o) => o.id === state.currentOrderProjectId);\n }),\n\n lastCompletedOrderStep: null,\n autofill: null,\n currentNewOrder: {} as DraftOrder,\n isFetching: false,\n};\n","/* eslint-disable no-undef,no-param-reassign */\n// @ts-nocheck\nimport { derived, IState } from \"overmind\";\n\nexport const createModals = <\n T extends {\n [name: string]: {\n state?: IState;\n result?: unknown;\n };\n }\n>(\n modals: T\n): {\n state: {\n current: keyof T | null;\n } & {\n [K in keyof T]: T[K][\"state\"] & { isCurrent: boolean };\n };\n actions: {\n [K in keyof T]: {\n open: ContextFunction<\n T[K][\"state\"] extends IState ? T[K][\"state\"] : void,\n T[K][\"result\"]\n >;\n close: ContextFunction<T[K][\"result\"], void>;\n };\n };\n} => {\n function createModal(name, modal) {\n let resolver: ((res: T) => void) | null;\n\n const open = async ({ state }: Context, newState = {}) => {\n state.modals.current = name;\n\n Object.assign(state.modals[name], newState);\n\n return new Promise((resolve) => {\n resolver = resolve;\n });\n };\n\n const close = async ({ state }: Context, payload) => {\n state.modals.current = null;\n if (modal.state) {\n Object.keys(modal.state).forEach((stateKey) => {\n state.modals[name][stateKey] = modal.state[stateKey];\n });\n }\n if (resolver) {\n resolver(typeof payload === \"undefined\" ? modal.result : payload);\n }\n };\n\n return {\n state: {\n ...modal.state,\n isCurrent: derived(\n (_, root: Context[\"state\"]) => root.modals.current === name\n ),\n },\n actions: {\n open,\n close,\n },\n };\n }\n\n return Object.keys(modals).reduce(\n (aggr, name) => {\n const modal = createModal(name, modals[name]);\n\n aggr.state[name] = modal.state;\n aggr.actions[name] = modal.actions;\n\n return aggr;\n },\n {\n state: {\n current: null,\n },\n actions: {},\n }\n ) as any;\n};\n","import { Direction } from \"@frontend/common/src/components/Table/Direction\";\nimport { Document } from \"./Document\";\nimport { Link } from \"./Link\";\n\nexport const MIN_ORDER_STATUS_WHEN_COMPLETED = 140;\n\nexport type Order = {\n id: string;\n product: string;\n projectId?: string;\n delivery: Date;\n deliveryDay: number;\n deliveryWeek: number;\n deliveryYear: number;\n deliveryTerms?: string;\n orderDate: string;\n status: number;\n sum: number;\n marked: string;\n deliveryAddress: string;\n constructionContactPhone: string;\n constructionContactName: string;\n customerOrderNumber: number;\n isProjectMaster: boolean;\n embedHash?: string;\n embedId?: number;\n documents?: Document[];\n links: Link[];\n customerEmployeeId: string;\n engineerId: string;\n isOrderPriceCalculated: boolean;\n subProjects: Order[];\n salesPersonId: string;\n valueChainStatus: number;\n customerNumber: string;\n projectName: string;\n\n calculationName: string;\n constructionName: string;\n};\n\nexport type OrderFilter = {\n status?: number;\n projectId?: string;\n freeText?: string;\n customerOrderNumber?: number | string;\n product?: string;\n hideDeliveredOrders?: boolean;\n showOnlyMyOrdersAndProjects?: boolean;\n deliveryYear?: number;\n projectName?: string;\n\n contactId?: string;\n showOnlyProjects?: boolean;\n};\n\nexport type OrderSortOption = {\n field: keyof Order;\n direction: Direction;\n};\n","export const sendMessageModal = {\n state: { userId: null as string },\n result: null as string,\n};\n\nexport const editEmployeeModal = {\n state: { employeeId: null as string },\n result: null as void,\n};\n\nexport const fileUploadModal = {\n state: {},\n result: null as FileList,\n};\nexport const calculatePriceModal = {\n state: {},\n result: null as any,\n};\nexport const selectionGridModal = {\n state: { items: null as any[] },\n result: null as any,\n};\n\nexport const precutModal = {\n state: { projectId: null as string },\n result: null as void,\n};\n","import { merge, namespaced } from \"overmind/config\";\nimport { state } from \"./state\";\nimport * as actions from \"./actions\";\nimport * as effects from \"./effects\";\nimport * as navigation from \"./navigation\";\nimport * as auth from \"./auth\";\nimport * as orders from \"./orders\";\nimport { createModals } from \"./createModals\";\nimport * as modals from \"./modals/config\";\n\nexport const config = merge(\n {\n state,\n actions,\n effects,\n },\n namespaced({\n auth,\n navigation,\n orders,\n modals: createModals(modals),\n })\n);\n","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGkAAAAqCAYAAACwTnX4AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA28SURBVHgB7Vt5bFzFGf/ee7u+d22vHYf4wiEHlAAJxIE0EIuERG1BHCoFitqmB0Wp2tICagMCNYnSlkrQShxpqyAqqkocarlEC6VAQkgKxiFHHYgDKUmcBNtJfK53vT52vY/f92aed97zru2Nc/2xn/Q882a+mflmvvnOtzaqqsr3+P0F1/l8hcdCodBBysBZB4bf719HpF2i69qyoiK/x+vN2h2JRIYoA2cN6KZJJkrNNM2KeNz8bW5u1ovTp087lzJw1oCu66TbL5qmeUxTWx6N6m9WV5dfyU2UgTMOUHe+avDiItS9SnsJmLXY58tvmz+/dl9zc3OcMnDGwAgESjYND8eOwibV4T1H6SvRNH1pd3dnqKxs6u6urq5hysAZAaOnpycWCoV3FhYWNROZV6DNT5bms/rzUF0Si0WNrKzsT+FQhCkDpx0Mu9Lb2/sxpKo+Ho+Xw4mYDuZYtgrM8oJjizweT21JSWkDmNpJGTitYKgvYMDnxcXZ7xB5ysCcOdwvJErjcvrw8PAyn8+/A/HU55SB0wZGRUXFikDAl5+XV9AZDoejwWAknJub9xbskQeMuRQ4WQp+KdrqwKjjYNSneM84FKcBjMJC/yZIyi148nHwW9AW7+vri1ZVVW0dGor2wU4tJsXzA5NKUFzj9xd2VFZWftze3p5xKE4xcMbhlyhZvdXh4Ofm5+f/DxLVwYcPO7UNbTvRzw5FQBmXC+ZdOzg4OMMwPJsGBgYGKQOnDAyorlVgUJ705s6HK359YaGvDSqvGRI1BEbtLyoq3gimVOGZCSdCZ1wugX9Jdra3trg4sD0YDGYcilMErO7uI8vVtoBZVYRiKTIR4dmzwzva2mgYDGgH0zYahg5GaXPImYk4j113SGQjGNpC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nwyaUqR1aCumzEJh5G9UGSrjzn2eCDz4Wn18gJXIMSXiUJ9bJapcOel72oeqJbwah/u9cfJtJ0J25SGBDqTbPnVo+Eg88dUHs4h6+S/KZmiqTrd1H9lTqPnD8X5Uqi0Rdcmv5FTJNuHzyX7lSPyhhnn9mH9/WxWOxvdgsCnnBcZLRtCAZkPmw8gMt1TEvcfF7qkNoPO7QB/ZtG6ELm2yscCmboAby3u2yaA+xDB67XsKYbDR7xMXFAGdOaAo8/YHYodol/YDgyDt+69qP/cVXtYt157+Dc2btku6UrXp/LMx2pczsuzhS+lSyC/Ls6M9UQZlQciXNWd/ARhqAOD+EUn/V4wm+2tARto84Jy15E3X/E6g+bItv89G7XF9hUAD32ATi0FUvA87RS98+o/RciJYa572dVh+c8tkm69ZHTuq77cRPuRdt3SHyvcuxEOYwoxmyBdL+djAYcRn1UuMJL2COFNPwjGR4+/bIRfgob/I0uvp39pS3h3Fg2ETboMZkaYonii/vc1TgT2bcmLrLfnCYz3LQqHMC09OgXSXr8/VD7K7IAAAAASUVORK5CYII=\"","// @ts-nocheck\n// https://github.com/beautifulinteractions/beautiful-react-hooks/blob/master/src/useMediaQuery.js\nimport { useState, useEffect } from \"react\";\n\n/**\n * Accepts a media query string then uses the\n * [window.matchMedia](https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia) API to determine if it\n * matches with the current document.<br />\n * It also monitor the document changes to detect when it matches or stops matching the media query.<br />\n * Returns the validity state of the given media query.\n *\n */\nexport const useMediaQuery = (mediaQuery) => {\n const [isVerified, setIsVerified] = useState(\n !!window.matchMedia(mediaQuery).matches\n );\n\n useEffect(() => {\n const mediaQueryList = window.matchMedia(mediaQuery);\n const documentChangeHandler = () => setIsVerified(!!mediaQueryList.matches);\n\n mediaQueryList.addListener(documentChangeHandler);\n\n documentChangeHandler();\n return () => {\n mediaQueryList.removeListener(documentChangeHandler);\n };\n }, [mediaQuery]);\n\n return isVerified;\n};\n\nexport default useMediaQuery;\n","import styled, { css } from \"styled-components\";\nimport { PreTreColors } from \"../../../styles/constants\";\n\nconst activeItemStyle = css`\n color: ${PreTreColors.pretre};\n font-weight: 700;\n`;\n\ntype ItemProps = {\n isActive?: boolean;\n};\n\nexport const Item = styled(\"a\")<ItemProps>`\n display: flex;\n padding: 1rem;\n justify-content: space-around;\n align-items: center;\n color: black;\n\n ${(props: ItemProps) => props.isActive && activeItemStyle}\n\n &:hover {\n color: ${PreTreColors.pretre};\n }\n cursor: pointer;\n text-decoration: none;\n margin-bottom: -10px;\n`;\n\ntype ContainerProps = { isOverlay: boolean };\n\nconst overlayMenu = css`\n position: absolute;\n background: white;\n display: flex;\n flex-direction: column;\n width: 100%;\n margin: 0;\n`;\nconst column = css`\n position: absolute;\n background: white;\n display: flex;\n flex-direction: column;\n width: 100%;\n`;\n\nexport const ItemContainer = styled(\"div\")<ContainerProps>`\n display: flex;\n ${(props: ContainerProps) => props.isOverlay && column}\n`;\n\nexport const Container = styled(\"div\")<ContainerProps>`\n margin-right: 1rem;\n margin-left: 1rem;\n min-height: 5rem;\n display: flex;\n justify-content: space-between;\n\n ${(props: ContainerProps) => props.isOverlay && overlayMenu}\n`;\n\nexport const DropdownItem = styled(\"div\")`\n display: flex;\n padding: 1rem;\n justify-content: space-around;\n align-items: center;\n color: black;\n &:hover {\n color: ${PreTreColors.pretre};\n }\n cursor: pointer;\n margin-bottom: -10px;\n`;\n\nexport const BurgerBar = styled(\"div\")`\n z-index: 1;\n cursor: pointer;\n justify-content: space-between;\n color: red;\n background-color: \"red\";\n width: 100%;\n color: \"blue\";\n display: flex;\n align-items: center;\n`;\nexport const BurgerButton = styled(\"div\")`\n z-index: 1;\n cursor: pointer;\n\n color: ${PreTreColors.pretre};\n width: 3rem;\n color: \"blue\";\n height: 3rem;\n\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n","/* eslint-disable jsx-a11y/click-events-have-key-events,jsx-a11y/no-noninteractive-element-interactions */\nimport React, { FunctionComponent, useEffect, useRef, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { User } from \"@frontend/common/src/types/User\";\nimport { Page } from \"@frontend/common/src/types/Page\";\nimport { useAuth0 } from \"@auth0/auth0-react\";\nimport Logo from \"../../../assets/img/pretre_logo.png\";\nimport { useMediaQuery } from \"../../../hooks/useMediaQuery\";\nimport { useOnClickOutside } from \"../../../hooks/useOnClickOutside\";\nimport { useActions, useAppState, useEffects } from \"../../../overmind\";\nimport { LayoutConstants } from \"../../../styles/constants\";\nimport { createUrl } from \"../../pages\";\nimport {\n BurgerBar,\n BurgerButton,\n Container,\n DropdownItem,\n Item,\n ItemContainer,\n} from \"./MainMenu.styles\";\n\ntype MenuItemConfig = {\n label: string;\n href: string;\n showAsActiveFor: Page[];\n};\nconst buildVersion = process.env.REACT_APP_BUILD_VERSION;\n\nconst getMenuItems = (t: any): MenuItemConfig[] => {\n const items: MenuItemConfig[] = [\n {\n label: t(\"My orders\"),\n href: createUrl(Page.ORDER_LIST),\n showAsActiveFor: [\n Page.ORDER_LIST,\n Page.VIEW_ORDER,\n Page.VIEW_ORDER_PROJECT,\n ],\n },\n {\n label: t(\"Nytt prosjekt\"),\n href: createUrl(Page.CREATE_ORDER, { slug: \"velgny\" }),\n showAsActiveFor: [Page.CREATE_ORDER],\n },\n {\n label: t(\"Documentation\"),\n href: createUrl(Page.DOCUMENTATION),\n showAsActiveFor: [Page.DOCUMENTATION],\n },\n ];\n return items;\n};\n\ntype Props = {\n currentPage: Page;\n displayName?: string;\n user?: User;\n};\n\nexport const MainMenu: FunctionComponent<Props> = ({\n currentPage,\n user,\n displayName,\n}) => {\n const { t } = useTranslation();\n const items = user !== null ? getMenuItems(t) : [];\n const actions = useActions();\n const effects = useEffects();\n const state = useAppState();\n const { logout } = useAuth0();\n const ref = useRef();\n const [isOpen, toggleMenu] = useState(false);\n\n const isSmall = useMediaQuery(\n `(max-width: ${LayoutConstants.sidebarBreak}px)`\n );\n const [hover, setHover] = useState(false);\n const onHover = () => {\n setHover(true);\n };\n\n const onLeave = () => {\n setHover(false);\n };\n useOnClickOutside(ref, () => {\n toggleMenu(!isOpen);\n });\n\n useEffect(() => {\n toggleMenu(false);\n }, [currentPage]);\n\n // Temporary menu while guest has no items present\n if (user === null) {\n return (\n <Container isOverlay={false}>\n <ItemContainer isOverlay={false}>\n <Item href=\"/\">\n <img style={{ margin: \"0.5rem\" }} src={Logo} alt=\"logo\" />\n </Item>\n </ItemContainer>\n <ItemContainer isOverlay={false}>\n <DropdownItem\n onClick={() => effects.router.navigateTo(createUrl(Page.LOGIN))}\n >\n <svg\n width=\"32\"\n height=\"32\"\n viewBox=\"0 0 32 32\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M2.56799 19.2578C3.05072 21.2543 3.96711 23.0829 5.21215 24.6361C8.29813 22.3574 12.0524 21.0906 16.0001 21.0906C19.9477 21.0906 23.7019 22.3574 26.788 24.6361C28.033 23.0828 28.9494 21.2541 29.4322 19.2578C29.6858 18.2051 29.8181 17.1128 29.8181 16C29.8181 8.369 23.631 2.18188 16 2.18188C8.36897 2.18188 2.18185 8.369 2.18185 16C2.18185 17.1128 2.31412 18.2051 2.56778 19.2578H2.56799ZM25.2812 26.2384C22.6629 24.3715 19.4596 23.2724 16 23.2724C12.5404 23.2724 9.33706 24.3715 6.7188 26.2384C9.17204 28.4626 12.4273 29.8181 16 29.8181C19.5727 29.8181 22.8281 28.4626 25.2812 26.2384ZM16 32C7.16355 32 0 24.8364 0 16C0 7.16355 7.16355 0 16 0C24.8364 0 32 7.16355 32 16C32 24.8364 24.8364 32 16 32Z\"\n fill=\"#430A03\"\n />\n <path\n d=\"M16.0005 17.455C18.0091 17.455 19.6374 15.8268 19.6374 13.8181C19.6374 11.8094 18.0091 10.1811 16.0005 10.1811C13.9918 10.1811 12.3635 11.8094 12.3635 13.8181C12.3635 15.8268 13.9918 17.455 16.0005 17.455ZM16.0005 19.6369C12.7876 19.6369 10.1816 17.0309 10.1816 13.8181C10.1816 10.6052 12.7876 7.99927 16.0005 7.99927C19.2133 7.99927 21.8193 10.6052 21.8193 13.8181C21.8193 17.0309 19.2133 19.6369 16.0005 19.6369Z\"\n fill=\"#430A03\"\n />\n </svg>\n </DropdownItem>\n </ItemContainer>\n </Container>\n );\n }\n\n if (isSmall && !isOpen) {\n return (\n <BurgerBar>\n <img style={{ margin: \"0.5rem\" }} src={Logo} alt=\"logo\" />\n <BurgerButton onClick={() => toggleMenu(!isOpen)}>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <line x1=\"3\" y1=\"12\" x2=\"21\" y2=\"12\" />\n <line x1=\"3\" y1=\"6\" x2=\"21\" y2=\"6\" />\n <line x1=\"3\" y1=\"18\" x2=\"21\" y2=\"18\" />\n </svg>\n </BurgerButton>\n </BurgerBar>\n );\n }\n return (\n <Container isOverlay={isSmall}>\n {isSmall && (\n <BurgerBar>\n <img style={{ margin: \"0.5rem\" }} src={Logo} alt=\"logo\" />\n </BurgerBar>\n )}\n\n <ItemContainer isOverlay={isSmall}>\n <Item href=\"/\">\n <img style={{ margin: \"0.5rem\" }} src={Logo} alt=\"logo\" />\n <span\n style={{\n position: \"absolute\",\n right: \".5rem\",\n top: \".5rem\",\n fontSize: \".5rem\",\n }}\n >\n {displayName}\n </span>\n </Item>\n </ItemContainer>\n <ItemContainer isOverlay={isSmall}>\n {items.map((i, idx) => (\n <Item\n key={idx}\n href={i.href}\n isActive={i.showAsActiveFor.includes(currentPage)}\n >\n {i.label}\n </Item>\n ))}\n {state.mesterIdLogin && state.mesterIdCustomers.length > 1 ? (\n <Item\n href={createUrl(Page.CUSTOMER_SELECTOR)}\n isActive={currentPage === Page.CUSTOMER_SELECTOR}\n >\n Kundevelger\n </Item>\n ) : null}\n {user ? (\n <Item>\n <p\n onClick={() => {\n if (state.mesterIdLogin) {\n actions.auth.logoutMesterId().then(() => {\n logout({ returnTo: window.location.origin });\n });\n } else {\n actions.auth.logout();\n }\n }}\n >\n {t(\"Logout\")}\n </p>\n </Item>\n ) : null}\n\n <DropdownItem>\n <svg\n width=\"32\"\n height=\"32\"\n viewBox=\"0 0 32 32\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n onMouseEnter={onHover}\n onMouseLeave={onLeave}\n >\n <path\n d=\"M2.56799 19.2578C3.05072 21.2543 3.96711 23.0829 5.21215 24.6361C8.29813 22.3574 12.0524 21.0906 16.0001 21.0906C19.9477 21.0906 23.7019 22.3574 26.788 24.6361C28.033 23.0828 28.9494 21.2541 29.4322 19.2578C29.6858 18.2051 29.8181 17.1128 29.8181 16C29.8181 8.369 23.631 2.18188 16 2.18188C8.36897 2.18188 2.18185 8.369 2.18185 16C2.18185 17.1128 2.31412 18.2051 2.56778 19.2578H2.56799ZM25.2812 26.2384C22.6629 24.3715 19.4596 23.2724 16 23.2724C12.5404 23.2724 9.33706 24.3715 6.7188 26.2384C9.17204 28.4626 12.4273 29.8181 16 29.8181C19.5727 29.8181 22.8281 28.4626 25.2812 26.2384ZM16 32C7.16355 32 0 24.8364 0 16C0 7.16355 7.16355 0 16 0C24.8364 0 32 7.16355 32 16C32 24.8364 24.8364 32 16 32Z\"\n fill=\"#430A03\"\n />\n <path\n d=\"M16.0005 17.455C18.0091 17.455 19.6374 15.8268 19.6374 13.8181C19.6374 11.8094 18.0091 10.1811 16.0005 10.1811C13.9918 10.1811 12.3635 11.8094 12.3635 13.8181C12.3635 15.8268 13.9918 17.455 16.0005 17.455ZM16.0005 19.6369C12.7876 19.6369 10.1816 17.0309 10.1816 13.8181C10.1816 10.6052 12.7876 7.99927 16.0005 7.99927C19.2133 7.99927 21.8193 10.6052 21.8193 13.8181C21.8193 17.0309 19.2133 19.6369 16.0005 19.6369Z\"\n fill=\"#430A03\"\n />\n </svg>\n\n {hover ? (\n <p style={{ position: \"absolute\", top: \"7.5%\" }}>\n Versjon: {buildVersion}\n </p>\n ) : null}\n </DropdownItem>\n </ItemContainer>\n </Container>\n );\n};\n","import React, { FunctionComponent } from \"react\";\nimport { Page } from \"@frontend/common/src/types/Page\";\nimport { MainMenu } from \"../components/MainMenu\";\n\ntype Props = {\n children: any;\n currentPage: Page;\n};\n\nexport const GuestLayout: FunctionComponent<Props> = ({\n children,\n currentPage,\n}) => {\n return (\n <>\n <MainMenu currentPage={currentPage} user={null} />\n {children}\n </>\n );\n};\n","import React, { FunctionComponent, useState } from \"react\";\nimport Modal from \"@frontend/common/src/components/Modal/Modal\";\nimport { TextArea } from \"@frontend/common/src/components/TextArea/TextArea\";\nimport { PhoneLink } from \"@frontend/common/src/components/PhoneLink/PhoneLink\";\nimport { useActions, useAppState } from \"../../overmind\";\nimport { Header } from \"../../elements/Header/Header\";\n\nimport { HBox } from \"../../elements/HBox/HBox\";\nimport { VBox } from \"../../elements/VBox/VBox\";\n\nimport { BlockButton } from \"../../components/Buttons/Buttons.styles\";\n\nexport const SendMessageModal: FunctionComponent = () => {\n const [message, setMessage] = useState(\"\");\n\n const { modals, pretreEmplyees } = useAppState();\n\n const { modals: modalsActions } = useActions();\n\n if (!modals.sendMessageModal.isCurrent) {\n return null;\n }\n\n const employee = pretreEmplyees.find(\n (e) => e.id === modals.sendMessageModal.userId\n );\n\n return (\n <Modal\n isOpen={modals.sendMessageModal.isCurrent}\n onClose={() => modalsActions.sendMessageModal.close(\"\")}\n >\n <HBox>\n <VBox>\n <Header type=\"secondary\">{employee.name}</Header>\n\n <PhoneLink number={employee.phone} />\n <a href={`mailto:${employee.email}`}>{employee.email}</a>\n </VBox>\n\n {employee.photoUrl ? (\n <div style={{ width: \"8rem\" }}>\n <img src={employee.photoUrl} alt={employee.name} />\n </div>\n ) : null}\n </HBox>\n <TextArea\n style={{ height: \"100px\" }}\n value={message}\n onChange={(e: any) => setMessage(e.target.value)}\n />\n <BlockButton\n onClick={() => modalsActions.sendMessageModal.close(message)}\n >\n Send melding\n </BlockButton>\n </Modal>\n );\n};\n","import React, { FunctionComponent } from \"react\";\nimport { Page } from \"@frontend/common/src/types/Page\";\nimport { useAppState } from \"../../../overmind\";\n\nimport { MainMenu } from \"../components/MainMenu\";\nimport { SendMessageModal } from \"../../../modals/SendMessageModal/SendMessageModal\";\n\ntype Props = {\n children: any;\n currentPage: Page;\n};\n\nexport const MainLayout: FunctionComponent<Props> = ({\n children,\n currentPage,\n}) => {\n const state = useAppState();\n\n let displayName = \"\";\n if (state.auth.user !== null) {\n if (state.currentEmployee) {\n displayName = `${state.currentEmployee.name} (${state.customer.name})`;\n } else if (state.customer) {\n displayName = state.customer.name;\n }\n }\n\n // customer={state.customer} customerEmployee={state.currentEmployee}\n return (\n <>\n <MainMenu\n currentPage={currentPage}\n user={state.auth.user}\n displayName={displayName}\n />\n {children}\n {state.modals.sendMessageModal.isCurrent ? <SendMessageModal /> : null}\n </>\n );\n};\n","import React, { FunctionComponent, useEffect, useState } from \"react\";\nimport { Page } from \"@frontend/common/src/types/Page\";\nimport { useAuth0 } from \"@auth0/auth0-react\";\nimport axios from \"axios\";\nimport { useActions, useAppState, useEffects } from \"../overmind\";\nimport { axiosTokenInterceptor } from \"../helpers/axiosTokenInterceptor\";\nimport \"./App.css\";\nimport { GuestLayout } from \"./layouts/GuestLayout/GuestLayout\";\nimport { MainLayout } from \"./layouts/MainLayout/MainLayout\";\nimport { pages, PageAccess, createUrl } from \"./pages\";\n\nexport const App: FunctionComponent = () => {\n const state = useAppState();\n const effects = useEffects();\n const actions = useActions();\n const {\n isLoading,\n isAuthenticated,\n error,\n user,\n getAccessTokenSilently,\n logout,\n } = useAuth0();\n const [loading, setLoading] = useState<boolean>(true);\n\n useEffect(() => {\n if (isAuthenticated && state.auth.user === null) {\n setLoading(true);\n getAccessTokenSilently().then((r) => {\n actions.auth\n .onMesterIdLoggedIn({ token: r, username: user.email })\n .then(() => setLoading(false));\n });\n } else {\n setTimeout(() => {\n setLoading(false);\n }, 500);\n }\n }, [isAuthenticated]);\n\n useEffect(() => {\n const triggerLogout = () => {\n effects.toast(\"Økten din har utløpt. Vennligst logg inn igjen\");\n if (state.mesterIdLogin) {\n actions.auth.logoutMesterId().then(() => {\n logout({ returnTo: window.location.origin });\n });\n } else {\n actions.auth.logout();\n }\n };\n\n if (isAuthenticated && state.auth.token) {\n const interceptorId = axiosTokenInterceptor(\n state,\n actions,\n triggerLogout,\n getAccessTokenSilently\n );\n return () => axios.interceptors.request.eject(interceptorId);\n }\n return () => {};\n }, [isAuthenticated, state.auth.token]);\n\n if (isLoading || loading) {\n return <div className=\"loading-spinner\">Laster...</div>;\n }\n if (error) {\n return <div>Oops... {error.message}</div>;\n }\n const CurrentPage = pages[state.navigation.currentPage];\n\n if (!CurrentPage) {\n return <div>404</div>;\n }\n\n const CurrentPageComponent = CurrentPage.component;\n\n if (!isAuthenticated && CurrentPage.restrictedTo === PageAccess.AUTH) {\n effects.toast(\"Du må logge inn for å se denne siden\");\n effects.router.navigateTo(createUrl(Page.HOME));\n } else if (\n !isAuthenticated &&\n CurrentPage.restrictedTo === PageAccess.GUEST\n ) {\n effects.router.navigateTo(createUrl(Page.HOME));\n }\n\n if (isAuthenticated) {\n return (\n <MainLayout currentPage={state.navigation.currentPage}>\n <CurrentPageComponent />\n </MainLayout>\n );\n }\n return (\n <GuestLayout currentPage={state.navigation.currentPage}>\n <CurrentPageComponent />\n </GuestLayout>\n );\n};\n","import axios from \"axios\";\nimport jwtDecode from \"jwt-decode\";\nimport { GetTokenSilentlyOptions } from \"@auth0/auth0-react\";\n\nexport const axiosTokenInterceptor = (\n state: any,\n actions: any,\n triggerLogout: () => void,\n getAccessTokenSilently: (options?: GetTokenSilentlyOptions) => Promise<string>\n) => {\n return axios.interceptors.request.use(\n async (config) => {\n const { token } = state.auth;\n\n if (!token) {\n triggerLogout();\n return Promise.reject(new Error(\"Ingen token, logger ut.\"));\n }\n\n const decoded: { exp: number } = jwtDecode(token);\n const tokenExpiry = decoded.exp * 1000;\n const currentTime = new Date().getTime();\n if (currentTime > tokenExpiry) {\n triggerLogout();\n return Promise.reject(new Error(\"Token utløpt, logger ut.\"));\n }\n\n if (tokenExpiry - currentTime < 15 * 60 * 1000) {\n const newToken = await getAccessTokenSilently({ ignoreCache: true });\n actions.auth.updateToken(newToken);\n\n return {\n ...config,\n headers: {\n ...config.headers,\n Authorization: `Bearer ${newToken}`,\n },\n };\n }\n\n return config;\n },\n (error) => {\n return Promise.reject(error);\n }\n );\n};\n","import i18n from \"i18next\";\nimport { initReactI18next } from \"react-i18next\";\n\n// the translations\n// (tip move them in a JSON file and import them)\nconst resources = {\n nb: {\n translation: {\n Login: \"Innlogging\",\n \"Log in\": \"Logg inn\",\n \"Forgot password?\": \"Glemt passord?\",\n Password: \"Passord\",\n \"Email/username\": \"Epost/brukernavn\",\n \"My orders and projects\": \"Mine prosjekt\",\n \"Show my orders and projects\": \"Vis mine ordrer og prosjekt\",\n \"Show only projects\": \"Vis kun prosjekt\",\n \"Hide delivered orders\": \"Skjul leverte ordre\",\n \"Project no.\": \"Prosjektnr.\",\n \"Order no.\": \"Ordrenr.\",\n Status: \"Status\",\n Constructor: \"Konstruktør\",\n Product: \"Prosjektnavn\",\n \"Product Group\": \"Produktgruppe\",\n \"Delivery year\": \"Leveringsår\",\n \"Delivery date\": \"Leveringdato\",\n \"Delivery addr.\": \"Leveringsaddr.\",\n \"Delivery terms\": \"Leverings bet.\",\n Delivery: \"Levering\",\n \"Order date\": \"Ordredato\",\n \"Order confirmation\": \"Ordrebekreftelse\",\n Price: \"Pris\",\n \"Order price\": \"Ordrepris\",\n \"Offer price\": \"Tilbudspris\",\n \"My orders\": \"Mine prosjekt\",\n \"My offers\": \"Mine tilbud\",\n \"Technical services\": \"Tekniske tjenester\",\n \"Request offer\": \"Be om tilbud\",\n \"Offer no.\": \"Tilbudsnr.\",\n \"Sales engineer\": \"Salgsingeniør\",\n \"Hide processed offers\": \"Skjul tilbud som er overført til ordre\",\n \"Show my offers\": \"Vis mine tilbud\",\n Contact: \"Kontakt\",\n \"Offer year\": \"Tilbudsår\",\n Choose: \"Velg\",\n Logout: \"Logg ut\",\n Created: \"Opprettet\",\n \"Customer ref.\": \"Kunde ref.\",\n \"Customer order no\": \"Kundes bestillingsnr.\",\n Marked: \"Merkes\",\n Loading: \"Laster\",\n Phone: \"Telefon\",\n \"Offers in project\": \"Tilbud i prosjekt\",\n \"Orders in project\": \"Ordre i prosjekt\",\n \"Other orders in project\": \"Andre ordre i prosjekt\",\n \"Other offers in project\": \"Andre tilbud i prosjekt\",\n Documents: \"Dokumenter\",\n \"Site contact\": \"Kontaktperson byggeplass\",\n \"Site phone\": \"Tlf. byggeplass\",\n \"Other orders for project\": \"Andre ordre for prosjektet\",\n Description: \"Beskrivelse\",\n Folder: \"Mappe\",\n \"Doc type\": \"Filtype\",\n \"My profile - {{companyName}}\": \"Min profil - {{companyName}}\",\n \"Customer & site\": \"Kundeinfo & byggeplass\",\n \"Offer options\": \"Tilbudsvalg\",\n Attachments: \"Vedlegg\",\n Summary: \"Oppsummering\",\n Documentation: \"Dokumentasjon\",\n \"Attach document\": \"Last opp dokument\",\n \"Add additional info here\": \"Skriv tilleggsinformasjon her\",\n Done: \"Fullfør\",\n \"Back to my offers\": \"Tilbake til Mine Tilbud\",\n \"Back to my orders\": \"Tilbake til Mine Prosjekt\",\n \"Offer created\": \"Tilbud registrert\",\n \"Offer date\": \"Tilbudsdato\",\n Customers: \"Kunder\",\n Username: \"Brukernavn\",\n Role: \"Rolle\",\n Email: \"Epost\",\n Search: \"Søk\",\n \"Want windows installed?\": \"Ønskes vinduer montert?\",\n \"Want standard framing?\": \"Ønskes standard omrammingstype?\",\n \"Want insolation?\": \"Ønskes isolert?\",\n \"Want boarding type: 19x148 D-fals, 60° New type?\":\n \"Ønskes Kledningstype: 19x148 D-fals, 60° Ny type?\",\n \"Can vertical boarding be split with floor divider?\":\n \"Kan stående kledning deles ved etasjeskille?\",\n \"Special fire safety requirements?\": \"Er det spesielle brannkrav?\",\n \"Joist type\": \"Type bjelkelag\",\n \"Pick joist\": \"Velg bjelkelag\",\n Joist: \"Bjelkelag\",\n \"Pick joist type\": \"Velg bjelkelagstype\",\n \"Immerse wetroom\": \"Nedsenk våtrom\",\n Dimension: \"Dimensjon\",\n \"Pick roof type\": \"Velg taktype\",\n Roof: \"Tak\",\n Roofing: \"Taktekking\",\n \"Roof angle\": \"Takvinkel\",\n \"Range distance\": \"Spennvidde\",\n Protrusion: \"Utstikk\",\n Elements: \"Elementer\",\n Yes: \"Ja\",\n No: \"Nei\",\n Next: \"Neste\",\n Comment: \"Kommentar\",\n \"3. What should the offer include?\": \"3. Hva ønsker du tilbud på?\",\n \"3. Technical services\": \"3. Tekniske tjenester\",\n \"Customer Order no.\": \"Kundes best.\",\n \"Project price\": \"Prosjektpris\",\n \"Write other required info here\": \"Skriv annen nødvendig info her\",\n FreeText: \"Fritekstsøk\",\n TechnicalType: \"Type tjeneste\",\n AddRoof: \"+ Tak\",\n AddExtendedRoof: \"+ Takstolkalkulator\",\n AddBeamlayer: \" + Bjelkelag\",\n AddPrecut: \"+ Precut\",\n AddTechnical: \"+ Tekniske tjenester\",\n roof: \"Tak\",\n beamlayer: \"Bjelkelag\",\n precut: \"Precut\",\n technical: \"Tekn. tjenester\",\n },\n },\n};\n\ni18n\n .use(initReactI18next) // passes i18n down to react-i18next\n .init({\n resources,\n lng: \"nb\",\n\n keySeparator: false, // we do not use keys in form messages.welcome\n\n interpolation: {\n escapeValue: false, // react already safes from xss\n },\n });\n\nexport default i18n;\n","/* eslint-disable */\n// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === \"localhost\" ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === \"[::1]\" ||\n // 127.0.0.0/8 are considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\ntype Config = {\n onSuccess?: (registration: ServiceWorkerRegistration) => void;\n onUpdate?: (registration: ServiceWorkerRegistration) => void;\n};\n\nexport function register(config?: Config) {\n if (process.env.NODE_ENV === \"production\" && \"serviceWorker\" in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener(\"load\", () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n \"This web app is being served cache-first by a service \" +\n \"worker. To learn more, visit https://bit.ly/CRA-PWA\"\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl: string, config?: Config) {\n navigator.serviceWorker\n .register(swUrl)\n .then((registration) => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === \"installed\") {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n \"New content is available and will be used when all \" +\n \"tabs for this page are closed. See https://bit.ly/CRA-PWA.\"\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log(\"Content is cached for offline use.\");\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch((error) => {\n console.error(\"Error during service worker registration:\", error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl: string, config?: Config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl, {\n headers: { \"Service-Worker\": \"script\" },\n })\n .then((response) => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get(\"content-type\");\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf(\"javascript\") === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then((registration) => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n \"No internet connection found. App is running in offline mode.\"\n );\n });\n}\n\nexport function unregister() {\n if (\"serviceWorker\" in navigator) {\n navigator.serviceWorker.ready\n .then((registration) => {\n registration.unregister();\n })\n .catch((error) => {\n console.error(error.message);\n });\n }\n}\n","/* eslint-disable @typescript-eslint/no-unused-vars */\nimport * as React from \"react\";\n\ntype Props = {};\ntype State = {\n hasError: boolean;\n};\nexport class ErrorBoundary extends React.Component<Props, State> {\n constructor(props: any) {\n super(props);\n this.state = { hasError: false };\n }\n\n static getDerivedStateFromError(error: any) {\n return { hasError: true };\n }\n\n componentDidCatch(error: any, errorInfo: any) {}\n\n render() {\n const { hasError } = this.state;\n const { children } = this.props;\n if (hasError) {\n return <h1>En feil oppstod. Prøv å logge inn på nytt.</h1>;\n }\n return children;\n }\n}\n","import React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport \"./normalize-tailwind.css\";\nimport \"./index.css\";\n// Overmind\nimport { createOvermind } from \"overmind\";\nimport { Provider } from \"overmind-react\";\n\nimport { Auth0Provider } from \"@auth0/auth0-react\";\nimport CacheBuster from \"react-cache-buster\";\nimport { config } from \"./overmind/config\";\nimport { App } from \"./app/App\";\n\nimport \"./i18n\";\n\nimport * as serviceWorker from \"./serviceWorker\";\n\nimport { ErrorBoundary } from \"./components/ErrorBoundary/ErrorBoundary\";\nimport { version } from \"../package.json\";\n\nconst overmind = createOvermind(config, {\n devtools: \"127.0.0.1:3031\",\n});\n\nconst domain = process.env.REACT_APP_AUTH0_DOMAIN;\nconst clientId = process.env.REACT_APP_AUTH0_CLIENT_ID;\nconst isProduction = process.env.NODE_ENV === \"production\";\n\nReactDOM.render(\n <React.StrictMode>\n <CacheBuster currentVersion={version} isEnabled={isProduction}>\n <Provider value={overmind}>\n <Auth0Provider\n domain={domain}\n clientId={clientId}\n redirectUri={`${window.location.origin}/auth`}\n audience=\"mg.iam\"\n >\n {/* @ts-ignore */}\n <ErrorBoundary>\n <App />\n </ErrorBoundary>\n </Auth0Provider>\n </Provider>\n </CacheBuster>\n </React.StrictMode>,\n document.getElementById(\"root\")\n);\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}