From 3eecf993a92b078deb855958941a431526c74dd8 Mon Sep 17 00:00:00 2001 From: mbeckem Date: Mon, 18 Nov 2024 09:18:39 +0000 Subject: [PATCH] =?UTF-8?q?Deploy=20preview=20for=20PR=20371=20?= =?UTF-8?q?=F0=9F=9B=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pr-371/assets/{D1iLb33hGMnx.js => BLnpWWKidViB.js} | 2 +- .../pr-previews/pr-371/assets/CC4cg6c-thsW.js | 4 ++++ .../pr-371/assets/{nU189nNlc4J5.js => CE2h5gQ2FaWn.js} | 2 +- .../pr-371/assets/{CkVP7suqMB2J.js => CkfVk3yAXsDv.js} | 2 +- .../pr-previews/pr-371/assets/D5SiXzFLvedX.js | 4 ---- .../pr-371/assets/{DOPSNmhp3Yv8.js => D5t2Vmz5gxIu.js} | 2 +- .../pr-371/assets/{DEc3M1w42gc3.js => DfytJBTHC9Fu.js} | 2 +- .../pr-371/assets/{D7mnkJrZHEBm.js => VtSxxxXBlKT0.js} | 2 +- .../pr-previews/pr-371/samples/map-sample/index.html | 6 +++--- .../pr-previews/pr-371/samples/ogc-api-sample/index.html | 2 +- .../pr-previews/pr-371/samples/showcase/index.html | 6 +++--- .../pr-previews/pr-371/samples/test-printing-api/index.html | 4 ++-- 12 files changed, 19 insertions(+), 19 deletions(-) rename openlayers-base-packages/pr-previews/pr-371/assets/{D1iLb33hGMnx.js => BLnpWWKidViB.js} (82%) create mode 100644 openlayers-base-packages/pr-previews/pr-371/assets/CC4cg6c-thsW.js rename openlayers-base-packages/pr-previews/pr-371/assets/{nU189nNlc4J5.js => CE2h5gQ2FaWn.js} (96%) rename openlayers-base-packages/pr-previews/pr-371/assets/{CkVP7suqMB2J.js => CkfVk3yAXsDv.js} (98%) delete mode 100644 openlayers-base-packages/pr-previews/pr-371/assets/D5SiXzFLvedX.js rename openlayers-base-packages/pr-previews/pr-371/assets/{DOPSNmhp3Yv8.js => D5t2Vmz5gxIu.js} (99%) rename openlayers-base-packages/pr-previews/pr-371/assets/{DEc3M1w42gc3.js => DfytJBTHC9Fu.js} (85%) rename openlayers-base-packages/pr-previews/pr-371/assets/{D7mnkJrZHEBm.js => VtSxxxXBlKT0.js} (97%) diff --git a/openlayers-base-packages/pr-previews/pr-371/assets/D1iLb33hGMnx.js b/openlayers-base-packages/pr-previews/pr-371/assets/BLnpWWKidViB.js similarity index 82% rename from openlayers-base-packages/pr-previews/pr-371/assets/D1iLb33hGMnx.js rename to openlayers-base-packages/pr-previews/pr-371/assets/BLnpWWKidViB.js index 11edb0e..b2ad17d 100644 --- a/openlayers-base-packages/pr-previews/pr-371/assets/D1iLb33hGMnx.js +++ b/openlayers-base-packages/pr-previews/pr-371/assets/BLnpWWKidViB.js @@ -1 +1 @@ -import{j as t,c as q,a as U,r as p,B as I,i as K,b as $,d as A,F as Z,e as Y}from"./Bh0CuZ3gy5tC.js";import{B as d,V as J,S as j,T as X,O as Q,a as C,b as N,c as ee,C as te,F as oe,r as T,d as D,e as re,w as ie,H as ne,M as ae,u as se,f as le,g as v,h as x,i as L,j as M,k as y,D as ce,l as pe,m as de}from"./CvR1K3f_Jx0o.js";import{W as V,P as ue,a as me,b as ge,c as he,d as fe,e as be,f as ve,g as xe,h as we}from"./DNeIgqfIWVUM.js";import{W as R,E as Se,V as ye,S as ke,O as Me,C as je,a as Ce,b as Le,L as ze,M as _e,c as Pe,d as Ie,P as Ae,N as Te}from"./DOPSNmhp3Yv8.js";import{G as O,u as De,T as h,P as Re,a as Ee,b as Fe,c as qe,d as Ne,e as Ve}from"./CDZlakCE4enr.js";import{T as z}from"./Tz2xttM4F6S2.js";import{N as Oe,P as He}from"./D5SiXzFLvedX.js";import{V as Ge,S as Be,I as We,Z as Ue,a as Ke}from"./Cn6jOzlRJRDP.js";import{_ as E}from"./CmsKOCeNyeyo.js";import{u as b,D as $e}from"./B1-t77dlZFnS.js";import{H}from"./L25RkWOQSN8A.js";import{G}from"./CL_VRsbiqLzM.js";import{R as Ze}from"./CxxdN3Z_jMxj.js";import{C as Ye}from"./BCXJt8t_qqq7.js";import"./DoZQ59JZnzxi.js";import"./CKfDAIEslOW2.js";import"./Cq1ZpfgEg4XJ.js";import"./D03oE8cEQPSj.js";import"./BO_q12Vdyug-.js";import"./CreVQ-qFRzOc.js";import"./CjjyePfBQlZ7.js";import"./DUys4rac0YQP.js";import"./2d5-QpxJNHTD.js";import"./BeFcF3Ti4kY-.js";const Je={height:"25px",width:"25px",borderColor:"#4cb3ff",borderWidth:"3px",borderRadius:"50%",display:"inline-block "};function Xe(r){return t.jsxs(d,{children:[t.jsx(z,{children:r.layer.title}),t.jsx(d,{style:Je})]})}const _="main";class Qe{mapId=_;vectorSourceFactory;constructor(e){this.vectorSourceFactory=e.references.vectorSourceFactory}async getMapConfig(){return{advanced:{view:new J({center:[404747,5757920],zoom:13,constrainResolution:!0,projection:"EPSG:25832"})},layers:[...et(),rt(),tt(this.vectorSourceFactory),ot(),it()]}}}function et(){return[new R({isBaseLayer:!0,title:"Topplus grau",url:"https://www.wmts.nrw.de/topplus_open/1.0.0/WMTSCapabilities.xml",name:"topplus_grau",matrixSet:"EPSG_25832_14",visible:!1,sourceOptions:{attributions:`Kartendarstellung und Präsentationsgraphiken: © Bundesamt für Kartographie und Geodäsie ${new Date().getFullYear()}, Datenquellen`}}),new R({isBaseLayer:!0,title:"Topplus farbig",url:"https://www.wmts.nrw.de/topplus_open/1.0.0/WMTSCapabilities.xml",name:"topplus_col",matrixSet:"EPSG_25832_14",visible:!0,sourceOptions:{attributions:`Kartendarstellung und Präsentationsgraphiken: © Bundesamt für Kartographie und Geodäsie ${new Date().getFullYear()}, Datenquellen`}}),new j({title:"OpenStreetMaps",visible:!1,isBaseLayer:!0,olLayer:new X({source:new Q})})]}function tt(r){const e="https://ogc-api-test.nrw.de/inspire-us-krankenhaus/v1",o="governmentalservice",i=r.createVectorSource({strategy:"next",baseUrl:e,collectionId:o,limit:1e3,crs:"http://www.opengis.net/def/crs/EPSG/0/25832",attributions:`Land NRW (${new Date().getFullYear()}), Datenlizenz Deutschland - Namensnennung - Version 2.0, Datenquelle`}),n=new C({source:i});return new j({id:"krankenhaus",title:"Krankenhäuser",visible:!1,olLayer:n,attributes:{collectionURL:e+"/collections/"+o}})}function ot(){return new V({title:"Schulstandorte",description:"Der vorliegende Datenbestand / Dienst zu den Schulstandorten in NRW stammt aus der Schuldatenbank. Die Informationen werden von den Schulträgern bzw. Schulen selbst eingetragen und aktuell gehalten. Die Daten werden tagesaktuell bereitgestellt und enthalten alle grundlegenden Informationen zu Schulen wie Schulnummer, Schulbezeichnung und Adresse.Der vorliegende Datenbestand / Dienst zu den Schulstandorten in NRW stammt aus der Schuldatenbank. Die Informationen werden von den Schulträgern bzw. Schulen selbst eingetragen und aktuell gehalten. Die Daten werden tagesaktuell bereitgestellt und enthalten alle grundlegenden Informationen zu Schulen wie Schulnummer, Schulbezeichnung und Adresse.Der vorliegende Datenbestand / Dienst zu den Schulstandorten in NRW stammt aus der Schuldatenbank. Die Informationen werden von den Schulträgern bzw. Schulen selbst eingetragen und aktuell gehalten. Die Daten werden tagesaktuell bereitgestellt und enthalten alle grundlegenden Informationen zu Schulen wie Schulnummer, Schulbezeichnung und Adresse.Der vorliegende Datenbestand / Dienst zu den Schulstandorten in NRW stammt aus der Schuldatenbank. Die Informationen werden von den Schulträgern bzw. Schulen selbst eingetragen und aktuell gehalten. Die Daten werden tagesaktuell bereitgestellt und enthalten alle grundlegenden Informationen zu Schulen wie Schulnummer, Schulbezeichnung und Adresse.",visible:!0,url:"https://www.wms.nrw.de/wms/wms_nw_inspire-schulen",sublayers:[{name:"US.education",title:"INSPIRE - WMS Schulstandorte NRW",attributes:{legend:{}}}],sourceOptions:{ratio:1}})}function rt(){return new V({title:"Straßennetz Landesbetrieb Straßenbau NRW",url:"https://www.wms.nrw.de/wms/strassen_nrw_wms",visible:!0,sublayers:[{name:"1",title:"Verwaltungen",attributes:{legend:{imageUrl:"https://www.wms.nrw.de/legends/wms/strassen_nrw_wms/1.png"}}},{name:"4",title:"Abschnitte und Äste"},{name:"6",title:"Unfälle"}]})}function it(){const r={Component:Xe},e=new N({url:"https://ogc-api.nrw.de/inspire-us-kindergarten/v1/collections/governmentalservice/items?f=json&limit=10000",format:new O,attributions:'© Bundesamt für Kartographie und Geodäsie 2017, Datenquellen'}),o=new C({source:e,style:new ee({image:new te({fill:new oe({color:"blue"}),radius:4})})});return new j({id:"ogc_kitas",title:"Kindertagesstätten",visible:!0,olLayer:o,attributes:{legend:r,resultListMetadata:[{id:"id",displayName:"ID",width:100,getPropertyValue(i){return i.id}},{propertyName:"pointOfContact.address.postCode",displayName:"PLZ",width:120},{propertyName:"name",displayName:"Name"},{propertyName:"inspireId",displayName:"inspireID"},{displayName:"Gefördert",width:160,getPropertyValue(i){switch(i.properties?.gefoerdert){case"ja":return!0;case"nein":return!1;default:return i.properties?.gefoerdert}}}]}})}class nt{label;filteredTypes;httpService;constructor(e,o,i){this.label=e,this.filteredTypes=o,this.httpService=i}async search(e,{mapProjection:o,signal:i}){const n=await this.request(e,100,i),a=new O({dataProjection:"EPSG:4326",featureProjection:o});return n.features.filter(s=>this.filteredTypes.includes(s.properties.type)).map((s,l)=>{const c=a.readGeometry(s.geometry);return{id:s.properties.osm_id||l,label:this.createLabel(s),geometry:c,properties:s.properties}})}async request(e,o,i){const n=new URL("https://photon.komoot.io/api?");n.searchParams.set("q",e),n.searchParams.set("lang","de"),n.searchParams.set("lat","51.961563"),n.searchParams.set("lon","7.628202"),n.searchParams.set("limit",o.toString());const a=await this.httpService.fetch(n,{signal:i});if(!a.ok)throw new Error("Request failed: "+a.status);return await a.json()}createLabel(e){return`${e.properties.name} (${e.properties.osm_value?e.properties.osm_value+", ":""}${e.properties.postcode?e.properties.postcode+", ":""}${e.properties.city?e.properties.city+", ":""}${e.properties.country?e.properties.country+")":")"}`}}const at=q("ol-app:AppModel");function k(r){return r==="selection"||r==="measurement"||r.startsWith("editing-")}class st{_mapRegistry;_vectorSelectionSourceFactory;_httpService;_resources=[];_featureHighlight=void 0;_mainContent=T(["toc"]);_searchSources=D();_selectionSources=D();_sourceMetadata=re();_resultListState=T({key:0,open:!1,input:void 0});constructor({references:e}){this._mapRegistry=e.mapRegistry,this._vectorSelectionSourceFactory=e.vectorSelectionSourceFactory,this._httpService=e.httpService,this.initSearchSources(),this.initSelectionSources().catch(o=>{at.error("Failed to initialize selection sources",o)})}destroy(){this.clearHighlight(),this._resources.forEach(e=>e.destroy())}get mainContent(){return this._mainContent.value}get searchSources(){return this._searchSources}get selectionSources(){return this._selectionSources}get sourceMetadata(){return this._sourceMetadata}get resultListState(){return this._resultListState.value}toggleMainContent(e){const o=this._mainContent.value;if(o.includes(e)){this._mainContent.value=o.filter(n=>n!==e);return}let i;k(e)?(i=[e],this.clearHighlight()):(i=o.filter(n=>!k(n)),i.push(e)),this._mainContent.value=i}hideContent(e){this._mainContent.value=this._mainContent.value.filter(o=>o!==e)}clearInteractions(){this._mainContent.value=this._mainContent.value.filter(e=>!k(e))}setResultListInput(e){const o=this._resultListState.value;this._resultListState.value={open:!0,key:o.key+1,input:e}}setResultListVisibility(e){this._resultListState.value={...this._resultListState.value,open:e}}highlightAndZoom(e,o){const i=e.olMap.getViewport();this.clearHighlight(),this._featureHighlight=e.highlightAndZoom(o,{viewPadding:i&&i.offsetWidth<1e3?{top:150,right:75,bottom:50,left:75}:{top:150,right:400,bottom:50,left:400}})}zoom(e,o){const i=e.olMap.getViewport();e.zoom(o,{viewPadding:i&&i.offsetWidth<1e3?{top:150,right:75,bottom:50,left:75}:{top:150,right:400,bottom:50,left:400}})}clearHighlight(){this._featureHighlight&&(this._featureHighlight.destroy(),this._featureHighlight=void 0)}initSearchSources(){const e=new nt("Photon Geocoder",["city","street"],this._httpService);this._searchSources.push(e)}async initSelectionSources(){const e=["ogc_kitas","ogc_kataster"],i=(await this._mapRegistry.expectMapModel(_)).layers.getOperationalLayers({sortByDisplayOrder:!0});for(const n of i){if(!e.includes(n.id)||!lt(n.olLayer))continue;const a=this._vectorSelectionSourceFactory.createSelectionSource({vectorLayer:n.olLayer,label:n.title}),s=ie(()=>[a.status],([l])=>{l!=="available"&&(l==="unavailable"||l?.kind==="unavailable")&&this.clearHighlight()});this._resources.push(s,a),this._selectionSources.unshift(a),this._sourceMetadata.set(a,n.attributes.resultListMetadata)}}}function lt(r){return r instanceof C&&r.getSource()instanceof N}const ct={"ol-map":{name:"ol-map",services:{MapConfigProviderImpl:{name:"MapConfigProviderImpl",clazz:Qe,provides:[{name:"map.MapConfigProvider",qualifier:void 0}],references:{vectorSourceFactory:{name:"ogc-features.VectorSourceFactory",qualifier:void 0,all:!1}}},AppModel:{name:"AppModel",clazz:st,provides:[{name:"ol-app.AppModel",qualifier:void 0}],references:{vectorSelectionSourceFactory:{name:"selection.VectorSelectionSourceFactory",qualifier:void 0,all:!1},httpService:{name:"http.HttpService",qualifier:void 0,all:!1},mapRegistry:{name:"map.MapRegistry",qualifier:void 0,all:!1}}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1},{name:"ol-app.AppModel",qualifier:void 0,all:!1},{name:"notifier.NotificationService",qualifier:void 0,all:!1},{name:"editing.EditingService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/chakra-integration":{name:"@open-pioneer/chakra-integration",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime":{name:"@open-pioneer/runtime",services:{},ui:{references:[]},properties:{}},"@open-pioneer/react-utils":{name:"@open-pioneer/react-utils",services:{},ui:{references:[]},properties:{}},"@open-pioneer/http":{name:"@open-pioneer/http",services:{HttpServiceImpl:{name:"HttpServiceImpl",clazz:ne,provides:[{name:"http.HttpService",qualifier:"http.HttpService"}],references:{interceptors:{name:"http.Interceptor",qualifier:void 0,all:!0}}}},ui:{references:[]},properties:{}},"@open-pioneer/notifier":{name:"@open-pioneer/notifier",services:{NotificationServiceImpl:{name:"NotificationServiceImpl",clazz:Oe,provides:[{name:"notifier.NotificationService",qualifier:"notifier.NotificationService"}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/reactivity":{name:"@open-pioneer/reactivity",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map":{name:"@open-pioneer/map",services:{MapRegistryImpl:{name:"MapRegistryImpl",clazz:ae,provides:[{name:"map.MapRegistry",qualifier:void 0}],references:{providers:{name:"map.MapConfigProvider",qualifier:void 0,all:!0},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/theme":{name:"@open-pioneer/theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map-ui-components":{name:"@open-pioneer/map-ui-components",services:{},ui:{references:[]},properties:{}},"@open-pioneer/coordinate-viewer":{name:"@open-pioneer/coordinate-viewer",services:{},ui:{references:[]},properties:{}},"@open-pioneer/ogc-features":{name:"@open-pioneer/ogc-features",services:{VectorSourceFactory:{name:"VectorSourceFactory",clazz:Ge,provides:[{name:"ogc-features.VectorSourceFactory",qualifier:void 0}],references:{httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}},SearchSourceFactory:{name:"SearchSourceFactory",clazz:Be,provides:[{name:"ogc-features.SearchSourceFactory",qualifier:void 0}],references:{httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[]},properties:{}},"@open-pioneer/scale-bar":{name:"@open-pioneer/scale-bar",services:{},ui:{references:[]},properties:{}},"@open-pioneer/scale-viewer":{name:"@open-pioneer/scale-viewer",services:{},ui:{references:[]},properties:{}},"@open-pioneer/result-list":{name:"@open-pioneer/result-list",services:{},ui:{references:[]},properties:{}},"@open-pioneer/toc":{name:"@open-pioneer/toc",services:{},ui:{references:[]},properties:{}},"@open-pioneer/editing":{name:"@open-pioneer/editing",services:{EditingServiceImpl:{name:"EditingServiceImpl",clazz:Se,provides:[{name:"editing.EditingService",qualifier:void 0}],references:{mapRegistry:{name:"map.MapRegistry",qualifier:void 0,all:!1},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[]},properties:{polygonStyle:{value:{"fill-color":"rgba(255,255,255,0.4)","stroke-color":"red","stroke-width":1.25,"circle-radius":3,"circle-fill-color":"red","circle-stroke-width":1.25,"circle-stroke-color":"red"},required:!1},vertexStyle:{value:{"circle-radius":3,"circle-fill-color":"red","circle-stroke-width":1.25,"circle-stroke-color":"red"},required:!1}}},"@open-pioneer/legend":{name:"@open-pioneer/legend",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map-navigation":{name:"@open-pioneer/map-navigation",services:{},ui:{references:[]},properties:{}},"@open-pioneer/measurement":{name:"@open-pioneer/measurement",services:{},ui:{references:[]},properties:{}},"@open-pioneer/printing":{name:"@open-pioneer/printing",services:{PrintingServiceImpl:{name:"PrintingServiceImpl",clazz:He,provides:[{name:"printing.PrintingService",qualifier:void 0}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1},{name:"printing.PrintingService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/search":{name:"@open-pioneer/search",services:{},ui:{references:[]},properties:{}},"@open-pioneer/selection":{name:"@open-pioneer/selection",services:{VectorSelectionSourceFactory:{name:"VectorSelectionSourceFactory",clazz:ye,provides:[{name:"selection.VectorSelectionSourceFactory",qualifier:void 0}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/base-theme":{name:"@open-pioneer/base-theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime-react-support":{name:"@open-pioneer/runtime-react-support",services:{},ui:{references:[]},properties:{}},"@open-pioneer/core":{name:"@open-pioneer/core",services:{},ui:{references:[]},properties:{}},"@open-pioneer/basemap-switcher":{name:"@open-pioneer/basemap-switcher",services:{},ui:{references:[]},properties:{}}},pt='.search-box{position:absolute;width:500px;max-width:100%;z-index:1}:root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.map-container .ol-viewport .ol-attribution{bottom:var(--map-padding-bottom);right:var(--map-padding-right)}.editing-tooltip{position:relative;background:#fffc;border-radius:4px;color:#000;padding:4px 8px;opacity:1;white-space:nowrap;font-size:12px;cursor:default;-webkit-user-select:none;user-select:none;font-weight:700}.editing-tooltip-hidden{visibility:hidden}.measurement-tooltip{position:relative;background:#fffc;border-radius:4px;color:#000;padding:4px 8px;opacity:1;white-space:nowrap;font-size:12px;cursor:default;-webkit-user-select:none;user-select:none;font-weight:700}.measurement-active-tooltip{background:#000000e6;border-radius:4px;border-color:#000000e6;opacity:.9;color:#fff}.measurement-finished-tooltip{background-color:#4cb3ffe6;color:#000;border:1px solid white}.measurement-active-tooltip:before,.measurement-finished-tooltip:before{border-top:6px solid rgba(0,0,0,.9);border-right:6px solid transparent;border-left:6px solid transparent;content:"";position:absolute;bottom:-6px;margin-left:-7px;left:50%}.measurement-finished-tooltip:before{border-top-color:#4cb3ff}.printing-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:10000;-webkit-user-select:none;user-select:none;pointer-events:all;cursor:wait;display:flex;flex-direction:row;align-items:center;justify-content:center;background-color:#b4b4b4cc}.printing-overlay-status{flex:1 1 auto;font-size:1.5em;text-align:center}.printing-scale-bar.ol-scale-bar{left:var(--printing-scale-bar-left);bottom:var(--printing-scale-bar-bottom)}.search-component .chakra-divider{display:none}.search-component .search-highlighted-match{font-weight:700}.search-component .search-value-container{cursor:text;padding-left:30px!important}.search-component .search-invisible{display:none}.selection-drag-box{background-color:#ffffff4d!important;border:3px solid var(--chakra-colors-background_primary)!important}.selection-tooltip{position:relative;background:#fffc;border-radius:4px;color:#000;padding:4px 8px;opacity:1;white-space:nowrap;font-size:12px;cursor:default;-webkit-user-select:none;user-select:none;font-weight:700}.selection .react-select{cursor:default}.map-container .selection-active{cursor:crosshair}.map-container .selection-inactive{cursor:no-drop}.selection-source-value.selection-source-value--disabled{opacity:.4}.selection-source-value.selection-source-value--disabled span{margin:0 6px 0 0}.scale-bar .ol-scale-bar{margin-bottom:8px;margin-right:8px}.scale-bar .ol-scale-bar,.scale-bar .ol-scale-line{position:relative;bottom:0;left:0;background:none}.scale-bar .ol-scale-bar .ol-scale-bar-inner,.scale-bar .ol-scale-bar .ol-scale-line-inner,.scale-bar .ol-scale-line .ol-scale-bar-inner,.scale-bar .ol-scale-line .ol-scale-line-inner{color:var(--chakra-white);border-color:var(--chakra-white)}.result-list-no-data-message{text-align:center;margin-top:50px;font-weight:700;font-size:larger}.result-list-table th,.result-list-table td{overflow-wrap:break-word}.result-list-table.result-list-table--is-resizing *{cursor:col-resize}.result-list-table thead{position:sticky;top:0;z-index:1;background:var(--chakra-colors-background_body)}.result-list-table th{position:relative;border-right-width:thin}.result-list-table tbody tr:hover{background:var(--chakra-colors-background_light)}.result-list-table .result-list-resizer{position:absolute;top:0;height:100%;right:0;width:8px;background:var(--chakra-colors-trails-100);transform:scaleX(.25);cursor:col-resize;-webkit-user-select:none;user-select:none;touch-action:none;padding-left:0}.result-list-table th:last-child .result-list-resizer{width:8px;transform:translate(50%) scaleX(.25)}.result-list-table th .result-list-resizer.result-list-resizer--is-resizing{background:var(--chakra-colors-trails-500);transform:scale(1)}.result-list-table th .result-list-resizer:hover{transform:scale(1)}',dt=["en","de"];function ut(r){switch(r){case"en":return E(()=>import("./BYGrfKr5WBJ9.js"),[],import.meta.url).then(e=>e.default);case"de":return E(()=>import("./C-s9YzO5rJEK.js"),[],import.meta.url).then(e=>e.default)}throw new Error(`Unsupported locale: '${r}'`)}const mt=U(pt),gt=Object.freeze(Object.defineProperty({__proto__:null,loadMessages:ut,locales:dt,packages:ct,styles:mt},Symbol.toStringTag,{value:"Module"})),B="ol-map",g=le.bind(void 0,B),u=se.bind(void 0,B),ht=q("ol-app:Editing");function F(r){const e=ft(r.kind),o=p.useId(),i=u();return t.jsx(d,{role:"dialog","aria-labelledby":o,children:t.jsx(v,{title:t.jsx(x,{id:o,size:"md",mb:2,children:i.formatMessage({id:"editing.title"})}),children:t.jsxs(d,{overflowY:"auto",maxHeight:300,children:[t.jsx(z,{textAlign:"center",children:i.formatMessage({id:"editing.active"})}),t.jsxs(H,{mt:4,align:"center",justify:"center",children:[t.jsx(I,{onClick:()=>{e?.reset()},children:i.formatMessage({id:"editing.resetGeometry"})}),t.jsx(I,{onClick:()=>{e?.destroy()},children:i.formatMessage({id:"editing.abort"})})]})]})})})}function ft(r){const e=g("notifier.NotificationService"),o=g("editing.EditingService"),i=u(),n=g("ol-app.AppModel"),{map:a}=L(),[s,l]=p.useState();return p.useEffect(()=>{if(!a)return;const c=new bt(e,o,a,i,n,r);return l(c),()=>{c.destroy(),l(void 0)}},[n,o,i,a,e,r]),s}class bt{notificationService;editingService;map;intl;appModel;kind;job;constructor(e,o,i,n,a,s){this.notificationService=e,this.editingService=o,this.map=i,this.intl=n,this.appModel=a,this.kind=s;let l;switch(s){case"create":l=this.createJob();break;case"update":l=this.updateJob();break}this.job=l,this.job.run().catch(c=>{K(c)||(ht.error("Edit operation failed",c),this.notificationService.notify({level:"error",message:this.intl.formatMessage({id:"editing.error"})}))}).finally(()=>{this.destroy()})}destroy(){this.job?.destroy(),this.job=void 0,this.appModel.hideContent(`editing-${this.kind}`)}reset(){this.job?.reset()}createJob(){let e;return{destroy(){e?.stop(),e=void 0},reset(){e?.reset()},run:async()=>{const o=this.findLayer(),i=new URL(o.attributes.collectionURL+"/items");e=this.editingService.createFeature(this.map,i);const n=await e.whenComplete();if(e=void 0,!n)return;this.notificationService.notify({level:"info",message:this.intl.formatMessage({id:"editing.create.featureCreated"},{featureId:n.featureId})}),(o?.olLayer).getSource()?.refresh()}}}updateJob(){const e=this.map,o=new AbortController,i=o.signal;let n,a,s;function l(){a&&e.olMap.removeInteraction(a),a&&a.dispose(),n&&n.destroy(),o.abort(),a=void 0,n=void 0}return{destroy(){l(),s?.stop(),s=void 0},reset(){s?.reset()},run:async()=>{const c=this.findLayer(),m=c.olLayer,w=new URL(c.attributes.collectionURL+"/items");a=new ke({layers:[m]}),e.olMap.addInteraction(a),n=vt(this.intl,e.olMap),n.element.classList.remove("editing-tooltip-hidden");let f;for(;;){const{selected:P,deselected:W}=await xt(a,i);if(P.length===1&&W.length===0){l(),f=P[0];break}}if(!f)throw Error("Feature is undefined");s=this.editingService.updateFeature(e,w,f);const S=await s.whenComplete();S&&(this.notificationService.notify({level:"info",message:this.intl.formatMessage({id:"editing.update.featureModified"},{featureId:S.featureId})}),m.getSource()?.refresh())}}}findLayer(){const e=this.map.layers.getLayerById("krankenhaus");if(!e)throw new Error("Layer not found");return e}}function vt(r,e){const o=document.createElement("div");o.className="editing-tooltip editing-tooltip-hidden",o.textContent=r.formatMessage({id:"editing.update.tooltip.select"});const i=new Me({element:o,offset:[15,0],positioning:"center-left"}),n=e.on("pointermove",a=>{a.dragging||i.setPosition(a.coordinate)});return e.addOverlay(i),{overlay:i,element:o,destroy(){M(n),e.removeOverlay(i)}}}function xt(r,e){let o;const{promise:i,resolve:n,reject:a}=$();if(e.aborted)return a(A()),i;const s=()=>{o&&M(o),o=void 0,a(A())};return e.addEventListener("abort",s),o=r.on("select",l=>{e.removeEventListener("abort",s),o&&M(o),o=void 0,n(l)}),i}function wt(){const r=u();return t.jsxs(y,{role:"region","aria-label":r.formatMessage({id:"ariaLabel.footer"}),gap:3,alignItems:"center",justifyContent:"center",children:[t.jsx(je,{precision:2,displayProjectionCode:"EPSG:4326"}),t.jsx(Ce,{}),t.jsx(Le,{})]})}function St(){const r=p.useId(),e=u();return t.jsx(d,{role:"dialog","aria-labelledby":r,children:t.jsx(v,{title:t.jsx(x,{id:r,size:"md",mb:2,children:e.formatMessage({id:"legendTitle"})}),children:t.jsx(d,{overflowY:"auto",maxHeight:300,children:t.jsx(ze,{showBaseLayers:!0})})})})}function yt(r){return G({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M6.5 9.5l1.546 -1.311"},child:[]},{tag:"path",attr:{d:"M14 5.5l3 1.5"},child:[]},{tag:"path",attr:{d:"M18.5 10l-1.185 3.318m-1.062 2.972l-.253 .71"},child:[]},{tag:"path",attr:{d:"M13.5 17.5l-7 -5"},child:[]},{tag:"path",attr:{d:"M3 3l18 18"},child:[]}]})(r)}function kt(r){return G({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M6.5 9.5l3.5 -3"},child:[]},{tag:"path",attr:{d:"M14 5.5l3 1.5"},child:[]},{tag:"path",attr:{d:"M18.5 10l-2.5 7"},child:[]},{tag:"path",attr:{d:"M13.5 17.5l-7 -5"},child:[]}]})(r)}function Mt(){const r=u(),e=g("ol-app.AppModel"),o=b(()=>e.resultListState,[e]),i=o.open,{isTocActive:n,isLegendActive:a,isPrintingActive:s}=b(()=>({isTocActive:e.mainContent.includes("toc"),isLegendActive:e.mainContent.includes("legend"),isPrintingActive:e.mainContent.includes("printing")}),[e]);return t.jsxs(y,{role:"toolbar","aria-label":r.formatMessage({id:"ariaLabel.toolbar"}),direction:"column",gap:1,padding:1,children:[t.jsx(jt,{}),o.input&&t.jsx(h,{label:r.formatMessage({id:"resultListTitle"}),icon:t.jsx(me,{}),isActive:o.open,onClick:()=>e.setResultListVisibility(!i)}),t.jsx(h,{label:r.formatMessage({id:"tocTitle"}),icon:t.jsx(ge,{}),isActive:n,onClick:()=>e.toggleMainContent("toc")}),t.jsx(h,{label:r.formatMessage({id:"legendTitle"}),icon:t.jsx(he,{}),isActive:a,onClick:()=>e.toggleMainContent("legend")}),t.jsx(h,{label:r.formatMessage({id:"printingTitle"}),icon:t.jsx(fe,{}),isActive:s,onClick:()=>e.toggleMainContent("printing")}),t.jsx(We,{}),t.jsx(Ue,{}),t.jsx(Ke,{})]})}function jt(){const r=u(),e=g("ol-app.AppModel"),[o,i]=p.useState(!1),{isSelectionActive:n,isMeasurementActive:a,isEditingCreateActive:s,isEditingUpdateActive:l}=b(()=>({isSelectionActive:e.mainContent.includes("selection"),isMeasurementActive:e.mainContent.includes("measurement"),isEditingCreateActive:e.mainContent.includes("editing-create"),isEditingUpdateActive:e.mainContent.includes("editing-update")}),[e]),c=f=>()=>{f(),i(!1)},m={placement:"top"},w=t.jsxs(t.Fragment,{children:[t.jsx(h,{label:s?r.formatMessage({id:"editing.stopTitle"}):r.formatMessage({id:"editing.create.startTitle"}),icon:s?t.jsx(yt,{}):t.jsx(kt,{}),isActive:s,onClick:c(()=>e.toggleMainContent("editing-create")),tooltipProps:m}),t.jsx(h,{label:l?r.formatMessage({id:"editing.stopTitle"}):r.formatMessage({id:"editing.update.startTitle"}),icon:l?t.jsx(be,{}):t.jsx(ve,{}),isActive:l,onClick:c(()=>e.toggleMainContent("editing-update")),tooltipProps:m}),t.jsx(h,{label:r.formatMessage({id:"measurementTitle"}),icon:t.jsx(xe,{}),isActive:a,onClick:c(()=>e.toggleMainContent("measurement")),tooltipProps:m}),t.jsx(h,{label:r.formatMessage({id:"selectionTitle"}),icon:t.jsx(we,{}),isActive:n,onClick:c(()=>e.toggleMainContent("selection")),tooltipProps:m})]});return t.jsxs(Re,{placement:"left",isLazy:!0,onOpen:()=>i(!0),onClose:()=>i(!1),isOpen:o,children:[t.jsx(Ee,{children:t.jsx(Ct,{})}),t.jsx(Z,{children:t.jsxs(Fe,{width:"auto",children:[t.jsx(qe,{}),t.jsx(Ne,{children:t.jsx(H,{spacing:2,children:w})})]})})]})}const Ct=p.forwardRef(function(e,o){const i=u(),n=De(),{onClick:a,...s}=n.getTriggerProps();return t.jsx(h,{ref:o,label:i.formatMessage({id:"mapInteractions.title"}),icon:t.jsx(ue,{}),onClick:a,buttonProps:s})});function Lt(){const r=p.useId(),e=u();return t.jsx(d,{role:"dialog","aria-labelledby":r,children:t.jsx(v,{title:t.jsx(x,{id:r,size:"md",mb:2,children:e.formatMessage({id:"measurementTitle"})}),children:t.jsx(_e,{})})})}function zt(){const r=g("ol-app.AppModel"),e=b(()=>r.resultListState,[r]),[o,i]=p.useState([]),[n,a]=p.useState([]),s=p.useCallback(l=>{i(l.features),a(l.getFeatureIds())},[]);return p.useEffect(()=>{console.log("Anzahl Features: "+o.length),console.log("SelectedIds: "+n.toString())},[o,n]),e.input&&t.jsx(d,{className:"result-list-container",position:"absolute",visibility:e.open?"visible":"hidden",bottom:"0",backgroundColor:"white",width:"100%",height:"400px",zIndex:1,borderTop:"2px solid",borderBottom:"2px solid",borderColor:"trails.100",children:t.jsx(Ze,{input:e.input,onSelectionChange:s},e.key)})}function _t(){const{map:r}=L(),e=g("ol-app.AppModel"),o=b(()=>e.searchSources.getItems(),[e]);function i(a){if(console.debug("The user selected the following item: ",a.result),!r)return;const s=a.result.geometry;s&&e.highlightAndZoom(r,[s])}function n(){console.debug("The user cleared the search"),e.clearHighlight()}return t.jsx(d,{backgroundColor:"white",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",mt:5,className:"search-box",children:t.jsx(Pe,{sources:o,maxResultsPerGroup:10,onSelect:i,onClear:n})})}function Pt(){const r=u(),e=g("notifier.NotificationService"),o=p.useId(),{map:i}=L(),n=g("ol-app.AppModel"),a=b(()=>n.selectionSources.getItems(),[n]),s={numberOptions:{maximumFractionDigits:3},dateOptions:{dateStyle:"medium",timeStyle:"medium",timeZone:"UTC"}};function l(m){const{source:w,results:f}=m;if(!i){console.debug("Map not ready");return}const S=n.sourceMetadata.get(w);if(!S){console.warn("Can not show results because no metadata could be found");return}n.setResultListInput({columns:S,data:f,formatOptions:s}),e.notify({level:"info",message:r.formatMessage({id:"foundResults"},{resultsCount:f.length}),displayDuration:4e3})}function c(m){n.clearHighlight()}return t.jsx(d,{role:"dialog","aria-labelledby":o,children:t.jsx(v,{title:t.jsx(x,{id:o,size:"md",mb:2,children:r.formatMessage({id:"selectionTitle"})}),children:t.jsx(Ie,{sources:a,onSelectionComplete:l,onSelectionSourceChanged:c})})})}function It(){const r=p.useId(),e=u();return t.jsx(d,{role:"dialog","aria-labelledby":r,children:t.jsx(v,{title:t.jsx(x,{id:r,size:"md",mb:2,children:t.jsx(z,{children:e.formatMessage({id:"tocTitle"})})}),children:t.jsx(d,{overflowY:"auto",maxHeight:300,children:t.jsx(Ve,{showTools:!0,basemapSwitcherProps:{allowSelectingEmptyBasemap:!0}})})})})}function At(){const r=p.useId(),e=u();return t.jsx(d,{role:"dialog","aria-labelledby":r,children:t.jsx(v,{title:t.jsx(x,{id:r,size:"md",mb:2,children:e.formatMessage({id:"printingTitle"})}),children:t.jsx(Ae,{})})})}function Tt(){const r=u(),e=g("ol-app.AppModel"),{resultListState:o,mainContent:i}=b(()=>({resultListState:e.resultListState,mainContent:e.mainContent}),[e]),n=o.input&&o.open;return t.jsx(ce,{mapId:_,children:t.jsxs(y,{height:"100%",direction:"column",overflow:"hidden",children:[t.jsx(Te,{position:"top-right"}),t.jsxs(v,{title:t.jsx(d,{role:"region","aria-label":r.formatMessage({id:"ariaLabel.header"}),textAlign:"center",py:1,children:t.jsx(x,{size:"md",children:"Sample Application"})}),children:[t.jsx(y,{flex:"1",direction:"column",position:"relative",children:t.jsxs(pe,{role:"main","aria-label":r.formatMessage({id:"ariaLabel.map"}),viewPadding:n?{bottom:400}:void 0,children:[t.jsx(Ye,{centerContent:!0,children:t.jsx(_t,{})}),t.jsx(Dt,{mainContent:i}),t.jsx(de,{position:"bottom-right",horizontalGap:10,verticalGap:45,children:t.jsx(Mt,{})}),t.jsx(zt,{})]})}),t.jsx(wt,{})]})]})})}function Dt(r){const{mainContent:e}=r,o=p.useMemo(()=>{const i=n=>{switch(n){case"toc":return t.jsx(It,{},n);case"legend":return t.jsx(St,{},n);case"printing":return t.jsx(At,{},n);case"selection":return t.jsx(Pt,{},n);case"measurement":return t.jsx(Lt,{},n);case"editing-create":return t.jsx(F,{kind:"create"},n);case"editing-update":return t.jsx(F,{kind:"update"},n)}};return e.map(n=>i(n))},[e]);return t.jsx(Rt,{children:o})}function Rt(r){const e=r.children,o=[];for(const i of e)i&&(o.length&&o.push(t.jsx($e,{mt:4,mb:4},o.length)),o.push(i));if(o.length!==0)return t.jsx(d,{position:"absolute",top:"100px",left:4,maxHeight:"calc(100% - 140px)",width:350,maxWidth:350,zIndex:1,backgroundColor:"white",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",overflow:"auto",children:o})}const Et=new URLSearchParams(window.location.search),Ft=Et.get("lang")||void 0,qt=Y({component:Tt,appMetadata:gt,config:{locale:Ft,properties:{"@open-pioneer/local-storage":{storageId:"ol-app-state"}}}});customElements.define("ol-map-app",qt); +import{j as t,c as q,a as U,r as p,B as I,i as K,b as $,d as A,F as Z,e as Y}from"./Bh0CuZ3gy5tC.js";import{B as d,V as J,S as j,T as X,O as Q,a as C,b as N,c as ee,C as te,F as oe,r as T,d as D,e as re,w as ie,H as ne,M as ae,u as se,f as le,g as v,h as x,i as L,j as M,k as y,D as ce,l as pe,m as de}from"./CvR1K3f_Jx0o.js";import{W as V,P as ue,a as me,b as ge,c as he,d as fe,e as be,f as ve,g as xe,h as we}from"./DNeIgqfIWVUM.js";import{W as R,E as Se,V as ye,S as ke,O as Me,C as je,a as Ce,b as Le,L as ze,M as _e,c as Pe,d as Ie,P as Ae,N as Te}from"./D5t2Vmz5gxIu.js";import{G as O,u as De,T as h,P as Re,a as Ee,b as Fe,c as qe,d as Ne,e as Ve}from"./CDZlakCE4enr.js";import{T as z}from"./Tz2xttM4F6S2.js";import{N as Oe,P as He}from"./CC4cg6c-thsW.js";import{V as Ge,S as Be,I as We,Z as Ue,a as Ke}from"./Cn6jOzlRJRDP.js";import{_ as E}from"./CmsKOCeNyeyo.js";import{u as b,D as $e}from"./B1-t77dlZFnS.js";import{H}from"./L25RkWOQSN8A.js";import{G}from"./CL_VRsbiqLzM.js";import{R as Ze}from"./CxxdN3Z_jMxj.js";import{C as Ye}from"./BCXJt8t_qqq7.js";import"./DoZQ59JZnzxi.js";import"./CKfDAIEslOW2.js";import"./Cq1ZpfgEg4XJ.js";import"./D03oE8cEQPSj.js";import"./BO_q12Vdyug-.js";import"./CreVQ-qFRzOc.js";import"./CjjyePfBQlZ7.js";import"./DUys4rac0YQP.js";import"./2d5-QpxJNHTD.js";import"./BeFcF3Ti4kY-.js";const Je={height:"25px",width:"25px",borderColor:"#4cb3ff",borderWidth:"3px",borderRadius:"50%",display:"inline-block "};function Xe(r){return t.jsxs(d,{children:[t.jsx(z,{children:r.layer.title}),t.jsx(d,{style:Je})]})}const _="main";class Qe{mapId=_;vectorSourceFactory;constructor(e){this.vectorSourceFactory=e.references.vectorSourceFactory}async getMapConfig(){return{advanced:{view:new J({center:[404747,5757920],zoom:13,constrainResolution:!0,projection:"EPSG:25832"})},layers:[...et(),rt(),tt(this.vectorSourceFactory),ot(),it()]}}}function et(){return[new R({isBaseLayer:!0,title:"Topplus grau",url:"https://www.wmts.nrw.de/topplus_open/1.0.0/WMTSCapabilities.xml",name:"topplus_grau",matrixSet:"EPSG_25832_14",visible:!1,sourceOptions:{attributions:`Kartendarstellung und Präsentationsgraphiken: © Bundesamt für Kartographie und Geodäsie ${new Date().getFullYear()}, Datenquellen`}}),new R({isBaseLayer:!0,title:"Topplus farbig",url:"https://www.wmts.nrw.de/topplus_open/1.0.0/WMTSCapabilities.xml",name:"topplus_col",matrixSet:"EPSG_25832_14",visible:!0,sourceOptions:{attributions:`Kartendarstellung und Präsentationsgraphiken: © Bundesamt für Kartographie und Geodäsie ${new Date().getFullYear()}, Datenquellen`}}),new j({title:"OpenStreetMaps",visible:!1,isBaseLayer:!0,olLayer:new X({source:new Q})})]}function tt(r){const e="https://ogc-api-test.nrw.de/inspire-us-krankenhaus/v1",o="governmentalservice",i=r.createVectorSource({strategy:"next",baseUrl:e,collectionId:o,limit:1e3,crs:"http://www.opengis.net/def/crs/EPSG/0/25832",attributions:`Land NRW (${new Date().getFullYear()}), Datenlizenz Deutschland - Namensnennung - Version 2.0, Datenquelle`}),n=new C({source:i});return new j({id:"krankenhaus",title:"Krankenhäuser",visible:!1,olLayer:n,attributes:{collectionURL:e+"/collections/"+o}})}function ot(){return new V({title:"Schulstandorte",description:"Der vorliegende Datenbestand / Dienst zu den Schulstandorten in NRW stammt aus der Schuldatenbank. Die Informationen werden von den Schulträgern bzw. Schulen selbst eingetragen und aktuell gehalten. Die Daten werden tagesaktuell bereitgestellt und enthalten alle grundlegenden Informationen zu Schulen wie Schulnummer, Schulbezeichnung und Adresse.Der vorliegende Datenbestand / Dienst zu den Schulstandorten in NRW stammt aus der Schuldatenbank. Die Informationen werden von den Schulträgern bzw. Schulen selbst eingetragen und aktuell gehalten. Die Daten werden tagesaktuell bereitgestellt und enthalten alle grundlegenden Informationen zu Schulen wie Schulnummer, Schulbezeichnung und Adresse.Der vorliegende Datenbestand / Dienst zu den Schulstandorten in NRW stammt aus der Schuldatenbank. Die Informationen werden von den Schulträgern bzw. Schulen selbst eingetragen und aktuell gehalten. Die Daten werden tagesaktuell bereitgestellt und enthalten alle grundlegenden Informationen zu Schulen wie Schulnummer, Schulbezeichnung und Adresse.Der vorliegende Datenbestand / Dienst zu den Schulstandorten in NRW stammt aus der Schuldatenbank. Die Informationen werden von den Schulträgern bzw. Schulen selbst eingetragen und aktuell gehalten. Die Daten werden tagesaktuell bereitgestellt und enthalten alle grundlegenden Informationen zu Schulen wie Schulnummer, Schulbezeichnung und Adresse.",visible:!0,url:"https://www.wms.nrw.de/wms/wms_nw_inspire-schulen",sublayers:[{name:"US.education",title:"INSPIRE - WMS Schulstandorte NRW",attributes:{legend:{}}}],sourceOptions:{ratio:1}})}function rt(){return new V({title:"Straßennetz Landesbetrieb Straßenbau NRW",url:"https://www.wms.nrw.de/wms/strassen_nrw_wms",visible:!0,sublayers:[{name:"1",title:"Verwaltungen",attributes:{legend:{imageUrl:"https://www.wms.nrw.de/legends/wms/strassen_nrw_wms/1.png"}}},{name:"4",title:"Abschnitte und Äste"},{name:"6",title:"Unfälle"}]})}function it(){const r={Component:Xe},e=new N({url:"https://ogc-api.nrw.de/inspire-us-kindergarten/v1/collections/governmentalservice/items?f=json&limit=10000",format:new O,attributions:'© Bundesamt für Kartographie und Geodäsie 2017, Datenquellen'}),o=new C({source:e,style:new ee({image:new te({fill:new oe({color:"blue"}),radius:4})})});return new j({id:"ogc_kitas",title:"Kindertagesstätten",visible:!0,olLayer:o,attributes:{legend:r,resultListMetadata:[{id:"id",displayName:"ID",width:100,getPropertyValue(i){return i.id}},{propertyName:"pointOfContact.address.postCode",displayName:"PLZ",width:120},{propertyName:"name",displayName:"Name"},{propertyName:"inspireId",displayName:"inspireID"},{displayName:"Gefördert",width:160,getPropertyValue(i){switch(i.properties?.gefoerdert){case"ja":return!0;case"nein":return!1;default:return i.properties?.gefoerdert}}}]}})}class nt{label;filteredTypes;httpService;constructor(e,o,i){this.label=e,this.filteredTypes=o,this.httpService=i}async search(e,{mapProjection:o,signal:i}){const n=await this.request(e,100,i),a=new O({dataProjection:"EPSG:4326",featureProjection:o});return n.features.filter(s=>this.filteredTypes.includes(s.properties.type)).map((s,l)=>{const c=a.readGeometry(s.geometry);return{id:s.properties.osm_id||l,label:this.createLabel(s),geometry:c,properties:s.properties}})}async request(e,o,i){const n=new URL("https://photon.komoot.io/api?");n.searchParams.set("q",e),n.searchParams.set("lang","de"),n.searchParams.set("lat","51.961563"),n.searchParams.set("lon","7.628202"),n.searchParams.set("limit",o.toString());const a=await this.httpService.fetch(n,{signal:i});if(!a.ok)throw new Error("Request failed: "+a.status);return await a.json()}createLabel(e){return`${e.properties.name} (${e.properties.osm_value?e.properties.osm_value+", ":""}${e.properties.postcode?e.properties.postcode+", ":""}${e.properties.city?e.properties.city+", ":""}${e.properties.country?e.properties.country+")":")"}`}}const at=q("ol-app:AppModel");function k(r){return r==="selection"||r==="measurement"||r.startsWith("editing-")}class st{_mapRegistry;_vectorSelectionSourceFactory;_httpService;_resources=[];_featureHighlight=void 0;_mainContent=T(["toc"]);_searchSources=D();_selectionSources=D();_sourceMetadata=re();_resultListState=T({key:0,open:!1,input:void 0});constructor({references:e}){this._mapRegistry=e.mapRegistry,this._vectorSelectionSourceFactory=e.vectorSelectionSourceFactory,this._httpService=e.httpService,this.initSearchSources(),this.initSelectionSources().catch(o=>{at.error("Failed to initialize selection sources",o)})}destroy(){this.clearHighlight(),this._resources.forEach(e=>e.destroy())}get mainContent(){return this._mainContent.value}get searchSources(){return this._searchSources}get selectionSources(){return this._selectionSources}get sourceMetadata(){return this._sourceMetadata}get resultListState(){return this._resultListState.value}toggleMainContent(e){const o=this._mainContent.value;if(o.includes(e)){this._mainContent.value=o.filter(n=>n!==e);return}let i;k(e)?(i=[e],this.clearHighlight()):(i=o.filter(n=>!k(n)),i.push(e)),this._mainContent.value=i}hideContent(e){this._mainContent.value=this._mainContent.value.filter(o=>o!==e)}clearInteractions(){this._mainContent.value=this._mainContent.value.filter(e=>!k(e))}setResultListInput(e){const o=this._resultListState.value;this._resultListState.value={open:!0,key:o.key+1,input:e}}setResultListVisibility(e){this._resultListState.value={...this._resultListState.value,open:e}}highlightAndZoom(e,o){const i=e.olMap.getViewport();this.clearHighlight(),this._featureHighlight=e.highlightAndZoom(o,{viewPadding:i&&i.offsetWidth<1e3?{top:150,right:75,bottom:50,left:75}:{top:150,right:400,bottom:50,left:400}})}zoom(e,o){const i=e.olMap.getViewport();e.zoom(o,{viewPadding:i&&i.offsetWidth<1e3?{top:150,right:75,bottom:50,left:75}:{top:150,right:400,bottom:50,left:400}})}clearHighlight(){this._featureHighlight&&(this._featureHighlight.destroy(),this._featureHighlight=void 0)}initSearchSources(){const e=new nt("Photon Geocoder",["city","street"],this._httpService);this._searchSources.push(e)}async initSelectionSources(){const e=["ogc_kitas","ogc_kataster"],i=(await this._mapRegistry.expectMapModel(_)).layers.getOperationalLayers({sortByDisplayOrder:!0});for(const n of i){if(!e.includes(n.id)||!lt(n.olLayer))continue;const a=this._vectorSelectionSourceFactory.createSelectionSource({vectorLayer:n.olLayer,label:n.title}),s=ie(()=>[a.status],([l])=>{l!=="available"&&(l==="unavailable"||l?.kind==="unavailable")&&this.clearHighlight()});this._resources.push(s,a),this._selectionSources.unshift(a),this._sourceMetadata.set(a,n.attributes.resultListMetadata)}}}function lt(r){return r instanceof C&&r.getSource()instanceof N}const ct={"ol-map":{name:"ol-map",services:{MapConfigProviderImpl:{name:"MapConfigProviderImpl",clazz:Qe,provides:[{name:"map.MapConfigProvider",qualifier:void 0}],references:{vectorSourceFactory:{name:"ogc-features.VectorSourceFactory",qualifier:void 0,all:!1}}},AppModel:{name:"AppModel",clazz:st,provides:[{name:"ol-app.AppModel",qualifier:void 0}],references:{vectorSelectionSourceFactory:{name:"selection.VectorSelectionSourceFactory",qualifier:void 0,all:!1},httpService:{name:"http.HttpService",qualifier:void 0,all:!1},mapRegistry:{name:"map.MapRegistry",qualifier:void 0,all:!1}}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1},{name:"ol-app.AppModel",qualifier:void 0,all:!1},{name:"notifier.NotificationService",qualifier:void 0,all:!1},{name:"editing.EditingService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/chakra-integration":{name:"@open-pioneer/chakra-integration",services:{},ui:{references:[]},properties:{}},"@open-pioneer/coordinate-viewer":{name:"@open-pioneer/coordinate-viewer",services:{},ui:{references:[]},properties:{}},"@open-pioneer/editing":{name:"@open-pioneer/editing",services:{EditingServiceImpl:{name:"EditingServiceImpl",clazz:Se,provides:[{name:"editing.EditingService",qualifier:void 0}],references:{mapRegistry:{name:"map.MapRegistry",qualifier:void 0,all:!1},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[]},properties:{polygonStyle:{value:{"fill-color":"rgba(255,255,255,0.4)","stroke-color":"red","stroke-width":1.25,"circle-radius":3,"circle-fill-color":"red","circle-stroke-width":1.25,"circle-stroke-color":"red"},required:!1},vertexStyle:{value:{"circle-radius":3,"circle-fill-color":"red","circle-stroke-width":1.25,"circle-stroke-color":"red"},required:!1}}},"@open-pioneer/http":{name:"@open-pioneer/http",services:{HttpServiceImpl:{name:"HttpServiceImpl",clazz:ne,provides:[{name:"http.HttpService",qualifier:"http.HttpService"}],references:{interceptors:{name:"http.Interceptor",qualifier:void 0,all:!0}}}},ui:{references:[]},properties:{}},"@open-pioneer/legend":{name:"@open-pioneer/legend",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map":{name:"@open-pioneer/map",services:{MapRegistryImpl:{name:"MapRegistryImpl",clazz:ae,provides:[{name:"map.MapRegistry",qualifier:void 0}],references:{providers:{name:"map.MapConfigProvider",qualifier:void 0,all:!0},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/map-navigation":{name:"@open-pioneer/map-navigation",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map-ui-components":{name:"@open-pioneer/map-ui-components",services:{},ui:{references:[]},properties:{}},"@open-pioneer/measurement":{name:"@open-pioneer/measurement",services:{},ui:{references:[]},properties:{}},"@open-pioneer/notifier":{name:"@open-pioneer/notifier",services:{NotificationServiceImpl:{name:"NotificationServiceImpl",clazz:Oe,provides:[{name:"notifier.NotificationService",qualifier:"notifier.NotificationService"}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/ogc-features":{name:"@open-pioneer/ogc-features",services:{VectorSourceFactory:{name:"VectorSourceFactory",clazz:Ge,provides:[{name:"ogc-features.VectorSourceFactory",qualifier:void 0}],references:{httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}},SearchSourceFactory:{name:"SearchSourceFactory",clazz:Be,provides:[{name:"ogc-features.SearchSourceFactory",qualifier:void 0}],references:{httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[]},properties:{}},"@open-pioneer/printing":{name:"@open-pioneer/printing",services:{PrintingServiceImpl:{name:"PrintingServiceImpl",clazz:He,provides:[{name:"printing.PrintingService",qualifier:void 0}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1},{name:"printing.PrintingService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/react-utils":{name:"@open-pioneer/react-utils",services:{},ui:{references:[]},properties:{}},"@open-pioneer/reactivity":{name:"@open-pioneer/reactivity",services:{},ui:{references:[]},properties:{}},"@open-pioneer/result-list":{name:"@open-pioneer/result-list",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime":{name:"@open-pioneer/runtime",services:{},ui:{references:[]},properties:{}},"@open-pioneer/scale-bar":{name:"@open-pioneer/scale-bar",services:{},ui:{references:[]},properties:{}},"@open-pioneer/scale-viewer":{name:"@open-pioneer/scale-viewer",services:{},ui:{references:[]},properties:{}},"@open-pioneer/search":{name:"@open-pioneer/search",services:{},ui:{references:[]},properties:{}},"@open-pioneer/selection":{name:"@open-pioneer/selection",services:{VectorSelectionSourceFactory:{name:"VectorSelectionSourceFactory",clazz:ye,provides:[{name:"selection.VectorSelectionSourceFactory",qualifier:void 0}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/theme":{name:"@open-pioneer/theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/toc":{name:"@open-pioneer/toc",services:{},ui:{references:[]},properties:{}},"@open-pioneer/core":{name:"@open-pioneer/core",services:{},ui:{references:[]},properties:{}},"@open-pioneer/base-theme":{name:"@open-pioneer/base-theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/basemap-switcher":{name:"@open-pioneer/basemap-switcher",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime-react-support":{name:"@open-pioneer/runtime-react-support",services:{},ui:{references:[]},properties:{}}},pt='.search-box{position:absolute;width:500px;max-width:100%;z-index:1}.editing-tooltip{position:relative;background:#fffc;border-radius:4px;color:#000;padding:4px 8px;opacity:1;white-space:nowrap;font-size:12px;cursor:default;-webkit-user-select:none;user-select:none;font-weight:700}.editing-tooltip-hidden{visibility:hidden}:root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.map-container .ol-viewport .ol-attribution{bottom:var(--map-padding-bottom);right:var(--map-padding-right)}.measurement-tooltip{position:relative;background:#fffc;border-radius:4px;color:#000;padding:4px 8px;opacity:1;white-space:nowrap;font-size:12px;cursor:default;-webkit-user-select:none;user-select:none;font-weight:700}.measurement-active-tooltip{background:#000000e6;border-radius:4px;border-color:#000000e6;opacity:.9;color:#fff}.measurement-finished-tooltip{background-color:#4cb3ffe6;color:#000;border:1px solid white}.measurement-active-tooltip:before,.measurement-finished-tooltip:before{border-top:6px solid rgba(0,0,0,.9);border-right:6px solid transparent;border-left:6px solid transparent;content:"";position:absolute;bottom:-6px;margin-left:-7px;left:50%}.measurement-finished-tooltip:before{border-top-color:#4cb3ff}.printing-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:10000;-webkit-user-select:none;user-select:none;pointer-events:all;cursor:wait;display:flex;flex-direction:row;align-items:center;justify-content:center;background-color:#b4b4b4cc}.printing-overlay-status{flex:1 1 auto;font-size:1.5em;text-align:center}.printing-scale-bar.ol-scale-bar{left:var(--printing-scale-bar-left);bottom:var(--printing-scale-bar-bottom)}.search-component .chakra-divider{display:none}.search-component .search-highlighted-match{font-weight:700}.search-component .search-value-container{cursor:text;padding-left:30px!important}.search-component .search-invisible{display:none}.selection-drag-box{background-color:#ffffff4d!important;border:3px solid var(--chakra-colors-background_primary)!important}.selection-tooltip{position:relative;background:#fffc;border-radius:4px;color:#000;padding:4px 8px;opacity:1;white-space:nowrap;font-size:12px;cursor:default;-webkit-user-select:none;user-select:none;font-weight:700}.selection .react-select{cursor:default}.map-container .selection-active{cursor:crosshair}.map-container .selection-inactive{cursor:no-drop}.selection-source-value.selection-source-value--disabled{opacity:.4}.selection-source-value.selection-source-value--disabled span{margin:0 6px 0 0}.result-list-no-data-message{text-align:center;margin-top:50px;font-weight:700;font-size:larger}.result-list-table th,.result-list-table td{overflow-wrap:break-word}.result-list-table.result-list-table--is-resizing *{cursor:col-resize}.result-list-table thead{position:sticky;top:0;z-index:1;background:var(--chakra-colors-background_body)}.result-list-table th{position:relative;border-right-width:thin}.result-list-table tbody tr:hover{background:var(--chakra-colors-background_light)}.result-list-table .result-list-resizer{position:absolute;top:0;height:100%;right:0;width:8px;background:var(--chakra-colors-trails-100);transform:scaleX(.25);cursor:col-resize;-webkit-user-select:none;user-select:none;touch-action:none;padding-left:0}.result-list-table th:last-child .result-list-resizer{width:8px;transform:translate(50%) scaleX(.25)}.result-list-table th .result-list-resizer.result-list-resizer--is-resizing{background:var(--chakra-colors-trails-500);transform:scale(1)}.result-list-table th .result-list-resizer:hover{transform:scale(1)}.scale-bar .ol-scale-bar{margin-bottom:8px;margin-right:8px}.scale-bar .ol-scale-bar,.scale-bar .ol-scale-line{position:relative;bottom:0;left:0;background:none}.scale-bar .ol-scale-bar .ol-scale-bar-inner,.scale-bar .ol-scale-bar .ol-scale-line-inner,.scale-bar .ol-scale-line .ol-scale-bar-inner,.scale-bar .ol-scale-line .ol-scale-line-inner{color:var(--chakra-white);border-color:var(--chakra-white)}',dt=["en","de"];function ut(r){switch(r){case"en":return E(()=>import("./BYGrfKr5WBJ9.js"),[],import.meta.url).then(e=>e.default);case"de":return E(()=>import("./C-s9YzO5rJEK.js"),[],import.meta.url).then(e=>e.default)}throw new Error(`Unsupported locale: '${r}'`)}const mt=U(pt),gt=Object.freeze(Object.defineProperty({__proto__:null,loadMessages:ut,locales:dt,packages:ct,styles:mt},Symbol.toStringTag,{value:"Module"})),B="ol-map",g=le.bind(void 0,B),u=se.bind(void 0,B),ht=q("ol-app:Editing");function F(r){const e=ft(r.kind),o=p.useId(),i=u();return t.jsx(d,{role:"dialog","aria-labelledby":o,children:t.jsx(v,{title:t.jsx(x,{id:o,size:"md",mb:2,children:i.formatMessage({id:"editing.title"})}),children:t.jsxs(d,{overflowY:"auto",maxHeight:300,children:[t.jsx(z,{textAlign:"center",children:i.formatMessage({id:"editing.active"})}),t.jsxs(H,{mt:4,align:"center",justify:"center",children:[t.jsx(I,{onClick:()=>{e?.reset()},children:i.formatMessage({id:"editing.resetGeometry"})}),t.jsx(I,{onClick:()=>{e?.destroy()},children:i.formatMessage({id:"editing.abort"})})]})]})})})}function ft(r){const e=g("notifier.NotificationService"),o=g("editing.EditingService"),i=u(),n=g("ol-app.AppModel"),{map:a}=L(),[s,l]=p.useState();return p.useEffect(()=>{if(!a)return;const c=new bt(e,o,a,i,n,r);return l(c),()=>{c.destroy(),l(void 0)}},[n,o,i,a,e,r]),s}class bt{notificationService;editingService;map;intl;appModel;kind;job;constructor(e,o,i,n,a,s){this.notificationService=e,this.editingService=o,this.map=i,this.intl=n,this.appModel=a,this.kind=s;let l;switch(s){case"create":l=this.createJob();break;case"update":l=this.updateJob();break}this.job=l,this.job.run().catch(c=>{K(c)||(ht.error("Edit operation failed",c),this.notificationService.notify({level:"error",message:this.intl.formatMessage({id:"editing.error"})}))}).finally(()=>{this.destroy()})}destroy(){this.job?.destroy(),this.job=void 0,this.appModel.hideContent(`editing-${this.kind}`)}reset(){this.job?.reset()}createJob(){let e;return{destroy(){e?.stop(),e=void 0},reset(){e?.reset()},run:async()=>{const o=this.findLayer(),i=new URL(o.attributes.collectionURL+"/items");e=this.editingService.createFeature(this.map,i);const n=await e.whenComplete();if(e=void 0,!n)return;this.notificationService.notify({level:"info",message:this.intl.formatMessage({id:"editing.create.featureCreated"},{featureId:n.featureId})}),(o?.olLayer).getSource()?.refresh()}}}updateJob(){const e=this.map,o=new AbortController,i=o.signal;let n,a,s;function l(){a&&e.olMap.removeInteraction(a),a&&a.dispose(),n&&n.destroy(),o.abort(),a=void 0,n=void 0}return{destroy(){l(),s?.stop(),s=void 0},reset(){s?.reset()},run:async()=>{const c=this.findLayer(),m=c.olLayer,w=new URL(c.attributes.collectionURL+"/items");a=new ke({layers:[m]}),e.olMap.addInteraction(a),n=vt(this.intl,e.olMap),n.element.classList.remove("editing-tooltip-hidden");let f;for(;;){const{selected:P,deselected:W}=await xt(a,i);if(P.length===1&&W.length===0){l(),f=P[0];break}}if(!f)throw Error("Feature is undefined");s=this.editingService.updateFeature(e,w,f);const S=await s.whenComplete();S&&(this.notificationService.notify({level:"info",message:this.intl.formatMessage({id:"editing.update.featureModified"},{featureId:S.featureId})}),m.getSource()?.refresh())}}}findLayer(){const e=this.map.layers.getLayerById("krankenhaus");if(!e)throw new Error("Layer not found");return e}}function vt(r,e){const o=document.createElement("div");o.className="editing-tooltip editing-tooltip-hidden",o.textContent=r.formatMessage({id:"editing.update.tooltip.select"});const i=new Me({element:o,offset:[15,0],positioning:"center-left"}),n=e.on("pointermove",a=>{a.dragging||i.setPosition(a.coordinate)});return e.addOverlay(i),{overlay:i,element:o,destroy(){M(n),e.removeOverlay(i)}}}function xt(r,e){let o;const{promise:i,resolve:n,reject:a}=$();if(e.aborted)return a(A()),i;const s=()=>{o&&M(o),o=void 0,a(A())};return e.addEventListener("abort",s),o=r.on("select",l=>{e.removeEventListener("abort",s),o&&M(o),o=void 0,n(l)}),i}function wt(){const r=u();return t.jsxs(y,{role:"region","aria-label":r.formatMessage({id:"ariaLabel.footer"}),gap:3,alignItems:"center",justifyContent:"center",children:[t.jsx(je,{precision:2,displayProjectionCode:"EPSG:4326"}),t.jsx(Ce,{}),t.jsx(Le,{})]})}function St(){const r=p.useId(),e=u();return t.jsx(d,{role:"dialog","aria-labelledby":r,children:t.jsx(v,{title:t.jsx(x,{id:r,size:"md",mb:2,children:e.formatMessage({id:"legendTitle"})}),children:t.jsx(d,{overflowY:"auto",maxHeight:300,children:t.jsx(ze,{showBaseLayers:!0})})})})}function yt(r){return G({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M6.5 9.5l1.546 -1.311"},child:[]},{tag:"path",attr:{d:"M14 5.5l3 1.5"},child:[]},{tag:"path",attr:{d:"M18.5 10l-1.185 3.318m-1.062 2.972l-.253 .71"},child:[]},{tag:"path",attr:{d:"M13.5 17.5l-7 -5"},child:[]},{tag:"path",attr:{d:"M3 3l18 18"},child:[]}]})(r)}function kt(r){return G({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M6.5 9.5l3.5 -3"},child:[]},{tag:"path",attr:{d:"M14 5.5l3 1.5"},child:[]},{tag:"path",attr:{d:"M18.5 10l-2.5 7"},child:[]},{tag:"path",attr:{d:"M13.5 17.5l-7 -5"},child:[]}]})(r)}function Mt(){const r=u(),e=g("ol-app.AppModel"),o=b(()=>e.resultListState,[e]),i=o.open,{isTocActive:n,isLegendActive:a,isPrintingActive:s}=b(()=>({isTocActive:e.mainContent.includes("toc"),isLegendActive:e.mainContent.includes("legend"),isPrintingActive:e.mainContent.includes("printing")}),[e]);return t.jsxs(y,{role:"toolbar","aria-label":r.formatMessage({id:"ariaLabel.toolbar"}),direction:"column",gap:1,padding:1,children:[t.jsx(jt,{}),o.input&&t.jsx(h,{label:r.formatMessage({id:"resultListTitle"}),icon:t.jsx(me,{}),isActive:o.open,onClick:()=>e.setResultListVisibility(!i)}),t.jsx(h,{label:r.formatMessage({id:"tocTitle"}),icon:t.jsx(ge,{}),isActive:n,onClick:()=>e.toggleMainContent("toc")}),t.jsx(h,{label:r.formatMessage({id:"legendTitle"}),icon:t.jsx(he,{}),isActive:a,onClick:()=>e.toggleMainContent("legend")}),t.jsx(h,{label:r.formatMessage({id:"printingTitle"}),icon:t.jsx(fe,{}),isActive:s,onClick:()=>e.toggleMainContent("printing")}),t.jsx(We,{}),t.jsx(Ue,{}),t.jsx(Ke,{})]})}function jt(){const r=u(),e=g("ol-app.AppModel"),[o,i]=p.useState(!1),{isSelectionActive:n,isMeasurementActive:a,isEditingCreateActive:s,isEditingUpdateActive:l}=b(()=>({isSelectionActive:e.mainContent.includes("selection"),isMeasurementActive:e.mainContent.includes("measurement"),isEditingCreateActive:e.mainContent.includes("editing-create"),isEditingUpdateActive:e.mainContent.includes("editing-update")}),[e]),c=f=>()=>{f(),i(!1)},m={placement:"top"},w=t.jsxs(t.Fragment,{children:[t.jsx(h,{label:s?r.formatMessage({id:"editing.stopTitle"}):r.formatMessage({id:"editing.create.startTitle"}),icon:s?t.jsx(yt,{}):t.jsx(kt,{}),isActive:s,onClick:c(()=>e.toggleMainContent("editing-create")),tooltipProps:m}),t.jsx(h,{label:l?r.formatMessage({id:"editing.stopTitle"}):r.formatMessage({id:"editing.update.startTitle"}),icon:l?t.jsx(be,{}):t.jsx(ve,{}),isActive:l,onClick:c(()=>e.toggleMainContent("editing-update")),tooltipProps:m}),t.jsx(h,{label:r.formatMessage({id:"measurementTitle"}),icon:t.jsx(xe,{}),isActive:a,onClick:c(()=>e.toggleMainContent("measurement")),tooltipProps:m}),t.jsx(h,{label:r.formatMessage({id:"selectionTitle"}),icon:t.jsx(we,{}),isActive:n,onClick:c(()=>e.toggleMainContent("selection")),tooltipProps:m})]});return t.jsxs(Re,{placement:"left",isLazy:!0,onOpen:()=>i(!0),onClose:()=>i(!1),isOpen:o,children:[t.jsx(Ee,{children:t.jsx(Ct,{})}),t.jsx(Z,{children:t.jsxs(Fe,{width:"auto",children:[t.jsx(qe,{}),t.jsx(Ne,{children:t.jsx(H,{spacing:2,children:w})})]})})]})}const Ct=p.forwardRef(function(e,o){const i=u(),n=De(),{onClick:a,...s}=n.getTriggerProps();return t.jsx(h,{ref:o,label:i.formatMessage({id:"mapInteractions.title"}),icon:t.jsx(ue,{}),onClick:a,buttonProps:s})});function Lt(){const r=p.useId(),e=u();return t.jsx(d,{role:"dialog","aria-labelledby":r,children:t.jsx(v,{title:t.jsx(x,{id:r,size:"md",mb:2,children:e.formatMessage({id:"measurementTitle"})}),children:t.jsx(_e,{})})})}function zt(){const r=g("ol-app.AppModel"),e=b(()=>r.resultListState,[r]),[o,i]=p.useState([]),[n,a]=p.useState([]),s=p.useCallback(l=>{i(l.features),a(l.getFeatureIds())},[]);return p.useEffect(()=>{console.log("Anzahl Features: "+o.length),console.log("SelectedIds: "+n.toString())},[o,n]),e.input&&t.jsx(d,{className:"result-list-container",position:"absolute",visibility:e.open?"visible":"hidden",bottom:"0",backgroundColor:"white",width:"100%",height:"400px",zIndex:1,borderTop:"2px solid",borderBottom:"2px solid",borderColor:"trails.100",children:t.jsx(Ze,{input:e.input,onSelectionChange:s},e.key)})}function _t(){const{map:r}=L(),e=g("ol-app.AppModel"),o=b(()=>e.searchSources.getItems(),[e]);function i(a){if(console.debug("The user selected the following item: ",a.result),!r)return;const s=a.result.geometry;s&&e.highlightAndZoom(r,[s])}function n(){console.debug("The user cleared the search"),e.clearHighlight()}return t.jsx(d,{backgroundColor:"white",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",mt:5,className:"search-box",children:t.jsx(Pe,{sources:o,maxResultsPerGroup:10,onSelect:i,onClear:n})})}function Pt(){const r=u(),e=g("notifier.NotificationService"),o=p.useId(),{map:i}=L(),n=g("ol-app.AppModel"),a=b(()=>n.selectionSources.getItems(),[n]),s={numberOptions:{maximumFractionDigits:3},dateOptions:{dateStyle:"medium",timeStyle:"medium",timeZone:"UTC"}};function l(m){const{source:w,results:f}=m;if(!i){console.debug("Map not ready");return}const S=n.sourceMetadata.get(w);if(!S){console.warn("Can not show results because no metadata could be found");return}n.setResultListInput({columns:S,data:f,formatOptions:s}),e.notify({level:"info",message:r.formatMessage({id:"foundResults"},{resultsCount:f.length}),displayDuration:4e3})}function c(m){n.clearHighlight()}return t.jsx(d,{role:"dialog","aria-labelledby":o,children:t.jsx(v,{title:t.jsx(x,{id:o,size:"md",mb:2,children:r.formatMessage({id:"selectionTitle"})}),children:t.jsx(Ie,{sources:a,onSelectionComplete:l,onSelectionSourceChanged:c})})})}function It(){const r=p.useId(),e=u();return t.jsx(d,{role:"dialog","aria-labelledby":r,children:t.jsx(v,{title:t.jsx(x,{id:r,size:"md",mb:2,children:t.jsx(z,{children:e.formatMessage({id:"tocTitle"})})}),children:t.jsx(d,{overflowY:"auto",maxHeight:300,children:t.jsx(Ve,{showTools:!0,basemapSwitcherProps:{allowSelectingEmptyBasemap:!0}})})})})}function At(){const r=p.useId(),e=u();return t.jsx(d,{role:"dialog","aria-labelledby":r,children:t.jsx(v,{title:t.jsx(x,{id:r,size:"md",mb:2,children:e.formatMessage({id:"printingTitle"})}),children:t.jsx(Ae,{})})})}function Tt(){const r=u(),e=g("ol-app.AppModel"),{resultListState:o,mainContent:i}=b(()=>({resultListState:e.resultListState,mainContent:e.mainContent}),[e]),n=o.input&&o.open;return t.jsx(ce,{mapId:_,children:t.jsxs(y,{height:"100%",direction:"column",overflow:"hidden",children:[t.jsx(Te,{position:"top-right"}),t.jsxs(v,{title:t.jsx(d,{role:"region","aria-label":r.formatMessage({id:"ariaLabel.header"}),textAlign:"center",py:1,children:t.jsx(x,{size:"md",children:"Sample Application"})}),children:[t.jsx(y,{flex:"1",direction:"column",position:"relative",children:t.jsxs(pe,{role:"main","aria-label":r.formatMessage({id:"ariaLabel.map"}),viewPadding:n?{bottom:400}:void 0,children:[t.jsx(Ye,{centerContent:!0,children:t.jsx(_t,{})}),t.jsx(Dt,{mainContent:i}),t.jsx(de,{position:"bottom-right",horizontalGap:10,verticalGap:45,children:t.jsx(Mt,{})}),t.jsx(zt,{})]})}),t.jsx(wt,{})]})]})})}function Dt(r){const{mainContent:e}=r,o=p.useMemo(()=>{const i=n=>{switch(n){case"toc":return t.jsx(It,{},n);case"legend":return t.jsx(St,{},n);case"printing":return t.jsx(At,{},n);case"selection":return t.jsx(Pt,{},n);case"measurement":return t.jsx(Lt,{},n);case"editing-create":return t.jsx(F,{kind:"create"},n);case"editing-update":return t.jsx(F,{kind:"update"},n)}};return e.map(n=>i(n))},[e]);return t.jsx(Rt,{children:o})}function Rt(r){const e=r.children,o=[];for(const i of e)i&&(o.length&&o.push(t.jsx($e,{mt:4,mb:4},o.length)),o.push(i));if(o.length!==0)return t.jsx(d,{position:"absolute",top:"100px",left:4,maxHeight:"calc(100% - 140px)",width:350,maxWidth:350,zIndex:1,backgroundColor:"white",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",overflow:"auto",children:o})}const Et=new URLSearchParams(window.location.search),Ft=Et.get("lang")||void 0,qt=Y({component:Tt,appMetadata:gt,config:{locale:Ft,properties:{"@open-pioneer/local-storage":{storageId:"ol-app-state"}}}});customElements.define("ol-map-app",qt); diff --git a/openlayers-base-packages/pr-previews/pr-371/assets/CC4cg6c-thsW.js b/openlayers-base-packages/pr-previews/pr-371/assets/CC4cg6c-thsW.js new file mode 100644 index 0000000..46c06c7 --- /dev/null +++ b/openlayers-base-packages/pr-previews/pr-371/assets/CC4cg6c-thsW.js @@ -0,0 +1,4 @@ +var K=a=>{throw TypeError(a)};var j=(a,e,t)=>e.has(a)||K("Cannot "+t);var C=(a,e,t)=>(j(a,e,"read from private field"),t?t.call(a):e.get(a)),D=(a,e,t)=>e.has(a)?K("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(a):e.set(a,t),x=(a,e,t,i)=>(j(a,e,"write to private field"),i?i.call(a,t):e.set(a,t),t),W=(a,e,t)=>(j(a,e,"access private method"),t);import{h as ie,j as X,r as I,a0 as de,f as J,c as ue,b as fe}from"./Bh0CuZ3gy5tC.js";import{_ as ge}from"./CmsKOCeNyeyo.js";import{c5 as _e,c6 as me,z as pe,c7 as ye,c8 as Ce,c9 as we,bj as ke,ca as Te,bH as xe,bu as Q,bz as ve,a as Pe,b as Se,cb as Le,bn as Z,bG as De,cc as Ee,I as be,bs as w,cd as Me,a3 as Ie,bt as se,b3 as E,as as V,ce as ee,bC as Fe,at as Re,ar as ne,bF as Ne,cf as Oe,cg as re,ch as Ge,aP as Ue,aR as Ae,b5 as te,av as je}from"./CvR1K3f_Jx0o.js";import{a as We,b as oe,M as ae,G as Ve}from"./DoZQ59JZnzxi.js";import{L as U}from"./CKfDAIEslOW2.js";var z=ie(function(e,t){const{htmlWidth:i,htmlHeight:s,alt:r,...n}=e;return X.jsx("img",{width:i,height:s,ref:t,alt:r,...n})});z.displayName="NativeImage";function Be(a){const{loading:e,src:t,srcSet:i,onLoad:s,onError:r,crossOrigin:n,sizes:o,ignoreFallback:h}=a,[l,c]=I.useState("pending");I.useEffect(()=>{c(t?"loading":"pending")},[t]);const d=I.useRef(),u=I.useCallback(()=>{if(!t)return;f();const g=new Image;g.src=t,n&&(g.crossOrigin=n),i&&(g.srcset=i),o&&(g.sizes=o),e&&(g.loading=e),g.onload=_=>{f(),c("loaded"),s?.(_)},g.onerror=_=>{f(),c("failed"),r?.(_)},d.current=g},[t,n,i,o,s,r,e]),f=()=>{d.current&&(d.current.onload=null,d.current.onerror=null,d.current=null)};return de(()=>{if(!h)return l==="loading"&&u(),()=>{f()}},[l,u,h]),h?"loaded":l}var qe=(a,e)=>a!=="loaded"&&e==="beforeLoadOrError"||a==="failed"&&e==="onError";function He(a,e=[]){const t=Object.assign({},a);for(const i of e)i in t&&delete t[i];return t}var $e=ie(function(e,t){const{fallbackSrc:i,fallback:s,src:r,srcSet:n,align:o,fit:h,loading:l,ignoreFallback:c,crossOrigin:d,fallbackStrategy:u="beforeLoadOrError",referrerPolicy:f,...g}=e,_=i!==void 0||s!==void 0,m=l!=null||c||!_,T=Be({...e,crossOrigin:d,ignoreFallback:m}),k=qe(T,u),p={ref:t,objectFit:h,objectPosition:o,...m?g:He(g,["onError","onLoad"])};return k?s||X.jsx(J.img,{as:z,className:"chakra-image__placeholder",src:i,...p}):X.jsx(J.img,{as:z,src:r,srcSet:n,crossOrigin:d,loading:l,referrerPolicy:f,className:"chakra-image",...p})});$e.displayName="Image";class A extends _e{constructor(e,t,i){super(),i!==void 0&&t===void 0?this.setFlatCoordinates(i,e):(t=t||0,this.setCenterAndRadius(e,t,i))}clone(){const e=new A(this.flatCoordinates.slice(),void 0,this.layout);return e.applyProperties(this),e}closestPointXY(e,t,i,s){const r=this.flatCoordinates,n=e-r[0],o=t-r[1],h=n*n+o*o;if(h=i[0]||e[1]<=i[1]&&e[3]>=i[1]?!0:ye(e,this.intersectsCoordinate.bind(this))}return!1}setCenter(e){const t=this.stride,i=this.flatCoordinates[t]-this.flatCoordinates[0],s=e.slice();s[t]=s[0]+i;for(let r=1;r=t?a[e-t]:a[e]}function O(a,e,t){let i,s;en){const h=P(a,i),l=P(a,s);return N(h,l)}let o=0;if(iu.startIndex?_u.startIndex&&(_-=f.length)),h=_,o=d)}const l=e.targets[o];let c=l.ring;if(e.targetIndex===o&&c){const d=P(l.coordinates,h),u=t.getPixelFromCoordinate(d);se(u,e.startPx)>i&&(c=!1)}if(c){const d=l.coordinates,u=d.length,f=l.startIndex,g=h;if(f=t?i-=t:i<0&&(i+=t);let r=i+1;r>=t&&(r-=t);const n=a[i],o=n[0],h=n[1],l=a[r],c=l[0]-o,d=l[1]-h;return[o+c*s,h+d*s]}class Ye extends ke{constructor(e){const t=e;t.stopDown||(t.stopDown=Te),super(t),this.on,this.once,this.un,this.shouldHandle_=!1,this.downPx_=null,this.downTimeout_,this.lastDragTime_,this.pointerType_,this.freehand_=!1,this.source_=e.source?e.source:null,this.features_=e.features?e.features:null,this.snapTolerance_=e.snapTolerance?e.snapTolerance:12,this.type_=e.type,this.mode_=Je(this.type_),this.stopClick_=!!e.stopClick,this.minPoints_=e.minPoints?e.minPoints:this.mode_==="Polygon"?3:2,this.maxPoints_=this.mode_==="Circle"?2:e.maxPoints?e.maxPoints:1/0,this.finishCondition_=e.finishCondition?e.finishCondition:xe,this.geometryLayout_=e.geometryLayout?e.geometryLayout:"XY";let i=e.geometryFunction;if(!i){const s=this.mode_;if(s==="Circle")i=function(r,n,o){const h=n||new A([NaN,NaN]),l=Q(r[0]),c=ve(l,Q(r[r.length-1]));return h.setCenterAndRadius(l,Math.sqrt(c),this.geometryLayout_),h};else{let r;s==="Point"?r=V:s==="LineString"?r=U:s==="Polygon"&&(r=ne),i=function(n,o,h){return o?s==="Polygon"?n[0].length?o.setCoordinates([n[0].concat([n[0][0]])],this.geometryLayout_):o.setCoordinates([],this.geometryLayout_):o.setCoordinates(n,this.geometryLayout_):o=new r(n,this.geometryLayout_),o}}}this.geometryFunction_=i,this.dragVertexDelay_=e.dragVertexDelay!==void 0?e.dragVertexDelay:500,this.finishCoordinate_=null,this.sketchFeature_=null,this.sketchPoint_=null,this.sketchCoords_=null,this.sketchLine_=null,this.sketchLineCoords_=null,this.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,this.overlay_=new Pe({source:new Se({useSpatialIndex:!1,wrapX:e.wrapX?e.wrapX:!1}),style:e.style?e.style:Ke(),updateWhileInteracting:!0}),this.geometryName_=e.geometryName,this.condition_=e.condition?e.condition:Le,this.freehandCondition_,e.freehand?this.freehandCondition_=Z:this.freehandCondition_=e.freehandCondition?e.freehandCondition:De,this.traceCondition_,this.setTrace(e.trace||!1),this.traceState_={active:!1},this.traceSource_=e.traceSource||e.source||null,this.addChangeListener(Ee.ACTIVE,this.updateState_)}setTrace(e){let t;e?e===!0?t=Z:t=e:t=Ne,this.traceCondition_=t}setMap(e){super.setMap(e),this.updateState_()}getOverlay(){return this.overlay_}handleEvent(e){e.originalEvent.type===be.CONTEXTMENU&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!=="Point"&&this.freehandCondition_(e);let t=e.type===w.POINTERMOVE,i=!0;return!this.freehand_&&this.lastDragTime_&&e.type===w.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,t=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_!==void 0&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)),this.freehand_&&e.type===w.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(e.coordinate),i=!1):this.freehand_&&e.type===w.POINTERDOWN?i=!1:t&&this.getPointerCount()<2?(i=e.type===w.POINTERMOVE,i&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):(e.originalEvent.pointerType==="mouse"||e.type===w.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(e)):e.type===w.DBLCLICK&&(i=!1),super.handleEvent(e)&&i}handleDownEvent(e){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=e.pixel,this.finishCoordinate_||this.startDrawing_(e.coordinate),!0):this.condition_(e)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(()=>{this.handlePointerMove_(new Me(w.POINTERMOVE,e.map,e.originalEvent,!1,e.frameState))},this.dragVertexDelay_),this.downPx_=e.pixel,!0):(this.lastDragTime_=void 0,!1)}deactivateTrace_(){this.traceState_={active:!1}}toggleTraceState_(e){if(!this.traceSource_||!this.traceCondition_(e))return;if(this.traceState_.active){this.deactivateTrace_();return}const t=this.getMap(),i=t.getCoordinateFromPixel([e.pixel[0]-this.snapTolerance_,e.pixel[1]+this.snapTolerance_]),s=t.getCoordinateFromPixel([e.pixel[0]+this.snapTolerance_,e.pixel[1]-this.snapTolerance_]),r=Ie([i,s]),n=this.traceSource_.getFeaturesInExtent(r);if(n.length===0)return;const o=Xe(e.coordinate,n);o.length&&(this.traceState_={active:!0,startPx:e.pixel.slice(),targets:o,targetIndex:-1})}addOrRemoveTracedCoordinates_(e,t){const i=e.startIndex<=e.endIndex,s=e.startIndex<=t;i===s?i&&t>e.endIndex||!i&&te.endIndex)&&this.removeTracedCoordinates_(t,e.endIndex):(this.removeTracedCoordinates_(e.startIndex,e.endIndex),this.addTracedCoordinates_(e,e.startIndex,t))}removeTracedCoordinates_(e,t){if(e===t)return;let i=0;if(e0&&this.removeLastPoints_(i)}addTracedCoordinates_(e,t,i){if(t===i)return;const s=[];if(t=n;--o)s.push(v(e.coordinates,o))}s.length&&this.appendCoordinates(s)}updateTrace_(e){const t=this.traceState_;if(!t.active||t.targetIndex===-1&&se(t.startPx,e.pixel)this.squaredClickTolerance_:n<=this.squaredClickTolerance_,!this.shouldHandle_)return}if(!this.finishCoordinate_){this.createOrUpdateSketchPoint_(e.coordinate.slice());return}this.updateTrace_(e),this.modifyDrawing_(e.coordinate)}atFinish_(e,t){let i=!1;if(this.sketchFeature_){let s=!1,r=[this.finishCoordinate_];const n=this.mode_;if(n==="Point")i=!0;else if(n==="Circle")i=this.sketchCoords_.length===2;else if(n==="LineString")s=!t&&this.sketchCoords_.length>this.minPoints_;else if(n==="Polygon"){const o=this.sketchCoords_;s=o[0].length>this.minPoints_,r=[o[0][0],o[0][o[0].length-2]],t?r=[o[0][0]]:r=[o[0][0],o[0][o[0].length-2]]}if(s){const o=this.getMap();for(let h=0,l=r.length;h=this.maxPoints_&&(this.freehand_?r.pop():s=!0),r.push(e.slice()),this.geometryFunction_(r,t,i)):n==="Polygon"&&(r=this.sketchCoords_[0],r.length>=this.maxPoints_&&(this.freehand_?r.pop():s=!0),r.push(e.slice()),s&&(this.finishCoordinate_=r[0]),this.geometryFunction_(this.sketchCoords_,t,i)),this.createOrUpdateSketchPoint_(e.slice()),this.updateSketchFeatures_(),s?this.finishDrawing():this.sketchFeature_}removeLastPoints_(e){if(!this.sketchFeature_)return;const t=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),s=this.mode_;for(let r=0;r=2){this.finishCoordinate_=n[n.length-2].slice();const o=this.finishCoordinate_.slice();n[n.length-1]=o,this.createOrUpdateSketchPoint_(o)}this.geometryFunction_(n,t,i),t.getType()==="Polygon"&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(t)}else if(s==="Polygon"){n=this.sketchCoords_[0],n.splice(-2,1);const o=this.sketchLine_.getGeometry();if(n.length>=2){const h=n[n.length-2].slice();n[n.length-1]=h,this.createOrUpdateSketchPoint_(h)}o.setCoordinates(n),this.geometryFunction_(this.sketchCoords_,t,i)}if(n.length===1){this.abortDrawing();break}}this.updateSketchFeatures_()}removeLastPoint(){this.removeLastPoints_(1)}finishDrawing(){const e=this.abortDrawing_();if(!e)return null;let t=this.sketchCoords_;const i=e.getGeometry(),s=this.getMap().getView().getProjection();return this.mode_==="LineString"?(t.pop(),this.geometryFunction_(t,i,s)):this.mode_==="Polygon"&&(t[0].pop(),this.geometryFunction_(t,i,s),t=i.getCoordinates()),this.type_==="MultiPoint"?e.setGeometry(new We([t])):this.type_==="MultiLineString"?e.setGeometry(new oe([t])):this.type_==="MultiPolygon"&&e.setGeometry(new ae([t])),this.dispatchEvent(new R(F.DRAWEND,e)),this.features_&&this.features_.push(e),this.source_&&this.source_.addFeature(e),e}abortDrawing_(){this.finishCoordinate_=null;const e=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),this.deactivateTrace_(),e}abortDrawing(){const e=this.abortDrawing_();e&&this.dispatchEvent(new R(F.DRAWABORT,e))}appendCoordinates(e){const t=this.mode_,i=!this.sketchFeature_;i&&this.startDrawing_(e[0]);let s;if(t==="LineString"||t==="Circle")s=this.sketchCoords_;else if(t==="Polygon")s=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[];else return;i&&s.shift(),s.pop();for(let n=0;n component has likely been used twice in your application.`),{destroy(){}};x(this,y,e);const t=C(this,S);if(x(this,S,void 0),t)for(const[s,...r]of t)e[s](...r);let i=!1;return{destroy:()=>{i||(i=!0,C(this,y)===e&&x(this,y,void 0))}}}}y=new WeakMap,S=new WeakMap,M=new WeakMap,L=new WeakSet,Y=function(e,...t){if(C(this,y))C(this,y)[e](...t);else{const i=C(this,S)??x(this,S,[]);if(i.length>=1024){H.error(`Internal notification buffer overflow: this event will be dropped to prevent a memory leak. +Make sure that the UI is configured to display notifications (use ).`,{method:e,args:t});return}i.push([e,...t])}},Qe=function(){C(this,y)||H.warn(`No notification handler has been registered: notifications will not be visible. +Make sure that your app contains the component.`)};const $="units",Ze=[1,2,5],b=25.4/.28;class et extends Ue{constructor(e){e=e||{};const t=document.createElement("div");t.style.pointerEvents="none",super({element:t,render:e.render,target:e.target}),this.on,this.once,this.un;const i=e.className!==void 0?e.className:e.bar?"ol-scale-bar":"ol-scale-line";this.innerElement_=document.createElement("div"),this.innerElement_.className=i+"-inner",this.element.className=i+" "+Ae,this.element.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=e.minWidth!==void 0?e.minWidth:64,this.maxWidth_=e.maxWidth,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_="",this.addChangeListener($,this.handleUnitsChanged_),this.setUnits(e.units||"metric"),this.scaleBar_=e.bar||!1,this.scaleBarSteps_=e.steps||4,this.scaleBarText_=e.text||!1,this.dpi_=e.dpi||void 0}getUnits(){return this.get($)}handleUnitsChanged_(){this.updateElement_()}setUnits(e){this.set($,e)}setDpi(e){this.dpi_=e}updateElement_(){const e=this.viewState_;if(!e){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const t=e.center,i=e.projection,s=this.getUnits(),r=s=="degrees"?"degrees":"m";let n=te(i,e.resolution,t,r);const o=this.minWidth_*(this.dpi_||b)/b,h=this.maxWidth_!==void 0?this.maxWidth_*(this.dpi_||b)/b:void 0;let l=o*n,c="";if(s=="degrees"){const p=je.degrees;l*=p,l

=h){u=_,f=m,g=T;break}else if(f>=o)break;_=u,m=f,T=g,++d}const k=this.scaleBar_?this.createScaleBar(f,u,c):u.toFixed(g<0?-g:0)+" "+c;this.renderedHTML_!=k&&(this.innerElement_.innerHTML=k,this.renderedHTML_=k),this.renderedWidth_!=f&&(this.innerElement_.style.width=f+"px",this.renderedWidth_=f),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}createScaleBar(e,t,i){const s=this.getScaleForResolution(),r=s<1?Math.round(1/s).toLocaleString()+" : 1":"1 : "+Math.round(s).toLocaleString(),n=this.scaleBarSteps_,o=e/n,h=[this.createMarker("absolute")];for(let c=0;c

`+this.createMarker("relative")+(c%2===0||n===2?this.createStepText(c,e,!1,t,i):"")+"")}return h.push(this.createStepText(n,e,!0,t,i)),(this.scaleBarText_?`
`+r+"
":"")+h.join("")}createMarker(e){return`
`}createStepText(e,t,i,s,r){const o=(e===0?0:Math.round(s/this.scaleBarSteps_*e*100)/100)+(e===0?"":" "+r),h=e===0?-3:t/this.scaleBarSteps_*-1,l=e===0?0:t/this.scaleBarSteps_*2;return`
`+o+"
"}getScaleForResolution(){const e=te(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,"m"),t=this.dpi_||b,i=1e3/25.4;return e*i*t}render(e){const t=e.frameState;t?this.viewState_=t.viewState:this.viewState_=null,this.updateElement_()}}const tt=.8,ce="printing-hide";function it(a,e){return a.toDataURL("image/png",e??tt)}function st(a,e){const t=document.createElement("div");t.classList.add("printing-overlay",ce),a.appendChild(t);const i=document.createElement("div");return i.classList.add("printing-overlay-status"),i.textContent=e,t.appendChild(i),{destroy(){t.remove()}}}class ft{defaultOverlayText;constructor(e){this.defaultOverlayText=e.intl.formatMessage({id:"printingMap"})}async printMap(e,t){return await new nt(e,{blockUserInteraction:!0,overlayText:this.defaultOverlayText,viewPadding:"auto",...t}).printMap()}}class nt{olMap;blockUserInteraction=!1;overlayText;viewPadding;running=!1;drawInformation=[];scaleLine=void 0;overlay=void 0;constructor(e,t){this.olMap=e,this.blockUserInteraction=t.blockUserInteraction,this.overlayText=t.overlayText,this.viewPadding=t.viewPadding}async printMap(){if(this.running)throw new Error("Printing already running.");try{await this.beginExport();let e=await this.printToCanvas(this.olMap.getViewport());if(!e)throw new Error("Canvas export failed");return this.viewPadding==="auto"&&(e=this.removePadding(e,this.getViewPadding())),new rt(e)}finally{this.reset()}}async beginExport(){this.running=!0;const e=this.olMap.getInteractions().getArray().filter(t=>t.getActive()&&t instanceof Ye);if(this.drawInformation=[],e?.forEach(t=>{const i=t,s=i.getOverlay().getStyle();i.getOverlay().setStyle(null),this.drawInformation?.push({draw:i,style:s})}),this.blockUserInteraction){const t=this.olMap?.getTargetElement();t&&(this.overlay=st(t,this.overlayText))}await this.addScaleLine()}async addScaleLine(){const t=(this.scaleLine=new et({className:"printing-scale-bar ol-scale-bar",bar:!0,text:!0,minWidth:125})).element;if(!t)throw new Error("Scale line does not have an element");let i=50,s=8;if(this.viewPadding==="auto"){const{bottom:h,left:l}=this.getViewPadding();i=Math.max(h+8,i),s+=l}t.style.setProperty("--printing-scale-bar-bottom",`${i}px`),t.style.setProperty("--printing-scale-bar-left",`${s}px`);const r=fe(),n=setTimeout(()=>{r.reject(new Error("Scale line did not render"))},3e3),o=this.scaleLine.render;this.scaleLine.render=(...h)=>{o.apply(this.scaleLine,h),r.resolve()},this.olMap?.addControl(this.scaleLine);try{await r.promise,await new Promise(h=>{requestAnimationFrame(h)})}finally{clearTimeout(n)}}async printToCanvas(e){const t={useCORS:!0,ignoreElements:function(r){if(r.classList&&typeof r.classList=="object"){const n=r.classList;return n.contains("map-anchors")||n.contains(ce)}return!1}},i=(await ge(async()=>{const{default:r}=await import("./BfxBtG_Oxhhm.js");return{default:r}},[],import.meta.url)).default;return await i(e,t)}reset(){this.scaleLine&&(this.olMap?.removeControl(this.scaleLine),this.scaleLine=void 0),this.overlay&&(this.overlay.destroy(),this.overlay=void 0),this.running=!1,this.drawInformation?.length&&this.drawInformation.forEach(e=>{e.draw.getOverlay().setStyle(e.style)})}removePadding(e,t){const i=window.devicePixelRatio||1,s={top:t.top*i,right:t.right*i,bottom:t.bottom*i,left:t.left*i};if(s.left===0&&s.right===0&&s.top===0&&s.bottom===0)return e;const{width:r,height:n}=e,o=document.createElement("canvas");o.width=r-s.left-s.right,o.height=n-s.top-s.bottom;const h=o.getContext("2d");if(!h)throw new Error("Failed to get a canvas context");return h.drawImage(e,s.left,s.top,o.width,o.height,0,0,o.width,o.height),o}getViewPadding(){const t=this.olMap.getView().padding??[0,0,0,0];return{top:t[0]??0,right:t[1]??0,bottom:t[2]??0,left:t[3]??0}}}class rt{canvas;constructor(e){this.canvas=e}getCanvas(){return this.canvas}getPNGDataURL(e){return it(this.canvas,e)}}export{Ye as D,$e as I,ut as N,ft as P,et as S,it as a,st as c}; diff --git a/openlayers-base-packages/pr-previews/pr-371/assets/nU189nNlc4J5.js b/openlayers-base-packages/pr-previews/pr-371/assets/CE2h5gQ2FaWn.js similarity index 96% rename from openlayers-base-packages/pr-previews/pr-371/assets/nU189nNlc4J5.js rename to openlayers-base-packages/pr-previews/pr-371/assets/CE2h5gQ2FaWn.js index dbc9046..034e882 100644 --- a/openlayers-base-packages/pr-previews/pr-371/assets/nU189nNlc4J5.js +++ b/openlayers-base-packages/pr-previews/pr-371/assets/CE2h5gQ2FaWn.js @@ -1 +1 @@ -var Ft=Object.defineProperty;var Xe=o=>{throw TypeError(o)};var Bt=(o,e,t)=>e in o?Ft(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var w=(o,e,t)=>Bt(o,typeof e!="symbol"?e+"":e,t),Ne=(o,e,t)=>e.has(o)||Xe("Cannot "+t);var a=(o,e,t)=>(Ne(o,e,"read from private field"),t?t.call(o):e.get(o)),u=(o,e,t)=>e.has(o)?Xe("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),h=(o,e,t,i)=>(Ne(o,e,"write to private field"),i?i.call(o,t):e.set(o,t),t),x=(o,e,t)=>(Ne(o,e,"access private method"),t);import{f as ft,h as Gt,j as r,r as b,c as we,B as Y,F as Ht,A as Ve,k as Oe,l as Ut,E as j,a as Wt,e as qt}from"./Bh0CuZ3gy5tC.js";import{aJ as $t,aK as Kt,X as Yt,W as Je,aL as Zt,aM as Xt,at as Jt,aN as Qt,aO as eo,aP as to,I as oo,ax as io,aQ as Qe,aR as ro,aS as so,aT as et,aU as ao,aV as no,aW as ze,V as lo,aX as tt,a1 as co,a7 as po,aY as uo,a5 as ho,aZ as mo,a_ as go,a$ as fo,b0 as vo,b1 as ot,B as R,S as Ue,T as vt,O as bt,a as We,b as wt,b2 as je,i as Te,f as qe,u as Pe,r as re,b3 as it,b4 as bo,as as wo,j as Be,c as yt,C as yo,F as xt,aC as kt,b5 as xo,d as ko,w as $e,b6 as So,b7 as Mo,b8 as _o,k as F,b9 as Io,g as Se,h as Ge,ba as Eo,bb as Co,H as Lo,M as Ao,D as jo,l as To,m as rt}from"./CvR1K3f_Jx0o.js";import{W as Po,i as Ro,j as St}from"./DNeIgqfIWVUM.js";import{O as Mt,W as Do,c as No,u as Vo,I as Oo,C as zo,b as Fo,a as Bo,M as Go,P as Ho,L as Uo,d as Wo,S as qo,E as $o,V as Ko,e as _t,N as Yo}from"./DOPSNmhp3Yv8.js";import{G as It,T as Zo,e as Xo}from"./CDZlakCE4enr.js";import{T as Re,V as He,L as Jo}from"./Tz2xttM4F6S2.js";import{u as $}from"./B1-t77dlZFnS.js";import{G as Qo}from"./CL_VRsbiqLzM.js";import{Z as ei,a as ti,H as oi,b as ii,I as ri,V as si,S as ai}from"./Cn6jOzlRJRDP.js";import{c as ni}from"./D03oE8cEQPSj.js";import{M as li,a as ci,b as di}from"./BeFcF3Ti4kY-.js";import{M as pi}from"./DUys4rac0YQP.js";import{S as ui}from"./CjjyePfBQlZ7.js";import{R as hi}from"./CxxdN3Z_jMxj.js";import{N as mi,P as gi}from"./D5SiXzFLvedX.js";import{_ as st}from"./CmsKOCeNyeyo.js";import{F as fi}from"./BO_q12Vdyug-.js";import{H as vi}from"./L25RkWOQSN8A.js";import{F as bi}from"./CreVQ-qFRzOc.js";import"./DoZQ59JZnzxi.js";import"./CKfDAIEslOW2.js";import"./Cq1ZpfgEg4XJ.js";import"./2d5-QpxJNHTD.js";var Et=ft("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});Et.displayName="Center";var wi={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}};Gt(function(e,t){const{axis:i="both",...s}=e;return r.jsx(ft.div,{ref:t,__css:wi[i],...s,position:"absolute"})});const f={ACCURACY:"accuracy",ACCURACY_GEOMETRY:"accuracyGeometry",ALTITUDE:"altitude",ALTITUDE_ACCURACY:"altitudeAccuracy",HEADING:"heading",POSITION:"position",PROJECTION:"projection",SPEED:"speed",TRACKING:"tracking",TRACKING_OPTIONS:"trackingOptions"},yi={ERROR:"error"};class xi extends Jt{constructor(e){super(yi.ERROR),this.code=e.code,this.message=e.message}}let ki=class extends $t{constructor(e){super(),this.on,this.once,this.un,e=e||{},this.position_=null,this.transform_=Kt,this.watchId_=void 0,this.addChangeListener(f.PROJECTION,this.handleProjectionChanged_),this.addChangeListener(f.TRACKING,this.handleTrackingChanged_),e.projection!==void 0&&this.setProjection(e.projection),e.trackingOptions!==void 0&&this.setTrackingOptions(e.trackingOptions),this.setTracking(e.tracking!==void 0?e.tracking:!1)}disposeInternal(){this.setTracking(!1),super.disposeInternal()}handleProjectionChanged_(){const e=this.getProjection();e&&(this.transform_=Yt(Je("EPSG:4326"),e),this.position_&&this.set(f.POSITION,this.transform_(this.position_)))}handleTrackingChanged_(){if("geolocation"in navigator){const e=this.getTracking();e&&this.watchId_===void 0?this.watchId_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions()):!e&&this.watchId_!==void 0&&(navigator.geolocation.clearWatch(this.watchId_),this.watchId_=void 0)}}positionChange_(e){const t=e.coords;this.set(f.ACCURACY,t.accuracy),this.set(f.ALTITUDE,t.altitude===null?void 0:t.altitude),this.set(f.ALTITUDE_ACCURACY,t.altitudeAccuracy===null?void 0:t.altitudeAccuracy),this.set(f.HEADING,t.heading===null?void 0:Zt(t.heading)),this.position_?(this.position_[0]=t.longitude,this.position_[1]=t.latitude):this.position_=[t.longitude,t.latitude];const i=this.transform_(this.position_);this.set(f.POSITION,i.slice()),this.set(f.SPEED,t.speed===null?void 0:t.speed);const s=Xt(this.position_,t.accuracy);s.applyTransform(this.transform_),this.set(f.ACCURACY_GEOMETRY,s),this.changed()}positionError_(e){this.dispatchEvent(new xi(e))}getAccuracy(){return this.get(f.ACCURACY)}getAccuracyGeometry(){return this.get(f.ACCURACY_GEOMETRY)||null}getAltitude(){return this.get(f.ALTITUDE)}getAltitudeAccuracy(){return this.get(f.ALTITUDE_ACCURACY)}getHeading(){return this.get(f.HEADING)}getPosition(){return this.get(f.POSITION)}getProjection(){return this.get(f.PROJECTION)}getSpeed(){return this.get(f.SPEED)}getTracking(){return this.get(f.TRACKING)}getTrackingOptions(){return this.get(f.TRACKING_OPTIONS)}setProjection(e){this.set(f.PROJECTION,Je(e))}setTracking(e){this.set(f.TRACKING,e)}setTrackingOptions(e){this.set(f.TRACKING_OPTIONS,e)}};const Si=1.2;function Mi(o,e=Si){_i(o);const t=Qt(o),i=eo(o),s=t*e,n=i*e;return[o[0]-(s-t)/2,o[1]-(n-i)/2,o[2]+(s-t)/2,o[3]+(n-i)/2]}function _i(o){if(o.length!==4)throw new Error(`Invalid extent (expected length 4, but got length ${o.length}).`)}const Fe=.75,ke=.1;let Ii=class extends to{constructor(e){e=e||{},super({element:document.createElement("div"),render:e.render,target:e.target}),this.boundHandleRotationChanged_=this.handleRotationChanged_.bind(this),this.collapsed_=e.collapsed!==void 0?e.collapsed:!0,this.collapsible_=e.collapsible!==void 0?e.collapsible:!0,this.collapsible_||(this.collapsed_=!1),this.rotateWithView_=e.rotateWithView!==void 0?e.rotateWithView:!1,this.viewExtent_=void 0;const t=e.className!==void 0?e.className:"ol-overviewmap",i=e.tipLabel!==void 0?e.tipLabel:"Overview map",s=e.collapseLabel!==void 0?e.collapseLabel:"‹";typeof s=="string"?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=s):this.collapseLabel_=s;const n=e.label!==void 0?e.label:"›";typeof n=="string"?(this.label_=document.createElement("span"),this.label_.textContent=n):this.label_=n;const l=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_,c=document.createElement("button");c.setAttribute("type","button"),c.title=i,c.appendChild(l),c.addEventListener(oo.CLICK,this.handleClick_.bind(this),!1),this.ovmapDiv_=document.createElement("div"),this.ovmapDiv_.className="ol-overviewmap-map",this.view_=e.view;const d=new io({view:e.view,controls:new Qe,interactions:new Qe});this.ovmap_=d,e.layers&&e.layers.forEach(function(I){d.addLayer(I)});const p=document.createElement("div");p.className="ol-overviewmap-box",p.style.boxSizing="border-box",this.boxOverlay_=new Mt({position:[0,0],positioning:"center-center",element:p}),this.ovmap_.addOverlay(this.boxOverlay_);const g=t+" "+ro+" "+so+(this.collapsed_&&this.collapsible_?" "+et:"")+(this.collapsible_?"":" ol-uncollapsible"),m=this.element;m.className=g,m.appendChild(this.ovmapDiv_),m.appendChild(c);const v=this,S=this.boxOverlay_,M=this.boxOverlay_.getElement(),ce=function(I){return{clientX:I.clientX,clientY:I.clientY}},ye=function(I){const E=ce(I),Ze=d.getEventCoordinateInternal(E);S.setPosition(Ze)},xe=function(I){const E=d.getEventCoordinateInternal(I);v.getMap().getView().setCenterInternal(E),window.removeEventListener("mousemove",ye),window.removeEventListener("mouseup",xe)};M.addEventListener("mousedown",function(){window.addEventListener("mousemove",ye),window.addEventListener("mouseup",xe)})}setMap(e){const t=this.getMap();if(e!==t){if(t){const i=t.getView();i&&this.unbindView_(i),this.ovmap_.setTarget(null)}if(super.setMap(e),e){this.ovmap_.setTarget(this.ovmapDiv_),this.listenerKeys.push(ao(e,no.PROPERTYCHANGE,this.handleMapPropertyChange_,this));const i=e.getView();i&&(this.bindView_(i),i.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_())),this.ovmap_.isRendered()||this.updateBoxAfterOvmapIsRendered_()}}}handleMapPropertyChange_(e){if(e.key===ze.VIEW){const t=e.oldValue;t&&this.unbindView_(t);const i=this.getMap().getView();this.bindView_(i)}else!this.ovmap_.isRendered()&&(e.key===ze.TARGET||e.key===ze.SIZE)&&this.ovmap_.updateSize()}bindView_(e){if(!this.view_){const t=new lo({projection:e.getProjection()});this.ovmap_.setView(t)}e.addChangeListener(tt.ROTATION,this.boundHandleRotationChanged_),this.handleRotationChanged_()}unbindView_(e){e.removeChangeListener(tt.ROTATION,this.boundHandleRotationChanged_)}handleRotationChanged_(){this.rotateWithView_&&this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())}validateExtent_(){const e=this.getMap(),t=this.ovmap_;if(!e.isRendered()||!t.isRendered())return;const i=e.getSize(),n=e.getView().calculateExtentInternal(i);if(this.viewExtent_&&co(n,this.viewExtent_))return;this.viewExtent_=n;const l=t.getSize(),d=t.getView().calculateExtentInternal(l),p=t.getPixelFromCoordinateInternal(po(n)),g=t.getPixelFromCoordinateInternal(uo(n)),m=Math.abs(p[0]-g[0]),v=Math.abs(p[1]-g[1]),S=l[0],M=l[1];mS*Fe||v>M*Fe?this.resetExtent_():ho(d,n)||this.recenter_()}resetExtent_(){const e=this.getMap(),t=this.ovmap_,i=e.getSize(),n=e.getView().calculateExtentInternal(i),l=t.getView(),c=Math.log(Fe/ke)/Math.LN2,d=1/(Math.pow(2,c/2)*ke);mo(n,d),l.fitInternal(go(n))}recenter_(){const e=this.getMap(),t=this.ovmap_,i=e.getView();t.getView().setCenterInternal(i.getCenterInternal())}updateBox_(){const e=this.getMap(),t=this.ovmap_;if(!e.isRendered()||!t.isRendered())return;const i=e.getSize(),s=e.getView(),n=t.getView(),l=this.rotateWithView_?0:-s.getRotation(),c=this.boxOverlay_,d=this.boxOverlay_.getElement(),p=s.getCenterInternal(),g=s.getResolution(),m=n.getResolution(),v=i[0]*g/m,S=i[1]*g/m;if(c.setPosition(p),d){d.style.width=v+"px",d.style.height=S+"px";const M="rotate("+l+"rad)";d.style.transform=M}}updateBoxAfterOvmapIsRendered_(){this.ovmapPostrenderKey_||(this.ovmapPostrenderKey_=fo(this.ovmap_,vo.POSTRENDER,function(e){delete this.ovmapPostrenderKey_,this.updateBox_()},this))}handleClick_(e){e.preventDefault(),this.handleToggle_()}handleToggle_(){this.element.classList.toggle(et),this.collapsed_?ot(this.collapseLabel_,this.label_):ot(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_;const e=this.ovmap_;if(!this.collapsed_){if(e.isRendered()){this.viewExtent_=void 0,e.render();return}e.updateSize(),this.resetExtent_(),this.updateBoxAfterOvmapIsRendered_()}}getCollapsible(){return this.collapsible_}setCollapsible(e){this.collapsible_!==e&&(this.collapsible_=e,this.element.classList.toggle("ol-uncollapsible"),!e&&this.collapsed_&&this.handleToggle_())}setCollapsed(e){!this.collapsible_||this.collapsed_===e||this.handleToggle_()}getCollapsed(){return this.collapsed_}getRotateWithView(){return this.rotateWithView_}setRotateWithView(e){this.rotateWithView_!==e&&(this.rotateWithView_=e,this.getMap().getView().getRotation()!==0&&(this.rotateWithView_?this.handleRotationChanged_():this.ovmap_.getView().setRotation(0),this.viewExtent_=void 0,this.validateExtent_(),this.updateBox_()))}getOverviewMap(){return this.ovmap_}render(e){this.validateExtent_(),this.updateBox_()}};const Ei=ni({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"}),Ci={height:"25px",width:"25px",borderColor:"#4cb3ff",borderWidth:"3px",borderRadius:"50%",display:"inline-block "};function Li(o){return r.jsxs(R,{children:[r.jsx(Re,{children:o.layer.title}),r.jsx(R,{style:Ci})]})}const De="main";class Ai{mapId=De;vectorSourceFactory;constructor(e){this.vectorSourceFactory=e.references.vectorSourceFactory}async getMapConfig(){return{initialView:{kind:"position",center:{x:823091,y:6724521},zoom:8},layers:[new Ue({title:"OSM",id:"osm",isBaseLayer:!0,olLayer:new vt({source:new bt})}),new Do({isBaseLayer:!0,title:"Orthofotos NRW",url:"https://www.wmts.nrw.de/geobasis/wmts_nw_dop/1.0.0/WMTSCapabilities.xml",name:"nw_dop",matrixSet:"EPSG_3857_16",sourceOptions:{attributions:'Die Geobasisdaten des amtlichen Vermessungswesens werden als öffentliche Aufgabe gem. VermKatG NRW und gebührenfrei nach Open Data-Prinzipien über online-Verfahren bereitgestellt. Nutzungsbedingungen: siehe '}}),Pi(),Ti(),ji(this.vectorSourceFactory)]}}}function ji(o){const e="https://ogc-api-test.nrw.de/inspire-us-krankenhaus/v1",t="governmentalservice",i=o.createVectorSource({baseUrl:e,collectionId:t,limit:1e3,crs:"http://www.opengis.net/def/crs/EPSG/0/3857",attributions:`Land NRW (${new Date().getFullYear()}), Datenlizenz Deutschland - Namensnennung - Version 2.0, Datenquelle`}),s=new We({source:i});return new Ue({id:"krankenhaus",title:"Krankenhäuser-Demo-Dienst",visible:!1,olLayer:s,attributes:{collectionURL:e+"/collections/"+t}})}function Ti(){const o=new wt({url:"https://ogc-api.nrw.de/inspire-us-kindergarten/v1/collections/governmentalservice/items?f=json&limit=10000",format:new It,attributions:'© Bundesamt für Kartographie und Geodäsie 2017, Datenquellen'}),e=new We({source:o}),t={Component:Li};return new Ue({id:"ogc_kitas",title:"Kindertagesstätten",visible:!0,olLayer:e,attributes:{legend:t}})}function Pi(){return new Po({title:"Verwaltungsgebiete",id:"verwaltungsgebiete",visible:!1,url:"https://www.wms.nrw.de/geobasis/wms_nw_dvg",sublayers:[{name:"nw_dvg_krs",title:"Kreise und kreisfreie Städte"}]})}const Ri="200px",Di="300px",Ni=o=>{const{olLayer:e,height:t=Ri,width:i=Di}=o,{containerProps:s}=je("overview-map",o),n=b.useRef(null),{map:l}=Te(o);return b.useEffect(()=>{if(n.current&&l&&e){const c=l.olMap,d=new Ii({className:"ol-overviewmap",layers:[e],collapsible:!1,collapsed:!1,target:n.current});return c.addControl(d),()=>{c.removeControl(d)}}},[l,e]),r.jsx(R,{height:t,width:i,ref:n,...s})};function Vi({intl:o}){return{id:"overviewMap",title:o.formatMessage({id:"demos.overviewMap.title"}),createModel(){const e=new vt({source:new bt});return{description:o.formatMessage({id:"demos.overviewMap.description"}),mainWidget:r.jsx(Ni,{olLayer:e}),destroy(){e.dispose()}}}}}class Oi{label;filteredTypes;httpService;constructor(e,t,i){this.label=e,this.filteredTypes=t,this.httpService=i}async search(e,{mapProjection:t,signal:i}){const s=await this.request(e,100,i),n=new It({dataProjection:"EPSG:4326",featureProjection:t});return s.features.filter(l=>this.filteredTypes.includes(l.properties.type)).map((l,c)=>{const d=n.readGeometry(l.geometry);return{id:l.properties.osm_id||c,label:this.createLabel(l),geometry:d,properties:l.properties}})}async request(e,t,i){const s=new URL("https://photon.komoot.io/api?");s.searchParams.set("q",e),s.searchParams.set("lang","de"),s.searchParams.set("lat","51.961563"),s.searchParams.set("lon","7.628202"),s.searchParams.set("limit",t.toString());const n=await this.httpService.fetch(s,{signal:i});if(!n.ok)throw new Error("Request failed: "+n.status);return await n.json()}createLabel(e){return`${e.properties.name} (${e.properties.osm_value?e.properties.osm_value+", ":""}${e.properties.postcode?e.properties.postcode+", ":""}${e.properties.city?e.properties.city+", ":""}${e.properties.country?e.properties.country+")":")"}`}}function zi({intl:o,httpService:e,mapModel:t}){return{id:"searchAndHighlight",title:o.formatMessage({id:"demos.searchAndHighlight.title"}),createModel(){return new Fi(o,t,e)}}}var pe,ue,Z,Me,X,mt;let Fi=(mt=class{constructor(e,t,i){u(this,pe);u(this,ue);u(this,Z);w(this,"description");w(this,"mainWidget");u(this,Me,e=>{const t=e.result.geometry;t&&(a(this,X).call(this),h(this,Z,Bi(a(this,ue),[t])))});u(this,X,()=>{a(this,Z)?.destroy(),h(this,Z,void 0)});h(this,pe,new Oi("Photon Geocoder",["city","street"],i)),h(this,ue,t),this.description=e.formatMessage({id:"demos.searchAndHighlight.description"}),this.mainWidget=r.jsx(No,{sources:[a(this,pe)],onSelect:a(this,Me),onClear:a(this,X)})}destroy(){a(this,X).call(this)}},pe=new WeakMap,ue=new WeakMap,Z=new WeakMap,Me=new WeakMap,X=new WeakMap,mt);function Bi(o,e){const t=o.olMap.getViewport();return o.highlightAndZoom(e,{viewPadding:t&&t.offsetWidth<1e3?{top:150,right:75,bottom:50,left:75}:{top:150,right:400,bottom:50,left:400}})}const Ct="@open-pioneer/geolocation",Gi=qe.bind(void 0,Ct),Lt=Pe.bind(void 0,Ct);function Hi(o){return Qo({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm8.94 3A8.994 8.994 0 0 0 13 3.06V1h-2v2.06A8.994 8.994 0 0 0 3.06 11H1v2h2.06A8.994 8.994 0 0 0 11 20.94V23h2v-2.06A8.994 8.994 0 0 0 20.94 13H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"},child:[]}]})(o)}const at=we("geolocation:GeolocationController"),nt=17;var B,G;class Ui{constructor(e,t,i){w(this,"supported",!!navigator.geolocation);w(this,"olMap");w(this,"positionHighlightLayer");w(this,"geolocation");w(this,"onError");w(this,"maxZoom",nt);w(this,"accuracyFeature");w(this,"positionFeature");w(this,"changeHandlers",[]);w(this,"setMapToPosition",!0);w(this,"trackingOptions",{});w(this,"isInitialZoom",!0);u(this,B,re(!1));u(this,G,re(!1));this.olMap=e,this.onError=t,this.isInitialZoom=!0,this.accuracyFeature=new it,this.accuracyFeature.setStyle(ct()),this.positionFeature=new it,this.positionFeature.setStyle(lt()),this.positionHighlightLayer=new We({source:new wt({features:[this.accuracyFeature,this.positionFeature]})}),this.positionHighlightLayer.setZIndex(bo);const s=i||Wi();this.geolocation=new ki({tracking:!1,trackingOptions:s,projection:e.getView()?.getProjection()}),this.trackingOptions=s,this.geolocation.on("error",n=>this.handleGeolocationError(n))}destroy(){this.stopGeolocation(),this.geolocation?.setTracking(!1),this.geolocation.dispose(),this.accuracyFeature=void 0,this.positionFeature=void 0,this.positionHighlightLayer.dispose()}startGeolocation(){if(a(this,G).value)return;const e=this.olMap;new Promise(i=>{a(this,G).value=!0,a(this,B).value=!0,this.geolocation?.setProjection(e.getView()?.getProjection()),this.geolocation?.setTracking(!0);const s=this.geolocation.on("change:accuracyGeometry",()=>{const d=this.geolocation.getAccuracyGeometry()||void 0;if(this.accuracyFeature?.setGeometry(d),this.accuracyFeature?.getGeometry()!==void 0&&i(),this.isInitialZoom){const p=this?.accuracyFeature?.getGeometry()?.getExtent();if(p){const g=Mi(p);if(!g)return;e.getView().fit(g,{maxZoom:this.maxZoom}),this.isInitialZoom=!1}}}),n=this.geolocation.on("change:position",()=>{const d=this.geolocation.getPosition();d&&(d[0]||d[1])!==void 0&&(this.positionFeature?.setGeometry(new wo(d)),this.setMapToPosition&&e.getView().setCenter(d),this.positionFeature?.getGeometry()!==void 0&&i())}),l=e.getView().on("change:resolution",()=>{this.setMapToPosition=this.isInitialZoom}),c=e.on("pointermove",d=>{d.dragging&&(this.setMapToPosition=!1)});this.changeHandlers.push(s,n,l,c),e.addLayer(this.positionHighlightLayer)}).then(()=>{a(this,B).value=!1}).catch(i=>{at.error("Failed to determine location",i)})}stopGeolocation(){this.geolocation?.setTracking(!1),a(this,G).value=!1,a(this,B).value=!1,this.trackingOptions={},this.setMapToPosition=!0,this.isInitialZoom=!0,this.changeHandlers.forEach(e=>{Be(e)}),this.changeHandlers=[],this.accuracyFeature?.setGeometry(void 0),this.positionFeature?.setGeometry(void 0),this.olMap.removeLayer(this.positionHighlightLayer)}get active(){return a(this,G).value}get loading(){return a(this,B).value}setPositionFeatureStyle(e){this.positionFeature?.setStyle(e??lt())}setAccuracyFeatureStyle(e){this.accuracyFeature?.setStyle(e??ct())}setMaxZoom(e){this.maxZoom=e??nt}getMaxZoom(){return this.maxZoom}getPositionFeature(){return this.positionFeature}getAccuracyFeature(){return this.accuracyFeature}getTrackingOptions(){return this.trackingOptions}getGeolocation(){return this.geolocation}handleGeolocationError(e){at.error("Error from geolocation API:",e.message),this.stopGeolocation();const t=(()=>{switch(e.code){case 1:return"permission-denied";case 2:return"position-unavailable";case 3:return"timeout";default:return"unknown"}})();this.onError(t)}}B=new WeakMap,G=new WeakMap;const lt=()=>new yt({image:new yo({radius:6,fill:new xt({color:"#3399CC"}),stroke:new kt({color:"#fff",width:2})})}),ct=()=>new yt({stroke:new kt({color:"#3399CC",width:3}),fill:new xt({color:"rgba(0, 0, 255, 0.05)"})}),Wi=()=>({enableHighAccuracy:!0,timeout:6e4,maximumAge:6e5}),qi=b.forwardRef(function(e,t){const{maxZoom:i,positionFeatureStyle:s,accuracyFeatureStyle:n,trackingOptions:l}=e,{map:c}=Te(e),d=Ki(c,i,l,s,n);return d&&r.jsx($i,{...e,controller:d,ref:t})}),$i=b.forwardRef(function(e,t){const{controller:i}=e,{containerProps:s}=je("geolocation",e),{isLoading:n,isActive:l}=$(()=>({isLoading:i.loading,isActive:i.active}),[i]),c=Lt(),d=i.supported?l?c.formatMessage({id:"locateMeEnd"}):c.formatMessage({id:"locateMeStart"}):c.formatMessage({id:"locateNotSupported"}),p=()=>{i.active?i.stopGeolocation():i.startGeolocation()};return r.jsx(Zo,{ref:t,label:d,icon:r.jsx(Hi,{}),onClick:()=>p(),isActive:l,isLoading:n,isDisabled:!i.supported,...s})});function Ki(o,e,t,i,s){const n=Lt(),l=Gi("notifier.NotificationService"),[c,d]=b.useState();return b.useEffect(()=>{if(!o)return;const p=m=>{const v=n.formatMessage({id:"error"}),S=(()=>{switch(m){case"permission-denied":return n.formatMessage({id:"permissionDenied"});case"position-unavailable":return n.formatMessage({id:"positionUnavailable"});case"timeout":return n.formatMessage({id:"timeout"});case"unknown":return n.formatMessage({id:"unknownError"})}})();l.notify({level:"error",title:v,message:S})},g=new Ui(o.olMap,p,t);return d(g),()=>{g.destroy(),d(void 0)}},[o,t,n,l]),b.useEffect(()=>{c?.setPositionFeatureStyle(i)},[c,i]),b.useEffect(()=>{c?.setAccuracyFeatureStyle(s)},[c,s]),b.useEffect(()=>{c?.setMaxZoom(e)},[c,e]),c}const Yi="@open-pioneer/scale-setter",Zi=Pe.bind(void 0,Yi),Xi=25.4/.28,Ji=39.37,Qi=[17471320,8735660,4367830,2183915,1091957,545978,272989,136494,68247,34123,17061,8530,4265,2132],er=o=>{const{scales:e=Qi}=o,{containerProps:t}=je("scale-setter",o),{map:i}=Te(o),s=Zi(),n=Vo(i?.olMap)??1;function l(p){if(!i)return;const g=i.olMap.getView(),m=i.olMap.getView().getProjection(),v=m.getMetersPerUnit()??1,S=Ji*Xi*v,M=i.olMap.getView().getCenter();if(!M)return;const ce=p/xo(m,S,M);g.setResolution(ce)}const c=e.map(p=>r.jsx(li,{value:p,onClick:()=>l(p),onFocus:g=>{g.target?.scrollIntoView?.({block:"nearest"})},className:"scale-setter-option",children:dt(s,p)},p)),d=dt(s,n);return r.jsx(R,{...t,children:r.jsxs(pi,{isLazy:!0,children:[r.jsx(ci,{as:Y,rightIcon:r.jsx(Ei,{}),className:"scale-setter-menubutton","aria-label":s.formatMessage({id:"button.ariaLabel"},{scale:d}),"aria-description":s.formatMessage({id:"button.ariaDescription"}),children:d}),r.jsx(Ht,{children:r.jsx(di,{className:"scale-setter-menuoptions",maxHeight:"20em",overflowY:"auto",children:c})})]})})};function dt(o,e){return"1 : "+o.formatNumber(e)}const At="@open-pioneer/spatial-bookmarks",tr=qe.bind(void 0,At),or=Pe.bind(void 0,At),D=we("spatial-bookmark:SpatialBookmarkViewModel");class ir{map;packageNamespace;writableBookmarks=ko([]);watchBookmarksHandle;get bookmarks(){return this.writableBookmarks.getItems()}constructor(e,t){this.map=e,this.packageNamespace=t.getNamespace("spatial-bookmarks"),this.loadState(),this.watchBookmarksHandle=$e(()=>[this.writableBookmarks.getItems()],([i])=>this.saveState(i),{immediate:!1})}destroy(){this.watchBookmarksHandle.destroy()}createBookmark(e){const t=this.map.olMap,i=t.getView().calculateExtent(),s=t.getView().getProjection().getCode(),n={minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]},l={id:So(),title:e,extent:n,projection:s};D.debug("Created a new bookmark",l),this.writableBookmarks.push(l)}activateBookmark(e){D.debug("Activating bookmark",e);const t=this.getBookmarkExtent(e);D.debug("Attempting to apply extent",t),this.applyExtent(t)}deleteBookmark(e){D.debug("Deleting bookmark",e);const t=this.writableBookmarks.findIndex(i=>i.id===e);t>-1&&this.writableBookmarks.splice(t,1)}deleteAllBookmarks(){D.debug("Deleting all bookmarks"),this.writableBookmarks.splice(0)}loadState(){D.debug("Restoring bookmarks from local storage");const e=this.packageNamespace.get("bookmarks")??[];try{rr(e),this.writableBookmarks.push(...e)}catch(t){D.error("Bookmarks data in local storage is invalid, resetting to default value.",t),this.writableBookmarks.splice(0),this.saveState([])}}saveState(e){D.debug("Saving bookmarks to local storage"),this.packageNamespace.set("bookmarks",e)}getBookmarkExtent(e){const i=this.map.olMap.getView(),s=e.extent,n=[s.minX,s.minY,s.maxX,s.maxY],l=i.getProjection(),c=e.projection;return Mo(n,c,l)}applyExtent(e){const i=this.map.olMap.getView(),s=_o(e),n=i.getResolutionForExtent(e);i.setCenter(s),i.setResolution(n)}}function rr(o){if(!Array.isArray(o))throw new Error("Expected bookmarks from local storage to be an array.");for(const e of o)sr(e)}function sr(o){if(!o||typeof o!="object")throw new Error("Expected bookmark from local storage to be an object.");const e=o;if(typeof e.id!="string")throw new Error("Bookmark does not have a valid id.");if(typeof e.title!="string")throw new Error("Bookmark does not have a valid title.");if(ar(e.extent),typeof e.projection!="string")throw new Error("Bookmark does not have a valid projection value.")}function ar(o){if(!o||typeof o!="object")throw new Error("Expected bookmark extent from local storage to be an object.");const e=o;if(typeof e.minX!="number"||typeof e.minY!="number"||typeof e.maxX!="number"||typeof e.maxY!="number")throw new Error("Expected bookmark extent from local storage to have valid coordinates.")}const nr=o=>{const{map:e}=Te(o),t=tr("local-storage.LocalStorageService"),i=mr(e,t);return i&&r.jsx(lr,{...o,viewModel:i})};function lr(o){const{viewModel:e}=o,t=or(),i=b.useRef([]),[s,n]=b.useState(!1),l=$(()=>e.bookmarks,[e]),[c,d]=b.useState(""),p=c.trim().length>0,{containerProps:g}=je("spatial-bookmarks",o),[m,v]=b.useState("list"),S=()=>{e.deleteAllBookmarks(),v("list")},M=()=>{p&&(e.createBookmark(c),v("list"),d(""),n(!0))};b.useEffect(()=>{if(s){const E=i.current;E&&E[l.length-1]?.scrollIntoView?.(),n(!1)}},[l,s]);const ce=()=>r.jsxs(He,{children:[r.jsxs(Ve,{rounded:"md",status:"warning",children:[r.jsx(Oe,{}),t.formatMessage({id:"bookmark.alert.delete"})]}),r.jsx(ur,{intl:t,onClear:S,onCancel:()=>v("list")})]}),ye=()=>r.jsxs(He,{children:[r.jsxs(Ve,{rounded:"md",status:"info",children:[r.jsx(Oe,{}),t.formatMessage({id:"bookmark.alert.create"})]}),r.jsx(Oo,{"aria-label":t.formatMessage({id:"bookmark.input.label"}),placeholder:t.formatMessage({id:"bookmark.input.placeholder"}),value:c,onChange:E=>{d(E.target.value)},onKeyDown:E=>{E.key==="Enter"&&M()},isRequired:!0,isInvalid:!p,autoFocus:!0}),r.jsx(hr,{intl:t,isInvalid:!p,onCancel:()=>{d(""),v("list")},onSave:M})]}),xe=()=>r.jsxs(r.Fragment,{children:[l.length?cr(l,e,t,i):r.jsxs(Ve,{rounded:"md",status:"info",children:[r.jsx(Oe,{}),t.formatMessage({id:"bookmark.alert.noSaved"})]}),r.jsx(pr,{intl:t,bookmarks:l,showCreate:()=>v("create"),showDelete:()=>v("delete")})]}),I=r.jsxs(r.Fragment,{children:[m==="list"&&xe(),m==="create"&&ye(),m==="delete"&&ce()]});return r.jsx(F,{flexDirection:"column",...g,children:I})}function cr(o,e,t,i){const s=t.formatMessage({id:"bookmark.button.deleteOne"}),n=o.map((l,c)=>r.jsx(dr,{index:c,listItemNodes:i,bookmark:l,onActivate:()=>e.activateBookmark(l),onDelete:()=>e.deleteBookmark(l.id),deleteBtnLabel:s},l.id));return r.jsx(Jo,{as:"ul",className:"spatial-bookmark-list",role:"listbox","aria-label":t.formatMessage({id:"bookmark.list.label"}),flexShrink:1,flexGrow:1,p:1,spacing:1,overflowY:"auto",listStyleType:"none",children:n})}const pt={ArrowDown:1,ArrowUp:-1};function dr(o){const{index:e,listItemNodes:t,bookmark:i,onDelete:s,onActivate:n,deleteBtnLabel:l}=o,c=i.title,d=p=>{const g=p.key;if(g==="Enter"){p.target===p.currentTarget&&n();return}if(pt[g]!=null){const m=t.current?.length;if(!m)return;let v=(e+pt[g])%m;v<0&&(v=m-1),t.current[v]?.focus()}};return r.jsx(R,{as:"li",p:1,ref:p=>{if(!p){t.current.splice(e,1);return}t.current[e]=p},className:Io("spatial-bookmarks-item"),tabIndex:0,rounded:"md",role:"option",cursor:"pointer",outline:0,_hover:{background:"trails.50"},_focusVisible:{boxShadow:"outline"},onKeyDown:d,onClick:n,children:r.jsxs(F,{width:"100%",flexDirection:"row",align:"center",gap:1,children:[r.jsx(Et,{children:r.jsx(Ro,{})}),r.jsx(Re,{ps:2,noOfLines:1,children:c}),r.jsx(ui,{}),r.jsx(Ut,{hasArrow:!0,label:l,placement:"right",children:r.jsx(Y,{className:"spatial-bookmarks-item-delete","aria-label":l,borderRadius:"full",iconSpacing:0,padding:0,colorScheme:"red",variant:"ghost",leftIcon:r.jsx(St,{}),onClick:p=>{s(),p.stopPropagation()}})},e)]})})}function pr(o){const{intl:e,bookmarks:t,showCreate:i,showDelete:s}=o;return r.jsxs(Ke,{children:[r.jsx(se,{isDisabled:t.length===0,colorScheme:"red",width:void 0,iconSpacing:0,leftIcon:r.jsx(St,{}),onClick:s,"aria-label":e.formatMessage({id:"bookmark.button.deleteAll"}),variant:"outline"}),r.jsx(se,{onClick:i,width:"100%",children:e.formatMessage({id:"bookmark.button.create"})})]})}function ur(o){const{intl:e,onCancel:t,onClear:i}=o;return r.jsxs(Ke,{children:[r.jsx(se,{variant:"outline",onClick:t,children:e.formatMessage({id:"bookmark.button.cancelDelete"})}),r.jsx(se,{onClick:i,children:e.formatMessage({id:"bookmark.button.confirmDelete"})})]})}function hr(o){const{intl:e,onCancel:t,onSave:i,isInvalid:s}=o;return r.jsxs(Ke,{children:[r.jsx(se,{variant:"outline",onClick:()=>t(),children:e.formatMessage({id:"bookmark.button.cancel"})}),r.jsx(se,{isDisabled:s,onClick:()=>i(),children:e.formatMessage({id:"bookmark.button.save"})})]})}function Ke(o){return r.jsx(F,{width:"100%",flexDirection:"row",mt:2,gap:1,flexGrow:0,flexShrink:0,children:o.children})}function se(o){return r.jsx(Y,{width:"100%",...o})}function mr(o,e){const[t,i]=b.useState();return b.useEffect(()=>{let s;return o?s=new ir(o,e):s=void 0,i(s),()=>s?.destroy()},[o,e]),t}function gr({intl:o}){return{id:"coordinateViewer",title:o.formatMessage({id:"demos.coordinateViewer.title"}),createModel(){return{description:o.formatMessage({id:"demos.coordinateViewer.description"}),mainWidget:r.jsx(zo,{})}}}}function fr({intl:o}){return{id:"scaleViewer",title:o.formatMessage({id:"demos.scaleViewer.title"}),createModel(){return{description:o.formatMessage({id:"demos.scaleViewer.description"}),mainWidget:r.jsx(Fo,{})}}}}function vr({intl:o}){return{id:"scaleSetter",title:o.formatMessage({id:"demos.scaleSetter.title"}),createModel(){return{description:o.formatMessage({id:"demos.scaleSetter.description"}),mainWidget:r.jsx(er,{})}}}}function br({intl:o}){return{id:"scaleBar",title:o.formatMessage({id:"demos.scaleBar.title"}),createModel(){return{description:o.formatMessage({id:"demos.scaleBar.description"}),tools:r.jsx(Bo,{})}}}}function wr({intl:o}){return{id:"measurement",title:o.formatMessage({id:"demos.measurement.title"}),createModel(){return{description:o.formatMessage({id:"demos.measurement.description"}),mainWidget:r.jsx(Go,{})}}}}function yr({intl:o}){return{id:"mapNavigation",title:o.formatMessage({id:"demos.mapNavigation.title"}),createModel(){return{description:o.formatMessage({id:"demos.mapNavigation.description"}),tools:r.jsxs(r.Fragment,{children:[r.jsx(ei,{}),r.jsx(ti,{}),r.jsx(oi,{}),r.jsx(ii,{}),r.jsx(ri,{})]})}}}}function xr({intl:o}){return{id:"geolocation",title:o.formatMessage({id:"demos.geolocation.title"}),createModel(){return{description:o.formatMessage({id:"demos.geolocation.description"}),tools:r.jsx(qi,{})}}}}function kr({intl:o}){return{id:"spatialBookmarks",title:o.formatMessage({id:"demos.spatialBookmarks.title"}),createModel(){return{description:o.formatMessage({id:"demos.spatialBookmarks.description"}),mainWidget:r.jsx(nr,{})}}}}function Sr({intl:o}){return{id:"printing",title:o.formatMessage({id:"demos.printing.title"}),createModel(){return{description:o.formatMessage({id:"demos.printing.description"}),mainWidget:r.jsx(Ho,{})}}}}const jt="showcase-app",Tt=qe.bind(void 0,jt),le=Pe.bind(void 0,jt);function Mr({intl:o,mapModel:e}){return{id:"tocLegend",title:o.formatMessage({id:"demos.tocLegend.title"}),createModel(){function t(s=!0){e.layers.getLayerById("verwaltungsgebiete").setVisible(s),e.layers.getLayerById("krankenhaus").setVisible(s),e.layers.getLayerById("ogc_kitas").setVisible(s)}function i(){t(!1),e?.layers.activateBaseLayer("osm")}return{description:o.formatMessage({id:"demos.tocLegend.description"}),mainWidget:r.jsx(_r,{}),destroy:i}}}}function _r(){const o=b.useId(),e=b.useId(),t=le();return r.jsxs(r.Fragment,{children:[r.jsx(R,{role:"dialog","aria-labelledby":o,children:r.jsx(Se,{title:r.jsx(Ge,{id:o,size:"md",mb:2,children:r.jsx(Re,{children:t.formatMessage({id:"demos.tocLegend.tocTitle"})})}),children:r.jsx(Xo,{showTools:!0,basemapSwitcherProps:{allowSelectingEmptyBasemap:!0}})})}),r.jsx(R,{pt:2,role:"dialog","aria-labelledby":e,children:r.jsx(Se,{title:r.jsx(Ge,{id:e,size:"md",mb:2,children:t.formatMessage({id:"demos.tocLegend.legendTitle"})}),children:r.jsx(Uo,{showBaseLayers:!0})})})]})}function Ir(o){return{id:"selectionResultList",title:o.intl.formatMessage({id:"demos.selectionResultList.title"}),createModel(){return new Er(o)}}}var he,J,Q,_e,Ie,gt;let Er=(gt=class{constructor(e){u(this,he);u(this,J);u(this,Q,re({key:0,input:void 0,open:!1}));w(this,"description");w(this,"mainWidget");u(this,_e,e=>{const{results:t}=e,n={columns:[{id:"id",displayName:"ID",width:100,getPropertyValue(c){return c.id}},{propertyName:"pointOfContact.address.postCode",displayName:"PLZ",width:120},{propertyName:"name",displayName:"Name"},{propertyName:"inspireId",displayName:"inspireID"},{displayName:"Gefördert",width:160,getPropertyValue(c){switch(c.properties?.gefoerdert){case"ja":return!0;case"nein":return!1;default:return c.properties?.gefoerdert}}}],data:t,formatOptions:{numberOptions:{maximumFractionDigits:3},dateOptions:{dateStyle:"medium",timeStyle:"medium",timeZone:"UTC"}}},l=a(this,Q).value.key;a(this,Q).value={open:!0,key:l+1,input:n}});u(this,Ie,e=>{console.log("Selected features: ",e.features)});const{mapModel:t,vectorSelectionSourceFactory:i,intl:s}=e;h(this,he,t),h(this,J,Cr(t,i)),this.description=s.formatMessage({id:"demos.selectionResultList.description"}),this.mainWidget=r.jsx(Wo,{sources:[a(this,J)],onSelectionComplete:a(this,_e)}),t.layers.getLayerById("ogc_kitas").setVisible(!0)}destroy(){a(this,J).destroy(),a(this,he).layers.getLayerById("ogc_kitas").setVisible(!1)}get listContainer(){const e=a(this,Q).value;if(!(!e.open||!e.input))return r.jsx(hi,{input:e.input,onSelectionChange:a(this,Ie)},e.key)}},he=new WeakMap,J=new WeakMap,Q=new WeakMap,_e=new WeakMap,Ie=new WeakMap,gt);function Cr(o,e){const t=o.layers.getLayerById("ogc_kitas");return e.createSelectionSource({vectorLayer:t.olLayer,label:t.title})}const Lr="krankenhaus";function Ar(o){return{id:"editing",title:o.intl.formatMessage({id:"demos.editing.title"}),createModel(){return new jr(o)}}}var me,ee;class jr{constructor(e){w(this,"description");w(this,"mainWidget");u(this,me);u(this,ee);const{mapModel:t,intl:i,editingService:s,notificationService:n}=e;h(this,me,t),this.description=i.formatMessage({id:"demos.editing.description"}),h(this,ee,new Tr(t,s,n,i)),this.mainWidget=r.jsx(Pr,{editingController:a(this,ee)}),this._setEditLayerVisible(!0)}destroy(){this._setEditLayerVisible(!1),a(this,ee).stopEditing()}_setEditLayerVisible(e=!0){a(this,me).layers.getLayerById(Lr).setVisible(e)}}me=new WeakMap,ee=new WeakMap;var k,_,H,U,N,P,W,V;class Tr{constructor(e,t,i,s){u(this,k);u(this,_);u(this,H);u(this,U);u(this,N);u(this,P);u(this,W);u(this,V);h(this,k,re(!1)),h(this,_,e),h(this,H,t),h(this,U,i),h(this,N,s)}editingActive(){return a(this,k).value}startCreateWorkflow(){if(!a(this,k).value)try{a(this,k).value=!0;const e=a(this,_).layers.getLayerById("krankenhaus"),t=new URL(e.attributes.collectionURL+"/items"),i=a(this,H).createFeature(a(this,_),t);this._watchState(i),i.whenComplete().then(s=>{if(!s)return;a(this,U).notify({level:"info",message:a(this,N).formatMessage({id:"demos.editing.create.featureCreated"},{featureId:s.featureId})}),(e?.olLayer).getSource()?.refresh()}).catch(s=>{console.error(s)}).finally(()=>{a(this,k).value=!1})}catch(e){a(this,k).value=!1,console.error(e)}}startUpdateWorkflow(){if(!a(this,k).value)try{a(this,k).value=!0,h(this,V,this._createEditingSelectTooltip());const e=a(this,_).layers.getLayerById("krankenhaus"),t=e?.olLayer;h(this,P,new qo({layers:[t]})),a(this,_).olMap.addInteraction(a(this,P)),a(this,V).element.classList.remove("editing-tooltip-hidden"),h(this,W,a(this,P).on("select",i=>{const s=i.selected,n=i.deselected;if(s.length!==1||n.length!==0)return;this._stopUpdateSelection();const l=s[0];if(!l)throw Error("feature is undefined");const c=new URL(e.attributes.collectionURL+"/items"),d=a(this,H).updateFeature(a(this,_),c,l);this._watchState(d),d.whenComplete().then(p=>{p&&(a(this,U).notify({level:"info",message:a(this,N).formatMessage({id:"demos.editing.update.featureModified"},{featureId:p.featureId})}),t.getSource()?.refresh())}).catch(p=>{console.error(p)}).finally(()=>{a(this,k).value=!1})}))}catch(e){a(this,k).value=!1,console.error(e)}}_watchState(e){const t=$e(()=>[e.getState()],i=>{i[0]==="active:saving"&&a(this,U).notify({level:"info",message:a(this,N).formatMessage({id:"demos.editing.update.savingStared"})}),i[0]==="destroyed"&&(t.destroy(),console.log("destroyed"))})}_createEditingSelectTooltip(){const e=document.createElement("div");e.className="editing-tooltip editing-tooltip-hidden",e.textContent=a(this,N).formatMessage({id:"demos.editing.update.tooltip.select"});const t=new Mt({element:e,offset:[15,0],positioning:"center-left"}),i=a(this,_).olMap,s=i.on("pointermove",n=>{n.dragging||t.setPosition(n.coordinate)});return i.addOverlay(t),{overlay:t,element:e,destroy(){Be(s),i.removeOverlay(t)}}}_stopUpdateSelection(){a(this,P)&&a(this,_).olMap.removeInteraction(a(this,P)),a(this,W)&&Be(a(this,W)),a(this,V)&&a(this,V).destroy(),h(this,P,void 0),h(this,W,void 0),h(this,V,void 0)}stopEditing(){a(this,H).stop(De),this._stopUpdateSelection(),a(this,k).value=!1}}k=new WeakMap,_=new WeakMap,H=new WeakMap,U=new WeakMap,N=new WeakMap,P=new WeakMap,W=new WeakMap,V=new WeakMap;function Pr({editingController:o}){const e=le(),t=$(()=>o.editingActive(),[o]),i=t?e.formatMessage({id:"demos.editing.activeInfo"}):e.formatMessage({id:"demos.editing.inactiveInfo"});return r.jsxs(r.Fragment,{children:[r.jsxs(F,{px:1,py:1,children:[r.jsx(Y,{mr:2,isDisabled:t,onClick:()=>{o.startCreateWorkflow()},children:e.formatMessage({id:"demos.editing.startCreateButton"})}),r.jsx(Y,{mr:2,isDisabled:t,onClick:()=>{o.startUpdateWorkflow()},children:e.formatMessage({id:"demos.editing.startUpdateButton"})}),r.jsx(Y,{isDisabled:!t,onClick:()=>{o.stopEditing()},children:e.formatMessage({id:"demos.editing.stopButton"})})]}),r.jsx(F,{px:1,py:1,children:i})]})}function Rr(o){return[Mr(o),gr(o),fr(o),vr(o),br(o),wr(o),Ar(o),yr(o),xr(o),kr(o),Vi(o),Sr(o),Ir(o),zi(o)]}const Dr=we("app::AppModel");var Ee,ge,fe,O,C,Ce,Le,ne,Pt,Rt;class Nr{constructor(e,t,i,s){u(this,ne);u(this,Ee);u(this,ge);u(this,fe);u(this,O);u(this,C);u(this,Ce,Eo(()=>Array.from(a(this,O).values())));u(this,Le,[]);if(h(this,Ee,e),h(this,ge,t),h(this,fe,i),h(this,O,new Map(s.map(l=>[l.id,l]))),a(this,O).size===0)throw new Error("No demos defined.");const n=s[0];h(this,C,re([n,n.createModel()])),x(this,ne,Pt).call(this),a(this,Le).push(x(this,ne,Rt).call(this))}destroy(){a(this,C).value[1].destroy?.()}get currentDemo(){return a(this,C).value[0]}get currentDemoModel(){return a(this,C).value[1]}get allDemoInfos(){return a(this,Ce).value}selectDemo(e){const t=a(this,O).get(e);if(!t)throw new Error(`Demo '${e}' does not exist.`);Co(()=>{const[,i]=a(this,C).value;i.destroy?.(),a(this,C).value=[t,t.createModel()]})}}Ee=new WeakMap,ge=new WeakMap,fe=new WeakMap,O=new WeakMap,C=new WeakMap,Ce=new WeakMap,Le=new WeakMap,ne=new WeakSet,Pt=function(){const t=new URL(window.location.href).searchParams.get("demo");if(t){if(!a(this,O).has(t)){a(this,ge).notify({title:a(this,fe).formatMessage({id:"demoSelection.notFound"},{demoId:t})});return}try{this.selectDemo(t)}catch(i){Dr.error("Failed to select demo from URL",i)}}},Rt=function(){return $e(()=>[a(this,C).value[0].id],([e])=>{const t=new URL(window.location.href);t.searchParams.set("demo",e),window.history.replaceState(null,"",t.toString())},{immediate:!0})};var te,ve,be,Ae,Dt;class Vr{constructor(e){u(this,Ae);u(this,te,re({kind:"loading"}));u(this,ve,[]);u(this,be,!1);const{mapRegistry:t,httpService:i,notifier:s,vectorSelectionSourceFactory:n,editingService:l,notificationService:c}=e.references,d=e.intl;x(this,Ae,Dt).call(this,{mapRegistry:t,httpService:i,notifier:s,vectorSelectionSourceFactory:n,editingService:l,intl:d,notificationService:c}).catch(p=>{a(this,te).value={kind:"error",message:p.message||"Unknown error"}})}destroy(){h(this,be,!0);for(const e of a(this,ve))e.destroy()}get appState(){return a(this,te).value}}te=new WeakMap,ve=new WeakMap,be=new WeakMap,Ae=new WeakSet,Dt=async function(e){const{mapRegistry:t,httpService:i,notifier:s,vectorSelectionSourceFactory:n,editingService:l,intl:c,notificationService:d}=e,p=await t.getMapModel(De);if(!p)throw new Error("No mapModel found.");const g=Rr({intl:c,httpService:i,mapModel:p,vectorSelectionSourceFactory:n,editingService:l,notificationService:d}),m={kind:"ready",appModel:new Nr(p,s,c,g),destroy(){this.appModel.destroy()}};if(a(this,be)){m.destroy();return}a(this,te).value=m,a(this,ve).push(m)};const q=we("local-storage"),Or=0,T={CORRUPTED_DATA:"local-storage:corrupted-data",INVALID_PATH:"local-storage:invalid-path",INVALID_VALUE:"local-storage:invalid-value",NOT_SUPPORTED:"local-storage:not-supported",INTERNAL:"local-storage:internal-error"};var oe,L,z,ie,A,y,Nt,Vt,de,K,Ot;class zr{constructor(e){u(this,y);u(this,oe);u(this,L,{});u(this,z);u(this,ie);u(this,A);h(this,oe,Hr(e.properties)),h(this,z,Ur()),a(this,z)&&(x(this,y,Vt).call(this),h(this,ie,x(this,y,Ot).call(this)))}destroy(){a(this,A)&&(clearTimeout(a(this,A)),h(this,A,void 0)),a(this,z)&&x(this,y,de).call(this)}get isSupported(){return!!a(this,ie)}get(e){return x(this,y,K).call(this).get(e)}set(e,t){return x(this,y,K).call(this).set(e,t)}remove(e){return x(this,y,K).call(this).remove(e)}removeAll(){return x(this,y,K).call(this).removeAll()}getNamespace(e){return x(this,y,K).call(this).getNamespace(e)}}oe=new WeakMap,L=new WeakMap,z=new WeakMap,ie=new WeakMap,A=new WeakMap,y=new WeakSet,Nt=function(){a(this,A)&&clearTimeout(a(this,A)),h(this,A,setTimeout(()=>{h(this,A,void 0),x(this,y,de).call(this)},Or))},Vt=function(){try{const e=a(this,z);if(!e)throw new j(T.INTERNAL,"Local storage is not available.");const t=e.getItem(a(this,oe));if(t==null){h(this,L,{}),x(this,y,de).call(this);return}try{const i=JSON.parse(t);if(!ae(i))throw new j(T.CORRUPTED_DATA,"Persisted value should be an object.");h(this,L,i)}catch(i){q.warn("Invalid persisted data, reverting to default.",i),h(this,L,{}),x(this,y,de).call(this)}}catch(e){q.error("Failed to load from local storage",e)}},de=function(){try{const e=a(this,z);if(!e)throw new j(T.INTERNAL,"Local storage is not available.");const t=JSON.stringify(a(this,L));e.setItem(a(this,oe),t)}catch(e){q.error("Failed to save to local storage",e)}},K=function(){const e=a(this,ie);if(!e)throw new j(T.NOT_SUPPORTED,"Local storage is not supported by this browser.");return e},Ot=function(){const e={getByPath:t=>ht(Fr(a(this,L),t)),setByPath:(t,i)=>{if(!Gr(i))throw new j(T.INVALID_VALUE,"The value is not supported by local storage.");if(i=ht(i),t.length===0){if(!ae(i))throw new j(T.INVALID_VALUE,"The root value must be a plain object.");h(this,L,i)}else Br(a(this,L),t,i);x(this,y,Nt).call(this)}};return new Ye([],e)};class Ye{path;access;constructor(e,t){this.path=e,this.access=t}get(e){return this.access.getByPath([...this.path,e])}set(e,t){this.access.setByPath([...this.path,e],t)}remove(e){this.access.setByPath([...this.path,e],void 0)}removeAll(){this.access.setByPath(this.path,{})}getNamespace(e){const t=this.get(e);if(t===void 0)this.set(e,{});else if(!ae(t))throw new j(T.INVALID_PATH,`Cannot use '${e}' as a namespace because it is not associated with an object.`);return new Ye(this.path.concat([e]),this.access)}}const ut="trails-state";function Fr(o,e){let t=o;for(const i of e){if(!ae(t))throw new j(T.INVALID_PATH,`Cannot get nested property '${i}' because the parent is no object.`);t=t[i]}return t}function Br(o,e,t){if(!e.length)throw new j(T.INTERNAL,"Path must not be empty.");let i=o;for(let n=0,l=e.length-1;n"u"){q.warn("Local storage is not supported by this browser.");return}try{const o=globalThis.localStorage;if(!o){q.warn("Local storage is not supported by this browser.");return}return o}catch(o){q.warn("Local storage is not supported by this browser.",o);return}}function ht(o){return o!=null&&(o=JSON.parse(JSON.stringify(o))),o}const Wr={"showcase-app":{name:"showcase-app",services:{MapConfigProviderImpl:{name:"MapConfigProviderImpl",clazz:Ai,provides:[{name:"map.MapConfigProvider",qualifier:void 0}],references:{vectorSourceFactory:{name:"ogc-features.VectorSourceFactory",qualifier:void 0,all:!1}}},AppInitModel:{name:"AppInitModel",clazz:Vr,provides:[{name:"app.AppInitModel",qualifier:void 0}],references:{httpService:{name:"http.HttpService",qualifier:void 0,all:!1},mapRegistry:{name:"map.MapRegistry",qualifier:void 0,all:!1},notifier:{name:"notifier.NotificationService",qualifier:void 0,all:!1},vectorSelectionSourceFactory:{name:"selection.VectorSelectionSourceFactory",qualifier:void 0,all:!1},editingService:{name:"editing.EditingService",qualifier:void 0,all:!1},notificationService:{name:"notifier.NotificationService",qualifier:void 0,all:!1}}}},ui:{references:[{name:"app.AppInitModel",qualifier:void 0,all:!1},{name:"runtime.ApplicationContext",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/chakra-integration":{name:"@open-pioneer/chakra-integration",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime":{name:"@open-pioneer/runtime",services:{},ui:{references:[]},properties:{}},"@open-pioneer/react-utils":{name:"@open-pioneer/react-utils",services:{},ui:{references:[]},properties:{}},"@open-pioneer/http":{name:"@open-pioneer/http",services:{HttpServiceImpl:{name:"HttpServiceImpl",clazz:Lo,provides:[{name:"http.HttpService",qualifier:"http.HttpService"}],references:{interceptors:{name:"http.Interceptor",qualifier:void 0,all:!0}}}},ui:{references:[]},properties:{}},"@open-pioneer/notifier":{name:"@open-pioneer/notifier",services:{NotificationServiceImpl:{name:"NotificationServiceImpl",clazz:mi,provides:[{name:"notifier.NotificationService",qualifier:"notifier.NotificationService"}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/reactivity":{name:"@open-pioneer/reactivity",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map":{name:"@open-pioneer/map",services:{MapRegistryImpl:{name:"MapRegistryImpl",clazz:Ao,provides:[{name:"map.MapRegistry",qualifier:void 0}],references:{providers:{name:"map.MapConfigProvider",qualifier:void 0,all:!0},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/coordinate-viewer":{name:"@open-pioneer/coordinate-viewer",services:{},ui:{references:[]},properties:{}},"@open-pioneer/ogc-features":{name:"@open-pioneer/ogc-features",services:{VectorSourceFactory:{name:"VectorSourceFactory",clazz:si,provides:[{name:"ogc-features.VectorSourceFactory",qualifier:void 0}],references:{httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}},SearchSourceFactory:{name:"SearchSourceFactory",clazz:ai,provides:[{name:"ogc-features.SearchSourceFactory",qualifier:void 0}],references:{httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[]},properties:{}},"@open-pioneer/overview-map":{name:"@open-pioneer/overview-map",services:{},ui:{references:[]},properties:{}},"@open-pioneer/scale-bar":{name:"@open-pioneer/scale-bar",services:{},ui:{references:[]},properties:{}},"@open-pioneer/scale-viewer":{name:"@open-pioneer/scale-viewer",services:{},ui:{references:[]},properties:{}},"@open-pioneer/result-list":{name:"@open-pioneer/result-list",services:{},ui:{references:[]},properties:{}},"@open-pioneer/toc":{name:"@open-pioneer/toc",services:{},ui:{references:[]},properties:{}},"@open-pioneer/editing":{name:"@open-pioneer/editing",services:{EditingServiceImpl:{name:"EditingServiceImpl",clazz:$o,provides:[{name:"editing.EditingService",qualifier:void 0}],references:{mapRegistry:{name:"map.MapRegistry",qualifier:void 0,all:!1},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[]},properties:{polygonStyle:{value:{"fill-color":"rgba(255,255,255,0.4)","stroke-color":"red","stroke-width":1.25,"circle-radius":3,"circle-fill-color":"red","circle-stroke-width":1.25,"circle-stroke-color":"red"},required:!1},vertexStyle:{value:{"circle-radius":3,"circle-fill-color":"red","circle-stroke-width":1.25,"circle-stroke-color":"red"},required:!1}}},"@open-pioneer/geolocation":{name:"@open-pioneer/geolocation",services:{},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/legend":{name:"@open-pioneer/legend",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map-navigation":{name:"@open-pioneer/map-navigation",services:{},ui:{references:[]},properties:{}},"@open-pioneer/measurement":{name:"@open-pioneer/measurement",services:{},ui:{references:[]},properties:{}},"@open-pioneer/printing":{name:"@open-pioneer/printing",services:{PrintingServiceImpl:{name:"PrintingServiceImpl",clazz:gi,provides:[{name:"printing.PrintingService",qualifier:void 0}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1},{name:"printing.PrintingService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/scale-setter":{name:"@open-pioneer/scale-setter",services:{},ui:{references:[]},properties:{}},"@open-pioneer/search":{name:"@open-pioneer/search",services:{},ui:{references:[]},properties:{}},"@open-pioneer/selection":{name:"@open-pioneer/selection",services:{VectorSelectionSourceFactory:{name:"VectorSelectionSourceFactory",clazz:Ko,provides:[{name:"selection.VectorSelectionSourceFactory",qualifier:void 0}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/spatial-bookmarks":{name:"@open-pioneer/spatial-bookmarks",services:{},ui:{references:[{name:"local-storage.LocalStorageService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/base-theme":{name:"@open-pioneer/base-theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime-react-support":{name:"@open-pioneer/runtime-react-support",services:{},ui:{references:[]},properties:{}},"@open-pioneer/core":{name:"@open-pioneer/core",services:{},ui:{references:[]},properties:{}},"@open-pioneer/basemap-switcher":{name:"@open-pioneer/basemap-switcher",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map-ui-components":{name:"@open-pioneer/map-ui-components",services:{},ui:{references:[]},properties:{}},"@open-pioneer/local-storage":{name:"@open-pioneer/local-storage",services:{LocalStorageServiceImpl:{name:"LocalStorageServiceImpl",clazz:zr,provides:[{name:"local-storage.LocalStorageService",qualifier:"local-storage.LocalStorageService"}],references:{}}},ui:{references:[]},properties:{storageId:{value:null,required:!1}}}},qr=':root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.map-container .ol-viewport .ol-attribution{bottom:var(--map-padding-bottom);right:var(--map-padding-right)}.editing-tooltip{position:relative;background:#fffc;border-radius:4px;color:#000;padding:4px 8px;opacity:1;white-space:nowrap;font-size:12px;cursor:default;-webkit-user-select:none;user-select:none;font-weight:700}.editing-tooltip-hidden{visibility:hidden}.measurement-tooltip{position:relative;background:#fffc;border-radius:4px;color:#000;padding:4px 8px;opacity:1;white-space:nowrap;font-size:12px;cursor:default;-webkit-user-select:none;user-select:none;font-weight:700}.measurement-active-tooltip{background:#000000e6;border-radius:4px;border-color:#000000e6;opacity:.9;color:#fff}.measurement-finished-tooltip{background-color:#4cb3ffe6;color:#000;border:1px solid white}.measurement-active-tooltip:before,.measurement-finished-tooltip:before{border-top:6px solid rgba(0,0,0,.9);border-right:6px solid transparent;border-left:6px solid transparent;content:"";position:absolute;bottom:-6px;margin-left:-7px;left:50%}.measurement-finished-tooltip:before{border-top-color:#4cb3ff}.printing-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:10000;-webkit-user-select:none;user-select:none;pointer-events:all;cursor:wait;display:flex;flex-direction:row;align-items:center;justify-content:center;background-color:#b4b4b4cc}.printing-overlay-status{flex:1 1 auto;font-size:1.5em;text-align:center}.printing-scale-bar.ol-scale-bar{left:var(--printing-scale-bar-left);bottom:var(--printing-scale-bar-bottom)}.search-component .chakra-divider{display:none}.search-component .search-highlighted-match{font-weight:700}.search-component .search-value-container{cursor:text;padding-left:30px!important}.search-component .search-invisible{display:none}.selection-drag-box{background-color:#ffffff4d!important;border:3px solid var(--chakra-colors-background_primary)!important}.selection-tooltip{position:relative;background:#fffc;border-radius:4px;color:#000;padding:4px 8px;opacity:1;white-space:nowrap;font-size:12px;cursor:default;-webkit-user-select:none;user-select:none;font-weight:700}.selection .react-select{cursor:default}.map-container .selection-active{cursor:crosshair}.map-container .selection-inactive{cursor:no-drop}.selection-source-value.selection-source-value--disabled{opacity:.4}.selection-source-value.selection-source-value--disabled span{margin:0 6px 0 0}.map-anchor.main-map-anchor{overflow-x:hidden;overflow-y:auto}.map-container:focus-visible{outline:none}.map-container:focus-visible:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;border:3px solid var(--chakra-colors-trails-500)}@media screen and (max-width: 48em){.map-anchor.main-map-anchor{max-height:45%}}.overview-map .ol-overviewmap{position:relative;height:100%;width:100%}.overview-map .ol-overviewmap:not(.ol-collapsed){border:1px solid black}.overview-map .ol-overviewmap .ol-overviewmap-map{border:none;width:100%;height:100%}.overview-map .ol-overviewmap .ol-overviewmap-box{border:2px solid red}.scale-bar .ol-scale-bar{margin-bottom:8px;margin-right:8px}.scale-bar .ol-scale-bar,.scale-bar .ol-scale-line{position:relative;bottom:0;left:0;background:none}.scale-bar .ol-scale-bar .ol-scale-bar-inner,.scale-bar .ol-scale-bar .ol-scale-line-inner,.scale-bar .ol-scale-line .ol-scale-bar-inner,.scale-bar .ol-scale-line .ol-scale-line-inner{color:var(--chakra-white);border-color:var(--chakra-white)}.result-list-no-data-message{text-align:center;margin-top:50px;font-weight:700;font-size:larger}.result-list-table th,.result-list-table td{overflow-wrap:break-word}.result-list-table.result-list-table--is-resizing *{cursor:col-resize}.result-list-table thead{position:sticky;top:0;z-index:1;background:var(--chakra-colors-background_body)}.result-list-table th{position:relative;border-right-width:thin}.result-list-table tbody tr:hover{background:var(--chakra-colors-background_light)}.result-list-table .result-list-resizer{position:absolute;top:0;height:100%;right:0;width:8px;background:var(--chakra-colors-trails-100);transform:scaleX(.25);cursor:col-resize;-webkit-user-select:none;user-select:none;touch-action:none;padding-left:0}.result-list-table th:last-child .result-list-resizer{width:8px;transform:translate(50%) scaleX(.25)}.result-list-table th .result-list-resizer.result-list-resizer--is-resizing{background:var(--chakra-colors-trails-500);transform:scale(1)}.result-list-table th .result-list-resizer:hover{transform:scale(1)}',$r=["en","de"];function Kr(o){switch(o){case"en":return st(()=>import("./DEc3M1w42gc3.js"),[],import.meta.url).then(e=>e.default);case"de":return st(()=>import("./BaIyqT_8vxnW.js"),[],import.meta.url).then(e=>e.default)}throw new Error(`Unsupported locale: '${o}'`)}const Yr=Wt(qr),Zr=Object.freeze(Object.defineProperty({__proto__:null,loadMessages:Kr,locales:$r,packages:Wr,styles:Yr},Symbol.toStringTag,{value:"Module"}));function zt({label:o,children:e}){return r.jsxs(fi,{as:vi,maxWidth:{base:"none",md:"20em"},width:{base:"100%",sm:"47%",md:void 0},children:[r.jsx(bi,{flexBasis:{base:"8em",sm:"auto"},m:0,children:o}),e]})}const Xr=we("app::DemoSelection");function Jr({appModel:o}){const e=le(),{allDemos:t,currentDemo:i}=$(()=>({allDemos:o.allDemoInfos,currentDemo:o.currentDemo}),[o]),s=b.useMemo(()=>t.map(n=>r.jsx("option",{value:n.id,children:n.title},n.id)),[t]);return r.jsx(zt,{label:e.formatMessage({id:"demoSelection.label"}),children:r.jsx(_t,{value:i.id,onChange:n=>{const l=n.target.value;try{o.selectDemo(l)}catch(c){Xr.error("Failed to select demo",c)}},children:s})})}function Qr(){const o=le(),e=Tt("runtime.ApplicationContext"),t=es(e.getLocale()),i=s=>{switch(s){case"en":e.setLocale("en-GB");break;case"de":e.setLocale("de-DE");break}};return r.jsx(zt,{label:o.formatMessage({id:"localeSwitcher.label"}),children:r.jsxs(_t,{value:t,onChange:s=>i(s.target.value),children:[r.jsx("option",{value:"de",children:o.formatMessage({id:"localeSwitcher.locale.de"})}),r.jsx("option",{value:"en",children:o.formatMessage({id:"localeSwitcher.locale.en"})})]})})}function es(o){const e=o.match(/^[a-z]+/i)?.[0];if(e==="en"||e=="de")return e;throw new Error("unexpected locale prefix: "+e)}function ts({appModel:o}){const e=le();return r.jsxs(F,{as:"header",px:2,py:3,flexWrap:{base:"wrap",md:"nowrap"},alignItems:"baseline",gap:2,boxShadow:"1px 0px 3px rgba(0, 0, 0, 0.5)",bgColor:"white",zIndex:100,children:[r.jsx(Ge,{size:"md",flexShrink:0,flexGrow:1,textAlign:{base:"center",md:"left"},width:{base:"100%",md:"auto"},mb:{base:2,md:0},children:e.formatMessage({id:"header.title"})}),r.jsx(Jr,{appModel:o}),r.jsx(Qr,{})]})}function os(){const o=Tt("app.AppInitModel"),e=$(()=>o.appState,[o]);let t;switch(e.kind){case"loading":t="Loading...";break;case"error":t="Error: "+e.message;break;case"ready":t=r.jsx(is,{state:e})}return t}function is(o){const e=le(),t=o.state.appModel,{currentDemo:i,currentDemoModel:s}=$(()=>({currentDemo:t.currentDemo,currentDemoModel:t.currentDemoModel}),[t]),n=$(()=>s.listContainer,[s]),l=b.useMemo(()=>({left:0,right:0,bottom:n!=null?400:0,top:0}),[n]);return r.jsxs(r.Fragment,{children:[r.jsx(Yo,{position:"top-right"}),r.jsx(F,{height:"100%",direction:"column",children:r.jsx(Se,{title:r.jsx(ts,{appModel:t}),children:r.jsx(F,{flex:"1",direction:"column",position:"relative",children:r.jsx(jo,{mapId:De,children:r.jsxs(To,{viewPadding:l,role:"main","aria-label":e.formatMessage({id:"ariaLabels.map"}),children:[r.jsx(rt,{className:"main-map-anchor",position:"top-left",horizontalGap:10,verticalGap:10,children:r.jsx(R,{bgColor:"white",borderRadius:10,p:2,maxW:"500px",children:r.jsxs(Se,{title:i.title,sectionHeadingProps:{size:"lg"},children:[r.jsx(Re,{py:4,dangerouslySetInnerHTML:{__html:s.description}}),s.mainWidget]})})}),r.jsx(rt,{position:"bottom-right",horizontalGap:6,children:r.jsx(He,{p:1,children:s.tools})}),n&&r.jsx(R,{className:"list-container",position:"absolute",bottom:"0",backgroundColor:"white",width:"100%",height:"400px",zIndex:1,borderTop:"2px solid",borderColor:"trails.100",children:n})]})})})})})]})}const rs=new URLSearchParams(window.location.search),ss=rs.get("lang")||void 0,as=qt({component:os,appMetadata:Zr,config:{properties:{"@open-pioneer/local-storage":{storageId:"ol-showcase-state"}},locale:ss}});customElements.define("showcase-app",as); +var Ft=Object.defineProperty;var Xe=o=>{throw TypeError(o)};var Bt=(o,e,t)=>e in o?Ft(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var w=(o,e,t)=>Bt(o,typeof e!="symbol"?e+"":e,t),Ne=(o,e,t)=>e.has(o)||Xe("Cannot "+t);var a=(o,e,t)=>(Ne(o,e,"read from private field"),t?t.call(o):e.get(o)),u=(o,e,t)=>e.has(o)?Xe("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),h=(o,e,t,i)=>(Ne(o,e,"write to private field"),i?i.call(o,t):e.set(o,t),t),x=(o,e,t)=>(Ne(o,e,"access private method"),t);import{f as ft,h as Gt,j as r,r as b,c as we,B as Y,F as Ht,A as Ve,k as Oe,l as Ut,E as j,a as Wt,e as qt}from"./Bh0CuZ3gy5tC.js";import{aJ as $t,aK as Kt,X as Yt,W as Je,aL as Zt,aM as Xt,at as Jt,aN as Qt,aO as eo,aP as to,I as oo,ax as io,aQ as Qe,aR as ro,aS as so,aT as et,aU as ao,aV as no,aW as ze,V as lo,aX as tt,a1 as co,a7 as po,aY as uo,a5 as ho,aZ as mo,a_ as go,a$ as fo,b0 as vo,b1 as ot,B as R,S as Ue,T as vt,O as bt,a as We,b as wt,b2 as je,i as Te,f as qe,u as Pe,r as re,b3 as it,b4 as bo,as as wo,j as Be,c as yt,C as yo,F as xt,aC as kt,b5 as xo,d as ko,w as $e,b6 as So,b7 as Mo,b8 as _o,k as F,b9 as Io,g as Se,h as Ge,ba as Eo,bb as Co,H as Lo,M as Ao,D as jo,l as To,m as rt}from"./CvR1K3f_Jx0o.js";import{W as Po,i as Ro,j as St}from"./DNeIgqfIWVUM.js";import{O as Mt,W as Do,c as No,u as Vo,I as Oo,C as zo,b as Fo,a as Bo,M as Go,P as Ho,L as Uo,d as Wo,S as qo,E as $o,V as Ko,e as _t,N as Yo}from"./D5t2Vmz5gxIu.js";import{G as It,T as Zo,e as Xo}from"./CDZlakCE4enr.js";import{T as Re,V as He,L as Jo}from"./Tz2xttM4F6S2.js";import{u as $}from"./B1-t77dlZFnS.js";import{G as Qo}from"./CL_VRsbiqLzM.js";import{Z as ei,a as ti,H as oi,b as ii,I as ri,V as si,S as ai}from"./Cn6jOzlRJRDP.js";import{c as ni}from"./D03oE8cEQPSj.js";import{M as li,a as ci,b as di}from"./BeFcF3Ti4kY-.js";import{M as pi}from"./DUys4rac0YQP.js";import{S as ui}from"./CjjyePfBQlZ7.js";import{R as hi}from"./CxxdN3Z_jMxj.js";import{N as mi,P as gi}from"./CC4cg6c-thsW.js";import{_ as st}from"./CmsKOCeNyeyo.js";import{F as fi}from"./BO_q12Vdyug-.js";import{H as vi}from"./L25RkWOQSN8A.js";import{F as bi}from"./CreVQ-qFRzOc.js";import"./DoZQ59JZnzxi.js";import"./CKfDAIEslOW2.js";import"./Cq1ZpfgEg4XJ.js";import"./2d5-QpxJNHTD.js";var Et=ft("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});Et.displayName="Center";var wi={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}};Gt(function(e,t){const{axis:i="both",...s}=e;return r.jsx(ft.div,{ref:t,__css:wi[i],...s,position:"absolute"})});const f={ACCURACY:"accuracy",ACCURACY_GEOMETRY:"accuracyGeometry",ALTITUDE:"altitude",ALTITUDE_ACCURACY:"altitudeAccuracy",HEADING:"heading",POSITION:"position",PROJECTION:"projection",SPEED:"speed",TRACKING:"tracking",TRACKING_OPTIONS:"trackingOptions"},yi={ERROR:"error"};class xi extends Jt{constructor(e){super(yi.ERROR),this.code=e.code,this.message=e.message}}let ki=class extends $t{constructor(e){super(),this.on,this.once,this.un,e=e||{},this.position_=null,this.transform_=Kt,this.watchId_=void 0,this.addChangeListener(f.PROJECTION,this.handleProjectionChanged_),this.addChangeListener(f.TRACKING,this.handleTrackingChanged_),e.projection!==void 0&&this.setProjection(e.projection),e.trackingOptions!==void 0&&this.setTrackingOptions(e.trackingOptions),this.setTracking(e.tracking!==void 0?e.tracking:!1)}disposeInternal(){this.setTracking(!1),super.disposeInternal()}handleProjectionChanged_(){const e=this.getProjection();e&&(this.transform_=Yt(Je("EPSG:4326"),e),this.position_&&this.set(f.POSITION,this.transform_(this.position_)))}handleTrackingChanged_(){if("geolocation"in navigator){const e=this.getTracking();e&&this.watchId_===void 0?this.watchId_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions()):!e&&this.watchId_!==void 0&&(navigator.geolocation.clearWatch(this.watchId_),this.watchId_=void 0)}}positionChange_(e){const t=e.coords;this.set(f.ACCURACY,t.accuracy),this.set(f.ALTITUDE,t.altitude===null?void 0:t.altitude),this.set(f.ALTITUDE_ACCURACY,t.altitudeAccuracy===null?void 0:t.altitudeAccuracy),this.set(f.HEADING,t.heading===null?void 0:Zt(t.heading)),this.position_?(this.position_[0]=t.longitude,this.position_[1]=t.latitude):this.position_=[t.longitude,t.latitude];const i=this.transform_(this.position_);this.set(f.POSITION,i.slice()),this.set(f.SPEED,t.speed===null?void 0:t.speed);const s=Xt(this.position_,t.accuracy);s.applyTransform(this.transform_),this.set(f.ACCURACY_GEOMETRY,s),this.changed()}positionError_(e){this.dispatchEvent(new xi(e))}getAccuracy(){return this.get(f.ACCURACY)}getAccuracyGeometry(){return this.get(f.ACCURACY_GEOMETRY)||null}getAltitude(){return this.get(f.ALTITUDE)}getAltitudeAccuracy(){return this.get(f.ALTITUDE_ACCURACY)}getHeading(){return this.get(f.HEADING)}getPosition(){return this.get(f.POSITION)}getProjection(){return this.get(f.PROJECTION)}getSpeed(){return this.get(f.SPEED)}getTracking(){return this.get(f.TRACKING)}getTrackingOptions(){return this.get(f.TRACKING_OPTIONS)}setProjection(e){this.set(f.PROJECTION,Je(e))}setTracking(e){this.set(f.TRACKING,e)}setTrackingOptions(e){this.set(f.TRACKING_OPTIONS,e)}};const Si=1.2;function Mi(o,e=Si){_i(o);const t=Qt(o),i=eo(o),s=t*e,n=i*e;return[o[0]-(s-t)/2,o[1]-(n-i)/2,o[2]+(s-t)/2,o[3]+(n-i)/2]}function _i(o){if(o.length!==4)throw new Error(`Invalid extent (expected length 4, but got length ${o.length}).`)}const Fe=.75,ke=.1;let Ii=class extends to{constructor(e){e=e||{},super({element:document.createElement("div"),render:e.render,target:e.target}),this.boundHandleRotationChanged_=this.handleRotationChanged_.bind(this),this.collapsed_=e.collapsed!==void 0?e.collapsed:!0,this.collapsible_=e.collapsible!==void 0?e.collapsible:!0,this.collapsible_||(this.collapsed_=!1),this.rotateWithView_=e.rotateWithView!==void 0?e.rotateWithView:!1,this.viewExtent_=void 0;const t=e.className!==void 0?e.className:"ol-overviewmap",i=e.tipLabel!==void 0?e.tipLabel:"Overview map",s=e.collapseLabel!==void 0?e.collapseLabel:"‹";typeof s=="string"?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=s):this.collapseLabel_=s;const n=e.label!==void 0?e.label:"›";typeof n=="string"?(this.label_=document.createElement("span"),this.label_.textContent=n):this.label_=n;const l=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_,c=document.createElement("button");c.setAttribute("type","button"),c.title=i,c.appendChild(l),c.addEventListener(oo.CLICK,this.handleClick_.bind(this),!1),this.ovmapDiv_=document.createElement("div"),this.ovmapDiv_.className="ol-overviewmap-map",this.view_=e.view;const d=new io({view:e.view,controls:new Qe,interactions:new Qe});this.ovmap_=d,e.layers&&e.layers.forEach(function(I){d.addLayer(I)});const p=document.createElement("div");p.className="ol-overviewmap-box",p.style.boxSizing="border-box",this.boxOverlay_=new Mt({position:[0,0],positioning:"center-center",element:p}),this.ovmap_.addOverlay(this.boxOverlay_);const g=t+" "+ro+" "+so+(this.collapsed_&&this.collapsible_?" "+et:"")+(this.collapsible_?"":" ol-uncollapsible"),m=this.element;m.className=g,m.appendChild(this.ovmapDiv_),m.appendChild(c);const v=this,S=this.boxOverlay_,M=this.boxOverlay_.getElement(),ce=function(I){return{clientX:I.clientX,clientY:I.clientY}},ye=function(I){const E=ce(I),Ze=d.getEventCoordinateInternal(E);S.setPosition(Ze)},xe=function(I){const E=d.getEventCoordinateInternal(I);v.getMap().getView().setCenterInternal(E),window.removeEventListener("mousemove",ye),window.removeEventListener("mouseup",xe)};M.addEventListener("mousedown",function(){window.addEventListener("mousemove",ye),window.addEventListener("mouseup",xe)})}setMap(e){const t=this.getMap();if(e!==t){if(t){const i=t.getView();i&&this.unbindView_(i),this.ovmap_.setTarget(null)}if(super.setMap(e),e){this.ovmap_.setTarget(this.ovmapDiv_),this.listenerKeys.push(ao(e,no.PROPERTYCHANGE,this.handleMapPropertyChange_,this));const i=e.getView();i&&(this.bindView_(i),i.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_())),this.ovmap_.isRendered()||this.updateBoxAfterOvmapIsRendered_()}}}handleMapPropertyChange_(e){if(e.key===ze.VIEW){const t=e.oldValue;t&&this.unbindView_(t);const i=this.getMap().getView();this.bindView_(i)}else!this.ovmap_.isRendered()&&(e.key===ze.TARGET||e.key===ze.SIZE)&&this.ovmap_.updateSize()}bindView_(e){if(!this.view_){const t=new lo({projection:e.getProjection()});this.ovmap_.setView(t)}e.addChangeListener(tt.ROTATION,this.boundHandleRotationChanged_),this.handleRotationChanged_()}unbindView_(e){e.removeChangeListener(tt.ROTATION,this.boundHandleRotationChanged_)}handleRotationChanged_(){this.rotateWithView_&&this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())}validateExtent_(){const e=this.getMap(),t=this.ovmap_;if(!e.isRendered()||!t.isRendered())return;const i=e.getSize(),n=e.getView().calculateExtentInternal(i);if(this.viewExtent_&&co(n,this.viewExtent_))return;this.viewExtent_=n;const l=t.getSize(),d=t.getView().calculateExtentInternal(l),p=t.getPixelFromCoordinateInternal(po(n)),g=t.getPixelFromCoordinateInternal(uo(n)),m=Math.abs(p[0]-g[0]),v=Math.abs(p[1]-g[1]),S=l[0],M=l[1];mS*Fe||v>M*Fe?this.resetExtent_():ho(d,n)||this.recenter_()}resetExtent_(){const e=this.getMap(),t=this.ovmap_,i=e.getSize(),n=e.getView().calculateExtentInternal(i),l=t.getView(),c=Math.log(Fe/ke)/Math.LN2,d=1/(Math.pow(2,c/2)*ke);mo(n,d),l.fitInternal(go(n))}recenter_(){const e=this.getMap(),t=this.ovmap_,i=e.getView();t.getView().setCenterInternal(i.getCenterInternal())}updateBox_(){const e=this.getMap(),t=this.ovmap_;if(!e.isRendered()||!t.isRendered())return;const i=e.getSize(),s=e.getView(),n=t.getView(),l=this.rotateWithView_?0:-s.getRotation(),c=this.boxOverlay_,d=this.boxOverlay_.getElement(),p=s.getCenterInternal(),g=s.getResolution(),m=n.getResolution(),v=i[0]*g/m,S=i[1]*g/m;if(c.setPosition(p),d){d.style.width=v+"px",d.style.height=S+"px";const M="rotate("+l+"rad)";d.style.transform=M}}updateBoxAfterOvmapIsRendered_(){this.ovmapPostrenderKey_||(this.ovmapPostrenderKey_=fo(this.ovmap_,vo.POSTRENDER,function(e){delete this.ovmapPostrenderKey_,this.updateBox_()},this))}handleClick_(e){e.preventDefault(),this.handleToggle_()}handleToggle_(){this.element.classList.toggle(et),this.collapsed_?ot(this.collapseLabel_,this.label_):ot(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_;const e=this.ovmap_;if(!this.collapsed_){if(e.isRendered()){this.viewExtent_=void 0,e.render();return}e.updateSize(),this.resetExtent_(),this.updateBoxAfterOvmapIsRendered_()}}getCollapsible(){return this.collapsible_}setCollapsible(e){this.collapsible_!==e&&(this.collapsible_=e,this.element.classList.toggle("ol-uncollapsible"),!e&&this.collapsed_&&this.handleToggle_())}setCollapsed(e){!this.collapsible_||this.collapsed_===e||this.handleToggle_()}getCollapsed(){return this.collapsed_}getRotateWithView(){return this.rotateWithView_}setRotateWithView(e){this.rotateWithView_!==e&&(this.rotateWithView_=e,this.getMap().getView().getRotation()!==0&&(this.rotateWithView_?this.handleRotationChanged_():this.ovmap_.getView().setRotation(0),this.viewExtent_=void 0,this.validateExtent_(),this.updateBox_()))}getOverviewMap(){return this.ovmap_}render(e){this.validateExtent_(),this.updateBox_()}};const Ei=ni({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"}),Ci={height:"25px",width:"25px",borderColor:"#4cb3ff",borderWidth:"3px",borderRadius:"50%",display:"inline-block "};function Li(o){return r.jsxs(R,{children:[r.jsx(Re,{children:o.layer.title}),r.jsx(R,{style:Ci})]})}const De="main";class Ai{mapId=De;vectorSourceFactory;constructor(e){this.vectorSourceFactory=e.references.vectorSourceFactory}async getMapConfig(){return{initialView:{kind:"position",center:{x:823091,y:6724521},zoom:8},layers:[new Ue({title:"OSM",id:"osm",isBaseLayer:!0,olLayer:new vt({source:new bt})}),new Do({isBaseLayer:!0,title:"Orthofotos NRW",url:"https://www.wmts.nrw.de/geobasis/wmts_nw_dop/1.0.0/WMTSCapabilities.xml",name:"nw_dop",matrixSet:"EPSG_3857_16",sourceOptions:{attributions:'Die Geobasisdaten des amtlichen Vermessungswesens werden als öffentliche Aufgabe gem. VermKatG NRW und gebührenfrei nach Open Data-Prinzipien über online-Verfahren bereitgestellt. Nutzungsbedingungen: siehe '}}),Pi(),Ti(),ji(this.vectorSourceFactory)]}}}function ji(o){const e="https://ogc-api-test.nrw.de/inspire-us-krankenhaus/v1",t="governmentalservice",i=o.createVectorSource({baseUrl:e,collectionId:t,limit:1e3,crs:"http://www.opengis.net/def/crs/EPSG/0/3857",attributions:`Land NRW (${new Date().getFullYear()}), Datenlizenz Deutschland - Namensnennung - Version 2.0, Datenquelle`}),s=new We({source:i});return new Ue({id:"krankenhaus",title:"Krankenhäuser-Demo-Dienst",visible:!1,olLayer:s,attributes:{collectionURL:e+"/collections/"+t}})}function Ti(){const o=new wt({url:"https://ogc-api.nrw.de/inspire-us-kindergarten/v1/collections/governmentalservice/items?f=json&limit=10000",format:new It,attributions:'© Bundesamt für Kartographie und Geodäsie 2017, Datenquellen'}),e=new We({source:o}),t={Component:Li};return new Ue({id:"ogc_kitas",title:"Kindertagesstätten",visible:!0,olLayer:e,attributes:{legend:t}})}function Pi(){return new Po({title:"Verwaltungsgebiete",id:"verwaltungsgebiete",visible:!1,url:"https://www.wms.nrw.de/geobasis/wms_nw_dvg",sublayers:[{name:"nw_dvg_krs",title:"Kreise und kreisfreie Städte"}]})}const Ri="200px",Di="300px",Ni=o=>{const{olLayer:e,height:t=Ri,width:i=Di}=o,{containerProps:s}=je("overview-map",o),n=b.useRef(null),{map:l}=Te(o);return b.useEffect(()=>{if(n.current&&l&&e){const c=l.olMap,d=new Ii({className:"ol-overviewmap",layers:[e],collapsible:!1,collapsed:!1,target:n.current});return c.addControl(d),()=>{c.removeControl(d)}}},[l,e]),r.jsx(R,{height:t,width:i,ref:n,...s})};function Vi({intl:o}){return{id:"overviewMap",title:o.formatMessage({id:"demos.overviewMap.title"}),createModel(){const e=new vt({source:new bt});return{description:o.formatMessage({id:"demos.overviewMap.description"}),mainWidget:r.jsx(Ni,{olLayer:e}),destroy(){e.dispose()}}}}}class Oi{label;filteredTypes;httpService;constructor(e,t,i){this.label=e,this.filteredTypes=t,this.httpService=i}async search(e,{mapProjection:t,signal:i}){const s=await this.request(e,100,i),n=new It({dataProjection:"EPSG:4326",featureProjection:t});return s.features.filter(l=>this.filteredTypes.includes(l.properties.type)).map((l,c)=>{const d=n.readGeometry(l.geometry);return{id:l.properties.osm_id||c,label:this.createLabel(l),geometry:d,properties:l.properties}})}async request(e,t,i){const s=new URL("https://photon.komoot.io/api?");s.searchParams.set("q",e),s.searchParams.set("lang","de"),s.searchParams.set("lat","51.961563"),s.searchParams.set("lon","7.628202"),s.searchParams.set("limit",t.toString());const n=await this.httpService.fetch(s,{signal:i});if(!n.ok)throw new Error("Request failed: "+n.status);return await n.json()}createLabel(e){return`${e.properties.name} (${e.properties.osm_value?e.properties.osm_value+", ":""}${e.properties.postcode?e.properties.postcode+", ":""}${e.properties.city?e.properties.city+", ":""}${e.properties.country?e.properties.country+")":")"}`}}function zi({intl:o,httpService:e,mapModel:t}){return{id:"searchAndHighlight",title:o.formatMessage({id:"demos.searchAndHighlight.title"}),createModel(){return new Fi(o,t,e)}}}var pe,ue,Z,Me,X,mt;let Fi=(mt=class{constructor(e,t,i){u(this,pe);u(this,ue);u(this,Z);w(this,"description");w(this,"mainWidget");u(this,Me,e=>{const t=e.result.geometry;t&&(a(this,X).call(this),h(this,Z,Bi(a(this,ue),[t])))});u(this,X,()=>{a(this,Z)?.destroy(),h(this,Z,void 0)});h(this,pe,new Oi("Photon Geocoder",["city","street"],i)),h(this,ue,t),this.description=e.formatMessage({id:"demos.searchAndHighlight.description"}),this.mainWidget=r.jsx(No,{sources:[a(this,pe)],onSelect:a(this,Me),onClear:a(this,X)})}destroy(){a(this,X).call(this)}},pe=new WeakMap,ue=new WeakMap,Z=new WeakMap,Me=new WeakMap,X=new WeakMap,mt);function Bi(o,e){const t=o.olMap.getViewport();return o.highlightAndZoom(e,{viewPadding:t&&t.offsetWidth<1e3?{top:150,right:75,bottom:50,left:75}:{top:150,right:400,bottom:50,left:400}})}const Ct="@open-pioneer/geolocation",Gi=qe.bind(void 0,Ct),Lt=Pe.bind(void 0,Ct);function Hi(o){return Qo({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm8.94 3A8.994 8.994 0 0 0 13 3.06V1h-2v2.06A8.994 8.994 0 0 0 3.06 11H1v2h2.06A8.994 8.994 0 0 0 11 20.94V23h2v-2.06A8.994 8.994 0 0 0 20.94 13H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"},child:[]}]})(o)}const at=we("geolocation:GeolocationController"),nt=17;var B,G;class Ui{constructor(e,t,i){w(this,"supported",!!navigator.geolocation);w(this,"olMap");w(this,"positionHighlightLayer");w(this,"geolocation");w(this,"onError");w(this,"maxZoom",nt);w(this,"accuracyFeature");w(this,"positionFeature");w(this,"changeHandlers",[]);w(this,"setMapToPosition",!0);w(this,"trackingOptions",{});w(this,"isInitialZoom",!0);u(this,B,re(!1));u(this,G,re(!1));this.olMap=e,this.onError=t,this.isInitialZoom=!0,this.accuracyFeature=new it,this.accuracyFeature.setStyle(ct()),this.positionFeature=new it,this.positionFeature.setStyle(lt()),this.positionHighlightLayer=new We({source:new wt({features:[this.accuracyFeature,this.positionFeature]})}),this.positionHighlightLayer.setZIndex(bo);const s=i||Wi();this.geolocation=new ki({tracking:!1,trackingOptions:s,projection:e.getView()?.getProjection()}),this.trackingOptions=s,this.geolocation.on("error",n=>this.handleGeolocationError(n))}destroy(){this.stopGeolocation(),this.geolocation?.setTracking(!1),this.geolocation.dispose(),this.accuracyFeature=void 0,this.positionFeature=void 0,this.positionHighlightLayer.dispose()}startGeolocation(){if(a(this,G).value)return;const e=this.olMap;new Promise(i=>{a(this,G).value=!0,a(this,B).value=!0,this.geolocation?.setProjection(e.getView()?.getProjection()),this.geolocation?.setTracking(!0);const s=this.geolocation.on("change:accuracyGeometry",()=>{const d=this.geolocation.getAccuracyGeometry()||void 0;if(this.accuracyFeature?.setGeometry(d),this.accuracyFeature?.getGeometry()!==void 0&&i(),this.isInitialZoom){const p=this?.accuracyFeature?.getGeometry()?.getExtent();if(p){const g=Mi(p);if(!g)return;e.getView().fit(g,{maxZoom:this.maxZoom}),this.isInitialZoom=!1}}}),n=this.geolocation.on("change:position",()=>{const d=this.geolocation.getPosition();d&&(d[0]||d[1])!==void 0&&(this.positionFeature?.setGeometry(new wo(d)),this.setMapToPosition&&e.getView().setCenter(d),this.positionFeature?.getGeometry()!==void 0&&i())}),l=e.getView().on("change:resolution",()=>{this.setMapToPosition=this.isInitialZoom}),c=e.on("pointermove",d=>{d.dragging&&(this.setMapToPosition=!1)});this.changeHandlers.push(s,n,l,c),e.addLayer(this.positionHighlightLayer)}).then(()=>{a(this,B).value=!1}).catch(i=>{at.error("Failed to determine location",i)})}stopGeolocation(){this.geolocation?.setTracking(!1),a(this,G).value=!1,a(this,B).value=!1,this.trackingOptions={},this.setMapToPosition=!0,this.isInitialZoom=!0,this.changeHandlers.forEach(e=>{Be(e)}),this.changeHandlers=[],this.accuracyFeature?.setGeometry(void 0),this.positionFeature?.setGeometry(void 0),this.olMap.removeLayer(this.positionHighlightLayer)}get active(){return a(this,G).value}get loading(){return a(this,B).value}setPositionFeatureStyle(e){this.positionFeature?.setStyle(e??lt())}setAccuracyFeatureStyle(e){this.accuracyFeature?.setStyle(e??ct())}setMaxZoom(e){this.maxZoom=e??nt}getMaxZoom(){return this.maxZoom}getPositionFeature(){return this.positionFeature}getAccuracyFeature(){return this.accuracyFeature}getTrackingOptions(){return this.trackingOptions}getGeolocation(){return this.geolocation}handleGeolocationError(e){at.error("Error from geolocation API:",e.message),this.stopGeolocation();const t=(()=>{switch(e.code){case 1:return"permission-denied";case 2:return"position-unavailable";case 3:return"timeout";default:return"unknown"}})();this.onError(t)}}B=new WeakMap,G=new WeakMap;const lt=()=>new yt({image:new yo({radius:6,fill:new xt({color:"#3399CC"}),stroke:new kt({color:"#fff",width:2})})}),ct=()=>new yt({stroke:new kt({color:"#3399CC",width:3}),fill:new xt({color:"rgba(0, 0, 255, 0.05)"})}),Wi=()=>({enableHighAccuracy:!0,timeout:6e4,maximumAge:6e5}),qi=b.forwardRef(function(e,t){const{maxZoom:i,positionFeatureStyle:s,accuracyFeatureStyle:n,trackingOptions:l}=e,{map:c}=Te(e),d=Ki(c,i,l,s,n);return d&&r.jsx($i,{...e,controller:d,ref:t})}),$i=b.forwardRef(function(e,t){const{controller:i}=e,{containerProps:s}=je("geolocation",e),{isLoading:n,isActive:l}=$(()=>({isLoading:i.loading,isActive:i.active}),[i]),c=Lt(),d=i.supported?l?c.formatMessage({id:"locateMeEnd"}):c.formatMessage({id:"locateMeStart"}):c.formatMessage({id:"locateNotSupported"}),p=()=>{i.active?i.stopGeolocation():i.startGeolocation()};return r.jsx(Zo,{ref:t,label:d,icon:r.jsx(Hi,{}),onClick:()=>p(),isActive:l,isLoading:n,isDisabled:!i.supported,...s})});function Ki(o,e,t,i,s){const n=Lt(),l=Gi("notifier.NotificationService"),[c,d]=b.useState();return b.useEffect(()=>{if(!o)return;const p=m=>{const v=n.formatMessage({id:"error"}),S=(()=>{switch(m){case"permission-denied":return n.formatMessage({id:"permissionDenied"});case"position-unavailable":return n.formatMessage({id:"positionUnavailable"});case"timeout":return n.formatMessage({id:"timeout"});case"unknown":return n.formatMessage({id:"unknownError"})}})();l.notify({level:"error",title:v,message:S})},g=new Ui(o.olMap,p,t);return d(g),()=>{g.destroy(),d(void 0)}},[o,t,n,l]),b.useEffect(()=>{c?.setPositionFeatureStyle(i)},[c,i]),b.useEffect(()=>{c?.setAccuracyFeatureStyle(s)},[c,s]),b.useEffect(()=>{c?.setMaxZoom(e)},[c,e]),c}const Yi="@open-pioneer/scale-setter",Zi=Pe.bind(void 0,Yi),Xi=25.4/.28,Ji=39.37,Qi=[17471320,8735660,4367830,2183915,1091957,545978,272989,136494,68247,34123,17061,8530,4265,2132],er=o=>{const{scales:e=Qi}=o,{containerProps:t}=je("scale-setter",o),{map:i}=Te(o),s=Zi(),n=Vo(i?.olMap)??1;function l(p){if(!i)return;const g=i.olMap.getView(),m=i.olMap.getView().getProjection(),v=m.getMetersPerUnit()??1,S=Ji*Xi*v,M=i.olMap.getView().getCenter();if(!M)return;const ce=p/xo(m,S,M);g.setResolution(ce)}const c=e.map(p=>r.jsx(li,{value:p,onClick:()=>l(p),onFocus:g=>{g.target?.scrollIntoView?.({block:"nearest"})},className:"scale-setter-option",children:dt(s,p)},p)),d=dt(s,n);return r.jsx(R,{...t,children:r.jsxs(pi,{isLazy:!0,children:[r.jsx(ci,{as:Y,rightIcon:r.jsx(Ei,{}),className:"scale-setter-menubutton","aria-label":s.formatMessage({id:"button.ariaLabel"},{scale:d}),"aria-description":s.formatMessage({id:"button.ariaDescription"}),children:d}),r.jsx(Ht,{children:r.jsx(di,{className:"scale-setter-menuoptions",maxHeight:"20em",overflowY:"auto",children:c})})]})})};function dt(o,e){return"1 : "+o.formatNumber(e)}const At="@open-pioneer/spatial-bookmarks",tr=qe.bind(void 0,At),or=Pe.bind(void 0,At),D=we("spatial-bookmark:SpatialBookmarkViewModel");class ir{map;packageNamespace;writableBookmarks=ko([]);watchBookmarksHandle;get bookmarks(){return this.writableBookmarks.getItems()}constructor(e,t){this.map=e,this.packageNamespace=t.getNamespace("spatial-bookmarks"),this.loadState(),this.watchBookmarksHandle=$e(()=>[this.writableBookmarks.getItems()],([i])=>this.saveState(i),{immediate:!1})}destroy(){this.watchBookmarksHandle.destroy()}createBookmark(e){const t=this.map.olMap,i=t.getView().calculateExtent(),s=t.getView().getProjection().getCode(),n={minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]},l={id:So(),title:e,extent:n,projection:s};D.debug("Created a new bookmark",l),this.writableBookmarks.push(l)}activateBookmark(e){D.debug("Activating bookmark",e);const t=this.getBookmarkExtent(e);D.debug("Attempting to apply extent",t),this.applyExtent(t)}deleteBookmark(e){D.debug("Deleting bookmark",e);const t=this.writableBookmarks.findIndex(i=>i.id===e);t>-1&&this.writableBookmarks.splice(t,1)}deleteAllBookmarks(){D.debug("Deleting all bookmarks"),this.writableBookmarks.splice(0)}loadState(){D.debug("Restoring bookmarks from local storage");const e=this.packageNamespace.get("bookmarks")??[];try{rr(e),this.writableBookmarks.push(...e)}catch(t){D.error("Bookmarks data in local storage is invalid, resetting to default value.",t),this.writableBookmarks.splice(0),this.saveState([])}}saveState(e){D.debug("Saving bookmarks to local storage"),this.packageNamespace.set("bookmarks",e)}getBookmarkExtent(e){const i=this.map.olMap.getView(),s=e.extent,n=[s.minX,s.minY,s.maxX,s.maxY],l=i.getProjection(),c=e.projection;return Mo(n,c,l)}applyExtent(e){const i=this.map.olMap.getView(),s=_o(e),n=i.getResolutionForExtent(e);i.setCenter(s),i.setResolution(n)}}function rr(o){if(!Array.isArray(o))throw new Error("Expected bookmarks from local storage to be an array.");for(const e of o)sr(e)}function sr(o){if(!o||typeof o!="object")throw new Error("Expected bookmark from local storage to be an object.");const e=o;if(typeof e.id!="string")throw new Error("Bookmark does not have a valid id.");if(typeof e.title!="string")throw new Error("Bookmark does not have a valid title.");if(ar(e.extent),typeof e.projection!="string")throw new Error("Bookmark does not have a valid projection value.")}function ar(o){if(!o||typeof o!="object")throw new Error("Expected bookmark extent from local storage to be an object.");const e=o;if(typeof e.minX!="number"||typeof e.minY!="number"||typeof e.maxX!="number"||typeof e.maxY!="number")throw new Error("Expected bookmark extent from local storage to have valid coordinates.")}const nr=o=>{const{map:e}=Te(o),t=tr("local-storage.LocalStorageService"),i=mr(e,t);return i&&r.jsx(lr,{...o,viewModel:i})};function lr(o){const{viewModel:e}=o,t=or(),i=b.useRef([]),[s,n]=b.useState(!1),l=$(()=>e.bookmarks,[e]),[c,d]=b.useState(""),p=c.trim().length>0,{containerProps:g}=je("spatial-bookmarks",o),[m,v]=b.useState("list"),S=()=>{e.deleteAllBookmarks(),v("list")},M=()=>{p&&(e.createBookmark(c),v("list"),d(""),n(!0))};b.useEffect(()=>{if(s){const E=i.current;E&&E[l.length-1]?.scrollIntoView?.(),n(!1)}},[l,s]);const ce=()=>r.jsxs(He,{children:[r.jsxs(Ve,{rounded:"md",status:"warning",children:[r.jsx(Oe,{}),t.formatMessage({id:"bookmark.alert.delete"})]}),r.jsx(ur,{intl:t,onClear:S,onCancel:()=>v("list")})]}),ye=()=>r.jsxs(He,{children:[r.jsxs(Ve,{rounded:"md",status:"info",children:[r.jsx(Oe,{}),t.formatMessage({id:"bookmark.alert.create"})]}),r.jsx(Oo,{"aria-label":t.formatMessage({id:"bookmark.input.label"}),placeholder:t.formatMessage({id:"bookmark.input.placeholder"}),value:c,onChange:E=>{d(E.target.value)},onKeyDown:E=>{E.key==="Enter"&&M()},isRequired:!0,isInvalid:!p,autoFocus:!0}),r.jsx(hr,{intl:t,isInvalid:!p,onCancel:()=>{d(""),v("list")},onSave:M})]}),xe=()=>r.jsxs(r.Fragment,{children:[l.length?cr(l,e,t,i):r.jsxs(Ve,{rounded:"md",status:"info",children:[r.jsx(Oe,{}),t.formatMessage({id:"bookmark.alert.noSaved"})]}),r.jsx(pr,{intl:t,bookmarks:l,showCreate:()=>v("create"),showDelete:()=>v("delete")})]}),I=r.jsxs(r.Fragment,{children:[m==="list"&&xe(),m==="create"&&ye(),m==="delete"&&ce()]});return r.jsx(F,{flexDirection:"column",...g,children:I})}function cr(o,e,t,i){const s=t.formatMessage({id:"bookmark.button.deleteOne"}),n=o.map((l,c)=>r.jsx(dr,{index:c,listItemNodes:i,bookmark:l,onActivate:()=>e.activateBookmark(l),onDelete:()=>e.deleteBookmark(l.id),deleteBtnLabel:s},l.id));return r.jsx(Jo,{as:"ul",className:"spatial-bookmark-list",role:"listbox","aria-label":t.formatMessage({id:"bookmark.list.label"}),flexShrink:1,flexGrow:1,p:1,spacing:1,overflowY:"auto",listStyleType:"none",children:n})}const pt={ArrowDown:1,ArrowUp:-1};function dr(o){const{index:e,listItemNodes:t,bookmark:i,onDelete:s,onActivate:n,deleteBtnLabel:l}=o,c=i.title,d=p=>{const g=p.key;if(g==="Enter"){p.target===p.currentTarget&&n();return}if(pt[g]!=null){const m=t.current?.length;if(!m)return;let v=(e+pt[g])%m;v<0&&(v=m-1),t.current[v]?.focus()}};return r.jsx(R,{as:"li",p:1,ref:p=>{if(!p){t.current.splice(e,1);return}t.current[e]=p},className:Io("spatial-bookmarks-item"),tabIndex:0,rounded:"md",role:"option",cursor:"pointer",outline:0,_hover:{background:"trails.50"},_focusVisible:{boxShadow:"outline"},onKeyDown:d,onClick:n,children:r.jsxs(F,{width:"100%",flexDirection:"row",align:"center",gap:1,children:[r.jsx(Et,{children:r.jsx(Ro,{})}),r.jsx(Re,{ps:2,noOfLines:1,children:c}),r.jsx(ui,{}),r.jsx(Ut,{hasArrow:!0,label:l,placement:"right",children:r.jsx(Y,{className:"spatial-bookmarks-item-delete","aria-label":l,borderRadius:"full",iconSpacing:0,padding:0,colorScheme:"red",variant:"ghost",leftIcon:r.jsx(St,{}),onClick:p=>{s(),p.stopPropagation()}})},e)]})})}function pr(o){const{intl:e,bookmarks:t,showCreate:i,showDelete:s}=o;return r.jsxs(Ke,{children:[r.jsx(se,{isDisabled:t.length===0,colorScheme:"red",width:void 0,iconSpacing:0,leftIcon:r.jsx(St,{}),onClick:s,"aria-label":e.formatMessage({id:"bookmark.button.deleteAll"}),variant:"outline"}),r.jsx(se,{onClick:i,width:"100%",children:e.formatMessage({id:"bookmark.button.create"})})]})}function ur(o){const{intl:e,onCancel:t,onClear:i}=o;return r.jsxs(Ke,{children:[r.jsx(se,{variant:"outline",onClick:t,children:e.formatMessage({id:"bookmark.button.cancelDelete"})}),r.jsx(se,{onClick:i,children:e.formatMessage({id:"bookmark.button.confirmDelete"})})]})}function hr(o){const{intl:e,onCancel:t,onSave:i,isInvalid:s}=o;return r.jsxs(Ke,{children:[r.jsx(se,{variant:"outline",onClick:()=>t(),children:e.formatMessage({id:"bookmark.button.cancel"})}),r.jsx(se,{isDisabled:s,onClick:()=>i(),children:e.formatMessage({id:"bookmark.button.save"})})]})}function Ke(o){return r.jsx(F,{width:"100%",flexDirection:"row",mt:2,gap:1,flexGrow:0,flexShrink:0,children:o.children})}function se(o){return r.jsx(Y,{width:"100%",...o})}function mr(o,e){const[t,i]=b.useState();return b.useEffect(()=>{let s;return o?s=new ir(o,e):s=void 0,i(s),()=>s?.destroy()},[o,e]),t}function gr({intl:o}){return{id:"coordinateViewer",title:o.formatMessage({id:"demos.coordinateViewer.title"}),createModel(){return{description:o.formatMessage({id:"demos.coordinateViewer.description"}),mainWidget:r.jsx(zo,{})}}}}function fr({intl:o}){return{id:"scaleViewer",title:o.formatMessage({id:"demos.scaleViewer.title"}),createModel(){return{description:o.formatMessage({id:"demos.scaleViewer.description"}),mainWidget:r.jsx(Fo,{})}}}}function vr({intl:o}){return{id:"scaleSetter",title:o.formatMessage({id:"demos.scaleSetter.title"}),createModel(){return{description:o.formatMessage({id:"demos.scaleSetter.description"}),mainWidget:r.jsx(er,{})}}}}function br({intl:o}){return{id:"scaleBar",title:o.formatMessage({id:"demos.scaleBar.title"}),createModel(){return{description:o.formatMessage({id:"demos.scaleBar.description"}),tools:r.jsx(Bo,{})}}}}function wr({intl:o}){return{id:"measurement",title:o.formatMessage({id:"demos.measurement.title"}),createModel(){return{description:o.formatMessage({id:"demos.measurement.description"}),mainWidget:r.jsx(Go,{})}}}}function yr({intl:o}){return{id:"mapNavigation",title:o.formatMessage({id:"demos.mapNavigation.title"}),createModel(){return{description:o.formatMessage({id:"demos.mapNavigation.description"}),tools:r.jsxs(r.Fragment,{children:[r.jsx(ei,{}),r.jsx(ti,{}),r.jsx(oi,{}),r.jsx(ii,{}),r.jsx(ri,{})]})}}}}function xr({intl:o}){return{id:"geolocation",title:o.formatMessage({id:"demos.geolocation.title"}),createModel(){return{description:o.formatMessage({id:"demos.geolocation.description"}),tools:r.jsx(qi,{})}}}}function kr({intl:o}){return{id:"spatialBookmarks",title:o.formatMessage({id:"demos.spatialBookmarks.title"}),createModel(){return{description:o.formatMessage({id:"demos.spatialBookmarks.description"}),mainWidget:r.jsx(nr,{})}}}}function Sr({intl:o}){return{id:"printing",title:o.formatMessage({id:"demos.printing.title"}),createModel(){return{description:o.formatMessage({id:"demos.printing.description"}),mainWidget:r.jsx(Ho,{})}}}}const jt="showcase-app",Tt=qe.bind(void 0,jt),le=Pe.bind(void 0,jt);function Mr({intl:o,mapModel:e}){return{id:"tocLegend",title:o.formatMessage({id:"demos.tocLegend.title"}),createModel(){function t(s=!0){e.layers.getLayerById("verwaltungsgebiete").setVisible(s),e.layers.getLayerById("krankenhaus").setVisible(s),e.layers.getLayerById("ogc_kitas").setVisible(s)}function i(){t(!1),e?.layers.activateBaseLayer("osm")}return{description:o.formatMessage({id:"demos.tocLegend.description"}),mainWidget:r.jsx(_r,{}),destroy:i}}}}function _r(){const o=b.useId(),e=b.useId(),t=le();return r.jsxs(r.Fragment,{children:[r.jsx(R,{role:"dialog","aria-labelledby":o,children:r.jsx(Se,{title:r.jsx(Ge,{id:o,size:"md",mb:2,children:r.jsx(Re,{children:t.formatMessage({id:"demos.tocLegend.tocTitle"})})}),children:r.jsx(Xo,{showTools:!0,basemapSwitcherProps:{allowSelectingEmptyBasemap:!0}})})}),r.jsx(R,{pt:2,role:"dialog","aria-labelledby":e,children:r.jsx(Se,{title:r.jsx(Ge,{id:e,size:"md",mb:2,children:t.formatMessage({id:"demos.tocLegend.legendTitle"})}),children:r.jsx(Uo,{showBaseLayers:!0})})})]})}function Ir(o){return{id:"selectionResultList",title:o.intl.formatMessage({id:"demos.selectionResultList.title"}),createModel(){return new Er(o)}}}var he,J,Q,_e,Ie,gt;let Er=(gt=class{constructor(e){u(this,he);u(this,J);u(this,Q,re({key:0,input:void 0,open:!1}));w(this,"description");w(this,"mainWidget");u(this,_e,e=>{const{results:t}=e,n={columns:[{id:"id",displayName:"ID",width:100,getPropertyValue(c){return c.id}},{propertyName:"pointOfContact.address.postCode",displayName:"PLZ",width:120},{propertyName:"name",displayName:"Name"},{propertyName:"inspireId",displayName:"inspireID"},{displayName:"Gefördert",width:160,getPropertyValue(c){switch(c.properties?.gefoerdert){case"ja":return!0;case"nein":return!1;default:return c.properties?.gefoerdert}}}],data:t,formatOptions:{numberOptions:{maximumFractionDigits:3},dateOptions:{dateStyle:"medium",timeStyle:"medium",timeZone:"UTC"}}},l=a(this,Q).value.key;a(this,Q).value={open:!0,key:l+1,input:n}});u(this,Ie,e=>{console.log("Selected features: ",e.features)});const{mapModel:t,vectorSelectionSourceFactory:i,intl:s}=e;h(this,he,t),h(this,J,Cr(t,i)),this.description=s.formatMessage({id:"demos.selectionResultList.description"}),this.mainWidget=r.jsx(Wo,{sources:[a(this,J)],onSelectionComplete:a(this,_e)}),t.layers.getLayerById("ogc_kitas").setVisible(!0)}destroy(){a(this,J).destroy(),a(this,he).layers.getLayerById("ogc_kitas").setVisible(!1)}get listContainer(){const e=a(this,Q).value;if(!(!e.open||!e.input))return r.jsx(hi,{input:e.input,onSelectionChange:a(this,Ie)},e.key)}},he=new WeakMap,J=new WeakMap,Q=new WeakMap,_e=new WeakMap,Ie=new WeakMap,gt);function Cr(o,e){const t=o.layers.getLayerById("ogc_kitas");return e.createSelectionSource({vectorLayer:t.olLayer,label:t.title})}const Lr="krankenhaus";function Ar(o){return{id:"editing",title:o.intl.formatMessage({id:"demos.editing.title"}),createModel(){return new jr(o)}}}var me,ee;class jr{constructor(e){w(this,"description");w(this,"mainWidget");u(this,me);u(this,ee);const{mapModel:t,intl:i,editingService:s,notificationService:n}=e;h(this,me,t),this.description=i.formatMessage({id:"demos.editing.description"}),h(this,ee,new Tr(t,s,n,i)),this.mainWidget=r.jsx(Pr,{editingController:a(this,ee)}),this._setEditLayerVisible(!0)}destroy(){this._setEditLayerVisible(!1),a(this,ee).stopEditing()}_setEditLayerVisible(e=!0){a(this,me).layers.getLayerById(Lr).setVisible(e)}}me=new WeakMap,ee=new WeakMap;var k,_,H,U,N,P,W,V;class Tr{constructor(e,t,i,s){u(this,k);u(this,_);u(this,H);u(this,U);u(this,N);u(this,P);u(this,W);u(this,V);h(this,k,re(!1)),h(this,_,e),h(this,H,t),h(this,U,i),h(this,N,s)}editingActive(){return a(this,k).value}startCreateWorkflow(){if(!a(this,k).value)try{a(this,k).value=!0;const e=a(this,_).layers.getLayerById("krankenhaus"),t=new URL(e.attributes.collectionURL+"/items"),i=a(this,H).createFeature(a(this,_),t);this._watchState(i),i.whenComplete().then(s=>{if(!s)return;a(this,U).notify({level:"info",message:a(this,N).formatMessage({id:"demos.editing.create.featureCreated"},{featureId:s.featureId})}),(e?.olLayer).getSource()?.refresh()}).catch(s=>{console.error(s)}).finally(()=>{a(this,k).value=!1})}catch(e){a(this,k).value=!1,console.error(e)}}startUpdateWorkflow(){if(!a(this,k).value)try{a(this,k).value=!0,h(this,V,this._createEditingSelectTooltip());const e=a(this,_).layers.getLayerById("krankenhaus"),t=e?.olLayer;h(this,P,new qo({layers:[t]})),a(this,_).olMap.addInteraction(a(this,P)),a(this,V).element.classList.remove("editing-tooltip-hidden"),h(this,W,a(this,P).on("select",i=>{const s=i.selected,n=i.deselected;if(s.length!==1||n.length!==0)return;this._stopUpdateSelection();const l=s[0];if(!l)throw Error("feature is undefined");const c=new URL(e.attributes.collectionURL+"/items"),d=a(this,H).updateFeature(a(this,_),c,l);this._watchState(d),d.whenComplete().then(p=>{p&&(a(this,U).notify({level:"info",message:a(this,N).formatMessage({id:"demos.editing.update.featureModified"},{featureId:p.featureId})}),t.getSource()?.refresh())}).catch(p=>{console.error(p)}).finally(()=>{a(this,k).value=!1})}))}catch(e){a(this,k).value=!1,console.error(e)}}_watchState(e){const t=$e(()=>[e.getState()],i=>{i[0]==="active:saving"&&a(this,U).notify({level:"info",message:a(this,N).formatMessage({id:"demos.editing.update.savingStared"})}),i[0]==="destroyed"&&(t.destroy(),console.log("destroyed"))})}_createEditingSelectTooltip(){const e=document.createElement("div");e.className="editing-tooltip editing-tooltip-hidden",e.textContent=a(this,N).formatMessage({id:"demos.editing.update.tooltip.select"});const t=new Mt({element:e,offset:[15,0],positioning:"center-left"}),i=a(this,_).olMap,s=i.on("pointermove",n=>{n.dragging||t.setPosition(n.coordinate)});return i.addOverlay(t),{overlay:t,element:e,destroy(){Be(s),i.removeOverlay(t)}}}_stopUpdateSelection(){a(this,P)&&a(this,_).olMap.removeInteraction(a(this,P)),a(this,W)&&Be(a(this,W)),a(this,V)&&a(this,V).destroy(),h(this,P,void 0),h(this,W,void 0),h(this,V,void 0)}stopEditing(){a(this,H).stop(De),this._stopUpdateSelection(),a(this,k).value=!1}}k=new WeakMap,_=new WeakMap,H=new WeakMap,U=new WeakMap,N=new WeakMap,P=new WeakMap,W=new WeakMap,V=new WeakMap;function Pr({editingController:o}){const e=le(),t=$(()=>o.editingActive(),[o]),i=t?e.formatMessage({id:"demos.editing.activeInfo"}):e.formatMessage({id:"demos.editing.inactiveInfo"});return r.jsxs(r.Fragment,{children:[r.jsxs(F,{px:1,py:1,children:[r.jsx(Y,{mr:2,isDisabled:t,onClick:()=>{o.startCreateWorkflow()},children:e.formatMessage({id:"demos.editing.startCreateButton"})}),r.jsx(Y,{mr:2,isDisabled:t,onClick:()=>{o.startUpdateWorkflow()},children:e.formatMessage({id:"demos.editing.startUpdateButton"})}),r.jsx(Y,{isDisabled:!t,onClick:()=>{o.stopEditing()},children:e.formatMessage({id:"demos.editing.stopButton"})})]}),r.jsx(F,{px:1,py:1,children:i})]})}function Rr(o){return[Mr(o),gr(o),fr(o),vr(o),br(o),wr(o),Ar(o),yr(o),xr(o),kr(o),Vi(o),Sr(o),Ir(o),zi(o)]}const Dr=we("app::AppModel");var Ee,ge,fe,O,C,Ce,Le,ne,Pt,Rt;class Nr{constructor(e,t,i,s){u(this,ne);u(this,Ee);u(this,ge);u(this,fe);u(this,O);u(this,C);u(this,Ce,Eo(()=>Array.from(a(this,O).values())));u(this,Le,[]);if(h(this,Ee,e),h(this,ge,t),h(this,fe,i),h(this,O,new Map(s.map(l=>[l.id,l]))),a(this,O).size===0)throw new Error("No demos defined.");const n=s[0];h(this,C,re([n,n.createModel()])),x(this,ne,Pt).call(this),a(this,Le).push(x(this,ne,Rt).call(this))}destroy(){a(this,C).value[1].destroy?.()}get currentDemo(){return a(this,C).value[0]}get currentDemoModel(){return a(this,C).value[1]}get allDemoInfos(){return a(this,Ce).value}selectDemo(e){const t=a(this,O).get(e);if(!t)throw new Error(`Demo '${e}' does not exist.`);Co(()=>{const[,i]=a(this,C).value;i.destroy?.(),a(this,C).value=[t,t.createModel()]})}}Ee=new WeakMap,ge=new WeakMap,fe=new WeakMap,O=new WeakMap,C=new WeakMap,Ce=new WeakMap,Le=new WeakMap,ne=new WeakSet,Pt=function(){const t=new URL(window.location.href).searchParams.get("demo");if(t){if(!a(this,O).has(t)){a(this,ge).notify({title:a(this,fe).formatMessage({id:"demoSelection.notFound"},{demoId:t})});return}try{this.selectDemo(t)}catch(i){Dr.error("Failed to select demo from URL",i)}}},Rt=function(){return $e(()=>[a(this,C).value[0].id],([e])=>{const t=new URL(window.location.href);t.searchParams.set("demo",e),window.history.replaceState(null,"",t.toString())},{immediate:!0})};var te,ve,be,Ae,Dt;class Vr{constructor(e){u(this,Ae);u(this,te,re({kind:"loading"}));u(this,ve,[]);u(this,be,!1);const{mapRegistry:t,httpService:i,notifier:s,vectorSelectionSourceFactory:n,editingService:l,notificationService:c}=e.references,d=e.intl;x(this,Ae,Dt).call(this,{mapRegistry:t,httpService:i,notifier:s,vectorSelectionSourceFactory:n,editingService:l,intl:d,notificationService:c}).catch(p=>{a(this,te).value={kind:"error",message:p.message||"Unknown error"}})}destroy(){h(this,be,!0);for(const e of a(this,ve))e.destroy()}get appState(){return a(this,te).value}}te=new WeakMap,ve=new WeakMap,be=new WeakMap,Ae=new WeakSet,Dt=async function(e){const{mapRegistry:t,httpService:i,notifier:s,vectorSelectionSourceFactory:n,editingService:l,intl:c,notificationService:d}=e,p=await t.getMapModel(De);if(!p)throw new Error("No mapModel found.");const g=Rr({intl:c,httpService:i,mapModel:p,vectorSelectionSourceFactory:n,editingService:l,notificationService:d}),m={kind:"ready",appModel:new Nr(p,s,c,g),destroy(){this.appModel.destroy()}};if(a(this,be)){m.destroy();return}a(this,te).value=m,a(this,ve).push(m)};const q=we("local-storage"),Or=0,T={CORRUPTED_DATA:"local-storage:corrupted-data",INVALID_PATH:"local-storage:invalid-path",INVALID_VALUE:"local-storage:invalid-value",NOT_SUPPORTED:"local-storage:not-supported",INTERNAL:"local-storage:internal-error"};var oe,L,z,ie,A,y,Nt,Vt,de,K,Ot;class zr{constructor(e){u(this,y);u(this,oe);u(this,L,{});u(this,z);u(this,ie);u(this,A);h(this,oe,Hr(e.properties)),h(this,z,Ur()),a(this,z)&&(x(this,y,Vt).call(this),h(this,ie,x(this,y,Ot).call(this)))}destroy(){a(this,A)&&(clearTimeout(a(this,A)),h(this,A,void 0)),a(this,z)&&x(this,y,de).call(this)}get isSupported(){return!!a(this,ie)}get(e){return x(this,y,K).call(this).get(e)}set(e,t){return x(this,y,K).call(this).set(e,t)}remove(e){return x(this,y,K).call(this).remove(e)}removeAll(){return x(this,y,K).call(this).removeAll()}getNamespace(e){return x(this,y,K).call(this).getNamespace(e)}}oe=new WeakMap,L=new WeakMap,z=new WeakMap,ie=new WeakMap,A=new WeakMap,y=new WeakSet,Nt=function(){a(this,A)&&clearTimeout(a(this,A)),h(this,A,setTimeout(()=>{h(this,A,void 0),x(this,y,de).call(this)},Or))},Vt=function(){try{const e=a(this,z);if(!e)throw new j(T.INTERNAL,"Local storage is not available.");const t=e.getItem(a(this,oe));if(t==null){h(this,L,{}),x(this,y,de).call(this);return}try{const i=JSON.parse(t);if(!ae(i))throw new j(T.CORRUPTED_DATA,"Persisted value should be an object.");h(this,L,i)}catch(i){q.warn("Invalid persisted data, reverting to default.",i),h(this,L,{}),x(this,y,de).call(this)}}catch(e){q.error("Failed to load from local storage",e)}},de=function(){try{const e=a(this,z);if(!e)throw new j(T.INTERNAL,"Local storage is not available.");const t=JSON.stringify(a(this,L));e.setItem(a(this,oe),t)}catch(e){q.error("Failed to save to local storage",e)}},K=function(){const e=a(this,ie);if(!e)throw new j(T.NOT_SUPPORTED,"Local storage is not supported by this browser.");return e},Ot=function(){const e={getByPath:t=>ht(Fr(a(this,L),t)),setByPath:(t,i)=>{if(!Gr(i))throw new j(T.INVALID_VALUE,"The value is not supported by local storage.");if(i=ht(i),t.length===0){if(!ae(i))throw new j(T.INVALID_VALUE,"The root value must be a plain object.");h(this,L,i)}else Br(a(this,L),t,i);x(this,y,Nt).call(this)}};return new Ye([],e)};class Ye{path;access;constructor(e,t){this.path=e,this.access=t}get(e){return this.access.getByPath([...this.path,e])}set(e,t){this.access.setByPath([...this.path,e],t)}remove(e){this.access.setByPath([...this.path,e],void 0)}removeAll(){this.access.setByPath(this.path,{})}getNamespace(e){const t=this.get(e);if(t===void 0)this.set(e,{});else if(!ae(t))throw new j(T.INVALID_PATH,`Cannot use '${e}' as a namespace because it is not associated with an object.`);return new Ye(this.path.concat([e]),this.access)}}const ut="trails-state";function Fr(o,e){let t=o;for(const i of e){if(!ae(t))throw new j(T.INVALID_PATH,`Cannot get nested property '${i}' because the parent is no object.`);t=t[i]}return t}function Br(o,e,t){if(!e.length)throw new j(T.INTERNAL,"Path must not be empty.");let i=o;for(let n=0,l=e.length-1;n"u"){q.warn("Local storage is not supported by this browser.");return}try{const o=globalThis.localStorage;if(!o){q.warn("Local storage is not supported by this browser.");return}return o}catch(o){q.warn("Local storage is not supported by this browser.",o);return}}function ht(o){return o!=null&&(o=JSON.parse(JSON.stringify(o))),o}const Wr={"showcase-app":{name:"showcase-app",services:{MapConfigProviderImpl:{name:"MapConfigProviderImpl",clazz:Ai,provides:[{name:"map.MapConfigProvider",qualifier:void 0}],references:{vectorSourceFactory:{name:"ogc-features.VectorSourceFactory",qualifier:void 0,all:!1}}},AppInitModel:{name:"AppInitModel",clazz:Vr,provides:[{name:"app.AppInitModel",qualifier:void 0}],references:{httpService:{name:"http.HttpService",qualifier:void 0,all:!1},mapRegistry:{name:"map.MapRegistry",qualifier:void 0,all:!1},notifier:{name:"notifier.NotificationService",qualifier:void 0,all:!1},vectorSelectionSourceFactory:{name:"selection.VectorSelectionSourceFactory",qualifier:void 0,all:!1},editingService:{name:"editing.EditingService",qualifier:void 0,all:!1},notificationService:{name:"notifier.NotificationService",qualifier:void 0,all:!1}}}},ui:{references:[{name:"app.AppInitModel",qualifier:void 0,all:!1},{name:"runtime.ApplicationContext",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/chakra-integration":{name:"@open-pioneer/chakra-integration",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime":{name:"@open-pioneer/runtime",services:{},ui:{references:[]},properties:{}},"@open-pioneer/react-utils":{name:"@open-pioneer/react-utils",services:{},ui:{references:[]},properties:{}},"@open-pioneer/http":{name:"@open-pioneer/http",services:{HttpServiceImpl:{name:"HttpServiceImpl",clazz:Lo,provides:[{name:"http.HttpService",qualifier:"http.HttpService"}],references:{interceptors:{name:"http.Interceptor",qualifier:void 0,all:!0}}}},ui:{references:[]},properties:{}},"@open-pioneer/notifier":{name:"@open-pioneer/notifier",services:{NotificationServiceImpl:{name:"NotificationServiceImpl",clazz:mi,provides:[{name:"notifier.NotificationService",qualifier:"notifier.NotificationService"}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/reactivity":{name:"@open-pioneer/reactivity",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map":{name:"@open-pioneer/map",services:{MapRegistryImpl:{name:"MapRegistryImpl",clazz:Ao,provides:[{name:"map.MapRegistry",qualifier:void 0}],references:{providers:{name:"map.MapConfigProvider",qualifier:void 0,all:!0},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/ogc-features":{name:"@open-pioneer/ogc-features",services:{VectorSourceFactory:{name:"VectorSourceFactory",clazz:si,provides:[{name:"ogc-features.VectorSourceFactory",qualifier:void 0}],references:{httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}},SearchSourceFactory:{name:"SearchSourceFactory",clazz:ai,provides:[{name:"ogc-features.SearchSourceFactory",qualifier:void 0}],references:{httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[]},properties:{}},"@open-pioneer/coordinate-viewer":{name:"@open-pioneer/coordinate-viewer",services:{},ui:{references:[]},properties:{}},"@open-pioneer/overview-map":{name:"@open-pioneer/overview-map",services:{},ui:{references:[]},properties:{}},"@open-pioneer/scale-bar":{name:"@open-pioneer/scale-bar",services:{},ui:{references:[]},properties:{}},"@open-pioneer/scale-viewer":{name:"@open-pioneer/scale-viewer",services:{},ui:{references:[]},properties:{}},"@open-pioneer/result-list":{name:"@open-pioneer/result-list",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map-navigation":{name:"@open-pioneer/map-navigation",services:{},ui:{references:[]},properties:{}},"@open-pioneer/toc":{name:"@open-pioneer/toc",services:{},ui:{references:[]},properties:{}},"@open-pioneer/editing":{name:"@open-pioneer/editing",services:{EditingServiceImpl:{name:"EditingServiceImpl",clazz:$o,provides:[{name:"editing.EditingService",qualifier:void 0}],references:{mapRegistry:{name:"map.MapRegistry",qualifier:void 0,all:!1},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[]},properties:{polygonStyle:{value:{"fill-color":"rgba(255,255,255,0.4)","stroke-color":"red","stroke-width":1.25,"circle-radius":3,"circle-fill-color":"red","circle-stroke-width":1.25,"circle-stroke-color":"red"},required:!1},vertexStyle:{value:{"circle-radius":3,"circle-fill-color":"red","circle-stroke-width":1.25,"circle-stroke-color":"red"},required:!1}}},"@open-pioneer/geolocation":{name:"@open-pioneer/geolocation",services:{},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/legend":{name:"@open-pioneer/legend",services:{},ui:{references:[]},properties:{}},"@open-pioneer/measurement":{name:"@open-pioneer/measurement",services:{},ui:{references:[]},properties:{}},"@open-pioneer/printing":{name:"@open-pioneer/printing",services:{PrintingServiceImpl:{name:"PrintingServiceImpl",clazz:gi,provides:[{name:"printing.PrintingService",qualifier:void 0}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1},{name:"printing.PrintingService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/scale-setter":{name:"@open-pioneer/scale-setter",services:{},ui:{references:[]},properties:{}},"@open-pioneer/search":{name:"@open-pioneer/search",services:{},ui:{references:[]},properties:{}},"@open-pioneer/selection":{name:"@open-pioneer/selection",services:{VectorSelectionSourceFactory:{name:"VectorSelectionSourceFactory",clazz:Ko,provides:[{name:"selection.VectorSelectionSourceFactory",qualifier:void 0}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/spatial-bookmarks":{name:"@open-pioneer/spatial-bookmarks",services:{},ui:{references:[{name:"local-storage.LocalStorageService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/base-theme":{name:"@open-pioneer/base-theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime-react-support":{name:"@open-pioneer/runtime-react-support",services:{},ui:{references:[]},properties:{}},"@open-pioneer/core":{name:"@open-pioneer/core",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map-ui-components":{name:"@open-pioneer/map-ui-components",services:{},ui:{references:[]},properties:{}},"@open-pioneer/basemap-switcher":{name:"@open-pioneer/basemap-switcher",services:{},ui:{references:[]},properties:{}},"@open-pioneer/local-storage":{name:"@open-pioneer/local-storage",services:{LocalStorageServiceImpl:{name:"LocalStorageServiceImpl",clazz:zr,provides:[{name:"local-storage.LocalStorageService",qualifier:"local-storage.LocalStorageService"}],references:{}}},ui:{references:[]},properties:{storageId:{value:null,required:!1}}}},qr=':root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.map-container .ol-viewport .ol-attribution{bottom:var(--map-padding-bottom);right:var(--map-padding-right)}.editing-tooltip{position:relative;background:#fffc;border-radius:4px;color:#000;padding:4px 8px;opacity:1;white-space:nowrap;font-size:12px;cursor:default;-webkit-user-select:none;user-select:none;font-weight:700}.editing-tooltip-hidden{visibility:hidden}.measurement-tooltip{position:relative;background:#fffc;border-radius:4px;color:#000;padding:4px 8px;opacity:1;white-space:nowrap;font-size:12px;cursor:default;-webkit-user-select:none;user-select:none;font-weight:700}.measurement-active-tooltip{background:#000000e6;border-radius:4px;border-color:#000000e6;opacity:.9;color:#fff}.measurement-finished-tooltip{background-color:#4cb3ffe6;color:#000;border:1px solid white}.measurement-active-tooltip:before,.measurement-finished-tooltip:before{border-top:6px solid rgba(0,0,0,.9);border-right:6px solid transparent;border-left:6px solid transparent;content:"";position:absolute;bottom:-6px;margin-left:-7px;left:50%}.measurement-finished-tooltip:before{border-top-color:#4cb3ff}.printing-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:10000;-webkit-user-select:none;user-select:none;pointer-events:all;cursor:wait;display:flex;flex-direction:row;align-items:center;justify-content:center;background-color:#b4b4b4cc}.printing-overlay-status{flex:1 1 auto;font-size:1.5em;text-align:center}.printing-scale-bar.ol-scale-bar{left:var(--printing-scale-bar-left);bottom:var(--printing-scale-bar-bottom)}.search-component .chakra-divider{display:none}.search-component .search-highlighted-match{font-weight:700}.search-component .search-value-container{cursor:text;padding-left:30px!important}.search-component .search-invisible{display:none}.selection-drag-box{background-color:#ffffff4d!important;border:3px solid var(--chakra-colors-background_primary)!important}.selection-tooltip{position:relative;background:#fffc;border-radius:4px;color:#000;padding:4px 8px;opacity:1;white-space:nowrap;font-size:12px;cursor:default;-webkit-user-select:none;user-select:none;font-weight:700}.selection .react-select{cursor:default}.map-container .selection-active{cursor:crosshair}.map-container .selection-inactive{cursor:no-drop}.selection-source-value.selection-source-value--disabled{opacity:.4}.selection-source-value.selection-source-value--disabled span{margin:0 6px 0 0}.map-anchor.main-map-anchor{overflow-x:hidden;overflow-y:auto}.map-container:focus-visible{outline:none}.map-container:focus-visible:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;border:3px solid var(--chakra-colors-trails-500)}@media screen and (max-width: 48em){.map-anchor.main-map-anchor{max-height:45%}}.overview-map .ol-overviewmap{position:relative;height:100%;width:100%}.overview-map .ol-overviewmap:not(.ol-collapsed){border:1px solid black}.overview-map .ol-overviewmap .ol-overviewmap-map{border:none;width:100%;height:100%}.overview-map .ol-overviewmap .ol-overviewmap-box{border:2px solid red}.scale-bar .ol-scale-bar{margin-bottom:8px;margin-right:8px}.scale-bar .ol-scale-bar,.scale-bar .ol-scale-line{position:relative;bottom:0;left:0;background:none}.scale-bar .ol-scale-bar .ol-scale-bar-inner,.scale-bar .ol-scale-bar .ol-scale-line-inner,.scale-bar .ol-scale-line .ol-scale-bar-inner,.scale-bar .ol-scale-line .ol-scale-line-inner{color:var(--chakra-white);border-color:var(--chakra-white)}.result-list-no-data-message{text-align:center;margin-top:50px;font-weight:700;font-size:larger}.result-list-table th,.result-list-table td{overflow-wrap:break-word}.result-list-table.result-list-table--is-resizing *{cursor:col-resize}.result-list-table thead{position:sticky;top:0;z-index:1;background:var(--chakra-colors-background_body)}.result-list-table th{position:relative;border-right-width:thin}.result-list-table tbody tr:hover{background:var(--chakra-colors-background_light)}.result-list-table .result-list-resizer{position:absolute;top:0;height:100%;right:0;width:8px;background:var(--chakra-colors-trails-100);transform:scaleX(.25);cursor:col-resize;-webkit-user-select:none;user-select:none;touch-action:none;padding-left:0}.result-list-table th:last-child .result-list-resizer{width:8px;transform:translate(50%) scaleX(.25)}.result-list-table th .result-list-resizer.result-list-resizer--is-resizing{background:var(--chakra-colors-trails-500);transform:scale(1)}.result-list-table th .result-list-resizer:hover{transform:scale(1)}',$r=["en","de"];function Kr(o){switch(o){case"en":return st(()=>import("./DfytJBTHC9Fu.js"),[],import.meta.url).then(e=>e.default);case"de":return st(()=>import("./BaIyqT_8vxnW.js"),[],import.meta.url).then(e=>e.default)}throw new Error(`Unsupported locale: '${o}'`)}const Yr=Wt(qr),Zr=Object.freeze(Object.defineProperty({__proto__:null,loadMessages:Kr,locales:$r,packages:Wr,styles:Yr},Symbol.toStringTag,{value:"Module"}));function zt({label:o,children:e}){return r.jsxs(fi,{as:vi,maxWidth:{base:"none",md:"20em"},width:{base:"100%",sm:"47%",md:void 0},children:[r.jsx(bi,{flexBasis:{base:"8em",sm:"auto"},m:0,children:o}),e]})}const Xr=we("app::DemoSelection");function Jr({appModel:o}){const e=le(),{allDemos:t,currentDemo:i}=$(()=>({allDemos:o.allDemoInfos,currentDemo:o.currentDemo}),[o]),s=b.useMemo(()=>t.map(n=>r.jsx("option",{value:n.id,children:n.title},n.id)),[t]);return r.jsx(zt,{label:e.formatMessage({id:"demoSelection.label"}),children:r.jsx(_t,{value:i.id,onChange:n=>{const l=n.target.value;try{o.selectDemo(l)}catch(c){Xr.error("Failed to select demo",c)}},children:s})})}function Qr(){const o=le(),e=Tt("runtime.ApplicationContext"),t=es(e.getLocale()),i=s=>{switch(s){case"en":e.setLocale("en-GB");break;case"de":e.setLocale("de-DE");break}};return r.jsx(zt,{label:o.formatMessage({id:"localeSwitcher.label"}),children:r.jsxs(_t,{value:t,onChange:s=>i(s.target.value),children:[r.jsx("option",{value:"de",children:o.formatMessage({id:"localeSwitcher.locale.de"})}),r.jsx("option",{value:"en",children:o.formatMessage({id:"localeSwitcher.locale.en"})})]})})}function es(o){const e=o.match(/^[a-z]+/i)?.[0];if(e==="en"||e=="de")return e;throw new Error("unexpected locale prefix: "+e)}function ts({appModel:o}){const e=le();return r.jsxs(F,{as:"header",px:2,py:3,flexWrap:{base:"wrap",md:"nowrap"},alignItems:"baseline",gap:2,boxShadow:"1px 0px 3px rgba(0, 0, 0, 0.5)",bgColor:"white",zIndex:100,children:[r.jsx(Ge,{size:"md",flexShrink:0,flexGrow:1,textAlign:{base:"center",md:"left"},width:{base:"100%",md:"auto"},mb:{base:2,md:0},children:e.formatMessage({id:"header.title"})}),r.jsx(Jr,{appModel:o}),r.jsx(Qr,{})]})}function os(){const o=Tt("app.AppInitModel"),e=$(()=>o.appState,[o]);let t;switch(e.kind){case"loading":t="Loading...";break;case"error":t="Error: "+e.message;break;case"ready":t=r.jsx(is,{state:e})}return t}function is(o){const e=le(),t=o.state.appModel,{currentDemo:i,currentDemoModel:s}=$(()=>({currentDemo:t.currentDemo,currentDemoModel:t.currentDemoModel}),[t]),n=$(()=>s.listContainer,[s]),l=b.useMemo(()=>({left:0,right:0,bottom:n!=null?400:0,top:0}),[n]);return r.jsxs(r.Fragment,{children:[r.jsx(Yo,{position:"top-right"}),r.jsx(F,{height:"100%",direction:"column",children:r.jsx(Se,{title:r.jsx(ts,{appModel:t}),children:r.jsx(F,{flex:"1",direction:"column",position:"relative",children:r.jsx(jo,{mapId:De,children:r.jsxs(To,{viewPadding:l,role:"main","aria-label":e.formatMessage({id:"ariaLabels.map"}),children:[r.jsx(rt,{className:"main-map-anchor",position:"top-left",horizontalGap:10,verticalGap:10,children:r.jsx(R,{bgColor:"white",borderRadius:10,p:2,maxW:"500px",children:r.jsxs(Se,{title:i.title,sectionHeadingProps:{size:"lg"},children:[r.jsx(Re,{py:4,dangerouslySetInnerHTML:{__html:s.description}}),s.mainWidget]})})}),r.jsx(rt,{position:"bottom-right",horizontalGap:6,children:r.jsx(He,{p:1,children:s.tools})}),n&&r.jsx(R,{className:"list-container",position:"absolute",bottom:"0",backgroundColor:"white",width:"100%",height:"400px",zIndex:1,borderTop:"2px solid",borderColor:"trails.100",children:n})]})})})})})]})}const rs=new URLSearchParams(window.location.search),ss=rs.get("lang")||void 0,as=qt({component:os,appMetadata:Zr,config:{properties:{"@open-pioneer/local-storage":{storageId:"ol-showcase-state"}},locale:ss}});customElements.define("showcase-app",as); diff --git a/openlayers-base-packages/pr-previews/pr-371/assets/CkVP7suqMB2J.js b/openlayers-base-packages/pr-previews/pr-371/assets/CkfVk3yAXsDv.js similarity index 98% rename from openlayers-base-packages/pr-previews/pr-371/assets/CkVP7suqMB2J.js rename to openlayers-base-packages/pr-previews/pr-371/assets/CkfVk3yAXsDv.js index 7b017ef..b8d14a8 100644 --- a/openlayers-base-packages/pr-previews/pr-371/assets/CkVP7suqMB2J.js +++ b/openlayers-base-packages/pr-previews/pr-371/assets/CkfVk3yAXsDv.js @@ -16,4 +16,4 @@ ${s}`)!==100){const l=e.replace("{font-family}",s.replace(/ /g,"-").toLowerCase( `)return B.push(` `,""),B;if(N==2){B.push(Ar(Y,ot),K);return}Y=Dr(Y,K,tr,ot).split(` `);for(let fe=0,ue=Y.length;fe0&&B.push(` -`,""),B.push(Y[fe],K);return B},[]):te=Tr(W,j).trim(),Te=z(v,"paint","text-opacity",b,T,m,x)}if(te&&Te&&!er){kt||(++U,w=S[U],(!w||!w.getText()||w.getFill()||w.getStroke())&&(w=new Ie,S[U]=w),w.setImage(void 0),w.setGeometry(void 0));const H=ti(v,b,T,"text",m);w.getText()||w.setText(q),q=w.getText(),(!q||"getDeclutterMode"in q&&q.getDeclutterMode()!==H)&&(q=new Jo({padding:[2,2,2,2],declutterMode:H}),w.setText(q));const W=z(v,"layout","text-transform",b,T,m,x);W=="uppercase"?te=Array.isArray(te)?te.map((ne,at)=>at%2?ne:ne.toUpperCase()):te.toUpperCase():W=="lowercase"&&(te=Array.isArray(te)?te.map((ne,at)=>at%2?ne:ne.toLowerCase()):te.toLowerCase());const B=Array.isArray(te)?te:N==2?Ar(te,ot):Dr(te,nt,tr,ot);q.setText(B),q.setFont(nt),q.setRotation(xr(z(v,"layout","text-rotate",b,T,m,x)));const X=z(v,"layout","text-anchor",b,T,m,x),D=kt||N==1?"point":z(v,"layout","symbol-placement",b,T,m,x);let O;if(D==="line-center"?(q.setPlacement("line"),O="center"):q.setPlacement(D),D==="line"&&typeof q.setRepeat=="function"){const ne=z(v,"layout","symbol-spacing",b,T,m,x);q.setRepeat(ne*2)}q.setOverflow(D==="point");let K=z(v,"paint","text-halo-width",b,T,m,x);const Y=z(v,"layout","text-offset",b,T,m,x),fe=z(v,"paint","text-translate",b,T,m,x);let ue=0,oe=0;if(D=="point"){O="center",X.indexOf("left")!==-1?(O="left",oe=K):X.indexOf("right")!==-1&&(O="right",oe=-K);const ne=z(v,"layout","text-rotation-alignment",b,T,m,x);q.setRotateWithView(ne=="map")}else q.setMaxAngle(xr(z(v,"layout","text-max-angle",b,T,m,x))*te.length/B.length),q.setRotateWithView(!1);q.setTextAlign(O);let ae="middle";X.indexOf("bottom")==0?(ae="bottom",ue=-K-.5*(it-1)*Ce):X.indexOf("top")==0&&(ae="top",ue=K+.5*(it-1)*Ce),q.setTextBaseline(ae);const J=z(v,"layout","text-justify",b,T,m,x);q.setJustify(J==="auto"?void 0:J),q.setOffsetX(Y[0]*Ce+oe+fe[0]),q.setOffsetY(Y[1]*Ce+ue+fe[1]),F.setColor(Ee(z(v,"paint","text-color",b,T,m,x),Te)),q.setFill(F);const he=Ee(z(v,"paint","text-halo-color",b,T,m,x),Te);if(he&&K>0){E.setColor(he),K*=2;const ne=.5*Ce;E.setWidth(K<=ne?K:ne),q.setStroke(E)}else q.setStroke(void 0);const me=z(v,"layout","text-padding",b,T,m,x),ye=q.getPadding();me!==ye[0]&&(ye[0]=me,ye[1]=me,ye[2]=me,ye[3]=me),w.setZIndex($e)}}}if(U>-1)return S.length=U+1,S};return t.setStyle($),t.set("mapbox-source",C),t.set("mapbox-layers",f),t.set("mapbox-featurestate",t.get("mapbox-featurestate")||{}),$}function Ul(t,e=512){return t.getExtent()?$r({extent:t.getExtent(),tileSize:e,maxZoom:22}).getResolutions():Yt}function Zl(t,e){return e.accessToken||(e=Object.assign({},e),new URL(t).searchParams.forEach((n,i)=>{e.accessToken=n,e.accessTokenParam=i})),e}function Hl(t,e,r="",n={},i=void 0){let o,a,s,l,u=!0;return typeof r!="string"&&!Array.isArray(r)?(s=r,l=s.source||s.layers,n=s):l=r,typeof n=="string"?(o=n,s={}):(o=n.styleUrl,s=n),s.updateSource===!1&&(u=!1),i||(i=s.resolutions),!o&&typeof e=="string"&&!e.trim().startsWith("{")&&(o=e),o&&(o=o.startsWith("data:")?location.href:Ui(o,s.accessToken),s=Zl(o,s)),new Promise(function(c,p){Hi(e,s).then(function(d){if(d.version!=8)return p(new Error("glStyle version 8 required."));if(!(t instanceof Fr||t instanceof pt))return p(new Error("Can only apply to VectorLayer or VectorTileLayer"));const f=t instanceof pt?"vector":"geojson";if(l?Array.isArray(l)?a=d.layers.find(function(F){return F.id===l[0]}).source:a=l:(a=Object.keys(d.sources).find(function(F){return d.sources[F].type===f}),l=a),!a)return p(new Error(`No ${f} source found in the glStyle.`));function h(){if(!u)return Promise.resolve();if(t instanceof pt)return Ql(d.sources[a],o,s).then(function(k){const I=t.getSource();I?k!==I&&(I.setTileUrlFunction(k.getTileUrlFunction()),typeof I.setUrls=="function"&&typeof k.getUrls=="function"&&I.setUrls(k.getUrls()),I.format_||(I.format_=k.format_),I.getAttributions()||I.setAttributions(k.getAttributions()),I.getTileLoadFunction()===di&&I.setTileLoadFunction(k.getTileLoadFunction()),Ho(I.getProjection(),k.getProjection())&&(I.tileGrid=k.getTileGrid())):t.setSource(k);const A=t.getSource().getTileGrid();!isFinite(t.getMaxResolution())&&!isFinite(t.getMinZoom())&&A.getMinZoom()>0&&t.setMaxResolution(Ml(Math.max(0,A.getMinZoom()-1e-12),A.getResolutions()))});const F=d.sources[a];let S=t.getSource();(!S||S.get("mapbox-source")!==F)&&(S=tu(F,o,s));const $=t.getSource();return $?S!==$&&($.getAttributions()||$.setAttributions(S.getAttributions()),$.format_||($.format_=S.getFormat()),$.url_=S.getUrl()):t.setSource(S),Promise.resolve()}let g,m,_,C;function E(){if(!C&&(!d.sprite||m)){if(s.projection&&!i){const S=Ke(s.projection).getUnits();S!=="m"&&(i=Yt.map($=>$/Go[S]))}C=Bl(t,d,l,i,m,_,(F,S=s.webfonts)=>$l(F,S),s.getImage),t.getStyle()?h().then(c).catch(p):p(new Error(`Nothing to show for source [${a}]`))}else C?(t.setStyle(C),h().then(c).catch(p)):p(new Error("Something went wrong trying to apply style."))}if(d.sprite){const F=new URL(Fl(d.sprite,s.accessToken,o||location.href));g=window.devicePixelRatio>=1.5?.5:1;const S=g==.5?"@2x":"";let $=F.origin+F.pathname+S+".json"+F.search;new Promise(function(k,I){Ye("Sprite",$,s).then(k).catch(function(A){$=F.origin+F.pathname+".json"+F.search,Ye("Sprite",$,s).then(k).catch(I)})}).then(function(k){if(k===void 0&&p(new Error("No sprites found.")),m=k,_=F.origin+F.pathname+S+".png"+F.search,s.transformRequest){const I=s.transformRequest(_,"SpriteImage")||_;(I instanceof Request||I instanceof Promise)&&(_=I)}E()}).catch(function(k){p(new Error(`Sprites cannot be loaded: ${$}: ${k.message}`))})}else E()}).catch(p)})}const ri={};function Wl(t,e,r){e.layers.some(function(n){if(n.type==="background"){if(t instanceof ui)return t.setBackground(function(i){return Xi(n,i,r,{})}),!0;if(t instanceof No||t instanceof Vo)return t.getLayers().insertAt(0,Yl(n,r,{})),!0}})}function Xl(t,e,r={}){return Hi(e,r).then(function(n){Wl(t,n,r)})}function Jl(t,e){const r=t.bounds;if(r){const n=Tn([r[0],r[1]],e),i=Tn([r[2],r[3]],e);return[n[0],n[1],i[0],i[1]]}return Ke(e).getExtent()}function Kl(t,e,r){const n=new xa({tileJSON:e,tileSize:t.tileSize||e.tileSize||512}),i=n.getTileJSON(),o=n.getTileGrid(),a=Ke(r.projection||"EPSG:3857"),s=Jl(i,a),l=a.getExtent(),u=i.minzoom||0,c=i.maxzoom||22,p={attributions:n.getAttributions(),projection:a,tileGrid:new ai({origin:l?li(l):o.getOrigin(0),extent:s||o.getExtent(),minZoom:u,resolutions:Ul(a,e.tileSize).slice(0,c+1),tileSize:o.getTileSize(0)})};return Array.isArray(i.tiles)?p.urls=i.tiles:p.url=i.tiles,p}function Xi(t,e,r,n){const i={id:t.id,type:t.type},o=t.layout||{},a=t.paint||{};i.paint=a;const s=Zi(e,r.resolutions||Yt);let l;const u=z(i,"paint","background-color",s,ri,n);return a["background-opacity"]!==void 0&&(l=z(i,"paint","background-opacity",s,ri,n)),o.visibility=="none"?void 0:Ee(u,l)}function Yl(t,e,r){const n=document.createElement("div");return n.className="ol-mapbox-style-background",n.style.position="absolute",n.style.width="100%",n.style.height="100%",new ui({source:new Bo({}),render(i){const o=Xi(t,i.viewState.resolution,e,r);return n.style.backgroundColor=o,n}})}function Ql(t,e,r){return new Promise(function(n,i){Rl(t,e,r).then(function({tileJson:o,tileLoadFunction:a}){const s=Kl(t,o,r);s.tileLoadFunction=a,s.format=new qr,n(new Lr(s))}).catch(i)})}function eu(t){return`{bbox-${(t?t.getCode():"EPSG:3857").toLowerCase().replace(/[^a-z0-9]/g,"-")}}`}function tu(t,e,r){const n=r.projection?new Sn({dataProjection:r.projection}):new Sn,i=t.data,o={};if(typeof i=="string"){const s=At(i,r.accessToken,r.accessTokenParam||"access_token",e||location.href);if(/\{bbox-[0-9a-z-]+\}/.test(s)){const u=(p,d,f)=>{const h=eu(f);return s.replace(h,`${p.join(",")}`)},c=new ir({attributions:t.attribution,format:n,loader:(p,d,f,h,g)=>{const m=typeof u=="function"?u(p,d,f):u;Ye("GeoJSON",m,r).then(_=>{const C=c.getFormat().readFeatures(_,{featureProjection:f});c.addFeatures(C),h(C)}).catch(_=>{c.removeLoadedExtent(p),g()})},strategy:Wo});return c.set("mapbox-source",t),c}const l=new ir({attributions:t.attribution,format:n,url:s,loader:(u,c,p,d,f)=>{Ye("GeoJSON",s,r).then(h=>{const g=l.getFormat().readFeatures(h,{featureProjection:p});l.addFeatures(g),d(g)}).catch(h=>{l.removeLoadedExtent(u),f()})}});return l}o.features=n.readFeatures(i,{featureProjection:"EPSG:3857"});const a=new ir(Object.assign({attributions:t.attribution,format:n},o));return a.set("mapbox-source",t),a}class ru extends qo{constructor(e){super(kr.ERROR),this.error=e}}class nu extends pt{constructor(e){const r="declutter"in e?e.declutter:!0,n=new Lr({state:"loading",format:new qr});super({source:n,background:e.background===!1?null:e.background,declutter:r,className:e.className,opacity:e.opacity,visible:e.visible,zIndex:e.zIndex,minResolution:e.minResolution,maxResolution:e.maxResolution,minZoom:e.minZoom,maxZoom:e.maxZoom,renderOrder:e.renderOrder,renderBuffer:e.renderBuffer,renderMode:e.renderMode,map:e.map,updateWhileAnimating:e.updateWhileAnimating,updateWhileInteracting:e.updateWhileInteracting,preload:e.preload,useInterimTilesOnError:e.useInterimTilesOnError,properties:e.properties}),e.accessToken&&(this.accessToken=e.accessToken);const i=e.styleUrl,o=[Hl(this,i,e.layers||e.source,{accessToken:this.accessToken})];this.getBackground()===void 0&&o.push(Xl(this,e.styleUrl,{accessToken:this.accessToken})),Promise.all(o).then(()=>{n.setState("ready")}).catch(a=>{this.dispatchEvent(new ru(a)),this.getSource().setState("error")})}}const Ve="main";class iu{mapId=Ve;vectorSourceFactory;constructor({references:e}){this.vectorSourceFactory=e.vectorSourceFactory}async getMapConfig(){return{projection:"EPSG:3857",initialView:{kind:"position",center:{x:848890,y:6793350},zoom:13},layers:[new st({title:"OSM",visible:!0,isBaseLayer:!0,olLayer:new Ko({source:new Yo})}),new st({id:"inspire-us-kindergarten",title:"Kindertageseinrichtungen in NRW",visible:!0,olLayer:new Fr({style:new Ie({image:new ci({fill:new Be({color:"blue"}),radius:5})}),source:this.vectorSourceFactory.createVectorSource({baseUrl:"https://ogc-api.nrw.de/inspire-us-kindergarten/v1",collectionId:"governmentalservice",crs:"http://www.opengis.net/def/crs/EPSG/0/3857",attributions:"Datenlizenz Deutschland - Namensnennung - Version 2.0"})})}),new st({id:"ogc_katasterbezirk",title:"Liegenschaftskatasterbezirke in NRW (viele Daten)",visible:!1,olLayer:new Fr({source:this.vectorSourceFactory.createVectorSource({baseUrl:"https://ogc-api.nrw.de/lika/v1",collectionId:"katasterbezirk",limit:1e3,crs:"http://www.opengis.net/def/crs/EPSG/0/3857",attributions:"Datenlizenz Deutschland - Namensnennung - Version 2.0"})})}),new st({title:"Abschnitte / Äste mit Unfällen (Mapbox Style)",visible:!1,olLayer:new nu({styleUrl:"https://demo.ldproxy.net/strassen/styles/default?f=mbs"})}),new st({title:"Pendleratlas",visible:!0,olLayer:new pt({source:new Lr({url:"https://pendleratlas.statistikportal.de/_vector_tiles/2022/vg250/{z}/{x}/{y}.pbf",format:new qr,projection:"EPSG:3857",attributions:`© Statistische Ämter der Länder ${new Date().getFullYear()} | GeoBasis-DE/BKG ${new Date().getFullYear()}`}),style:new Ie({fill:new Be({color:"rgba(173, 209, 158, 0.6)"}),stroke:new ut({color:"#2d7d9f",width:3})})})})]}}}class ou{beforeRequest({target:e,options:r}){e.protocol==="https:"&&e.hostname==="ogc-api.nrw.de"&&r.headers.set("Authorization","Bearer 12345")}}const au={"ogc-api-app":{name:"ogc-api-app",services:{MapConfigProviderImpl:{name:"MapConfigProviderImpl",clazz:iu,provides:[{name:"map.MapConfigProvider",qualifier:void 0}],references:{vectorSourceFactory:{name:"ogc-features.VectorSourceFactory",qualifier:void 0,all:!1}}},SampleTokenInterceptor:{name:"SampleTokenInterceptor",clazz:ou,provides:[{name:"http.Interceptor",qualifier:void 0}],references:{}}},ui:{references:[]},properties:{}},"@open-pioneer/basemap-switcher":{name:"@open-pioneer/basemap-switcher",services:{},ui:{references:[]},properties:{}},"@open-pioneer/chakra-integration":{name:"@open-pioneer/chakra-integration",services:{},ui:{references:[]},properties:{}},"@open-pioneer/http":{name:"@open-pioneer/http",services:{HttpServiceImpl:{name:"HttpServiceImpl",clazz:Qo,provides:[{name:"http.HttpService",qualifier:"http.HttpService"}],references:{interceptors:{name:"http.Interceptor",qualifier:void 0,all:!0}}}},ui:{references:[]},properties:{}},"@open-pioneer/map":{name:"@open-pioneer/map",services:{MapRegistryImpl:{name:"MapRegistryImpl",clazz:ea,provides:[{name:"map.MapRegistry",qualifier:void 0}],references:{providers:{name:"map.MapConfigProvider",qualifier:void 0,all:!0},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/map-navigation":{name:"@open-pioneer/map-navigation",services:{},ui:{references:[]},properties:{}},"@open-pioneer/ogc-features":{name:"@open-pioneer/ogc-features",services:{VectorSourceFactory:{name:"VectorSourceFactory",clazz:ca,provides:[{name:"ogc-features.VectorSourceFactory",qualifier:void 0}],references:{httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}},SearchSourceFactory:{name:"SearchSourceFactory",clazz:pa,provides:[{name:"ogc-features.SearchSourceFactory",qualifier:void 0}],references:{httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[]},properties:{}},"@open-pioneer/react-utils":{name:"@open-pioneer/react-utils",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime":{name:"@open-pioneer/runtime",services:{},ui:{references:[]},properties:{}},"@open-pioneer/theme":{name:"@open-pioneer/theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/toc":{name:"@open-pioneer/toc",services:{},ui:{references:[]},properties:{}},"@open-pioneer/reactivity":{name:"@open-pioneer/reactivity",services:{},ui:{references:[]},properties:{}},"@open-pioneer/core":{name:"@open-pioneer/core",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map-ui-components":{name:"@open-pioneer/map-ui-components",services:{},ui:{references:[]},properties:{}},"@open-pioneer/base-theme":{name:"@open-pioneer/base-theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime-react-support":{name:"@open-pioneer/runtime-react-support",services:{},ui:{references:[]},properties:{}}},su=':root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.map-container .ol-viewport .ol-attribution{bottom:var(--map-padding-bottom);right:var(--map-padding-right)}',lu=["en","de"];function uu(t){switch(t){case"en":return Cn(()=>import("./Bi5QOsk-GySW.js"),[],import.meta.url).then(e=>e.default);case"de":return Cn(()=>import("./wAUNb4P8esoo.js"),[],import.meta.url).then(e=>e.default)}throw new Error(`Unsupported locale: '${t}'`)}const cu=eo(su),pu=Object.freeze(Object.defineProperty({__proto__:null,loadMessages:uu,locales:lu,packages:au,styles:cu},Symbol.toStringTag,{value:"Module"})),du="ogc-api-app",fu=ta.bind(void 0,du);function hu(){const t=fu();return Q.jsx(or,{height:"100%",direction:"column",overflow:"hidden",children:Q.jsx(kn,{title:Q.jsx(zn,{textAlign:"center",py:1,children:Q.jsx(Fn,{size:"md",children:"Open Pioneer - OGC API Features and OGC API Tiles Sample"})}),children:Q.jsx(or,{flex:"1",direction:"column",position:"relative",children:Q.jsxs(ra,{mapId:Ve,children:[Q.jsx(ar,{position:"top-left",horizontalGap:20,verticalGap:20,children:Q.jsx(zn,{backgroundColor:"white",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",children:Q.jsx(kn,{title:Q.jsx(Fn,{size:"md",children:t.formatMessage({id:"tocTitle"})}),children:Q.jsx(oa,{mapId:Ve,basemapSwitcherProps:{allowSelectingEmptyBasemap:!0}})})})}),Q.jsx(ar,{position:"top-right",horizontalGap:10,verticalGap:10,children:Q.jsxs(ma,{backgroundColor:"whiteAlpha.900",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",maxWidth:"400px",children:[Q.jsx(sr,{as:"b",children:"Description"}),Q.jsx(sr,{children:"This application can be used to test OGC API Features and OGC API Tiles."}),Q.jsx(sr,{children:"Vector Tiles cannot be reprojected and require the map to use the same projection. Currently all known MVT vector tile sets are using WebMercator, making them unusable in the Default Sample App which uses ETRS89/UTM zone 32N. This Sample App uses WebMercator."})]})}),Q.jsx(ar,{position:"bottom-right",horizontalGap:10,verticalGap:30,children:Q.jsxs(or,{direction:"column",gap:1,padding:1,children:[Q.jsx(da,{mapId:Ve}),Q.jsx(fa,{mapId:Ve}),Q.jsx(ha,{mapId:Ve})]})})]})})})})}const mu=to({component:hu,theme:ro,appMetadata:pu,async resolveConfig(t){const e=t.getAttribute("forced-locale");if(e)return{locale:e}}});customElements.define("ogc-api-app",mu);const yu=document.getElementsByTagName("body")[0];gu();function gu(){const t=window.location.search,r=new URLSearchParams(t).get("lang"),n=document.createElement("ogc-api-app");n.classList.add("full-height"),n.setAttribute("id","test"),r&&n.setAttribute("forced-locale",r),yu.appendChild(n)} +`,""),B.push(Y[fe],K);return B},[]):te=Tr(W,j).trim(),Te=z(v,"paint","text-opacity",b,T,m,x)}if(te&&Te&&!er){kt||(++U,w=S[U],(!w||!w.getText()||w.getFill()||w.getStroke())&&(w=new Ie,S[U]=w),w.setImage(void 0),w.setGeometry(void 0));const H=ti(v,b,T,"text",m);w.getText()||w.setText(q),q=w.getText(),(!q||"getDeclutterMode"in q&&q.getDeclutterMode()!==H)&&(q=new Jo({padding:[2,2,2,2],declutterMode:H}),w.setText(q));const W=z(v,"layout","text-transform",b,T,m,x);W=="uppercase"?te=Array.isArray(te)?te.map((ne,at)=>at%2?ne:ne.toUpperCase()):te.toUpperCase():W=="lowercase"&&(te=Array.isArray(te)?te.map((ne,at)=>at%2?ne:ne.toLowerCase()):te.toLowerCase());const B=Array.isArray(te)?te:N==2?Ar(te,ot):Dr(te,nt,tr,ot);q.setText(B),q.setFont(nt),q.setRotation(xr(z(v,"layout","text-rotate",b,T,m,x)));const X=z(v,"layout","text-anchor",b,T,m,x),D=kt||N==1?"point":z(v,"layout","symbol-placement",b,T,m,x);let O;if(D==="line-center"?(q.setPlacement("line"),O="center"):q.setPlacement(D),D==="line"&&typeof q.setRepeat=="function"){const ne=z(v,"layout","symbol-spacing",b,T,m,x);q.setRepeat(ne*2)}q.setOverflow(D==="point");let K=z(v,"paint","text-halo-width",b,T,m,x);const Y=z(v,"layout","text-offset",b,T,m,x),fe=z(v,"paint","text-translate",b,T,m,x);let ue=0,oe=0;if(D=="point"){O="center",X.indexOf("left")!==-1?(O="left",oe=K):X.indexOf("right")!==-1&&(O="right",oe=-K);const ne=z(v,"layout","text-rotation-alignment",b,T,m,x);q.setRotateWithView(ne=="map")}else q.setMaxAngle(xr(z(v,"layout","text-max-angle",b,T,m,x))*te.length/B.length),q.setRotateWithView(!1);q.setTextAlign(O);let ae="middle";X.indexOf("bottom")==0?(ae="bottom",ue=-K-.5*(it-1)*Ce):X.indexOf("top")==0&&(ae="top",ue=K+.5*(it-1)*Ce),q.setTextBaseline(ae);const J=z(v,"layout","text-justify",b,T,m,x);q.setJustify(J==="auto"?void 0:J),q.setOffsetX(Y[0]*Ce+oe+fe[0]),q.setOffsetY(Y[1]*Ce+ue+fe[1]),F.setColor(Ee(z(v,"paint","text-color",b,T,m,x),Te)),q.setFill(F);const he=Ee(z(v,"paint","text-halo-color",b,T,m,x),Te);if(he&&K>0){E.setColor(he),K*=2;const ne=.5*Ce;E.setWidth(K<=ne?K:ne),q.setStroke(E)}else q.setStroke(void 0);const me=z(v,"layout","text-padding",b,T,m,x),ye=q.getPadding();me!==ye[0]&&(ye[0]=me,ye[1]=me,ye[2]=me,ye[3]=me),w.setZIndex($e)}}}if(U>-1)return S.length=U+1,S};return t.setStyle($),t.set("mapbox-source",C),t.set("mapbox-layers",f),t.set("mapbox-featurestate",t.get("mapbox-featurestate")||{}),$}function Ul(t,e=512){return t.getExtent()?$r({extent:t.getExtent(),tileSize:e,maxZoom:22}).getResolutions():Yt}function Zl(t,e){return e.accessToken||(e=Object.assign({},e),new URL(t).searchParams.forEach((n,i)=>{e.accessToken=n,e.accessTokenParam=i})),e}function Hl(t,e,r="",n={},i=void 0){let o,a,s,l,u=!0;return typeof r!="string"&&!Array.isArray(r)?(s=r,l=s.source||s.layers,n=s):l=r,typeof n=="string"?(o=n,s={}):(o=n.styleUrl,s=n),s.updateSource===!1&&(u=!1),i||(i=s.resolutions),!o&&typeof e=="string"&&!e.trim().startsWith("{")&&(o=e),o&&(o=o.startsWith("data:")?location.href:Ui(o,s.accessToken),s=Zl(o,s)),new Promise(function(c,p){Hi(e,s).then(function(d){if(d.version!=8)return p(new Error("glStyle version 8 required."));if(!(t instanceof Fr||t instanceof pt))return p(new Error("Can only apply to VectorLayer or VectorTileLayer"));const f=t instanceof pt?"vector":"geojson";if(l?Array.isArray(l)?a=d.layers.find(function(F){return F.id===l[0]}).source:a=l:(a=Object.keys(d.sources).find(function(F){return d.sources[F].type===f}),l=a),!a)return p(new Error(`No ${f} source found in the glStyle.`));function h(){if(!u)return Promise.resolve();if(t instanceof pt)return Ql(d.sources[a],o,s).then(function(k){const I=t.getSource();I?k!==I&&(I.setTileUrlFunction(k.getTileUrlFunction()),typeof I.setUrls=="function"&&typeof k.getUrls=="function"&&I.setUrls(k.getUrls()),I.format_||(I.format_=k.format_),I.getAttributions()||I.setAttributions(k.getAttributions()),I.getTileLoadFunction()===di&&I.setTileLoadFunction(k.getTileLoadFunction()),Ho(I.getProjection(),k.getProjection())&&(I.tileGrid=k.getTileGrid())):t.setSource(k);const A=t.getSource().getTileGrid();!isFinite(t.getMaxResolution())&&!isFinite(t.getMinZoom())&&A.getMinZoom()>0&&t.setMaxResolution(Ml(Math.max(0,A.getMinZoom()-1e-12),A.getResolutions()))});const F=d.sources[a];let S=t.getSource();(!S||S.get("mapbox-source")!==F)&&(S=tu(F,o,s));const $=t.getSource();return $?S!==$&&($.getAttributions()||$.setAttributions(S.getAttributions()),$.format_||($.format_=S.getFormat()),$.url_=S.getUrl()):t.setSource(S),Promise.resolve()}let g,m,_,C;function E(){if(!C&&(!d.sprite||m)){if(s.projection&&!i){const S=Ke(s.projection).getUnits();S!=="m"&&(i=Yt.map($=>$/Go[S]))}C=Bl(t,d,l,i,m,_,(F,S=s.webfonts)=>$l(F,S),s.getImage),t.getStyle()?h().then(c).catch(p):p(new Error(`Nothing to show for source [${a}]`))}else C?(t.setStyle(C),h().then(c).catch(p)):p(new Error("Something went wrong trying to apply style."))}if(d.sprite){const F=new URL(Fl(d.sprite,s.accessToken,o||location.href));g=window.devicePixelRatio>=1.5?.5:1;const S=g==.5?"@2x":"";let $=F.origin+F.pathname+S+".json"+F.search;new Promise(function(k,I){Ye("Sprite",$,s).then(k).catch(function(A){$=F.origin+F.pathname+".json"+F.search,Ye("Sprite",$,s).then(k).catch(I)})}).then(function(k){if(k===void 0&&p(new Error("No sprites found.")),m=k,_=F.origin+F.pathname+S+".png"+F.search,s.transformRequest){const I=s.transformRequest(_,"SpriteImage")||_;(I instanceof Request||I instanceof Promise)&&(_=I)}E()}).catch(function(k){p(new Error(`Sprites cannot be loaded: ${$}: ${k.message}`))})}else E()}).catch(p)})}const ri={};function Wl(t,e,r){e.layers.some(function(n){if(n.type==="background"){if(t instanceof ui)return t.setBackground(function(i){return Xi(n,i,r,{})}),!0;if(t instanceof No||t instanceof Vo)return t.getLayers().insertAt(0,Yl(n,r,{})),!0}})}function Xl(t,e,r={}){return Hi(e,r).then(function(n){Wl(t,n,r)})}function Jl(t,e){const r=t.bounds;if(r){const n=Tn([r[0],r[1]],e),i=Tn([r[2],r[3]],e);return[n[0],n[1],i[0],i[1]]}return Ke(e).getExtent()}function Kl(t,e,r){const n=new xa({tileJSON:e,tileSize:t.tileSize||e.tileSize||512}),i=n.getTileJSON(),o=n.getTileGrid(),a=Ke(r.projection||"EPSG:3857"),s=Jl(i,a),l=a.getExtent(),u=i.minzoom||0,c=i.maxzoom||22,p={attributions:n.getAttributions(),projection:a,tileGrid:new ai({origin:l?li(l):o.getOrigin(0),extent:s||o.getExtent(),minZoom:u,resolutions:Ul(a,e.tileSize).slice(0,c+1),tileSize:o.getTileSize(0)})};return Array.isArray(i.tiles)?p.urls=i.tiles:p.url=i.tiles,p}function Xi(t,e,r,n){const i={id:t.id,type:t.type},o=t.layout||{},a=t.paint||{};i.paint=a;const s=Zi(e,r.resolutions||Yt);let l;const u=z(i,"paint","background-color",s,ri,n);return a["background-opacity"]!==void 0&&(l=z(i,"paint","background-opacity",s,ri,n)),o.visibility=="none"?void 0:Ee(u,l)}function Yl(t,e,r){const n=document.createElement("div");return n.className="ol-mapbox-style-background",n.style.position="absolute",n.style.width="100%",n.style.height="100%",new ui({source:new Bo({}),render(i){const o=Xi(t,i.viewState.resolution,e,r);return n.style.backgroundColor=o,n}})}function Ql(t,e,r){return new Promise(function(n,i){Rl(t,e,r).then(function({tileJson:o,tileLoadFunction:a}){const s=Kl(t,o,r);s.tileLoadFunction=a,s.format=new qr,n(new Lr(s))}).catch(i)})}function eu(t){return`{bbox-${(t?t.getCode():"EPSG:3857").toLowerCase().replace(/[^a-z0-9]/g,"-")}}`}function tu(t,e,r){const n=r.projection?new Sn({dataProjection:r.projection}):new Sn,i=t.data,o={};if(typeof i=="string"){const s=At(i,r.accessToken,r.accessTokenParam||"access_token",e||location.href);if(/\{bbox-[0-9a-z-]+\}/.test(s)){const u=(p,d,f)=>{const h=eu(f);return s.replace(h,`${p.join(",")}`)},c=new ir({attributions:t.attribution,format:n,loader:(p,d,f,h,g)=>{const m=typeof u=="function"?u(p,d,f):u;Ye("GeoJSON",m,r).then(_=>{const C=c.getFormat().readFeatures(_,{featureProjection:f});c.addFeatures(C),h(C)}).catch(_=>{c.removeLoadedExtent(p),g()})},strategy:Wo});return c.set("mapbox-source",t),c}const l=new ir({attributions:t.attribution,format:n,url:s,loader:(u,c,p,d,f)=>{Ye("GeoJSON",s,r).then(h=>{const g=l.getFormat().readFeatures(h,{featureProjection:p});l.addFeatures(g),d(g)}).catch(h=>{l.removeLoadedExtent(u),f()})}});return l}o.features=n.readFeatures(i,{featureProjection:"EPSG:3857"});const a=new ir(Object.assign({attributions:t.attribution,format:n},o));return a.set("mapbox-source",t),a}class ru extends qo{constructor(e){super(kr.ERROR),this.error=e}}class nu extends pt{constructor(e){const r="declutter"in e?e.declutter:!0,n=new Lr({state:"loading",format:new qr});super({source:n,background:e.background===!1?null:e.background,declutter:r,className:e.className,opacity:e.opacity,visible:e.visible,zIndex:e.zIndex,minResolution:e.minResolution,maxResolution:e.maxResolution,minZoom:e.minZoom,maxZoom:e.maxZoom,renderOrder:e.renderOrder,renderBuffer:e.renderBuffer,renderMode:e.renderMode,map:e.map,updateWhileAnimating:e.updateWhileAnimating,updateWhileInteracting:e.updateWhileInteracting,preload:e.preload,useInterimTilesOnError:e.useInterimTilesOnError,properties:e.properties}),e.accessToken&&(this.accessToken=e.accessToken);const i=e.styleUrl,o=[Hl(this,i,e.layers||e.source,{accessToken:this.accessToken})];this.getBackground()===void 0&&o.push(Xl(this,e.styleUrl,{accessToken:this.accessToken})),Promise.all(o).then(()=>{n.setState("ready")}).catch(a=>{this.dispatchEvent(new ru(a)),this.getSource().setState("error")})}}const Ve="main";class iu{mapId=Ve;vectorSourceFactory;constructor({references:e}){this.vectorSourceFactory=e.vectorSourceFactory}async getMapConfig(){return{projection:"EPSG:3857",initialView:{kind:"position",center:{x:848890,y:6793350},zoom:13},layers:[new st({title:"OSM",visible:!0,isBaseLayer:!0,olLayer:new Ko({source:new Yo})}),new st({id:"inspire-us-kindergarten",title:"Kindertageseinrichtungen in NRW",visible:!0,olLayer:new Fr({style:new Ie({image:new ci({fill:new Be({color:"blue"}),radius:5})}),source:this.vectorSourceFactory.createVectorSource({baseUrl:"https://ogc-api.nrw.de/inspire-us-kindergarten/v1",collectionId:"governmentalservice",crs:"http://www.opengis.net/def/crs/EPSG/0/3857",attributions:"Datenlizenz Deutschland - Namensnennung - Version 2.0"})})}),new st({id:"ogc_katasterbezirk",title:"Liegenschaftskatasterbezirke in NRW (viele Daten)",visible:!1,olLayer:new Fr({source:this.vectorSourceFactory.createVectorSource({baseUrl:"https://ogc-api.nrw.de/lika/v1",collectionId:"katasterbezirk",limit:1e3,crs:"http://www.opengis.net/def/crs/EPSG/0/3857",attributions:"Datenlizenz Deutschland - Namensnennung - Version 2.0"})})}),new st({title:"Abschnitte / Äste mit Unfällen (Mapbox Style)",visible:!1,olLayer:new nu({styleUrl:"https://demo.ldproxy.net/strassen/styles/default?f=mbs"})}),new st({title:"Pendleratlas",visible:!0,olLayer:new pt({source:new Lr({url:"https://pendleratlas.statistikportal.de/_vector_tiles/2022/vg250/{z}/{x}/{y}.pbf",format:new qr,projection:"EPSG:3857",attributions:`© Statistische Ämter der Länder ${new Date().getFullYear()} | GeoBasis-DE/BKG ${new Date().getFullYear()}`}),style:new Ie({fill:new Be({color:"rgba(173, 209, 158, 0.6)"}),stroke:new ut({color:"#2d7d9f",width:3})})})})]}}}class ou{beforeRequest({target:e,options:r}){e.protocol==="https:"&&e.hostname==="ogc-api.nrw.de"&&r.headers.set("Authorization","Bearer 12345")}}const au={"ogc-api-app":{name:"ogc-api-app",services:{MapConfigProviderImpl:{name:"MapConfigProviderImpl",clazz:iu,provides:[{name:"map.MapConfigProvider",qualifier:void 0}],references:{vectorSourceFactory:{name:"ogc-features.VectorSourceFactory",qualifier:void 0,all:!1}}},SampleTokenInterceptor:{name:"SampleTokenInterceptor",clazz:ou,provides:[{name:"http.Interceptor",qualifier:void 0}],references:{}}},ui:{references:[]},properties:{}},"@open-pioneer/chakra-integration":{name:"@open-pioneer/chakra-integration",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime":{name:"@open-pioneer/runtime",services:{},ui:{references:[]},properties:{}},"@open-pioneer/react-utils":{name:"@open-pioneer/react-utils",services:{},ui:{references:[]},properties:{}},"@open-pioneer/http":{name:"@open-pioneer/http",services:{HttpServiceImpl:{name:"HttpServiceImpl",clazz:Qo,provides:[{name:"http.HttpService",qualifier:"http.HttpService"}],references:{interceptors:{name:"http.Interceptor",qualifier:void 0,all:!0}}}},ui:{references:[]},properties:{}},"@open-pioneer/map":{name:"@open-pioneer/map",services:{MapRegistryImpl:{name:"MapRegistryImpl",clazz:ea,provides:[{name:"map.MapRegistry",qualifier:void 0}],references:{providers:{name:"map.MapConfigProvider",qualifier:void 0,all:!0},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/theme":{name:"@open-pioneer/theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/ogc-features":{name:"@open-pioneer/ogc-features",services:{VectorSourceFactory:{name:"VectorSourceFactory",clazz:ca,provides:[{name:"ogc-features.VectorSourceFactory",qualifier:void 0}],references:{httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}},SearchSourceFactory:{name:"SearchSourceFactory",clazz:pa,provides:[{name:"ogc-features.SearchSourceFactory",qualifier:void 0}],references:{httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[]},properties:{}},"@open-pioneer/basemap-switcher":{name:"@open-pioneer/basemap-switcher",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map-navigation":{name:"@open-pioneer/map-navigation",services:{},ui:{references:[]},properties:{}},"@open-pioneer/toc":{name:"@open-pioneer/toc",services:{},ui:{references:[]},properties:{}},"@open-pioneer/base-theme":{name:"@open-pioneer/base-theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime-react-support":{name:"@open-pioneer/runtime-react-support",services:{},ui:{references:[]},properties:{}},"@open-pioneer/core":{name:"@open-pioneer/core",services:{},ui:{references:[]},properties:{}},"@open-pioneer/reactivity":{name:"@open-pioneer/reactivity",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map-ui-components":{name:"@open-pioneer/map-ui-components",services:{},ui:{references:[]},properties:{}}},su=':root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.map-container .ol-viewport .ol-attribution{bottom:var(--map-padding-bottom);right:var(--map-padding-right)}',lu=["en","de"];function uu(t){switch(t){case"en":return Cn(()=>import("./Bi5QOsk-GySW.js"),[],import.meta.url).then(e=>e.default);case"de":return Cn(()=>import("./wAUNb4P8esoo.js"),[],import.meta.url).then(e=>e.default)}throw new Error(`Unsupported locale: '${t}'`)}const cu=eo(su),pu=Object.freeze(Object.defineProperty({__proto__:null,loadMessages:uu,locales:lu,packages:au,styles:cu},Symbol.toStringTag,{value:"Module"})),du="ogc-api-app",fu=ta.bind(void 0,du);function hu(){const t=fu();return Q.jsx(or,{height:"100%",direction:"column",overflow:"hidden",children:Q.jsx(kn,{title:Q.jsx(zn,{textAlign:"center",py:1,children:Q.jsx(Fn,{size:"md",children:"Open Pioneer - OGC API Features and OGC API Tiles Sample"})}),children:Q.jsx(or,{flex:"1",direction:"column",position:"relative",children:Q.jsxs(ra,{mapId:Ve,children:[Q.jsx(ar,{position:"top-left",horizontalGap:20,verticalGap:20,children:Q.jsx(zn,{backgroundColor:"white",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",children:Q.jsx(kn,{title:Q.jsx(Fn,{size:"md",children:t.formatMessage({id:"tocTitle"})}),children:Q.jsx(oa,{mapId:Ve,basemapSwitcherProps:{allowSelectingEmptyBasemap:!0}})})})}),Q.jsx(ar,{position:"top-right",horizontalGap:10,verticalGap:10,children:Q.jsxs(ma,{backgroundColor:"whiteAlpha.900",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",maxWidth:"400px",children:[Q.jsx(sr,{as:"b",children:"Description"}),Q.jsx(sr,{children:"This application can be used to test OGC API Features and OGC API Tiles."}),Q.jsx(sr,{children:"Vector Tiles cannot be reprojected and require the map to use the same projection. Currently all known MVT vector tile sets are using WebMercator, making them unusable in the Default Sample App which uses ETRS89/UTM zone 32N. This Sample App uses WebMercator."})]})}),Q.jsx(ar,{position:"bottom-right",horizontalGap:10,verticalGap:30,children:Q.jsxs(or,{direction:"column",gap:1,padding:1,children:[Q.jsx(da,{mapId:Ve}),Q.jsx(fa,{mapId:Ve}),Q.jsx(ha,{mapId:Ve})]})})]})})})})}const mu=to({component:hu,theme:ro,appMetadata:pu,async resolveConfig(t){const e=t.getAttribute("forced-locale");if(e)return{locale:e}}});customElements.define("ogc-api-app",mu);const yu=document.getElementsByTagName("body")[0];gu();function gu(){const t=window.location.search,r=new URLSearchParams(t).get("lang"),n=document.createElement("ogc-api-app");n.classList.add("full-height"),n.setAttribute("id","test"),r&&n.setAttribute("forced-locale",r),yu.appendChild(n)} diff --git a/openlayers-base-packages/pr-previews/pr-371/assets/D5SiXzFLvedX.js b/openlayers-base-packages/pr-previews/pr-371/assets/D5SiXzFLvedX.js deleted file mode 100644 index 1476553..0000000 --- a/openlayers-base-packages/pr-previews/pr-371/assets/D5SiXzFLvedX.js +++ /dev/null @@ -1,4 +0,0 @@ -var K=a=>{throw TypeError(a)};var j=(a,e,t)=>e.has(a)||K("Cannot "+t);var C=(a,e,t)=>(j(a,e,"read from private field"),t?t.call(a):e.get(a)),D=(a,e,t)=>e.has(a)?K("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(a):e.set(a,t),x=(a,e,t,i)=>(j(a,e,"write to private field"),i?i.call(a,t):e.set(a,t),t),W=(a,e,t)=>(j(a,e,"access private method"),t);import{h as ie,j as X,r as I,a0 as de,f as J,c as ue,b as fe}from"./Bh0CuZ3gy5tC.js";import{_ as ge}from"./CmsKOCeNyeyo.js";import{c5 as _e,c6 as me,z as pe,c7 as ye,c8 as Ce,c9 as we,bj as ke,ca as Te,bH as xe,bu as Q,bz as ve,a as Pe,b as Se,cb as Le,bn as Z,bG as De,cc as Ee,I as be,bs as w,cd as Me,a3 as Ie,bt as se,b3 as E,as as V,ce as ee,bC as Fe,at as Re,ar as ne,bF as Ne,cf as Oe,cg as re,ch as Ge,aP as Ue,aR as Ae,b5 as te,av as je}from"./CvR1K3f_Jx0o.js";import{a as We,b as oe,M as ae,G as Ve}from"./DoZQ59JZnzxi.js";import{L as U}from"./CKfDAIEslOW2.js";var z=ie(function(e,t){const{htmlWidth:i,htmlHeight:s,alt:r,...n}=e;return X.jsx("img",{width:i,height:s,ref:t,alt:r,...n})});z.displayName="NativeImage";function Be(a){const{loading:e,src:t,srcSet:i,onLoad:s,onError:r,crossOrigin:n,sizes:o,ignoreFallback:h}=a,[l,c]=I.useState("pending");I.useEffect(()=>{c(t?"loading":"pending")},[t]);const d=I.useRef(),u=I.useCallback(()=>{if(!t)return;f();const g=new Image;g.src=t,n&&(g.crossOrigin=n),i&&(g.srcset=i),o&&(g.sizes=o),e&&(g.loading=e),g.onload=_=>{f(),c("loaded"),s?.(_)},g.onerror=_=>{f(),c("failed"),r?.(_)},d.current=g},[t,n,i,o,s,r,e]),f=()=>{d.current&&(d.current.onload=null,d.current.onerror=null,d.current=null)};return de(()=>{if(!h)return l==="loading"&&u(),()=>{f()}},[l,u,h]),h?"loaded":l}var qe=(a,e)=>a!=="loaded"&&e==="beforeLoadOrError"||a==="failed"&&e==="onError";function He(a,e=[]){const t=Object.assign({},a);for(const i of e)i in t&&delete t[i];return t}var $e=ie(function(e,t){const{fallbackSrc:i,fallback:s,src:r,srcSet:n,align:o,fit:h,loading:l,ignoreFallback:c,crossOrigin:d,fallbackStrategy:u="beforeLoadOrError",referrerPolicy:f,...g}=e,_=i!==void 0||s!==void 0,m=l!=null||c||!_,T=Be({...e,crossOrigin:d,ignoreFallback:m}),k=qe(T,u),p={ref:t,objectFit:h,objectPosition:o,...m?g:He(g,["onError","onLoad"])};return k?s||X.jsx(J.img,{as:z,className:"chakra-image__placeholder",src:i,...p}):X.jsx(J.img,{as:z,src:r,srcSet:n,crossOrigin:d,loading:l,referrerPolicy:f,className:"chakra-image",...p})});$e.displayName="Image";class A extends _e{constructor(e,t,i){super(),i!==void 0&&t===void 0?this.setFlatCoordinates(i,e):(t=t||0,this.setCenterAndRadius(e,t,i))}clone(){const e=new A(this.flatCoordinates.slice(),void 0,this.layout);return e.applyProperties(this),e}closestPointXY(e,t,i,s){const r=this.flatCoordinates,n=e-r[0],o=t-r[1],h=n*n+o*o;if(h=i[0]||e[1]<=i[1]&&e[3]>=i[1]?!0:ye(e,this.intersectsCoordinate.bind(this))}return!1}setCenter(e){const t=this.stride,i=this.flatCoordinates[t]-this.flatCoordinates[0],s=e.slice();s[t]=s[0]+i;for(let r=1;r component has likely been used twice in your application.`),{destroy(){}};x(this,y,e);const t=C(this,S);if(x(this,S,void 0),t)for(const[s,...r]of t)e[s](...r);let i=!1;return{destroy:()=>{i||(i=!0,C(this,y)===e&&x(this,y,void 0))}}}}y=new WeakMap,S=new WeakMap,M=new WeakMap,L=new WeakSet,Y=function(e,...t){if(C(this,y))C(this,y)[e](...t);else{const i=C(this,S)??x(this,S,[]);if(i.length>=1024){B.error(`Internal notification buffer overflow: this event will be dropped to prevent a memory leak. -Make sure that the UI is configured to display notifications (use ).`,{method:e,args:t});return}i.push([e,...t])}},Xe=function(){C(this,y)||B.warn(`No notification handler has been registered: notifications will not be visible. -Make sure that your app contains the component.`)};const F={DRAWSTART:"drawstart",DRAWEND:"drawend",DRAWABORT:"drawabort"};class R extends Re{constructor(e,t){super(e),this.feature=t}}function ze(a,e){const t=[];for(let i=0;i=t?a[e-t]:a[e]}function O(a,e,t){let i,s;en){const h=P(a,i),l=P(a,s);return N(h,l)}let o=0;if(iu.startIndex?_u.startIndex&&(_-=f.length)),h=_,o=d)}const l=e.targets[o];let c=l.ring;if(e.targetIndex===o&&c){const d=P(l.coordinates,h),u=t.getPixelFromCoordinate(d);se(u,e.startPx)>i&&(c=!1)}if(c){const d=l.coordinates,u=d.length,f=l.startIndex,g=h;if(f=t?i-=t:i<0&&(i+=t);let r=i+1;r>=t&&(r-=t);const n=a[i],o=n[0],h=n[1],l=a[r],c=l[0]-o,d=l[1]-h;return[o+c*s,h+d*s]}class Ke extends ke{constructor(e){const t=e;t.stopDown||(t.stopDown=Te),super(t),this.on,this.once,this.un,this.shouldHandle_=!1,this.downPx_=null,this.downTimeout_,this.lastDragTime_,this.pointerType_,this.freehand_=!1,this.source_=e.source?e.source:null,this.features_=e.features?e.features:null,this.snapTolerance_=e.snapTolerance?e.snapTolerance:12,this.type_=e.type,this.mode_=Qe(this.type_),this.stopClick_=!!e.stopClick,this.minPoints_=e.minPoints?e.minPoints:this.mode_==="Polygon"?3:2,this.maxPoints_=this.mode_==="Circle"?2:e.maxPoints?e.maxPoints:1/0,this.finishCondition_=e.finishCondition?e.finishCondition:xe,this.geometryLayout_=e.geometryLayout?e.geometryLayout:"XY";let i=e.geometryFunction;if(!i){const s=this.mode_;if(s==="Circle")i=function(r,n,o){const h=n||new A([NaN,NaN]),l=Q(r[0]),c=ve(l,Q(r[r.length-1]));return h.setCenterAndRadius(l,Math.sqrt(c),this.geometryLayout_),h};else{let r;s==="Point"?r=V:s==="LineString"?r=U:s==="Polygon"&&(r=ne),i=function(n,o,h){return o?s==="Polygon"?n[0].length?o.setCoordinates([n[0].concat([n[0][0]])],this.geometryLayout_):o.setCoordinates([],this.geometryLayout_):o.setCoordinates(n,this.geometryLayout_):o=new r(n,this.geometryLayout_),o}}}this.geometryFunction_=i,this.dragVertexDelay_=e.dragVertexDelay!==void 0?e.dragVertexDelay:500,this.finishCoordinate_=null,this.sketchFeature_=null,this.sketchPoint_=null,this.sketchCoords_=null,this.sketchLine_=null,this.sketchLineCoords_=null,this.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,this.overlay_=new Pe({source:new Se({useSpatialIndex:!1,wrapX:e.wrapX?e.wrapX:!1}),style:e.style?e.style:Je(),updateWhileInteracting:!0}),this.geometryName_=e.geometryName,this.condition_=e.condition?e.condition:Le,this.freehandCondition_,e.freehand?this.freehandCondition_=Z:this.freehandCondition_=e.freehandCondition?e.freehandCondition:De,this.traceCondition_,this.setTrace(e.trace||!1),this.traceState_={active:!1},this.traceSource_=e.traceSource||e.source||null,this.addChangeListener(Ee.ACTIVE,this.updateState_)}setTrace(e){let t;e?e===!0?t=Z:t=e:t=Ne,this.traceCondition_=t}setMap(e){super.setMap(e),this.updateState_()}getOverlay(){return this.overlay_}handleEvent(e){e.originalEvent.type===be.CONTEXTMENU&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!=="Point"&&this.freehandCondition_(e);let t=e.type===w.POINTERMOVE,i=!0;return!this.freehand_&&this.lastDragTime_&&e.type===w.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,t=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_!==void 0&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)),this.freehand_&&e.type===w.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(e.coordinate),i=!1):this.freehand_&&e.type===w.POINTERDOWN?i=!1:t&&this.getPointerCount()<2?(i=e.type===w.POINTERMOVE,i&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):(e.originalEvent.pointerType==="mouse"||e.type===w.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(e)):e.type===w.DBLCLICK&&(i=!1),super.handleEvent(e)&&i}handleDownEvent(e){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=e.pixel,this.finishCoordinate_||this.startDrawing_(e.coordinate),!0):this.condition_(e)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(()=>{this.handlePointerMove_(new Me(w.POINTERMOVE,e.map,e.originalEvent,!1,e.frameState))},this.dragVertexDelay_),this.downPx_=e.pixel,!0):(this.lastDragTime_=void 0,!1)}deactivateTrace_(){this.traceState_={active:!1}}toggleTraceState_(e){if(!this.traceSource_||!this.traceCondition_(e))return;if(this.traceState_.active){this.deactivateTrace_();return}const t=this.getMap(),i=t.getCoordinateFromPixel([e.pixel[0]-this.snapTolerance_,e.pixel[1]+this.snapTolerance_]),s=t.getCoordinateFromPixel([e.pixel[0]+this.snapTolerance_,e.pixel[1]-this.snapTolerance_]),r=Ie([i,s]),n=this.traceSource_.getFeaturesInExtent(r);if(n.length===0)return;const o=ze(e.coordinate,n);o.length&&(this.traceState_={active:!0,startPx:e.pixel.slice(),targets:o,targetIndex:-1})}addOrRemoveTracedCoordinates_(e,t){const i=e.startIndex<=e.endIndex,s=e.startIndex<=t;i===s?i&&t>e.endIndex||!i&&te.endIndex)&&this.removeTracedCoordinates_(t,e.endIndex):(this.removeTracedCoordinates_(e.startIndex,e.endIndex),this.addTracedCoordinates_(e,e.startIndex,t))}removeTracedCoordinates_(e,t){if(e===t)return;let i=0;if(e0&&this.removeLastPoints_(i)}addTracedCoordinates_(e,t,i){if(t===i)return;const s=[];if(t=n;--o)s.push(v(e.coordinates,o))}s.length&&this.appendCoordinates(s)}updateTrace_(e){const t=this.traceState_;if(!t.active||t.targetIndex===-1&&se(t.startPx,e.pixel)this.squaredClickTolerance_:n<=this.squaredClickTolerance_,!this.shouldHandle_)return}if(!this.finishCoordinate_){this.createOrUpdateSketchPoint_(e.coordinate.slice());return}this.updateTrace_(e),this.modifyDrawing_(e.coordinate)}atFinish_(e,t){let i=!1;if(this.sketchFeature_){let s=!1,r=[this.finishCoordinate_];const n=this.mode_;if(n==="Point")i=!0;else if(n==="Circle")i=this.sketchCoords_.length===2;else if(n==="LineString")s=!t&&this.sketchCoords_.length>this.minPoints_;else if(n==="Polygon"){const o=this.sketchCoords_;s=o[0].length>this.minPoints_,r=[o[0][0],o[0][o[0].length-2]],t?r=[o[0][0]]:r=[o[0][0],o[0][o[0].length-2]]}if(s){const o=this.getMap();for(let h=0,l=r.length;h=this.maxPoints_&&(this.freehand_?r.pop():s=!0),r.push(e.slice()),this.geometryFunction_(r,t,i)):n==="Polygon"&&(r=this.sketchCoords_[0],r.length>=this.maxPoints_&&(this.freehand_?r.pop():s=!0),r.push(e.slice()),s&&(this.finishCoordinate_=r[0]),this.geometryFunction_(this.sketchCoords_,t,i)),this.createOrUpdateSketchPoint_(e.slice()),this.updateSketchFeatures_(),s?this.finishDrawing():this.sketchFeature_}removeLastPoints_(e){if(!this.sketchFeature_)return;const t=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),s=this.mode_;for(let r=0;r=2){this.finishCoordinate_=n[n.length-2].slice();const o=this.finishCoordinate_.slice();n[n.length-1]=o,this.createOrUpdateSketchPoint_(o)}this.geometryFunction_(n,t,i),t.getType()==="Polygon"&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(t)}else if(s==="Polygon"){n=this.sketchCoords_[0],n.splice(-2,1);const o=this.sketchLine_.getGeometry();if(n.length>=2){const h=n[n.length-2].slice();n[n.length-1]=h,this.createOrUpdateSketchPoint_(h)}o.setCoordinates(n),this.geometryFunction_(this.sketchCoords_,t,i)}if(n.length===1){this.abortDrawing();break}}this.updateSketchFeatures_()}removeLastPoint(){this.removeLastPoints_(1)}finishDrawing(){const e=this.abortDrawing_();if(!e)return null;let t=this.sketchCoords_;const i=e.getGeometry(),s=this.getMap().getView().getProjection();return this.mode_==="LineString"?(t.pop(),this.geometryFunction_(t,i,s)):this.mode_==="Polygon"&&(t[0].pop(),this.geometryFunction_(t,i,s),t=i.getCoordinates()),this.type_==="MultiPoint"?e.setGeometry(new We([t])):this.type_==="MultiLineString"?e.setGeometry(new oe([t])):this.type_==="MultiPolygon"&&e.setGeometry(new ae([t])),this.dispatchEvent(new R(F.DRAWEND,e)),this.features_&&this.features_.push(e),this.source_&&this.source_.addFeature(e),e}abortDrawing_(){this.finishCoordinate_=null;const e=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),this.deactivateTrace_(),e}abortDrawing(){const e=this.abortDrawing_();e&&this.dispatchEvent(new R(F.DRAWABORT,e))}appendCoordinates(e){const t=this.mode_,i=!this.sketchFeature_;i&&this.startDrawing_(e[0]);let s;if(t==="LineString"||t==="Circle")s=this.sketchCoords_;else if(t==="Polygon")s=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[];else return;i&&s.shift(),s.pop();for(let n=0;n=h){u=_,f=m,g=T;break}else if(f>=o)break;_=u,m=f,T=g,++d}const k=this.scaleBar_?this.createScaleBar(f,u,c):u.toFixed(g<0?-g:0)+" "+c;this.renderedHTML_!=k&&(this.innerElement_.innerHTML=k,this.renderedHTML_=k),this.renderedWidth_!=f&&(this.innerElement_.style.width=f+"px",this.renderedWidth_=f),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}createScaleBar(e,t,i){const s=this.getScaleForResolution(),r=s<1?Math.round(1/s).toLocaleString()+" : 1":"1 : "+Math.round(s).toLocaleString(),n=this.scaleBarSteps_,o=e/n,h=[this.createMarker("absolute")];for(let c=0;c
`+this.createMarker("relative")+(c%2===0||n===2?this.createStepText(c,e,!1,t,i):"")+"")}return h.push(this.createStepText(n,e,!0,t,i)),(this.scaleBarText_?`
`+r+"
":"")+h.join("")}createMarker(e){return`
`}createStepText(e,t,i,s,r){const o=(e===0?0:Math.round(s/this.scaleBarSteps_*e*100)/100)+(e===0?"":" "+r),h=e===0?-3:t/this.scaleBarSteps_*-1,l=e===0?0:t/this.scaleBarSteps_*2;return`
`+o+"
"}getScaleForResolution(){const e=te(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,"m"),t=this.dpi_||b,i=1e3/25.4;return e*i*t}render(e){const t=e.frameState;t?this.viewState_=t.viewState:this.viewState_=null,this.updateElement_()}}const tt=.8,ce="printing-hide";function it(a,e){return a.toDataURL("image/png",e??tt)}function st(a,e){const t=document.createElement("div");t.classList.add("printing-overlay",ce),a.appendChild(t);const i=document.createElement("div");return i.classList.add("printing-overlay-status"),i.textContent=e,t.appendChild(i),{destroy(){t.remove()}}}class ft{defaultOverlayText;constructor(e){this.defaultOverlayText=e.intl.formatMessage({id:"printingMap"})}async printMap(e,t){return await new nt(e,{blockUserInteraction:!0,overlayText:this.defaultOverlayText,viewPadding:"auto",...t}).printMap()}}class nt{olMap;blockUserInteraction=!1;overlayText;viewPadding;running=!1;drawInformation=[];scaleLine=void 0;overlay=void 0;constructor(e,t){this.olMap=e,this.blockUserInteraction=t.blockUserInteraction,this.overlayText=t.overlayText,this.viewPadding=t.viewPadding}async printMap(){if(this.running)throw new Error("Printing already running.");try{await this.beginExport();let e=await this.printToCanvas(this.olMap.getViewport());if(!e)throw new Error("Canvas export failed");return this.viewPadding==="auto"&&(e=this.removePadding(e,this.getViewPadding())),new rt(e)}finally{this.reset()}}async beginExport(){this.running=!0;const e=this.olMap.getInteractions().getArray().filter(t=>t.getActive()&&t instanceof Ke);if(this.drawInformation=[],e?.forEach(t=>{const i=t,s=i.getOverlay().getStyle();i.getOverlay().setStyle(null),this.drawInformation?.push({draw:i,style:s})}),this.blockUserInteraction){const t=this.olMap?.getTargetElement();t&&(this.overlay=st(t,this.overlayText))}await this.addScaleLine()}async addScaleLine(){const t=(this.scaleLine=new et({className:"printing-scale-bar ol-scale-bar",bar:!0,text:!0,minWidth:125})).element;if(!t)throw new Error("Scale line does not have an element");let i=50,s=8;if(this.viewPadding==="auto"){const{bottom:h,left:l}=this.getViewPadding();i=Math.max(h+8,i),s+=l}t.style.setProperty("--printing-scale-bar-bottom",`${i}px`),t.style.setProperty("--printing-scale-bar-left",`${s}px`);const r=fe(),n=setTimeout(()=>{r.reject(new Error("Scale line did not render"))},3e3),o=this.scaleLine.render;this.scaleLine.render=(...h)=>{o.apply(this.scaleLine,h),r.resolve()},this.olMap?.addControl(this.scaleLine);try{await r.promise,await new Promise(h=>{requestAnimationFrame(h)})}finally{clearTimeout(n)}}async printToCanvas(e){const t={useCORS:!0,ignoreElements:function(r){if(r.classList&&typeof r.classList=="object"){const n=r.classList;return n.contains("map-anchors")||n.contains(ce)}return!1}},i=(await ge(async()=>{const{default:r}=await import("./BfxBtG_Oxhhm.js");return{default:r}},[],import.meta.url)).default;return await i(e,t)}reset(){this.scaleLine&&(this.olMap?.removeControl(this.scaleLine),this.scaleLine=void 0),this.overlay&&(this.overlay.destroy(),this.overlay=void 0),this.running=!1,this.drawInformation?.length&&this.drawInformation.forEach(e=>{e.draw.getOverlay().setStyle(e.style)})}removePadding(e,t){const i=window.devicePixelRatio||1,s={top:t.top*i,right:t.right*i,bottom:t.bottom*i,left:t.left*i};if(s.left===0&&s.right===0&&s.top===0&&s.bottom===0)return e;const{width:r,height:n}=e,o=document.createElement("canvas");o.width=r-s.left-s.right,o.height=n-s.top-s.bottom;const h=o.getContext("2d");if(!h)throw new Error("Failed to get a canvas context");return h.drawImage(e,s.left,s.top,o.width,o.height,0,0,o.width,o.height),o}getViewPadding(){const t=this.olMap.getView().padding??[0,0,0,0];return{top:t[0]??0,right:t[1]??0,bottom:t[2]??0,left:t[3]??0}}}class rt{canvas;constructor(e){this.canvas=e}getCanvas(){return this.canvas}getPNGDataURL(e){return it(this.canvas,e)}}export{Ke as D,$e as I,ut as N,ft as P,et as S,it as a,st as c}; diff --git a/openlayers-base-packages/pr-previews/pr-371/assets/DOPSNmhp3Yv8.js b/openlayers-base-packages/pr-previews/pr-371/assets/D5t2Vmz5gxIu.js similarity index 99% rename from openlayers-base-packages/pr-previews/pr-371/assets/DOPSNmhp3Yv8.js rename to openlayers-base-packages/pr-previews/pr-371/assets/D5t2Vmz5gxIu.js index 06d3b18..bfd693f 100644 --- a/openlayers-base-packages/pr-previews/pr-371/assets/DOPSNmhp3Yv8.js +++ b/openlayers-base-packages/pr-previews/pr-371/assets/D5t2Vmz5gxIu.js @@ -1,2 +1,2 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Bdg1SXiiiaSc.js","./CmsKOCeNyeyo.js","./B1-t77dlZFnS.js","./Bh0CuZ3gy5tC.js","./CvR1K3f_Jx0o.js","./Cq1ZpfgEg4XJ.js","./BO_q12Vdyug-.js","./Tz2xttM4F6S2.js","./DUys4rac0YQP.js","./CL_VRsbiqLzM.js"])))=>i.map(i=>d[i]); -var en=Object.defineProperty;var Je=i=>{throw TypeError(i)};var tn=(i,e,t)=>e in i?en(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var _=(i,e,t)=>tn(i,typeof e!="symbol"?e+"":e,t),Ie=(i,e,t)=>e.has(i)||Je("Cannot "+t);var v=(i,e,t)=>(Ie(i,e,"read from private field"),t?t.call(i):e.get(i)),x=(i,e,t)=>e.has(i)?Je("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),w=(i,e,t,s)=>(Ie(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),ne=(i,e,t)=>(Ie(i,e,"access private method"),t);import{aJ as nn,bc as sn,bd as rn,be as on,bf as an,aU as ln,b0 as cn,bg as un,bh as dn,a5 as hn,bi as gn,b5 as fn,j as N,bj as mn,bk as pn,bl as yn,bm as St,bn as _n,bo as vn,a as ee,b as Ce,aQ as _e,bp as Xe,bq as K,I as Ze,a3 as j,br as Te,b3 as Z,as as Qe,bs as me,bt as et,bu as A,o as C,bv as U,bw as Oe,bx as Sn,by as xn,E as wn,bz as je,bA as bn,bB as Mn,bC as xt,at as wt,bD as En,bE as Cn,bF as tt,bG as Pn,bH as nt,bI as Fn,bJ as st,r as He,b4 as Be,bK as bt,bL as Ln,b6 as In,f as $e,u as z,b2 as H,i as B,B as P,bM as Tn,b9 as Pe,bN as An,ar as ve,bO as Nn,bP as kn,c as Se,aC as ie,F as Re,C as On,bQ as it,bR as jn,bS as rt,k as ot}from"./CvR1K3f_Jx0o.js";import{u as Rn,m as Dn,r as m,n as Gn,h as Ue,o as Mt,p as Et,q as Ct,j as d,f as D,s as Vn,t as Hn,c as fe,b as Pt,v as at,B as Ft,C as Bn,w as $n,i as Lt,x as It,l as Un,I as Wn}from"./Bh0CuZ3gy5tC.js";import{G as Tt,i as zn}from"./CDZlakCE4enr.js";import{a as Kn}from"./DoZQ59JZnzxi.js";import{D as At,S as qn,I as Yn,c as Jn,a as Xn}from"./D5SiXzFLvedX.js";import{u as V}from"./Cq1ZpfgEg4XJ.js";import{T as Q,L as Zn,V as Qn}from"./Tz2xttM4F6S2.js";import{u as te,F as k,r as Nt}from"./B1-t77dlZFnS.js";import{c as kt}from"./D03oE8cEQPSj.js";import{L as De}from"./CKfDAIEslOW2.js";import{u as Ot,F as xe}from"./BO_q12Vdyug-.js";import{F as we}from"./CreVQ-qFRzOc.js";import{H as Ge}from"./L25RkWOQSN8A.js";import{F as es}from"./CL_VRsbiqLzM.js";import{_ as ts}from"./CmsKOCeNyeyo.js";function ns(i){const{theme:e}=Rn(),t=Dn();return m.useMemo(()=>Gn(e.direction,{...t,...i}),[i,e.direction,t])}var We=Ue(function(e,t){const{htmlSize:s,...n}=e,r=Mt("Input",n),o=Et(n),a=Ot(o),l=Ct("chakra-input",e.className);return d.jsx(D.input,{size:s,...a,__css:r.field,ref:t,className:l})});We.displayName="Input";We.id="Input";var jt=Ue(function(e,t){const{children:s,placeholder:n,className:r,...o}=e;return d.jsxs(D.select,{...o,ref:t,className:Ct("chakra-select",r),children:[n&&d.jsx("option",{value:"",children:n}),s]})});jt.displayName="SelectField";function ss(i,e){const t={},s={};for(const[n,r]of Object.entries(i))e.includes(n)?t[n]=r:s[n]=r;return[t,s]}var ze=Ue((i,e)=>{var t;const s=Mt("Select",i),{rootProps:n,placeholder:r,icon:o,color:a,height:l,h:c,minH:u,minHeight:h,iconColor:f,iconSize:g,...p}=Et(i),[y,b]=ss(p,Hn),F=Ot(b),O={width:"100%",height:"fit-content",position:"relative",color:a},S={paddingEnd:"2rem",...s.field,_focus:{zIndex:"unset",...(t=s.field)==null?void 0:t._focus}};return d.jsxs(D.div,{className:"chakra-select__wrapper",__css:O,...y,...n,children:[d.jsx(jt,{ref:e,height:c??l,minH:u??h,placeholder:r,...F,__css:S,children:i.children}),d.jsx(Rt,{"data-disabled":Vn(F.disabled),...(f||a)&&{color:f||a},__css:s.icon,...g&&{fontSize:g},children:o})]})});ze.displayName="Select";var is=i=>d.jsx("svg",{viewBox:"0 0 24 24",...i,children:d.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),rs=D("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),Rt=i=>{const{children:e=d.jsx(is,{}),...t}=i,s=m.cloneElement(e,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return d.jsx(rs,{...t,className:"chakra-select__icon-wrapper",children:m.isValidElement(e)?s:null})};Rt.displayName="SelectIcon";const M={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"};class Fe extends nn{constructor(e){super(),this.on,this.once,this.un,this.options=e,this.id=e.id,this.insertFirst=e.insertFirst!==void 0?e.insertFirst:!0,this.stopEvent=e.stopEvent!==void 0?e.stopEvent:!0,this.element=document.createElement("div"),this.element.className=e.className!==void 0?e.className:"ol-overlay-container "+sn,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.autoPan=e.autoPan===!0?{}:e.autoPan||void 0,this.rendered={transform_:"",visible:!0},this.mapPostrenderListenerKey=null,this.addChangeListener(M.ELEMENT,this.handleElementChanged),this.addChangeListener(M.MAP,this.handleMapChanged),this.addChangeListener(M.OFFSET,this.handleOffsetChanged),this.addChangeListener(M.POSITION,this.handlePositionChanged),this.addChangeListener(M.POSITIONING,this.handlePositioningChanged),e.element!==void 0&&this.setElement(e.element),this.setOffset(e.offset!==void 0?e.offset:[0,0]),this.setPositioning(e.positioning||"top-left"),e.position!==void 0&&this.setPosition(e.position)}getElement(){return this.get(M.ELEMENT)}getId(){return this.id}getMap(){return this.get(M.MAP)||null}getOffset(){return this.get(M.OFFSET)}getPosition(){return this.get(M.POSITION)}getPositioning(){return this.get(M.POSITIONING)}handleElementChanged(){rn(this.element);const e=this.getElement();e&&this.element.appendChild(e)}handleMapChanged(){this.mapPostrenderListenerKey&&(on(this.element),an(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);const e=this.getMap();if(e){this.mapPostrenderListenerKey=ln(e,cn.POSTRENDER,this.render,this),this.updatePixelPosition();const t=this.stopEvent?e.getOverlayContainerStopEvent():e.getOverlayContainer();this.insertFirst?t.insertBefore(this.element,t.childNodes[0]||null):t.appendChild(this.element),this.performAutoPan()}}render(){this.updatePixelPosition()}handleOffsetChanged(){this.updatePixelPosition()}handlePositionChanged(){this.updatePixelPosition(),this.performAutoPan()}handlePositioningChanged(){this.updatePixelPosition()}setElement(e){this.set(M.ELEMENT,e)}setMap(e){this.set(M.MAP,e)}setOffset(e){this.set(M.OFFSET,e)}setPosition(e){this.set(M.POSITION,e)}performAutoPan(){this.autoPan&&this.panIntoView(this.autoPan)}panIntoView(e){const t=this.getMap();if(!t||!t.getTargetElement()||!this.get(M.POSITION))return;const s=this.getRect(t.getTargetElement(),t.getSize()),n=this.getElement(),r=this.getRect(n,[un(n),dn(n)]);e=e||{};const o=e.margin===void 0?20:e.margin;if(!hn(s,r)){const a=r[0]-s[0],l=s[2]-r[2],c=r[1]-s[1],u=s[3]-r[3],h=[0,0];if(a<0?h[0]=a-o:l<0&&(h[0]=Math.abs(l)+o),c<0?h[1]=c-o:u<0&&(h[1]=Math.abs(u)+o),h[0]!==0||h[1]!==0){const f=t.getView().getCenterInternal(),g=t.getPixelFromCoordinateInternal(f);if(!g)return;const p=[g[0]+h[0],g[1]+h[1]],y=e.animation||{};t.getView().animateInternal({center:t.getCoordinateFromPixelInternal(p),duration:y.duration,easing:y.easing})}}}getRect(e,t){const s=e.getBoundingClientRect(),n=s.left+window.pageXOffset,r=s.top+window.pageYOffset;return[n,r,n+t[0],r+t[1]]}setPositioning(e){this.set(M.POSITIONING,e)}setVisible(e){this.rendered.visible!==e&&(this.element.style.display=e?"":"none",this.rendered.visible=e)}updatePixelPosition(){const e=this.getMap(),t=this.getPosition();if(!e||!e.isRendered()||!t){this.setVisible(!1);return}const s=e.getPixelFromCoordinate(t),n=e.getSize();this.updateRenderedPosition(s,n)}updateRenderedPosition(e,t){const s=this.element.style,n=this.getOffset(),r=this.getPositioning();this.setVisible(!0);const o=Math.round(e[0]+n[0])+"px",a=Math.round(e[1]+n[1])+"px";let l="0%",c="0%";r=="bottom-right"||r=="center-right"||r=="top-right"?l="-100%":(r=="bottom-center"||r=="center-center"||r=="top-center")&&(l="-50%"),r=="bottom-left"||r=="bottom-center"||r=="bottom-right"?c="-100%":(r=="center-left"||r=="center-center"||r=="center-right")&&(c="-50%");const u=`translate(${l}, ${c}) translate(${o}, ${a})`;this.rendered.transform_!=u&&(this.rendered.transform_=u,s.transform=u)}getOptions(){return this.options}}const cr=gn,os=25.4/.28,as=39.37;function Ke(i){return qe(i,ls,cs)}function ls(i){return i.getView()}function cs(i,e){return i.on("change:view",e)}function Dt(i){return Ke(i)?.getProjection()}function us(i){const e=Ke(i);return qe(e,ds,hs)}function ds(i){return i.getResolution()}function hs(i,e){return i.on("change:resolution",e)}function gs(i){const e=Ke(i);return qe(e,fs,ms)}function fs(i){return i.getCenter()}function ms(i,e){return i.on("change:center",e)}function ps(i){const e=gs(i),t=us(i),s=Dt(i);return m.useMemo(()=>{if(s==null||t==null||e==null)return;const r=fn(s,t,e);return Math.round(r*as*os)},[s,t,e])}function qe(i,e,t){const s=m.useCallback(()=>i?e(i):void 0,[i,e]),n=m.useCallback(r=>{if(!i)return()=>{};const o=t(i,r);return()=>N(o)},[i,t]);return m.useSyncExternalStore(n,s)}const lt=0,re=1,ct=[0,0,0,0],q=[],Ae={MODIFYSTART:"modifystart",MODIFYEND:"modifyend"};class Ne extends wt{constructor(e,t,s){super(e),this.features=t,this.mapBrowserEvent=s}}class ys extends mn{constructor(e){super(e),this.on,this.once,this.un,this.boundHandleFeatureChange_=this.handleFeatureChange_.bind(this),this.condition_=e.condition?e.condition:pn,this.defaultDeleteCondition_=function(s){return yn(s)&&St(s)},this.deleteCondition_=e.deleteCondition?e.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:_n,this.vertexFeature_=null,this.vertexSegments_=null,this.lastPixel_=[0,0],this.ignoreNextSingleClick_=!1,this.featuresBeingModified_=null,this.rBush_=new vn,this.pixelTolerance_=e.pixelTolerance!==void 0?e.pixelTolerance:10,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new ee({source:new Ce({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:vs(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.SEGMENT_WRITERS_={Point:this.writePointGeometry_.bind(this),LineString:this.writeLineStringGeometry_.bind(this),LinearRing:this.writeLineStringGeometry_.bind(this),Polygon:this.writePolygonGeometry_.bind(this),MultiPoint:this.writeMultiPointGeometry_.bind(this),MultiLineString:this.writeMultiLineStringGeometry_.bind(this),MultiPolygon:this.writeMultiPolygonGeometry_.bind(this),Circle:this.writeCircleGeometry_.bind(this),GeometryCollection:this.writeGeometryCollectionGeometry_.bind(this)},this.source_=null,this.hitDetection_=null;let t;if(e.features?t=e.features:e.source&&(this.source_=e.source,t=new _e(this.source_.getFeatures()),this.source_.addEventListener(Xe.ADDFEATURE,this.handleSourceAdd_.bind(this)),this.source_.addEventListener(Xe.REMOVEFEATURE,this.handleSourceRemove_.bind(this))),!t)throw new Error("The modify interaction requires features, a source or a layer");e.hitDetection&&(this.hitDetection_=e.hitDetection),this.features_=t,this.features_.forEach(this.addFeature_.bind(this)),this.features_.addEventListener(K.ADD,this.handleFeatureAdd_.bind(this)),this.features_.addEventListener(K.REMOVE,this.handleFeatureRemove_.bind(this)),this.lastPointerEvent_=null,this.delta_=[0,0],this.snapToPointer_=e.snapToPointer===void 0?!this.hitDetection_:e.snapToPointer}addFeature_(e){const t=e.getGeometry();if(t){const n=this.SEGMENT_WRITERS_[t.getType()];n&&n(e,t)}const s=this.getMap();s&&s.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,s),e.addEventListener(Ze.CHANGE,this.boundHandleFeatureChange_)}willModifyFeatures_(e,t){if(!this.featuresBeingModified_){this.featuresBeingModified_=new _e;const s=this.featuresBeingModified_.getArray();for(let n=0,r=t.length;n=0;--n){const r=s[n];for(let o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===r&&this.dragSegments_.splice(o,1);t.remove(r)}}setActive(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),super.setActive(e)}setMap(e){this.overlay_.setMap(e),super.setMap(e)}getOverlay(){return this.overlay_}handleSourceAdd_(e){e.feature&&this.features_.push(e.feature)}handleSourceRemove_(e){e.feature&&this.features_.remove(e.feature)}handleFeatureAdd_(e){this.addFeature_(e.element)}handleFeatureChange_(e){if(!this.changingFeature_){const t=e.target;this.removeFeature_(t),this.addFeature_(t)}}handleFeatureRemove_(e){this.removeFeature_(e.element)}writePointGeometry_(e,t){const s=t.getCoordinates(),n={feature:e,geometry:t,segment:[s,s]};this.rBush_.insert(t.getExtent(),n)}writeMultiPointGeometry_(e,t){const s=t.getCoordinates();for(let n=0,r=s.length;n=0;--c)this.insertVertex_(n[c],r)}return!!this.vertexFeature_}handleUpEvent(e){for(let t=this.dragSegments_.length-1;t>=0;--t){const s=this.dragSegments_[t][0],n=s.geometry;if(n.getType()==="Circle"){const r=n.getCenter(),o=s.featureSegments[0],a=s.featureSegments[1];o.segment[0]=r,o.segment[1]=r,a.segment[0]=r,a.segment[1]=r,this.rBush_.update(Te(r),o);let l=n;this.rBush_.update(l.getExtent(),a)}else this.rBush_.update(j(s.segment),s)}return this.featuresBeingModified_&&(this.dispatchEvent(new Ne(Ae.MODIFYEND,this.featuresBeingModified_,e)),this.featuresBeingModified_=null),!1}handlePointerMove_(e){this.lastPixel_=e.pixel,this.handlePointerAtPixel_(e.pixel,e.map,e.coordinate)}handlePointerAtPixel_(e,t,s){const n=s||t.getCoordinateFromPixel(e);t.getView().getProjection();const r=function(l,c){return ut(n,l)-ut(n,c)};let o,a;if(this.hitDetection_){const l=typeof this.hitDetection_=="object"?c=>c===this.hitDetection_:void 0;t.forEachFeatureAtPixel(e,(c,u,h)=>{h&&h.getType()==="Point"&&(h=new Qe(Oe(h.getCoordinates())));const f=h||c.getGeometry();if(c instanceof Z&&this.features_.getArray().includes(c)){a=f;const g=c.getGeometry().getFlatCoordinates().slice(0,2);o=[{feature:c,geometry:a,segment:[g,g]}]}return!0},{layerFilter:l})}if(!o){const l=Sn(Te(n,ct)),c=t.getView().getResolution()*this.pixelTolerance_,u=xn(wn(l,c,ct));o=this.rBush_.getInExtent(u)}if(o&&o.length>0){const l=o.sort(r)[0],c=l.segment;let u=dt(n,l);const h=t.getPixelFromCoordinate(u);let f=et(e,h);if(a||f<=this.pixelTolerance_){const g={};if(g[C(c)]=!0,this.snapToPointer_||(this.delta_[0]=u[0]-n[0],this.delta_[1]=u[1]-n[1]),l.geometry.getType()==="Circle"&&l.index===re)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(u,[l.feature],[l.geometry]);else{const p=t.getPixelFromCoordinate(c[0]),y=t.getPixelFromCoordinate(c[1]),b=je(h,p),F=je(h,y);f=Math.sqrt(Math.min(b,F)),this.snappedToVertex_=f<=this.pixelTolerance_,this.snappedToVertex_&&(u=b>F?c[1]:c[0]),this.createOrUpdateVertexFeature_(u,[l.feature],[l.geometry]);const O={};O[C(l.geometry)]=!0;for(let S=1,L=o.length;S=0;--l)o=e[l],g=o[0],p=C(g.feature),g.depth&&(p+="-"+g.depth.join("-")),p in t||(t[p]={}),o[1]===0?(t[p].right=g,t[p].index=g.index):o[1]==1&&(t[p].left=g,t[p].index=g.index+1);for(p in t){switch(f=t[p].right,u=t[p].left,c=t[p].index,h=c-1,u!==void 0?g=u:g=f,h<0&&(h=0),a=g.geometry,r=a.getCoordinates(),n=r,s=!1,a.getType()){case"MultiLineString":r[g.depth[0]].length>2&&(r[g.depth[0]].splice(c,1),s=!0);break;case"LineString":r.length>2&&(r.splice(c,1),s=!0);break;case"MultiPolygon":n=n[g.depth[1]];case"Polygon":n=n[g.depth[0]],n.length>4&&(c==n.length-1&&(c=0),n.splice(c,1),s=!0,c===0&&(n.pop(),n.push(n[0]),h=n.length-1));break}if(s){this.setGeometryCoordinates_(a,r);const y=[];if(u!==void 0&&(this.rBush_.remove(u),y.push(u.segment[0])),f!==void 0&&(this.rBush_.remove(f),y.push(f.segment[1])),u!==void 0&&f!==void 0){const b={depth:g.depth,feature:g.feature,geometry:g.geometry,index:h,segment:y};this.rBush_.insert(j(b.segment),b)}this.updateSegmentIndices_(a,c,g.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),e.length=0}}return s}setGeometryCoordinates_(e,t){this.changingFeature_=!0,e.setCoordinates(t),this.changingFeature_=!1}updateSegmentIndices_(e,t,s,n){this.rBush_.forEachInExtent(e.getExtent(),function(r){r.geometry===e&&(s===void 0||r.depth===void 0||bn(r.depth,s))&&r.index>t&&(r.index+=n)})}}function _s(i,e){return i.index-e.index}function ut(i,e,t){const s=e.geometry;if(s.getType()==="Circle"){let r=s;if(e.index===re){const o=je(r.getCenter(),A(i)),a=Math.sqrt(o)-r.getRadius();return a*a}}const n=A(i);return q[0]=A(e.segment[0]),q[1]=A(e.segment[1]),En(n,q)}function dt(i,e,t){const s=e.geometry;if(s.getType()==="Circle"&&e.index===re)return Oe(s.getClosestPoint(A(i)));const n=A(i);return q[0]=A(e.segment[0]),q[1]=A(e.segment[1]),Oe(Mn(n,q))}function vs(){const i=xt();return function(e,t){return i.Point}}const Ss={SELECT:"select"};class xs extends wt{constructor(e,t,s,n){super(e),this.selected=t,this.deselected=s,this.mapBrowserEvent=n}}const pe={};class Gt extends Cn{constructor(e){super(),this.on,this.once,this.un,e=e||{},this.boundAddFeature_=this.addFeature_.bind(this),this.boundRemoveFeature_=this.removeFeature_.bind(this),this.condition_=e.condition?e.condition:St,this.addCondition_=e.addCondition?e.addCondition:tt,this.removeCondition_=e.removeCondition?e.removeCondition:tt,this.toggleCondition_=e.toggleCondition?e.toggleCondition:Pn,this.multi_=e.multi?e.multi:!1,this.filter_=e.filter?e.filter:nt,this.hitTolerance_=e.hitTolerance?e.hitTolerance:0,this.style_=e.style!==void 0?e.style:ws(),this.features_=e.features||new _e;let t;if(e.layers)if(typeof e.layers=="function")t=e.layers;else{const s=e.layers;t=function(n){return s.includes(n)}}else t=nt;this.layerFilter_=t,this.featureLayerAssociation_={}}addFeatureLayerAssociation_(e,t){this.featureLayerAssociation_[C(e)]=t}getFeatures(){return this.features_}getHitTolerance(){return this.hitTolerance_}getLayer(e){return this.featureLayerAssociation_[C(e)]}setHitTolerance(e){this.hitTolerance_=e}setMap(e){this.getMap()&&this.style_&&this.features_.forEach(this.restorePreviousStyle_.bind(this)),super.setMap(e),e?(this.features_.addEventListener(K.ADD,this.boundAddFeature_),this.features_.addEventListener(K.REMOVE,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(K.ADD,this.boundAddFeature_),this.features_.removeEventListener(K.REMOVE,this.boundRemoveFeature_))}addFeature_(e){const t=e.element;if(this.style_&&this.applySelectedStyle_(t),!this.getLayer(t)){const s=this.getMap().getAllLayers().find(function(n){if(n instanceof ee&&n.getSource()&&n.getSource().hasFeature(t))return n});s&&this.addFeatureLayerAssociation_(t,s)}}removeFeature_(e){this.style_&&this.restorePreviousStyle_(e.element)}getStyle(){return this.style_}applySelectedStyle_(e){const t=C(e);t in pe||(pe[t]=e.getStyle()),e.setStyle(this.style_)}restorePreviousStyle_(e){const t=this.getMap().getInteractions().getArray();for(let n=t.length-1;n>=0;--n){const r=t[n];if(r!==this&&r instanceof Gt&&r.getStyle()&&r.getFeatures().getArray().lastIndexOf(e)!==-1){e.setStyle(r.getStyle());return}}const s=C(e);e.setStyle(pe[s]),delete pe[s]}removeFeatureLayerAssociation_(e){delete this.featureLayerAssociation_[C(e)]}handleEvent(e){if(!this.condition_(e))return!0;const t=this.addCondition_(e),s=this.removeCondition_(e),n=this.toggleCondition_(e),r=!t&&!s&&!n,o=e.map,a=this.getFeatures(),l=[],c=[];if(r){Fn(this.featureLayerAssociation_),o.forEachFeatureAtPixel(e.pixel,(u,h)=>{if(!(!(u instanceof Z)||!this.filter_(u,h)))return this.addFeatureLayerAssociation_(u,h),c.push(u),!this.multi_},{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(let u=a.getLength()-1;u>=0;--u){const h=a.item(u),f=c.indexOf(h);f>-1?c.splice(f,1):(a.remove(h),l.push(h))}c.length!==0&&a.extend(c)}else{o.forEachFeatureAtPixel(e.pixel,(u,h)=>{if(!(!(u instanceof Z)||!this.filter_(u,h)))return(t||n)&&!a.getArray().includes(u)?(this.addFeatureLayerAssociation_(u,h),c.push(u)):(s||n)&&a.getArray().includes(u)&&(l.push(u),this.removeFeatureLayerAssociation_(u)),!this.multi_},{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(let u=l.length-1;u>=0;--u)a.remove(l[u]);a.extend(c)}return(c.length>0||l.length>0)&&this.dispatchEvent(new xs(Ss.SELECT,c,l,e)),!0}}function ws(){const i=xt();return st(i.Polygon,i.LineString),st(i.GeometryCollection,i.LineString),function(e){return e.getGeometry()?i[e.getGeometry().getType()]:null}}async function bs(i,e,t,s){const r=s.getCode().replace("EPSG:","http://www.opengis.net/def/crs/EPSG/0/"),o=await i.fetch(e,{method:"POST",body:JSON.stringify({type:"Feature",properties:{},geometry:t}),headers:{"Content-Type":"application/geo+json; charset=utf-8","Content-Crs":`<${r}>`}});if(!o||!o.ok||o.status!==201)throw new Error("Request failed: "+o.status);const a=o.headers.get("location");if(!a)throw new Error("Request failed: no Location response header");const l=a.substring(a.lastIndexOf("/")+1);return Promise.resolve(l)}async function Ms(i,e,t,s,n){const o=n.getCode().replace("EPSG:","http://www.opengis.net/def/crs/EPSG/0/"),a=new URL(`${e.toString()}/${t}`),l=await i.fetch(a,{method:"PATCH",body:JSON.stringify({type:"Feature",properties:{},geometry:s}),headers:{"Content-Type":"application/geo+json; charset=utf-8","Content-Crs":`<${o}>`}});if(!l||!l.ok||l.status!==204)throw new Error("Request failed: "+l.status);return Promise.resolve(t)}function Vt(i,e){const t=document.createElement("div");t.className="editing-tooltip editing-tooltip-hidden",t.role="tooltip";const s=document.createElement("span");s.textContent=e,t.appendChild(s);const n=new Fe({element:t,offset:[15,0],positioning:"center-left"}),r=i.on("pointermove",o=>{o.dragging||n.setPosition(o.coordinate)});return i.addOverlay(n),{destroy(){N(r),i.removeOverlay(n)},setVisible(o){t.classList.toggle("editing-tooltip-hidden",!o)},setText(o){s.textContent=o}}}function Ht(i){let e=ht(i.polygon);Array.isArray(e)&&(e=e[0]);let t=ht(i.vertex);Array.isArray(t)&&(t=t[0]);const s=[];return e&&s.push(e),t&&(t.setGeometry(Es),s.push(t)),s}const Es=i=>{if(i){const e=i.getGeometry();if(e&&e.getType()==="Polygon"){const t=e.getCoordinates()[0];if(t)return new Kn(t)}}},ht=i=>{const e=new Z,s=new ee({style:i}).getStyleFunction();if(!s)throw new Error("can't retrieve style function");const n=s(e,1);if(!n)throw new Error("can't retrieve styles from feature style function");return Array.isArray(n)&&n.length?n.length>1?n:n[0]:n},Cs=fe("editing:EditingCreateWorkflowImpl");var R;class Ps{constructor(e){x(this,R);_(this,"_httpService");_(this,"_intl");_(this,"_map");_(this,"_polygonStyle");_(this,"_vertexStyle");_(this,"_state");_(this,"_editLayerURL");_(this,"_featureId");_(this,"_editingSource");_(this,"_editingLayer");_(this,"_drawInteraction");_(this,"_olMap");_(this,"_tooltip");_(this,"_enterHandler");_(this,"_escapeHandler");_(this,"_error");_(this,"_interactionListener");_(this,"_mapListener");this._httpService=e.httpService,this._intl=e.intl,this._polygonStyle=e.polygonStyle,this._vertexStyle=e.vertexStyle,this._map=e.map,this._olMap=e.map.olMap,this._state=He("active:initialized"),this._editLayerURL=e.ogcApiFeatureLayerUrl,this._editingSource=new Ce,this._editingLayer=new ee({source:this._editingSource,zIndex:Be,properties:{name:"editing-layer"}}),this._drawInteraction=new At({source:this._editingSource,type:"Polygon",style:Ht({polygon:this._polygonStyle,vertex:this._vertexStyle})}),this._tooltip=Vt(this._olMap,this._intl.formatMessage({id:"create.tooltip.begin"})),this._enterHandler=t=>{if((t.code==="Enter"||t.code==="NumpadEnter")&&t.target===this._olMap.getTargetElement()){const s=this._drawInteraction.getOverlay().getSource()?.getFeatures()??[];s[0]&&s[0].getGeometry().getCoordinates()[0].length>4&&this.triggerSave()}},this._escapeHandler=t=>{t.code==="Escape"&&t.target===this._olMap.getTargetElement()&&this.reset()},this._interactionListener=[],this._mapListener=[],this._start()}getDrawInteraction(){return this._drawInteraction}getState(){return this._state.value}_setState(e){this._state.value=e}_save(e){this._setState("active:saving");const t=this._editLayerURL,s=e.getGeometry();if(!s){this._destroy(),this._error=new Error("no geometry available"),v(this,R)?.reject(this._error);return}const n=this._olMap.getView().getProjection(),o=new Tt({dataProjection:n}).writeGeometryObject(s,{rightHanded:!0,decimals:10});this._olMap.removeInteraction(this._drawInteraction),this._tooltip.destroy(),bs(this._httpService,t,o,n).then(a=>{this._featureId=a,this._destroy(),v(this,R)?.resolve({featureId:this._featureId})}).catch(a=>{Cs.error(a),this._destroy(),this._error=new Error("Failed to save feature",{cause:a}),v(this,R)?.reject(this._error)})}_start(){this._olMap.addLayer(this._editingLayer),this._olMap.addInteraction(this._drawInteraction);const e=bt(()=>{const n=this._map.container;if(n)return n.addEventListener("keydown",this._enterHandler,!1),n.addEventListener("keydown",this._escapeHandler,!1),()=>{n.removeEventListener("keydown",this._enterHandler),n.removeEventListener("keydown",this._escapeHandler)}});this._tooltip.setVisible(!0);const t=this._drawInteraction.on("drawstart",()=>{this._setState("active:drawing"),this._tooltip.setText(this._intl.formatMessage({id:"create.tooltip.continue"}))}),s=this._drawInteraction.on("drawend",n=>{const r=n.feature;if(!r){this._destroy(),this._error=new Error("no feature available"),v(this,R)?.reject(this._error);return}this._save(r)});this._interactionListener.push(t,s),this._mapListener.push(e)}reset(){this._drawInteraction.abortDrawing(),this._tooltip.setText(this._intl.formatMessage({id:"create.tooltip.begin"})),this._setState("active:initialized")}stop(){this._destroy(),v(this,R)?.resolve(void 0)}_destroy(){this._olMap.removeLayer(this._editingLayer),this._olMap.removeInteraction(this._drawInteraction),this._tooltip.destroy(),this._interactionListener.forEach(e=>{N(e)}),this._mapListener.forEach(e=>{e.destroy()}),this._setState("destroyed")}triggerSave(){this._drawInteraction.finishDrawing()}whenComplete(){return this._state.value==="destroyed"?this._error?Promise.reject(this._error):this._featureId?Promise.resolve({featureId:this._featureId}):Promise.resolve(void 0):(v(this,R)??w(this,R,Pt())).promise}}R=new WeakMap;var I;class Fs{constructor(e){x(this,I);_(this,"_httpService");_(this,"_intl");_(this,"_map");_(this,"_polygonStyle");_(this,"_vertexStyle");_(this,"_state");_(this,"_editLayerURL");_(this,"_featureId");_(this,"_initialFeature");_(this,"_editFeature");_(this,"_editingSource");_(this,"_editingLayer");_(this,"_modifyInteraction");_(this,"_olMap");_(this,"_tooltip");_(this,"_enterHandler");_(this,"_escapeHandler");_(this,"_error");_(this,"_interactionListener");_(this,"_mapListener");this._httpService=e.httpService,this._intl=e.intl,this._polygonStyle=e.polygonStyle,this._vertexStyle=e.vertexStyle,this._map=e.map,this._olMap=e.map.olMap,this._state=He("active:initialized"),this._editLayerURL=e.ogcApiFeatureLayerUrl,this._initialFeature=e.feature.clone(),this._initialFeature.setId(e.feature.getId()),this._editFeature=e.feature.clone(),this._editFeature.setId(e.feature.getId()),this._editFeature.setStyle(Ht({polygon:this._polygonStyle,vertex:this._vertexStyle})),this._editingSource=new Ce({features:new _e([this._editFeature])}),this._editingLayer=new ee({source:this._editingSource,zIndex:Be,properties:{name:"editing-layer"}}),this._modifyInteraction=new ys({source:this._editingSource}),this._tooltip=Vt(this._olMap,this._intl.formatMessage({id:"create.tooltip.deselect"})),this._enterHandler=t=>{if((t.code==="Enter"||t.code==="NumpadEnter")&&t.target===this._olMap.getTargetElement()){const s=this._editingSource.getFeatures()[0];if(!s)throw Error("no updated feature found");this._save(s)}},this._escapeHandler=t=>{t.code==="Escape"&&t.target===this._olMap.getTargetElement()&&this.reset()},this._interactionListener=[],this._mapListener=[],this._start()}getModifyInteraction(){return this._modifyInteraction}getState(){return this._state.value}_setState(e){this._state.value=e}_save(e){this._setState("active:saving");const t=this._editLayerURL;if(this._featureId=e.getId()?.toString(),!this._featureId){this._destroy(),this._error=new Error("no feature id available"),v(this,I)?.reject(this._error);return}const s=e?.getGeometry();if(!s){this._destroy(),this._error=new Error("no geometry available"),v(this,I)?.reject(this._error);return}const n=this._olMap.getView().getProjection(),o=new Tt({dataProjection:n}).writeGeometryObject(s,{rightHanded:!0,decimals:10});this._olMap.removeInteraction(this._modifyInteraction),this._tooltip.destroy(),Ms(this._httpService,t,this._featureId,o,n).then(a=>{this._destroy(),v(this,I)?.resolve({featureId:a})}).catch(a=>{this._destroy(),this._error=new Error("Failed to save feature",{cause:a}),v(this,I)?.reject(this._error)})}_start(){this._olMap.addLayer(this._editingLayer),this._olMap.addInteraction(this._modifyInteraction);const e=this._editingSource.getFeatures()[0];if(e&&!e.getId()?.toString()){this._destroy(),this._error=new Error("no feature id available"),v(this,I)?.reject(this._error);return}const t=bt(()=>{const r=this._map.container;if(r)return r.addEventListener("keydown",this._enterHandler,!1),r.addEventListener("keydown",this._escapeHandler,!1),()=>{r.removeEventListener("keydown",this._enterHandler),r.removeEventListener("keydown",this._escapeHandler)}});this._tooltip.setVisible(!0);const s=this._map.olMap.on("click",r=>{const o=r.coordinate,a=r.originalEvent.altKey,l=this._editingSource.getFeaturesAtCoordinate(o);a||l.length===0&&this.triggerSave()}),n=this._modifyInteraction.on("modifystart",()=>{this._setState("active:drawing")});this._interactionListener.push(s,n),this._mapListener.push(t)}reset(){const e=this._initialFeature.getGeometry()?.clone(),t=this._editingSource.getFeatures()[0];if(!t)throw Error("no updated feature found");t.setGeometry(e),this._setState("active:initialized")}stop(){this._destroy(),v(this,I)?.resolve(void 0)}_destroy(){this._editingSource.clear(),this._olMap.removeLayer(this._editingLayer),this._olMap.removeInteraction(this._modifyInteraction),this._tooltip.destroy(),this._interactionListener.forEach(e=>{N(e)}),this._mapListener.forEach(e=>{e.destroy()}),this._setState("destroyed")}triggerSave(){const e=this._editingSource.getFeatures()[0];if(!e)throw Error("no updated feature found");this._save(e)}whenComplete(){return this._state.value==="destroyed"?this._error?Promise.reject(this._error):this._featureId?Promise.resolve({featureId:this._featureId}):Promise.resolve(void 0):(v(this,I)??w(this,I,Pt())).promise}}I=new WeakMap;class ur{_serviceOptions;_workflows;constructor(e){this._serviceOptions=e,this._workflows=new Map}createFeature(e,t){if(!t||!e||!e.id)throw new Error("Map, mapId or url is undefined.");const s=e.id;let n=this._workflows.get(s);if(n)throw new Error("EditingWorkflow could not be started. EditingWorkflow already in progress for this map.");return n=new Ps({map:e,ogcApiFeatureLayerUrl:t,polygonStyle:this._serviceOptions.properties.polygonStyle,vertexStyle:this._serviceOptions.properties.vertexStyle,httpService:this._serviceOptions.references.httpService,intl:this._serviceOptions.intl}),this._workflows.set(s,n),this._connectToWorkflowDestroyEvent(n,s),n}updateFeature(e,t,s){if(!t||!e||!e.id)throw new Error("Map, mapId or url is undefined.");const n=e.id;let r=this._workflows.get(n);if(r)throw new Error("EditingWorkflow could not be started. EditingWorkflow already in progress for this map.");return r=new Fs({map:e,ogcApiFeatureLayerUrl:t,feature:s,polygonStyle:this._serviceOptions.properties.polygonStyle,vertexStyle:this._serviceOptions.properties.vertexStyle,httpService:this._serviceOptions.references.httpService,intl:this._serviceOptions.intl}),this._workflows.set(n,r),this._connectToWorkflowDestroyEvent(r,n),r}stop(e){const t=this._workflows.get(e);t&&t.stop()}reset(e){const t=this._workflows.get(e);if(t)t.reset();else throw new Error("No workflow found for mapId: "+e)}_connectToWorkflowDestroyEvent(e,t){const s=Ln(()=>[e.getState()],([n])=>{n==="destroyed"&&(this._workflows.get(t)===e&&this._workflows.delete(t),s.destroy())})}}var W,G,oe,ae,le,Ve;class Ls{constructor(e,t,s){x(this,le);_(this,"label");x(this,W,He({kind:"available"}));x(this,G);x(this,oe);x(this,ae);this.label=t,w(this,G,e),w(this,ae,s),ne(this,le,Ve).call(this),w(this,oe,v(this,G).on("change:visible",()=>{ne(this,le,Ve).call(this)}))}destroy(){N(v(this,oe))}get status(){return v(this,W).value}async select(e,t){if(e.type!=="extent")throw new Error(`Unsupported selection kind: ${e.type}`);if(v(this,W).value.kind!=="available"||v(this,G).getSource()===null)return[];const s=[];v(this,G).getSource().forEachFeatureIntersectingExtent(e.extent,o=>{if(!o.getGeometry())return;const a={...o.getProperties()};delete a.geometries;const l={id:o.getId()?.toString()||In(),geometry:o.getGeometry(),properties:a};s.push(l)});const n=s.filter(o=>o!=null);return n.length>t.maxResults?n.slice(0,t.maxResults):n}}W=new WeakMap,G=new WeakMap,oe=new WeakMap,ae=new WeakMap,le=new WeakSet,Ve=function(){const t=v(this,G).getVisible()?{kind:"available"}:{kind:"unavailable",reason:v(this,ae)};t.kind!==v(this,W).value.kind&&(v(this,W).value=t)};var ce;class dr{constructor({intl:e}){x(this,ce);w(this,ce,e)}createSelectionSource(e){return new Ls(e.vectorLayer,e.label,v(this,ce).formatMessage({id:"layerNotVisibleReason"}))}}ce=new WeakMap;const Is="@open-pioneer/notifier",Ts=$e.bind(void 0,Is),As=kt({d:"M23.384,21.619,16.855,15.09a9.284,9.284,0,1,0-1.768,1.768l6.529,6.529a1.266,1.266,0,0,0,1.768,0A1.251,1.251,0,0,0,23.384,21.619ZM2.75,9.5a6.75,6.75,0,1,1,6.75,6.75A6.758,6.758,0,0,1,2.75,9.5Z",displayName:"SearchIcon"}),Bt=kt({displayName:"WarningTwoIcon",d:"M23.119,20,13.772,2.15h0a2,2,0,0,0-3.543,0L.881,20a2,2,0,0,0,1.772,2.928H21.347A2,2,0,0,0,23.119,20ZM11,8.423a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Zm1.05,11.51h-.028a1.528,1.528,0,0,1-1.522-1.47,1.476,1.476,0,0,1,1.448-1.53h.028A1.527,1.527,0,0,1,13.5,18.4,1.475,1.475,0,0,1,12.05,19.933Z"}),Ns=!1;function hr(i){const{position:e="top-right"}=i,t=ns(),s=Ts("notifier.NotificationService"),[n,r]=m.useState(!Ns),o=V(l=>{const c=l.level==="error"?d.jsx(Bt,{h:"100%",w:"100%"}):void 0;t({position:e,title:l.title,description:l.message||null,status:l.level,isClosable:!0,duration:l.displayDuration??null,icon:c})}),a=V(()=>{t.closeAll()});return m.useEffect(()=>{const l=s.registerHandler({showNotification:o,closeAll:a});return()=>l.destroy()},[n,s,o,a]),d.jsx(d.Fragment,{})}const ks="@open-pioneer/coordinate-viewer",Os=z.bind(void 0,ks),js=4,Rs="decimal",gr=i=>{const{precision:e,displayProjectionCode:t,format:s}=i,{containerProps:n}=H("coordinate-viewer",i),{map:r}=B(i),o=r?.olMap,a=Dt(o)?.getCode()??"";let{coordinates:l}=Gs(o);l=l&&t?Hs(l,a,t):l;const c=Ds(l,e,s),u=t||a,h=c?c+" "+u:"";return d.jsx(P,{...n,children:d.jsx(Q,{className:"coordinate-viewer-text",children:h})})};function Ds(i,e,t){const s=Os();return i?Vs(i,e,s,t):""}function Gs(i){const[e,t]=m.useState();return m.useEffect(()=>{if(!i)return;const s=i.on("pointermove",n=>{t(n.coordinate)});return()=>N(s)},[i]),{coordinates:e}}function Vs(i,e,t,s){if(i[0]==null||i[1]==null)return"";const n=e??js,r=s??Rs,[o,a]=i;let l;if(r==="degree"&&isFinite(o)&&isFinite(a)){const[c,u,h]=gt(o,t,n),[f,g,p]=gt(a,t,n),y=`${Math.abs(c)}°${u}'${h}"${0<=c?"(E)":"(W)"}`,b=`${Math.abs(f)}°${g}'${p}"${0<=f?"(N)":"(S)"}`;l=y+" "+b}else{const c=t.formatNumber(o,{maximumFractionDigits:n,minimumFractionDigits:n}),u=t.formatNumber(a,{maximumFractionDigits:n,minimumFractionDigits:n});l=c+" "+u}return l}function gt(i,e,t){const s=Math.floor(i),n=i-s,r=Math.floor(60*n),a=60*(60*n-r),l=e.formatNumber(a,{maximumFractionDigits:t,minimumFractionDigits:t});return[s,r,l]}function Hs(i,e,t){return Tn(i,e,t)}const fr=i=>{const{displayMode:e="line"}=i,{containerProps:t}=H("scale-bar",i),{map:s}=B(i),n=m.useRef(null);return m.useEffect(()=>{if(n.current&&s){const r=s.olMap,o=new qn({units:"metric",target:n.current,bar:e==="bar"});return r.addControl(o),()=>{r.removeControl(o)}}},[e,s]),d.jsx(P,{...t,ref:n})},Bs="@open-pioneer/scale-viewer",$s=z.bind(void 0,Bs),mr=i=>{const{containerProps:e}=H("scale-viewer",i),{map:t}=B(i),s=$s(),n=ps(t?.olMap),r=n?s.formatNumber(n):void 0;return d.jsx(P,{...e,children:r&&d.jsxs(Q,{children:["1:",r]})})},Us="@open-pioneer/legend",$t=z.bind(void 0,Us),pr=i=>{const{showBaseLayers:e=!1}=i,{containerProps:t}=H("legend",i),{map:s}=B(i);return d.jsx(P,{...t,children:s?d.jsx(Ws,{map:s,showBaseLayers:e}):null})};function Ws(i){const{map:e,showBaseLayers:t}=i,n=Ks(e).map(r=>d.jsx(Ut,{layer:r,showBaseLayers:t},r.id));return d.jsx(Zn,{as:"ul",className:"legend-layer-list",listStyleType:"none",spacing:2,children:n})}function Ut(i){const{layer:e,showBaseLayers:t}=i,s=te(()=>e.visible,[e]),n=qs(e);if(!s||!t&&zn(e)&&Wt(e))return;const r=[];return n?.length&&n.forEach(o=>{r.push(d.jsx(Ut,{layer:o,showBaseLayers:t},o.id))}),d.jsxs(d.Fragment,{children:[d.jsx(zs,{layer:e,showBaseLayers:t}),r]})}function zs(i){const e=$t(),{layer:t,showBaseLayers:s}=i,n=Wt(t),r=Ys(t),o=te(()=>t.legend,[t]);let a;return r?.Component?a=d.jsx(r.Component,{layer:t}):r?.imageUrl?a=d.jsx(ft,{layer:t,imageUrl:r.imageUrl}):o&&(a=d.jsx(ft,{layer:t,imageUrl:o})),a?d.jsxs(P,{as:"li",className:Pe("legend-item",`layer-${Js(t.id)}`),children:[s&&n?d.jsx(Q,{as:"b",children:e.formatMessage({id:"basemapLabel"})}):null,a]}):void 0}function ft(i){const e=$t(),{layer:t,imageUrl:s}=i;return d.jsxs(P,{children:[d.jsx(Q,{children:t.title}),d.jsx(Yn,{maxW:"none",maxH:"none",src:s,alt:e.formatMessage({id:"altLabel"},{layerName:t.title}),className:"legend-item__image",fallbackStrategy:"onError",fallback:d.jsx(P,{children:d.jsxs(Q,{children:[d.jsx(Bt,{me:2}),e.formatMessage({id:"fallbackLabel"})]})})})]})}function Ks(i){return te(()=>{const e=i.layers.getAllLayers({sortByDisplayOrder:!0})??[];return e.reverse(),e},[i])}function qs(i){return te(()=>{const e=i.sublayers?.getSublayers({sortByDisplayOrder:!0});if(e)return e.reverse(),e},[i])}function Ys(i){return te(()=>i.attributes.legend,[i])}function Wt(i){return!("parentLayer"in i)&&i.isBaseLayer}function Js(i){return i.toLowerCase().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")}const Xs="@open-pioneer/measurement",Zs=z.bind(void 0,Xs);class Qs{olMap;messages;activeFeatureStyle;layer;source;draw=void 0;activeMeasurement;predefinedMeasurements=new Map;finishedMeasurements=new Set;helpTooltip;resources=[];measurementChangedHandler;constructor(e,t){this.olMap=e,this.messages=t;const s=this.source=new Ce;this.layer=new ee({source:s,zIndex:Be,properties:{name:"measurement-layer"}}),e.addLayer(this.layer);const n=e.on("pointermove",this.handlePointerMove.bind(this));this.resources.push({destroy(){N(n)}});const r=()=>{this.helpTooltip.element.classList.add("hidden")};e.getViewport().addEventListener("mouseout",r),this.resources.push({destroy(){e.getViewport().removeEventListener("mouseout",r)}}),this.helpTooltip=ti(this.olMap)}destroy(){this.stopMeasurement();for(const e of this.resources)e.destroy();this.resources=[],this.activeMeasurement=at(this.activeMeasurement);for(const e of this.finishedMeasurements)e.destroy();this.finishedMeasurements.clear(),this.helpTooltip.destroy(),this.olMap.removeLayer(this.layer),this.layer.dispose(),this.source.dispose(),this.measurementChangedHandler=void 0,this.predefinedMeasurements.clear()}getVectorLayer(){return this.layer}setFinishedFeatureStyle(e){this.layer.setStyle(e)}setMeasurementSourceChangedHandler(e){this.measurementChangedHandler=e}setPredefinedMeasurements(e){this.updatePredefinedMeasurements(e)}setActiveFeatureStyle(e){const t=An(e);this.activeFeatureStyle=(s,...n)=>{const r=s?.getGeometry()?.getType();if(r==="Polygon"||r==="LineString"||r==="Point")return t(s,...n)},this.draw?.getOverlay().setStyle(this.activeFeatureStyle)}clearMeasurements(){const e=this.source.getFeatures();this.source.clear(),e.forEach(t=>{this.raiseMeasurementsChangeEvent("remove-measurement",t)}),this.predefinedMeasurements.clear();for(const t of this.finishedMeasurements)t.destroy();this.finishedMeasurements.clear()}startMeasurement(e){if(this.draw)throw new Error("Internal error: another measurement interaction is still active.");const t=e==="area"?"Polygon":"LineString",s=this.draw=new At({source:this.source,type:t,style:this.activeFeatureStyle});this.olMap.addInteraction(s);let n,r;s.on("drawstart",o=>{const a=o.feature;a&&(n=this.activeMeasurement=new mt("active",a,this),r=a.getGeometry()?.on("change",()=>{n?.updateTooltipContent(),n?.updateTooltipPosition()}))}),s.on("drawend",()=>{if(n&&n===this.activeMeasurement){const o=n;o.updateState("finished"),this.finishedMeasurements.add(o),this.raiseMeasurementsChangeEvent("add-measurement",o.feature),this.activeMeasurement=n=void 0}n=void 0,r&&N(r)}),s.on("drawabort",()=>{n&&(n.destroy(),n===this.activeMeasurement&&(this.activeMeasurement=void 0),n=void 0),r&&N(r)})}stopMeasurement(){this.draw&&(this.olMap.removeInteraction(this.draw),this.draw.abortDrawing(),this.draw.dispose(),this.draw=void 0),this.activeMeasurement=at(this.activeMeasurement)}handlePointerMove(e){if(e.dragging)return;const t=this.helpTooltip,s=si(this.messages,this.activeMeasurement);t.setText(s),t.overlay.setPosition(e.coordinate),t.element.classList.remove("hidden")}updatePredefinedMeasurements(e){const t=e.filter(n=>!this.predefinedMeasurements.has(n)),s=[];for(const n of this.predefinedMeasurements.keys())e.includes(n)||s.push(n);t.forEach(n=>{const r=new Z(n);this.source.addFeature(r);const o=new mt("finished",r,this);this.finishedMeasurements.add(o),this.predefinedMeasurements.set(n,o),this.raiseMeasurementsChangeEvent("add-measurement",r)}),s.forEach(n=>{const r=this.predefinedMeasurements.get(n);r&&(this.source.removeFeature(r.feature),this.finishedMeasurements.delete(r),r.destroy(),this.raiseMeasurementsChangeEvent("remove-measurement",r.feature)),this.predefinedMeasurements.delete(n)})}raiseMeasurementsChangeEvent(e,t){const s=t.getGeometry();this.measurementChangedHandler&&s&&this.measurementChangedHandler({kind:e,geometry:(s instanceof ve,s)})}}class mt{controller;feature;_state;tooltip;constructor(e,t,s){this.controller=s,this._state=e,this.feature=t,this.tooltip=ni(this.olMap),this.updateTooltipContent(),this.updateTooltipPosition(),this.tooltip.setActive(e==="active")}destroy(){this.tooltip.destroy()}get state(){return this._state}updateState(e){this._state!==e&&(this._state=e,this.tooltip.setActive(e==="active"))}updateTooltipContent(){const e=this.feature.getGeometry();if(!e)return;const t=this.olMap.getView().getProjection();let s;e instanceof ve?s=ii(e,t,this.messages):e instanceof De&&(s=ri(e,t,this.messages)),s&&this.tooltip.setHtml(s)}updateTooltipPosition(){const e=this.feature.getGeometry();if(!e)return;let t;if(e instanceof ve)t=e.getInteriorPoint().getCoordinates()||null;else if(e instanceof De)t=e.getLastCoordinate()||null;else return;this.tooltip.overlay.setPosition(t)}get olMap(){return this.controller.olMap}get messages(){return this.controller.messages}}const pt=[0,-15],ei=[0,-7];function ti(i){const e=document.createElement("div");e.className="measurement-tooltip printing-hide hidden",e.role="tooltip";const t=document.createElement("span");e.appendChild(t);const s=new Fe({element:e,offset:[15,0],positioning:"center-left"});return i.addOverlay(s),{overlay:s,element:e,destroy(){i.removeOverlay(s)},setText(n){t.textContent=n},setHtml(n){t.innerHTML=n}}}function ni(i){const e=document.createElement("div");e.role="tooltip",e.className="measurement-tooltip measurement-active-tooltip printing-hide";const t=document.createElement("span");e.appendChild(t);const s=new Fe({element:e,offset:pt,positioning:"bottom-center",stopEvent:!1,insertFirst:!1});return i.addOverlay(s),{overlay:s,element:e,destroy(){i.removeOverlay(s)},setActive(n){n?(e.className="measurement-tooltip measurement-active-tooltip printing-hide",s.setOffset(pt)):(e.className="measurement-tooltip measurement-finished-tooltip",s.setOffset(ei))},setText(n){t.textContent=n},setHtml(n){t.innerHTML=n}}}function si(i,e){if(e){const t=e.feature.getGeometry();if(t instanceof ve||t instanceof De)return i.getContinueMessage()}return i.getHelpMessage()}function ii(i,e,t){const s=Nn(i,{projection:e});let n;return s>=1e6?n=`${t.formatNumber(s/1e6)} km2`:n=`${t.formatNumber(s)} m2`,n}function ri(i,e,t){const s=kn(i,{projection:e});let n;return s>=1e3?n=`${t.formatNumber(s/1e3)} km`:n=`${t.formatNumber(s)} m`,n}const yr=i=>{const e=Zs(),{containerProps:t}=H("measurement",i),[s,n]=m.useState("distance"),r=u=>e.formatMessage({id:u}),o=B(i),a=oi(o.map,i,e);m.useEffect(()=>{if(a)return a.startMeasurement(s),()=>{a.stopMeasurement()}},[a,s]);function l(u){if(u==="distance"||u==="area")n(u);else throw new Error(`Unexpected measurement type: '${u}'.`)}function c(){a?.clearMeasurements()}return d.jsxs(P,{...t,children:[d.jsx(Q,{mb:3,children:e.formatMessage({id:"measurementInfoText"})}),d.jsx(xe,{mb:4,alignItems:"center",children:d.jsxs(Ge,{mb:2,children:[d.jsx(we,{mb:1,children:r("measurementLabel")}),d.jsxs(ze,{value:s,onChange:u=>l(u.target.value),className:"measurement-select",children:[d.jsx("option",{value:"distance",children:r("distance")}),d.jsx("option",{value:"area",children:r("area")})]})]})}),d.jsx(Ft,{padding:2,className:"measurement-delete-button",onClick:c,width:"100%",children:r("deleteMeasurementLabel")})]})};function oi(i,e,t){const{activeFeatureStyle:s,finishedFeatureStyle:n,onMeasurementsChange:r,predefinedMeasurements:o}=e,[a,l]=m.useState(void 0);return m.useEffect(()=>{if(!i)return;const c=new Qs(i.olMap,{getContinueMessage(){return t.formatMessage({id:"tooltips.continue"})},getHelpMessage(){return t.formatMessage({id:"tooltips.help"})},formatNumber(u){return t.formatNumber(u,{maximumFractionDigits:2})}});return l(c),()=>{c.destroy(),l(void 0)}},[i,t]),m.useEffect(()=>{a?.setActiveFeatureStyle(s??ai())},[a,s]),m.useEffect(()=>{a?.setFinishedFeatureStyle(n??li())},[a,n]),m.useEffect(()=>{a?.setMeasurementSourceChangedHandler(r)},[a,r]),m.useEffect(()=>{a?.setPredefinedMeasurements(o??[])},[a,o]),a}function ai(){return[new Se({stroke:new ie({color:"#fff",lineDash:[10,10],width:5})}),new Se({fill:new Re({color:"rgba(0,0,0,0.15)"}),stroke:new ie({color:"rgba(0, 0, 0, 0.7)",lineDash:[10,10],width:3}),image:new On({radius:5,stroke:new ie({color:"rgba(0, 0, 0, 0.7)",width:2}),fill:new Re({color:"rgba(255, 255, 255, 0.2)"})})})]}function li(){return[new Se({stroke:new ie({color:"#fff",width:5})}),new Se({stroke:new ie({color:"#0b96fc",width:3}),fill:new Re({color:"rgba(11,150,252,0.15)"})})]}const ci="@open-pioneer/search",Le=z.bind(void 0,ci);function ui(i){const e=i.selectProps.inputValue.length>0,t={...i,className:Pe(i.className,{"search-invisible":!e})};return d.jsx(k.Menu,{...t,children:i.children})}function di(i){const e=i.data.label,t={...i.innerProps,"aria-label":e,role:"group"};return d.jsx(k.Group,{...i,innerProps:t})}function hi(i){const t=Le().formatMessage({id:"noOptionsText"});return d.jsx(k.NoOptionsMessage,{...i,children:d.jsx(D.span,{className:"search-no-match",children:t})})}function gi(i){const t=Le().formatMessage({id:"loadingText"});return d.jsx(k.LoadingMessage,{...i,children:d.jsx(D.span,{className:"search-loading-text",children:t})})}function fi({children:i,...e}){const t={...e,className:Pe(e.className,"search-value-container")};return d.jsxs(k.ValueContainer,{...t,children:[!!i&&d.jsx(As,{style:{position:"absolute",left:8}}),i]})}function mi(i){const e={...i,isHidden:!1};return d.jsx(k.Input,{...e})}function pi(i){return null}function yi(i){return d.jsxs(k.IndicatorsContainer,{...i,children:[i.children,!i.selectProps.isLoading&&i.selectProps.inputValue&&d.jsx(_i,{selectProps:i.selectProps,clearValue:i.clearValue})]})}function _i(i){const t=Le().formatMessage({id:"ariaLabel.clearButton"}),s=n=>{n.preventDefault(),n.stopPropagation(),i.clearValue()};return d.jsx(Bn,{role:"button",size:"md",mr:1,"aria-label":t,onClick:s,onTouchEnd:s,onMouseDown:n=>n.preventDefault()})}function vi(i){return null}function Si(i){const e=i.selectProps.inputValue,t=i.data.label,s={...i,className:Pe(i.className,"search-option")};return d.jsx(k.Option,{...s,children:d.jsx(D.div,{className:"search-option-label",children:e.trim().length>0?xi(t,e):t})})}function xi(i,e){const t=i.toLowerCase().indexOf(e.toLowerCase());return t>=0?d.jsxs(d.Fragment,{children:[i.substring(0,t),d.jsx(D.span,{className:"search-highlighted-match",children:i.substring(t,t+e.length)},"highlighted"),i.substring(t+e.length)]}):i}const yt=fe("search:SearchController"),_t=200,vt=5;var ue,Y,J,X,T,Me,zt;class wi{constructor(e,t){x(this,Me);x(this,ue);x(this,Y,[]);x(this,J,vt);x(this,X,_t);x(this,T);w(this,ue,e),w(this,Y,t)}destroy(){v(this,T)?.abort(),w(this,T,void 0)}async search(e){if(v(this,T)?.abort(),w(this,T,void 0),!e)return[];const t=w(this,T,new AbortController);try{return await bi(t.signal,v(this,X)),t.signal.aborted&&(yt.debug(`search canceled with ${e}`),$n()),(await Promise.all(v(this,Y).map(n=>ne(this,Me,zt).call(this,n,e,t.signal)))).filter(n=>n!=null)}finally{v(this,T)===t&&w(this,T,void 0)}}get searchTypingDelay(){return v(this,X)}set searchTypingDelay(e){w(this,X,e??_t)}get maxResultsPerSource(){return v(this,J)}set maxResultsPerSource(e){w(this,J,e??vt)}get sources(){return v(this,Y)}}ue=new WeakMap,Y=new WeakMap,J=new WeakMap,X=new WeakMap,T=new WeakMap,Me=new WeakSet,zt=async function(e,t,s){const n=e.label,r=v(this,ue).olMap.getView().getProjection();try{const o=v(this,J);let a=await e.search(t,{maxResults:o,signal:s,mapProjection:r});return a.length>o&&(a=a.slice(0,o)),{label:n,source:e,results:a}}catch(o){Lt(o)||yt.error(`search for source ${n} failed`,o);return}};async function bi(i,e){i.aborted||await new Promise(t=>{const s=()=>{i.removeEventListener("abort",s),clearTimeout(n),t()};i.addEventListener("abort",s);const n=setTimeout(s,e)})}const be=fe("search:Search"),_r=i=>{const{sources:e,searchTypingDelay:t,maxResultsPerGroup:s,onSelect:n,onClear:r}=i,{containerProps:o}=H("search",i),{map:a}=B(i),l=Le(),c=Pi(e,t,s,a),{input:u,search:h,selectedOption:f,onInputChanged:g,onResultConfirmed:p}=Fi(c),y=Ci(),b=Mi(l),F=Ei(),O=V((E,$)=>{$.action==="input-change"&&g(E)}),S=V((E,$)=>{switch($.action){case"select-option":E&&(p(E),n?.({source:E.source,result:E.result}));break;case"clear":g(""),L.current?.blur(),L.current?.focus(),r?.();break;default:be.debug(`Unhandled action type '${$.action}'.`);break}}),L=m.useRef(null);return d.jsx(P,{...o,children:d.jsx(Nt,{className:"search-component",classNamePrefix:"react-select",ref:L,inputValue:u,onInputChange:O,"aria-label":l.formatMessage({id:"ariaLabel.search"}),ariaLiveMessages:b,colorScheme:"trails",selectedOptionStyle:"color",selectedOptionColorScheme:"trails",chakraStyles:y,isClearable:!0,placeholder:l.formatMessage({id:"searchPlaceholder"}),closeMenuOnSelect:!0,isLoading:h.kind==="loading",options:h.kind==="ready"?h.results:void 0,filterOption:()=>!0,tabSelectsValue:!1,components:F,onChange:S,value:f,menuPosition:"fixed"})})};function Mi(i){return m.useMemo(()=>({onFocus:()=>"",onChange:()=>"",guidance:()=>`${i.formatMessage({id:"ariaLabel.instructions"})}`,onFilter:()=>""}),[i])}function Ei(){return m.useMemo(()=>({Menu:ui,Input:mi,SingleValue:pi,Option:Si,NoOptionsMessage:hi,LoadingMessage:gi,ValueContainer:fi,IndicatorsContainer:yi,ClearIndicator:vi,Group:di}),[])}function Ci(){const[i,e]=It("colors",["trails.100","trails.50"],["#d5e5ec","#eaf2f5"]);return m.useMemo(()=>({groupHeading:s=>({...s,backgroundColor:i,padding:"8px 12px",fontSize:"inherit",fontWeight:"inherit"}),option:s=>({...s,backgroundColor:"inherit",_focus:{backgroundColor:e}}),dropdownIndicator:s=>({...s,display:"none"})}),[i,e])}function Pi(i,e,t,s){const[n,r]=m.useState(void 0);return m.useEffect(()=>{if(!s)return;const o=new wi(s,i);return r(o),()=>{o.destroy(),r(void 0)}},[s,i]),m.useEffect(()=>{n&&(n.searchTypingDelay=e)},[n,e]),m.useEffect(()=>{n&&(n.maxResultsPerSource=t)},[n,t]),n}function Fi(i){const[e,t]=m.useReducer((a,l)=>{switch(l.kind){case"input":return{...a,query:l.query,selectedOption:null};case"select-option":return{...a,selectedOption:l.option,query:l.option.label};case"load-results":return{...a,search:{kind:"loading"}};case"accept-results":return{...a,search:{kind:"ready",results:l.results}}}},void 0,()=>({query:"",selectedOption:null,search:{kind:"ready",results:[]}})),s=m.useRef(),n=V(a=>{if(!i){s.current=void 0,t({kind:"accept-results",results:[]});return}be.isDebug()&&be.debug(`Starting new search for query ${JSON.stringify(a)}.`),t({kind:"load-results"});const l=s.current=Li(i,a).then(c=>{s.current===l&&t({kind:"accept-results",results:c})})}),r=m.useCallback(a=>{t({kind:"select-option",option:a})},[]),o=m.useCallback(a=>{t({kind:"input",query:a}),n(a)},[n]);return{input:e.query,search:e.search,selectedOption:e.selectedOption,onResultConfirmed:r,onInputChanged:o}}async function Li(i,e){let t;try{t=await i.search(e)}catch(s){Lt(s)||be.error("Search failed",s),t=[]}return Ii(t)}function Ii(i){return i.map((t,s)=>({label:t.label,options:t.results.map(n=>({value:`${s}-${n.id}`,label:n.label,source:t.source,result:n}))}))}const Kt="@open-pioneer/selection",Ti=$e.bind(void 0,Kt),Ye=z.bind(void 0,Kt),se="selection-active",ye="selection-inactive";class Ai{tooltip;interactionResources=[];olMap;isActive=!0;tooltipMessage;tooltipDisabledMessage;constructor(e,t,s,n){const r=this.initViewport(e);this.interactionResources.push(this.createDragBox(e,n,r,this.interactionResources)),this.interactionResources.push(this.createDrag(e,r,this.interactionResources)),this.tooltip=this.createHelpTooltip(e,t),this.olMap=e,this.tooltipMessage=t,this.tooltipDisabledMessage=s}initViewport(e){const t=e.getViewport();return t.classList.add(se),t.oncontextmenu=s=>(s.preventDefault(),!1),t}destroy(){this.tooltip.destroy(),this.interactionResources.forEach(e=>{e.destroy()})}setActive(e){if(this.isActive===e)return;const t=this.olMap.getViewport();e?(this.interactionResources.forEach(s=>this.olMap.addInteraction(s.interaction)),this.tooltip.setText(this.tooltipMessage),t.classList.remove(ye),t.classList.add(se),this.isActive=!0):(this.interactionResources.forEach(s=>this.olMap.removeInteraction(s.interaction)),this.tooltip.setText(this.tooltipDisabledMessage),t.classList.remove(se),t.classList.add(ye),this.isActive=!1)}createDragBox(e,t,s,n){const r=new it({className:"selection-drag-box",condition:jn});return e.addInteraction(r),r.on("boxend",function(){t(r.getGeometry())}),{interaction:r,destroy(){e.removeInteraction(r),n.splice(n.indexOf(this)),r.dispose(),s.classList.remove(se),s.classList.remove(ye),s.oncontextmenu=null}}}createDrag(e,t,s){const n=function(a){return a.originalEvent.button==2},r=new rt({condition:n});return e.addInteraction(r),{interaction:r,destroy(){e.removeInteraction(r),s.splice(s.indexOf(this)),r.dispose(),t.classList.remove(se),t.classList.remove(ye),t.oncontextmenu=null}}}createHelpTooltip(e,t){const s=document.createElement("div");s.className="selection-tooltip printing-hide",s.role="tooltip";const n=document.createElement("span");n.textContent=t,s.appendChild(n);const r=new Fe({element:s,offset:[15,0],positioning:"center-left"}),o=e.on("pointermove",a=>{r.setPosition(a.coordinate)});return e.addOverlay(r),{overlay:r,element:s,destroy(){e.removeOverlay(r),r.dispose(),N(o)},setText(a){n.textContent=a}}}getDragboxInteraction(){return this.interactionResources.find(e=>e.interaction instanceof it)}getDragPanInteraction(){return this.interactionResources.find(e=>e.interaction instanceof rt)}}const ke=fe("selection:SelectionController"),Ni=1e4;var de,he,ge,Ee,qt;class ki{constructor(e){x(this,Ee);x(this,de);x(this,he);x(this,ge);const{mapModel:t,onError:s,maxResults:n=Ni}=e;w(this,de,t),w(this,he,n),w(this,ge,s)}destroy(){}async select(e,t){if(t)return await ne(this,Ee,qt).call(this,e,t)}}de=new WeakMap,he=new WeakMap,ge=new WeakMap,Ee=new WeakSet,qt=async function(e,t){const s=v(this,de).olMap.getView().getProjection();try{ke.debug(`Starting selection on source '${e.label}'`);const n=v(this,he);let r=await e.select({type:"extent",extent:t},{maxResults:n,mapProjection:s,signal:new AbortController().signal});return r.length>n&&(r=r.slice(0,n)),ke.debug(`Found ${r.length} results on source '${e.label}'`),{source:e,results:r}}catch(n){ke.error(`selection from source ${e.label} failed`,n),v(this,ge).call(this);return}};const Oi={classNamePrefix:"react-select",menuPosition:"fixed",isSearchable:!1,isClearable:!1},vr=i=>{const e=Ye(),{sources:t,onSelectionComplete:s,onSelectionSourceChanged:n}=i,{containerProps:r}=H("selection",i),o=e.formatMessage({id:"sourceNotAvailable"}),[a,l]=Di(t,n),c=Xt(a,o),u=B(i),{onExtentSelected:h}=Gi(u.map,t,a,s),f=Hi(),[g,p]=m.useState(!1);Vi(u.map,e,h,c.kind==="available",!!a);const y=m.useMemo(()=>t.map(S=>({label:S.label,value:S})),[t]),b=m.useMemo(()=>y.find(L=>L.value===a)||null,[y,a]),F=V(S=>{l(S?.value)}),O=V(S=>{!g&&S.key==="Enter"&&p(!0)});return d.jsx(Qn,{...r,spacing:2,children:d.jsxs(xe,{children:[d.jsx(we,{children:e.formatMessage({id:"selectSource"})}),d.jsx(Nt,{className:"selection-source react-select",...Oi,options:y,placeholder:e.formatMessage({id:"selectionPlaceholder"}),value:b,onChange:F,components:{Option:ji,SingleValue:Ri},isOptionDisabled:()=>!1,getOptionLabel:S=>{const L=S.label,E=Jt(S.value,o);return E.kind=="available"?L:L+" "+E.reason},ariaLiveMessages:{guidance:()=>"",onChange:S=>S.action=="select-option"||S.action=="initial-input-focus"?S.label+" "+e.formatMessage({id:"selected"}):"",onFilter:()=>"",onFocus:()=>""},chakraStyles:f,onKeyDown:O,menuIsOpen:g,onMenuOpen:()=>p(!0),onMenuClose:()=>p(!1)})]})})};function ji(i){const{value:e}=i.data,{isAvailable:t,content:s}=Yt(e,!1);return d.jsx(k.Option,{...i,isDisabled:!t,className:"selection-source-option",children:s})}function Ri(i){const{value:e}=i.data,{isAvailable:t,content:s}=Yt(e,!0),n=t?"selection-source-value":"selection-source-value selection-source-value--disabled";return d.jsx(k.SingleValue,{...i,isDisabled:!t,className:n,children:s})}function Di(i,e){const[t,s]=m.useState(()=>i[0]);m.useEffect(()=>{t&&!i.includes(t)&&s(void 0)},[i,t]);const n=m.useRef(void 0);return m.useEffect(()=>{t!==n.current&&(n.current=t,e?.({source:t}))},[t,e]),[t,s]}function Yt(i,e){const t=Ye(),s=i?.label,n=t.formatMessage({id:"sourceNotAvailable"}),r=Xt(i,n);return{isAvailable:r.kind==="available",content:d.jsxs(ot,{direction:"row",alignItems:"center",grow:1,children:[!e&&d.jsx(ot,{grow:1,children:s}),r.kind==="unavailable"&&d.jsx(P,{ml:2,children:d.jsx(Un,{label:r.reason,placement:"right",openDelay:500,children:d.jsx(D.span,{children:d.jsx(Wn,{as:es,color:"red",className:"warning-icon","aria-label":r.reason})})})}),e&&s]})}}function Gi(i,e,t,s){const n=Ti("notifier.NotificationService"),r=Ye(),[o,a]=m.useState(void 0);m.useEffect(()=>{if(!i)return;const c=new ki({mapModel:i,onError(){n.notify({level:"error",message:r.formatMessage({id:"selectionFailed"})})}});return a(c),()=>{c.destroy()}},[i,n,e,r]);const l=V(async c=>{if(!o||!t)return;const u=await o.select(t,c.getExtent());u&&s?.(u)});return{controller:o,onExtentSelected:l}}function Jt(i,e){const t=i.status??"available",s=typeof t=="string"?{kind:t}:t;return s.kind==="available"?s:{kind:"unavailable",reason:s.reason??e}}function Xt(i,e){return te(()=>i?Jt(i,e):{kind:"unavailable",reason:e},[i,e])}function Vi(i,e,t,s,n){m.useEffect(()=>{if(!i)return;const r=n?e.formatMessage({id:"disabledTooltip"}):e.formatMessage({id:"noSourceTooltip"}),o=new Ai(i.olMap,e.formatMessage({id:"tooltip"}),r,t);return o.setActive(s),()=>{o?.destroy()}},[i,e,t,s,n])}function Hi(){const[i,e]=It("colors",["background_body","border"],["#ffffff","#ffffff"]);return m.useMemo(()=>({control:s=>({...s,cursor:"pointer"}),indicatorSeparator:s=>({...s,borderColor:e}),dropdownIndicator:s=>({...s,backgroundColor:i})}),[i,e])}const Zt="@open-pioneer/printing",Qt=$e.bind(void 0,Zt),Bi=z.bind(void 0,Zt),$i="map";class Ui{olMap;i18n;printingService;viewPadding;printMap=void 0;overlay=void 0;constructor(e,t,s){this.olMap=e,this.printingService=t,this.i18n=s}destroy(){this.reset()}setViewPadding(e){this.viewPadding=e}async handleMapExport(e){if(this.olMap)try{this.begin(),this.printMap=await this.printingService.printMap(this.olMap,{blockUserInteraction:!1,viewPadding:this.viewPadding});const t=this.printMap.getCanvas();if(t)e.fileFormat=="png"?await this.exportMapInPNG(t,e):await this.exportMapInPDF(t,e);else throw new Error("Canvas export failed")}finally{this.reset()}}begin(){const e=this.olMap.getTargetElement();e&&(this.overlay=Jn(e,this.i18n.overlayText))}reset(){this.overlay?.destroy(),this.overlay=void 0}getTitleAndFileName(e){const t=e.title||"",s=e.title||$i;return{title:t,fileName:s}}async exportMapInPNG(e,t){const s=document.createElement("canvas");s.width=e.width,s.height=e.height+50,s.style.backgroundColor="#fff";const n=s.getContext("2d");if(!n)throw new Error("2d canvas rendering context not available");const{title:r,fileName:o}=this.getTitleAndFileName(t);n.fillStyle="#fff",n.fillRect(0,0,s.width,s.height),n.font="20px bold sans-serif",n.textAlign="center",n.fillStyle="#000";const a=s.width/2;n.fillText(r,a,20),n.drawImage(e,0,50);const l=document.createElement("a");l.setAttribute("download",o+".png");const c=Xn(s);if(!c)throw new Error("Failed to get image data URL");l.href=c,l.click()}async exportMapInPDF(e,t){const{jsPDF:s}=await ts(async()=>{const{jsPDF:F}=await import("./Bdg1SXiiiaSc.js");return{jsPDF:F}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url),n=new s({orientation:"landscape",unit:"mm",format:"a4"}),r=n.internal.pageSize.getWidth(),o=n.internal.pageSize.getHeight(),a=15,l=20,c=o-l;n.setFontSize(20);const{title:u,fileName:h}=this.getTitleAndFileName(t);n.text(u,r/2,a,{align:"center"});const f=e.width/e.height;let g=c,p=g*f;p>=r&&(p=r,g=p/f);const y=(r-p)/2,b=l+(c-g)/2;n.addImage(e,"",y,b,p,g),n.save(h+".pdf")}}const Wi=fe("printing"),Sr=i=>{const e=Bi(),{viewPadding:t="auto"}=i,{containerProps:s}=H("printing",i),[n,r]=m.useState("pdf"),[o,a]=m.useState(""),[l,c]=m.useState(!1),u=Qt("notifier.NotificationService"),{map:h}=B(i),f=zi(h,e,t);function g(y){(y==="png"||y==="pdf")&&r(y)}function p(){l||!f||(c(!0),f.handleMapExport({title:o,fileFormat:n}).catch(y=>{const b=e.formatMessage({id:"printingFailed"});u.notify({level:"error",message:b}),Wi.error("Failed to print the map",y)}).finally(()=>{c(!1)}))}return d.jsx(P,{...s,children:d.jsxs(P,{as:"form",m:2,alignItems:"center",onSubmit:y=>{y.preventDefault(),p()},children:[d.jsxs(xe,{as:Ge,mb:2,children:[d.jsx(we,{minWidth:"82",mb:1,children:e.formatMessage({id:"title"})}),d.jsx(We,{placeholder:e.formatMessage({id:"input.placeholder"}),value:o,onChange:y=>{a(y.target.value)},autoFocus:!0})]}),d.jsxs(xe,{as:Ge,mb:2,children:[d.jsx(we,{minWidth:"82",mb:1,children:e.formatMessage({id:"fileFormat"})}),d.jsxs(ze,{value:n,onChange:y=>g(y.target.value),className:"printing-select",children:[d.jsx("option",{value:"png",children:"PNG"}),d.jsx("option",{value:"pdf",children:"PDF"})]})]}),d.jsx(Ft,{isLoading:l,loadingText:e.formatMessage({id:"printingMap"}),disabled:l,mt:2,p:2,className:"printing-export-button",type:"submit",width:"100%",children:e.formatMessage({id:"export"})})]})})};function zi(i,e,t){const s=Qt("printing.PrintingService"),[n,r]=m.useState(void 0);return m.useEffect(()=>{if(!i)return;const o=new Ui(i.olMap,s,{overlayText:e.formatMessage({id:"printingMap"})});return r(o),()=>{o.destroy(),r(void 0)}},[i,e,s]),m.useEffect(()=>{n?.setViewPadding(t)},[n,t]),n}export{gr as C,ur as E,We as I,pr as L,yr as M,hr as N,Fe as O,Sr as P,Gt as S,dr as V,cr as W,fr as a,mr as b,_r as c,vr as d,ze as e,ps as u}; +var en=Object.defineProperty;var Je=i=>{throw TypeError(i)};var tn=(i,e,t)=>e in i?en(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var _=(i,e,t)=>tn(i,typeof e!="symbol"?e+"":e,t),Ie=(i,e,t)=>e.has(i)||Je("Cannot "+t);var v=(i,e,t)=>(Ie(i,e,"read from private field"),t?t.call(i):e.get(i)),x=(i,e,t)=>e.has(i)?Je("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),w=(i,e,t,s)=>(Ie(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),ne=(i,e,t)=>(Ie(i,e,"access private method"),t);import{aJ as nn,bc as sn,bd as rn,be as on,bf as an,aU as ln,b0 as cn,bg as un,bh as dn,a5 as hn,bi as gn,b5 as fn,j as N,bj as mn,bk as pn,bl as yn,bm as St,bn as _n,bo as vn,a as ee,b as Ce,aQ as _e,bp as Xe,bq as K,I as Ze,a3 as j,br as Te,b3 as Z,as as Qe,bs as me,bt as et,bu as A,o as C,bv as U,bw as Oe,bx as Sn,by as xn,E as wn,bz as je,bA as bn,bB as Mn,bC as xt,at as wt,bD as En,bE as Cn,bF as tt,bG as Pn,bH as nt,bI as Fn,bJ as st,r as He,b4 as Be,bK as bt,bL as Ln,b6 as In,f as $e,u as z,b2 as H,i as B,B as P,bM as Tn,b9 as Pe,bN as An,ar as ve,bO as Nn,bP as kn,c as Se,aC as ie,F as Re,C as On,bQ as it,bR as jn,bS as rt,k as ot}from"./CvR1K3f_Jx0o.js";import{u as Rn,m as Dn,r as m,n as Gn,h as Ue,o as Mt,p as Et,q as Ct,j as d,f as D,s as Vn,t as Hn,c as fe,b as Pt,v as at,B as Ft,C as Bn,w as $n,i as Lt,x as It,l as Un,I as Wn}from"./Bh0CuZ3gy5tC.js";import{G as Tt,i as zn}from"./CDZlakCE4enr.js";import{a as Kn}from"./DoZQ59JZnzxi.js";import{D as At,S as qn,I as Yn,c as Jn,a as Xn}from"./CC4cg6c-thsW.js";import{u as V}from"./Cq1ZpfgEg4XJ.js";import{T as Q,L as Zn,V as Qn}from"./Tz2xttM4F6S2.js";import{u as te,F as k,r as Nt}from"./B1-t77dlZFnS.js";import{c as kt}from"./D03oE8cEQPSj.js";import{L as De}from"./CKfDAIEslOW2.js";import{u as Ot,F as xe}from"./BO_q12Vdyug-.js";import{F as we}from"./CreVQ-qFRzOc.js";import{H as Ge}from"./L25RkWOQSN8A.js";import{F as es}from"./CL_VRsbiqLzM.js";import{_ as ts}from"./CmsKOCeNyeyo.js";function ns(i){const{theme:e}=Rn(),t=Dn();return m.useMemo(()=>Gn(e.direction,{...t,...i}),[i,e.direction,t])}var We=Ue(function(e,t){const{htmlSize:s,...n}=e,r=Mt("Input",n),o=Et(n),a=Ot(o),l=Ct("chakra-input",e.className);return d.jsx(D.input,{size:s,...a,__css:r.field,ref:t,className:l})});We.displayName="Input";We.id="Input";var jt=Ue(function(e,t){const{children:s,placeholder:n,className:r,...o}=e;return d.jsxs(D.select,{...o,ref:t,className:Ct("chakra-select",r),children:[n&&d.jsx("option",{value:"",children:n}),s]})});jt.displayName="SelectField";function ss(i,e){const t={},s={};for(const[n,r]of Object.entries(i))e.includes(n)?t[n]=r:s[n]=r;return[t,s]}var ze=Ue((i,e)=>{var t;const s=Mt("Select",i),{rootProps:n,placeholder:r,icon:o,color:a,height:l,h:c,minH:u,minHeight:h,iconColor:f,iconSize:g,...p}=Et(i),[y,b]=ss(p,Hn),F=Ot(b),O={width:"100%",height:"fit-content",position:"relative",color:a},S={paddingEnd:"2rem",...s.field,_focus:{zIndex:"unset",...(t=s.field)==null?void 0:t._focus}};return d.jsxs(D.div,{className:"chakra-select__wrapper",__css:O,...y,...n,children:[d.jsx(jt,{ref:e,height:c??l,minH:u??h,placeholder:r,...F,__css:S,children:i.children}),d.jsx(Rt,{"data-disabled":Vn(F.disabled),...(f||a)&&{color:f||a},__css:s.icon,...g&&{fontSize:g},children:o})]})});ze.displayName="Select";var is=i=>d.jsx("svg",{viewBox:"0 0 24 24",...i,children:d.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),rs=D("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),Rt=i=>{const{children:e=d.jsx(is,{}),...t}=i,s=m.cloneElement(e,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return d.jsx(rs,{...t,className:"chakra-select__icon-wrapper",children:m.isValidElement(e)?s:null})};Rt.displayName="SelectIcon";const M={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"};class Fe extends nn{constructor(e){super(),this.on,this.once,this.un,this.options=e,this.id=e.id,this.insertFirst=e.insertFirst!==void 0?e.insertFirst:!0,this.stopEvent=e.stopEvent!==void 0?e.stopEvent:!0,this.element=document.createElement("div"),this.element.className=e.className!==void 0?e.className:"ol-overlay-container "+sn,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.autoPan=e.autoPan===!0?{}:e.autoPan||void 0,this.rendered={transform_:"",visible:!0},this.mapPostrenderListenerKey=null,this.addChangeListener(M.ELEMENT,this.handleElementChanged),this.addChangeListener(M.MAP,this.handleMapChanged),this.addChangeListener(M.OFFSET,this.handleOffsetChanged),this.addChangeListener(M.POSITION,this.handlePositionChanged),this.addChangeListener(M.POSITIONING,this.handlePositioningChanged),e.element!==void 0&&this.setElement(e.element),this.setOffset(e.offset!==void 0?e.offset:[0,0]),this.setPositioning(e.positioning||"top-left"),e.position!==void 0&&this.setPosition(e.position)}getElement(){return this.get(M.ELEMENT)}getId(){return this.id}getMap(){return this.get(M.MAP)||null}getOffset(){return this.get(M.OFFSET)}getPosition(){return this.get(M.POSITION)}getPositioning(){return this.get(M.POSITIONING)}handleElementChanged(){rn(this.element);const e=this.getElement();e&&this.element.appendChild(e)}handleMapChanged(){this.mapPostrenderListenerKey&&(on(this.element),an(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);const e=this.getMap();if(e){this.mapPostrenderListenerKey=ln(e,cn.POSTRENDER,this.render,this),this.updatePixelPosition();const t=this.stopEvent?e.getOverlayContainerStopEvent():e.getOverlayContainer();this.insertFirst?t.insertBefore(this.element,t.childNodes[0]||null):t.appendChild(this.element),this.performAutoPan()}}render(){this.updatePixelPosition()}handleOffsetChanged(){this.updatePixelPosition()}handlePositionChanged(){this.updatePixelPosition(),this.performAutoPan()}handlePositioningChanged(){this.updatePixelPosition()}setElement(e){this.set(M.ELEMENT,e)}setMap(e){this.set(M.MAP,e)}setOffset(e){this.set(M.OFFSET,e)}setPosition(e){this.set(M.POSITION,e)}performAutoPan(){this.autoPan&&this.panIntoView(this.autoPan)}panIntoView(e){const t=this.getMap();if(!t||!t.getTargetElement()||!this.get(M.POSITION))return;const s=this.getRect(t.getTargetElement(),t.getSize()),n=this.getElement(),r=this.getRect(n,[un(n),dn(n)]);e=e||{};const o=e.margin===void 0?20:e.margin;if(!hn(s,r)){const a=r[0]-s[0],l=s[2]-r[2],c=r[1]-s[1],u=s[3]-r[3],h=[0,0];if(a<0?h[0]=a-o:l<0&&(h[0]=Math.abs(l)+o),c<0?h[1]=c-o:u<0&&(h[1]=Math.abs(u)+o),h[0]!==0||h[1]!==0){const f=t.getView().getCenterInternal(),g=t.getPixelFromCoordinateInternal(f);if(!g)return;const p=[g[0]+h[0],g[1]+h[1]],y=e.animation||{};t.getView().animateInternal({center:t.getCoordinateFromPixelInternal(p),duration:y.duration,easing:y.easing})}}}getRect(e,t){const s=e.getBoundingClientRect(),n=s.left+window.pageXOffset,r=s.top+window.pageYOffset;return[n,r,n+t[0],r+t[1]]}setPositioning(e){this.set(M.POSITIONING,e)}setVisible(e){this.rendered.visible!==e&&(this.element.style.display=e?"":"none",this.rendered.visible=e)}updatePixelPosition(){const e=this.getMap(),t=this.getPosition();if(!e||!e.isRendered()||!t){this.setVisible(!1);return}const s=e.getPixelFromCoordinate(t),n=e.getSize();this.updateRenderedPosition(s,n)}updateRenderedPosition(e,t){const s=this.element.style,n=this.getOffset(),r=this.getPositioning();this.setVisible(!0);const o=Math.round(e[0]+n[0])+"px",a=Math.round(e[1]+n[1])+"px";let l="0%",c="0%";r=="bottom-right"||r=="center-right"||r=="top-right"?l="-100%":(r=="bottom-center"||r=="center-center"||r=="top-center")&&(l="-50%"),r=="bottom-left"||r=="bottom-center"||r=="bottom-right"?c="-100%":(r=="center-left"||r=="center-center"||r=="center-right")&&(c="-50%");const u=`translate(${l}, ${c}) translate(${o}, ${a})`;this.rendered.transform_!=u&&(this.rendered.transform_=u,s.transform=u)}getOptions(){return this.options}}const cr=gn,os=25.4/.28,as=39.37;function Ke(i){return qe(i,ls,cs)}function ls(i){return i.getView()}function cs(i,e){return i.on("change:view",e)}function Dt(i){return Ke(i)?.getProjection()}function us(i){const e=Ke(i);return qe(e,ds,hs)}function ds(i){return i.getResolution()}function hs(i,e){return i.on("change:resolution",e)}function gs(i){const e=Ke(i);return qe(e,fs,ms)}function fs(i){return i.getCenter()}function ms(i,e){return i.on("change:center",e)}function ps(i){const e=gs(i),t=us(i),s=Dt(i);return m.useMemo(()=>{if(s==null||t==null||e==null)return;const r=fn(s,t,e);return Math.round(r*as*os)},[s,t,e])}function qe(i,e,t){const s=m.useCallback(()=>i?e(i):void 0,[i,e]),n=m.useCallback(r=>{if(!i)return()=>{};const o=t(i,r);return()=>N(o)},[i,t]);return m.useSyncExternalStore(n,s)}const lt=0,re=1,ct=[0,0,0,0],q=[],Ae={MODIFYSTART:"modifystart",MODIFYEND:"modifyend"};class Ne extends wt{constructor(e,t,s){super(e),this.features=t,this.mapBrowserEvent=s}}class ys extends mn{constructor(e){super(e),this.on,this.once,this.un,this.boundHandleFeatureChange_=this.handleFeatureChange_.bind(this),this.condition_=e.condition?e.condition:pn,this.defaultDeleteCondition_=function(s){return yn(s)&&St(s)},this.deleteCondition_=e.deleteCondition?e.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:_n,this.vertexFeature_=null,this.vertexSegments_=null,this.lastPixel_=[0,0],this.ignoreNextSingleClick_=!1,this.featuresBeingModified_=null,this.rBush_=new vn,this.pixelTolerance_=e.pixelTolerance!==void 0?e.pixelTolerance:10,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new ee({source:new Ce({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:vs(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.SEGMENT_WRITERS_={Point:this.writePointGeometry_.bind(this),LineString:this.writeLineStringGeometry_.bind(this),LinearRing:this.writeLineStringGeometry_.bind(this),Polygon:this.writePolygonGeometry_.bind(this),MultiPoint:this.writeMultiPointGeometry_.bind(this),MultiLineString:this.writeMultiLineStringGeometry_.bind(this),MultiPolygon:this.writeMultiPolygonGeometry_.bind(this),Circle:this.writeCircleGeometry_.bind(this),GeometryCollection:this.writeGeometryCollectionGeometry_.bind(this)},this.source_=null,this.hitDetection_=null;let t;if(e.features?t=e.features:e.source&&(this.source_=e.source,t=new _e(this.source_.getFeatures()),this.source_.addEventListener(Xe.ADDFEATURE,this.handleSourceAdd_.bind(this)),this.source_.addEventListener(Xe.REMOVEFEATURE,this.handleSourceRemove_.bind(this))),!t)throw new Error("The modify interaction requires features, a source or a layer");e.hitDetection&&(this.hitDetection_=e.hitDetection),this.features_=t,this.features_.forEach(this.addFeature_.bind(this)),this.features_.addEventListener(K.ADD,this.handleFeatureAdd_.bind(this)),this.features_.addEventListener(K.REMOVE,this.handleFeatureRemove_.bind(this)),this.lastPointerEvent_=null,this.delta_=[0,0],this.snapToPointer_=e.snapToPointer===void 0?!this.hitDetection_:e.snapToPointer}addFeature_(e){const t=e.getGeometry();if(t){const n=this.SEGMENT_WRITERS_[t.getType()];n&&n(e,t)}const s=this.getMap();s&&s.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,s),e.addEventListener(Ze.CHANGE,this.boundHandleFeatureChange_)}willModifyFeatures_(e,t){if(!this.featuresBeingModified_){this.featuresBeingModified_=new _e;const s=this.featuresBeingModified_.getArray();for(let n=0,r=t.length;n=0;--n){const r=s[n];for(let o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===r&&this.dragSegments_.splice(o,1);t.remove(r)}}setActive(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),super.setActive(e)}setMap(e){this.overlay_.setMap(e),super.setMap(e)}getOverlay(){return this.overlay_}handleSourceAdd_(e){e.feature&&this.features_.push(e.feature)}handleSourceRemove_(e){e.feature&&this.features_.remove(e.feature)}handleFeatureAdd_(e){this.addFeature_(e.element)}handleFeatureChange_(e){if(!this.changingFeature_){const t=e.target;this.removeFeature_(t),this.addFeature_(t)}}handleFeatureRemove_(e){this.removeFeature_(e.element)}writePointGeometry_(e,t){const s=t.getCoordinates(),n={feature:e,geometry:t,segment:[s,s]};this.rBush_.insert(t.getExtent(),n)}writeMultiPointGeometry_(e,t){const s=t.getCoordinates();for(let n=0,r=s.length;n=0;--c)this.insertVertex_(n[c],r)}return!!this.vertexFeature_}handleUpEvent(e){for(let t=this.dragSegments_.length-1;t>=0;--t){const s=this.dragSegments_[t][0],n=s.geometry;if(n.getType()==="Circle"){const r=n.getCenter(),o=s.featureSegments[0],a=s.featureSegments[1];o.segment[0]=r,o.segment[1]=r,a.segment[0]=r,a.segment[1]=r,this.rBush_.update(Te(r),o);let l=n;this.rBush_.update(l.getExtent(),a)}else this.rBush_.update(j(s.segment),s)}return this.featuresBeingModified_&&(this.dispatchEvent(new Ne(Ae.MODIFYEND,this.featuresBeingModified_,e)),this.featuresBeingModified_=null),!1}handlePointerMove_(e){this.lastPixel_=e.pixel,this.handlePointerAtPixel_(e.pixel,e.map,e.coordinate)}handlePointerAtPixel_(e,t,s){const n=s||t.getCoordinateFromPixel(e);t.getView().getProjection();const r=function(l,c){return ut(n,l)-ut(n,c)};let o,a;if(this.hitDetection_){const l=typeof this.hitDetection_=="object"?c=>c===this.hitDetection_:void 0;t.forEachFeatureAtPixel(e,(c,u,h)=>{h&&h.getType()==="Point"&&(h=new Qe(Oe(h.getCoordinates())));const f=h||c.getGeometry();if(c instanceof Z&&this.features_.getArray().includes(c)){a=f;const g=c.getGeometry().getFlatCoordinates().slice(0,2);o=[{feature:c,geometry:a,segment:[g,g]}]}return!0},{layerFilter:l})}if(!o){const l=Sn(Te(n,ct)),c=t.getView().getResolution()*this.pixelTolerance_,u=xn(wn(l,c,ct));o=this.rBush_.getInExtent(u)}if(o&&o.length>0){const l=o.sort(r)[0],c=l.segment;let u=dt(n,l);const h=t.getPixelFromCoordinate(u);let f=et(e,h);if(a||f<=this.pixelTolerance_){const g={};if(g[C(c)]=!0,this.snapToPointer_||(this.delta_[0]=u[0]-n[0],this.delta_[1]=u[1]-n[1]),l.geometry.getType()==="Circle"&&l.index===re)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(u,[l.feature],[l.geometry]);else{const p=t.getPixelFromCoordinate(c[0]),y=t.getPixelFromCoordinate(c[1]),b=je(h,p),F=je(h,y);f=Math.sqrt(Math.min(b,F)),this.snappedToVertex_=f<=this.pixelTolerance_,this.snappedToVertex_&&(u=b>F?c[1]:c[0]),this.createOrUpdateVertexFeature_(u,[l.feature],[l.geometry]);const O={};O[C(l.geometry)]=!0;for(let S=1,L=o.length;S=0;--l)o=e[l],g=o[0],p=C(g.feature),g.depth&&(p+="-"+g.depth.join("-")),p in t||(t[p]={}),o[1]===0?(t[p].right=g,t[p].index=g.index):o[1]==1&&(t[p].left=g,t[p].index=g.index+1);for(p in t){switch(f=t[p].right,u=t[p].left,c=t[p].index,h=c-1,u!==void 0?g=u:g=f,h<0&&(h=0),a=g.geometry,r=a.getCoordinates(),n=r,s=!1,a.getType()){case"MultiLineString":r[g.depth[0]].length>2&&(r[g.depth[0]].splice(c,1),s=!0);break;case"LineString":r.length>2&&(r.splice(c,1),s=!0);break;case"MultiPolygon":n=n[g.depth[1]];case"Polygon":n=n[g.depth[0]],n.length>4&&(c==n.length-1&&(c=0),n.splice(c,1),s=!0,c===0&&(n.pop(),n.push(n[0]),h=n.length-1));break}if(s){this.setGeometryCoordinates_(a,r);const y=[];if(u!==void 0&&(this.rBush_.remove(u),y.push(u.segment[0])),f!==void 0&&(this.rBush_.remove(f),y.push(f.segment[1])),u!==void 0&&f!==void 0){const b={depth:g.depth,feature:g.feature,geometry:g.geometry,index:h,segment:y};this.rBush_.insert(j(b.segment),b)}this.updateSegmentIndices_(a,c,g.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),e.length=0}}return s}setGeometryCoordinates_(e,t){this.changingFeature_=!0,e.setCoordinates(t),this.changingFeature_=!1}updateSegmentIndices_(e,t,s,n){this.rBush_.forEachInExtent(e.getExtent(),function(r){r.geometry===e&&(s===void 0||r.depth===void 0||bn(r.depth,s))&&r.index>t&&(r.index+=n)})}}function _s(i,e){return i.index-e.index}function ut(i,e,t){const s=e.geometry;if(s.getType()==="Circle"){let r=s;if(e.index===re){const o=je(r.getCenter(),A(i)),a=Math.sqrt(o)-r.getRadius();return a*a}}const n=A(i);return q[0]=A(e.segment[0]),q[1]=A(e.segment[1]),En(n,q)}function dt(i,e,t){const s=e.geometry;if(s.getType()==="Circle"&&e.index===re)return Oe(s.getClosestPoint(A(i)));const n=A(i);return q[0]=A(e.segment[0]),q[1]=A(e.segment[1]),Oe(Mn(n,q))}function vs(){const i=xt();return function(e,t){return i.Point}}const Ss={SELECT:"select"};class xs extends wt{constructor(e,t,s,n){super(e),this.selected=t,this.deselected=s,this.mapBrowserEvent=n}}const pe={};class Gt extends Cn{constructor(e){super(),this.on,this.once,this.un,e=e||{},this.boundAddFeature_=this.addFeature_.bind(this),this.boundRemoveFeature_=this.removeFeature_.bind(this),this.condition_=e.condition?e.condition:St,this.addCondition_=e.addCondition?e.addCondition:tt,this.removeCondition_=e.removeCondition?e.removeCondition:tt,this.toggleCondition_=e.toggleCondition?e.toggleCondition:Pn,this.multi_=e.multi?e.multi:!1,this.filter_=e.filter?e.filter:nt,this.hitTolerance_=e.hitTolerance?e.hitTolerance:0,this.style_=e.style!==void 0?e.style:ws(),this.features_=e.features||new _e;let t;if(e.layers)if(typeof e.layers=="function")t=e.layers;else{const s=e.layers;t=function(n){return s.includes(n)}}else t=nt;this.layerFilter_=t,this.featureLayerAssociation_={}}addFeatureLayerAssociation_(e,t){this.featureLayerAssociation_[C(e)]=t}getFeatures(){return this.features_}getHitTolerance(){return this.hitTolerance_}getLayer(e){return this.featureLayerAssociation_[C(e)]}setHitTolerance(e){this.hitTolerance_=e}setMap(e){this.getMap()&&this.style_&&this.features_.forEach(this.restorePreviousStyle_.bind(this)),super.setMap(e),e?(this.features_.addEventListener(K.ADD,this.boundAddFeature_),this.features_.addEventListener(K.REMOVE,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(K.ADD,this.boundAddFeature_),this.features_.removeEventListener(K.REMOVE,this.boundRemoveFeature_))}addFeature_(e){const t=e.element;if(this.style_&&this.applySelectedStyle_(t),!this.getLayer(t)){const s=this.getMap().getAllLayers().find(function(n){if(n instanceof ee&&n.getSource()&&n.getSource().hasFeature(t))return n});s&&this.addFeatureLayerAssociation_(t,s)}}removeFeature_(e){this.style_&&this.restorePreviousStyle_(e.element)}getStyle(){return this.style_}applySelectedStyle_(e){const t=C(e);t in pe||(pe[t]=e.getStyle()),e.setStyle(this.style_)}restorePreviousStyle_(e){const t=this.getMap().getInteractions().getArray();for(let n=t.length-1;n>=0;--n){const r=t[n];if(r!==this&&r instanceof Gt&&r.getStyle()&&r.getFeatures().getArray().lastIndexOf(e)!==-1){e.setStyle(r.getStyle());return}}const s=C(e);e.setStyle(pe[s]),delete pe[s]}removeFeatureLayerAssociation_(e){delete this.featureLayerAssociation_[C(e)]}handleEvent(e){if(!this.condition_(e))return!0;const t=this.addCondition_(e),s=this.removeCondition_(e),n=this.toggleCondition_(e),r=!t&&!s&&!n,o=e.map,a=this.getFeatures(),l=[],c=[];if(r){Fn(this.featureLayerAssociation_),o.forEachFeatureAtPixel(e.pixel,(u,h)=>{if(!(!(u instanceof Z)||!this.filter_(u,h)))return this.addFeatureLayerAssociation_(u,h),c.push(u),!this.multi_},{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(let u=a.getLength()-1;u>=0;--u){const h=a.item(u),f=c.indexOf(h);f>-1?c.splice(f,1):(a.remove(h),l.push(h))}c.length!==0&&a.extend(c)}else{o.forEachFeatureAtPixel(e.pixel,(u,h)=>{if(!(!(u instanceof Z)||!this.filter_(u,h)))return(t||n)&&!a.getArray().includes(u)?(this.addFeatureLayerAssociation_(u,h),c.push(u)):(s||n)&&a.getArray().includes(u)&&(l.push(u),this.removeFeatureLayerAssociation_(u)),!this.multi_},{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(let u=l.length-1;u>=0;--u)a.remove(l[u]);a.extend(c)}return(c.length>0||l.length>0)&&this.dispatchEvent(new xs(Ss.SELECT,c,l,e)),!0}}function ws(){const i=xt();return st(i.Polygon,i.LineString),st(i.GeometryCollection,i.LineString),function(e){return e.getGeometry()?i[e.getGeometry().getType()]:null}}async function bs(i,e,t,s){const r=s.getCode().replace("EPSG:","http://www.opengis.net/def/crs/EPSG/0/"),o=await i.fetch(e,{method:"POST",body:JSON.stringify({type:"Feature",properties:{},geometry:t}),headers:{"Content-Type":"application/geo+json; charset=utf-8","Content-Crs":`<${r}>`}});if(!o||!o.ok||o.status!==201)throw new Error("Request failed: "+o.status);const a=o.headers.get("location");if(!a)throw new Error("Request failed: no Location response header");const l=a.substring(a.lastIndexOf("/")+1);return Promise.resolve(l)}async function Ms(i,e,t,s,n){const o=n.getCode().replace("EPSG:","http://www.opengis.net/def/crs/EPSG/0/"),a=new URL(`${e.toString()}/${t}`),l=await i.fetch(a,{method:"PATCH",body:JSON.stringify({type:"Feature",properties:{},geometry:s}),headers:{"Content-Type":"application/geo+json; charset=utf-8","Content-Crs":`<${o}>`}});if(!l||!l.ok||l.status!==204)throw new Error("Request failed: "+l.status);return Promise.resolve(t)}function Vt(i,e){const t=document.createElement("div");t.className="editing-tooltip editing-tooltip-hidden",t.role="tooltip";const s=document.createElement("span");s.textContent=e,t.appendChild(s);const n=new Fe({element:t,offset:[15,0],positioning:"center-left"}),r=i.on("pointermove",o=>{o.dragging||n.setPosition(o.coordinate)});return i.addOverlay(n),{destroy(){N(r),i.removeOverlay(n)},setVisible(o){t.classList.toggle("editing-tooltip-hidden",!o)},setText(o){s.textContent=o}}}function Ht(i){let e=ht(i.polygon);Array.isArray(e)&&(e=e[0]);let t=ht(i.vertex);Array.isArray(t)&&(t=t[0]);const s=[];return e&&s.push(e),t&&(t.setGeometry(Es),s.push(t)),s}const Es=i=>{if(i){const e=i.getGeometry();if(e&&e.getType()==="Polygon"){const t=e.getCoordinates()[0];if(t)return new Kn(t)}}},ht=i=>{const e=new Z,s=new ee({style:i}).getStyleFunction();if(!s)throw new Error("can't retrieve style function");const n=s(e,1);if(!n)throw new Error("can't retrieve styles from feature style function");return Array.isArray(n)&&n.length?n.length>1?n:n[0]:n},Cs=fe("editing:EditingCreateWorkflowImpl");var R;class Ps{constructor(e){x(this,R);_(this,"_httpService");_(this,"_intl");_(this,"_map");_(this,"_polygonStyle");_(this,"_vertexStyle");_(this,"_state");_(this,"_editLayerURL");_(this,"_featureId");_(this,"_editingSource");_(this,"_editingLayer");_(this,"_drawInteraction");_(this,"_olMap");_(this,"_tooltip");_(this,"_enterHandler");_(this,"_escapeHandler");_(this,"_error");_(this,"_interactionListener");_(this,"_mapListener");this._httpService=e.httpService,this._intl=e.intl,this._polygonStyle=e.polygonStyle,this._vertexStyle=e.vertexStyle,this._map=e.map,this._olMap=e.map.olMap,this._state=He("active:initialized"),this._editLayerURL=e.ogcApiFeatureLayerUrl,this._editingSource=new Ce,this._editingLayer=new ee({source:this._editingSource,zIndex:Be,properties:{name:"editing-layer"}}),this._drawInteraction=new At({source:this._editingSource,type:"Polygon",style:Ht({polygon:this._polygonStyle,vertex:this._vertexStyle})}),this._tooltip=Vt(this._olMap,this._intl.formatMessage({id:"create.tooltip.begin"})),this._enterHandler=t=>{if((t.code==="Enter"||t.code==="NumpadEnter")&&t.target===this._olMap.getTargetElement()){const s=this._drawInteraction.getOverlay().getSource()?.getFeatures()??[];s[0]&&s[0].getGeometry().getCoordinates()[0].length>4&&this.triggerSave()}},this._escapeHandler=t=>{t.code==="Escape"&&t.target===this._olMap.getTargetElement()&&this.reset()},this._interactionListener=[],this._mapListener=[],this._start()}getDrawInteraction(){return this._drawInteraction}getState(){return this._state.value}_setState(e){this._state.value=e}_save(e){this._setState("active:saving");const t=this._editLayerURL,s=e.getGeometry();if(!s){this._destroy(),this._error=new Error("no geometry available"),v(this,R)?.reject(this._error);return}const n=this._olMap.getView().getProjection(),o=new Tt({dataProjection:n}).writeGeometryObject(s,{rightHanded:!0,decimals:10});this._olMap.removeInteraction(this._drawInteraction),this._tooltip.destroy(),bs(this._httpService,t,o,n).then(a=>{this._featureId=a,this._destroy(),v(this,R)?.resolve({featureId:this._featureId})}).catch(a=>{Cs.error(a),this._destroy(),this._error=new Error("Failed to save feature",{cause:a}),v(this,R)?.reject(this._error)})}_start(){this._olMap.addLayer(this._editingLayer),this._olMap.addInteraction(this._drawInteraction);const e=bt(()=>{const n=this._map.container;if(n)return n.addEventListener("keydown",this._enterHandler,!1),n.addEventListener("keydown",this._escapeHandler,!1),()=>{n.removeEventListener("keydown",this._enterHandler),n.removeEventListener("keydown",this._escapeHandler)}});this._tooltip.setVisible(!0);const t=this._drawInteraction.on("drawstart",()=>{this._setState("active:drawing"),this._tooltip.setText(this._intl.formatMessage({id:"create.tooltip.continue"}))}),s=this._drawInteraction.on("drawend",n=>{const r=n.feature;if(!r){this._destroy(),this._error=new Error("no feature available"),v(this,R)?.reject(this._error);return}this._save(r)});this._interactionListener.push(t,s),this._mapListener.push(e)}reset(){this._drawInteraction.abortDrawing(),this._tooltip.setText(this._intl.formatMessage({id:"create.tooltip.begin"})),this._setState("active:initialized")}stop(){this._destroy(),v(this,R)?.resolve(void 0)}_destroy(){this._olMap.removeLayer(this._editingLayer),this._olMap.removeInteraction(this._drawInteraction),this._tooltip.destroy(),this._interactionListener.forEach(e=>{N(e)}),this._mapListener.forEach(e=>{e.destroy()}),this._setState("destroyed")}triggerSave(){this._drawInteraction.finishDrawing()}whenComplete(){return this._state.value==="destroyed"?this._error?Promise.reject(this._error):this._featureId?Promise.resolve({featureId:this._featureId}):Promise.resolve(void 0):(v(this,R)??w(this,R,Pt())).promise}}R=new WeakMap;var I;class Fs{constructor(e){x(this,I);_(this,"_httpService");_(this,"_intl");_(this,"_map");_(this,"_polygonStyle");_(this,"_vertexStyle");_(this,"_state");_(this,"_editLayerURL");_(this,"_featureId");_(this,"_initialFeature");_(this,"_editFeature");_(this,"_editingSource");_(this,"_editingLayer");_(this,"_modifyInteraction");_(this,"_olMap");_(this,"_tooltip");_(this,"_enterHandler");_(this,"_escapeHandler");_(this,"_error");_(this,"_interactionListener");_(this,"_mapListener");this._httpService=e.httpService,this._intl=e.intl,this._polygonStyle=e.polygonStyle,this._vertexStyle=e.vertexStyle,this._map=e.map,this._olMap=e.map.olMap,this._state=He("active:initialized"),this._editLayerURL=e.ogcApiFeatureLayerUrl,this._initialFeature=e.feature.clone(),this._initialFeature.setId(e.feature.getId()),this._editFeature=e.feature.clone(),this._editFeature.setId(e.feature.getId()),this._editFeature.setStyle(Ht({polygon:this._polygonStyle,vertex:this._vertexStyle})),this._editingSource=new Ce({features:new _e([this._editFeature])}),this._editingLayer=new ee({source:this._editingSource,zIndex:Be,properties:{name:"editing-layer"}}),this._modifyInteraction=new ys({source:this._editingSource}),this._tooltip=Vt(this._olMap,this._intl.formatMessage({id:"create.tooltip.deselect"})),this._enterHandler=t=>{if((t.code==="Enter"||t.code==="NumpadEnter")&&t.target===this._olMap.getTargetElement()){const s=this._editingSource.getFeatures()[0];if(!s)throw Error("no updated feature found");this._save(s)}},this._escapeHandler=t=>{t.code==="Escape"&&t.target===this._olMap.getTargetElement()&&this.reset()},this._interactionListener=[],this._mapListener=[],this._start()}getModifyInteraction(){return this._modifyInteraction}getState(){return this._state.value}_setState(e){this._state.value=e}_save(e){this._setState("active:saving");const t=this._editLayerURL;if(this._featureId=e.getId()?.toString(),!this._featureId){this._destroy(),this._error=new Error("no feature id available"),v(this,I)?.reject(this._error);return}const s=e?.getGeometry();if(!s){this._destroy(),this._error=new Error("no geometry available"),v(this,I)?.reject(this._error);return}const n=this._olMap.getView().getProjection(),o=new Tt({dataProjection:n}).writeGeometryObject(s,{rightHanded:!0,decimals:10});this._olMap.removeInteraction(this._modifyInteraction),this._tooltip.destroy(),Ms(this._httpService,t,this._featureId,o,n).then(a=>{this._destroy(),v(this,I)?.resolve({featureId:a})}).catch(a=>{this._destroy(),this._error=new Error("Failed to save feature",{cause:a}),v(this,I)?.reject(this._error)})}_start(){this._olMap.addLayer(this._editingLayer),this._olMap.addInteraction(this._modifyInteraction);const e=this._editingSource.getFeatures()[0];if(e&&!e.getId()?.toString()){this._destroy(),this._error=new Error("no feature id available"),v(this,I)?.reject(this._error);return}const t=bt(()=>{const r=this._map.container;if(r)return r.addEventListener("keydown",this._enterHandler,!1),r.addEventListener("keydown",this._escapeHandler,!1),()=>{r.removeEventListener("keydown",this._enterHandler),r.removeEventListener("keydown",this._escapeHandler)}});this._tooltip.setVisible(!0);const s=this._map.olMap.on("click",r=>{const o=r.coordinate,a=r.originalEvent.altKey,l=this._editingSource.getFeaturesAtCoordinate(o);a||l.length===0&&this.triggerSave()}),n=this._modifyInteraction.on("modifystart",()=>{this._setState("active:drawing")});this._interactionListener.push(s,n),this._mapListener.push(t)}reset(){const e=this._initialFeature.getGeometry()?.clone(),t=this._editingSource.getFeatures()[0];if(!t)throw Error("no updated feature found");t.setGeometry(e),this._setState("active:initialized")}stop(){this._destroy(),v(this,I)?.resolve(void 0)}_destroy(){this._editingSource.clear(),this._olMap.removeLayer(this._editingLayer),this._olMap.removeInteraction(this._modifyInteraction),this._tooltip.destroy(),this._interactionListener.forEach(e=>{N(e)}),this._mapListener.forEach(e=>{e.destroy()}),this._setState("destroyed")}triggerSave(){const e=this._editingSource.getFeatures()[0];if(!e)throw Error("no updated feature found");this._save(e)}whenComplete(){return this._state.value==="destroyed"?this._error?Promise.reject(this._error):this._featureId?Promise.resolve({featureId:this._featureId}):Promise.resolve(void 0):(v(this,I)??w(this,I,Pt())).promise}}I=new WeakMap;class ur{_serviceOptions;_workflows;constructor(e){this._serviceOptions=e,this._workflows=new Map}createFeature(e,t){if(!t||!e||!e.id)throw new Error("Map, mapId or url is undefined.");const s=e.id;let n=this._workflows.get(s);if(n)throw new Error("EditingWorkflow could not be started. EditingWorkflow already in progress for this map.");return n=new Ps({map:e,ogcApiFeatureLayerUrl:t,polygonStyle:this._serviceOptions.properties.polygonStyle,vertexStyle:this._serviceOptions.properties.vertexStyle,httpService:this._serviceOptions.references.httpService,intl:this._serviceOptions.intl}),this._workflows.set(s,n),this._connectToWorkflowDestroyEvent(n,s),n}updateFeature(e,t,s){if(!t||!e||!e.id)throw new Error("Map, mapId or url is undefined.");const n=e.id;let r=this._workflows.get(n);if(r)throw new Error("EditingWorkflow could not be started. EditingWorkflow already in progress for this map.");return r=new Fs({map:e,ogcApiFeatureLayerUrl:t,feature:s,polygonStyle:this._serviceOptions.properties.polygonStyle,vertexStyle:this._serviceOptions.properties.vertexStyle,httpService:this._serviceOptions.references.httpService,intl:this._serviceOptions.intl}),this._workflows.set(n,r),this._connectToWorkflowDestroyEvent(r,n),r}stop(e){const t=this._workflows.get(e);t&&t.stop()}reset(e){const t=this._workflows.get(e);if(t)t.reset();else throw new Error("No workflow found for mapId: "+e)}_connectToWorkflowDestroyEvent(e,t){const s=Ln(()=>[e.getState()],([n])=>{n==="destroyed"&&(this._workflows.get(t)===e&&this._workflows.delete(t),s.destroy())})}}var W,G,oe,ae,le,Ve;class Ls{constructor(e,t,s){x(this,le);_(this,"label");x(this,W,He({kind:"available"}));x(this,G);x(this,oe);x(this,ae);this.label=t,w(this,G,e),w(this,ae,s),ne(this,le,Ve).call(this),w(this,oe,v(this,G).on("change:visible",()=>{ne(this,le,Ve).call(this)}))}destroy(){N(v(this,oe))}get status(){return v(this,W).value}async select(e,t){if(e.type!=="extent")throw new Error(`Unsupported selection kind: ${e.type}`);if(v(this,W).value.kind!=="available"||v(this,G).getSource()===null)return[];const s=[];v(this,G).getSource().forEachFeatureIntersectingExtent(e.extent,o=>{if(!o.getGeometry())return;const a={...o.getProperties()};delete a.geometries;const l={id:o.getId()?.toString()||In(),geometry:o.getGeometry(),properties:a};s.push(l)});const n=s.filter(o=>o!=null);return n.length>t.maxResults?n.slice(0,t.maxResults):n}}W=new WeakMap,G=new WeakMap,oe=new WeakMap,ae=new WeakMap,le=new WeakSet,Ve=function(){const t=v(this,G).getVisible()?{kind:"available"}:{kind:"unavailable",reason:v(this,ae)};t.kind!==v(this,W).value.kind&&(v(this,W).value=t)};var ce;class dr{constructor({intl:e}){x(this,ce);w(this,ce,e)}createSelectionSource(e){return new Ls(e.vectorLayer,e.label,v(this,ce).formatMessage({id:"layerNotVisibleReason"}))}}ce=new WeakMap;const Is="@open-pioneer/notifier",Ts=$e.bind(void 0,Is),As=kt({d:"M23.384,21.619,16.855,15.09a9.284,9.284,0,1,0-1.768,1.768l6.529,6.529a1.266,1.266,0,0,0,1.768,0A1.251,1.251,0,0,0,23.384,21.619ZM2.75,9.5a6.75,6.75,0,1,1,6.75,6.75A6.758,6.758,0,0,1,2.75,9.5Z",displayName:"SearchIcon"}),Bt=kt({displayName:"WarningTwoIcon",d:"M23.119,20,13.772,2.15h0a2,2,0,0,0-3.543,0L.881,20a2,2,0,0,0,1.772,2.928H21.347A2,2,0,0,0,23.119,20ZM11,8.423a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Zm1.05,11.51h-.028a1.528,1.528,0,0,1-1.522-1.47,1.476,1.476,0,0,1,1.448-1.53h.028A1.527,1.527,0,0,1,13.5,18.4,1.475,1.475,0,0,1,12.05,19.933Z"}),Ns=!1;function hr(i){const{position:e="top-right"}=i,t=ns(),s=Ts("notifier.NotificationService"),[n,r]=m.useState(!Ns),o=V(l=>{const c=l.level==="error"?d.jsx(Bt,{h:"100%",w:"100%"}):void 0;t({position:e,title:l.title,description:l.message||null,status:l.level,isClosable:!0,duration:l.displayDuration??null,icon:c})}),a=V(()=>{t.closeAll()});return m.useEffect(()=>{const l=s.registerHandler({showNotification:o,closeAll:a});return()=>l.destroy()},[n,s,o,a]),d.jsx(d.Fragment,{})}const ks="@open-pioneer/coordinate-viewer",Os=z.bind(void 0,ks),js=4,Rs="decimal",gr=i=>{const{precision:e,displayProjectionCode:t,format:s}=i,{containerProps:n}=H("coordinate-viewer",i),{map:r}=B(i),o=r?.olMap,a=Dt(o)?.getCode()??"";let{coordinates:l}=Gs(o);l=l&&t?Hs(l,a,t):l;const c=Ds(l,e,s),u=t||a,h=c?c+" "+u:"";return d.jsx(P,{...n,children:d.jsx(Q,{className:"coordinate-viewer-text",children:h})})};function Ds(i,e,t){const s=Os();return i?Vs(i,e,s,t):""}function Gs(i){const[e,t]=m.useState();return m.useEffect(()=>{if(!i)return;const s=i.on("pointermove",n=>{t(n.coordinate)});return()=>N(s)},[i]),{coordinates:e}}function Vs(i,e,t,s){if(i[0]==null||i[1]==null)return"";const n=e??js,r=s??Rs,[o,a]=i;let l;if(r==="degree"&&isFinite(o)&&isFinite(a)){const[c,u,h]=gt(o,t,n),[f,g,p]=gt(a,t,n),y=`${Math.abs(c)}°${u}'${h}"${0<=c?"(E)":"(W)"}`,b=`${Math.abs(f)}°${g}'${p}"${0<=f?"(N)":"(S)"}`;l=y+" "+b}else{const c=t.formatNumber(o,{maximumFractionDigits:n,minimumFractionDigits:n}),u=t.formatNumber(a,{maximumFractionDigits:n,minimumFractionDigits:n});l=c+" "+u}return l}function gt(i,e,t){const s=Math.floor(i),n=i-s,r=Math.floor(60*n),a=60*(60*n-r),l=e.formatNumber(a,{maximumFractionDigits:t,minimumFractionDigits:t});return[s,r,l]}function Hs(i,e,t){return Tn(i,e,t)}const fr=i=>{const{displayMode:e="line"}=i,{containerProps:t}=H("scale-bar",i),{map:s}=B(i),n=m.useRef(null);return m.useEffect(()=>{if(n.current&&s){const r=s.olMap,o=new qn({units:"metric",target:n.current,bar:e==="bar"});return r.addControl(o),()=>{r.removeControl(o)}}},[e,s]),d.jsx(P,{...t,ref:n})},Bs="@open-pioneer/scale-viewer",$s=z.bind(void 0,Bs),mr=i=>{const{containerProps:e}=H("scale-viewer",i),{map:t}=B(i),s=$s(),n=ps(t?.olMap),r=n?s.formatNumber(n):void 0;return d.jsx(P,{...e,children:r&&d.jsxs(Q,{children:["1:",r]})})},Us="@open-pioneer/legend",$t=z.bind(void 0,Us),pr=i=>{const{showBaseLayers:e=!1}=i,{containerProps:t}=H("legend",i),{map:s}=B(i);return d.jsx(P,{...t,children:s?d.jsx(Ws,{map:s,showBaseLayers:e}):null})};function Ws(i){const{map:e,showBaseLayers:t}=i,n=Ks(e).map(r=>d.jsx(Ut,{layer:r,showBaseLayers:t},r.id));return d.jsx(Zn,{as:"ul",className:"legend-layer-list",listStyleType:"none",spacing:2,children:n})}function Ut(i){const{layer:e,showBaseLayers:t}=i,s=te(()=>e.visible,[e]),n=qs(e);if(!s||!t&&zn(e)&&Wt(e))return;const r=[];return n?.length&&n.forEach(o=>{r.push(d.jsx(Ut,{layer:o,showBaseLayers:t},o.id))}),d.jsxs(d.Fragment,{children:[d.jsx(zs,{layer:e,showBaseLayers:t}),r]})}function zs(i){const e=$t(),{layer:t,showBaseLayers:s}=i,n=Wt(t),r=Ys(t),o=te(()=>t.legend,[t]);let a;return r?.Component?a=d.jsx(r.Component,{layer:t}):r?.imageUrl?a=d.jsx(ft,{layer:t,imageUrl:r.imageUrl}):o&&(a=d.jsx(ft,{layer:t,imageUrl:o})),a?d.jsxs(P,{as:"li",className:Pe("legend-item",`layer-${Js(t.id)}`),children:[s&&n?d.jsx(Q,{as:"b",children:e.formatMessage({id:"basemapLabel"})}):null,a]}):void 0}function ft(i){const e=$t(),{layer:t,imageUrl:s}=i;return d.jsxs(P,{children:[d.jsx(Q,{children:t.title}),d.jsx(Yn,{maxW:"none",maxH:"none",src:s,alt:e.formatMessage({id:"altLabel"},{layerName:t.title}),className:"legend-item__image",fallbackStrategy:"onError",fallback:d.jsx(P,{children:d.jsxs(Q,{children:[d.jsx(Bt,{me:2}),e.formatMessage({id:"fallbackLabel"})]})})})]})}function Ks(i){return te(()=>{const e=i.layers.getAllLayers({sortByDisplayOrder:!0})??[];return e.reverse(),e},[i])}function qs(i){return te(()=>{const e=i.sublayers?.getSublayers({sortByDisplayOrder:!0});if(e)return e.reverse(),e},[i])}function Ys(i){return te(()=>i.attributes.legend,[i])}function Wt(i){return!("parentLayer"in i)&&i.isBaseLayer}function Js(i){return i.toLowerCase().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")}const Xs="@open-pioneer/measurement",Zs=z.bind(void 0,Xs);class Qs{olMap;messages;activeFeatureStyle;layer;source;draw=void 0;activeMeasurement;predefinedMeasurements=new Map;finishedMeasurements=new Set;helpTooltip;resources=[];measurementChangedHandler;constructor(e,t){this.olMap=e,this.messages=t;const s=this.source=new Ce;this.layer=new ee({source:s,zIndex:Be,properties:{name:"measurement-layer"}}),e.addLayer(this.layer);const n=e.on("pointermove",this.handlePointerMove.bind(this));this.resources.push({destroy(){N(n)}});const r=()=>{this.helpTooltip.element.classList.add("hidden")};e.getViewport().addEventListener("mouseout",r),this.resources.push({destroy(){e.getViewport().removeEventListener("mouseout",r)}}),this.helpTooltip=ti(this.olMap)}destroy(){this.stopMeasurement();for(const e of this.resources)e.destroy();this.resources=[],this.activeMeasurement=at(this.activeMeasurement);for(const e of this.finishedMeasurements)e.destroy();this.finishedMeasurements.clear(),this.helpTooltip.destroy(),this.olMap.removeLayer(this.layer),this.layer.dispose(),this.source.dispose(),this.measurementChangedHandler=void 0,this.predefinedMeasurements.clear()}getVectorLayer(){return this.layer}setFinishedFeatureStyle(e){this.layer.setStyle(e)}setMeasurementSourceChangedHandler(e){this.measurementChangedHandler=e}setPredefinedMeasurements(e){this.updatePredefinedMeasurements(e)}setActiveFeatureStyle(e){const t=An(e);this.activeFeatureStyle=(s,...n)=>{const r=s?.getGeometry()?.getType();if(r==="Polygon"||r==="LineString"||r==="Point")return t(s,...n)},this.draw?.getOverlay().setStyle(this.activeFeatureStyle)}clearMeasurements(){const e=this.source.getFeatures();this.source.clear(),e.forEach(t=>{this.raiseMeasurementsChangeEvent("remove-measurement",t)}),this.predefinedMeasurements.clear();for(const t of this.finishedMeasurements)t.destroy();this.finishedMeasurements.clear()}startMeasurement(e){if(this.draw)throw new Error("Internal error: another measurement interaction is still active.");const t=e==="area"?"Polygon":"LineString",s=this.draw=new At({source:this.source,type:t,style:this.activeFeatureStyle});this.olMap.addInteraction(s);let n,r;s.on("drawstart",o=>{const a=o.feature;a&&(n=this.activeMeasurement=new mt("active",a,this),r=a.getGeometry()?.on("change",()=>{n?.updateTooltipContent(),n?.updateTooltipPosition()}))}),s.on("drawend",()=>{if(n&&n===this.activeMeasurement){const o=n;o.updateState("finished"),this.finishedMeasurements.add(o),this.raiseMeasurementsChangeEvent("add-measurement",o.feature),this.activeMeasurement=n=void 0}n=void 0,r&&N(r)}),s.on("drawabort",()=>{n&&(n.destroy(),n===this.activeMeasurement&&(this.activeMeasurement=void 0),n=void 0),r&&N(r)})}stopMeasurement(){this.draw&&(this.olMap.removeInteraction(this.draw),this.draw.abortDrawing(),this.draw.dispose(),this.draw=void 0),this.activeMeasurement=at(this.activeMeasurement)}handlePointerMove(e){if(e.dragging)return;const t=this.helpTooltip,s=si(this.messages,this.activeMeasurement);t.setText(s),t.overlay.setPosition(e.coordinate),t.element.classList.remove("hidden")}updatePredefinedMeasurements(e){const t=e.filter(n=>!this.predefinedMeasurements.has(n)),s=[];for(const n of this.predefinedMeasurements.keys())e.includes(n)||s.push(n);t.forEach(n=>{const r=new Z(n);this.source.addFeature(r);const o=new mt("finished",r,this);this.finishedMeasurements.add(o),this.predefinedMeasurements.set(n,o),this.raiseMeasurementsChangeEvent("add-measurement",r)}),s.forEach(n=>{const r=this.predefinedMeasurements.get(n);r&&(this.source.removeFeature(r.feature),this.finishedMeasurements.delete(r),r.destroy(),this.raiseMeasurementsChangeEvent("remove-measurement",r.feature)),this.predefinedMeasurements.delete(n)})}raiseMeasurementsChangeEvent(e,t){const s=t.getGeometry();this.measurementChangedHandler&&s&&this.measurementChangedHandler({kind:e,geometry:(s instanceof ve,s)})}}class mt{controller;feature;_state;tooltip;constructor(e,t,s){this.controller=s,this._state=e,this.feature=t,this.tooltip=ni(this.olMap),this.updateTooltipContent(),this.updateTooltipPosition(),this.tooltip.setActive(e==="active")}destroy(){this.tooltip.destroy()}get state(){return this._state}updateState(e){this._state!==e&&(this._state=e,this.tooltip.setActive(e==="active"))}updateTooltipContent(){const e=this.feature.getGeometry();if(!e)return;const t=this.olMap.getView().getProjection();let s;e instanceof ve?s=ii(e,t,this.messages):e instanceof De&&(s=ri(e,t,this.messages)),s&&this.tooltip.setHtml(s)}updateTooltipPosition(){const e=this.feature.getGeometry();if(!e)return;let t;if(e instanceof ve)t=e.getInteriorPoint().getCoordinates()||null;else if(e instanceof De)t=e.getLastCoordinate()||null;else return;this.tooltip.overlay.setPosition(t)}get olMap(){return this.controller.olMap}get messages(){return this.controller.messages}}const pt=[0,-15],ei=[0,-7];function ti(i){const e=document.createElement("div");e.className="measurement-tooltip printing-hide hidden",e.role="tooltip";const t=document.createElement("span");e.appendChild(t);const s=new Fe({element:e,offset:[15,0],positioning:"center-left"});return i.addOverlay(s),{overlay:s,element:e,destroy(){i.removeOverlay(s)},setText(n){t.textContent=n},setHtml(n){t.innerHTML=n}}}function ni(i){const e=document.createElement("div");e.role="tooltip",e.className="measurement-tooltip measurement-active-tooltip printing-hide";const t=document.createElement("span");e.appendChild(t);const s=new Fe({element:e,offset:pt,positioning:"bottom-center",stopEvent:!1,insertFirst:!1});return i.addOverlay(s),{overlay:s,element:e,destroy(){i.removeOverlay(s)},setActive(n){n?(e.className="measurement-tooltip measurement-active-tooltip printing-hide",s.setOffset(pt)):(e.className="measurement-tooltip measurement-finished-tooltip",s.setOffset(ei))},setText(n){t.textContent=n},setHtml(n){t.innerHTML=n}}}function si(i,e){if(e){const t=e.feature.getGeometry();if(t instanceof ve||t instanceof De)return i.getContinueMessage()}return i.getHelpMessage()}function ii(i,e,t){const s=Nn(i,{projection:e});let n;return s>=1e6?n=`${t.formatNumber(s/1e6)} km2`:n=`${t.formatNumber(s)} m2`,n}function ri(i,e,t){const s=kn(i,{projection:e});let n;return s>=1e3?n=`${t.formatNumber(s/1e3)} km`:n=`${t.formatNumber(s)} m`,n}const yr=i=>{const e=Zs(),{containerProps:t}=H("measurement",i),[s,n]=m.useState("distance"),r=u=>e.formatMessage({id:u}),o=B(i),a=oi(o.map,i,e);m.useEffect(()=>{if(a)return a.startMeasurement(s),()=>{a.stopMeasurement()}},[a,s]);function l(u){if(u==="distance"||u==="area")n(u);else throw new Error(`Unexpected measurement type: '${u}'.`)}function c(){a?.clearMeasurements()}return d.jsxs(P,{...t,children:[d.jsx(Q,{mb:3,children:e.formatMessage({id:"measurementInfoText"})}),d.jsx(xe,{mb:4,alignItems:"center",children:d.jsxs(Ge,{mb:2,children:[d.jsx(we,{mb:1,children:r("measurementLabel")}),d.jsxs(ze,{value:s,onChange:u=>l(u.target.value),className:"measurement-select",children:[d.jsx("option",{value:"distance",children:r("distance")}),d.jsx("option",{value:"area",children:r("area")})]})]})}),d.jsx(Ft,{padding:2,className:"measurement-delete-button",onClick:c,width:"100%",children:r("deleteMeasurementLabel")})]})};function oi(i,e,t){const{activeFeatureStyle:s,finishedFeatureStyle:n,onMeasurementsChange:r,predefinedMeasurements:o}=e,[a,l]=m.useState(void 0);return m.useEffect(()=>{if(!i)return;const c=new Qs(i.olMap,{getContinueMessage(){return t.formatMessage({id:"tooltips.continue"})},getHelpMessage(){return t.formatMessage({id:"tooltips.help"})},formatNumber(u){return t.formatNumber(u,{maximumFractionDigits:2})}});return l(c),()=>{c.destroy(),l(void 0)}},[i,t]),m.useEffect(()=>{a?.setActiveFeatureStyle(s??ai())},[a,s]),m.useEffect(()=>{a?.setFinishedFeatureStyle(n??li())},[a,n]),m.useEffect(()=>{a?.setMeasurementSourceChangedHandler(r)},[a,r]),m.useEffect(()=>{a?.setPredefinedMeasurements(o??[])},[a,o]),a}function ai(){return[new Se({stroke:new ie({color:"#fff",lineDash:[10,10],width:5})}),new Se({fill:new Re({color:"rgba(0,0,0,0.15)"}),stroke:new ie({color:"rgba(0, 0, 0, 0.7)",lineDash:[10,10],width:3}),image:new On({radius:5,stroke:new ie({color:"rgba(0, 0, 0, 0.7)",width:2}),fill:new Re({color:"rgba(255, 255, 255, 0.2)"})})})]}function li(){return[new Se({stroke:new ie({color:"#fff",width:5})}),new Se({stroke:new ie({color:"#0b96fc",width:3}),fill:new Re({color:"rgba(11,150,252,0.15)"})})]}const ci="@open-pioneer/search",Le=z.bind(void 0,ci);function ui(i){const e=i.selectProps.inputValue.length>0,t={...i,className:Pe(i.className,{"search-invisible":!e})};return d.jsx(k.Menu,{...t,children:i.children})}function di(i){const e=i.data.label,t={...i.innerProps,"aria-label":e,role:"group"};return d.jsx(k.Group,{...i,innerProps:t})}function hi(i){const t=Le().formatMessage({id:"noOptionsText"});return d.jsx(k.NoOptionsMessage,{...i,children:d.jsx(D.span,{className:"search-no-match",children:t})})}function gi(i){const t=Le().formatMessage({id:"loadingText"});return d.jsx(k.LoadingMessage,{...i,children:d.jsx(D.span,{className:"search-loading-text",children:t})})}function fi({children:i,...e}){const t={...e,className:Pe(e.className,"search-value-container")};return d.jsxs(k.ValueContainer,{...t,children:[!!i&&d.jsx(As,{style:{position:"absolute",left:8}}),i]})}function mi(i){const e={...i,isHidden:!1};return d.jsx(k.Input,{...e})}function pi(i){return null}function yi(i){return d.jsxs(k.IndicatorsContainer,{...i,children:[i.children,!i.selectProps.isLoading&&i.selectProps.inputValue&&d.jsx(_i,{selectProps:i.selectProps,clearValue:i.clearValue})]})}function _i(i){const t=Le().formatMessage({id:"ariaLabel.clearButton"}),s=n=>{n.preventDefault(),n.stopPropagation(),i.clearValue()};return d.jsx(Bn,{role:"button",size:"md",mr:1,"aria-label":t,onClick:s,onTouchEnd:s,onMouseDown:n=>n.preventDefault()})}function vi(i){return null}function Si(i){const e=i.selectProps.inputValue,t=i.data.label,s={...i,className:Pe(i.className,"search-option")};return d.jsx(k.Option,{...s,children:d.jsx(D.div,{className:"search-option-label",children:e.trim().length>0?xi(t,e):t})})}function xi(i,e){const t=i.toLowerCase().indexOf(e.toLowerCase());return t>=0?d.jsxs(d.Fragment,{children:[i.substring(0,t),d.jsx(D.span,{className:"search-highlighted-match",children:i.substring(t,t+e.length)},"highlighted"),i.substring(t+e.length)]}):i}const yt=fe("search:SearchController"),_t=200,vt=5;var ue,Y,J,X,T,Me,zt;class wi{constructor(e,t){x(this,Me);x(this,ue);x(this,Y,[]);x(this,J,vt);x(this,X,_t);x(this,T);w(this,ue,e),w(this,Y,t)}destroy(){v(this,T)?.abort(),w(this,T,void 0)}async search(e){if(v(this,T)?.abort(),w(this,T,void 0),!e)return[];const t=w(this,T,new AbortController);try{return await bi(t.signal,v(this,X)),t.signal.aborted&&(yt.debug(`search canceled with ${e}`),$n()),(await Promise.all(v(this,Y).map(n=>ne(this,Me,zt).call(this,n,e,t.signal)))).filter(n=>n!=null)}finally{v(this,T)===t&&w(this,T,void 0)}}get searchTypingDelay(){return v(this,X)}set searchTypingDelay(e){w(this,X,e??_t)}get maxResultsPerSource(){return v(this,J)}set maxResultsPerSource(e){w(this,J,e??vt)}get sources(){return v(this,Y)}}ue=new WeakMap,Y=new WeakMap,J=new WeakMap,X=new WeakMap,T=new WeakMap,Me=new WeakSet,zt=async function(e,t,s){const n=e.label,r=v(this,ue).olMap.getView().getProjection();try{const o=v(this,J);let a=await e.search(t,{maxResults:o,signal:s,mapProjection:r});return a.length>o&&(a=a.slice(0,o)),{label:n,source:e,results:a}}catch(o){Lt(o)||yt.error(`search for source ${n} failed`,o);return}};async function bi(i,e){i.aborted||await new Promise(t=>{const s=()=>{i.removeEventListener("abort",s),clearTimeout(n),t()};i.addEventListener("abort",s);const n=setTimeout(s,e)})}const be=fe("search:Search"),_r=i=>{const{sources:e,searchTypingDelay:t,maxResultsPerGroup:s,onSelect:n,onClear:r}=i,{containerProps:o}=H("search",i),{map:a}=B(i),l=Le(),c=Pi(e,t,s,a),{input:u,search:h,selectedOption:f,onInputChanged:g,onResultConfirmed:p}=Fi(c),y=Ci(),b=Mi(l),F=Ei(),O=V((E,$)=>{$.action==="input-change"&&g(E)}),S=V((E,$)=>{switch($.action){case"select-option":E&&(p(E),n?.({source:E.source,result:E.result}));break;case"clear":g(""),L.current?.blur(),L.current?.focus(),r?.();break;default:be.debug(`Unhandled action type '${$.action}'.`);break}}),L=m.useRef(null);return d.jsx(P,{...o,children:d.jsx(Nt,{className:"search-component",classNamePrefix:"react-select",ref:L,inputValue:u,onInputChange:O,"aria-label":l.formatMessage({id:"ariaLabel.search"}),ariaLiveMessages:b,colorScheme:"trails",selectedOptionStyle:"color",selectedOptionColorScheme:"trails",chakraStyles:y,isClearable:!0,placeholder:l.formatMessage({id:"searchPlaceholder"}),closeMenuOnSelect:!0,isLoading:h.kind==="loading",options:h.kind==="ready"?h.results:void 0,filterOption:()=>!0,tabSelectsValue:!1,components:F,onChange:S,value:f,menuPosition:"fixed"})})};function Mi(i){return m.useMemo(()=>({onFocus:()=>"",onChange:()=>"",guidance:()=>`${i.formatMessage({id:"ariaLabel.instructions"})}`,onFilter:()=>""}),[i])}function Ei(){return m.useMemo(()=>({Menu:ui,Input:mi,SingleValue:pi,Option:Si,NoOptionsMessage:hi,LoadingMessage:gi,ValueContainer:fi,IndicatorsContainer:yi,ClearIndicator:vi,Group:di}),[])}function Ci(){const[i,e]=It("colors",["trails.100","trails.50"],["#d5e5ec","#eaf2f5"]);return m.useMemo(()=>({groupHeading:s=>({...s,backgroundColor:i,padding:"8px 12px",fontSize:"inherit",fontWeight:"inherit"}),option:s=>({...s,backgroundColor:"inherit",_focus:{backgroundColor:e}}),dropdownIndicator:s=>({...s,display:"none"})}),[i,e])}function Pi(i,e,t,s){const[n,r]=m.useState(void 0);return m.useEffect(()=>{if(!s)return;const o=new wi(s,i);return r(o),()=>{o.destroy(),r(void 0)}},[s,i]),m.useEffect(()=>{n&&(n.searchTypingDelay=e)},[n,e]),m.useEffect(()=>{n&&(n.maxResultsPerSource=t)},[n,t]),n}function Fi(i){const[e,t]=m.useReducer((a,l)=>{switch(l.kind){case"input":return{...a,query:l.query,selectedOption:null};case"select-option":return{...a,selectedOption:l.option,query:l.option.label};case"load-results":return{...a,search:{kind:"loading"}};case"accept-results":return{...a,search:{kind:"ready",results:l.results}}}},void 0,()=>({query:"",selectedOption:null,search:{kind:"ready",results:[]}})),s=m.useRef(),n=V(a=>{if(!i){s.current=void 0,t({kind:"accept-results",results:[]});return}be.isDebug()&&be.debug(`Starting new search for query ${JSON.stringify(a)}.`),t({kind:"load-results"});const l=s.current=Li(i,a).then(c=>{s.current===l&&t({kind:"accept-results",results:c})})}),r=m.useCallback(a=>{t({kind:"select-option",option:a})},[]),o=m.useCallback(a=>{t({kind:"input",query:a}),n(a)},[n]);return{input:e.query,search:e.search,selectedOption:e.selectedOption,onResultConfirmed:r,onInputChanged:o}}async function Li(i,e){let t;try{t=await i.search(e)}catch(s){Lt(s)||be.error("Search failed",s),t=[]}return Ii(t)}function Ii(i){return i.map((t,s)=>({label:t.label,options:t.results.map(n=>({value:`${s}-${n.id}`,label:n.label,source:t.source,result:n}))}))}const Kt="@open-pioneer/selection",Ti=$e.bind(void 0,Kt),Ye=z.bind(void 0,Kt),se="selection-active",ye="selection-inactive";class Ai{tooltip;interactionResources=[];olMap;isActive=!0;tooltipMessage;tooltipDisabledMessage;constructor(e,t,s,n){const r=this.initViewport(e);this.interactionResources.push(this.createDragBox(e,n,r,this.interactionResources)),this.interactionResources.push(this.createDrag(e,r,this.interactionResources)),this.tooltip=this.createHelpTooltip(e,t),this.olMap=e,this.tooltipMessage=t,this.tooltipDisabledMessage=s}initViewport(e){const t=e.getViewport();return t.classList.add(se),t.oncontextmenu=s=>(s.preventDefault(),!1),t}destroy(){this.tooltip.destroy(),this.interactionResources.forEach(e=>{e.destroy()})}setActive(e){if(this.isActive===e)return;const t=this.olMap.getViewport();e?(this.interactionResources.forEach(s=>this.olMap.addInteraction(s.interaction)),this.tooltip.setText(this.tooltipMessage),t.classList.remove(ye),t.classList.add(se),this.isActive=!0):(this.interactionResources.forEach(s=>this.olMap.removeInteraction(s.interaction)),this.tooltip.setText(this.tooltipDisabledMessage),t.classList.remove(se),t.classList.add(ye),this.isActive=!1)}createDragBox(e,t,s,n){const r=new it({className:"selection-drag-box",condition:jn});return e.addInteraction(r),r.on("boxend",function(){t(r.getGeometry())}),{interaction:r,destroy(){e.removeInteraction(r),n.splice(n.indexOf(this)),r.dispose(),s.classList.remove(se),s.classList.remove(ye),s.oncontextmenu=null}}}createDrag(e,t,s){const n=function(a){return a.originalEvent.button==2},r=new rt({condition:n});return e.addInteraction(r),{interaction:r,destroy(){e.removeInteraction(r),s.splice(s.indexOf(this)),r.dispose(),t.classList.remove(se),t.classList.remove(ye),t.oncontextmenu=null}}}createHelpTooltip(e,t){const s=document.createElement("div");s.className="selection-tooltip printing-hide",s.role="tooltip";const n=document.createElement("span");n.textContent=t,s.appendChild(n);const r=new Fe({element:s,offset:[15,0],positioning:"center-left"}),o=e.on("pointermove",a=>{r.setPosition(a.coordinate)});return e.addOverlay(r),{overlay:r,element:s,destroy(){e.removeOverlay(r),r.dispose(),N(o)},setText(a){n.textContent=a}}}getDragboxInteraction(){return this.interactionResources.find(e=>e.interaction instanceof it)}getDragPanInteraction(){return this.interactionResources.find(e=>e.interaction instanceof rt)}}const ke=fe("selection:SelectionController"),Ni=1e4;var de,he,ge,Ee,qt;class ki{constructor(e){x(this,Ee);x(this,de);x(this,he);x(this,ge);const{mapModel:t,onError:s,maxResults:n=Ni}=e;w(this,de,t),w(this,he,n),w(this,ge,s)}destroy(){}async select(e,t){if(t)return await ne(this,Ee,qt).call(this,e,t)}}de=new WeakMap,he=new WeakMap,ge=new WeakMap,Ee=new WeakSet,qt=async function(e,t){const s=v(this,de).olMap.getView().getProjection();try{ke.debug(`Starting selection on source '${e.label}'`);const n=v(this,he);let r=await e.select({type:"extent",extent:t},{maxResults:n,mapProjection:s,signal:new AbortController().signal});return r.length>n&&(r=r.slice(0,n)),ke.debug(`Found ${r.length} results on source '${e.label}'`),{source:e,results:r}}catch(n){ke.error(`selection from source ${e.label} failed`,n),v(this,ge).call(this);return}};const Oi={classNamePrefix:"react-select",menuPosition:"fixed",isSearchable:!1,isClearable:!1},vr=i=>{const e=Ye(),{sources:t,onSelectionComplete:s,onSelectionSourceChanged:n}=i,{containerProps:r}=H("selection",i),o=e.formatMessage({id:"sourceNotAvailable"}),[a,l]=Di(t,n),c=Xt(a,o),u=B(i),{onExtentSelected:h}=Gi(u.map,t,a,s),f=Hi(),[g,p]=m.useState(!1);Vi(u.map,e,h,c.kind==="available",!!a);const y=m.useMemo(()=>t.map(S=>({label:S.label,value:S})),[t]),b=m.useMemo(()=>y.find(L=>L.value===a)||null,[y,a]),F=V(S=>{l(S?.value)}),O=V(S=>{!g&&S.key==="Enter"&&p(!0)});return d.jsx(Qn,{...r,spacing:2,children:d.jsxs(xe,{children:[d.jsx(we,{children:e.formatMessage({id:"selectSource"})}),d.jsx(Nt,{className:"selection-source react-select",...Oi,options:y,placeholder:e.formatMessage({id:"selectionPlaceholder"}),value:b,onChange:F,components:{Option:ji,SingleValue:Ri},isOptionDisabled:()=>!1,getOptionLabel:S=>{const L=S.label,E=Jt(S.value,o);return E.kind=="available"?L:L+" "+E.reason},ariaLiveMessages:{guidance:()=>"",onChange:S=>S.action=="select-option"||S.action=="initial-input-focus"?S.label+" "+e.formatMessage({id:"selected"}):"",onFilter:()=>"",onFocus:()=>""},chakraStyles:f,onKeyDown:O,menuIsOpen:g,onMenuOpen:()=>p(!0),onMenuClose:()=>p(!1)})]})})};function ji(i){const{value:e}=i.data,{isAvailable:t,content:s}=Yt(e,!1);return d.jsx(k.Option,{...i,isDisabled:!t,className:"selection-source-option",children:s})}function Ri(i){const{value:e}=i.data,{isAvailable:t,content:s}=Yt(e,!0),n=t?"selection-source-value":"selection-source-value selection-source-value--disabled";return d.jsx(k.SingleValue,{...i,isDisabled:!t,className:n,children:s})}function Di(i,e){const[t,s]=m.useState(()=>i[0]);m.useEffect(()=>{t&&!i.includes(t)&&s(void 0)},[i,t]);const n=m.useRef(void 0);return m.useEffect(()=>{t!==n.current&&(n.current=t,e?.({source:t}))},[t,e]),[t,s]}function Yt(i,e){const t=Ye(),s=i?.label,n=t.formatMessage({id:"sourceNotAvailable"}),r=Xt(i,n);return{isAvailable:r.kind==="available",content:d.jsxs(ot,{direction:"row",alignItems:"center",grow:1,children:[!e&&d.jsx(ot,{grow:1,children:s}),r.kind==="unavailable"&&d.jsx(P,{ml:2,children:d.jsx(Un,{label:r.reason,placement:"right",openDelay:500,children:d.jsx(D.span,{children:d.jsx(Wn,{as:es,color:"red",className:"warning-icon","aria-label":r.reason})})})}),e&&s]})}}function Gi(i,e,t,s){const n=Ti("notifier.NotificationService"),r=Ye(),[o,a]=m.useState(void 0);m.useEffect(()=>{if(!i)return;const c=new ki({mapModel:i,onError(){n.notify({level:"error",message:r.formatMessage({id:"selectionFailed"})})}});return a(c),()=>{c.destroy()}},[i,n,e,r]);const l=V(async c=>{if(!o||!t)return;const u=await o.select(t,c.getExtent());u&&s?.(u)});return{controller:o,onExtentSelected:l}}function Jt(i,e){const t=i.status??"available",s=typeof t=="string"?{kind:t}:t;return s.kind==="available"?s:{kind:"unavailable",reason:s.reason??e}}function Xt(i,e){return te(()=>i?Jt(i,e):{kind:"unavailable",reason:e},[i,e])}function Vi(i,e,t,s,n){m.useEffect(()=>{if(!i)return;const r=n?e.formatMessage({id:"disabledTooltip"}):e.formatMessage({id:"noSourceTooltip"}),o=new Ai(i.olMap,e.formatMessage({id:"tooltip"}),r,t);return o.setActive(s),()=>{o?.destroy()}},[i,e,t,s,n])}function Hi(){const[i,e]=It("colors",["background_body","border"],["#ffffff","#ffffff"]);return m.useMemo(()=>({control:s=>({...s,cursor:"pointer"}),indicatorSeparator:s=>({...s,borderColor:e}),dropdownIndicator:s=>({...s,backgroundColor:i})}),[i,e])}const Zt="@open-pioneer/printing",Qt=$e.bind(void 0,Zt),Bi=z.bind(void 0,Zt),$i="map";class Ui{olMap;i18n;printingService;viewPadding;printMap=void 0;overlay=void 0;constructor(e,t,s){this.olMap=e,this.printingService=t,this.i18n=s}destroy(){this.reset()}setViewPadding(e){this.viewPadding=e}async handleMapExport(e){if(this.olMap)try{this.begin(),this.printMap=await this.printingService.printMap(this.olMap,{blockUserInteraction:!1,viewPadding:this.viewPadding});const t=this.printMap.getCanvas();if(t)e.fileFormat=="png"?await this.exportMapInPNG(t,e):await this.exportMapInPDF(t,e);else throw new Error("Canvas export failed")}finally{this.reset()}}begin(){const e=this.olMap.getTargetElement();e&&(this.overlay=Jn(e,this.i18n.overlayText))}reset(){this.overlay?.destroy(),this.overlay=void 0}getTitleAndFileName(e){const t=e.title||"",s=e.title||$i;return{title:t,fileName:s}}async exportMapInPNG(e,t){const s=document.createElement("canvas");s.width=e.width,s.height=e.height+50,s.style.backgroundColor="#fff";const n=s.getContext("2d");if(!n)throw new Error("2d canvas rendering context not available");const{title:r,fileName:o}=this.getTitleAndFileName(t);n.fillStyle="#fff",n.fillRect(0,0,s.width,s.height),n.font="20px bold sans-serif",n.textAlign="center",n.fillStyle="#000";const a=s.width/2;n.fillText(r,a,20),n.drawImage(e,0,50);const l=document.createElement("a");l.setAttribute("download",o+".png");const c=Xn(s);if(!c)throw new Error("Failed to get image data URL");l.href=c,l.click()}async exportMapInPDF(e,t){const{jsPDF:s}=await ts(async()=>{const{jsPDF:F}=await import("./Bdg1SXiiiaSc.js");return{jsPDF:F}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url),n=new s({orientation:"landscape",unit:"mm",format:"a4"}),r=n.internal.pageSize.getWidth(),o=n.internal.pageSize.getHeight(),a=15,l=20,c=o-l;n.setFontSize(20);const{title:u,fileName:h}=this.getTitleAndFileName(t);n.text(u,r/2,a,{align:"center"});const f=e.width/e.height;let g=c,p=g*f;p>=r&&(p=r,g=p/f);const y=(r-p)/2,b=l+(c-g)/2;n.addImage(e,"",y,b,p,g),n.save(h+".pdf")}}const Wi=fe("printing"),Sr=i=>{const e=Bi(),{viewPadding:t="auto"}=i,{containerProps:s}=H("printing",i),[n,r]=m.useState("pdf"),[o,a]=m.useState(""),[l,c]=m.useState(!1),u=Qt("notifier.NotificationService"),{map:h}=B(i),f=zi(h,e,t);function g(y){(y==="png"||y==="pdf")&&r(y)}function p(){l||!f||(c(!0),f.handleMapExport({title:o,fileFormat:n}).catch(y=>{const b=e.formatMessage({id:"printingFailed"});u.notify({level:"error",message:b}),Wi.error("Failed to print the map",y)}).finally(()=>{c(!1)}))}return d.jsx(P,{...s,children:d.jsxs(P,{as:"form",m:2,alignItems:"center",onSubmit:y=>{y.preventDefault(),p()},children:[d.jsxs(xe,{as:Ge,mb:2,children:[d.jsx(we,{minWidth:"82",mb:1,children:e.formatMessage({id:"title"})}),d.jsx(We,{placeholder:e.formatMessage({id:"input.placeholder"}),value:o,onChange:y=>{a(y.target.value)},autoFocus:!0})]}),d.jsxs(xe,{as:Ge,mb:2,children:[d.jsx(we,{minWidth:"82",mb:1,children:e.formatMessage({id:"fileFormat"})}),d.jsxs(ze,{value:n,onChange:y=>g(y.target.value),className:"printing-select",children:[d.jsx("option",{value:"png",children:"PNG"}),d.jsx("option",{value:"pdf",children:"PDF"})]})]}),d.jsx(Ft,{isLoading:l,loadingText:e.formatMessage({id:"printingMap"}),disabled:l,mt:2,p:2,className:"printing-export-button",type:"submit",width:"100%",children:e.formatMessage({id:"export"})})]})})};function zi(i,e,t){const s=Qt("printing.PrintingService"),[n,r]=m.useState(void 0);return m.useEffect(()=>{if(!i)return;const o=new Ui(i.olMap,s,{overlayText:e.formatMessage({id:"printingMap"})});return r(o),()=>{o.destroy(),r(void 0)}},[i,e,s]),m.useEffect(()=>{n?.setViewPadding(t)},[n,t]),n}export{gr as C,ur as E,We as I,pr as L,yr as M,hr as N,Fe as O,Sr as P,Gt as S,dr as V,cr as W,fr as a,mr as b,_r as c,vr as d,ze as e,ps as u}; diff --git a/openlayers-base-packages/pr-previews/pr-371/assets/DEc3M1w42gc3.js b/openlayers-base-packages/pr-previews/pr-371/assets/DfytJBTHC9Fu.js similarity index 85% rename from openlayers-base-packages/pr-previews/pr-371/assets/DEc3M1w42gc3.js rename to openlayers-base-packages/pr-previews/pr-371/assets/DfytJBTHC9Fu.js index 8ca62e3..e8e45b3 100644 --- a/openlayers-base-packages/pr-previews/pr-371/assets/DEc3M1w42gc3.js +++ b/openlayers-base-packages/pr-previews/pr-371/assets/DfytJBTHC9Fu.js @@ -1 +1 @@ -const e=JSON.parse(`{"showcase-app":{"header.title":"Component Showcase","ariaLabels.map":"Map. Use the arrow keys to move the map. Zoom in with the plus button and zoom out with the minus button.","demos.geolocation.title":"Geolocation","demos.geolocation.description":"This demo shows how to use the Geolocation tool to get the current position of the device.","demos.printing.title":"Printing","demos.printing.description":"This demo shows how to use the Printing component to export a screenshot of the map.","demos.spatialBookmarks.title":"Spatial Bookmarks","demos.spatialBookmarks.description":"This demo shows how to use the SpatialBookmarks component to save und load spatial bookmarks.","demos.overviewMap.title":"Overview map","demos.overviewMap.description":"This demo shows how to use the OverviewMap.","demos.mapNavigation.title":"Map navigation tools","demos.mapNavigation.description":"This demo shows how to use the map navigation tools: ZoomIn, ZoomOut, InitialExtent","demos.searchAndHighlight.title":"Search and Feature-Highlight","demos.searchAndHighlight.description":"This demo shows how to use the Search component and how features can be highlighted in the map.","demos.coordinateViewer.title":"Coordinate viewer","demos.coordinateViewer.description":"This demo shows how to use the CoordinateViewer component to show the coordinates at the users current mouse position.","demos.scaleViewer.title":"Scale viewer","demos.scaleViewer.description":"This demo shows how to use the ScaleViewer component.","demos.scaleSetter.title":"Scale setter","demos.scaleSetter.description":"This demo shows how to use the ScaleSetter component to change the scale of the map.","demos.scaleBar.title":"Scale bar","demos.scaleBar.description":"This demo shows how to use the ScaleBar component.","demos.measurement.title":"Measurement","demos.measurement.description":"This demo shows how to use the Measurement component for measuring distances and areas. Measurement component for measuring distances and areas.","demos.tocLegend.title":"Toc, BasemapSwitcher and Legend","demos.tocLegend.description":"This demo shows how to use the Toc, BasemapSwitcher and Legend components to control the map content and to show the legend for the contents.","demos.tocLegend.tocTitle":"TOC","demos.tocLegend.legendTitle":"Legend","demos.selectionResultList.title":"Selection and Result List","demos.selectionResultList.description":"This demo shows how to use the Selection component to select feature in the map and how to use the ResultList component to display feature attributes in a table.","demos.editing.title":"Editing","demos.editing.description":"This demo shows how the API of the editing package can be used to provide editing functionality.","demos.editing.startCreateButton":"create feature","demos.editing.startUpdateButton":"update feature","demos.editing.stopButton":"stop editing","demos.editing.create.startTitle":"Editing - Create new feature","demos.editing.create.featureCreated":"Created feature with ID: {featureId}","demos.editing.update.startTitle":"Editing - Modify feature","demos.editing.update.featureModified":"Modified feature with ID: {featureId}","demos.editing.update.tooltip.select":"Select geometry to start editing","demos.editing.update.savingStared":"Feature is being saved...","demos.editing.activeInfo":"Status: editing active","demos.editing.inactiveInfo":"Status: editing inactive","demoSelection.label":"Demo:","demoSelection.notFound":"Demo ''{demoId}'' was not found.","localeSwitcher.label":"Language:","localeSwitcher.locale.de":"German","localeSwitcher.locale.en":"English"},"@open-pioneer/editing":{"title":"Editing","create.tooltip.begin":"Click to start creating the geometry","create.tooltip.continue":"Double click to finish the geometry and save the feature","create.tooltip.deselect":"Click outside the geometry in the map to save changes"},"@open-pioneer/geolocation":{"locateNotSupported":"Geolocation is not supported.","locateMeStart":"Start geolocation","locateMeEnd":"Stop geolocation","error":"Error","permissionDenied":"Geolocation was canceled.","positionUnavailable":"Geolocation position cannot be determined.","timeout":"Geolocation was canceled due to timeout.","unknownError":"An unexpected error occurred during geolocation."},"@open-pioneer/legend":{"altLabel":"legend image for layer {layerName}","fallbackLabel":"legend not available","basemapLabel":"Basemap"},"@open-pioneer/map-navigation":{"initial-extent.title":"Zoom to initial extent","zoom-in.title":"Zoom in map","zoom-out.title":"Zoom out map","view-backward.title":"One map view back","view-forward.title":"One map view ahead"},"@open-pioneer/measurement":{"measurementLabel":"Mode","distance":"Distance","area":"Area","deleteMeasurementLabel":"Delete measurements","measurementInfoText":"Click in the map to start a measurement.","tooltips.help":"Click to start measuring.","tooltips.continue":"Double click to end the measurement."},"@open-pioneer/printing":{"title":"Title","fileFormat":"File format","export":"Export map","input.placeholder":"Enter title","printingMap":"Map is printing ...","printingFailed":"Failed to print the map."},"@open-pioneer/result-list":{"selectAllTooltip":"Select all","deSelectAllTooltip":"Deselect all","noDataMessage":"No data available","displayBoolean.true":"yes","displayBoolean.false":"no","ariaLabel.selectSingle":"Press space to select or deselect."},"@open-pioneer/scale-setter":{"button.ariaLabel":"Current scale: {scale}.","button.ariaDescription":"Press Enter to change the scale."},"@open-pioneer/search":{"noOptionsText":"No results found","loadingText":"Loading...","searchPlaceholder":"Search...","ariaLabel.search":"Search bar","ariaLabel.instructions":"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu, press Tab to select the option and exit the menu.","ariaLabel.searchFocus":"focused","ariaLabel.searchSelect":"selected","ariaLabel.searchClear":"cleared","ariaLabel.clearButton":"Empty the search"},"@open-pioneer/selection":{"selectMethod":"Select method","EXTENT":"Rechteck","POLYGON":"Polygon","FREEPOLYGON":"Freies Zeichnen","CIRCLE":"Kreis","selectSource":"Select source","tooltip":"Click on the map, hold down the mouse button and draw a rectangle","disabledTooltip":"The current selection source is not available","noSourceTooltip":"No selection source selected. Please choose a selection source to start.","sourceNotAvailable":"Source not available","selectionFailed":"Spatial selection failed","selectionPlaceholder":"No source selected","layerNotVisibleReason":"Matching layer is not visible.","selected":"selected"},"@open-pioneer/spatial-bookmarks":{"bookmark.button.create":"Add new bookmark","bookmark.button.deleteAll":"Delete all bookmarks","bookmark.button.deleteOne":"Delete bookmark","bookmark.button.save":"Save","bookmark.button.cancel":"Cancel","bookmark.button.cancelDelete":"No","bookmark.button.confirmDelete":"Yes","bookmark.input.label":"Name","bookmark.input.placeholder":"Enter bookmark name","bookmark.alert.create":"After entering a name you can save the new bookmark. The current map extent is used as the basis for the position.","bookmark.alert.delete":"Do you really want to delete all spatial bookmarks?","bookmark.alert.noSaved":"No bookmarks saved","bookmark.list.label":"Spatial bookmarks"},"@open-pioneer/toc":{"basemapsLabel":"Basemaps","descriptionLabel":"Layer description","operationalLayerLabel":"Operational layers","childgroupLabel":"Layer group {title}","missingLayers":"There are no layers to display.","error":"Error while creating map content.","layerNotAvailable":"Layer not available","toolsLabel":"Map tools","tools.hideAllLayers":"Hide all layers"},"@open-pioneer/basemap-switcher":{"emptyBasemapLabel":"Without basemap","layerNotAvailable":"Layer not available","selected":"selected"}}`);export{e as default}; +const e=JSON.parse(`{"showcase-app":{"header.title":"Component Showcase","ariaLabels.map":"Map. Use the arrow keys to move the map. Zoom in with the plus button and zoom out with the minus button.","demos.geolocation.title":"Geolocation","demos.geolocation.description":"This demo shows how to use the Geolocation tool to get the current position of the device.","demos.printing.title":"Printing","demos.printing.description":"This demo shows how to use the Printing component to export a screenshot of the map.","demos.spatialBookmarks.title":"Spatial Bookmarks","demos.spatialBookmarks.description":"This demo shows how to use the SpatialBookmarks component to save und load spatial bookmarks.","demos.overviewMap.title":"Overview map","demos.overviewMap.description":"This demo shows how to use the OverviewMap.","demos.mapNavigation.title":"Map navigation tools","demos.mapNavigation.description":"This demo shows how to use the map navigation tools: ZoomIn, ZoomOut, InitialExtent","demos.searchAndHighlight.title":"Search and Feature-Highlight","demos.searchAndHighlight.description":"This demo shows how to use the Search component and how features can be highlighted in the map.","demos.coordinateViewer.title":"Coordinate viewer","demos.coordinateViewer.description":"This demo shows how to use the CoordinateViewer component to show the coordinates at the users current mouse position.","demos.scaleViewer.title":"Scale viewer","demos.scaleViewer.description":"This demo shows how to use the ScaleViewer component.","demos.scaleSetter.title":"Scale setter","demos.scaleSetter.description":"This demo shows how to use the ScaleSetter component to change the scale of the map.","demos.scaleBar.title":"Scale bar","demos.scaleBar.description":"This demo shows how to use the ScaleBar component.","demos.measurement.title":"Measurement","demos.measurement.description":"This demo shows how to use the Measurement component for measuring distances and areas. Measurement component for measuring distances and areas.","demos.tocLegend.title":"Toc, BasemapSwitcher and Legend","demos.tocLegend.description":"This demo shows how to use the Toc, BasemapSwitcher and Legend components to control the map content and to show the legend for the contents.","demos.tocLegend.tocTitle":"TOC","demos.tocLegend.legendTitle":"Legend","demos.selectionResultList.title":"Selection and Result List","demos.selectionResultList.description":"This demo shows how to use the Selection component to select feature in the map and how to use the ResultList component to display feature attributes in a table.","demos.editing.title":"Editing","demos.editing.description":"This demo shows how the API of the editing package can be used to provide editing functionality.","demos.editing.startCreateButton":"create feature","demos.editing.startUpdateButton":"update feature","demos.editing.stopButton":"stop editing","demos.editing.create.startTitle":"Editing - Create new feature","demos.editing.create.featureCreated":"Created feature with ID: {featureId}","demos.editing.update.startTitle":"Editing - Modify feature","demos.editing.update.featureModified":"Modified feature with ID: {featureId}","demos.editing.update.tooltip.select":"Select geometry to start editing","demos.editing.update.savingStared":"Feature is being saved...","demos.editing.activeInfo":"Status: editing active","demos.editing.inactiveInfo":"Status: editing inactive","demoSelection.label":"Demo:","demoSelection.notFound":"Demo ''{demoId}'' was not found.","localeSwitcher.label":"Language:","localeSwitcher.locale.de":"German","localeSwitcher.locale.en":"English"},"@open-pioneer/editing":{"title":"Editing","create.tooltip.begin":"Click to start creating the geometry","create.tooltip.continue":"Double click to finish the geometry and save the feature","create.tooltip.deselect":"Click outside the geometry in the map to save changes"},"@open-pioneer/geolocation":{"locateNotSupported":"Geolocation is not supported.","locateMeStart":"Start geolocation","locateMeEnd":"Stop geolocation","error":"Error","permissionDenied":"Geolocation was canceled.","positionUnavailable":"Geolocation position cannot be determined.","timeout":"Geolocation was canceled due to timeout.","unknownError":"An unexpected error occurred during geolocation."},"@open-pioneer/legend":{"altLabel":"legend image for layer {layerName}","fallbackLabel":"legend not available","basemapLabel":"Basemap"},"@open-pioneer/map-navigation":{"initial-extent.title":"Zoom to initial extent","zoom-in.title":"Zoom in map","zoom-out.title":"Zoom out map","view-backward.title":"One map view back","view-forward.title":"One map view ahead"},"@open-pioneer/measurement":{"measurementLabel":"Mode","distance":"Distance","area":"Area","deleteMeasurementLabel":"Delete measurements","measurementInfoText":"Click in the map to start a measurement.","tooltips.help":"Click to start measuring.","tooltips.continue":"Double click to end the measurement."},"@open-pioneer/printing":{"title":"Title","fileFormat":"File format","export":"Export map","input.placeholder":"Enter title","printingMap":"Map is printing ...","printingFailed":"Failed to print the map."},"@open-pioneer/result-list":{"selectAllTooltip":"Select all","deSelectAllTooltip":"Deselect all","noDataMessage":"No data available","displayBoolean.true":"yes","displayBoolean.false":"no","ariaLabel.selectSingle":"Press space to select or deselect."},"@open-pioneer/scale-setter":{"button.ariaLabel":"Current scale: {scale}.","button.ariaDescription":"Press Enter to change the scale."},"@open-pioneer/selection":{"selectMethod":"Select method","EXTENT":"Rechteck","POLYGON":"Polygon","FREEPOLYGON":"Freies Zeichnen","CIRCLE":"Kreis","selectSource":"Select source","tooltip":"Click on the map, hold down the mouse button and draw a rectangle","disabledTooltip":"The current selection source is not available","noSourceTooltip":"No selection source selected. Please choose a selection source to start.","sourceNotAvailable":"Source not available","selectionFailed":"Spatial selection failed","selectionPlaceholder":"No source selected","layerNotVisibleReason":"Matching layer is not visible.","selected":"selected"},"@open-pioneer/search":{"noOptionsText":"No results found","loadingText":"Loading...","searchPlaceholder":"Search...","ariaLabel.search":"Search bar","ariaLabel.instructions":"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu, press Tab to select the option and exit the menu.","ariaLabel.searchFocus":"focused","ariaLabel.searchSelect":"selected","ariaLabel.searchClear":"cleared","ariaLabel.clearButton":"Empty the search"},"@open-pioneer/spatial-bookmarks":{"bookmark.button.create":"Add new bookmark","bookmark.button.deleteAll":"Delete all bookmarks","bookmark.button.deleteOne":"Delete bookmark","bookmark.button.save":"Save","bookmark.button.cancel":"Cancel","bookmark.button.cancelDelete":"No","bookmark.button.confirmDelete":"Yes","bookmark.input.label":"Name","bookmark.input.placeholder":"Enter bookmark name","bookmark.alert.create":"After entering a name you can save the new bookmark. The current map extent is used as the basis for the position.","bookmark.alert.delete":"Do you really want to delete all spatial bookmarks?","bookmark.alert.noSaved":"No bookmarks saved","bookmark.list.label":"Spatial bookmarks"},"@open-pioneer/toc":{"basemapsLabel":"Basemaps","descriptionLabel":"Layer description","operationalLayerLabel":"Operational layers","childgroupLabel":"Layer group {title}","missingLayers":"There are no layers to display.","error":"Error while creating map content.","layerNotAvailable":"Layer not available","toolsLabel":"Map tools","tools.hideAllLayers":"Hide all layers"},"@open-pioneer/basemap-switcher":{"emptyBasemapLabel":"Without basemap","layerNotAvailable":"Layer not available","selected":"selected"}}`);export{e as default}; diff --git a/openlayers-base-packages/pr-previews/pr-371/assets/D7mnkJrZHEBm.js b/openlayers-base-packages/pr-previews/pr-371/assets/VtSxxxXBlKT0.js similarity index 97% rename from openlayers-base-packages/pr-previews/pr-371/assets/D7mnkJrZHEBm.js rename to openlayers-base-packages/pr-previews/pr-371/assets/VtSxxxXBlKT0.js index 731a3e2..d85ed1b 100644 --- a/openlayers-base-packages/pr-previews/pr-371/assets/D7mnkJrZHEBm.js +++ b/openlayers-base-packages/pr-previews/pr-371/assets/VtSxxxXBlKT0.js @@ -1 +1 @@ -import{a as k,c as y,r as c,j as e,B as m,e as z}from"./Bh0CuZ3gy5tC.js";import{t as S}from"./B99qq3IKf4kH.js";import{S as j,T as I,O as C,M,H as P,f as L,i as R,k as g,g as _,B as p,h as E,l as A,m as s}from"./CvR1K3f_Jx0o.js";import{P as T,N as H,I as q}from"./D5SiXzFLvedX.js";import{_ as b}from"./CmsKOCeNyeyo.js";import{S as N,T as i,V as v,U,a as h}from"./Tz2xttM4F6S2.js";import"./DoZQ59JZnzxi.js";import"./CKfDAIEslOW2.js";const d="main";class O{mapId=d;async getMapConfig(){return{initialView:{kind:"position",center:{x:404747,y:5757920},zoom:14},layers:[new j({title:"OSM",isBaseLayer:!0,olLayer:new I({source:new C})})]}}}const F={"printing-api-app":{name:"printing-api-app",services:{MapConfigProviderImpl:{name:"MapConfigProviderImpl",clazz:O,provides:[{name:"map.MapConfigProvider",qualifier:void 0}],references:{}}},ui:{references:[{name:"printing.PrintingService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/chakra-integration":{name:"@open-pioneer/chakra-integration",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map":{name:"@open-pioneer/map",services:{MapRegistryImpl:{name:"MapRegistryImpl",clazz:M,provides:[{name:"map.MapRegistry",qualifier:void 0}],references:{providers:{name:"map.MapConfigProvider",qualifier:void 0,all:!0},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/printing":{name:"@open-pioneer/printing",services:{PrintingServiceImpl:{name:"PrintingServiceImpl",clazz:T,provides:[{name:"printing.PrintingService",qualifier:void 0}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1},{name:"printing.PrintingService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/runtime":{name:"@open-pioneer/runtime",services:{},ui:{references:[]},properties:{}},"@open-pioneer/react-utils":{name:"@open-pioneer/react-utils",services:{},ui:{references:[]},properties:{}},"@open-pioneer/theme":{name:"@open-pioneer/theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/core":{name:"@open-pioneer/core",services:{},ui:{references:[]},properties:{}},"@open-pioneer/http":{name:"@open-pioneer/http",services:{HttpServiceImpl:{name:"HttpServiceImpl",clazz:P,provides:[{name:"http.HttpService",qualifier:"http.HttpService"}],references:{interceptors:{name:"http.Interceptor",qualifier:void 0,all:!0}}}},ui:{references:[]},properties:{}},"@open-pioneer/notifier":{name:"@open-pioneer/notifier",services:{NotificationServiceImpl:{name:"NotificationServiceImpl",clazz:H,provides:[{name:"notifier.NotificationService",qualifier:"notifier.NotificationService"}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/base-theme":{name:"@open-pioneer/base-theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime-react-support":{name:"@open-pioneer/runtime-react-support",services:{},ui:{references:[]},properties:{}}},G=':root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.map-container .ol-viewport .ol-attribution{bottom:var(--map-padding-bottom);right:var(--map-padding-right)}.printing-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:10000;-webkit-user-select:none;user-select:none;pointer-events:all;cursor:wait;display:flex;flex-direction:row;align-items:center;justify-content:center;background-color:#b4b4b4cc}.printing-overlay-status{flex:1 1 auto;font-size:1.5em;text-align:center}.printing-scale-bar.ol-scale-bar{left:var(--printing-scale-bar-left);bottom:var(--printing-scale-bar-bottom)}',B=["en","de"];function D(o){switch(o){case"en":return b(()=>import("./-jAncdI_g-d4.js"),[],import.meta.url).then(r=>r.default);case"de":return b(()=>import("./1YhbJ59n8_2l.js"),[],import.meta.url).then(r=>r.default)}throw new Error(`Unsupported locale: '${o}'`)}const V=k(G),W=Object.freeze(Object.defineProperty({__proto__:null,loadMessages:D,locales:B,packages:F,styles:V},Symbol.toStringTag,{value:"Module"})),K="printing-api-app",$=L.bind(void 0,K),J=y("printing");function Q(){const{map:o}=R(d),r=$("printing.PrintingService"),[t,n]=c.useState(void 0),f=async()=>{u("canvas")},x=async()=>{u("png")},u=async w=>{o&&await r.printMap(o.olMap).then(a=>{const l=a.getCanvas();w==="canvas"?(l.style.width="100%",l.style.height="100%",n(l)):n(a.getPNGDataURL(.6))},a=>{J.error(a)})};return e.jsx(g,{height:"100%",direction:"column",overflow:"hidden",children:e.jsx(_,{title:e.jsx(p,{textAlign:"center",py:1,children:e.jsx(E,{size:"md",children:"OpenLayers Base Packages - Printing API"})}),children:e.jsx(g,{flex:"1",direction:"column",position:"relative",children:e.jsxs(A,{mapId:d,children:[e.jsx(s,{position:"top-left",horizontalGap:10,verticalGap:10,children:e.jsx(p,{backgroundColor:"whiteAlpha.900",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",children:e.jsxs(N,{pt:5,children:[e.jsx(i,{align:"center",children:"Test Controls:"}),e.jsx(m,{onClick:()=>f(),children:"Canvas"}),e.jsx(m,{onClick:()=>x(),children:"Image data URL"})]})})}),e.jsx(s,{position:"top-right",horizontalGap:10,verticalGap:10,children:e.jsxs(v,{backgroundColor:"whiteAlpha.900",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",maxWidth:"400px",maxHeight:"300px",overflow:"auto",children:[e.jsx(i,{as:"b",children:"Description"}),e.jsx(i,{children:"This application can be used to test the printing service. The service provides the screenshot of the given map view in a form of HTMLCanvasElement or a data url."}),e.jsxs(U,{children:[e.jsxs(h,{children:["Clicking on the ","'Canvas'"," button shows the HTMLCanvasElement of the map view embedded in another HTMLElement."]}),e.jsxs(h,{children:["Clicking on the ","'Image data URL'"," button shows the data url of the map view image used as source for HTMLImageElement."]})]})]})}),e.jsx(s,{position:"top-right",horizontalGap:450,verticalGap:10,children:t&&e.jsx(v,{backgroundColor:"whiteAlpha.900",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",className:"result-display",maxWidth:"600",maxHeight:"500",children:e.jsx(X,{input:t})})})]})})})})}function X(o){const r=typeof o.input=="string"?o.input:void 0,t=r&&e.jsxs(e.Fragment,{children:[e.jsx(i,{as:"b",children:"Image from data URL"}),e.jsx(q,{src:r})]}),n=typeof o.input!="string"?e.jsx(Y,{canvas:o.input}):void 0;return t||n}function Y(o){const r=c.useRef(null);return c.useEffect(()=>{if(!r.current)return;const t=r.current;return t.appendChild(o.canvas),()=>{t.removeChild(o.canvas)}},[o.canvas]),e.jsxs(e.Fragment,{children:[e.jsx(i,{as:"b",children:"Image from canvas"}),e.jsx(p,{ref:r})]})}const Z=new URLSearchParams(window.location.search),ee=Z.get("lang"),oe=z({component:Q,config:{locale:ee??void 0},theme:S,appMetadata:W});customElements.define("printing-api-app",oe); +import{a as k,c as y,r as c,j as e,B as m,e as z}from"./Bh0CuZ3gy5tC.js";import{t as S}from"./B99qq3IKf4kH.js";import{S as j,T as I,O as C,M,H as P,f as L,i as R,k as g,g as _,B as p,h as E,l as A,m as s}from"./CvR1K3f_Jx0o.js";import{P as T,N as H,I as q}from"./CC4cg6c-thsW.js";import{_ as b}from"./CmsKOCeNyeyo.js";import{S as N,T as i,V as v,U,a as h}from"./Tz2xttM4F6S2.js";import"./DoZQ59JZnzxi.js";import"./CKfDAIEslOW2.js";const d="main";class O{mapId=d;async getMapConfig(){return{initialView:{kind:"position",center:{x:404747,y:5757920},zoom:14},layers:[new j({title:"OSM",isBaseLayer:!0,olLayer:new I({source:new C})})]}}}const F={"printing-api-app":{name:"printing-api-app",services:{MapConfigProviderImpl:{name:"MapConfigProviderImpl",clazz:O,provides:[{name:"map.MapConfigProvider",qualifier:void 0}],references:{}}},ui:{references:[{name:"printing.PrintingService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/chakra-integration":{name:"@open-pioneer/chakra-integration",services:{},ui:{references:[]},properties:{}},"@open-pioneer/map":{name:"@open-pioneer/map",services:{MapRegistryImpl:{name:"MapRegistryImpl",clazz:M,provides:[{name:"map.MapRegistry",qualifier:void 0}],references:{providers:{name:"map.MapConfigProvider",qualifier:void 0,all:!0},httpService:{name:"http.HttpService",qualifier:void 0,all:!1}}}},ui:{references:[{name:"map.MapRegistry",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/printing":{name:"@open-pioneer/printing",services:{PrintingServiceImpl:{name:"PrintingServiceImpl",clazz:T,provides:[{name:"printing.PrintingService",qualifier:void 0}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1},{name:"printing.PrintingService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/react-utils":{name:"@open-pioneer/react-utils",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime":{name:"@open-pioneer/runtime",services:{},ui:{references:[]},properties:{}},"@open-pioneer/theme":{name:"@open-pioneer/theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/core":{name:"@open-pioneer/core",services:{},ui:{references:[]},properties:{}},"@open-pioneer/http":{name:"@open-pioneer/http",services:{HttpServiceImpl:{name:"HttpServiceImpl",clazz:P,provides:[{name:"http.HttpService",qualifier:"http.HttpService"}],references:{interceptors:{name:"http.Interceptor",qualifier:void 0,all:!0}}}},ui:{references:[]},properties:{}},"@open-pioneer/notifier":{name:"@open-pioneer/notifier",services:{NotificationServiceImpl:{name:"NotificationServiceImpl",clazz:H,provides:[{name:"notifier.NotificationService",qualifier:"notifier.NotificationService"}],references:{}}},ui:{references:[{name:"notifier.NotificationService",qualifier:void 0,all:!1}]},properties:{}},"@open-pioneer/base-theme":{name:"@open-pioneer/base-theme",services:{},ui:{references:[]},properties:{}},"@open-pioneer/runtime-react-support":{name:"@open-pioneer/runtime-react-support",services:{},ui:{references:[]},properties:{}}},G=':root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.map-container .ol-viewport .ol-attribution{bottom:var(--map-padding-bottom);right:var(--map-padding-right)}.printing-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:10000;-webkit-user-select:none;user-select:none;pointer-events:all;cursor:wait;display:flex;flex-direction:row;align-items:center;justify-content:center;background-color:#b4b4b4cc}.printing-overlay-status{flex:1 1 auto;font-size:1.5em;text-align:center}.printing-scale-bar.ol-scale-bar{left:var(--printing-scale-bar-left);bottom:var(--printing-scale-bar-bottom)}',B=["en","de"];function D(o){switch(o){case"en":return b(()=>import("./-jAncdI_g-d4.js"),[],import.meta.url).then(r=>r.default);case"de":return b(()=>import("./1YhbJ59n8_2l.js"),[],import.meta.url).then(r=>r.default)}throw new Error(`Unsupported locale: '${o}'`)}const V=k(G),W=Object.freeze(Object.defineProperty({__proto__:null,loadMessages:D,locales:B,packages:F,styles:V},Symbol.toStringTag,{value:"Module"})),K="printing-api-app",$=L.bind(void 0,K),J=y("printing");function Q(){const{map:o}=R(d),r=$("printing.PrintingService"),[t,n]=c.useState(void 0),f=async()=>{u("canvas")},x=async()=>{u("png")},u=async w=>{o&&await r.printMap(o.olMap).then(a=>{const l=a.getCanvas();w==="canvas"?(l.style.width="100%",l.style.height="100%",n(l)):n(a.getPNGDataURL(.6))},a=>{J.error(a)})};return e.jsx(g,{height:"100%",direction:"column",overflow:"hidden",children:e.jsx(_,{title:e.jsx(p,{textAlign:"center",py:1,children:e.jsx(E,{size:"md",children:"OpenLayers Base Packages - Printing API"})}),children:e.jsx(g,{flex:"1",direction:"column",position:"relative",children:e.jsxs(A,{mapId:d,children:[e.jsx(s,{position:"top-left",horizontalGap:10,verticalGap:10,children:e.jsx(p,{backgroundColor:"whiteAlpha.900",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",children:e.jsxs(N,{pt:5,children:[e.jsx(i,{align:"center",children:"Test Controls:"}),e.jsx(m,{onClick:()=>f(),children:"Canvas"}),e.jsx(m,{onClick:()=>x(),children:"Image data URL"})]})})}),e.jsx(s,{position:"top-right",horizontalGap:10,verticalGap:10,children:e.jsxs(v,{backgroundColor:"whiteAlpha.900",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",maxWidth:"400px",maxHeight:"300px",overflow:"auto",children:[e.jsx(i,{as:"b",children:"Description"}),e.jsx(i,{children:"This application can be used to test the printing service. The service provides the screenshot of the given map view in a form of HTMLCanvasElement or a data url."}),e.jsxs(U,{children:[e.jsxs(h,{children:["Clicking on the ","'Canvas'"," button shows the HTMLCanvasElement of the map view embedded in another HTMLElement."]}),e.jsxs(h,{children:["Clicking on the ","'Image data URL'"," button shows the data url of the map view image used as source for HTMLImageElement."]})]})]})}),e.jsx(s,{position:"top-right",horizontalGap:450,verticalGap:10,children:t&&e.jsx(v,{backgroundColor:"whiteAlpha.900",borderWidth:"1px",borderRadius:"lg",padding:2,boxShadow:"lg",className:"result-display",maxWidth:"600",maxHeight:"500",children:e.jsx(X,{input:t})})})]})})})})}function X(o){const r=typeof o.input=="string"?o.input:void 0,t=r&&e.jsxs(e.Fragment,{children:[e.jsx(i,{as:"b",children:"Image from data URL"}),e.jsx(q,{src:r})]}),n=typeof o.input!="string"?e.jsx(Y,{canvas:o.input}):void 0;return t||n}function Y(o){const r=c.useRef(null);return c.useEffect(()=>{if(!r.current)return;const t=r.current;return t.appendChild(o.canvas),()=>{t.removeChild(o.canvas)}},[o.canvas]),e.jsxs(e.Fragment,{children:[e.jsx(i,{as:"b",children:"Image from canvas"}),e.jsx(p,{ref:r})]})}const Z=new URLSearchParams(window.location.search),ee=Z.get("lang"),oe=z({component:Q,config:{locale:ee??void 0},theme:S,appMetadata:W});customElements.define("printing-api-app",oe); diff --git a/openlayers-base-packages/pr-previews/pr-371/samples/map-sample/index.html b/openlayers-base-packages/pr-previews/pr-371/samples/map-sample/index.html index 4d8cfb3..1b4d4a5 100644 --- a/openlayers-base-packages/pr-previews/pr-371/samples/map-sample/index.html +++ b/openlayers-base-packages/pr-previews/pr-371/samples/map-sample/index.html @@ -17,7 +17,7 @@ overflow: hidden; } - + @@ -34,11 +34,11 @@ - + - + diff --git a/openlayers-base-packages/pr-previews/pr-371/samples/ogc-api-sample/index.html b/openlayers-base-packages/pr-previews/pr-371/samples/ogc-api-sample/index.html index 3161f5c..af218aa 100644 --- a/openlayers-base-packages/pr-previews/pr-371/samples/ogc-api-sample/index.html +++ b/openlayers-base-packages/pr-previews/pr-371/samples/ogc-api-sample/index.html @@ -16,7 +16,7 @@ max-height: 100%; } - + diff --git a/openlayers-base-packages/pr-previews/pr-371/samples/showcase/index.html b/openlayers-base-packages/pr-previews/pr-371/samples/showcase/index.html index 7b24ffd..21fb2dc 100644 --- a/openlayers-base-packages/pr-previews/pr-371/samples/showcase/index.html +++ b/openlayers-base-packages/pr-previews/pr-371/samples/showcase/index.html @@ -17,7 +17,7 @@ overflow: hidden; } - + @@ -34,11 +34,11 @@ - + - + diff --git a/openlayers-base-packages/pr-previews/pr-371/samples/test-printing-api/index.html b/openlayers-base-packages/pr-previews/pr-371/samples/test-printing-api/index.html index 89cf3ec..6acc195 100644 --- a/openlayers-base-packages/pr-previews/pr-371/samples/test-printing-api/index.html +++ b/openlayers-base-packages/pr-previews/pr-371/samples/test-printing-api/index.html @@ -16,14 +16,14 @@ max-height: 100%; } - + - +