{"version":3,"file":"hslayers-ng-config.mjs","sources":["../../../projects/hslayers/config/config-validation.service.ts","../../../projects/hslayers/config/config.service.ts","../../../projects/hslayers/config/hslayers-ng-config.ts"],"sourcesContent":["import {Injectable} from '@angular/core';\nimport {HsConfigObject} from './config.service';\n\n/**\n * Type for validation rules\n * @param condition - Condition function that should return true in case of conflict.\n * @param message - The message to display if the condition is true (conflict found)\n */\nexport type HsConfigValidationRule = {\n  condition: (config: HsConfigObject) => boolean;\n  message: string;\n};\n\n@Injectable({\n  providedIn: 'root',\n})\nexport class HsConfigValidationService {\n  /**\n   * Default validation rules for detecting incompatible configuration combinations\n   */\n  private readonly defaultValidationRules: HsConfigValidationRule[] = [\n    {\n      condition: (config) =>\n        config.defaultComposition &&\n        config.panelsEnabled?.compositions === false,\n      message: 'defaultComposition requires compositions panel to be enabled',\n    },\n    {\n      condition: (config) =>\n        config.panelsEnabled?.sensors === true && !config.senslog?.url,\n      message: 'sensors panel requires senslog.url to be configured',\n    },\n  ];\n\n  constructor() {}\n\n  /**\n   * Validates configuration for incompatible combinations and returns warning messages\n   * @param config - The configuration object to validate\n   * @param userRules - Optional user-defined validation rules from config\n   * @param useDefaultRules - Whether to include default validation rules (default: true)\n   * @returns Array of warning messages for detected conflicts\n   */\n  validate(\n    config: HsConfigObject,\n    userRules?: HsConfigValidationRule[],\n    useDefaultRules: boolean = true,\n  ): string[] {\n    const warnings: string[] = [];\n\n    try {\n      // Start with default rules if enabled\n      const allRules: HsConfigValidationRule[] = useDefaultRules\n        ? [...this.defaultValidationRules]\n        : [];\n\n      // Add user rules if provided\n      if (userRules && Array.isArray(userRules)) {\n        userRules.forEach((userRule) => {\n          // Validate user rule\n          if (!userRule.condition || !userRule.message) {\n            console.warn(\n              'HsConfigValidation Warning: Invalid validation rule provided. Rule must have condition and message properties.',\n              userRule,\n            );\n            return;\n          }\n\n          allRules.push(userRule);\n        });\n      }\n\n      // Run validation with all rules\n      allRules.forEach((rule, index) => {\n        try {\n          if (rule.condition(config)) {\n            warnings.push(`Configuration conflict detected: ${rule.message}`);\n          }\n        } catch (e) {\n          warnings.push(`Error in validation rule #${index + 1}: ${e.message}`);\n        }\n      });\n    } catch (e) {\n      warnings.push(\n        `Critical error during configuration validation: ${e.message}`,\n      );\n    }\n\n    return warnings;\n  }\n}\n","import {Injectable, inject} from '@angular/core';\nimport {Subject} from 'rxjs';\n\nimport {Feature, View} from 'ol';\nimport {Layer, Vector as VectorLayer} from 'ol/layer';\nimport {Source, Vector as VectorSource} from 'ol/source';\n\nimport {\n  AddDataFileType,\n  AddDataUrlType,\n  HsEndpoint,\n  QueryPopupWidgetsType,\n  WidgetItem,\n} from 'hslayers-ng/types';\nimport {StyleLike} from 'ol/style/Style';\nimport {\n  HsConfigValidationRule,\n  HsConfigValidationService,\n} from './config-validation.service';\n\nexport type ToastPosition =\n  | 'top-left'\n  | 'top-right'\n  | 'top-center'\n  | 'bottom-left'\n  | 'bottom-right'\n  | 'bottom-center';\n\nexport type SymbolizerIcon = {\n  name: string;\n  url: string;\n};\n\nexport type MapSwipeOptions = {\n  orientation?: 'vertical' | 'horizontal';\n};\n\n/**\n * Names and corresponding numbers\n */\nexport interface KeyNumberDict {\n  [key: string]: number;\n}\n\nexport type PanelsEnabled = {\n  legend?: boolean;\n  measure?: boolean;\n  query?: boolean;\n  compositions?: boolean;\n  draw?: boolean;\n  layerManager?: boolean;\n  featureTable?: boolean;\n  print?: boolean;\n  saveMap?: boolean;\n  language?: boolean;\n  share?: boolean;\n  sensors?: boolean;\n  search?: boolean;\n  tripPlanner?: boolean;\n  addData?: boolean;\n  mapSwipe?: boolean;\n  wfsFilter?: boolean;\n};\n//Provides PanelsEnabled suggestions while keeping type open for custom panels\nexport type DefaultPanel =\n  | keyof PanelsEnabled\n  | (string & Record<never, never>);\n\nexport class HsConfigObject {\n  componentsEnabled?: {\n    guiOverlay?: boolean;\n    info?: boolean;\n    sidebar?: boolean;\n    toolbar?: boolean;\n    drawToolbar?: boolean;\n    searchToolbar?: boolean;\n    measureToolbar?: boolean;\n    geolocationButton?: boolean;\n    defaultViewButton?: boolean;\n    mapControls?: boolean;\n    basemapGallery?: boolean;\n    mapSwipe?: boolean;\n    queryPopup?: boolean;\n  };\n  /**\n   * Master switch for layer editor widgets.\n   * If false, all widgets are disabled regardless of layerEditorWidgets settings.\n   * Default: true\n   */\n  layerEditorWidgetsEnabled?: boolean;\n\n  /**\n   * Configuration for individual layer editor widgets.\n   * Only applied when layerEditorWidgetsEnabled is true.\n   * Set individual widgets to false to disable them.\n   * Default: all true\n   */\n  layerEditorWidgets?: {\n    type?: boolean;\n    metadata?: boolean;\n    extent?: boolean;\n    cluster?: boolean;\n    scale?: boolean;\n    legend?: boolean;\n    dimensions?: boolean;\n    folder?: boolean;\n    opacity?: boolean;\n    idw?: boolean;\n    wmsSource?: boolean;\n    layerType?: boolean;\n  };\n  clusteringDistance?: number;\n  mapInteractionsEnabled?: boolean;\n  sidebarClosed?: boolean;\n  sidebarPosition?: string;\n  default_layers?: Layer<Source>[];\n  mobileBreakpoint?: number;\n  base_layers?: {\n    url: string;\n    default: string;\n  };\n  senslog?: {\n    url: string;\n    user_id: number;\n    group: string;\n    user: string;\n    /**\n     * Whitelist object defining which units and which unit sensors\n     * should be listed. Each key is a `unit_id`, and the value is an array\n     * of `sensor_id`s to be included for that unit.\n     * If the value is `all`, all sensors for that unit will be included.\n     *\n     * Example:\n     * ```\n     * {\n     *   default: [1,2,3],\n     *   1305167: [530040, 560030],\n     *   1405167: 'all'\n     * }\n     *```\n     * The `default` property defines a common set of sensor IDs that should be included for all units,\n     * unless overridden by a specific unit's configuration.\n     */\n    filter?: {\n      default?: number[];\n      [unit_id: number]: number[] | 'all';\n    };\n    liteApiPath?: string;\n    mapLogApiPath?: string;\n    senslog1Path?: string;\n    senslog2Path?: string;\n    /**\n     * Directory path in which objects defining vega view timeFormatLocale attribute are located.\n     * Used to localize time unit of vega charts for non default languages/specific changes\n     */\n    timeFormatConfigPath?: string;\n  };\n  proxyPrefix?: string;\n  defaultDrawLayerPath?: string;\n  defaultComposition?: string;\n  default_view?: View;\n  panelsEnabled?: PanelsEnabled;\n  defaultPanel?: DefaultPanel;\n\n  /**\n   * Controls where toast notifications are anchored to\n   * 'screen' - anchors toasts to the viewport\n   * 'map' - anchors toasts to the map container\n   * @default 'map' - anchors toasts to the map container\n   */\n  toastAnchor?: 'screen' | 'map' = 'map';\n  /**\n   * Controls the position of toast notifications\n   * @default 'bottom-right'\n   */\n  toastPosition?: ToastPosition;\n  errorToastDuration?: number;\n\n  advancedForm?: boolean;\n  project_name?: string;\n  hostname?: {\n    shareService?: {\n      url: string;\n    };\n    user?: {\n      url: string;\n    };\n    default?: {\n      url: string;\n    };\n  };\n  mapSwipeOptions?: MapSwipeOptions = {};\n  shareServiceUrl?: string;\n  shortenUrl?: (url) => any;\n  permalinkLocation?: {origin: string; pathname: string};\n  social_hashtag?: string;\n  useProxy?: boolean;\n  layerTooltipDelay?: number;\n  search_provider?: string;\n  geonamesUser?: string;\n  searchProvider?: any;\n  language?: string;\n  enabledLanguages?: string;\n  /**\n   * Allows adding natively not supported languages.\n   * Use it together with `enabledLanguages` and `translationOverrides`.\n   * @example\n   *  {\n   *    'af' : 'Afrikaans'\n   *  }\n   */\n  additionalLanguages?: {\n    [key: string]: string;\n  };\n  query?: {multi?: boolean; style?: StyleLike; hitTolerance?: number};\n  /**\n   * Panel names to add to the default non-queryable panels list.\n   * Default non-queryable panels: measure, compositions, analysis, sensors, tripPlanner.\n   */\n  additionalNonQueryablePanels?: string[];\n  /**\n   * Configures visibility of clicked point feature.\n   *   - `'hidden'` - Hides clicked point feature at all times\n   *   - `'notWithin'` - Hides clicked point feature in case it would overlap with other features\n   */\n  queryPoint?: 'notWithin' | 'hidden';\n  popUpDisplay?: 'none' | 'click' | 'hover';\n  /**\n   * Configures query popup widgets, the order in which they are generated, and visibility\n   */\n  queryPopupWidgets?: QueryPopupWidgetsType[] | string[];\n  /**\n   * Allows the user to add custom widgets to query popup\n   */\n  customQueryPopupWidgets?: WidgetItem[];\n  preserveLastSketchPoint?: boolean;\n  zoomWithModifierKeyOnly?: boolean;\n  pureMap?: boolean;\n  translationOverrides?: any;\n  layersInFeatureTable?: VectorLayer<VectorSource<Feature>>[];\n  open_lm_after_comp_loaded?: boolean;\n  draggable_windows?: boolean;\n  connectTypes?: AddDataUrlType[];\n  uploadTypes?: AddDataFileType[];\n  datasources?: HsEndpoint[];\n  panelWidths?: KeyNumberDict;\n  sidebarToggleable?: boolean;\n  sizeMode?: string;\n  symbolizerIcons?: SymbolizerIcon[];\n  openQueryPanelOnDrawEnd?: boolean;\n  assetsPath?: string;\n  reverseLayerList?: boolean;\n  /**\n   * When set to 'true', the map layers are stored temporarily to localStorage\n   * on page reload, loaded when it starts and deleted afterwards.\n   * Otherwise, nothing is stored to localStorage and only default_layers are loaded\n   * after page reloads.\n   * Default: true\n   */\n  saveMapStateOnReload?: boolean;\n  /**\n   * Triggered when config is updated using 'update' function of HsConfig.\n   * The full resulting config is provided in the subscriber as a parameter\n   */\n  timeDisplayFormat?: string;\n\n  /**\n   * Determines behavior of exclusive layers (layer.exclusive = true) visibility\n   * If set to true, only layers with same path are affected by exclusivity\n   */\n  pathExclusivity?: boolean;\n  ngRouter?: boolean;\n\n  /**\n   * User-defined validation rules to check for configuration conflicts.\n   * These rules will be added to the default validation rules.\n   */\n  configValidationRules?: HsConfigValidationRule[];\n\n  /**\n   * Whether to use default validation rules.\n   * Set to false to disable all default validation and only use configValidationRules.\n   * @default true\n   */\n  useDefaultValidationRules?: boolean;\n\n  /**\n   * Controls the concurrency of the loading queues for tile and image loads\n   * @default {tileLoad: 6, imageLoad: 4}\n   */\n  loadingQueueConcurrency?: {\n    tileLoad?: number;\n    imageLoad?: number;\n  };\n\n  /**\n   * Configuration to mark URLs that should NOT be treated as Layman,\n   * even if the generic detection says they are.\n   * If any condition matches, the URL is treated as non-Layman.\n   */\n  laymanUrlExceptions?: {\n    /**\n     * Array of strings. If the URL starts with any of these strings, it's treated as non-Layman.\n     */\n    startsWith?: string[];\n    /**\n     * Array of strings. If the URL includes any of these strings, it's treated as non-Layman.\n     */\n    includes?: string[];\n    /**\n     * Array of regex pattern strings. If the URL matches any of these patterns, it's treated as non-Layman.\n     */\n    regex?: string[];\n  };\n\n  constructor() {\n    this.pathExclusivity = false;\n    this.panelsEnabled = {\n      legend: true,\n      compositions: true,\n      measure: true,\n      draw: true,\n      layerManager: true,\n      print: true,\n      saveMap: true,\n      language: true,\n      share: true,\n      query: true,\n      sensors: false,\n      search: true,\n      tripPlanner: false,\n      addData: true,\n      mapSwipe: false,\n      wfsFilter: false,\n    };\n    this.componentsEnabled = {\n      guiOverlay: true,\n      info: true,\n      sidebar: true,\n      toolbar: true,\n      searchToolbar: true,\n      drawToolbar: true,\n      measureToolbar: true,\n      geolocationButton: true,\n      defaultViewButton: true,\n      mapControls: true,\n      basemapGallery: false,\n      // Says whether it should be activated by default. Is overridden by url param\n      mapSwipe: false,\n      queryPopup: true,\n    };\n    this.layerEditorWidgetsEnabled = true;\n    this.queryPopupWidgets = ['layer-name', 'feature-info', 'clear-layer'];\n    this.panelWidths = {\n      default: 425,\n      ows: 700,\n      compositions: 550,\n      addData: 700,\n      wfsFilter: 550,\n      mapSwipe: 550,\n    };\n    this.sidebarPosition = 'right';\n    this.sidebarToggleable = true;\n    this.mobileBreakpoint = 767;\n  }\n}\n\n@Injectable({\n  providedIn: 'root',\n})\nexport class HsConfig extends HsConfigObject {\n  private validationService = inject(HsConfigValidationService);\n\n  id: string;\n  configChanges?: Subject<void> = new Subject();\n  private defaultSymbolizerIcons? = [\n    {name: 'favourite', url: 'img/icons/favourite28.svg'},\n    {name: 'gps', url: 'img/icons/gps43.svg'},\n    {name: 'information', url: 'img/icons/information78.svg'},\n    {name: 'wifi', url: 'img/icons/wifi8.svg'},\n  ];\n\n  private logConfigWarning(message: string) {\n    console.warn('HsConfig Warning:', message);\n  }\n\n  /**\n   * Validates configuration for incompatible combinations and logs warnings\n   * @param config - The configuration object to validate\n   * @param userRules - Optional user-defined validation rules\n   * @param useDefaultRules - Whether to use default validation rules\n   */\n  private validateConfigCompatibility(\n    config: HsConfigObject,\n    userRules?: HsConfigValidationRule[],\n    useDefaultRules: boolean = true,\n  ): void {\n    const warnings = this.validationService.validate(\n      config,\n      userRules,\n      useDefaultRules,\n    );\n    warnings.forEach((warning) => this.logConfigWarning(warning));\n  }\n\n  /**\n   * Safely executes a configuration update operation and handles any errors\n   * @param operation - Function to execute\n   * @param errorMessage - Message to log if operation fails\n   * @returns The result of the operation or a fallback value if provided\n   */\n  private safeUpdate<T>(\n    operation: () => T,\n    errorMessage: string,\n    fallback?: T,\n  ): T | undefined {\n    try {\n      return operation();\n    } catch (e) {\n      this.logConfigWarning(`${errorMessage}: ${e.message}`);\n      return fallback;\n    }\n  }\n\n  checkDeprecatedCesiumConfig?(newConfig: any) {\n    const deprecatedProps = [\n      'cesiumDebugShowFramesPerSecond',\n      'cesiumShadows',\n      'cesiumBase',\n      'createWorldTerrainOptions',\n      'terrain_provider',\n      'cesiumTimeline',\n      'cesiumAnimation',\n      'creditContainer',\n      'cesiumInfoBox',\n      'imageryProvider',\n      'terrainExaggeration',\n      'cesiumBingKey',\n      'newTerrainProviderOptions',\n      'terrain_providers',\n      'cesiumAccessToken',\n      'cesiumTime',\n    ];\n\n    for (const prop of deprecatedProps) {\n      if (newConfig[prop] != undefined) {\n        console.error(\n          `HsConfig.${prop} has been moved to HsCesiumConfig service or hslayersCesiumConfig.${prop} when using hslayers-cesium-app`,\n        );\n      }\n    }\n  }\n\n  update?(newConfig: HsConfigObject): void {\n    try {\n      if (!newConfig) {\n        this.logConfigWarning('Empty configuration provided');\n        return;\n      }\n\n      this.checkDeprecatedCesiumConfig(newConfig);\n\n      // Extract validation settings before processing\n      const userValidationRules = newConfig.configValidationRules;\n      const useDefaultRules = newConfig.useDefaultValidationRules ?? true;\n      if (newConfig.configValidationRules) {\n        delete newConfig.configValidationRules;\n      }\n      if (newConfig.useDefaultValidationRules !== undefined) {\n        delete newConfig.useDefaultValidationRules;\n      }\n\n      if (newConfig.sidebarPosition === 'bottom') {\n        /**Set high enough value to make sure class setting mobile-view is not toggled*/\n        newConfig.mobileBreakpoint = 9999;\n      }\n\n      // Update symbolizer icons with current assets path\n      this.safeUpdate<void>(() => {\n        this.symbolizerIcons = this.defaultSymbolizerIcons.map((val) => ({\n          ...val,\n          url: (this.assetsPath ?? '') + val.url,\n        }));\n      }, 'Error updating symbolizer icons');\n\n      // Update components enabled\n      this.componentsEnabled =\n        this.safeUpdate(\n          () => this.updateComponentsEnabled(newConfig),\n          'Error updating components enabled',\n          {...this.componentsEnabled},\n        ) ?? this.componentsEnabled;\n      delete newConfig.componentsEnabled;\n\n      // Update panel widths\n      this.safeUpdate(\n        () => Object.assign(this.panelWidths, newConfig.panelWidths ?? {}),\n        'Error updating panel widths',\n      );\n      delete newConfig.panelWidths;\n\n      // Update panels enabled\n      this.safeUpdate(\n        () => Object.assign(this.panelsEnabled, newConfig.panelsEnabled ?? {}),\n        'Error updating panels enabled',\n      );\n      delete newConfig.panelsEnabled;\n\n      // Update symbolizer icons\n      this.symbolizerIcons =\n        this.safeUpdate(\n          () => [\n            ...this.updateSymbolizers(newConfig),\n            ...(newConfig.symbolizerIcons ?? []),\n          ],\n          'Error updating symbolizers',\n          this.symbolizerIcons,\n        ) ?? this.symbolizerIcons;\n      delete newConfig.symbolizerIcons;\n\n      // Merge remaining config\n      this.safeUpdate(\n        () => Object.assign(this, newConfig),\n        'Error merging configuration',\n      );\n\n      // Handle assets path\n      if (this.assetsPath == undefined) {\n        this.assetsPath = '';\n      }\n      this.assetsPath += this.assetsPath.endsWith('/') ? '' : '/';\n\n      this.validateConfigCompatibility(\n        this,\n        userValidationRules,\n        useDefaultRules,\n      );\n\n      this.configChanges.next();\n    } catch (e) {\n      this.logConfigWarning(\n        'Critical error updating configuration: ' + e.message,\n      );\n    }\n  }\n\n  /**\n   * Merges componentsEnabled from newConfig with existing componentsEnabled\n   * Preserves the order of keys from newConfig.componentsEnabled\n   */\n  updateComponentsEnabled?(\n    newConfig: HsConfigObject,\n  ): HsConfigObject['componentsEnabled'] {\n    if (!newConfig?.componentsEnabled) {\n      return {...this.componentsEnabled};\n    }\n\n    try {\n      const orderedKeys = new Set([\n        ...Object.keys(newConfig.componentsEnabled),\n        ...Object.keys(this.componentsEnabled),\n      ]);\n\n      const mergedComponentsEnabled = {};\n      orderedKeys.forEach((key) => {\n        mergedComponentsEnabled[key] =\n          newConfig.componentsEnabled[key] ?? this.componentsEnabled[key];\n      });\n\n      return mergedComponentsEnabled;\n    } catch (e) {\n      this.logConfigWarning(\n        'Error in updateComponentsEnabled, using defaults: ' + e.message,\n      );\n      return {...this.componentsEnabled};\n    }\n  }\n\n  updateSymbolizers?(config: HsConfigObject) {\n    try {\n      let assetsPath = config.assetsPath ?? '';\n      assetsPath += assetsPath.endsWith('/') ? '' : '/';\n      return this.defaultSymbolizerIcons.map((val) => ({\n        ...val,\n        url: assetsPath + val.url,\n      }));\n    } catch (e) {\n      this.logConfigWarning('Error in updateSymbolizers: ' + e.message);\n      return [...this.defaultSymbolizerIcons];\n    }\n  }\n\n  setAppId(id: string) {\n    this.id = id;\n  }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAgBa,yBAAyB,CAAA;AAkBpC,IAAA,WAAA,GAAA;AAjBA;;AAEG;AACc,QAAA,IAAA,CAAA,sBAAsB,GAA6B;AAClE,YAAA;gBACE,SAAS,EAAE,CAAC,MAAM,KAChB,MAAM,CAAC,kBAAkB;AACzB,oBAAA,MAAM,CAAC,aAAa,EAAE,YAAY,KAAK,KAAK;AAC9C,gBAAA,OAAO,EAAE,8DAA8D;AACxE,aAAA;AACD,YAAA;AACE,gBAAA,SAAS,EAAE,CAAC,MAAM,KAChB,MAAM,CAAC,aAAa,EAAE,OAAO,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG;AACh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