var Xn=Object.defineProperty;var Gn=(t,e,n)=>e in t?Xn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var b=(t,e,n)=>(Gn(t,typeof e!="symbol"?e+"":e,n),n);import{_ as Yn}from"./preload-helper-33d3da02.js";import{v as ve,o as C,a as A,b as I,F as nn,f as rn,l as Un,t as z,g as O,k as S,e as Zn,h as ht,j as Kn,p as Wn,c as Y,x as U,n as Z,K as H,q as Qn,u as Jn}from"./_plugin-vue_export-helper-55d324a8.js";import{c as jn,u as tr}from"./vue-i18n-da413f07.js";import{I as J}from"./index-c366cf98.js";import{D as er,I as nr}from"./Icon-0b02bdc4.js";import{g as rr}from"./ndspatterns/flatpickr/flatpickr-module-78a47ccc.js";import"./settings-11fb010d.js";import"./customSettings-86a66a83.js";import"./helpers-080cca41.js";function ir(){const t=document.getElementById("js-custom-map-icons");return t?JSON.parse(t.textContent):!1}const D={defaultCenter:[10.4541194,51.1758057],defaultStyle:"https://omt-cdn.ecmaps.de/api/maps/bright/style.json",defaultWinterStyle:"https://api.maptiler.com/maps/winter/style.json?key=HGbT8c4ig4QG0RucJkjp",defaultZoom:9,defaultMaxZoom:18,clusterRadius:50,clusterMaxZoom:14,localIdeographFontFamily:!1,getPin:function(t,e,n){return Object.prototype.hasOwnProperty.call(this.customMapPins,t)?this.customMapPins[t].replace("FGCOLOR",n).replace("BGCOLOR",e):this.mapPins.icons[t]?this.mapPins.icons[t](e,n):""},customMapPins:ir(),mapPins:{types:["article","city","convention","event","gastro","hotel","package","poi","tour","webcam","pages","storytelling","skiresort","lift","sledge","sledge-20","sledge-40","sledge-60","sledge-80","sledge-100","slope","slope-20","slope-40","slope-60","slope-80","slope-100","trail","trail-20","trail-40","trail-60","trail-80","trail-100","hiking","hiking-20","hiking-40","hiking-60","hiking-80","hiking-100"],polyline:["polylineStart","polylineEnd"],size:32,sizeLarge:48,icons:{polylineStart:function(t,e){return`<svg  viewBox="0 0 96 96" xmlns="http://www.w3.org/2000/svg"><path fill="${t}" d="m44.4 93.1c-26.7-38.7-31.6-42.6-31.6-56.9 0-19.4 15.7-35.2 35.2-35.2s35.2 15.8 35.2 35.2c0 14.2-5 18.2-31.6 56.9-1.7 2.5-5.5 2.5-7.2 0z"/><svg viewBox="0 0 96 96" xmlns="http://www.w3.org/2000/svg" width="40" x="29" y="-12"><path fill="${e}" d="m85.9 13.3c3.9-1.8 8.4 1 8.4 5.3v44.6c0 1.9-.9 3.7-2.5 4.8-6.6 4.5-13.6 7.5-22.5 7.5-12.4 0-20.5-6.4-30.3-6.4-9.3 0-15.8 1.8-21 4.1v17.3c0 2.4-2 4.4-4.4 4.4h-2.9c-2.4 0-4.4-2-4.4-4.4v-70.8c-2.7-1.9-4.4-4.9-4.4-8.4-.2-5.8 4.7-10.5 10.5-10.3 5.2.2 9.5 4.4 9.8 9.6.1 1.5-.1 2.9-.7 4.3 3.8-1.4 7.9-2.2 12.5-2.2 12.4 0 20.5 6.4 30.3 6.4 7.6 0 15.3-2.9 21.6-5.8z"/></svg></svg>`},polylineEnd:function(t,e){return`<svg viewBox="0 0 96 96" xmlns="http://www.w3.org/2000/svg"><path fill="${t}" d="m44.4 93.1c-26.7-38.7-31.6-42.6-31.6-56.9 0-19.4 15.7-35.2 35.2-35.2s35.2 15.8 35.2 35.2c0 14.2-5 18.2-31.6 56.9-1.7 2.5-5.5 2.5-7.2 0z"/><svg viewBox="0 0 96 96" xmlns="http://www.w3.org/2000/svg" width="40" x="29" y="-12"><path fill="${e}" d="m48 1c-26 0-47 21-47 47s21 47 47 47 47-21 47-47-21-47-47-47zm0 81.9c-19.3 0-34.9-15.6-34.9-34.9s15.6-34.9 34.9-34.9 34.9 15.6 34.9 34.9-15.6 34.9-34.9 34.9zm0-59.2c-13.4 0-24.3 10.9-24.3 24.3s10.9 24.3 24.3 24.3 24.3-10.9 24.3-24.3-10.9-24.3-24.3-24.3zm0 36.4c-6.7 0-12.1-5.4-12.1-12.1s5.4-12.1 12.1-12.1 12.1 5.4 12.1 12.1-5.4 12.1-12.1 12.1z"/></svg></svg>`}}}};class ar{constructor(e,n,r={},i={}){b(this,"map");b(this,"id");b(this,"sourceId");b(this,"layerId");b(this,"data",{type:"FeatureCollection",features:[]});b(this,"cluster",!0);b(this,"fitBounds",!1);b(this,"options");this.map=e,this.id=n,this.options=i,this.data=r||this.data,this.sourceId=`${n}-cluster-source`,this.layerId=`${n}-cluster-layer`,this.cluster="cluster"in i?i.cluster:this.cluster,this.fitBounds="fitBounds"in i?i.fitBounds:this.fitBounds,this.pinColors={mapMarkerBgColor:getComputedStyle(document.documentElement).getPropertyValue("--map-marker-color"),mapMarkerBgColorActive:getComputedStyle(document.documentElement).getPropertyValue("--map-marker-color-active"),mapMarkerFgColor:getComputedStyle(document.documentElement).getPropertyValue("--map-marker-icon-color"),mapMarkerFgColorActive:getComputedStyle(document.documentElement).getPropertyValue("--map-marker-icon-color-active"),mapClusterFgColor:getComputedStyle(document.documentElement).getPropertyValue("--map-cluster-text-color"),mapClusterBgColor:getComputedStyle(document.documentElement).getPropertyValue("--map-cluster-bg-color"),mapClusterBgColorActive:getComputedStyle(document.documentElement).getPropertyValue("--map-cluster-bg-color-active")}}addToMap(){const{instance:e}=this.map;this._addMapPins(e),this._addSourceToMap(e),this._addClusterLayerToMap(e)}updateData(e){this.data=e;const n=this.map.instance.getSource(this.sourceId);n&&n.setData(e)}_addMapPins(e){[{key:"types",size:D.mapPins.size},{key:"polyline",size:D.mapPins.sizeLarge}].forEach(n=>{D.mapPins[n.key].forEach(r=>{if(!e.hasImage(r)){const i=new Image(n.size,n.size);i.onload=()=>e.addImage(r,i),i.src="data:image/svg+xml;base64,"+btoa(D.getPin(r,this.pinColors.mapMarkerBgColor,this.pinColors.mapMarkerFgColor))}if(!e.hasImage(r+"-hover")){const i=new Image(n.size,n.size);i.onload=()=>e.addImage(r+"-hover",i),i.src="data:image/svg+xml;base64,"+btoa(D.getPin(r,this.pinColors.mapMarkerBgColorActive,this.pinColors.mapMarkerFgColorActive))}})})}_addSourceToMap(e){e.getSource(this.sourceId)||(e.addSource(this.sourceId,{type:"geojson",data:this.data,generateId:!0,cluster:this.cluster,clusterMaxZoom:D.clusterMaxZoom,clusterRadius:D.clusterRadius}),e.addSource(`${this.sourceId}-lines`,{type:"geojson",data:this.data}))}_addClusterLayerToMap(e){e.getLayer(this.layerId)&&e.removeLayer(this.layerId),this.cluster&&(e.addLayer({id:"route",type:"line",source:`${this.sourceId}-lines`,layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"#000","line-width":2},filter:["==","$type","LineString"]}),e.addLayer({id:this.layerId,type:"circle",source:this.sourceId,filter:["has","point_count"],paint:{"circle-color":["case",["boolean",["feature-state","hover"],!1],this.pinColors.mapClusterBgColorActive,this.pinColors.mapClusterBgColor],"circle-radius":20}}),e.addLayer({id:this.layerId+"-count",type:"symbol",source:this.sourceId,filter:["has","point_count"],layout:{"text-field":"{point_count_abbreviated}","text-size":12,"text-ignore-placement":!0,"text-allow-overlap":!0},paint:{"text-color":this.pinColors.mapClusterFgColor}}),e.on("mouseenter",this.layerId,()=>{e.getCanvas().style.cursor="pointer"}),e.on("mouseleave",this.layerId,()=>{e.getCanvas().style.cursor=""}),e.on("click",this.layerId,s=>{const u=e.queryRenderedFeatures(s.point,{layers:[this.layerId]}),l=u[0].properties.cluster_id;e.getSource(this.sourceId).getClusterExpansionZoom(l,(f,c)=>{f||e.easeTo({center:u[0].geometry.coordinates,zoom:c})})}));let n=null;const r={id:this.layerId+"-markers",type:"symbol",source:this.sourceId,filter:["!",["has","point_count"]],layout:{"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-allow-overlap":!0,"text-ignore-placement":!0,"icon-image":["get","icon"],"icon-anchor":"bottom"}};e.addLayer(r),e.on("click",this.layerId+"-markers",s=>{n===s.features[0].id?(n=null,e.setLayoutProperty(this.layerId+"-markers","icon-image",["get","icon"])):(n=s.features[0].id,e.setLayoutProperty(this.layerId+"-markers","icon-image",["match",["id"],s.features[0].id,["get","icon-hover"],["get","icon"]])),this.map.container.dispatchEvent(new CustomEvent("marker-click",{detail:{id:s.features[0].properties.id}}))});let i=null;e.on("mouseenter",this.layerId+"-markers",s=>{e.getCanvas().style.cursor="pointer",i=s.features[0].id,e.setLayoutProperty(this.layerId+"-markers","icon-image",["match",["id"],s.features[0].id,["get","icon-hover"],["get","icon"]])}),e.on("mouseleave",this.layerId+"-markers",()=>{e.getCanvas().style.cursor="",i!==null&&i!==n&&(i=null,n!==null?e.setLayoutProperty(this.layerId+"-markers","icon-image",["match",["id"],n,["get","icon-hover"],["get","icon"]]):e.setLayoutProperty(this.layerId+"-markers","icon-image",["get","icon"]))});let a=null;const o=[this.layerId,this.layerId+"-markers"];this.cluster&&o.push(this.layerId+"-count"),o.forEach(s=>{e.on("mousemove",s,l=>{l.features.length>0&&(a&&e.setFeatureState({source:this.sourceId,id:a},{hover:!1}),a=l.features[0].id,e.setFeatureState({source:this.sourceId,id:a},{hover:!0}))}),e.on("mouseleave",this.layerId,()=>{a&&e.setFeatureState({source:this.sourceId,id:a},{hover:!1}),a=null});function u(l,f){return e.querySourceFeatures(l,{filter:["==","id",f]})[0]}window.addEventListener("toggle-marker-hover",l=>{const f=u(this.sourceId,l.detail.markerId);if(!f)return;const c=l.detail.state==="active"?["match",["id"],f.id,["get","icon-hover"],["get","icon"]]:["get","icon"];e.setLayoutProperty(this.layerId+"-markers","icon-image",c)})})}}function zt(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function or(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function an(t){let e,n,r;t.length!==2?(e=zt,n=(s,u)=>zt(t(s),u),r=(s,u)=>t(s)-u):(e=t===zt||t===or?t:sr,n=t,r=t);function i(s,u,l=0,f=s.length){if(l<f){if(e(u,u)!==0)return f;do{const c=l+f>>>1;n(s[c],u)<0?l=c+1:f=c}while(l<f)}return l}function a(s,u,l=0,f=s.length){if(l<f){if(e(u,u)!==0)return f;do{const c=l+f>>>1;n(s[c],u)<=0?l=c+1:f=c}while(l<f)}return l}function o(s,u,l=0,f=s.length){const c=i(s,u,l,f-1);return c>l&&r(s[c-1],u)>-r(s[c],u)?c-1:c}return{left:i,center:o,right:a}}function sr(){return 0}function lr(t){return t===null?NaN:+t}const ur=an(zt),cr=ur.right;an(lr).center;const fr=cr,hr=Math.sqrt(50),dr=Math.sqrt(10),pr=Math.sqrt(2);function qt(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=hr?10:a>=dr?5:a>=pr?2:1;let s,u,l;return i<0?(l=Math.pow(10,-i)/o,s=Math.round(t*l),u=Math.round(e*l),s/l<t&&++s,u/l>e&&--u,l=-l):(l=Math.pow(10,i)*o,s=Math.round(t/l),u=Math.round(e/l),s*l<t&&++s,u*l>e&&--u),u<s&&.5<=n&&n<2?qt(t,e,n*2):[s,u,l]}function mr(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,a,o]=r?qt(e,t,n):qt(t,e,n);if(!(a>=i))return[];const s=a-i+1,u=new Array(s);if(r)if(o<0)for(let l=0;l<s;++l)u[l]=(a-l)/-o;else for(let l=0;l<s;++l)u[l]=(a-l)*o;else if(o<0)for(let l=0;l<s;++l)u[l]=(i+l)/-o;else for(let l=0;l<s;++l)u[l]=(i+l)*o;return u}function ae(t,e,n){return e=+e,t=+t,n=+n,qt(t,e,n)[2]}function gr(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?ae(e,t,n):ae(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function Se(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function Ie(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function yr(t){return t}var te=1,ee=2,oe=3,kt=4,Ae=1e-6;function vr(t){return"translate("+t+",0)"}function _r(t){return"translate(0,"+t+")"}function wr(t){return e=>+t(e)}function xr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function br(){return!this.__axis}function on(t,e){var n=[],r=null,i=null,a=6,o=6,s=3,u=typeof window<"u"&&window.devicePixelRatio>1?0:.5,l=t===te||t===kt?-1:1,f=t===kt||t===ee?"x":"y",c=t===te||t===oe?vr:_r;function h(d){var m=r??(e.ticks?e.ticks.apply(e,n):e.domain()),_=i??(e.tickFormat?e.tickFormat.apply(e,n):yr),M=Math.max(a,0)+s,E=e.range(),$=+E[0]+u,g=+E[E.length-1]+u,k=(e.bandwidth?xr:wr)(e.copy(),u),v=d.selection?d.selection():d,P=v.selectAll(".domain").data([null]),T=v.selectAll(".tick").data(m,e).order(),R=T.exit(),q=T.enter().append("g").attr("class","tick"),x=T.select("line"),p=T.select("text");P=P.merge(P.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),T=T.merge(q),x=x.merge(q.append("line").attr("stroke","currentColor").attr(f+"2",l*a)),p=p.merge(q.append("text").attr("fill","currentColor").attr(f,l*M).attr("dy",t===te?"0em":t===oe?"0.71em":"0.32em")),d!==v&&(P=P.transition(d),T=T.transition(d),x=x.transition(d),p=p.transition(d),R=R.transition(d).attr("opacity",Ae).attr("transform",function(w){return isFinite(w=k(w))?c(w+u):this.getAttribute("transform")}),q.attr("opacity",Ae).attr("transform",function(w){var N=this.parentNode.__axis;return c((N&&isFinite(N=N(w))?N:k(w))+u)})),R.remove(),P.attr("d",t===kt||t===ee?o?"M"+l*o+","+$+"H"+u+"V"+g+"H"+l*o:"M"+u+","+$+"V"+g:o?"M"+$+","+l*o+"V"+u+"H"+g+"V"+l*o:"M"+$+","+u+"H"+g),T.attr("opacity",1).attr("transform",function(w){return c(k(w)+u)}),x.attr(f+"2",l*a),p.attr(f,l*M).text(_),v.filter(br).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===ee?"start":t===kt?"end":"middle"),v.each(function(){this.__axis=k})}return h.scale=function(d){return arguments.length?(e=d,h):e},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(d){return arguments.length?(n=d==null?[]:Array.from(d),h):n.slice()},h.tickValues=function(d){return arguments.length?(r=d==null?null:Array.from(d),h):r&&r.slice()},h.tickFormat=function(d){return arguments.length?(i=d,h):i},h.tickSize=function(d){return arguments.length?(a=o=+d,h):a},h.tickSizeInner=function(d){return arguments.length?(a=+d,h):a},h.tickSizeOuter=function(d){return arguments.length?(o=+d,h):o},h.tickPadding=function(d){return arguments.length?(s=+d,h):s},h.offset=function(d){return arguments.length?(u=+d,h):u},h}function Ne(t){return on(oe,t)}function Pe(t){return on(kt,t)}var kr={value:()=>{}};function sn(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Dt(n)}function Dt(t){this._=t}function Cr(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Dt.prototype=sn.prototype={constructor:Dt,on:function(t,e){var n=this._,r=Cr(t+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(t=r[a]).type)&&(i=Mr(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<o;)if(i=(t=r[a]).type)n[i]=Te(n[i],t.name,e);else if(e==null)for(i in n)n[i]=Te(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Dt(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],r=0,i=a.length;r<i;++r)a[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}};function Mr(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function Te(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=kr,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var se="http://www.w3.org/1999/xhtml";const Le={svg:"http://www.w3.org/2000/svg",xhtml:se,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Qt(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Le.hasOwnProperty(e)?{space:Le[e],local:t}:t}function Er(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===se&&e.documentElement.namespaceURI===se?e.createElement(t):e.createElementNS(n,t)}}function $r(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function ln(t){var e=Qt(t);return(e.local?$r:Er)(e)}function Sr(){}function _e(t){return t==null?Sr:function(){return this.querySelector(t)}}function Ir(t){typeof t!="function"&&(t=_e(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,s=r[i]=new Array(o),u,l,f=0;f<o;++f)(u=a[f])&&(l=t.call(u,u.__data__,f,a))&&("__data__"in u&&(l.__data__=u.__data__),s[f]=l);return new B(r,this._parents)}function Ar(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Nr(){return[]}function un(t){return t==null?Nr:function(){return this.querySelectorAll(t)}}function Pr(t){return function(){return Ar(t.apply(this,arguments))}}function Tr(t){typeof t=="function"?t=Pr(t):t=un(t);for(var e=this._groups,n=e.length,r=[],i=[],a=0;a<n;++a)for(var o=e[a],s=o.length,u,l=0;l<s;++l)(u=o[l])&&(r.push(t.call(u,u.__data__,l,o)),i.push(u));return new B(r,i)}function cn(t){return function(){return this.matches(t)}}function fn(t){return function(e){return e.matches(t)}}var Lr=Array.prototype.find;function Fr(t){return function(){return Lr.call(this.children,t)}}function Rr(){return this.firstElementChild}function zr(t){return this.select(t==null?Rr:Fr(typeof t=="function"?t:fn(t)))}var Dr=Array.prototype.filter;function Br(){return Array.from(this.children)}function Or(t){return function(){return Dr.call(this.children,t)}}function qr(t){return this.selectAll(t==null?Br:Or(typeof t=="function"?t:fn(t)))}function Hr(t){typeof t!="function"&&(t=cn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,s=r[i]=[],u,l=0;l<o;++l)(u=a[l])&&t.call(u,u.__data__,l,a)&&s.push(u);return new B(r,this._parents)}function hn(t){return new Array(t.length)}function Vr(){return new B(this._enter||this._groups.map(hn),this._parents)}function Ht(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Ht.prototype={constructor:Ht,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Xr(t){return function(){return t}}function Gr(t,e,n,r,i,a){for(var o=0,s,u=e.length,l=a.length;o<l;++o)(s=e[o])?(s.__data__=a[o],r[o]=s):n[o]=new Ht(t,a[o]);for(;o<u;++o)(s=e[o])&&(i[o]=s)}function Yr(t,e,n,r,i,a,o){var s,u,l=new Map,f=e.length,c=a.length,h=new Array(f),d;for(s=0;s<f;++s)(u=e[s])&&(h[s]=d=o.call(u,u.__data__,s,e)+"",l.has(d)?i[s]=u:l.set(d,u));for(s=0;s<c;++s)d=o.call(t,a[s],s,a)+"",(u=l.get(d))?(r[s]=u,u.__data__=a[s],l.delete(d)):n[s]=new Ht(t,a[s]);for(s=0;s<f;++s)(u=e[s])&&l.get(h[s])===u&&(i[s]=u)}function Ur(t){return t.__data__}function Zr(t,e){if(!arguments.length)return Array.from(this,Ur);var n=e?Yr:Gr,r=this._parents,i=this._groups;typeof t!="function"&&(t=Xr(t));for(var a=i.length,o=new Array(a),s=new Array(a),u=new Array(a),l=0;l<a;++l){var f=r[l],c=i[l],h=c.length,d=Kr(t.call(f,f&&f.__data__,l,r)),m=d.length,_=s[l]=new Array(m),M=o[l]=new Array(m),E=u[l]=new Array(h);n(f,c,_,M,E,d,e);for(var $=0,g=0,k,v;$<m;++$)if(k=_[$]){for($>=g&&(g=$+1);!(v=M[g])&&++g<m;);k._next=v||null}}return o=new B(o,r),o._enter=s,o._exit=u,o}function Kr(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Wr(){return new B(this._exit||this._groups.map(hn),this._parents)}function Qr(t,e,n){var r=this.enter(),i=this,a=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function Jr(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,a=r.length,o=Math.min(i,a),s=new Array(i),u=0;u<o;++u)for(var l=n[u],f=r[u],c=l.length,h=s[u]=new Array(c),d,m=0;m<c;++m)(d=l[m]||f[m])&&(h[m]=d);for(;u<i;++u)s[u]=n[u];return new B(s,this._parents)}function jr(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function ti(t){t||(t=ei);function e(c,h){return c&&h?t(c.__data__,h.__data__):!c-!h}for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,u=i[a]=new Array(s),l,f=0;f<s;++f)(l=o[f])&&(u[f]=l);u.sort(e)}return new B(i,this._parents).order()}function ei(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function ni(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function ri(){return Array.from(this)}function ii(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function ai(){let t=0;for(const e of this)++t;return t}function oi(){return!this.node()}function si(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&t.call(s,s.__data__,a,i);return this}function li(t){return function(){this.removeAttribute(t)}}function ui(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ci(t,e){return function(){this.setAttribute(t,e)}}function fi(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function hi(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function di(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function pi(t,e){var n=Qt(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?ui:li:typeof e=="function"?n.local?di:hi:n.local?fi:ci)(n,e))}function dn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function mi(t){return function(){this.style.removeProperty(t)}}function gi(t,e,n){return function(){this.style.setProperty(t,e,n)}}function yi(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function vi(t,e,n){return arguments.length>1?this.each((e==null?mi:typeof e=="function"?yi:gi)(t,e,n??"")):gt(this.node(),t)}function gt(t,e){return t.style.getPropertyValue(e)||dn(t).getComputedStyle(t,null).getPropertyValue(e)}function _i(t){return function(){delete this[t]}}function wi(t,e){return function(){this[t]=e}}function xi(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function bi(t,e){return arguments.length>1?this.each((e==null?_i:typeof e=="function"?xi:wi)(t,e)):this.node()[t]}function pn(t){return t.trim().split(/^|\s+/)}function we(t){return t.classList||new mn(t)}function mn(t){this._node=t,this._names=pn(t.getAttribute("class")||"")}mn.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function gn(t,e){for(var n=we(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function yn(t,e){for(var n=we(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function ki(t){return function(){gn(this,t)}}function Ci(t){return function(){yn(this,t)}}function Mi(t,e){return function(){(e.apply(this,arguments)?gn:yn)(this,t)}}function Ei(t,e){var n=pn(t+"");if(arguments.length<2){for(var r=we(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?Mi:e?ki:Ci)(n,e))}function $i(){this.textContent=""}function Si(t){return function(){this.textContent=t}}function Ii(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Ai(t){return arguments.length?this.each(t==null?$i:(typeof t=="function"?Ii:Si)(t)):this.node().textContent}function Ni(){this.innerHTML=""}function Pi(t){return function(){this.innerHTML=t}}function Ti(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Li(t){return arguments.length?this.each(t==null?Ni:(typeof t=="function"?Ti:Pi)(t)):this.node().innerHTML}function Fi(){this.nextSibling&&this.parentNode.appendChild(this)}function Ri(){return this.each(Fi)}function zi(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Di(){return this.each(zi)}function Bi(t){var e=typeof t=="function"?t:ln(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Oi(){return null}function qi(t,e){var n=typeof t=="function"?t:ln(t),r=e==null?Oi:typeof e=="function"?e:_e(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Hi(){var t=this.parentNode;t&&t.removeChild(this)}function Vi(){return this.each(Hi)}function Xi(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Gi(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Yi(t){return this.select(t?Gi:Xi)}function Ui(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Zi(t){return function(e){t.call(this,e,this.__data__)}}function Ki(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function Wi(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,a;n<i;++n)a=e[n],(!t.type||a.type===t.type)&&a.name===t.name?this.removeEventListener(a.type,a.listener,a.options):e[++r]=a;++r?e.length=r:delete this.__on}}}function Qi(t,e,n){return function(){var r=this.__on,i,a=Zi(e);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=e;return}}this.addEventListener(t.type,a,n),i={type:t.type,name:t.name,value:e,listener:a,options:n},r?r.push(i):this.__on=[i]}}function Ji(t,e,n){var r=Ki(t+""),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var u=0,l=s.length,f;u<l;++u)for(i=0,f=s[u];i<a;++i)if((o=r[i]).type===f.type&&o.name===f.name)return f.value}return}for(s=e?Qi:Wi,i=0;i<a;++i)this.each(s(r[i],e,n));return this}function vn(t,e,n){var r=dn(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function ji(t,e){return function(){return vn(this,t,e)}}function ta(t,e){return function(){return vn(this,t,e.apply(this,arguments))}}function ea(t,e){return this.each((typeof e=="function"?ta:ji)(t,e))}function*na(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var _n=[null];function B(t,e){this._groups=t,this._parents=e}function Nt(){return new B([[document.documentElement]],_n)}function ra(){return this}B.prototype=Nt.prototype={constructor:B,select:Ir,selectAll:Tr,selectChild:zr,selectChildren:qr,filter:Hr,data:Zr,enter:Vr,exit:Wr,join:Qr,merge:Jr,selection:ra,order:jr,sort:ti,call:ni,nodes:ri,node:ii,size:ai,empty:oi,each:si,attr:pi,style:vi,property:bi,classed:Ei,text:Ai,html:Li,raise:Ri,lower:Di,append:Bi,insert:qi,remove:Vi,clone:Yi,datum:Ui,on:Ji,dispatch:ea,[Symbol.iterator]:na};function xt(t){return typeof t=="string"?new B([[document.querySelector(t)]],[document.documentElement]):new B([[t]],_n)}function ia(t){let e;for(;e=t.sourceEvent;)t=e;return t}function aa(t,e){if(t=ia(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}function xe(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function wn(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Pt(){}var St=.7,Vt=1/St,mt="\\s*([+-]?\\d+)\\s*",It="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",K="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",oa=/^#([0-9a-f]{3,8})$/,sa=new RegExp(`^rgb\\(${mt},${mt},${mt}\\)$`),la=new RegExp(`^rgb\\(${K},${K},${K}\\)$`),ua=new RegExp(`^rgba\\(${mt},${mt},${mt},${It}\\)$`),ca=new RegExp(`^rgba\\(${K},${K},${K},${It}\\)$`),fa=new RegExp(`^hsl\\(${It},${K},${K}\\)$`),ha=new RegExp(`^hsla\\(${It},${K},${K},${It}\\)$`),Fe={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};xe(Pt,ot,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Re,formatHex:Re,formatHex8:da,formatHsl:pa,formatRgb:ze,toString:ze});function Re(){return this.rgb().formatHex()}function da(){return this.rgb().formatHex8()}function pa(){return xn(this).formatHsl()}function ze(){return this.rgb().formatRgb()}function ot(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=oa.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?De(e):n===3?new F(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Tt(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Tt(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=sa.exec(t))?new F(e[1],e[2],e[3],1):(e=la.exec(t))?new F(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=ua.exec(t))?Tt(e[1],e[2],e[3],e[4]):(e=ca.exec(t))?Tt(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=fa.exec(t))?qe(e[1],e[2]/100,e[3]/100,1):(e=ha.exec(t))?qe(e[1],e[2]/100,e[3]/100,e[4]):Fe.hasOwnProperty(t)?De(Fe[t]):t==="transparent"?new F(NaN,NaN,NaN,0):null}function De(t){return new F(t>>16&255,t>>8&255,t&255,1)}function Tt(t,e,n,r){return r<=0&&(t=e=n=NaN),new F(t,e,n,r)}function ma(t){return t instanceof Pt||(t=ot(t)),t?(t=t.rgb(),new F(t.r,t.g,t.b,t.opacity)):new F}function le(t,e,n,r){return arguments.length===1?ma(t):new F(t,e,n,r??1)}function F(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}xe(F,le,wn(Pt,{brighter(t){return t=t==null?Vt:Math.pow(Vt,t),new F(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?St:Math.pow(St,t),new F(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new F(at(this.r),at(this.g),at(this.b),Xt(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Be,formatHex:Be,formatHex8:ga,formatRgb:Oe,toString:Oe}));function Be(){return`#${it(this.r)}${it(this.g)}${it(this.b)}`}function ga(){return`#${it(this.r)}${it(this.g)}${it(this.b)}${it((isNaN(this.opacity)?1:this.opacity)*255)}`}function Oe(){const t=Xt(this.opacity);return`${t===1?"rgb(":"rgba("}${at(this.r)}, ${at(this.g)}, ${at(this.b)}${t===1?")":`, ${t})`}`}function Xt(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function at(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function it(t){return t=at(t),(t<16?"0":"")+t.toString(16)}function qe(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new X(t,e,n,r)}function xn(t){if(t instanceof X)return new X(t.h,t.s,t.l,t.opacity);if(t instanceof Pt||(t=ot(t)),!t)return new X;if(t instanceof X)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,u=(a+i)/2;return s?(e===a?o=(n-r)/s+(n<r)*6:n===a?o=(r-e)/s+2:o=(e-n)/s+4,s/=u<.5?a+i:2-a-i,o*=60):s=u>0&&u<1?0:o,new X(o,s,u,t.opacity)}function ya(t,e,n,r){return arguments.length===1?xn(t):new X(t,e,n,r??1)}function X(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}xe(X,ya,wn(Pt,{brighter(t){return t=t==null?Vt:Math.pow(Vt,t),new X(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?St:Math.pow(St,t),new X(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new F(ne(t>=240?t-240:t+120,i,r),ne(t,i,r),ne(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new X(He(this.h),Lt(this.s),Lt(this.l),Xt(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Xt(this.opacity);return`${t===1?"hsl(":"hsla("}${He(this.h)}, ${Lt(this.s)*100}%, ${Lt(this.l)*100}%${t===1?")":`, ${t})`}`}}));function He(t){return t=(t||0)%360,t<0?t+360:t}function Lt(t){return Math.max(0,Math.min(1,t||0))}function ne(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const be=t=>()=>t;function va(t,e){return function(n){return t+n*e}}function _a(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function wa(t){return(t=+t)==1?bn:function(e,n){return n-e?_a(e,n,t):be(isNaN(e)?n:e)}}function bn(t,e){var n=e-t;return n?va(t,n):be(isNaN(t)?e:t)}const Gt=function t(e){var n=wa(e);function r(i,a){var o=n((i=le(i)).r,(a=le(a)).r),s=n(i.g,a.g),u=n(i.b,a.b),l=bn(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=s(f),i.b=u(f),i.opacity=l(f),i+""}}return r.gamma=t,r}(1);function xa(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=t[i]*(1-a)+e[i]*a;return r}}function ba(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function ka(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),a=new Array(n),o;for(o=0;o<r;++o)i[o]=ke(t[o],e[o]);for(;o<n;++o)a[o]=e[o];return function(s){for(o=0;o<r;++o)a[o]=i[o](s);return a}}function Ca(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function V(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Ma(t,e){var n={},r={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=ke(t[i],e[i]):r[i]=e[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var ue=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,re=new RegExp(ue.source,"g");function Ea(t){return function(){return t}}function $a(t){return function(e){return t(e)+""}}function kn(t,e){var n=ue.lastIndex=re.lastIndex=0,r,i,a,o=-1,s=[],u=[];for(t=t+"",e=e+"";(r=ue.exec(t))&&(i=re.exec(e));)(a=i.index)>n&&(a=e.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,u.push({i:o,x:V(r,i)})),n=re.lastIndex;return n<e.length&&(a=e.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?u[0]?$a(u[0].x):Ea(e):(e=u.length,function(l){for(var f=0,c;f<e;++f)s[(c=u[f]).i]=c.x(l);return s.join("")})}function ke(t,e){var n=typeof e,r;return e==null||n==="boolean"?be(e):(n==="number"?V:n==="string"?(r=ot(e))?(e=r,Gt):kn:e instanceof ot?Gt:e instanceof Date?Ca:ba(e)?xa:Array.isArray(e)?ka:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Ma:V)(t,e)}function Sa(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var Ve=180/Math.PI,ce={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Cn(t,e,n,r,i,a){var o,s,u;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),t*r<e*n&&(t=-t,e=-e,u=-u,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*Ve,skewX:Math.atan(u)*Ve,scaleX:o,scaleY:s}}var Ft;function Ia(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?ce:Cn(e.a,e.b,e.c,e.d,e.e,e.f)}function Aa(t){return t==null||(Ft||(Ft=document.createElementNS("http://www.w3.org/2000/svg","g")),Ft.setAttribute("transform",t),!(t=Ft.transform.baseVal.consolidate()))?ce:(t=t.matrix,Cn(t.a,t.b,t.c,t.d,t.e,t.f))}function Mn(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function a(l,f,c,h,d,m){if(l!==c||f!==h){var _=d.push("translate(",null,e,null,n);m.push({i:_-4,x:V(l,c)},{i:_-2,x:V(f,h)})}else(c||h)&&d.push("translate("+c+e+h+n)}function o(l,f,c,h){l!==f?(l-f>180?f+=360:f-l>180&&(l+=360),h.push({i:c.push(i(c)+"rotate(",null,r)-2,x:V(l,f)})):f&&c.push(i(c)+"rotate("+f+r)}function s(l,f,c,h){l!==f?h.push({i:c.push(i(c)+"skewX(",null,r)-2,x:V(l,f)}):f&&c.push(i(c)+"skewX("+f+r)}function u(l,f,c,h,d,m){if(l!==c||f!==h){var _=d.push(i(d)+"scale(",null,",",null,")");m.push({i:_-4,x:V(l,c)},{i:_-2,x:V(f,h)})}else(c!==1||h!==1)&&d.push(i(d)+"scale("+c+","+h+")")}return function(l,f){var c=[],h=[];return l=t(l),f=t(f),a(l.translateX,l.translateY,f.translateX,f.translateY,c,h),o(l.rotate,f.rotate,c,h),s(l.skewX,f.skewX,c,h),u(l.scaleX,l.scaleY,f.scaleX,f.scaleY,c,h),l=f=null,function(d){for(var m=-1,_=h.length,M;++m<_;)c[(M=h[m]).i]=M.x(d);return c.join("")}}}var Na=Mn(Ia,"px, ","px)","deg)"),Pa=Mn(Aa,", ",")",")"),yt=0,Ct=0,bt=0,En=1e3,Yt,Mt,Ut=0,st=0,Jt=0,At=typeof performance=="object"&&performance.now?performance:Date,$n=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ce(){return st||($n(Ta),st=At.now()+Jt)}function Ta(){st=0}function Zt(){this._call=this._time=this._next=null}Zt.prototype=Sn.prototype={constructor:Zt,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Ce():+n)+(e==null?0:+e),!this._next&&Mt!==this&&(Mt?Mt._next=this:Yt=this,Mt=this),this._call=t,this._time=n,fe()},stop:function(){this._call&&(this._call=null,this._time=1/0,fe())}};function Sn(t,e,n){var r=new Zt;return r.restart(t,e,n),r}function La(){Ce(),++yt;for(var t=Yt,e;t;)(e=st-t._time)>=0&&t._call.call(void 0,e),t=t._next;--yt}function Xe(){st=(Ut=At.now())+Jt,yt=Ct=0;try{La()}finally{yt=0,Ra(),st=0}}function Fa(){var t=At.now(),e=t-Ut;e>En&&(Jt-=e,Ut=t)}function Ra(){for(var t,e=Yt,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Yt=n);Mt=t,fe(r)}function fe(t){if(!yt){Ct&&(Ct=clearTimeout(Ct));var e=t-st;e>24?(t<1/0&&(Ct=setTimeout(Xe,t-At.now()-Jt)),bt&&(bt=clearInterval(bt))):(bt||(Ut=At.now(),bt=setInterval(Fa,En)),yt=1,$n(Xe))}}function Ge(t,e,n){var r=new Zt;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var za=sn("start","end","cancel","interrupt"),Da=[],In=0,Ye=1,he=2,Bt=3,Ue=4,de=5,Ot=6;function jt(t,e,n,r,i,a){var o=t.__transition;if(!o)t.__transition={};else if(n in o)return;Ba(t,n,{name:e,index:r,group:i,on:za,tween:Da,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:In})}function Me(t,e){var n=G(t,e);if(n.state>In)throw new Error("too late; already scheduled");return n}function W(t,e){var n=G(t,e);if(n.state>Bt)throw new Error("too late; already running");return n}function G(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Ba(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Sn(a,0,n.time);function a(l){n.state=Ye,n.timer.restart(o,n.delay,n.time),n.delay<=l&&o(l-n.delay)}function o(l){var f,c,h,d;if(n.state!==Ye)return u();for(f in r)if(d=r[f],d.name===n.name){if(d.state===Bt)return Ge(o);d.state===Ue?(d.state=Ot,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[f]):+f<e&&(d.state=Ot,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[f])}if(Ge(function(){n.state===Bt&&(n.state=Ue,n.timer.restart(s,n.delay,n.time),s(l))}),n.state=he,n.on.call("start",t,t.__data__,n.index,n.group),n.state===he){for(n.state=Bt,i=new Array(h=n.tween.length),f=0,c=-1;f<h;++f)(d=n.tween[f].value.call(t,t.__data__,n.index,n.group))&&(i[++c]=d);i.length=c+1}}function s(l){for(var f=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(u),n.state=de,1),c=-1,h=i.length;++c<h;)i[c].call(t,f);n.state===de&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){n.state=Ot,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function Oa(t,e){var n=t.__transition,r,i,a=!0,o;if(n){e=e==null?null:e+"";for(o in n){if((r=n[o]).name!==e){a=!1;continue}i=r.state>he&&r.state<de,r.state=Ot,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[o]}a&&delete t.__transition}}function qa(t){return this.each(function(){Oa(this,t)})}function Ha(t,e){var n,r;return function(){var i=W(this,t),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===e){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function Va(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=W(this,t),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:e,value:n},u=0,l=i.length;u<l;++u)if(i[u].name===e){i[u]=s;break}u===l&&i.push(s)}a.tween=i}}function Xa(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=G(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===t)return o.value;return null}return this.each((e==null?Ha:Va)(n,t,e))}function Ee(t,e,n){var r=t._id;return t.each(function(){var i=W(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return G(i,r).value[e]}}function An(t,e){var n;return(typeof e=="number"?V:e instanceof ot?Gt:(n=ot(e))?(e=n,Gt):kn)(t,e)}function Ga(t){return function(){this.removeAttribute(t)}}function Ya(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ua(t,e,n){var r,i=n+"",a;return function(){var o=this.getAttribute(t);return o===i?null:o===r?a:a=e(r=o,n)}}function Za(t,e,n){var r,i=n+"",a;return function(){var o=this.getAttributeNS(t.space,t.local);return o===i?null:o===r?a:a=e(r=o,n)}}function Ka(t,e,n){var r,i,a;return function(){var o,s=n(this),u;return s==null?void this.removeAttribute(t):(o=this.getAttribute(t),u=s+"",o===u?null:o===r&&u===i?a:(i=u,a=e(r=o,s)))}}function Wa(t,e,n){var r,i,a;return function(){var o,s=n(this),u;return s==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),u=s+"",o===u?null:o===r&&u===i?a:(i=u,a=e(r=o,s)))}}function Qa(t,e){var n=Qt(t),r=n==="transform"?Pa:An;return this.attrTween(t,typeof e=="function"?(n.local?Wa:Ka)(n,r,Ee(this,"attr."+t,e)):e==null?(n.local?Ya:Ga)(n):(n.local?Za:Ua)(n,r,e))}function Ja(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function ja(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function to(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&ja(t,a)),n}return i._value=e,i}function eo(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&Ja(t,a)),n}return i._value=e,i}function no(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=Qt(t);return this.tween(n,(r.local?to:eo)(r,e))}function ro(t,e){return function(){Me(this,t).delay=+e.apply(this,arguments)}}function io(t,e){return e=+e,function(){Me(this,t).delay=e}}function ao(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?ro:io)(e,t)):G(this.node(),e).delay}function oo(t,e){return function(){W(this,t).duration=+e.apply(this,arguments)}}function so(t,e){return e=+e,function(){W(this,t).duration=e}}function lo(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?oo:so)(e,t)):G(this.node(),e).duration}function uo(t,e){if(typeof e!="function")throw new Error;return function(){W(this,t).ease=e}}function co(t){var e=this._id;return arguments.length?this.each(uo(e,t)):G(this.node(),e).ease}function fo(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;W(this,t).ease=n}}function ho(t){if(typeof t!="function")throw new Error;return this.each(fo(this._id,t))}function po(t){typeof t!="function"&&(t=cn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,s=r[i]=[],u,l=0;l<o;++l)(u=a[l])&&t.call(u,u.__data__,l,a)&&s.push(u);return new tt(r,this._parents,this._name,this._id)}function mo(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,a=Math.min(r,i),o=new Array(r),s=0;s<a;++s)for(var u=e[s],l=n[s],f=u.length,c=o[s]=new Array(f),h,d=0;d<f;++d)(h=u[d]||l[d])&&(c[d]=h);for(;s<r;++s)o[s]=e[s];return new tt(o,this._parents,this._name,this._id)}function go(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function yo(t,e,n){var r,i,a=go(e)?Me:W;return function(){var o=a(this,t),s=o.on;s!==r&&(i=(r=s).copy()).on(e,n),o.on=i}}function vo(t,e){var n=this._id;return arguments.length<2?G(this.node(),n).on.on(t):this.each(yo(n,t,e))}function _o(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function wo(){return this.on("end.remove",_o(this._id))}function xo(t){var e=this._name,n=this._id;typeof t!="function"&&(t=_e(t));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o)for(var s=r[o],u=s.length,l=a[o]=new Array(u),f,c,h=0;h<u;++h)(f=s[h])&&(c=t.call(f,f.__data__,h,s))&&("__data__"in f&&(c.__data__=f.__data__),l[h]=c,jt(l[h],e,n,h,l,G(f,n)));return new tt(a,this._parents,e,n)}function bo(t){var e=this._name,n=this._id;typeof t!="function"&&(t=un(t));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var u=r[s],l=u.length,f,c=0;c<l;++c)if(f=u[c]){for(var h=t.call(f,f.__data__,c,u),d,m=G(f,n),_=0,M=h.length;_<M;++_)(d=h[_])&&jt(d,e,n,_,h,m);a.push(h),o.push(f)}return new tt(a,o,e,n)}var ko=Nt.prototype.constructor;function Co(){return new ko(this._groups,this._parents)}function Mo(t,e){var n,r,i;return function(){var a=gt(this,t),o=(this.style.removeProperty(t),gt(this,t));return a===o?null:a===n&&o===r?i:i=e(n=a,r=o)}}function Nn(t){return function(){this.style.removeProperty(t)}}function Eo(t,e,n){var r,i=n+"",a;return function(){var o=gt(this,t);return o===i?null:o===r?a:a=e(r=o,n)}}function $o(t,e,n){var r,i,a;return function(){var o=gt(this,t),s=n(this),u=s+"";return s==null&&(u=s=(this.style.removeProperty(t),gt(this,t))),o===u?null:o===r&&u===i?a:(i=u,a=e(r=o,s))}}function So(t,e){var n,r,i,a="style."+e,o="end."+a,s;return function(){var u=W(this,t),l=u.on,f=u.value[a]==null?s||(s=Nn(e)):void 0;(l!==n||i!==f)&&(r=(n=l).copy()).on(o,i=f),u.on=r}}function Io(t,e,n){var r=(t+="")=="transform"?Na:An;return e==null?this.styleTween(t,Mo(t,r)).on("end.style."+t,Nn(t)):typeof e=="function"?this.styleTween(t,$o(t,r,Ee(this,"style."+t,e))).each(So(this._id,t)):this.styleTween(t,Eo(t,r,e),n).on("end.style."+t,null)}function Ao(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function No(t,e,n){var r,i;function a(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&Ao(t,o,n)),r}return a._value=e,a}function Po(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,No(t,e,n??""))}function To(t){return function(){this.textContent=t}}function Lo(t){return function(){var e=t(this);this.textContent=e??""}}function Fo(t){return this.tween("text",typeof t=="function"?Lo(Ee(this,"text",t)):To(t==null?"":t+""))}function Ro(t){return function(e){this.textContent=t.call(this,e)}}function zo(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&Ro(i)),e}return r._value=t,r}function Do(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,zo(t))}function Bo(){for(var t=this._name,e=this._id,n=Pn(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,u,l=0;l<s;++l)if(u=o[l]){var f=G(u,e);jt(u,t,n,l,o,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new tt(r,this._parents,t,n)}function Oo(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},u={value:function(){--i===0&&a()}};n.each(function(){var l=W(this,r),f=l.on;f!==t&&(e=(t=f).copy(),e._.cancel.push(s),e._.interrupt.push(s),e._.end.push(u)),l.on=e}),i===0&&a()})}var qo=0;function tt(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Pn(){return++qo}var j=Nt.prototype;tt.prototype={constructor:tt,select:xo,selectAll:bo,selectChild:j.selectChild,selectChildren:j.selectChildren,filter:po,merge:mo,selection:Co,transition:Bo,call:j.call,nodes:j.nodes,node:j.node,size:j.size,empty:j.empty,each:j.each,on:vo,attr:Qa,attrTween:no,style:Io,styleTween:Po,text:Fo,textTween:Do,remove:wo,tween:Xa,delay:ao,duration:lo,ease:co,easeVarying:ho,end:Oo,[Symbol.iterator]:j[Symbol.iterator]};function Ho(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Vo={time:null,delay:0,duration:250,ease:Ho};function Xo(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function Go(t){var e,n;t instanceof tt?(e=t._id,t=t._name):(e=Pn(),(n=Vo).time=Ce(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,u,l=0;l<s;++l)(u=o[l])&&jt(u,t,e,l,o,n||Xo(u,e));return new tt(r,this._parents,t,e)}Nt.prototype.interrupt=qa;Nt.prototype.transition=Go;const pe=Math.PI,me=2*pe,rt=1e-6,Yo=me-rt;function Tn(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function Uo(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Tn;const n=10**e;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class Zo{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?Tn:Uo(e)}moveTo(e,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,n){this._append`L${this._x1=+e},${this._y1=+n}`}quadraticCurveTo(e,n,r,i){this._append`Q${+e},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(e,n,r,i,a,o){this._append`C${+e},${+n},${+r},${+i},${this._x1=+a},${this._y1=+o}`}arcTo(e,n,r,i,a){if(e=+e,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,s=this._y1,u=r-e,l=i-n,f=o-e,c=s-n,h=f*f+c*c;if(this._x1===null)this._append`M${this._x1=e},${this._y1=n}`;else if(h>rt)if(!(Math.abs(c*u-l*f)>rt)||!a)this._append`L${this._x1=e},${this._y1=n}`;else{let d=r-o,m=i-s,_=u*u+l*l,M=d*d+m*m,E=Math.sqrt(_),$=Math.sqrt(h),g=a*Math.tan((pe-Math.acos((_+h-M)/(2*E*$)))/2),k=g/$,v=g/E;Math.abs(k-1)>rt&&this._append`L${e+k*f},${n+k*c}`,this._append`A${a},${a},0,0,${+(c*d>f*m)},${this._x1=e+v*u},${this._y1=n+v*l}`}}arc(e,n,r,i,a,o){if(e=+e,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),u=r*Math.sin(i),l=e+s,f=n+u,c=1^o,h=o?i-a:a-i;this._x1===null?this._append`M${l},${f}`:(Math.abs(this._x1-l)>rt||Math.abs(this._y1-f)>rt)&&this._append`L${l},${f}`,r&&(h<0&&(h=h%me+me),h>Yo?this._append`A${r},${r},0,1,${c},${e-s},${n-u}A${r},${r},0,1,${c},${this._x1=l},${this._y1=f}`:h>rt&&this._append`A${r},${r},0,${+(h>=pe)},${c},${this._x1=e+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function Ko(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Kt(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function vt(t){return t=Kt(Math.abs(t)),t?t[1]:NaN}function Wo(t,e){return function(n,r){for(var i=n.length,a=[],o=0,s=t[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),a.push(n.substring(i-=s,i+s)),!((u+=s+1)>r));)s=t[o=(o+1)%t.length];return a.reverse().join(e)}}function Qo(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var Jo=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Wt(t){if(!(e=Jo.exec(t)))throw new Error("invalid format: "+t);var e;return new $e({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Wt.prototype=$e.prototype;function $e(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}$e.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function jo(t){t:for(var e=t.length,n=1,r=-1,i;n<e;++n)switch(t[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+t[n])break t;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var Ln;function ts(t,e){var n=Kt(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(Ln=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Kt(t,Math.max(0,e+a-1))[0]}function Ze(t,e){var n=Kt(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const Ke={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Ko,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Ze(t*100,e),r:Ze,s:ts,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function We(t){return t}var Qe=Array.prototype.map,Je=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function es(t){var e=t.grouping===void 0||t.thousands===void 0?We:Wo(Qe.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?We:Qo(Qe.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"−":t.minus+"",u=t.nan===void 0?"NaN":t.nan+"";function l(c){c=Wt(c);var h=c.fill,d=c.align,m=c.sign,_=c.symbol,M=c.zero,E=c.width,$=c.comma,g=c.precision,k=c.trim,v=c.type;v==="n"?($=!0,v="g"):Ke[v]||(g===void 0&&(g=12),k=!0,v="g"),(M||h==="0"&&d==="=")&&(M=!0,h="0",d="=");var P=_==="$"?n:_==="#"&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",T=_==="$"?r:/[%p]/.test(v)?o:"",R=Ke[v],q=/[defgprs%]/.test(v);g=g===void 0?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g));function x(p){var w=P,N=T,Q,_t,lt;if(v==="c")N=R(p)+N,p="";else{p=+p;var ut=p<0||1/p<0;if(p=isNaN(p)?u:R(Math.abs(p),g),k&&(p=jo(p)),ut&&+p==0&&m!=="+"&&(ut=!1),w=(ut?m==="("?m:s:m==="-"||m==="("?"":m)+w,N=(v==="s"?Je[8+Ln/3]:"")+N+(ut&&m==="("?")":""),q){for(Q=-1,_t=p.length;++Q<_t;)if(lt=p.charCodeAt(Q),48>lt||lt>57){N=(lt===46?i+p.slice(Q+1):p.slice(Q))+N,p=p.slice(0,Q);break}}}$&&!M&&(p=e(p,1/0));var ct=w.length+p.length+N.length,y=ct<E?new Array(E-ct+1).join(h):"";switch($&&M&&(p=e(y+p,y.length?E-N.length:1/0),y=""),d){case"<":p=w+p+N+y;break;case"=":p=w+y+p+N;break;case"^":p=y.slice(0,ct=y.length>>1)+w+p+N+y.slice(ct);break;default:p=y+w+p+N;break}return a(p)}return x.toString=function(){return c+""},x}function f(c,h){var d=l((c=Wt(c),c.type="f",c)),m=Math.max(-8,Math.min(8,Math.floor(vt(h)/3)))*3,_=Math.pow(10,-m),M=Je[8+m/3];return function(E){return d(_*E)+M}}return{format:l,formatPrefix:f}}var Rt,Fn,Rn;ns({thousands:",",grouping:[3],currency:["$",""]});function ns(t){return Rt=es(t),Fn=Rt.format,Rn=Rt.formatPrefix,Rt}function rs(t){return Math.max(0,-vt(Math.abs(t)))}function is(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(vt(e)/3)))*3-vt(Math.abs(t)))}function as(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,vt(e)-vt(t))+1}function os(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function ss(t){return function(){return t}}function ls(t){return+t}var je=[0,1];function pt(t){return t}function ge(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:ss(isNaN(e)?NaN:.5)}function us(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function cs(t,e,n){var r=t[0],i=t[1],a=e[0],o=e[1];return i<r?(r=ge(i,r),a=n(o,a)):(r=ge(r,i),a=n(a,o)),function(s){return a(r(s))}}function fs(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),a=new Array(r),o=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<r;)i[o]=ge(t[o],t[o+1]),a[o]=n(e[o],e[o+1]);return function(s){var u=fr(t,s,1,r)-1;return a[u](i[u](s))}}function hs(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function ds(){var t=je,e=je,n=ke,r,i,a,o=pt,s,u,l;function f(){var h=Math.min(t.length,e.length);return o!==pt&&(o=us(t[0],t[h-1])),s=h>2?fs:cs,u=l=null,c}function c(h){return h==null||isNaN(h=+h)?a:(u||(u=s(t.map(r),e,n)))(r(o(h)))}return c.invert=function(h){return o(i((l||(l=s(e,t.map(r),V)))(h)))},c.domain=function(h){return arguments.length?(t=Array.from(h,ls),f()):t.slice()},c.range=function(h){return arguments.length?(e=Array.from(h),f()):e.slice()},c.rangeRound=function(h){return e=Array.from(h),n=Sa,f()},c.clamp=function(h){return arguments.length?(o=h?!0:pt,f()):o!==pt},c.interpolate=function(h){return arguments.length?(n=h,f()):n},c.unknown=function(h){return arguments.length?(a=h,c):a},function(h,d){return r=h,i=d,f()}}function ps(){return ds()(pt,pt)}function ms(t,e,n,r){var i=gr(t,e,n),a;switch(r=Wt(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(a=is(i,o))&&(r.precision=a),Rn(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=as(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=rs(i))&&(r.precision=a-(r.type==="%")*2);break}}return Fn(r)}function gs(t){var e=t.domain;return t.ticks=function(n){var r=e();return mr(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return ms(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,a=r.length-1,o=r[i],s=r[a],u,l,f=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);f-- >0;){if(l=ae(o,s,n),l===u)return r[i]=o,r[a]=s,e(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;u=l}return t},t}function ye(){var t=ps();return t.copy=function(){return hs(t,ye())},os.apply(t,arguments),gs(t)}function L(t){return function(){return t}}function zn(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new Zo(e)}function Dn(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Bn(t){this._context=t}Bn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function On(t){return new Bn(t)}function qn(t){return t[0]}function Hn(t){return t[1]}function ys(t,e){var n=L(!0),r=null,i=On,a=null,o=zn(s);t=typeof t=="function"?t:t===void 0?qn:L(t),e=typeof e=="function"?e:e===void 0?Hn:L(e);function s(u){var l,f=(u=Dn(u)).length,c,h=!1,d;for(r==null&&(a=i(d=o())),l=0;l<=f;++l)!(l<f&&n(c=u[l],l,u))===h&&((h=!h)?a.lineStart():a.lineEnd()),h&&a.point(+t(c,l,u),+e(c,l,u));if(d)return a=null,d+""||null}return s.x=function(u){return arguments.length?(t=typeof u=="function"?u:L(+u),s):t},s.y=function(u){return arguments.length?(e=typeof u=="function"?u:L(+u),s):e},s.defined=function(u){return arguments.length?(n=typeof u=="function"?u:L(!!u),s):n},s.curve=function(u){return arguments.length?(i=u,r!=null&&(a=i(r)),s):i},s.context=function(u){return arguments.length?(u==null?r=a=null:a=i(r=u),s):r},s}function vs(t,e,n){var r=null,i=L(!0),a=null,o=On,s=null,u=zn(l);t=typeof t=="function"?t:t===void 0?qn:L(+t),e=typeof e=="function"?e:L(e===void 0?0:+e),n=typeof n=="function"?n:n===void 0?Hn:L(+n);function l(c){var h,d,m,_=(c=Dn(c)).length,M,E=!1,$,g=new Array(_),k=new Array(_);for(a==null&&(s=o($=u())),h=0;h<=_;++h){if(!(h<_&&i(M=c[h],h,c))===E)if(E=!E)d=h,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),m=h-1;m>=d;--m)s.point(g[m],k[m]);s.lineEnd(),s.areaEnd()}E&&(g[h]=+t(M,h,c),k[h]=+e(M,h,c),s.point(r?+r(M,h,c):g[h],n?+n(M,h,c):k[h]))}if($)return s=null,$+""||null}function f(){return ys().defined(i).curve(o).context(a)}return l.x=function(c){return arguments.length?(t=typeof c=="function"?c:L(+c),r=null,l):t},l.x0=function(c){return arguments.length?(t=typeof c=="function"?c:L(+c),l):t},l.x1=function(c){return arguments.length?(r=c==null?null:typeof c=="function"?c:L(+c),l):r},l.y=function(c){return arguments.length?(e=typeof c=="function"?c:L(+c),n=null,l):e},l.y0=function(c){return arguments.length?(e=typeof c=="function"?c:L(+c),l):e},l.y1=function(c){return arguments.length?(n=c==null?null:typeof c=="function"?c:L(+c),l):n},l.lineX0=l.lineY0=function(){return f().x(t).y(e)},l.lineY1=function(){return f().x(t).y(n)},l.lineX1=function(){return f().x(r).y(e)},l.defined=function(c){return arguments.length?(i=typeof c=="function"?c:L(!!c),l):i},l.curve=function(c){return arguments.length?(o=c,a!=null&&(s=o(a)),l):o},l.context=function(c){return arguments.length?(c==null?a=s=null:s=o(a=c),l):a},l}function Et(t,e,n){this.k=t,this.x=e,this.y=n}Et.prototype={constructor:Et,scale:function(t){return t===1?this:new Et(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Et(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};Et.prototype;const _s={class:"map-popover__elevation"},ws={class:"map-popover__elevation-content"},xs=I("div",{id:"d3chartsvg",class:"map-popover__elevation-svg-wrap"},null,-1),bs={class:"map-popover__elevation-legend"},ks={__name:"ElevationProfile",props:{mapElement:{type:Object,required:!0},globalId:{type:String,required:!0},surfaceTypes:{type:Array,default:()=>[]},tourLength:{type:Number,default:0},chartData:{type:Array,default:()=>[]}},setup(t){const e=t;ve(()=>{a(),window.addEventListener("resize",er.debounce(()=>{xt("#d3chartsvg").select("svg").remove(),a()},300))});function n(){const o=[],s=e.chartData.length;let u=!1;return e.chartData.forEach((l,f)=>{if(Object.prototype.hasOwnProperty.call(l,"surface")){const c=Math.round(f/s*100);u&&o.push({offset:c+"%",color:"#"+u}),u=l.surface.color,o.push({offset:c+"%",color:"#"+l.surface.color})}}),o}function r(o){return o<1e3?Math.round(o)+" m":(parseFloat(o/1e3).toFixed(0)+"").replace(/\./,",")+" km"}function i(o){return Math.round(o)+" m"}function a(){let o=window.innerWidth,s=214;window.matchMedia("(max-width: 767px)").matches?s=164:window.matchMedia("(max-width: 1344px)").matches?s=194:o=1344;const u={top:32,right:32,bottom:32,left:64},l=o-u.left-u.right,f=s-u.top-u.bottom,c=n(),h=ye([0,Se(e.chartData,y=>y.distance)],[0,l]),d=ye([Ie(e.chartData,y=>y.elevation),Se(e.chartData,y=>y.elevation)],[f,0]),m=vs().x(y=>h(y.distance)).y0(d(Ie(e.chartData,y=>y.elevation))).y1(y=>d(y.elevation)),_=Ne(h).ticks(5).tickFormat(r),M=Pe(d).ticks(3).tickFormat(i),E=Ne(h).tickSize(-f).tickFormat("").ticks(5),$=Pe(d).tickSize(-l).tickFormat("").ticks(3),g=xt("#d3chartsvg").append("svg").attr("width",o).attr("height",s).attr("viewBox",[0,0,o,s]).append("g").attr("transform","translate("+u.left+","+u.top+")");g.append("g").attr("class","x axis-grid").attr("transform","translate(0,"+f+")").call(E),g.append("g").attr("class","y axis-grid").call($),g.append("g").attr("transform",`translate(0,${f})`).call(_),g.append("g").call(M),g.append("linearGradient").attr("id","area-gradient").attr("gradientUnits","userSpaceOnUse").selectAll("stop").data(c).enter().append("stop").attr("offset",function(y){return y.offset}).attr("stop-color",function(y){return y.color}),g.append("path").attr("class","area").attr("d",m(e.chartData));const k=g.append("g").attr("class","chart-marker-container").attr("display","none");k.append("line").attr("class","chart-marker").attr("x1",0).attr("y1",0).attr("x2",0).attr("y2",f),k.append("circle").attr("class","chart-drag").attr("r",10).attr("cx",1).attr("cy",f/2),k.append("circle").attr("class","chart-marker-circle").attr("r",8).attr("cx",0).attr("cy",0),k.append("rect").attr("class","chart-marker-text-bg").attr("height",16).attr("width",100).attr("x",0).attr("y",0),k.append("text").attr("class","chart-marker-text distance").attr("x",5).attr("dy",12).attr("text-anchor","left"),g.append("rect").attr("class","event").attr("x",0).attr("y",0).attr("width",l).attr("height",f);const v=xt("#d3chartsvg .chart-marker-container"),P=v.select(".chart-marker-circle"),T=v.select(".chart-marker-text"),R=v.selectAll(".chart-marker-text-bg"),q=xt("#d3chartsvg rect.event");function x(y){const ft=y/l;let nt=0,wt=0;for(;nt/e.tourLength<ft;)wt++,nt=e.chartData[wt].distance;T.text(i(e.chartData[wt].elevation)+" / "+r(nt)),P.attr("cy",d(e.chartData[wt].elevation)),nt>0&&(T.attr("display",""),R.attr("display","")),l-y<105?(R.attr("transform","translate(-100, 0)"),T.attr("transform","translate(-100, 0)")):(R.attr("transform",""),T.attr("transform","")),window.dispatchEvent(new CustomEvent("update-profile-map-dot",{detail:{item:e.chartData[wt]}}))}function p(y){const ft=aa(y);v.attr("display","").attr("transform","translate("+(ft[0]-1)+", 0)"),x(ft[0])}function w(){v.attr("display","none"),window.dispatchEvent(new CustomEvent("hide-profile-map-dot"))}let N=!1,Q,_t;function lt(y){y.preventDefault(),N=!0,Q=y.touches[0].clientX,_t=v.attr("transform")?parseFloat(v.attr("transform").replace("translate(","").replace(")","").split(",")[0]):0}function ut(y){y.preventDefault(),N=!1}function ct(y){if(y.preventDefault(),N){const ft=y.touches[0].clientX-Q,nt=_t+ft;v.attr("display","").attr("transform","translate("+nt+", 0)"),x(nt)}}document.documentElement.classList.contains("touchevents")?(v.attr("display",""),T.attr("display","none"),R.attr("display","none"),q.attr("display","none"),xt(".chart-drag").on("touchstart",y=>lt(y)).on("touchmove",y=>ct(y)).on("touchend",y=>ut(y))):q.on("mousemove",y=>p(y)).on("mouseout",w)}return(o,s)=>(C(),A("div",_s,[I("div",ws,[xs,I("div",bs,[(C(!0),A(nn,null,rn(t.surfaceTypes,u=>(C(),A("div",{key:u.label,class:"map-popover__elevation-surface",style:Un("--elevation-surface-color: #"+u.color)},[I("span",null,z(u.label),1)],4))),128))])])]))}},Cs=["data-id","data-href"],Ms={class:"map-popover__teaser-content"},Es={key:1,class:"map-popover__teaser-image"},$s=["src"],Ss=["href"],Is={key:3,class:"map-popover__teaser-text"},As={class:"copyright copyright--below"},Ns={class:"copyright__text"},Ps={key:0},Ts={key:1},Ls={__name:"Teaser",props:{teaser:{type:Object,required:!0}},setup(t){return(e,n)=>(C(),A("div",{class:"map-popover__teaser","data-id":t.teaser.id,"data-href":t.teaser.url},[I("div",Ms,[t.teaser.icon?(C(),O(nr,{key:0,modifier:"map-popover__teaser-icon",name:t.teaser.icon},null,8,["name"])):S("v-if",!0),t.teaser.imageUrl?(C(),A("figure",Es,[I("img",{src:t.teaser.imageUrl,alt:"",height:"64"},null,8,$s)])):S("v-if",!0),t.teaser.url?(C(),A("a",{key:2,href:t.teaser.url,class:"map-popover__teaser-text"},z(t.teaser.title),9,Ss)):(C(),A("div",Is,z(t.teaser.title),1))]),I("footer",As,[I("small",Ns,[t.teaser.imageCopyright?(C(),A("span",Ps,z(t.teaser.imageCopyright),1)):(C(),A("span",Ts,[Zn(" "),S(" placeholder spacing ")]))])])],8,Cs))}},Fs={class:"map-popover__slider-lane"},Rs={__name:"TeaserSlider",props:{teasers:{type:Array,required:!0},mapElement:{type:Object,required:!0}},setup(t){const e=t,n=ht(null);return ve(()=>{e.mapElement.addEventListener("marker-click",r=>{const i=r.detail.id,a=n.value.querySelector(".map-popover__teaser.is-active"),o=n.value.querySelector('[data-id="'+i+'"]');a?a.classList.remove("is-active"):o&&(o.classList.add("is-active"),o.scrollIntoView({behavior:"smooth",block:"center",inline:"center"}))})}),(r,i)=>(C(),A("div",{ref_key:"slider",ref:n,class:"map-popover__slider"},[I("div",Fs,[(C(!0),A(nn,null,rn(t.teasers,a=>(C(),A("div",{key:a.id,class:"map-popover__slider-item"},[Kn(Ls,{teaser:a},null,8,["teaser"])]))),128))])],512))}},zs={class:"map-popover__content"},Ds={class:"map-popover__filter-bar"},Bs={class:"btn__text"},Os={class:"btn__text"},qs={class:"btn__text"},Hs={class:"btn__text"},Vs={class:"btn__text"},Xs={class:"btn__text"},Gs={class:"btn__text"},Ys={class:"btn__text"},Us={class:"btn__text"},Zs={__name:"DetailFullscreenMap",props:{mapElement:{type:Object,required:!0},map:{type:Object,required:!0},wrapper:{type:Object,required:!0},dataType:{type:String,required:!0},globalId:{type:String,default:""},fullscreenCategory:{type:String,default:""},previewCategories:{type:String,default:""},availableCategories:{type:Array,default:function(){return[]}},disableElevationProfile:{type:Boolean,default:!1}},setup(t){const e=t,n=ht(!1),r=Wn({activeCategories:e.fullscreenCategory.split(",")}),i=ht(e.dataType==="Tour"&&e.globalId!==""&&!e.disableElevationProfile),a=Y(()=>r.activeCategories.includes("wa")),o=Y(()=>r.activeCategories.includes("ga")),s=Y(()=>r.activeCategories.includes("re")),u=Y(()=>r.activeCategories.includes("rc")),l=Y(()=>r.activeCategories.includes("hiking")),f=Y(()=>r.activeCategories.includes("slope")),c=Y(()=>r.activeCategories.includes("trail")),h=Y(()=>r.activeCategories.includes("sledge")),d=ht(),m=Y(()=>n.value?"":"hidden"),_=ht([]),M=ht(!1),E=Y(()=>_.value.teasers?_.value.teasers.filter(x=>r.activeCategories.includes(x.category)):[]);ve(()=>{R()});function $(){n.value=!n.value,n.value?g():k()}function g(){d.value.appendChild(e.mapElement),e.mapElement.dispatchEvent(new CustomEvent("filter-cluster",{detail:{state:"open",categories:e.fullscreenCategory.split(",")}}))}function k(){r.activeCategories=e.previewCategories.split(","),e.wrapper.appendChild(e.mapElement),e.mapElement.dispatchEvent(new CustomEvent("filter-cluster",{detail:{state:"closed",categories:r.activeCategories}}))}window.addEventListener("toggle-popover-map",x=>{x.detail&&x.detail.previewCategories&&(r.activeCategories=[x.detail.previewCategories.split(",")[0]],e.mapElement.dispatchEvent(new CustomEvent("filter-cluster",{detail:{categories:r.activeCategories}}))),$()});function v(x){x.currentTarget.blur(),i.value=!i.value}function P(x,p,w=!1){x.currentTarget.blur(),T(p,w)}function T(x,p=!1){p?(r.activeCategories.includes(x)?r.activeCategories=r.activeCategories.filter(w=>w!==x):r.activeCategories.push(x),r.activeCategories.length===0&&(r.activeCategories=[e.previewCategories.split(",")[0]])):r.activeCategories=[r.activeCategories.includes(x)?e.previewCategories.split(",")[0]:x],e.mapElement.dispatchEvent(new CustomEvent("filter-cluster",{detail:{categories:r.activeCategories}}))}async function R(){e.mapElement.dataset.fullscreenmap&&(_.value=await q(),M.value=!0)}async function q(){return await(await fetch(e.mapElement.dataset.fullscreenmap)).json()}return(x,p)=>(C(),A("div",{class:Z(["map-popover",m.value])},[I("div",{class:"map-popover__bg",onClickOnce:p[0]||(p[0]=U(w=>$(),["prevent"]))},null,32),I("div",zs,[I("div",Ds,[t.dataType==="Tour"&&!t.disableElevationProfile?(C(),A("button",{key:0,class:Z(["btn btn--filter",i.value?"is-active":""]),onClick:p[1]||(p[1]=U(w=>v(w),["prevent"]))},[i.value?(C(),O(H(J),{key:0,name:"check",modifier:"btn__icon"})):S("v-if",!0),I("span",Bs,z(x.$t("elevationProfile")),1)],2)):S("v-if",!0),t.availableCategories.includes("wa")?(C(),A("button",{key:1,class:Z(["btn btn--filter",a.value?"is-active":""]),onClick:p[2]||(p[2]=U(w=>P(w,"wa"),["prevent"]))},[a.value?(C(),O(H(J),{key:0,name:"check",modifier:"btn__icon"})):S("v-if",!0),I("span",Os,z(x.$t("waypoints")),1)],2)):S("v-if",!0),t.availableCategories.includes("ga")?(C(),A("button",{key:2,class:Z(["btn btn--filter",o.value?"is-active":""]),onClick:p[3]||(p[3]=U(w=>P(w,"ga"),["prevent"]))},[o.value?(C(),O(H(J),{key:0,name:"check",modifier:"btn__icon"})):S("v-if",!0),I("span",qs,z(x.$t("gastro")),1)],2)):S("v-if",!0),t.availableCategories.includes("re")?(C(),A("button",{key:3,class:Z(["btn btn--filter",s.value?"is-active":""]),onClick:p[4]||(p[4]=U(w=>P(w,"re"),["prevent"]))},[s.value?(C(),O(H(J),{key:0,name:"check",modifier:"btn__icon"})):S("v-if",!0),I("span",Hs,z(x.$t("nearby")),1)],2)):S("v-if",!0),t.availableCategories.includes("rc")?(C(),A("button",{key:4,class:Z(["btn btn--filter",u.value?"is-active":""]),onClick:p[5]||(p[5]=U(w=>P(w,"rc"),["prevent"]))},[u.value?(C(),O(H(J),{key:0,name:"check",modifier:"btn__icon"})):S("v-if",!0),I("span",Vs,z(x.$t("recommended")),1)],2)):S("v-if",!0),t.availableCategories.includes("hiking")?(C(),A("button",{key:5,class:Z(["btn btn--filter",l.value?"is-active":""]),onClick:p[6]||(p[6]=U(w=>P(w,"hiking",!0),["prevent"]))},[l.value?(C(),O(H(J),{key:0,name:"check",modifier:"btn__icon"})):S("v-if",!0),I("span",Xs,z(x.$t("hiking")),1)],2)):S("v-if",!0),t.availableCategories.includes("slope")?(C(),A("button",{key:6,class:Z(["btn btn--filter",f.value?"is-active":""]),onClick:p[7]||(p[7]=U(w=>P(w,"slope",!0),["prevent"]))},[f.value?(C(),O(H(J),{key:0,name:"check",modifier:"btn__icon"})):S("v-if",!0),I("span",Gs,z(x.$t("slope")),1)],2)):S("v-if",!0),t.availableCategories.includes("sledge")?(C(),A("button",{key:7,class:Z(["btn btn--filter",h.value?"is-active":""]),onClick:p[8]||(p[8]=U(w=>P(w,"sledge",!0),["prevent"]))},[h.value?(C(),O(H(J),{key:0,name:"check",modifier:"btn__icon"})):S("v-if",!0),I("span",Ys,z(x.$t("sledge")),1)],2)):S("v-if",!0),t.availableCategories.includes("trail")?(C(),A("button",{key:8,class:Z(["btn btn--filter",c.value?"is-active":""]),onClick:p[9]||(p[9]=U(w=>P(w,"trail",!0),["prevent"]))},[c.value?(C(),O(H(J),{key:0,name:"check",modifier:"btn__icon"})):S("v-if",!0),I("span",Us,z(x.$t("trail")),1)],2)):S("v-if",!0)]),I("div",{ref_key:"containerInner",ref:d,class:"map-popover__map"},[E.value.length>0?(C(),O(H(Rs),{key:0,"map-element":t.mapElement,teasers:E.value},null,8,["map-element","teasers"])):S("v-if",!0)],512),i.value&&M.value?(C(),O(H(ks),{key:0,"map-element":t.mapElement,"global-id":t.globalId,"surface-types":_.value.surfaceTypes,"tour-length":_.value.tourLength,"chart-data":_.value.tourChartData},null,8,["map-element","global-id","surface-types","tour-length","chart-data"])):S("v-if",!0)])],2))}},Ks=Zs;class Ws{constructor(e,n,r,i){b(this,"popoverContainer");b(this,"wrapper");b(this,"map");b(this,"labels");b(this,"closePopoverContainer");b(this,"isFirst");this.wrapper=e,this.map=n,this.labels=r,this.isFirst=i}onAdd(e){return this._dataType=this.wrapper.dataset.mapType??"",this._map=e,this.isFirst&&this._initVueApp(),this._createButton(),this.closePopoverContainer=()=>this._closePopoverContainer(),this._container}onRemove(){this._container.parentNode.removeChild(this._container)}_createButton(){const e=document.head.querySelector('meta[name="iconpath"]').content;this._container=document.createElement("div"),this._container.className="map__control maplibregl-ctrl",this._container.innerHTML=`
    <button class="map__control-btn">
      <i class="icon" aria-hidden="true">
        <svg class="icon__svg map__popover-open" crossOrigin="anonymous" data-url="/dist/svg/${e}/maximize.svg"></svg>
        <svg class="icon__svg map__popover-close" crossOrigin="anonymous" data-url="/dist/svg/${e}/close.svg"></svg>
      </i>
    </button>`,this._container.addEventListener("click",this._togglePopoverContainer.bind(this))}_togglePopoverContainer(){window.dispatchEvent(new CustomEvent("toggle-popover-map"))}_initVueApp(){const e=document.createElement("div");e.className="js-detail-map-fullscreen-app",document.body.append(e);const n={};n[document.documentElement.lang]=this.labels;const r=jn({locale:document.documentElement.lang,messages:n,globalInjection:!0,legacy:!1}),i=Qn({setup(){const{t:a,locale:o}=tr();return{t:a,locale:o}},render:()=>Jn(Ks,{mapElement:this.map,map:this._map,wrapper:this.wrapper,dataType:this._dataType,globalId:this.map.dataset.globalid??"",fullscreenCategory:this.map.dataset.fullscreenCategory,previewCategories:this.map.dataset.previewCategories,availableCategories:this.map.dataset.availableCategories.split(",")??[],disableElevationProfile:parseInt(this.map.dataset.disableElevationProfile)===1})});i.use(r),i.mount(e)}}class Qs{constructor(e=[],n={}){this.styles=e,this.onChange=n.onChange||(()=>{})}onAdd(e){return this._map=e,this._createControlContainer(),this._createButtonContainer(),this._createModalContainer(),this._createModalItemContainers(),document.addEventListener("click",n=>this._onDocumentClick(n)),this._container}onRemove(){this._container.parentNode.removeChild(this._container),this._map=void 0}_createControlContainer(){this._container=document.createElement("div"),this._container.className="map__control maplibregl-ctrl maplibregl-ctrl-style-switcher"}_createButtonContainer(){const e=document.head.querySelector('meta[name="iconpath"]').content;this._button=document.createElement("button"),this._button.className="map__control-btn",this._button.innerHTML=`<i class="icon" aria-hidden="true">
        <svg class="icon__svg" data-url="/dist/svg/${e}/filled_map.svg"></svg>
      </i>`,this._button.addEventListener("click",()=>this._openMenu()),this._container.appendChild(this._button)}_createModalContainer(){this._menu=document.createElement("div"),this._menu.className="map__control-list",this._menu.style.display="none",this._container.appendChild(this._menu)}_createModalItemContainers(){this.styleElements=[];for(const e of this.styles){const n=document.createElement("div");n.className="map__control-list-item text-link",n.textContent=e.title,n.addEventListener("click",()=>this._selectStyle(n,e)),this._menu.appendChild(n),this.styleElements.push(n),e.active&&n.classList.add("map__control-list-item--active")}}_selectStyle(e,n){this._closeMenu(),this._resetStyleElements(),this._map.setStyle(n.uri),e.classList.add("map__control-list-item--active"),this.onChange()}_openMenu(){this._button.style.display="none",this._menu.style.display=""}_closeMenu(){this._button.style.display="",this._menu.style.display="none"}_resetStyleElements(){for(const e of this.styleElements)e.classList.remove("map__control-list-item--active")}_onDocumentClick(e){this._container.contains(e.target)||this._closeMenu()}}const ie=new Map,tn=t=>(ie.has(t)===!1&&ie.set(t,getComputedStyle(document.documentElement).getPropertyValue(t)),ie.get(t));class Js{constructor(e,n,r={},i={}){b(this,"map");b(this,"id");b(this,"sourceId");b(this,"layerId");b(this,"data",{type:"FeatureCollection",features:[]});b(this,"fitBounds",!1);b(this,"options");this.map=e,this.id=n,this.options=i,this.data=r||this.data,this.sourceId=`${n}-polyline-source`,this.layerId=`${n}-polyline-layer`,this.fitBounds="fitBounds"in i?i.fitBounds:this.fitBounds}addToMap(){const{instance:e}=this.map;this._addSourceToMap(e),this._addClusterLayerToMap(e)}updateData(e){this.data=e;const n=this.map.instance.getSource(this.sourceId);n&&n.setData(e)}_addSourceToMap(e){e.getSource(this.sourceId)||(e.addSource(this.sourceId,{type:"geojson",data:this.data}),e.addSource(this.sourceId+"-dot",{type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[10.87,48.03]}}]}}))}_addClusterLayerToMap(e){e.getLayer(this.layerId)&&e.removeLayer(this.layerId),e.addLayer({id:this.layerId,type:"line",source:this.sourceId,layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":tn("--map-line-bg-color"),"line-width":parseInt(tn("--map-line-width"))}}),e.addLayer({id:this.layerId+"-dot",source:this.sourceId+"-dot",type:"circle",layout:{visibility:"none"},paint:{"circle-radius":12,"circle-color":this.options.profileDotColor,"circle-stroke-color":"#000000","circle-stroke-width":2}}),e.addLayer({id:this.layerId+"-dot-outer",source:this.sourceId+"-dot",type:"circle",layout:{visibility:"none"},paint:{"circle-radius":24,"circle-color":this.options.profileDotColor,"circle-opacity":.3}})}}const js=rr(),en={map:{default:"Map",de:"Karte"},terrain:{default:"Terrain",de:"Gelände"},winter:{default:"Winter",de:"Winter"},satellite:{default:"Satellite",de:"Satellit"},mobileHelpText:{default:"Use two fingers to move the map",de:"Mit zwei Fingern scrollen, um die Karte zu bewegen"},windowsHelpText:{default:"Use &bdquo;CTRL&ldquo; and scroll to zoom the map",de:"Halten Sie die Taste &bdquo;STRG&ldquo; gedrückt beim Scrollen, um in der Karte zu vergrößern."},macHelpText:{default:"Use &bdquo;⌘&ldquo; and scroll to zoom the map",de:"Halten Sie die Taste &bdquo;⌘&ldquo; gedrückt beim Scrollen, um in der Karte zu vergrößern."}},et=t=>{if(Object.prototype.hasOwnProperty.call(en,t)===!1)return"";const e=en[t];return e[js]||e.default||""},tl=t=>{let e=180,n=90,r=-180,i=-90;return t.forEach(([a,o,s,u])=>{!a||!o||!s||!u||(a<e&&(e=a),o<n&&(n=o),s>r&&(r=s),u>i&&(i=u))}),[e,n,r,i]};function Vn(t,e,n){if(t!==null)for(var r,i,a,o,s,u,l,f=0,c=0,h,d=t.type,m=d==="FeatureCollection",_=d==="Feature",M=m?t.features.length:1,E=0;E<M;E++){l=m?t.features[E].geometry:_?t.geometry:t,h=l?l.type==="GeometryCollection":!1,s=h?l.geometries.length:1;for(var $=0;$<s;$++){var g=0,k=0;if(o=h?l.geometries[$]:l,o!==null){u=o.coordinates;var v=o.type;switch(f=n&&(v==="Polygon"||v==="MultiPolygon")?1:0,v){case null:break;case"Point":if(e(u,c,E,g,k)===!1)return!1;c++,g++;break;case"LineString":case"MultiPoint":for(r=0;r<u.length;r++){if(e(u[r],c,E,g,k)===!1)return!1;c++,v==="MultiPoint"&&g++}v==="LineString"&&g++;break;case"Polygon":case"MultiLineString":for(r=0;r<u.length;r++){for(i=0;i<u[r].length-f;i++){if(e(u[r][i],c,E,g,k)===!1)return!1;c++}v==="MultiLineString"&&g++,v==="Polygon"&&k++}v==="Polygon"&&g++;break;case"MultiPolygon":for(r=0;r<u.length;r++){for(k=0,i=0;i<u[r].length;i++){for(a=0;a<u[r][i].length-f;a++){if(e(u[r][i][a],c,E,g,k)===!1)return!1;c++}k++}g++}break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(Vn(o.geometries[r],e,n)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function $t(t){var e=[1/0,1/0,-1/0,-1/0];return Vn(t,function(n){e[0]>n[0]&&(e[0]=n[0]),e[1]>n[1]&&(e[1]=n[1]),e[2]<n[0]&&(e[2]=n[0]),e[3]<n[1]&&(e[3]=n[1])}),e}$t.default=$t;let dt=null;const el=async()=>(dt===null&&(dt=async function(){return dt=await Yn(()=>import("./maplibre-gl-e4f5785c.js").then(t=>t.m),["js/maplibre-gl-e4f5785c.js","js/_commonjsHelpers-725317a4.js"]),dt}()),dt);class hl{constructor(e,{disablePopoverMap:n,disableStyleSwitcher:r,defaultStyle:i,...a}){b(this,"container");b(this,"options");b(this,"instance",null);b(this,"geojson");b(this,"clusters",new Map);b(this,"markers",new Map);b(this,"popupOffset",50);b(this,"polyline",new Map);b(this,"controls",[]);b(this,"popoverControl",null);b(this,"labels",[]);b(this,"disablePopoverMap",!1);b(this,"isFirst",!1);b(this,"defaultStyle","");b(this,"settings");this.container=e,this.options=a,this.disablePopoverMap=n,this.defaultStyle=i,this._addStyleSwitchControl(r),this._setPopupOffset(39,52),this._addLoadingIndicator()}_addLoadingIndicator(){const e=document.createElement("div");e.className="map__loading-indicator",e.innerHTML='<div class="loading-indicator"><div class="loading-indicator__inner" /></div>',this.container.appendChild(e)}async initialize(){await this._createInstance(),this._addPopoverMapControl(this.disablePopoverMap),this._registerResizeObserver(),this._addFeaturesToMap(),this._addMapControls()}setGeojson(e){this.geojson=e}setCluster(e,n=null,r={}){if(this.clusters.has(e)){const i=this.clusters.get(e);"fitBounds"in r&&(i.fitBounds=r.fitBounds),n&&i.updateData(n)}else this.clusters.set(e,new ar(this,e,n,r))}getCluster(e){return this.clusters.get(e)}setLabels(e){this.labels=e}getLabels(){return this.labels}setIsFirst(e){this.isFirst=e}getIsFirst(){return this.isFirst}setPolyline(e,n=null,r={}){if(this.polyline.has(e)){const i=this.polyline.get(e);n&&i.updateData(n)}else this.polyline.set(e,new Js(this,e,n,r))}setLayerVisibility(e,n){this.instance.setLayoutProperty(e,"visibility",n?"visible":"none")}showProfileMapDot(e,n){const r=this.instance.getSource("polyline-polyline-source-dot");r&&(r.setData({type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[e,n]}}]}),this.instance.setLayoutProperty("polyline-polyline-layer-dot","visibility","visible"),this.instance.setLayoutProperty("polyline-polyline-layer-dot-outer","visibility","visible"))}hideProfileMapDot(){this.instance.setLayoutProperty("polyline-polyline-layer-dot","visibility","none"),this.instance.setLayoutProperty("polyline-polyline-layer-dot-outer","visibility","none")}fitBounds(e={},n=null){const r=[];for(const i of this.clusters.values())if(i.fitBounds)if(n){const a={type:"FeatureCollection",features:[]};i.data.features.forEach(o=>{n.includes(o.properties.category)&&a.features.push(o)}),r.push($t(a))}else r.push($t(i.data));for(const i of this.polyline.values())i.fitBounds&&r.push($t(i.data));r.length>0?this.instance.fitBounds(tl(r),{padding:100,duration:0,...e}):this.options.center&&this.instance.setCenter(this.options.center)}async getMarkerId(e){for(const n of this.clusters.values()){if(!this.instance.isSourceLoaded(n.sourceId))return;const r=this.instance.getSource(n.sourceId),i=this.instance.querySourceFeatures(n.sourceId),a=this._findIdInFeatures(e,i,r);if(a)return a}return!1}_setPopupOffset(e,n){this.popupOffset={top:[0,0],"top-left":[e*.35,-n*.15],"top-right":[-e*.35,-n*.15],bottom:[0,-n],"bottom-left":[e*.35,-n*.85],"bottom-right":[-e*.35,-n*.85],left:[e*.5,-n*.5],right:[-e*.5,-n*.5]}}async _findIdInFeatures(e,n,r){for(const i of n){const a=i.properties.id||i.properties.cluster_id;if(a===e||i.properties.cluster&&await this._isIdInCluster(e,i,r))return a}return!1}async _isIdInCluster(e,n,r){return new Promise((i,a)=>{r.getClusterLeaves(n.properties.cluster_id,n.properties.point_count,0,(o,s)=>{o&&a(new Error(o)),i(this._findIdInFeatures(e,s,r))})})}_addPopoverMapControl(e){e||(this.popoverControl=new Ws(this.container.parentNode,this.container,this.getLabels(),this.getIsFirst()),this.controls.push(this.popoverControl))}_addStyleSwitchControl(e){if(e)return;let n=[{title:et("map"),uri:"https://omt-cdn.ecmaps.de/api/maps/bright/style.json",active:this.options.style==="https://omt-cdn.ecmaps.de/api/maps/bright/style.json"},{title:et("terrain"),uri:"https://omt-cdn.ecmaps.de/api/maps/topo-v2/style.json",active:this.options.style==="https://omt-cdn.ecmaps.de/api/maps/topo-v2/style.json"},{title:et("winter"),uri:"https://api.maptiler.com/maps/winter/style.json?key=HGbT8c4ig4QG0RucJkjp",active:this.options.style==="https://api.maptiler.com/maps/winter/style.json?key=HGbT8c4ig4QG0RucJkjp"},{title:et("satellite"),uri:"https://api.maptiler.com/maps/hybrid/style.json?key=BNVQnxsTPmM6e4z17FxE",active:this.options.style==="https://api.maptiler.com/maps/hybrid/style.json?key=BNVQnxsTPmM6e4z17FxE"}];Object.prototype.hasOwnProperty.call(this.options,"customStyles")&&(n=[],this.options.customStyles.forEach(i=>{n.push({title:et(i.id),uri:i.uri,active:i.uri===this.options.style})}));const r=new Qs(n,{onChange:()=>{this.instance.once("idle",()=>{this._addFeaturesToMap()})}});this.controls.push(r)}_addMapControls(){for(const e of this.controls)this.instance.addControl(e);this.instance.addControl(new dt.NavigationControl,"top-left")}_registerResizeObserver(){new ResizeObserver(()=>{this.instance.resize()}).observe(this.container)}_addFeaturesToMap(){for(const e of this.clusters.values())e.addToMap();for(const e of this.polyline.values())e.addToMap()}async _createInstance(){if(this.instance)return;const e=await el(),n=this._getMapOptions();return this.defaultStyle==="winter"&&(n.style=D.defaultWinterStyle),this.instance=new e.Map(n),new Promise((r,i)=>{this.instance.once("load",()=>r()),this.instance.on("error",()=>i(new Error("Map could not be loaded")))})}_getMapOptions(){return{container:this.container,style:D.defaultStyle,zoom:D.defaultZoom,maxZoom:D.defaultMaxZoom,center:D.defaultCenter,localIdeographFontFamily:D.localIdeographFontFamily,cooperativeGestures:{mobileHelpText:et("mobileHelpText"),windowsHelpText:et("windowsHelpText"),macHelpText:et("macHelpText")},...this.options||{}}}}export{hl as default};