{ "version": 3, "sources": ["src/app/providers/configuration-service/configuration.service.ts"], "sourcesContent": ["import { Injectable, inject } from \"@angular/core\";\nimport { HttpClient, HttpHeaders } from \"@angular/common/http\";\nimport { ConstantsService } from \"../constants-service/constants.service\";\nimport { AuthenticationService } from \"../authentication-service/authentication.service\";\nimport { Observable } from \"rxjs\";\n\nexport interface RegionConfiguration {\n id: string;\n microRegions: number;\n subRegions: string[];\n superRegions: string[];\n neighborRegions: string[];\n publishBulletins: boolean;\n publishBlogs: boolean;\n createCaamlV5: boolean;\n createCaamlV6: boolean;\n createJson: boolean;\n createMaps: boolean;\n createPdf: boolean;\n sendEmails: boolean;\n createSimpleHtml: boolean;\n sendTelegramMessages: boolean;\n sendPushNotifications: boolean;\n enableMediaFile: boolean;\n enableAvalancheProblemCornices: boolean;\n enableAvalancheProblemNoDistinctAvalancheProblem: boolean;\n enableDangerSources: boolean;\n enableObservations: boolean;\n enableModelling: boolean;\n enableWeatherbox: boolean;\n enableStrategicMindset: boolean;\n enableStressLevel: boolean;\n showMatrix: boolean;\n serverInstance: ServerConfiguration;\n pdfColor: string;\n emailColor: string;\n pdfMapYAmPm: number;\n pdfMapYFd: number;\n pdfMapWidthAmPm: number;\n pdfMapWidthFd: number;\n pdfMapHeight: number;\n pdfFooterLogo: boolean;\n pdfFooterLogoColorPath: string;\n pdfFooterLogoBwPath: string;\n mapXmax: number;\n mapXmin: number;\n mapYmax: number;\n mapYmin: number;\n simpleHtmlTemplateName: string;\n geoDataDirectory: string;\n mapLogoColorPath: string;\n mapLogoBwPath: string;\n mapLogoPosition: string;\n mapCenterLat: number;\n mapCenterLng: number;\n imageColorbarColorPath: string;\n imageColorbarBwPath: string;\n isNew: boolean;\n}\n\nexport interface ServerConfiguration {\n id: string;\n name: string;\n apiUrl: string;\n userName: string;\n password: string;\n externalServer: boolean;\n publishAt5PM: boolean;\n publishAt8AM: boolean;\n pdfDirectory: string;\n htmlDirectory: string;\n mapsPath: string;\n mediaPath: string;\n mapProductionUrl: string;\n serverImagesUrl: string;\n dangerLevelElevationDependency: boolean;\n isNew: boolean;\n}\n\n@Injectable()\nexport class ConfigurationService {\n http = inject(HttpClient);\n private constantsService = inject(ConstantsService);\n private authenticationService = inject(AuthenticationService);\n\n public loadPublicLocalServerConfiguration(): Observable {\n const url = this.constantsService.getServerUrl() + \"server/info\";\n return this.http.get(url);\n }\n\n public loadLocalServerConfiguration(): Observable {\n const url = this.constantsService.getServerUrl() + \"server\";\n return this.http.get(url);\n }\n\n public loadExternalServerConfigurations(): Observable {\n const url = this.constantsService.getServerUrl() + \"server/external\";\n return this.http.get(url);\n }\n\n public updateServerConfiguration(json) {\n const url = this.constantsService.getServerUrl() + \"server\";\n const body = JSON.stringify(json);\n return this.http.put(url, body);\n }\n\n public createServerConfiguration(json) {\n const url = this.constantsService.getServerUrl() + \"server\";\n const body = JSON.stringify(json);\n return this.http.post(url, body);\n }\n\n public loadRegionConfiguration(region): Observable {\n const url = this.constantsService.getServerUrl() + \"regions/region?region=\" + region;\n return this.http.get(url);\n }\n\n public loadRegionConfigurations(): Observable {\n const url = this.constantsService.getServerUrl() + \"regions\";\n return this.http.get(url);\n }\n\n public updateRegionConfiguration(json) {\n const url = this.constantsService.getServerUrl() + \"regions\";\n const body = JSON.stringify(json);\n return this.http.put(url, body);\n }\n\n public createRegionConfiguration(json) {\n const url = this.constantsService.getServerUrl() + \"regions\";\n const body = JSON.stringify(json);\n return this.http.post(url, body);\n }\n}\n"], "mappings": "uEAgFA,IAAaA,GAAoB,IAAA,CAA3B,MAAOA,CAAoB,CADjCC,aAAA,CAEE,KAAAC,KAAOC,EAAOC,CAAU,EAChB,KAAAC,iBAAmBF,EAAOG,CAAgB,EAC1C,KAAAC,sBAAwBJ,EAAOK,CAAqB,EAErDC,oCAAkC,CACvC,IAAMC,EAAM,KAAKL,iBAAiBM,aAAY,EAAK,cACnD,OAAO,KAAKT,KAAKU,IAA+CF,CAAG,CACrE,CAEOG,8BAA4B,CACjC,IAAMH,EAAM,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antsService", "authenticationService", "AuthenticationService", "loadPublicLocalServerConfiguration", "url", "getServerUrl", "get", "loadLocalServerConfiguration", "loadExternalServerConfigurations", "updateServerConfiguration", "json", "body", "JSON", "stringify", "put", "createServerConfiguration", "post", "loadRegionConfiguration", "region", "loadRegionConfigurations", "updateRegionConfiguration", "createRegionConfiguration", "factory", "\u0275fac"] }