@eox/drawtools 0.11.0 → 0.11.1-dev.1730197611.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -991,9 +991,7 @@ const ce = `
991
991
  r.interactions.drawInteractionmodify, X(i, r, i.layerId), (n = i.modify) == null || n.on("modifyend", () => i.onModifyEnd()), r.addEventListener("addfeatures", () => de(i)), { EoxMap: r, OlMap: s };
992
992
  }, ue = (i) => {
993
993
  const t = () => {
994
- i.drawnFeatures = [], setTimeout(() => {
995
- i.draw.setActive(!1), i.selectionEvents.removeSelectionEvent();
996
- }, 200), i.drawLayer.getSource().clear(), i.geoJSON = null;
994
+ i.drawnFeatures = [], i.draw.setActive(!1), i.selectionEvents.removeSelectionEvent(), i.drawLayer.getSource().clear(), i.geoJSON = null;
997
995
  }, e = () => {
998
996
  i.emitDrawnFeatures(), i.currentlyDrawing = !1, i.requestUpdate();
999
997
  };
@@ -1059,9 +1057,7 @@ const ce = `
1059
1057
  };
1060
1058
  r.interactions = [s, n], t.addOrUpdateLayer(r);
1061
1059
  const o = i.draw;
1062
- i.draw = t.selectInteractions.SelectLayerClickInteraction, setTimeout(() => {
1063
- o.setActive(!1), t.selectInteractions.SelectLayerClickInteraction.setActive(!1), t.selectInteractions.SelectLayerHoverInteraction.setActive(!1);
1064
- }, 200);
1060
+ i.draw = t.selectInteractions.SelectLayerClickInteraction, o.setActive(!1), t.selectInteractions.SelectLayerClickInteraction.setActive(!1), t.selectInteractions.SelectLayerHoverInteraction.setActive(!1);
1065
1061
  }, ge = (i, t, e, r) => {
1066
1062
  if (t) {
1067
1063
  if (e) {
@@ -10,9 +10,9 @@
10
10
  * @license
11
11
  * Copyright 2017 Google LLC
12
12
  * SPDX-License-Identifier: BSD-3-Clause
13
- */const N=globalThis,G=N.trustedTypes,at=G?G.createPolicy("lit-html",{createHTML:i=>i}):void 0,lt="$lit$",b=`lit$${Math.random().toFixed(9).slice(2)}$`,ct="?"+b,Bt=`<${ct}>`,_=document,V=()=>_.createComment(""),B=i=>i===null||typeof i!="object"&&typeof i!="function",T=Array.isArray,Rt=i=>T(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",X=`[
14
- \f\r]`,R=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,dt=/-->/g,ht=/>/g,x=RegExp(`>|${X}(?:([^\\s"'>=/]+)(${X}*=${X}*(?:[^
15
- \f\r"'\`<>=]|("|')|))|$)`,"g"),pt=/'/g,ut=/"/g,yt=/^(?:script|style|textarea|title)$/i,zt=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),A=zt(1),M=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),ft=new WeakMap,S=_.createTreeWalker(_,129);function gt(i,t){if(!T(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return at!==void 0?at.createHTML(t):t}const jt=(i,t)=>{const e=i.length-1,r=[];let s,n=t===2?"<svg>":t===3?"<math>":"",o=R;for(let d=0;d<e;d++){const a=i[d];let u,f,h=-1,g=0;for(;g<a.length&&(o.lastIndex=g,f=o.exec(a),f!==null);)g=o.lastIndex,o===R?f[1]==="!--"?o=dt:f[1]!==void 0?o=ht:f[2]!==void 0?(yt.test(f[2])&&(s=RegExp("</"+f[2],"g")),o=x):f[3]!==void 0&&(o=x):o===x?f[0]===">"?(o=s??R,h=-1):f[1]===void 0?h=-2:(h=o.lastIndex-f[2].length,u=f[1],o=f[3]===void 0?x:f[3]==='"'?ut:pt):o===ut||o===pt?o=x:o===dt||o===ht?o=R:(o=x,s=void 0);const $=o===x&&i[d+1].startsWith("/>")?" ":"";n+=o===R?a+Bt:h>=0?(r.push(u),a.slice(0,h)+lt+a.slice(h)+b+$):a+b+(h===-2?d:$)}return[gt(i,n+(i[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),r]};class z{constructor({strings:t,_$litType$:e},r){let s;this.parts=[];let n=0,o=0;const d=t.length-1,a=this.parts,[u,f]=jt(t,e);if(this.el=z.createElement(u,r),S.currentNode=this.el.content,e===2||e===3){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(s=S.nextNode())!==null&&a.length<d;){if(s.nodeType===1){if(s.hasAttributes())for(const h of s.getAttributeNames())if(h.endsWith(lt)){const g=f[o++],$=s.getAttribute(h).split(b),Z=/([.?@])?(.*)/.exec(g);a.push({type:1,index:n,name:Z[2],strings:$,ctor:Z[1]==="."?qt:Z[1]==="?"?Dt:Z[1]==="@"?Gt:W}),s.removeAttribute(h)}else h.startsWith(b)&&(a.push({type:6,index:n}),s.removeAttribute(h));if(yt.test(s.tagName)){const h=s.textContent.split(b),g=h.length-1;if(g>0){s.textContent=G?G.emptyScript:"";for(let $=0;$<g;$++)s.append(h[$],V()),S.nextNode(),a.push({type:2,index:++n});s.append(h[g],V())}}}else if(s.nodeType===8)if(s.data===ct)a.push({type:2,index:n});else{let h=-1;for(;(h=s.data.indexOf(b,h+1))!==-1;)a.push({type:7,index:n}),h+=b.length-1}n++}}static createElement(t,e){const r=_.createElement("template");return r.innerHTML=t,r}}function F(i,t,e=i,r){var o,d;if(t===M)return t;let s=r!==void 0?(o=e._$Co)==null?void 0:o[r]:e._$Cl;const n=B(t)?void 0:t._$litDirective$;return(s==null?void 0:s.constructor)!==n&&((d=s==null?void 0:s._$AO)==null||d.call(s,!1),n===void 0?s=void 0:(s=new n(i),s._$AT(i,e,r)),r!==void 0?(e._$Co??(e._$Co=[]))[r]=s:e._$Cl=s),s!==void 0&&(t=F(i,s._$AS(i,t.values),s,r)),t}class Jt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:r}=this._$AD,s=((t==null?void 0:t.creationScope)??_).importNode(e,!0);S.currentNode=s;let n=S.nextNode(),o=0,d=0,a=r[0];for(;a!==void 0;){if(o===a.index){let u;a.type===2?u=new j(n,n.nextSibling,this,t):a.type===1?u=new a.ctor(n,a.name,a.strings,this,t):a.type===6&&(u=new Wt(n,this,t)),this._$AV.push(u),a=r[++d]}o!==(a==null?void 0:a.index)&&(n=S.nextNode(),o++)}return S.currentNode=_,s}p(t){let e=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}}class j{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,r,s){this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=s,this._$Cv=(s==null?void 0:s.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=F(this,t,e),B(t)?t===p||t==null||t===""?(this._$AH!==p&&this._$AR(),this._$AH=p):t!==this._$AH&&t!==M&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Rt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==p&&B(this._$AH)?this._$AA.nextSibling.data=t:this.T(_.createTextNode(t)),this._$AH=t}$(t){var n;const{values:e,_$litType$:r}=t,s=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=z.createElement(gt(r.h,r.h[0]),this.options)),r);if(((n=this._$AH)==null?void 0:n._$AD)===s)this._$AH.p(e);else{const o=new Jt(s,this),d=o.u(this.options);o.p(e),this.T(d),this._$AH=o}}_$AC(t){let e=ft.get(t.strings);return e===void 0&&ft.set(t.strings,e=new z(t)),e}k(t){T(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let r,s=0;for(const n of t)s===e.length?e.push(r=new j(this.O(V()),this.O(V()),this,this.options)):r=e[s],r._$AI(n),s++;s<e.length&&(this._$AR(r&&r._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,e);t&&t!==this._$AB;){const s=t.nextSibling;t.remove(),t=s}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class W{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,s,n){this.type=1,this._$AH=p,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=n,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=p}_$AI(t,e=this,r,s){const n=this.strings;let o=!1;if(n===void 0)t=F(this,t,e,0),o=!B(t)||t!==this._$AH&&t!==M,o&&(this._$AH=t);else{const d=t;let a,u;for(t=n[0],a=0;a<n.length-1;a++)u=F(this,d[r+a],e,a),u===M&&(u=this._$AH[a]),o||(o=!B(u)||u!==this._$AH[a]),u===p?t=p:t!==p&&(t+=(u??"")+n[a+1]),this._$AH[a]=u}o&&!s&&this.j(t)}j(t){t===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class qt extends W{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===p?void 0:t}}class Dt extends W{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==p)}}class Gt extends W{constructor(t,e,r,s,n){super(t,e,r,s,n),this.type=5}_$AI(t,e=this){if((t=F(this,t,e,0)??p)===M)return;const r=this._$AH,s=t===p&&r!==p||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,n=t!==p&&(r===p||s);s&&this.element.removeEventListener(this.name,this,r),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class Wt{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){F(this,t)}}const Y=N.litHtmlPolyfillSupport;Y==null||Y(z,j),(N.litHtmlVersions??(N.litHtmlVersions=[])).push("3.2.1");const Zt=(i,t,e)=>{const r=(e==null?void 0:e.renderBefore)??t;let s=r._$litPart$;if(s===void 0){const n=(e==null?void 0:e.renderBefore)??null;r._$litPart$=s=new j(t.insertBefore(V(),n),n,void 0,e??{})}return s._$AI(i),s};/**
13
+ */const N=globalThis,G=N.trustedTypes,at=G?G.createPolicy("lit-html",{createHTML:i=>i}):void 0,lt="$lit$",b=`lit$${Math.random().toFixed(9).slice(2)}$`,ct="?"+b,Bt=`<${ct}>`,_=document,V=()=>_.createComment(""),B=i=>i===null||typeof i!="object"&&typeof i!="function",X=Array.isArray,Rt=i=>X(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",Y=`[
14
+ \f\r]`,R=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,dt=/-->/g,ht=/>/g,x=RegExp(`>|${Y}(?:([^\\s"'>=/]+)(${Y}*=${Y}*(?:[^
15
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),pt=/'/g,ut=/"/g,yt=/^(?:script|style|textarea|title)$/i,zt=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),A=zt(1),M=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),ft=new WeakMap,S=_.createTreeWalker(_,129);function gt(i,t){if(!X(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return at!==void 0?at.createHTML(t):t}const jt=(i,t)=>{const e=i.length-1,r=[];let s,n=t===2?"<svg>":t===3?"<math>":"",o=R;for(let d=0;d<e;d++){const a=i[d];let u,f,h=-1,g=0;for(;g<a.length&&(o.lastIndex=g,f=o.exec(a),f!==null);)g=o.lastIndex,o===R?f[1]==="!--"?o=dt:f[1]!==void 0?o=ht:f[2]!==void 0?(yt.test(f[2])&&(s=RegExp("</"+f[2],"g")),o=x):f[3]!==void 0&&(o=x):o===x?f[0]===">"?(o=s??R,h=-1):f[1]===void 0?h=-2:(h=o.lastIndex-f[2].length,u=f[1],o=f[3]===void 0?x:f[3]==='"'?ut:pt):o===ut||o===pt?o=x:o===dt||o===ht?o=R:(o=x,s=void 0);const $=o===x&&i[d+1].startsWith("/>")?" ":"";n+=o===R?a+Bt:h>=0?(r.push(u),a.slice(0,h)+lt+a.slice(h)+b+$):a+b+(h===-2?d:$)}return[gt(i,n+(i[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),r]};class z{constructor({strings:t,_$litType$:e},r){let s;this.parts=[];let n=0,o=0;const d=t.length-1,a=this.parts,[u,f]=jt(t,e);if(this.el=z.createElement(u,r),S.currentNode=this.el.content,e===2||e===3){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(s=S.nextNode())!==null&&a.length<d;){if(s.nodeType===1){if(s.hasAttributes())for(const h of s.getAttributeNames())if(h.endsWith(lt)){const g=f[o++],$=s.getAttribute(h).split(b),Z=/([.?@])?(.*)/.exec(g);a.push({type:1,index:n,name:Z[2],strings:$,ctor:Z[1]==="."?qt:Z[1]==="?"?Dt:Z[1]==="@"?Gt:W}),s.removeAttribute(h)}else h.startsWith(b)&&(a.push({type:6,index:n}),s.removeAttribute(h));if(yt.test(s.tagName)){const h=s.textContent.split(b),g=h.length-1;if(g>0){s.textContent=G?G.emptyScript:"";for(let $=0;$<g;$++)s.append(h[$],V()),S.nextNode(),a.push({type:2,index:++n});s.append(h[g],V())}}}else if(s.nodeType===8)if(s.data===ct)a.push({type:2,index:n});else{let h=-1;for(;(h=s.data.indexOf(b,h+1))!==-1;)a.push({type:7,index:n}),h+=b.length-1}n++}}static createElement(t,e){const r=_.createElement("template");return r.innerHTML=t,r}}function F(i,t,e=i,r){var o,d;if(t===M)return t;let s=r!==void 0?(o=e._$Co)==null?void 0:o[r]:e._$Cl;const n=B(t)?void 0:t._$litDirective$;return(s==null?void 0:s.constructor)!==n&&((d=s==null?void 0:s._$AO)==null||d.call(s,!1),n===void 0?s=void 0:(s=new n(i),s._$AT(i,e,r)),r!==void 0?(e._$Co??(e._$Co=[]))[r]=s:e._$Cl=s),s!==void 0&&(t=F(i,s._$AS(i,t.values),s,r)),t}class Jt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:r}=this._$AD,s=((t==null?void 0:t.creationScope)??_).importNode(e,!0);S.currentNode=s;let n=S.nextNode(),o=0,d=0,a=r[0];for(;a!==void 0;){if(o===a.index){let u;a.type===2?u=new j(n,n.nextSibling,this,t):a.type===1?u=new a.ctor(n,a.name,a.strings,this,t):a.type===6&&(u=new Wt(n,this,t)),this._$AV.push(u),a=r[++d]}o!==(a==null?void 0:a.index)&&(n=S.nextNode(),o++)}return S.currentNode=_,s}p(t){let e=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}}class j{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,r,s){this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=s,this._$Cv=(s==null?void 0:s.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=F(this,t,e),B(t)?t===p||t==null||t===""?(this._$AH!==p&&this._$AR(),this._$AH=p):t!==this._$AH&&t!==M&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Rt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==p&&B(this._$AH)?this._$AA.nextSibling.data=t:this.T(_.createTextNode(t)),this._$AH=t}$(t){var n;const{values:e,_$litType$:r}=t,s=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=z.createElement(gt(r.h,r.h[0]),this.options)),r);if(((n=this._$AH)==null?void 0:n._$AD)===s)this._$AH.p(e);else{const o=new Jt(s,this),d=o.u(this.options);o.p(e),this.T(d),this._$AH=o}}_$AC(t){let e=ft.get(t.strings);return e===void 0&&ft.set(t.strings,e=new z(t)),e}k(t){X(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let r,s=0;for(const n of t)s===e.length?e.push(r=new j(this.O(V()),this.O(V()),this,this.options)):r=e[s],r._$AI(n),s++;s<e.length&&(this._$AR(r&&r._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,e);t&&t!==this._$AB;){const s=t.nextSibling;t.remove(),t=s}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class W{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,s,n){this.type=1,this._$AH=p,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=n,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=p}_$AI(t,e=this,r,s){const n=this.strings;let o=!1;if(n===void 0)t=F(this,t,e,0),o=!B(t)||t!==this._$AH&&t!==M,o&&(this._$AH=t);else{const d=t;let a,u;for(t=n[0],a=0;a<n.length-1;a++)u=F(this,d[r+a],e,a),u===M&&(u=this._$AH[a]),o||(o=!B(u)||u!==this._$AH[a]),u===p?t=p:t!==p&&(t+=(u??"")+n[a+1]),this._$AH[a]=u}o&&!s&&this.j(t)}j(t){t===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class qt extends W{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===p?void 0:t}}class Dt extends W{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==p)}}class Gt extends W{constructor(t,e,r,s,n){super(t,e,r,s,n),this.type=5}_$AI(t,e=this){if((t=F(this,t,e,0)??p)===M)return;const r=this._$AH,s=t===p&&r!==p||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,n=t!==p&&(r===p||s);s&&this.element.removeEventListener(this.name,this,r),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class Wt{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){F(this,t)}}const T=N.litHtmlPolyfillSupport;T==null||T(z,j),(N.litHtmlVersions??(N.litHtmlVersions=[])).push("3.2.1");const Zt=(i,t,e)=>{const r=(e==null?void 0:e.renderBefore)??t;let s=r._$litPart$;if(s===void 0){const n=(e==null?void 0:e.renderBefore)??null;r._$litPart$=s=new j(t.insertBefore(V(),n),n,void 0,e??{})}return s._$AI(i),s};/**
16
16
  * @license
17
17
  * Copyright 2017 Google LLC
18
18
  * SPDX-License-Identifier: BSD-3-Clause
@@ -24,16 +24,16 @@
24
24
  * @license
25
25
  * Copyright 2020 Google LLC
26
26
  * SPDX-License-Identifier: BSD-3-Clause
27
- */const Tt={},Xt=(i,t=Tt)=>i._$AH=t;/**
27
+ */const Xt={},Yt=(i,t=Xt)=>i._$AH=t;/**
28
28
  * @license
29
29
  * Copyright 2021 Google LLC
30
30
  * SPDX-License-Identifier: BSD-3-Clause
31
- */const Yt=Kt(class extends Qt{constructor(){super(...arguments),this.key=p}render(i,t){return this.key=i,t}update(i,[t,e]){return t!==this.key&&(Xt(i),this.key=t),e}}),te=i=>{i.hoverInteraction=i.eoxMap.selectInteractions.selectHover,i.clickInteraction=i.eoxMap.selectInteractions.selectClick;const t=()=>{i.requestUpdate()};i.hoverInteraction.selectStyleLayer.on("change",t),i.clickInteraction.selectStyleLayer.on("change",t)},ee=(i,t,e)=>{if(i.clickId===t)return;const r=e?[]:[t];i.hoverInteraction.highlightById(r)},ie=(i,t)=>{i.stopPropagation();const e=Number(i.target.getAttribute("index")),r=t.drawnFeatures[e];t.drawLayer.getSource().removeFeature(r),t.drawnFeatures.splice(e,1),t.requestUpdate()},mt={duration:750},vt={type:"FeatureCollection",features:[]},re=(i,t)=>{const e=i.getId(),{clickId:r,drawLayer:s,olMap:n,clickInteraction:o}=t,d=r===e,a=i.getGeometry();if(d){const u=s.getSource().getExtent();n.getView().fit(u,mt),o.highlightById([])}else{const u=a.getExtent();o.highlightById([e]),n.getView().fit(u,mt)}t.requestUpdate()},se="ul.list-wrap { padding: 0;}ul.list-wrap li:hover,ul.list-wrap li.selected { background: var(--secondary-bg-color-hover);}ul.list-wrap li { list-style: none; padding: 4px;}ul.list-wrap li { border-bottom: 1.2px solid var(--secondary-color);}ul.list-wrap li:first-child { border-top: 1.2px solid var(--secondary-color);}ul.list-wrap li .list { width: 100%; align-items: center; justify-content: space-between; display: flex; align-items: center; cursor: pointer; font-size: small; gap: 10px;}ul.list-wrap li .list span { display: flex; align-items: center; cursor: pointer; font-size: small; flex-grow: 1;}";class bt extends C{constructor(){super();E(this,"hoverInteraction");E(this,"clickInteraction");E(this,"hoverId");E(this,"clickId");this.eoxMap=null,this.olMap=null,this.draw=null,this.drawLayer=null,this.drawnFeatures=[],this.modify=null,this.unstyled=!1}_handleDelete(e){ie(e,this),this.dispatchEvent(new CustomEvent("changed",{bubbles:!0}))}_handleFeatureSelectAndDeselect(e){re(e,this)}_handleHoverFeature(e,r=!1){ee(this,e,r)}firstUpdated(){te(this)}createRenderRoot(){return this}render(){var e,r;return this.hoverId=(e=this.hoverInteraction)==null?void 0:e.selectedFids[0],this.clickId=(r=this.clickInteraction)==null?void 0:r.selectedFids[0],A`
31
+ */const Tt=Kt(class extends Qt{constructor(){super(...arguments),this.key=p}render(i,t){return this.key=i,t}update(i,[t,e]){return t!==this.key&&(Yt(i),this.key=t),e}}),te=i=>{i.hoverInteraction=i.eoxMap.selectInteractions.selectHover,i.clickInteraction=i.eoxMap.selectInteractions.selectClick;const t=()=>{i.requestUpdate()};i.hoverInteraction.selectStyleLayer.on("change",t),i.clickInteraction.selectStyleLayer.on("change",t)},ee=(i,t,e)=>{if(i.clickId===t)return;const r=e?[]:[t];i.hoverInteraction.highlightById(r)},ie=(i,t)=>{i.stopPropagation();const e=Number(i.target.getAttribute("index")),r=t.drawnFeatures[e];t.drawLayer.getSource().removeFeature(r),t.drawnFeatures.splice(e,1),t.requestUpdate()},mt={duration:750},vt={type:"FeatureCollection",features:[]},re=(i,t)=>{const e=i.getId(),{clickId:r,drawLayer:s,olMap:n,clickInteraction:o}=t,d=r===e,a=i.getGeometry();if(d){const u=s.getSource().getExtent();n.getView().fit(u,mt),o.highlightById([])}else{const u=a.getExtent();o.highlightById([e]),n.getView().fit(u,mt)}t.requestUpdate()},se="ul.list-wrap { padding: 0;}ul.list-wrap li:hover,ul.list-wrap li.selected { background: var(--secondary-bg-color-hover);}ul.list-wrap li { list-style: none; padding: 4px;}ul.list-wrap li { border-bottom: 1.2px solid var(--secondary-color);}ul.list-wrap li:first-child { border-top: 1.2px solid var(--secondary-color);}ul.list-wrap li .list { width: 100%; align-items: center; justify-content: space-between; display: flex; align-items: center; cursor: pointer; font-size: small; gap: 10px;}ul.list-wrap li .list span { display: flex; align-items: center; cursor: pointer; font-size: small; flex-grow: 1;}";class bt extends C{constructor(){super();E(this,"hoverInteraction");E(this,"clickInteraction");E(this,"hoverId");E(this,"clickId");this.eoxMap=null,this.olMap=null,this.draw=null,this.drawLayer=null,this.drawnFeatures=[],this.modify=null,this.unstyled=!1}_handleDelete(e){ie(e,this),this.dispatchEvent(new CustomEvent("changed",{bubbles:!0}))}_handleFeatureSelectAndDeselect(e){re(e,this)}_handleHoverFeature(e,r=!1){ee(this,e,r)}firstUpdated(){te(this)}createRenderRoot(){return this}render(){var e,r;return this.hoverId=(e=this.hoverInteraction)==null?void 0:e.selectedFids[0],this.clickId=(r=this.clickInteraction)==null?void 0:r.selectedFids[0],A`
32
32
  <style>
33
33
  ${!this.unstyled&&se}
34
34
  </style>
35
35
  <ul class="list-wrap">
36
- ${this.drawnFeatures.map((s,n)=>{const o=n+1,d=s.getId(),a=this.hoverId===d,u=this.clickId===d;return Yt(o,A`
36
+ ${this.drawnFeatures.map((s,n)=>{const o=n+1,d=s.getId(),a=this.hoverId===d,u=this.clickId===d;return Tt(o,A`
37
37
  <li
38
38
  class="${a||u?"selected":p}"
39
39
  @mouseover=${()=>this._handleHoverFeature(d)}
@@ -174,7 +174,7 @@
174
174
  color: white;
175
175
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ctitle%3Econtent-copy%3C/title%3E%3Cpath d='M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z' fill='white' /%3E%3C/svg%3E")
176
176
  }
177
- `,de=i=>{(()=>{i.emitDrawnFeatures(),i.multipleFeatures||(i.draw.setActive(!1),i.selectionEvents.removeSelectionEvent(),i.currentlyDrawing=!1)})(),i.requestUpdate()},he=i=>{const t=()=>{i.drawLayer.set("isDrawingEnabled",!0),i.draw.setActive(!0),i.selectionEvents.addSelectionEvent()},e=()=>{i.currentlyDrawing=!0,i.requestUpdate()};t(),e()},pe=i=>{let t;return typeof i=="string"?t=document.querySelector(i):t=i,t},_t=(i,t)=>{var n;const r=pe(i.for),s=r.map;return i.drawLayer=r.addOrUpdateLayer({type:"Vector",properties:{id:"drawLayer",layerControlHide:!0,isDrawingEnabled:!1,multipleFeatures:t},source:{type:"Vector"},interactions:[{type:"draw",options:{active:!1,id:"drawInteraction",type:i.type,modify:i.allowModify,stopClick:!0}},{type:"select",options:{id:"selectHover",condition:"pointermove",style:{"fill-color":"rgba(51, 153, 204,0.5)","stroke-color":"#3399CC","stroke-width":2.5}}},{type:"select",options:{id:"selectClick",condition:"click",panIn:!0,style:{"fill-color":"rgba(51, 153, 204,0.5)","stroke-color":"#3399CC","stroke-width":2.5}}}]}),i.draw=r.interactions.drawInteraction,i.modify=r.interactions.drawInteractionmodify,et(i,r,i.layerId),(n=i.modify)==null||n.on("modifyend",()=>i.onModifyEnd()),r.addEventListener("addfeatures",()=>de(i)),{EoxMap:r,OlMap:s}},ue=i=>{const t=()=>{i.drawnFeatures=[],setTimeout(()=>{i.draw.setActive(!1),i.selectionEvents.removeSelectionEvent()},200),i.drawLayer.getSource().clear(),i.geoJSON=null},e=()=>{i.emitDrawnFeatures(),i.currentlyDrawing=!1,i.requestUpdate()};t(),e()},ye=(i,t)=>{setTimeout(()=>{i.drawnFeatures=i.drawLayer.getSource().getFeatures(),i.updateGeoJSON(),i.requestUpdate(),t()},0)},fe=i=>{const t=s=>{(s==null?void 0:s.detail.id)!=="SelectLayerClickInteraction"||!s.detail.feature||(i.drawLayer.getSource().addFeature(s.detail.feature),i.eoxMap.dispatchEvent(new CustomEvent("addfeatures",{detail:s.detail})))};return{addSelectionEvent:()=>{i.layerId&&(i.eoxMap.selectInteractions.SelectLayerHoverInteraction.setActive(!0),i.eoxMap.addEventListener("select",t))},removeSelectionEvent:()=>{var n;const s=(n=i.eoxMap.selectInteractions)==null?void 0:n.SelectLayerHoverInteraction;s&&(s.selectedFids=[],s.setActive(!1)),i.eoxMap.removeEventListener("select",t)}}},et=(i,t,e)=>{if(!e||!t)return;const r=JSON.parse(JSON.stringify(t.getLayerById(e).get("_jsonDefinition")))||null;if(!r){console.error(`Layer with id ${e} not found`);return}const s={type:"select",active:!1,options:{id:"SelectLayerHoverInteraction",condition:"pointermove",active:!1,style:{"fill-color":"rgba(0, 0, 0,0.0)","stroke-color":"#3399CC","stroke-width":2.5}}},n={type:"select",options:{id:"SelectLayerClickInteraction",condition:"click",multi:i.multipleFeatures,modify:i.allowModify,active:!1,style:{"fill-color":"rgba(0, 0, 0,0.0)","stroke-color":"rgba(0, 0, 0,0.0)"}}};r.interactions=[s,n],t.addOrUpdateLayer(r);const o=i.draw;i.draw=t.selectInteractions.SelectLayerClickInteraction,setTimeout(()=>{o.setActive(!1),t.selectInteractions.SelectLayerClickInteraction.setActive(!1),t.selectInteractions.SelectLayerHoverInteraction.setActive(!1)},200)},ge=(i,t,e,r)=>{if(t){if(e){r&&e!==r&&xt(i,t),et(i,t,e);return}if(!e&&r){xt(i,t);return}}};function xt(i,t){t&&(i.discardDrawing(),i.selectionEvents.removeSelectionEvent(),i.draw=t.interactions.drawInteraction,t.selectInteractions.SelectLayerClickInteraction.remove(),t.selectInteractions.SelectLayerHoverInteraction.remove())}const me=':root,:host { --spacing: 1rem; --block-spacing-vertical: calc(var(--spacing) * 2); --block-spacing-horizontal: var(--spacing); --background-color: var(--eox-background-color, white); --color: var(--eox-color, #2c3d49); --h-color: var(--eox-h-color, var(--color)); --hover-transparency: var(--eox-hover-transparency, 20%); --bg-hover-transparency: var(--eox-bg-hover-transparency, 40%); --btn-hover-transparency: var(--eox-btn-hover-transparency, 80%); --primary-color: var(--eox-primary-color, #004170); --primary-color-hover: color-mix( in srgb, var(--primary-color) var(--hover-transparency), transparent ); --primary-bg-color-hover: color-mix( in srgb, var(--primary-color) var(--bg-hover-transparency), transparent ); --primary-btn-color-hover: color-mix( in srgb, var(--primary-color) var(--btn-hover-transparency), transparent ); --secondary-color: var(--eox-secondary-color, #c6d4df); --secondary-color-hover: color-mix( in srgb, var(--secondary-color) var(--hover-transparency), transparent ); --secondary-bg-color-hover: color-mix( in srgb, var(--secondary-color) var(--bg-hover-transparency), transparent ); --secondary-btn-color-hover: color-mix( in srgb, var(--secondary-color) var(--btn-hover-transparency), transparent ); --success: var(--eox-success, #26cc0f); --warning: var(--eox-warning, #f18e32); --error: var(--eox-error, #ff5252); --header-font-family: var(--eox-header-font-family, "Roboto", sans-serif); --body-font-family: var(--eox-body-font-family, "Roboto", sans-serif);}* { font-size: normal; font-family: var(--body-font-family); color: var(--eox-color);}h1,h2,h3,h4,h5,h6 { font-family: var(--header-font-family);}span,p,div,main,label { font-family: var(--body-font-family);}@media (min-width: 576px) { .container { max-width: 510px; padding-right: 0; padding-left: 0; --block-spacing-vertical: calc(var(--spacing) * 2.5); }}@media (min-width: 768px) { .container { max-width: 700px; --block-spacing-vertical: calc(var(--spacing) * 3); }}@media (min-width: 992px) { .container { max-width: 920px; --block-spacing-vertical: calc(var(--spacing) * 3.5); }}@media (min-width: 1200px) { .container { max-width: 1130px; --block-spacing-vertical: calc(var(--spacing) * 4); }}.container { width: 100%; margin-right: auto; margin-left: auto; display: block; padding: var(--block-spacing-vertical) var(--block-spacing-horizontal);}h1,h2,h3 { line-height: 120%; margin-top: 0.8rem; margin-bottom: 0.8rem;}p { --font-size: 1rem; font-weight: 400; line-height: 170%; margin-top: 0.8rem; margin-bottom: 1.6rem; font-size: var(--font-size);}body { padding: 0; margin: 0;}.sb-show-main.sb-main-padded { padding: 0;}h1,h2,h3,h4,h5,h6 { --font-weight: 700;}h1 { --font-size: 3rem; --typography-spacing-vertical: 0.5rem;}h2 { --font-size: 2rem; --typography-spacing-vertical: 0.5rem;}h3 { --font-size: 1.75rem; --typography-spacing-vertical: 0.5rem;}h4 { --font-size: 1.5rem; --typography-spacing-vertical: 0.5rem;}h5 { --font-size: 1.25rem; --typography-spacing-vertical: 0.5rem;}h1,h2,h3,h4,h5,h6 { margin-top: 0; margin-bottom: var(--typography-spacing-vertical); color: var(--h-color); font-weight: var(--font-weight); font-size: var(--font-size); font-family: var(--header-font-family);}';function ve(i,t){function e(n){n.preventDefault(),n.stopPropagation()}function r(n){n.srcElement.style.opacity="0.4"}function s(n){n.srcElement.style.opacity="1"}["dragenter","dragover","dragleave","drop"].forEach(n=>{t.addEventListener(n,e,!1),["dragenter","dragover"].includes(n)?t.addEventListener(n,r,!1):t.addEventListener(n,s,!1)}),t.addEventListener("drop",n=>At(n,i),!1)}function be(i){i.preventDefault(),i.stopPropagation()}function At(i,t){be(i);const e=i.dataTransfer?i.dataTransfer.files:i.target.files;Array.from(e).forEach(r=>$e(r,t))}function $e(i,t){const e=new FileReader;e.readAsText(i),e.onloadend=function(){typeof e.result=="string"&&t.handleFeatureChange(e.result)}}class St extends C{constructor(){super();H(this,I);H(this,L);H(this,D);H(this,U);this.allowModify=!1,this.for="eox-map",this.currentlyDrawing=!1,this.draw=null,this.drawLayer=null,this.layerId="",this.drawnFeatures=[],this.modify=null,this.multipleFeatures=!1,this.importFeatures=!1,this.showEditor=!1,this.showList=!1,this.type="Polygon",this.unstyled=!1,this.noShadow=!1,this.selectionEvents=null}static get properties(){return{allowModify:{attribute:"allow-modify",type:Boolean},for:{type:String},currentlyDrawing:{attribute:!1,state:!0,type:Boolean},draw:{attribute:!1,state:!0},drawLayer:{attribute:!1,state:!0},layerId:{attribute:"layer-id",type:String},drawnFeatures:{attribute:!1,state:!0,type:Array},modify:{attribute:!1,state:!0},multipleFeatures:{attribute:"multiple-features",type:Boolean},importFeatures:{attribute:"import-features",type:Boolean},showEditor:{attribute:"show-editor",type:Boolean},showList:{attribute:"show-list",type:Boolean},noShadow:{type:Boolean},type:{type:String},unstyled:{type:Boolean}}}set layerId(e){ge(this,this.eoxMap,e,m(this,U)),w(this,U,e)}get layerId(){return m(this,U)}startDrawing(){he(this)}discardDrawing(){ue(this)}handleFeatureChange(e,r=!1){this.eoxMap.parseTextToFeature(e||JSON.stringify(vt),this.drawLayer,this.eoxMap,r)}handleFilesChange(e){At(e,this)}onModifyEnd(){this.emitDrawnFeatures()}updateGeoJSON(){w(this,D,JSON.stringify(this.eoxMap.parseFeature(this.drawnFeatures)||vt,void 0,2))}emitDrawnFeatures(){ye(this,()=>{this.dispatchEvent(new CustomEvent("drawupdate",{detail:this.drawnFeatures}))})}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}firstUpdated(){const{EoxMap:e,OlMap:r}=_t(this,this.multipleFeatures);this.eoxMap=e,w(this,L,r),this.selectionEvents=fe(this),this.importFeatures&&ve(this,this.eoxMap),this.updateGeoJSON(),this.requestUpdate()}updated(e){if(e.has("for")){const{EoxMap:r,OlMap:s}=_t(this,this.multipleFeatures);this.eoxMap=r,w(this,L,s)}}get eoxMap(){return m(this,I)}set eoxMap(e){const r=m(this,I);w(this,I,e),this.requestUpdate("eoxMap",r)}render(){var e;return A`
177
+ `,de=i=>{(()=>{i.emitDrawnFeatures(),i.multipleFeatures||(i.draw.setActive(!1),i.selectionEvents.removeSelectionEvent(),i.currentlyDrawing=!1)})(),i.requestUpdate()},he=i=>{const t=()=>{i.drawLayer.set("isDrawingEnabled",!0),i.draw.setActive(!0),i.selectionEvents.addSelectionEvent()},e=()=>{i.currentlyDrawing=!0,i.requestUpdate()};t(),e()},pe=i=>{let t;return typeof i=="string"?t=document.querySelector(i):t=i,t},_t=(i,t)=>{var n;const r=pe(i.for),s=r.map;return i.drawLayer=r.addOrUpdateLayer({type:"Vector",properties:{id:"drawLayer",layerControlHide:!0,isDrawingEnabled:!1,multipleFeatures:t},source:{type:"Vector"},interactions:[{type:"draw",options:{active:!1,id:"drawInteraction",type:i.type,modify:i.allowModify,stopClick:!0}},{type:"select",options:{id:"selectHover",condition:"pointermove",style:{"fill-color":"rgba(51, 153, 204,0.5)","stroke-color":"#3399CC","stroke-width":2.5}}},{type:"select",options:{id:"selectClick",condition:"click",panIn:!0,style:{"fill-color":"rgba(51, 153, 204,0.5)","stroke-color":"#3399CC","stroke-width":2.5}}}]}),i.draw=r.interactions.drawInteraction,i.modify=r.interactions.drawInteractionmodify,et(i,r,i.layerId),(n=i.modify)==null||n.on("modifyend",()=>i.onModifyEnd()),r.addEventListener("addfeatures",()=>de(i)),{EoxMap:r,OlMap:s}},ue=i=>{const t=()=>{i.drawnFeatures=[],i.draw.setActive(!1),i.selectionEvents.removeSelectionEvent(),i.drawLayer.getSource().clear(),i.geoJSON=null},e=()=>{i.emitDrawnFeatures(),i.currentlyDrawing=!1,i.requestUpdate()};t(),e()},ye=(i,t)=>{setTimeout(()=>{i.drawnFeatures=i.drawLayer.getSource().getFeatures(),i.updateGeoJSON(),i.requestUpdate(),t()},0)},fe=i=>{const t=s=>{(s==null?void 0:s.detail.id)!=="SelectLayerClickInteraction"||!s.detail.feature||(i.drawLayer.getSource().addFeature(s.detail.feature),i.eoxMap.dispatchEvent(new CustomEvent("addfeatures",{detail:s.detail})))};return{addSelectionEvent:()=>{i.layerId&&(i.eoxMap.selectInteractions.SelectLayerHoverInteraction.setActive(!0),i.eoxMap.addEventListener("select",t))},removeSelectionEvent:()=>{var n;const s=(n=i.eoxMap.selectInteractions)==null?void 0:n.SelectLayerHoverInteraction;s&&(s.selectedFids=[],s.setActive(!1)),i.eoxMap.removeEventListener("select",t)}}},et=(i,t,e)=>{if(!e||!t)return;const r=JSON.parse(JSON.stringify(t.getLayerById(e).get("_jsonDefinition")))||null;if(!r){console.error(`Layer with id ${e} not found`);return}const s={type:"select",active:!1,options:{id:"SelectLayerHoverInteraction",condition:"pointermove",active:!1,style:{"fill-color":"rgba(0, 0, 0,0.0)","stroke-color":"#3399CC","stroke-width":2.5}}},n={type:"select",options:{id:"SelectLayerClickInteraction",condition:"click",multi:i.multipleFeatures,modify:i.allowModify,active:!1,style:{"fill-color":"rgba(0, 0, 0,0.0)","stroke-color":"rgba(0, 0, 0,0.0)"}}};r.interactions=[s,n],t.addOrUpdateLayer(r);const o=i.draw;i.draw=t.selectInteractions.SelectLayerClickInteraction,o.setActive(!1),t.selectInteractions.SelectLayerClickInteraction.setActive(!1),t.selectInteractions.SelectLayerHoverInteraction.setActive(!1)},ge=(i,t,e,r)=>{if(t){if(e){r&&e!==r&&xt(i,t),et(i,t,e);return}if(!e&&r){xt(i,t);return}}};function xt(i,t){t&&(i.discardDrawing(),i.selectionEvents.removeSelectionEvent(),i.draw=t.interactions.drawInteraction,t.selectInteractions.SelectLayerClickInteraction.remove(),t.selectInteractions.SelectLayerHoverInteraction.remove())}const me=':root,:host { --spacing: 1rem; --block-spacing-vertical: calc(var(--spacing) * 2); --block-spacing-horizontal: var(--spacing); --background-color: var(--eox-background-color, white); --color: var(--eox-color, #2c3d49); --h-color: var(--eox-h-color, var(--color)); --hover-transparency: var(--eox-hover-transparency, 20%); --bg-hover-transparency: var(--eox-bg-hover-transparency, 40%); --btn-hover-transparency: var(--eox-btn-hover-transparency, 80%); --primary-color: var(--eox-primary-color, #004170); --primary-color-hover: color-mix( in srgb, var(--primary-color) var(--hover-transparency), transparent ); --primary-bg-color-hover: color-mix( in srgb, var(--primary-color) var(--bg-hover-transparency), transparent ); --primary-btn-color-hover: color-mix( in srgb, var(--primary-color) var(--btn-hover-transparency), transparent ); --secondary-color: var(--eox-secondary-color, #c6d4df); --secondary-color-hover: color-mix( in srgb, var(--secondary-color) var(--hover-transparency), transparent ); --secondary-bg-color-hover: color-mix( in srgb, var(--secondary-color) var(--bg-hover-transparency), transparent ); --secondary-btn-color-hover: color-mix( in srgb, var(--secondary-color) var(--btn-hover-transparency), transparent ); --success: var(--eox-success, #26cc0f); --warning: var(--eox-warning, #f18e32); --error: var(--eox-error, #ff5252); --header-font-family: var(--eox-header-font-family, "Roboto", sans-serif); --body-font-family: var(--eox-body-font-family, "Roboto", sans-serif);}* { font-size: normal; font-family: var(--body-font-family); color: var(--eox-color);}h1,h2,h3,h4,h5,h6 { font-family: var(--header-font-family);}span,p,div,main,label { font-family: var(--body-font-family);}@media (min-width: 576px) { .container { max-width: 510px; padding-right: 0; padding-left: 0; --block-spacing-vertical: calc(var(--spacing) * 2.5); }}@media (min-width: 768px) { .container { max-width: 700px; --block-spacing-vertical: calc(var(--spacing) * 3); }}@media (min-width: 992px) { .container { max-width: 920px; --block-spacing-vertical: calc(var(--spacing) * 3.5); }}@media (min-width: 1200px) { .container { max-width: 1130px; --block-spacing-vertical: calc(var(--spacing) * 4); }}.container { width: 100%; margin-right: auto; margin-left: auto; display: block; padding: var(--block-spacing-vertical) var(--block-spacing-horizontal);}h1,h2,h3 { line-height: 120%; margin-top: 0.8rem; margin-bottom: 0.8rem;}p { --font-size: 1rem; font-weight: 400; line-height: 170%; margin-top: 0.8rem; margin-bottom: 1.6rem; font-size: var(--font-size);}body { padding: 0; margin: 0;}.sb-show-main.sb-main-padded { padding: 0;}h1,h2,h3,h4,h5,h6 { --font-weight: 700;}h1 { --font-size: 3rem; --typography-spacing-vertical: 0.5rem;}h2 { --font-size: 2rem; --typography-spacing-vertical: 0.5rem;}h3 { --font-size: 1.75rem; --typography-spacing-vertical: 0.5rem;}h4 { --font-size: 1.5rem; --typography-spacing-vertical: 0.5rem;}h5 { --font-size: 1.25rem; --typography-spacing-vertical: 0.5rem;}h1,h2,h3,h4,h5,h6 { margin-top: 0; margin-bottom: var(--typography-spacing-vertical); color: var(--h-color); font-weight: var(--font-weight); font-size: var(--font-size); font-family: var(--header-font-family);}';function ve(i,t){function e(n){n.preventDefault(),n.stopPropagation()}function r(n){n.srcElement.style.opacity="0.4"}function s(n){n.srcElement.style.opacity="1"}["dragenter","dragover","dragleave","drop"].forEach(n=>{t.addEventListener(n,e,!1),["dragenter","dragover"].includes(n)?t.addEventListener(n,r,!1):t.addEventListener(n,s,!1)}),t.addEventListener("drop",n=>At(n,i),!1)}function be(i){i.preventDefault(),i.stopPropagation()}function At(i,t){be(i);const e=i.dataTransfer?i.dataTransfer.files:i.target.files;Array.from(e).forEach(r=>$e(r,t))}function $e(i,t){const e=new FileReader;e.readAsText(i),e.onloadend=function(){typeof e.result=="string"&&t.handleFeatureChange(e.result)}}class St extends C{constructor(){super();H(this,I);H(this,L);H(this,D);H(this,U);this.allowModify=!1,this.for="eox-map",this.currentlyDrawing=!1,this.draw=null,this.drawLayer=null,this.layerId="",this.drawnFeatures=[],this.modify=null,this.multipleFeatures=!1,this.importFeatures=!1,this.showEditor=!1,this.showList=!1,this.type="Polygon",this.unstyled=!1,this.noShadow=!1,this.selectionEvents=null}static get properties(){return{allowModify:{attribute:"allow-modify",type:Boolean},for:{type:String},currentlyDrawing:{attribute:!1,state:!0,type:Boolean},draw:{attribute:!1,state:!0},drawLayer:{attribute:!1,state:!0},layerId:{attribute:"layer-id",type:String},drawnFeatures:{attribute:!1,state:!0,type:Array},modify:{attribute:!1,state:!0},multipleFeatures:{attribute:"multiple-features",type:Boolean},importFeatures:{attribute:"import-features",type:Boolean},showEditor:{attribute:"show-editor",type:Boolean},showList:{attribute:"show-list",type:Boolean},noShadow:{type:Boolean},type:{type:String},unstyled:{type:Boolean}}}set layerId(e){ge(this,this.eoxMap,e,m(this,U)),w(this,U,e)}get layerId(){return m(this,U)}startDrawing(){he(this)}discardDrawing(){ue(this)}handleFeatureChange(e,r=!1){this.eoxMap.parseTextToFeature(e||JSON.stringify(vt),this.drawLayer,this.eoxMap,r)}handleFilesChange(e){At(e,this)}onModifyEnd(){this.emitDrawnFeatures()}updateGeoJSON(){w(this,D,JSON.stringify(this.eoxMap.parseFeature(this.drawnFeatures)||vt,void 0,2))}emitDrawnFeatures(){ye(this,()=>{this.dispatchEvent(new CustomEvent("drawupdate",{detail:this.drawnFeatures}))})}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}firstUpdated(){const{EoxMap:e,OlMap:r}=_t(this,this.multipleFeatures);this.eoxMap=e,w(this,L,r),this.selectionEvents=fe(this),this.importFeatures&&ve(this,this.eoxMap),this.updateGeoJSON(),this.requestUpdate()}updated(e){if(e.has("for")){const{EoxMap:r,OlMap:s}=_t(this,this.multipleFeatures);this.eoxMap=r,w(this,L,s)}}get eoxMap(){return m(this,I)}set eoxMap(e){const r=m(this,I);w(this,I,e),this.requestUpdate("eoxMap",r)}render(){var e;return A`
178
178
  <style>
179
179
  :host { display: block; }
180
180
  ${!this.unstyled&&me}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eox/drawtools",
3
- "version": "0.11.0",
3
+ "version": "0.11.1-dev.1730197611.0",
4
4
  "type": "module",
5
5
  "devDependencies": {
6
6
  "ol": "^10.0.0",
@@ -9,10 +9,8 @@ const discardDrawingMethod = (EoxDrawTool) => {
9
9
  const discardDrawingActions = () => {
10
10
  // Reset drawnFeatures, deactivate drawing, and clear drawLayer's source
11
11
  EoxDrawTool.drawnFeatures = [];
12
- setTimeout(() => {
13
- EoxDrawTool.draw.setActive(false);
14
- EoxDrawTool.selectionEvents.removeSelectionEvent();
15
- }, 200);
12
+ EoxDrawTool.draw.setActive(false);
13
+ EoxDrawTool.selectionEvents.removeSelectionEvent();
16
14
  EoxDrawTool.drawLayer.getSource().clear();
17
15
  //@ts-expect-error TODO
18
16
  EoxDrawTool.geoJSON = null;
@@ -63,11 +63,9 @@ const initSelection = (EoxDrawTool, EoxMap, updatedLayerId) => {
63
63
  const oldDrawInteraction = EoxDrawTool.draw;
64
64
  EoxDrawTool.draw = EoxMap.selectInteractions["SelectLayerClickInteraction"];
65
65
 
66
- setTimeout(() => {
67
- oldDrawInteraction.setActive(false);
68
- EoxMap.selectInteractions["SelectLayerClickInteraction"].setActive(false);
69
- EoxMap.selectInteractions["SelectLayerHoverInteraction"].setActive(false);
70
- }, 200);
66
+ oldDrawInteraction.setActive(false);
67
+ EoxMap.selectInteractions["SelectLayerClickInteraction"].setActive(false);
68
+ EoxMap.selectInteractions["SelectLayerHoverInteraction"].setActive(false);
71
69
  };
72
70
 
73
71
  export default initSelection;