{"version":3,"file":"hslayers-ng-services-query.mjs","sources":["../../../projects/hslayers/services/query/query-base.service.ts","../../../projects/hslayers/services/query/query-vector.service.ts","../../../projects/hslayers/services/query/hslayers-ng-services-query.ts"],"sourcesContent":["import {DomSanitizer, SafeHtml} from '@angular/platform-browser';\nimport {Injectable, NgZone, PLATFORM_ID, inject} from '@angular/core';\nimport {Subject} from 'rxjs';\nimport {isPlatformBrowser} from '@angular/common';\n\nimport {Circle as CircleStyle, Fill, Stroke, Style} from 'ol/style';\nimport {Coordinate, createStringXY, toStringHDMS} from 'ol/coordinate';\nimport {Feature, Map} from 'ol';\nimport {FeatureLike} from 'ol/Feature';\nimport {Point} from 'ol/geom';\nimport {Select} from 'ol/interaction';\nimport {Vector} from 'ol/source';\nimport {Vector as VectorLayer} from 'ol/layer';\nimport {transform} from 'ol/proj';\n\nimport {HsConfig} from 'hslayers-ng/config';\nimport {HsEventBusService} from 'hslayers-ng/services/event-bus';\nimport {HsLanguageService} from 'hslayers-ng/services/language';\nimport {HsLayoutService} from 'hslayers-ng/services/layout';\nimport {HsMapService} from 'hslayers-ng/services/map';\nimport {HsSaveMapService} from 'hslayers-ng/services/save-map';\nimport {HsFeatureDescriptor} from 'hslayers-ng/types';\n\nexport type HsProjectedCoordinatesDescription = {\n  /**\n   * EPSG code name of the projection\n   */\n  name: string;\n  /**\n   * Stringified coordinate values in the named projection\n   */\n  value: string;\n};\n\nexport type HsCoordinateDescription = {\n  /**\n   * Translated title \"coordinates\"\n   */\n  name: string;\n  mapProjCoordinate: Coordinate;\n  epsg4326Coordinate: Coordinate;\n  projections: HsProjectedCoordinatesDescription[];\n};\n\n@Injectable({\n  providedIn: 'root',\n})\nexport class HsQueryBaseService {\n  private hsMapService = inject(HsMapService);\n  private hsConfig = inject(HsConfig);\n  private hsLayoutService = inject(HsLayoutService);\n  private hsLanguageService = inject(HsLanguageService);\n  private hsEventBusService = inject(HsEventBusService);\n  private hsSaveMapService = inject(HsSaveMapService);\n  private domSanitizer = inject(DomSanitizer);\n  private zone = inject(NgZone);\n  private platformId = inject(PLATFORM_ID);\n\n  attributes = [];\n  features: HsFeatureDescriptor[] = [];\n  featureInfoHtmls: SafeHtml[] = [];\n  customFeatures = [];\n  coordinates: HsCoordinateDescription[] = [];\n  selectedProj: HsProjectedCoordinatesDescription;\n  queryLayer: VectorLayer;\n  featureLayersUnderMouse = [];\n  dataCleared = true;\n  invisiblePopup: HTMLIFrameElement;\n  queryPoint = new Point([0, 0]);\n  selector: Select = null;\n  last_coordinate_clicked: any;\n  queryActive = false;\n  currentQuery: string = null;\n\n  popupClassname = '';\n  private defaultNonQueryablePanels = [\n    'measure',\n    'compositions',\n    'analysis',\n    'sensors',\n    'tripPlanner',\n  ];\n\n  get nonQueryablePanels(): string[] {\n    const additional = this.hsConfig.additionalNonQueryablePanels ?? [];\n    return [...this.defaultNonQueryablePanels, ...additional];\n  }\n  getFeatureInfoStarted: Subject<any> = new Subject();\n  getFeatureInfoCollected: Subject<number[] | void> = new Subject();\n  queryStatusChanges: Subject<boolean> = new Subject();\n  vectorSelectorCreated: Subject<Select> = new Subject();\n\n  multiWmsQuery = false;\n  wmsFeatureInfoLoading = false;\n\n  constructor() {\n    this.vectorSelectorCreated.subscribe((selector) => {\n      this.selector = selector;\n    });\n\n    this.queryLayer = new VectorLayer({\n      properties: {\n        title: 'Point clicked',\n        queryable: false,\n        showInLayerManager: false,\n        removable: false,\n      },\n      source: new Vector({\n        features: [\n          new Feature({\n            geometry: this.queryPoint,\n          }),\n        ],\n      }),\n      style: () => this.pointClickedStyle(),\n    });\n    this.invisiblePopup = this.getInvisiblePopup();\n\n    this.hsMapService.loaded().then((map) => {\n      this.activateQueries();\n      this.hsMapService.getMap().on('singleclick', (evt) => {\n        this.zone.run(() => {\n          this.hsEventBusService.mapClicked.next(\n            Object.assign(evt, {\n              coordinates: this.getCoordinate(evt.coordinate),\n            }),\n          );\n          if (!this.queryActive) {\n            return;\n          }\n          this.popupClassname = '';\n          if (!this) {\n            this.clear();\n          }\n          this.dataCleared = false;\n          this.currentQuery = (Math.random() + 1).toString(36).substring(7);\n          this.setCoordinates(this.getCoordinate(evt.coordinate));\n          this.last_coordinate_clicked = evt.coordinate; //It is used in some examples and apps\n          this.selectedProj = this.coordinates[0].projections[0];\n          this.getFeatureInfoStarted.next(evt);\n        });\n      });\n    });\n  }\n\n  /**\n   * Get features under the mouse pointer on the map\n   * @param map - Current map object\n   * @param pixel - Target pixel\n   * @returns Array with features\n   */\n  getFeaturesUnderMouse(map: Map, pixel: number[]): FeatureLike[] {\n    return map.getFeaturesAtPixel(pixel, {\n      layerFilter: (layer) => layer['ol_uid'] !== this.queryLayer['ol_uid'],\n    });\n  }\n\n  /**\n   * Get invisible popup element\n   * @returns HTML frame element, if the app is running in a browser\n   */\n  getInvisiblePopup(): HTMLIFrameElement {\n    if (isPlatformBrowser(this.platformId)) {\n      return <HTMLIFrameElement>document.getElementById('invisible_popup');\n    }\n  }\n\n  /**\n   * Push a new feature info html content to other htmls array\n   * @param html - Feature info html content\n   */\n  pushFeatureInfoHtml(html: string): void {\n    const sanitizedHtml = this.domSanitizer.bypassSecurityTrustHtml(html);\n    if (this.multiWmsQuery) {\n      this.featureInfoHtmls.push(sanitizedHtml);\n    } else {\n      this.featureInfoHtmls = [sanitizedHtml];\n    }\n    this.dataCleared = false;\n  }\n\n  /**\n   * Fill popup iframe and resize it to fit the content\n   * @param response - Response of GetFeatureInfoRequest\n   * @param append - If true, the response will be appended to iframe's inner HTML, otherwise its content will be replaced\n   */\n  fillIframeAndResize(response: string, append: boolean): void {\n    const iframe = this.getInvisiblePopup();\n    if (append) {\n      iframe.contentDocument.body.innerHTML += response;\n    } else {\n      iframe.contentDocument.body.innerHTML = response;\n    }\n    const mapElement =\n      this.hsLayoutService.contentWrapper.querySelector('.hs-ol-map');\n    const maxWidth = mapElement.clientWidth - 60;\n    const maxHeight = 700;\n\n    const tmp_width = Math.min(iframe.contentWindow.innerWidth, maxWidth);\n    const tmp_height = Math.min(iframe.contentWindow.innerHeight, maxHeight);\n\n    iframe.style.width = `${tmp_width}px`;\n    iframe.style.height = `${tmp_height}px`;\n  }\n\n  /**\n   * Get coordinates in multiple projections\n   * @param coordinate - Coordinates from map single click interaction\n   * @returns Object with coordinates in multiple projections\n   */\n  getCoordinate(coordinate: Coordinate): HsCoordinateDescription {\n    this.queryPoint.setCoordinates(coordinate, 'XY');\n    const epsg4326Coordinate = transform(\n      coordinate,\n      this.hsMapService.getCurrentProj(),\n      'EPSG:4326',\n    );\n    const coords = {\n      name: this.hsLanguageService.getTranslation(\n        'QUERY.coordinates',\n        undefined,\n      ),\n      mapProjCoordinate: coordinate,\n      epsg4326Coordinate,\n      projections: [\n        {\n          name: 'EPSG:4326',\n          value: toStringHDMS(epsg4326Coordinate),\n        },\n        {\n          name: 'EPSG:4326',\n          value: createStringXY(7)(epsg4326Coordinate),\n        },\n        {\n          name: this.hsMapService.getCurrentProj().getCode(),\n          value: createStringXY(7)(coordinate),\n        },\n      ],\n    };\n    return coords;\n  }\n\n  /**\n   * Activate queries for the current OL map\n   */\n  activateQueries(): void {\n    if (this.queryActive) {\n      return;\n    }\n    this.queryActive = true;\n    this.hsMapService.loaded().then((map) => {\n      map.addLayer(this.queryLayer);\n    });\n    this.hsSaveMapService.internalLayers.push(this.queryLayer);\n    this.queryStatusChanges.next(true);\n  }\n\n  /**\n   * Deactivate queries for the current OL map\n   */\n  deactivateQueries(): void {\n    if (!this.queryActive) {\n      return;\n    }\n    this.queryActive = false;\n    this.hsMapService.loaded().then((map) => {\n      map.removeLayer(this.queryLayer);\n    });\n    this.queryStatusChanges.next(false);\n  }\n\n  /**\n   * Check if current app panel is queryable\n   * @returns - True or false\n   */\n  currentPanelQueryable(): boolean {\n    return (\n      !this.nonQueryablePanels.includes(this.hsLayoutService.mainpanel) &&\n      !this.nonQueryablePanels.includes('*')\n    );\n  }\n\n  /**\n   * Get style for point clicked on the map\n   * @returns - OL style\n   */\n  pointClickedStyle(): Style {\n    const defaultStyle = new Style({\n      image: new CircleStyle({\n        fill: new Fill({\n          color: 'rgba(255, 156, 156, 0.4)',\n        }),\n        stroke: new Stroke({\n          color: '#cc3333',\n          width: 1,\n        }),\n        radius: 5,\n      }),\n    });\n    if (this.hsConfig.queryPoint) {\n      const circle = defaultStyle.getImage() as CircleStyle;\n      if (this.hsConfig.queryPoint == 'hidden') {\n        circle.setRadius(0);\n      } else if (this.hsConfig.queryPoint == 'notWithin') {\n        if (this.selector.getFeatures().getLength() > 0) {\n          circle.setRadius(0);\n        }\n      }\n    }\n    return defaultStyle;\n  }\n\n  /**\n   * Sets latest coordinates as current descriptor\n   * @param coords - Description of coordinates in HsCoordinateDescription format\n   */\n  setCoordinates(coords: HsCoordinateDescription): void {\n    this.coordinates.length = 0;\n    this.coordinates.push(coords);\n    this.hsEventBusService.queryDataUpdated.next(this);\n  }\n\n  /**\n   * Sets latest features as current descriptor\n   * @param features - Either a description of features in HsFeatureDescription format or an array of these descriptions\n   */\n  setFeatures(features: HsFeatureDescriptor[] | HsFeatureDescriptor): void {\n    if (Array.isArray(features)) {\n      this.features = this.features.concat(features);\n    } else {\n      this.features.push(features);\n    }\n    this.hsEventBusService.queryDataUpdated.next(this);\n  }\n\n  clear(type?: string): void {\n    if (type) {\n      this[type].length = 0;\n    } else {\n      this.attributes.length = 0;\n      this.features.length = 0;\n      this.coordinates.length = 0;\n      this.featureInfoHtmls = [];\n      this.customFeatures = [];\n    }\n    if (this.invisiblePopup) {\n      this.invisiblePopup.contentDocument.body.innerHTML = '';\n      this.invisiblePopup.style.height = '0px';\n      this.invisiblePopup.style.width = '0px';\n    }\n    this.dataCleared = true;\n  }\n}\n","import {DomSanitizer, SafeHtml} from '@angular/platform-browser';\nimport {Injectable, inject} from '@angular/core';\nimport {Subject, debounceTime} from 'rxjs';\n\nimport * as extent from 'ol/extent';\nimport Style, {StyleLike} from 'ol/style/Style';\nimport {Circle as CircleStyle, Fill, Stroke} from 'ol/style';\nimport {Cluster, Vector as VectorSource} from 'ol/source';\nimport {Coordinate} from 'ol/coordinate';\nimport {Feature} from 'ol';\nimport {GeoJSON, WKT} from 'ol/format';\nimport {Geometry, LineString, Polygon} from 'ol/geom';\nimport {Select} from 'ol/interaction';\nimport {click} from 'ol/events/condition';\nimport {toLonLat} from 'ol/proj';\n\nimport {HsConfig} from 'hslayers-ng/config';\nimport {HsEventBusService} from 'hslayers-ng/services/event-bus';\nimport {\n  formatLength,\n  formatArea,\n  instOf,\n  getLayerName,\n  isLayerEditable,\n} from 'hslayers-ng/services/utils';\nimport {HsMapService} from 'hslayers-ng/services/map';\nimport {HsQueryBaseService} from './query-base.service';\nimport {\n  getFeatures,\n  getOnFeatureSelected,\n  getQueryable,\n  getVirtualAttributes,\n} from 'hslayers-ng/common/extensions';\nimport {HsFeatureAttribute, HsFeatureDescriptor} from 'hslayers-ng/types';\n\nconst fill = new Fill({\n  color: 'rgba(51, 153, 204,0.4)',\n});\nconst stroke = new Stroke({\n  color: 'rgb(51, 128, 204)',\n  width: 2,\n});\n\nexport const defaultSelectStyle = [\n  new Style({\n    image: new CircleStyle({\n      fill: fill,\n      stroke: stroke,\n      radius: 5,\n    }),\n    fill: fill,\n    stroke: stroke,\n  }),\n];\n\n@Injectable({\n  providedIn: 'root',\n})\nexport class HsQueryVectorService {\n  private hsQueryBaseService = inject(HsQueryBaseService);\n  private hsMapService = inject(HsMapService);\n  private hsConfig = inject(HsConfig);\n  private hsEventBusService = inject(HsEventBusService);\n  private domSanitizer = inject(DomSanitizer);\n\n  featureRemovals: Subject<Feature<Geometry>> = new Subject();\n  selector: Select = null;\n  private setSelectorTrigger = new Subject<void>();\n\n  constructor() {\n    this.hsQueryBaseService.getFeatureInfoStarted.subscribe((evt) => {\n      this.hsQueryBaseService.clear('features');\n      if (!this.hsQueryBaseService.queryActive) {\n        return;\n      }\n      this.createFeatureAttributeList();\n    });\n\n    // Setup subscription with debounce\n    this.setSelectorTrigger.pipe(debounceTime(500)).subscribe(() => {\n      this.setNewSelector();\n    });\n    // Trigger the selector immediately on init\n    this.triggerSetSelector();\n\n    this.hsEventBusService.vectorQueryFeatureSelection.subscribe((e) => {\n      if (e?.feature) {\n        const layer = e.selector.getLayer(e.feature);\n        if (layer && getOnFeatureSelected(layer)) {\n          const originalFeature = this.getSelectedFeature(e.feature);\n          if (originalFeature) {\n            getOnFeatureSelected(layer)(originalFeature);\n          }\n        }\n      }\n    });\n    this.hsConfig.configChanges.subscribe((_) => {\n      if (this.hsConfig.query) {\n        this.triggerSetSelector();\n      }\n    });\n  }\n\n  private triggerSetSelector(): void {\n    this.setSelectorTrigger.next();\n  }\n\n  /**\n   * Set new selector for the app\n   */\n  async setNewSelector(style?: StyleLike | null): Promise<void> {\n    const selector = new Select({\n      condition: click,\n      multi: this.hsConfig.query?.multi ? this.hsConfig.query.multi : false,\n      filter: function (feature, layer) {\n        if (layer === null) {\n          return;\n        }\n        if (getQueryable(layer) === false) {\n          return false;\n        }\n        return true;\n      },\n      /**\n       * Consider \"null\" a valid value since this allows\n       * interaction to not apply any style changes for selected features\n       */\n      style:\n        style !== undefined\n          ? style\n          : this.hsConfig.query?.style !== undefined\n            ? this.hsConfig.query?.style\n            : defaultSelectStyle,\n      hitTolerance: this.hsConfig.query?.hitTolerance || 0,\n    });\n\n    await this.hsMapService.loaded();\n    const map = this.hsMapService.getMap();\n\n    map.removeInteraction(this.selector);\n    map.addInteraction(selector);\n\n    this.selector = selector;\n    this.hsQueryBaseService.vectorSelectorCreated.next(selector);\n\n    selector.getFeatures().on('add', (e) => {\n      this.hsEventBusService.vectorQueryFeatureSelection.next({\n        feature: e.element,\n        selector,\n      });\n    });\n\n    selector.getFeatures().on('remove', (e) => {\n      this.hsEventBusService.vectorQueryFeatureDeselection.next({\n        feature: e.element,\n        selector,\n      });\n    });\n  }\n\n  /**\n   * Get selected features original data\n   * @param feature - Feature selected\n   * @returns Feature\n   */\n  getSelectedFeature(feature: Feature<Geometry>): Feature<Geometry> {\n    let original = feature;\n    if (getFeatures(original) && getFeatures(original).length == 1) {\n      original = getFeatures(original)[0];\n    }\n    return original;\n  }\n\n  /**\n   * Create attribute list for all of the features selected with the selector\n   */\n  createFeatureAttributeList(): void {\n    this.hsQueryBaseService.attributes.length = 0;\n    const features = this.selector.getFeatures().getArray();\n    let featureDescriptions: HsFeatureDescriptor[] = [];\n    for (const feature of features) {\n      featureDescriptions = featureDescriptions.concat(\n        this.getFeatureAttributes(feature),\n      );\n    }\n    this.hsQueryBaseService.setFeatures(featureDescriptions);\n    this.hsQueryBaseService.getFeatureInfoCollected.next();\n  }\n\n  /**\n   * Export feature/s in specified format\n   * @param clickedFormat - Export format\n   * @param feature - Feature or features to export\n   * @returns Formatted features\n   */\n  exportData(\n    clickedFormat: 'WKT' | 'GeoJSON',\n    feature: Feature<Geometry>[] | Feature<Geometry>,\n  ): string {\n    let fmt;\n    const featureArray = Array.isArray(feature) ? feature : [feature];\n    switch (clickedFormat) {\n      case 'WKT':\n        fmt = new WKT();\n        return fmt.writeFeatures(featureArray);\n      case 'GeoJSON':\n      default:\n        fmt = new GeoJSON();\n        return fmt.writeFeatures(featureArray, {\n          dataProjection: 'EPSG:4326',\n          featureProjection: this.hsMapService.getCurrentProj(),\n        });\n    }\n  }\n\n  /**\n   * Get layer name from the feature selected\n   * @param feature - Feature selected\n   * @returns Layer name\n   */\n  getFeatureLayerName(feature: Feature<Geometry>): string {\n    const layer = this.hsMapService.getLayerForFeature(feature);\n    return getLayerName(layer);\n  }\n\n  /**\n   * Get center coordinates of the selected feature\n   * @param feature - Selected feature from the map\n   * @returns Center coordinates\n   */\n  getCentroid(feature: Feature<Geometry>): Coordinate {\n    if (feature == undefined) {\n      return;\n    }\n    const center = extent.getCenter(feature.getGeometry().getExtent());\n    return center;\n  }\n  /**\n   * Adding a default stats to query based on feature geometry type\n   * @param f - Selected feature from the map\n   * @returns Default feature stats\n   */\n  private addDefaultStats(f: Feature<Geometry>): {name: string; value: any}[] {\n    const geom = f.getGeometry();\n    const type = geom.getType();\n    if (type == 'Polygon') {\n      const area = formatArea(\n        geom as Polygon,\n        this.hsMapService.getCurrentProj(),\n      );\n      return [\n        {name: `${area.type} in ${area.unit}`, value: area.size},\n        {name: 'center', value: toLonLat(this.getCentroid(f))},\n      ];\n    }\n    if (type == 'LineString') {\n      const length = formatLength(\n        geom as LineString,\n        this.hsMapService.getCurrentProj(),\n      );\n      return [\n        {name: `${length.type} in ${length.unit}`, value: length.size},\n        {name: 'center', value: toLonLat(this.getCentroid(f))},\n      ];\n    }\n    if (type == 'Point') {\n      return [{name: 'center', value: toLonLat(this.getCentroid(f))}];\n    }\n  }\n\n  /**\n   * Find layer source from the feature selected\n   * @param feature - Selected feature from the map\n   * @returns Vector layer's source\n   */\n  olSource(feature: Feature<Geometry>): VectorSource {\n    const layer = this.hsMapService.getLayerForFeature(feature);\n    if (layer == undefined) {\n      return;\n    }\n    if (instOf(layer.getSource(), Cluster)) {\n      return (layer.getSource() as Cluster<Feature>).getSource();\n    }\n    return layer.getSource();\n  }\n\n  /**\n   * Check if feature is removable\n   * @param feature - Selected feature from the map\n   * @returns True if feature is removable, false otherwise\n   */\n  isFeatureRemovable(feature: Feature<Geometry>): boolean {\n    const source = this.olSource(feature);\n    if (source == undefined) {\n      return false;\n    }\n    const layer = this.hsMapService.getLayerForFeature(feature);\n    return instOf(source, VectorSource) && isLayerEditable(layer);\n  }\n\n  /**\n   * Remove selected feature\n   * @param feature - Selected feature from map\n   */\n  removeFeature(feature: Feature<Geometry>): void {\n    const source = this.olSource(feature);\n    if (instOf(source, VectorSource)) {\n      source.removeFeature(feature);\n    }\n    this.selector.getFeatures().remove(feature);\n    this.featureRemovals.next(feature);\n  }\n\n  /**\n   * Handler for querying vector layers of map. Get information about selected feature.\n   * @param feature - Selected feature from map\n   * @returns Feature attributes\n   */\n  getFeatureAttributes(feature: Feature<Geometry>): HsFeatureDescriptor[] {\n    const attributes = [];\n    let tmp: HsFeatureDescriptor[] = [];\n    const hstemplate = feature.get('hstemplate')\n      ? feature.get('hstemplate')\n      : null;\n    feature.getKeys().forEach((key) => {\n      if (['gid', 'geometry', 'wkb_geometry'].indexOf(key) > -1) {\n        return;\n      }\n      if (key == 'features') {\n        for (const subFeature of getFeatures(feature)) {\n          tmp = tmp.concat(this.getFeatureAttributes(subFeature));\n        }\n      } else {\n        const obj: HsFeatureAttribute = {\n          name: key,\n          value: feature.get(key),\n        };\n        obj.sanitizedValue = this.sanitizeAttributeValue(feature.get(key));\n        attributes.push(obj);\n      }\n    });\n    const layer = this.hsMapService.getLayerForFeature(feature);\n    if (layer && getVirtualAttributes(layer)) {\n      const virtualAttributes = getVirtualAttributes(layer);\n      for (const key of Object.keys(virtualAttributes)) {\n        const value = virtualAttributes[key](feature);\n        const obj: HsFeatureAttribute = {\n          name: key,\n          value,\n        };\n        obj.sanitizedValue = this.sanitizeAttributeValue(value);\n        attributes.push(obj);\n      }\n    }\n    if (!getFeatures(feature)) {\n      const featureDescription: HsFeatureDescriptor = {\n        layer: getLayerName(layer),\n        name: 'Feature',\n        attributes: attributes,\n        stats: this.addDefaultStats(feature),\n        hstemplate,\n        feature,\n      };\n      tmp.push(featureDescription);\n    }\n    return tmp;\n  }\n\n  /**\n   * Sanitize attribute value to be safe HTML if it is a string\n   * @param value - Attribute value\n   * @returns Sanitized attribute value\n   */\n  sanitizeAttributeValue(value): SafeHtml {\n    if ((typeof value).toLowerCase() == 'string') {\n      return this.domSanitizer.bypassSecurityTrustHtml(value);\n    }\n    return;\n  }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["VectorLayer","Vector","CircleStyle","Style","VectorSource"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;MA+Ca,kBAAkB,CAAA;AAoC7B,IAAA,IAAI,kBAAkB,GAAA;QACpB,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,4BAA4B,IAAI,EAAE;QACnE,OAAO,CAAC,GAAG,IAAI,CAAC,yBAAyB,EAAE,GAAG,UAAU,CAAC;IAC3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