@mattilsynet/design 3.0.2 → 3.0.4
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.
- package/mtds/atlas/atlas-element.js +1 -1
- package/mtds/atlas.iife.js +1 -1
- package/mtds/chart/chart-element.js +25 -26
- package/mtds/chart/chart-element.js.map +1 -1
- package/mtds/index.iife.js +65 -35
- package/mtds/law/law-helper.d.ts +2 -0
- package/mtds/law/law-helper.js +72 -70
- package/mtds/law/law-helper.js.map +1 -1
- package/mtds/law/law.js +7 -6
- package/mtds/law/law.js.map +1 -1
- package/mtds/package.json.js +1 -1
- package/mtds/print/print.css.js +50 -20
- package/mtds/print/print.css.js.map +1 -1
- package/mtds/styles.css +1 -1
- package/mtds/utils.d.ts +2 -2
- package/mtds/utils.js +17 -20
- package/mtds/utils.js.map +1 -1
- package/package.json +9 -9
package/mtds/atlas.iife.js
CHANGED
|
@@ -600,7 +600,7 @@ path.leaflet-interactive:focus:not(:focus-visible) {
|
|
|
600
600
|
print-color-adjust: exact;
|
|
601
601
|
}
|
|
602
602
|
}
|
|
603
|
-
`;_.MarkerClusterGroup=_.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(n){_.Util.setOptions(this,n),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this.options.clusterPane||(this.options.clusterPane=_.Marker.prototype.options.pane),this._featureGroup=new _.FeatureGroup,this._featureGroup.addEventParent(this),this._nonPointGroup=new _.FeatureGroup,this._nonPointGroup.addEventParent(this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[],this._childMarkerEventHandlers={dragstart:this._childMarkerDragStart,move:this._childMarkerMoved,dragend:this._childMarkerDragEnd};var t=_.DomUtil.TRANSITION&&this.options.animate;Object.assign(this,t?this._withAnimation:this._noAnimation),this._markerCluster=t?_.MarkerCluster:_.MarkerClusterNonAnimated},addLayer:function(n){if(n instanceof _.LayerGroup)return this.addLayers([n]);if(!n.getLatLng)return this._nonPointGroup.addLayer(n),this.fire("layeradd",{layer:n,propagatedFrom:n}),this;if(!this._map)return this._needsClustering.push(n),this.fire("layeradd",{layer:n,propagatedFrom:n}),this;if(this.hasLayer(n))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(n,this._maxZoom),this.fire("layeradd",{layer:n,propagatedFrom:n}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();var t=n,e=this._zoom;if(n.__parent)for(;t.__parent._zoom>=e;)t=t.__parent;return this._currentShownBounds.contains(t.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(n,t):this._animationAddLayerNonAnimated(n,t)),this},removeLayer:function(n){return n instanceof _.LayerGroup?this.removeLayers([n]):n.getLatLng?this._map?n.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(n)),this._removeLayer(n,!0),this.fire("layerremove",{layer:n,propagatedFrom:n}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),n.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(n)&&(this._featureGroup.removeLayer(n),n.clusterShow&&n.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,n)&&this.hasLayer(n)&&this._needsRemoving.push({layer:n,latlng:n._latlng}),this.fire("layerremove",{layer:n,propagatedFrom:n}),this):(this._nonPointGroup.removeLayer(n),this.fire("layerremove",{layer:n,propagatedFrom:n}),this)},addLayers:function(n,t){if(!Array.isArray(n))return this.addLayer(n);var e=this._featureGroup,i=this._nonPointGroup,s=this.options.chunkedLoading,o=this.options.chunkInterval,r=this.options.chunkProgress,a=n.length,l=0,h=!0,d;if(this._map){const c=Date.now(),u=()=>{for(var p=Date.now();l<a&&!(s&&l%200===0&&Date.now()-p>o);l++){if(d=n[l],d instanceof _.LayerGroup){h&&(n=n.slice(),h=!1),this._extractNonGroupLayers(d,n),a=n.length;continue}if(!d.getLatLng){i.addLayer(d),t||this.fire("layeradd",{layer:d,propagatedFrom:d});continue}if(!this.hasLayer(d)&&(this._addLayer(d,this._maxZoom),t||this.fire("layeradd",{layer:d,propagatedFrom:d}),d.__parent&&d.__parent.getChildCount()===2)){const y=d.__parent.getAllChildMarkers(),g=y[0]===d?y[1]:y[0];e.removeLayer(g)}}r&&r(l,a,Date.now()-c),l===a?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(u,this.options.chunkDelay)};u()}else{const c=this._needsClustering;for(;l<a;l++){if(d=n[l],d instanceof _.LayerGroup){h&&(n=n.slice(),h=!1),this._extractNonGroupLayers(d,n),a=n.length;continue}if(!d.getLatLng){i.addLayer(d);continue}this.hasLayer(d)||c.push(d)}}return this},removeLayers:function(n){var t,e,i=n.length,s=this._featureGroup,o=this._nonPointGroup,r=!0;if(!this._map){for(t=0;t<i;t++){if(e=n[t],e instanceof _.LayerGroup){r&&(n=n.slice(),r=!1),this._extractNonGroupLayers(e,n),i=n.length;continue}this._arraySplice(this._needsClustering,e),o.removeLayer(e),this.hasLayer(e)&&this._needsRemoving.push({layer:e,latlng:e._latlng}),this.fire("layerremove",{layer:e,propagatedFrom:e})}return this}if(this._unspiderfy){this._unspiderfy();const a=n.slice();let l=i;for(t=0;t<l;t++){if(e=a[t],e instanceof _.LayerGroup){this._extractNonGroupLayers(e,a),l=a.length;continue}this._unspiderfyLayer(e)}}for(t=0;t<i;t++){if(e=n[t],e instanceof _.LayerGroup){r&&(n=n.slice(),r=!1),this._extractNonGroupLayers(e,n),i=n.length;continue}if(!e.__parent){o.removeLayer(e),this.fire("layerremove",{layer:e,propagatedFrom:e});continue}this._removeLayer(e,!0,!0),this.fire("layerremove",{layer:e,propagatedFrom:e}),s.hasLayer(e)&&(s.removeLayer(e),e.clusterShow&&e.clusterShow())}return this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},clearLayers:function(){return this._map||(this._needsClustering=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(n){n.off(this._childMarkerEventHandlers,this),delete n.__parent},this),this._map&&this._generateInitialClusters(),this},getBounds:function(){var n=new _.LatLngBounds;this._topClusterLevel&&n.extend(this._topClusterLevel._bounds);for(let t=this._needsClustering.length-1;t>=0;t--)n.extend(this._needsClustering[t].getLatLng());return n.extend(this._nonPointGroup.getBounds()),n},eachLayer:function(n,t){var e=this._needsClustering.slice(),i=this._needsRemoving,s,o,r;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(e),o=e.length-1;o>=0;o--){for(s=!0,r=i.length-1;r>=0;r--)if(i[r].layer===e[o]){s=!1;break}s&&n.call(t,e[o])}this._nonPointGroup.eachLayer(n,t)},getLayers:function(){var n=[];return this.eachLayer(t=>{n.push(t)}),n},getLayer:function(n){var t=null;return n=parseInt(n,10),this.eachLayer(e=>{_.stamp(e)===n&&(t=e)}),t},hasLayer:function(n){if(!n)return!1;var t,e=this._needsClustering;for(t=e.length-1;t>=0;t--)if(e[t]===n)return!0;for(e=this._needsRemoving,t=e.length-1;t>=0;t--)if(e[t].layer===n)return!1;return!!(n.__parent&&n.__parent._group===this)||this._nonPointGroup.hasLayer(n)},zoomToShowLayer:function(n,t){typeof t!="function"&&(t=()=>{});var e=function(){(n._icon||n.__parent._icon)&&!this._inZoomAnimation&&(this._map.off("moveend",e,this),this.off("animationend",e,this),n._icon?t():n.__parent._icon&&(this.once("spiderfied",t,this),n.__parent.spiderfy()))};n._icon&&this._map.getBounds().contains(n.getLatLng())?t():n.__parent._zoom<Math.round(this._map._zoom)?(this._map.on("moveend",e,this),this._map.panTo(n.getLatLng())):(this._map.on("moveend",e,this),this.on("animationend",e,this),n.__parent.zoomToBounds())},onAdd:function(n){this._map=n;var t,e,i;if(!Number.isFinite(this._map.getMaxZoom()))throw"Map has no maxZoom specified";for(this._featureGroup.addTo(n),this._nonPointGroup.addTo(n),this._gridClusters||this._generateInitialClusters(),this._maxLat=n.options.crs.projection.MAX_LATITUDE,t=0,e=this._needsRemoving.length;t<e;t++)i=this._needsRemoving[t],i.newlatlng=i.layer._latlng,i.layer._latlng=i.latlng;for(t=0,e=this._needsRemoving.length;t<e;t++)i=this._needsRemoving[t],this._removeLayer(i.layer,!0),i.layer._latlng=i.newlatlng;this._needsRemoving=[],this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds(),this._map.on("zoomend",this._zoomEnd,this),this._map.on("moveend",this._moveEnd,this),this._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),e=this._needsClustering,this._needsClustering=[],this.addLayers(e,!0)},onRemove:function(n){n.off("zoomend",this._zoomEnd,this),n.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this._spiderfierOnRemove&&this._spiderfierOnRemove(),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent:n=>{for(var t=n;t&&!t._icon;)t=t.__parent;return t||null},_arraySplice:(n,t)=>{for(let e=n.length-1;e>=0;e--)if(n[e]===t)return n.splice(e,1),!0},_removeFromGridUnclustered:function(n,t){for(var e=this._map,i=this._gridUnclustered,s=Math.floor(this._map.getMinZoom());t>=s&&i[t].removeObject(n,e.project(n.getLatLng(),t));t--);},_childMarkerDragStart:n=>{n.target.__dragStart=n.target._latlng},_childMarkerMoved:function(n){if(!this._ignoreMove&&!n.target.__dragStart){const t=(n.target._popup||null)?.isOpen();this._moveChild(n.target,n.oldLatLng,n.latlng),t&&n.target.openPopup()}},_moveChild:function(n,t,e){n._latlng=t,this.removeLayer(n),n._latlng=e,this.addLayer(n)},_childMarkerDragEnd:function(n){n.target.__dragStart&&this._moveChild(n.target,n.target.__dragStart,n.target._latlng),delete n.target.__dragStart},_removeLayer:function(n,t,e){var i=this._gridClusters,s=this._gridUnclustered,o=this._featureGroup,r=this._map,a=Math.floor(this._map.getMinZoom());t&&this._removeFromGridUnclustered(n,this._maxZoom);var l=n.__parent,h=l._markers,d;for(this._arraySplice(h,n);l&&(l._childCount--,l._boundsNeedUpdate=!0,!(l._zoom<a));)t&&l._childCount<=1?(d=l._markers[0]===n?l._markers[1]:l._markers[0],i[l._zoom].removeObject(l,r.project(l._cLatLng,l._zoom)),s[l._zoom].addObject(d,r.project(d.getLatLng(),l._zoom)),this._arraySplice(l.__parent._childClusters,l),l.__parent._markers.push(d),d.__parent=l.__parent,l._icon&&(o.removeLayer(l),e||o.addLayer(d))):l._iconNeedsUpdate=!0,l=l.__parent;delete n.__parent},_isOrIsParent:(n,t)=>{for(;t;){if(n===t)return!0;t=t.parentNode}return!1},fire:function(n,t,e){if(t&&t.propagatedFrom instanceof _.MarkerCluster){if(t.originalEvent&&this._isOrIsParent(t.propagatedFrom._icon,t.originalEvent.relatedTarget))return;n=`cluster${n}`}_.FeatureGroup.prototype.fire.call(this,n,t,e)},listens:function(n,t){return _.FeatureGroup.prototype.listens.call(this,n,t)||_.FeatureGroup.prototype.listens.call(this,`cluster${n}`,t)},_defaultIconCreateFunction:n=>{const t=n.getChildCount();let e=" marker-cluster-";return t<10?e+="small":t<100?e+="medium":e+="large",new _.DivIcon({html:`<div><span>${t}</span></div>`,className:`marker-cluster ${e}`,iconSize:new _.Point(40,40)})},_bindEvents:function(){var n=this._map,t=this.options.spiderfyOnMaxZoom,e=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick;(t||i)&&this.on("clusterclick",this._zoomOrSpiderfy,this),e&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),n.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(n){const t=n.propagatedFrom;let e=t;for(;e._childClusters.length===1;)e=e._childClusters[0];e._zoom===this._maxZoom&&e._childCount===t._childCount&&this.options.spiderfyOnMaxZoom?t.spiderfy():this.options.zoomToBoundsOnClick&&t.zoomToBounds(),n.originalEvent&&n.originalEvent.keyCode===13&&this._map._container.focus()},_showCoverage:function(n){var t=this._map;this._inZoomAnimation||(this._shownPolygon&&t.removeLayer(this._shownPolygon),n.propagatedFrom.getChildCount()>2&&n.propagatedFrom!==this._spiderfied&&(this._shownPolygon=new _.Polygon(n.propagatedFrom.getConvexHull(),this.options.polygonOptions),t.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var n=this.options.spiderfyOnMaxZoom,t=this.options.showCoverageOnHover,e=this.options.zoomToBoundsOnClick,i=this._map;(n||e)&&this.off("clusterclick",this._zoomOrSpiderfy,this),t&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),i.off("zoomend",this._hideCoverage,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var n=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,n),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),n),this._currentShownBounds=n}},_generateInitialClusters:function(){var n=Math.ceil(this._map.getMaxZoom()),t=Math.floor(this._map.getMinZoom()),e=this.options.maxClusterRadius,i=e;typeof e!="function"&&(i=()=>e),this.options.disableClusteringAtZoom!==null&&(n=this.options.disableClusteringAtZoom-1),this._maxZoom=n,this._gridClusters={},this._gridUnclustered={};for(let s=n;s>=t;s--)this._gridClusters[s]=new _.DistanceGrid(i(s)),this._gridUnclustered[s]=new _.DistanceGrid(i(s));this._topClusterLevel=new this._markerCluster(this,t-1)},_addLayer:function(n,t){var e=this._gridClusters,i=this._gridUnclustered,s=Math.floor(this._map.getMinZoom()),o,r;for(this.options.singleMarkerMode&&this._overrideMarkerIcon(n),n.on(this._childMarkerEventHandlers,this);t>=s;t--){o=this._map.project(n.getLatLng(),t);let a=e[t].getNearObject(o);if(a){a._addChild(n),n.__parent=a;return}if(a=i[t].getNearObject(o),a){const l=a.__parent;l&&this._removeLayer(a,!1);const h=new this._markerCluster(this,t,a,n);e[t].addObject(h,this._map.project(h._cLatLng,t)),a.__parent=h,n.__parent=h;let d=h;for(r=t-1;r>l._zoom;r--)d=new this._markerCluster(this,r,d),e[r].addObject(d,this._map.project(a.getLatLng(),r));l._addChild(d),this._removeFromGridUnclustered(a,t);return}i[t].addObject(n,o)}this._topClusterLevel._addChild(n),n.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer(n=>{n instanceof _.MarkerCluster&&n._iconNeedsUpdate&&n._updateIcon()})},_enqueue:function(n){this._queue.push(n),this._queueTimeout||(this._queueTimeout=setTimeout(()=>this._processQueue(),300))},_processQueue:function(){for(let n=0;n<this._queue.length;n++)this._queue[n].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters:function(){var n=Math.round(this._map._zoom);this._processQueue(),this._zoom<n&&this._currentShownBounds.intersects(this._getExpandedVisibleBounds())?(this._animationStart(),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,this._getExpandedVisibleBounds()),this._animationZoomIn(this._zoom,n)):this._zoom>n?(this._animationStart(),this._animationZoomOut(this._zoom,n)):this._moveEnd()},_getExpandedVisibleBounds:function(){if(this.options.removeOutsideVisibleBounds){if(_.Browser.mobile)return this._checkBoundsMaxLat(this._map.getBounds())}else return this._mapBoundsInfinite;return this._checkBoundsMaxLat(this._map.getBounds().pad(1))},_checkBoundsMaxLat:function(n){var t=this._maxLat;return t!==void 0&&(n.getNorth()>=t&&(n._northEast.lat=1/0),n.getSouth()<=-t&&(n._southWest.lat=-1/0)),n},_animationAddLayerNonAnimated:function(n,t){if(t===n)this._featureGroup.addLayer(n);else if(t._childCount===2){t._addToMap();const e=t.getAllChildMarkers();this._featureGroup.removeLayer(e[0]),this._featureGroup.removeLayer(e[1])}else t._updateIcon()},_extractNonGroupLayers:function(n,t){var e=n.getLayers(),i=0,s;for(t=t||[];i<e.length;i++){if(s=e[i],s instanceof _.LayerGroup){this._extractNonGroupLayers(s,t);continue}t.push(s)}return t},_overrideMarkerIcon:function(n){return n.options.icon=this.options.iconCreateFunction({getChildCount:()=>1,getAllChildMarkers:()=>[n]}),n.options.icon}}),_.MarkerClusterGroup.include({_mapBoundsInfinite:new _.LatLngBounds(new _.LatLng(-1/0,-1/0),new _.LatLng(1/0,1/0))}),_.MarkerClusterGroup.include({_noAnimation:{_animationStart:()=>{},_animationZoomIn:function(n,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),n),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut:function(n,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),n),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer:function(n,t){this._animationAddLayerNonAnimated(n,t)}},_withAnimation:{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationZoomIn:function(n,t){var e=this._getExpandedVisibleBounds(),i=this._featureGroup,s=Math.floor(this._map.getMinZoom()),o;this._ignoreMove=!0,this._topClusterLevel._recursively(e,n,s,r=>{var a=r._latlng,l=r._markers,h;for(e.contains(a)||(a=null),r._isSingleParent()&&n+1===t?(i.removeLayer(r),r._recursivelyAddChildrenToMap(null,t,e)):(r.clusterHide(),r._recursivelyAddChildrenToMap(a,t,e)),o=l.length-1;o>=0;o--)h=l[o],e.contains(h._latlng)||i.removeLayer(h)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(e,t),i.eachLayer(r=>{!(r instanceof _.MarkerCluster)&&r._icon&&r.clusterShow()}),this._topClusterLevel._recursively(e,n,t,r=>{r._recursivelyRestoreChildPositions(t)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(e,n,s,r=>{i.removeLayer(r),r.clusterShow()}),this._animationEnd()})},_animationZoomOut:function(n,t){this._animationZoomOutSingle(this._topClusterLevel,n-1,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),n,this._getExpandedVisibleBounds())},_animationAddLayer:function(n,t){var e=this._featureGroup;e.addLayer(n),t!==n&&(t._childCount>2?(t._updateIcon(),this._forceLayout(),this._animationStart(),n._setPos(this._map.latLngToLayerPoint(t.getLatLng())),n.clusterHide(),this._enqueue(()=>{e.removeLayer(n),n.clusterShow(),this._animationEnd()})):(this._forceLayout(),this._animationStart(),this._animationZoomOutSingle(t,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(n,t,e){var i=this._getExpandedVisibleBounds(),s=Math.floor(this._map.getMinZoom());n._recursivelyAnimateChildrenInAndAddSelfToMap(i,s,t+1,e);var o=this;this._forceLayout(),n._recursivelyBecomeVisible(i,e),this._enqueue(function(){if(n._childCount===1){const r=n._markers[0];this._ignoreMove=!0,r.setLatLng(r.getLatLng()),this._ignoreMove=!1,r.clusterShow&&r.clusterShow()}else n._recursively(i,e,s,r=>{r._recursivelyRemoveChildrenFromMap(i,s,t+1)});o._animationEnd()})},_animationEnd:function(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","")),this._inZoomAnimation--,this.fire("animationend")},_forceLayout:()=>{_.Util.falseFn(document.body.offsetWidth)}}),_.MarkerCluster=_.Marker.extend({initialize:function(n,t,e,i){_.Marker.prototype.initialize.call(this,e?e._cLatLng||e.getLatLng():new _.LatLng(0,0),{icon:this,pane:n.options.clusterPane}),this._group=n,this._zoom=t,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new _.LatLngBounds,e&&this._addChild(e),i&&this._addChild(i)},getAllChildMarkers:function(n){n=n||[];for(let t=this._childClusters.length-1;t>=0;t--)this._childClusters[t].getAllChildMarkers(n);for(let t=this._markers.length-1;t>=0;t--)n.push(this._markers[t]);return n},getChildCount:function(){return this._childCount},zoomToBounds:function(n){for(var t=this._childClusters.slice(),e=this._group._map,i=e.getBoundsZoom(this._bounds),s=this._zoom+1,o=e.getZoom(),r;t.length>0&&i>s;){s++;let a=[];for(r=0;r<t.length;r++)a=a.concat(t[r]._childClusters);t=a}i>s?this._group._map.setView(this._latlng,s):i<=o?this._group._map.setView(this._latlng,o+1):this._group._map.fitBounds(this._bounds,n)},getBounds:function(){var n=new _.LatLngBounds;return n.extend(this._bounds),n},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},createIcon:function(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow:function(){return this._iconObj.createShadow()},_addChild:function(n,t){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(n),n instanceof _.MarkerCluster?(t||(this._childClusters.push(n),n.__parent=this),this._childCount+=n._childCount):(t||this._markers.push(n),this._childCount++),this.__parent&&this.__parent._addChild(n,!0)},_setClusterCenter:function(n){this._cLatLng||(this._cLatLng=n._cLatLng||n._latlng)},_resetBounds:function(){var n=this._bounds;n._southWest&&(n._southWest.lat=1/0,n._southWest.lng=1/0),n._northEast&&(n._northEast.lat=-1/0,n._northEast.lng=-1/0)},_recalculateBounds:function(){var n=this._markers,t=this._childClusters,e=0,i=0,s=this._childCount,o,r,a,l;if(s!==0){for(this._resetBounds(),o=0;o<n.length;o++)a=n[o]._latlng,this._bounds.extend(a),e+=a.lat,i+=a.lng;for(o=0;o<t.length;o++)r=t[o],r._boundsNeedUpdate&&r._recalculateBounds(),this._bounds.extend(r._bounds),a=r._wLatLng,l=r._childCount,e+=a.lat*l,i+=a.lng*l;this._latlng=this._wLatLng=new _.LatLng(e/s,i/s),this._boundsNeedUpdate=!1}},_addToMap:function(n){n&&(this._backupLatlng=this._latlng,this.setLatLng(n)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(n,t,e){this._recursively(n,this._group._map.getMinZoom(),e-1,i=>{var s=i._markers,o,r;for(o=s.length-1;o>=0;o--)r=s[o],r._icon&&(r._setPos(t),r.clusterHide())},i=>{var s=i._childClusters,o,r;for(o=s.length-1;o>=0;o--)r=s[o],r._icon&&(r._setPos(t),r.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(n,t,e,i){this._recursively(n,i,t,s=>{s._recursivelyAnimateChildrenIn(n,s._group._map.latLngToLayerPoint(s.getLatLng()).round(),e),s._isSingleParent()&&e-1===i?(s.clusterShow(),s._recursivelyRemoveChildrenFromMap(n,t,e)):s.clusterHide(),s._addToMap()})},_recursivelyBecomeVisible:function(n,t){this._recursively(n,this._group._map.getMinZoom(),t,null,e=>{e.clusterShow()})},_recursivelyAddChildrenToMap:function(n,t,e){this._recursively(e,this._group._map.getMinZoom()-1,t,i=>{if(t!==i._zoom)for(let s=i._markers.length-1;s>=0;s--){const o=i._markers[s];e.contains(o._latlng)&&(n&&(o._backupLatlng=o.getLatLng(),o.setLatLng(n),o.clusterHide&&o.clusterHide()),i._group._featureGroup.addLayer(o))}},i=>{i._addToMap(n)})},_recursivelyRestoreChildPositions:function(n){for(let t=this._markers.length-1;t>=0;t--){const e=this._markers[t];e._backupLatlng&&(e.setLatLng(e._backupLatlng),delete e._backupLatlng)}if(n-1===this._zoom)for(let t=this._childClusters.length-1;t>=0;t--)this._childClusters[t]._restorePosition();else for(let t=this._childClusters.length-1;t>=0;t--)this._childClusters[t]._recursivelyRestoreChildPositions(n)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(n,t,e,i){var s,o;this._recursively(n,t-1,e-1,r=>{for(o=r._markers.length-1;o>=0;o--)s=r._markers[o],(!i||!i.contains(s._latlng))&&(r._group._featureGroup.removeLayer(s),s.clusterShow&&s.clusterShow())},r=>{for(o=r._childClusters.length-1;o>=0;o--)s=r._childClusters[o],(!i||!i.contains(s._latlng))&&(r._group._featureGroup.removeLayer(s),s.clusterShow&&s.clusterShow())})},_recursively:function(n,t,e,i,s){var o=this._childClusters,r=this._zoom,a,l;if(t<=r&&(i&&i(this),s&&r===e&&s(this)),r<t||r<e)for(a=o.length-1;a>=0;a--)l=o[a],n.intersects(l._bounds)&&l._recursively(n,t,e,i,s)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}}),_.Marker.include({clusterHide:function(){return this.options.opacityWhenUnclustered=this.options.opacity||1,this.setOpacity(0)},clusterShow:function(){var n=this.setOpacity(this.options.opacity||this.options.opacityWhenUnclustered);return delete this.options.opacityWhenUnclustered,n}}),_.DistanceGrid=function(n){this._cellSize=n,this._sqCellSize=n*n,this._grid={},this._objectPoint={}},_.DistanceGrid.prototype={addObject:function(n,t){var e=this._getCoord(t.x),i=this._getCoord(t.y),s=this._grid;s[i]=s[i]||{};var o=s[i];o[e]=o[e]||[];var r=o[e],a=_.Util.stamp(n);this._objectPoint[a]=t,r.push(n)},updateObject:function(n,t){this.removeObject(n),this.addObject(n,t)},removeObject:function(n,t){var e=this._getCoord(t.x),i=this._getCoord(t.y),s=this._grid;s[i]=s[i]||{};var o=s[i];o[e]=o[e]||[];var r=o[e],a,l;for(delete this._objectPoint[_.Util.stamp(n)],a=0,l=r.length;a<l;a++)if(r[a]===n)return r.splice(a,1),l===1&&delete o[e],!0},eachObject:function(n,t){var e,i,s,o,r,a,l,h=this._grid;for(e in h){r=h[e];for(i in r)for(a=r[i],s=0,o=a.length;s<o;s++)l=n.call(t,a[s]),l&&(s--,o--)}},getNearObject:function(n){var t=this._getCoord(n.x),e=this._getCoord(n.y),i,s,o,r,a,l,h,d,c=this._objectPoint,u=this._sqCellSize,p=null;for(i=e-1;i<=e+1;i++)if(r=this._grid[i],r){for(s=t-1;s<=t+1;s++)if(a=r[s],a)for(o=0,l=a.length;o<l;o++)h=a[o],d=this._sqDist(c[_.Util.stamp(h)],n),d<u&&(u=d,p=h)}return p},_getCoord:function(n){return Math.floor(n/this._cellSize)},_sqDist:(n,t)=>{var e=t.x-n.x,i=t.y-n.y;return e*e+i*i}},_.QuickHull={getDistant:(n,t)=>{var e=t[1].lat-t[0].lat,i=t[0].lng-t[1].lng;return i*(n.lat-t[0].lat)+e*(n.lng-t[0].lng)},findMostDistantPointFromBaseLine:function(n,t){var e=0,i=null,s=[],o,r,a;for(o=t.length-1;o>=0;o--){if(r=t[o],a=this.getDistant(r,n),a>0)s.push(r);else continue;a>e&&(e=a,i=r)}return{maxPoint:i,newPoints:s}},buildConvexHull:function(n,t){var e=[],i=this.findMostDistantPointFromBaseLine(n,t);return i.maxPoint?(e=e.concat(this.buildConvexHull([n[0],i.maxPoint],i.newPoints)),e=e.concat(this.buildConvexHull([i.maxPoint,n[1]],i.newPoints)),e):[n[0]]},getConvexHull:function(n){var t=!1,e=!1,i=!1,s=!1,o=null,r=null,a=null,l=null,h=null,d=null,c;for(c=n.length-1;c>=0;c--){const p=n[c];(t===!1||p.lat>t)&&(o=p,t=p.lat),(e===!1||p.lat<e)&&(r=p,e=p.lat),(i===!1||p.lng>i)&&(a=p,i=p.lng),(s===!1||p.lng<s)&&(l=p,s=p.lng)}e!==t?(d=r,h=o):(d=l,h=a);var u=[].concat(this.buildConvexHull([d,h],n),this.buildConvexHull([h,d],n));return u}},_.MarkerCluster.include({getConvexHull:function(){var n=this.getAllChildMarkers(),t=[],e,i;for(i=n.length-1;i>=0;i--)e=n[i].getLatLng(),t.push(e);return _.QuickHull.getConvexHull(t)}}),_.MarkerCluster.include({_2PI:Math.PI*2,_circleFootSeparation:25,_circleStartAngle:Math.PI/6,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(!(this._group._spiderfied===this||this._group._inZoomAnimation)){var n=this.getAllChildMarkers(),t=this._group,e=t._map,i=e.latLngToLayerPoint(this._latlng),s;this._group._unspiderfy(),this._group._spiderfied=this,n.length>=this._circleSpiralSwitchover?s=this._generatePointsSpiral(n.length,i):(i.y+=10,s=this._generatePointsCircle(n.length,i)),this._animationSpiderfy(n,s)}},unspiderfy:function(n){this._group._inZoomAnimation||(this._animationUnspiderfy(n),this._group._spiderfied=null)},_generatePointsCircle:function(n,t){var e=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+n),i=e/this._2PI,s=this._2PI/n,o=[],r,a;for(o.length=n,r=n-1;r>=0;r--)a=this._circleStartAngle+r*s,o[r]=new _.Point(t.x+i*Math.cos(a),t.y+i*Math.sin(a))._round();return o},_generatePointsSpiral:function(n,t){var e=this._group.options.spiderfyDistanceMultiplier,i=e*this._spiralLengthStart,s=e*this._spiralFootSeparation,o=e*this._spiralLengthFactor*this._2PI,r=0,a=[],l;for(a.length=n,l=n-1;l>=0;l--)r+=s/i+l*5e-4,a[l]=new _.Point(t.x+i*Math.cos(r),t.y+i*Math.sin(r))._round(),i+=o/r;return a},_noanimationUnspiderfy:function(){var n=this._group,t=n._map,e=n._featureGroup,i=this.getAllChildMarkers(),s,o;for(n._ignoreMove=!0,this.setOpacity(1),o=i.length-1;o>=0;o--)s=i[o],e.removeLayer(s),s._preSpiderfyLatlng&&(s.setLatLng(s._preSpiderfyLatlng),delete s._preSpiderfyLatlng),s.setZIndexOffset&&s.setZIndexOffset(0),s._spiderLeg&&(t.removeLayer(s._spiderLeg),delete s._spiderLeg);n.fire("unspiderfied",{cluster:this,markers:i}),n._ignoreMove=!1,n._spiderfied=null}}),_.MarkerClusterNonAnimated=_.MarkerCluster.extend({_animationSpiderfy:function(n,t){var e=this._group,i=e._map,s=e._featureGroup,o=this._group.options.spiderLegPolylineOptions,r,a,l,h;for(e._ignoreMove=!0,r=0;r<n.length;r++)h=i.layerPointToLatLng(t[r]),a=n[r],l=new _.Polyline([this._latlng,h],o),i.addLayer(l),a._spiderLeg=l,a._preSpiderfyLatlng=a._latlng,a.setLatLng(h),a.setZIndexOffset&&a.setZIndexOffset(1e6),s.addLayer(a);this.setOpacity(.3),e._ignoreMove=!1,e.fire("spiderfied",{cluster:this,markers:n})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),_.MarkerCluster.include({_animationSpiderfy:function(n,t){var e=this._group,i=e._map,s=e._featureGroup,o=this._latlng,r=i.latLngToLayerPoint(o),a=_.Path.SVG,l=Object.assign({},this._group.options.spiderLegPolylineOptions),h=l.opacity,d,c,u,p,y,g;for(h===void 0&&(h=_.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),a?(l.opacity=0,l.className=`${l.className||""} leaflet-cluster-spider-leg`):l.opacity=h,e._ignoreMove=!0,d=0;d<n.length;d++)c=n[d],g=i.layerPointToLatLng(t[d]),u=new _.Polyline([o,g],l),i.addLayer(u),c._spiderLeg=u,a&&(p=u._path,y=p.getTotalLength()+.1,p.style.strokeDasharray=y,p.style.strokeDashoffset=y),c.setZIndexOffset&&c.setZIndexOffset(1e6),c.clusterHide&&c.clusterHide(),s.addLayer(c),c._setPos&&c._setPos(r);for(e._forceLayout(),e._animationStart(),d=n.length-1;d>=0;d--)g=i.layerPointToLatLng(t[d]),c=n[d],c._preSpiderfyLatlng=c._latlng,c.setLatLng(g),c.clusterShow&&c.clusterShow(),a&&(u=c._spiderLeg,p=u._path,p.style.strokeDashoffset=0,u.setStyle({opacity:h}));this.setOpacity(.3),e._ignoreMove=!1,setTimeout(()=>{e._animationEnd(),e.fire("spiderfied",{cluster:this,markers:n})},200)},_animationUnspiderfy:function(n){var t=this._group,e=t._map,i=t._featureGroup,s=n?e._latLngToNewLayerPoint(this._latlng,n.zoom,n.center):e.latLngToLayerPoint(this._latlng),o=this.getAllChildMarkers(),r=_.Path.SVG,a,l,h,d,c,u;for(t._ignoreMove=!0,t._animationStart(),this.setOpacity(1),l=o.length-1;l>=0;l--)a=o[l],a._preSpiderfyLatlng&&(a.closePopup(),a.setLatLng(a._preSpiderfyLatlng),delete a._preSpiderfyLatlng,u=!0,a._setPos&&(a._setPos(s),u=!1),a.clusterHide&&(a.clusterHide(),u=!1),u&&i.removeLayer(a),r&&(h=a._spiderLeg,d=h._path,c=d.getTotalLength()+.1,d.style.strokeDashoffset=c,h.setStyle({opacity:0})));t._ignoreMove=!1,setTimeout(()=>{var p=0;for(l=o.length-1;l>=0;l--)a=o[l],a._spiderLeg&&p++;for(l=o.length-1;l>=0;l--)a=o[l],a._spiderLeg&&(a.clusterShow&&a.clusterShow(),a.setZIndexOffset&&a.setZIndexOffset(0),p>1&&i.removeLayer(a),e.removeLayer(a._spiderLeg),delete a._spiderLeg);t._animationEnd(),t.fire("unspiderfied",{cluster:this,markers:o})},200)}}),_.MarkerClusterGroup.include({_spiderfied:null,unspiderfy:function(...n){this._unspiderfy.apply(this,n)},_spiderfierOnAdd:function(){this._map.on("click",this._unspiderfyWrapper,this),this._map.options.zoomAnimation&&this._map.on("zoomstart",this._unspiderfyZoomStart,this),this._map.on("zoomend",this._noanimationUnspiderfy,this),_.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove:function(){this._map.off("click",this._unspiderfyWrapper,this),this._map.off("zoomstart",this._unspiderfyZoomStart,this),this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._map.off("zoomend",this._noanimationUnspiderfy,this),this._noanimationUnspiderfy()},_unspiderfyZoomStart:function(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(n){this._map._mapPane.classList.contains("leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(n))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(n){this._spiderfied&&this._spiderfied.unspiderfy(n)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(n){n._spiderLeg&&(this._featureGroup.removeLayer(n),n.clusterShow&&n.clusterShow(),n.setZIndexOffset&&n.setZIndexOffset(0),this._map.removeLayer(n._spiderLeg),delete n._spiderLeg)}}),_.MarkerClusterGroup.include({refreshClusters:function(n){return n?n instanceof _.MarkerClusterGroup?n=n._topClusterLevel.getAllChildMarkers():n instanceof _.LayerGroup?n=n._layers:n instanceof _.MarkerCluster?n=n.getAllChildMarkers():n instanceof _.Marker&&(n=[n]):n=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(n),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(n),this},_flagParentsIconsNeedUpdate:n=>{var t,e;for(t in n)for(e=n[t].__parent;e;)e._iconNeedsUpdate=!0,e=e.__parent},_refreshSingleMarkerModeMarkers:function(n){var t,e;for(t in n)e=n[t],this.hasLayer(e)&&e.setIcon(this._overrideMarkerIcon(e))}}),_.Marker.include({refreshIconOptions:function(n,t){var e=this.options.icon;return _.setOptions(e,n),this.setIcon(e),t&&this.__parent&&this.__parent._group.refreshClusters(this),this}});const Ve=()=>typeof window<"u"&&typeof document<"u";function Yn(n,t){let e;return function(...i){clearTimeout(e),e=setTimeout(()=>n.apply(this,i),t)}}function A(n,t,e){return e===void 0?n.getAttribute(t)??null:(e===null?n.removeAttribute(t):n.getAttribute(t)!==e&&n.setAttribute(t,e),null)}const en=(n,...t)=>{const[e,...i]=t;for(const s of e.split(" "))n.addEventListener(s,...i);return()=>Ke(n,...t)},Ke=(n,...t)=>{const[e,...i]=t;for(const s of e.split(" "))n.removeEventListener(s,...i)},ce=(n,t,e)=>{const i=document.createElement(n);if(e&&(i.textContent=e),t)for(const[s,o]of Object.entries(t))A(i,s,o);return i},ue=typeof HTMLElement>"u"?class{}:HTMLElement,pe=(n,t)=>!Ve()||window.customElements.get(n)||window.customElements.define(n,t),Xn=`/**
|
|
603
|
+
`;_.MarkerClusterGroup=_.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(n){_.Util.setOptions(this,n),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this.options.clusterPane||(this.options.clusterPane=_.Marker.prototype.options.pane),this._featureGroup=new _.FeatureGroup,this._featureGroup.addEventParent(this),this._nonPointGroup=new _.FeatureGroup,this._nonPointGroup.addEventParent(this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[],this._childMarkerEventHandlers={dragstart:this._childMarkerDragStart,move:this._childMarkerMoved,dragend:this._childMarkerDragEnd};var t=_.DomUtil.TRANSITION&&this.options.animate;Object.assign(this,t?this._withAnimation:this._noAnimation),this._markerCluster=t?_.MarkerCluster:_.MarkerClusterNonAnimated},addLayer:function(n){if(n instanceof _.LayerGroup)return this.addLayers([n]);if(!n.getLatLng)return this._nonPointGroup.addLayer(n),this.fire("layeradd",{layer:n,propagatedFrom:n}),this;if(!this._map)return this._needsClustering.push(n),this.fire("layeradd",{layer:n,propagatedFrom:n}),this;if(this.hasLayer(n))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(n,this._maxZoom),this.fire("layeradd",{layer:n,propagatedFrom:n}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();var t=n,e=this._zoom;if(n.__parent)for(;t.__parent._zoom>=e;)t=t.__parent;return this._currentShownBounds.contains(t.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(n,t):this._animationAddLayerNonAnimated(n,t)),this},removeLayer:function(n){return n instanceof _.LayerGroup?this.removeLayers([n]):n.getLatLng?this._map?n.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(n)),this._removeLayer(n,!0),this.fire("layerremove",{layer:n,propagatedFrom:n}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),n.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(n)&&(this._featureGroup.removeLayer(n),n.clusterShow&&n.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,n)&&this.hasLayer(n)&&this._needsRemoving.push({layer:n,latlng:n._latlng}),this.fire("layerremove",{layer:n,propagatedFrom:n}),this):(this._nonPointGroup.removeLayer(n),this.fire("layerremove",{layer:n,propagatedFrom:n}),this)},addLayers:function(n,t){if(!Array.isArray(n))return this.addLayer(n);var e=this._featureGroup,i=this._nonPointGroup,s=this.options.chunkedLoading,o=this.options.chunkInterval,r=this.options.chunkProgress,a=n.length,l=0,h=!0,d;if(this._map){const c=Date.now(),u=()=>{for(var p=Date.now();l<a&&!(s&&l%200===0&&Date.now()-p>o);l++){if(d=n[l],d instanceof _.LayerGroup){h&&(n=n.slice(),h=!1),this._extractNonGroupLayers(d,n),a=n.length;continue}if(!d.getLatLng){i.addLayer(d),t||this.fire("layeradd",{layer:d,propagatedFrom:d});continue}if(!this.hasLayer(d)&&(this._addLayer(d,this._maxZoom),t||this.fire("layeradd",{layer:d,propagatedFrom:d}),d.__parent&&d.__parent.getChildCount()===2)){const y=d.__parent.getAllChildMarkers(),g=y[0]===d?y[1]:y[0];e.removeLayer(g)}}r&&r(l,a,Date.now()-c),l===a?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(u,this.options.chunkDelay)};u()}else{const c=this._needsClustering;for(;l<a;l++){if(d=n[l],d instanceof _.LayerGroup){h&&(n=n.slice(),h=!1),this._extractNonGroupLayers(d,n),a=n.length;continue}if(!d.getLatLng){i.addLayer(d);continue}this.hasLayer(d)||c.push(d)}}return this},removeLayers:function(n){var t,e,i=n.length,s=this._featureGroup,o=this._nonPointGroup,r=!0;if(!this._map){for(t=0;t<i;t++){if(e=n[t],e instanceof _.LayerGroup){r&&(n=n.slice(),r=!1),this._extractNonGroupLayers(e,n),i=n.length;continue}this._arraySplice(this._needsClustering,e),o.removeLayer(e),this.hasLayer(e)&&this._needsRemoving.push({layer:e,latlng:e._latlng}),this.fire("layerremove",{layer:e,propagatedFrom:e})}return this}if(this._unspiderfy){this._unspiderfy();const a=n.slice();let l=i;for(t=0;t<l;t++){if(e=a[t],e instanceof _.LayerGroup){this._extractNonGroupLayers(e,a),l=a.length;continue}this._unspiderfyLayer(e)}}for(t=0;t<i;t++){if(e=n[t],e instanceof _.LayerGroup){r&&(n=n.slice(),r=!1),this._extractNonGroupLayers(e,n),i=n.length;continue}if(!e.__parent){o.removeLayer(e),this.fire("layerremove",{layer:e,propagatedFrom:e});continue}this._removeLayer(e,!0,!0),this.fire("layerremove",{layer:e,propagatedFrom:e}),s.hasLayer(e)&&(s.removeLayer(e),e.clusterShow&&e.clusterShow())}return this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},clearLayers:function(){return this._map||(this._needsClustering=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(n){n.off(this._childMarkerEventHandlers,this),delete n.__parent},this),this._map&&this._generateInitialClusters(),this},getBounds:function(){var n=new _.LatLngBounds;this._topClusterLevel&&n.extend(this._topClusterLevel._bounds);for(let t=this._needsClustering.length-1;t>=0;t--)n.extend(this._needsClustering[t].getLatLng());return n.extend(this._nonPointGroup.getBounds()),n},eachLayer:function(n,t){var e=this._needsClustering.slice(),i=this._needsRemoving,s,o,r;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(e),o=e.length-1;o>=0;o--){for(s=!0,r=i.length-1;r>=0;r--)if(i[r].layer===e[o]){s=!1;break}s&&n.call(t,e[o])}this._nonPointGroup.eachLayer(n,t)},getLayers:function(){var n=[];return this.eachLayer(t=>{n.push(t)}),n},getLayer:function(n){var t=null;return n=parseInt(n,10),this.eachLayer(e=>{_.stamp(e)===n&&(t=e)}),t},hasLayer:function(n){if(!n)return!1;var t,e=this._needsClustering;for(t=e.length-1;t>=0;t--)if(e[t]===n)return!0;for(e=this._needsRemoving,t=e.length-1;t>=0;t--)if(e[t].layer===n)return!1;return!!(n.__parent&&n.__parent._group===this)||this._nonPointGroup.hasLayer(n)},zoomToShowLayer:function(n,t){typeof t!="function"&&(t=()=>{});var e=function(){(n._icon||n.__parent._icon)&&!this._inZoomAnimation&&(this._map.off("moveend",e,this),this.off("animationend",e,this),n._icon?t():n.__parent._icon&&(this.once("spiderfied",t,this),n.__parent.spiderfy()))};n._icon&&this._map.getBounds().contains(n.getLatLng())?t():n.__parent._zoom<Math.round(this._map._zoom)?(this._map.on("moveend",e,this),this._map.panTo(n.getLatLng())):(this._map.on("moveend",e,this),this.on("animationend",e,this),n.__parent.zoomToBounds())},onAdd:function(n){this._map=n;var t,e,i;if(!Number.isFinite(this._map.getMaxZoom()))throw"Map has no maxZoom specified";for(this._featureGroup.addTo(n),this._nonPointGroup.addTo(n),this._gridClusters||this._generateInitialClusters(),this._maxLat=n.options.crs.projection.MAX_LATITUDE,t=0,e=this._needsRemoving.length;t<e;t++)i=this._needsRemoving[t],i.newlatlng=i.layer._latlng,i.layer._latlng=i.latlng;for(t=0,e=this._needsRemoving.length;t<e;t++)i=this._needsRemoving[t],this._removeLayer(i.layer,!0),i.layer._latlng=i.newlatlng;this._needsRemoving=[],this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds(),this._map.on("zoomend",this._zoomEnd,this),this._map.on("moveend",this._moveEnd,this),this._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),e=this._needsClustering,this._needsClustering=[],this.addLayers(e,!0)},onRemove:function(n){n.off("zoomend",this._zoomEnd,this),n.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this._spiderfierOnRemove&&this._spiderfierOnRemove(),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent:n=>{for(var t=n;t&&!t._icon;)t=t.__parent;return t||null},_arraySplice:(n,t)=>{for(let e=n.length-1;e>=0;e--)if(n[e]===t)return n.splice(e,1),!0},_removeFromGridUnclustered:function(n,t){for(var e=this._map,i=this._gridUnclustered,s=Math.floor(this._map.getMinZoom());t>=s&&i[t].removeObject(n,e.project(n.getLatLng(),t));t--);},_childMarkerDragStart:n=>{n.target.__dragStart=n.target._latlng},_childMarkerMoved:function(n){if(!this._ignoreMove&&!n.target.__dragStart){const t=(n.target._popup||null)?.isOpen();this._moveChild(n.target,n.oldLatLng,n.latlng),t&&n.target.openPopup()}},_moveChild:function(n,t,e){n._latlng=t,this.removeLayer(n),n._latlng=e,this.addLayer(n)},_childMarkerDragEnd:function(n){n.target.__dragStart&&this._moveChild(n.target,n.target.__dragStart,n.target._latlng),delete n.target.__dragStart},_removeLayer:function(n,t,e){var i=this._gridClusters,s=this._gridUnclustered,o=this._featureGroup,r=this._map,a=Math.floor(this._map.getMinZoom());t&&this._removeFromGridUnclustered(n,this._maxZoom);var l=n.__parent,h=l._markers,d;for(this._arraySplice(h,n);l&&(l._childCount--,l._boundsNeedUpdate=!0,!(l._zoom<a));)t&&l._childCount<=1?(d=l._markers[0]===n?l._markers[1]:l._markers[0],i[l._zoom].removeObject(l,r.project(l._cLatLng,l._zoom)),s[l._zoom].addObject(d,r.project(d.getLatLng(),l._zoom)),this._arraySplice(l.__parent._childClusters,l),l.__parent._markers.push(d),d.__parent=l.__parent,l._icon&&(o.removeLayer(l),e||o.addLayer(d))):l._iconNeedsUpdate=!0,l=l.__parent;delete n.__parent},_isOrIsParent:(n,t)=>{for(;t;){if(n===t)return!0;t=t.parentNode}return!1},fire:function(n,t,e){if(t&&t.propagatedFrom instanceof _.MarkerCluster){if(t.originalEvent&&this._isOrIsParent(t.propagatedFrom._icon,t.originalEvent.relatedTarget))return;n=`cluster${n}`}_.FeatureGroup.prototype.fire.call(this,n,t,e)},listens:function(n,t){return _.FeatureGroup.prototype.listens.call(this,n,t)||_.FeatureGroup.prototype.listens.call(this,`cluster${n}`,t)},_defaultIconCreateFunction:n=>{const t=n.getChildCount();let e=" marker-cluster-";return t<10?e+="small":t<100?e+="medium":e+="large",new _.DivIcon({html:`<div><span>${t}</span></div>`,className:`marker-cluster ${e}`,iconSize:new _.Point(40,40)})},_bindEvents:function(){var n=this._map,t=this.options.spiderfyOnMaxZoom,e=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick;(t||i)&&this.on("clusterclick",this._zoomOrSpiderfy,this),e&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),n.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(n){const t=n.propagatedFrom;let e=t;for(;e._childClusters.length===1;)e=e._childClusters[0];e._zoom===this._maxZoom&&e._childCount===t._childCount&&this.options.spiderfyOnMaxZoom?t.spiderfy():this.options.zoomToBoundsOnClick&&t.zoomToBounds(),n.originalEvent&&n.originalEvent.keyCode===13&&this._map._container.focus()},_showCoverage:function(n){var t=this._map;this._inZoomAnimation||(this._shownPolygon&&t.removeLayer(this._shownPolygon),n.propagatedFrom.getChildCount()>2&&n.propagatedFrom!==this._spiderfied&&(this._shownPolygon=new _.Polygon(n.propagatedFrom.getConvexHull(),this.options.polygonOptions),t.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var n=this.options.spiderfyOnMaxZoom,t=this.options.showCoverageOnHover,e=this.options.zoomToBoundsOnClick,i=this._map;(n||e)&&this.off("clusterclick",this._zoomOrSpiderfy,this),t&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),i.off("zoomend",this._hideCoverage,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var n=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,n),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),n),this._currentShownBounds=n}},_generateInitialClusters:function(){var n=Math.ceil(this._map.getMaxZoom()),t=Math.floor(this._map.getMinZoom()),e=this.options.maxClusterRadius,i=e;typeof e!="function"&&(i=()=>e),this.options.disableClusteringAtZoom!==null&&(n=this.options.disableClusteringAtZoom-1),this._maxZoom=n,this._gridClusters={},this._gridUnclustered={};for(let s=n;s>=t;s--)this._gridClusters[s]=new _.DistanceGrid(i(s)),this._gridUnclustered[s]=new _.DistanceGrid(i(s));this._topClusterLevel=new this._markerCluster(this,t-1)},_addLayer:function(n,t){var e=this._gridClusters,i=this._gridUnclustered,s=Math.floor(this._map.getMinZoom()),o,r;for(this.options.singleMarkerMode&&this._overrideMarkerIcon(n),n.on(this._childMarkerEventHandlers,this);t>=s;t--){o=this._map.project(n.getLatLng(),t);let a=e[t].getNearObject(o);if(a){a._addChild(n),n.__parent=a;return}if(a=i[t].getNearObject(o),a){const l=a.__parent;l&&this._removeLayer(a,!1);const h=new this._markerCluster(this,t,a,n);e[t].addObject(h,this._map.project(h._cLatLng,t)),a.__parent=h,n.__parent=h;let d=h;for(r=t-1;r>l._zoom;r--)d=new this._markerCluster(this,r,d),e[r].addObject(d,this._map.project(a.getLatLng(),r));l._addChild(d),this._removeFromGridUnclustered(a,t);return}i[t].addObject(n,o)}this._topClusterLevel._addChild(n),n.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer(n=>{n instanceof _.MarkerCluster&&n._iconNeedsUpdate&&n._updateIcon()})},_enqueue:function(n){this._queue.push(n),this._queueTimeout||(this._queueTimeout=setTimeout(()=>this._processQueue(),300))},_processQueue:function(){for(let n=0;n<this._queue.length;n++)this._queue[n].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters:function(){var n=Math.round(this._map._zoom);this._processQueue(),this._zoom<n&&this._currentShownBounds.intersects(this._getExpandedVisibleBounds())?(this._animationStart(),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,this._getExpandedVisibleBounds()),this._animationZoomIn(this._zoom,n)):this._zoom>n?(this._animationStart(),this._animationZoomOut(this._zoom,n)):this._moveEnd()},_getExpandedVisibleBounds:function(){if(this.options.removeOutsideVisibleBounds){if(_.Browser.mobile)return this._checkBoundsMaxLat(this._map.getBounds())}else return this._mapBoundsInfinite;return this._checkBoundsMaxLat(this._map.getBounds().pad(1))},_checkBoundsMaxLat:function(n){var t=this._maxLat;return t!==void 0&&(n.getNorth()>=t&&(n._northEast.lat=1/0),n.getSouth()<=-t&&(n._southWest.lat=-1/0)),n},_animationAddLayerNonAnimated:function(n,t){if(t===n)this._featureGroup.addLayer(n);else if(t._childCount===2){t._addToMap();const e=t.getAllChildMarkers();this._featureGroup.removeLayer(e[0]),this._featureGroup.removeLayer(e[1])}else t._updateIcon()},_extractNonGroupLayers:function(n,t){var e=n.getLayers(),i=0,s;for(t=t||[];i<e.length;i++){if(s=e[i],s instanceof _.LayerGroup){this._extractNonGroupLayers(s,t);continue}t.push(s)}return t},_overrideMarkerIcon:function(n){return n.options.icon=this.options.iconCreateFunction({getChildCount:()=>1,getAllChildMarkers:()=>[n]}),n.options.icon}}),_.MarkerClusterGroup.include({_mapBoundsInfinite:new _.LatLngBounds(new _.LatLng(-1/0,-1/0),new _.LatLng(1/0,1/0))}),_.MarkerClusterGroup.include({_noAnimation:{_animationStart:()=>{},_animationZoomIn:function(n,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),n),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut:function(n,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),n),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer:function(n,t){this._animationAddLayerNonAnimated(n,t)}},_withAnimation:{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationZoomIn:function(n,t){var e=this._getExpandedVisibleBounds(),i=this._featureGroup,s=Math.floor(this._map.getMinZoom()),o;this._ignoreMove=!0,this._topClusterLevel._recursively(e,n,s,r=>{var a=r._latlng,l=r._markers,h;for(e.contains(a)||(a=null),r._isSingleParent()&&n+1===t?(i.removeLayer(r),r._recursivelyAddChildrenToMap(null,t,e)):(r.clusterHide(),r._recursivelyAddChildrenToMap(a,t,e)),o=l.length-1;o>=0;o--)h=l[o],e.contains(h._latlng)||i.removeLayer(h)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(e,t),i.eachLayer(r=>{!(r instanceof _.MarkerCluster)&&r._icon&&r.clusterShow()}),this._topClusterLevel._recursively(e,n,t,r=>{r._recursivelyRestoreChildPositions(t)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(e,n,s,r=>{i.removeLayer(r),r.clusterShow()}),this._animationEnd()})},_animationZoomOut:function(n,t){this._animationZoomOutSingle(this._topClusterLevel,n-1,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),n,this._getExpandedVisibleBounds())},_animationAddLayer:function(n,t){var e=this._featureGroup;e.addLayer(n),t!==n&&(t._childCount>2?(t._updateIcon(),this._forceLayout(),this._animationStart(),n._setPos(this._map.latLngToLayerPoint(t.getLatLng())),n.clusterHide(),this._enqueue(()=>{e.removeLayer(n),n.clusterShow(),this._animationEnd()})):(this._forceLayout(),this._animationStart(),this._animationZoomOutSingle(t,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(n,t,e){var i=this._getExpandedVisibleBounds(),s=Math.floor(this._map.getMinZoom());n._recursivelyAnimateChildrenInAndAddSelfToMap(i,s,t+1,e);var o=this;this._forceLayout(),n._recursivelyBecomeVisible(i,e),this._enqueue(function(){if(n._childCount===1){const r=n._markers[0];this._ignoreMove=!0,r.setLatLng(r.getLatLng()),this._ignoreMove=!1,r.clusterShow&&r.clusterShow()}else n._recursively(i,e,s,r=>{r._recursivelyRemoveChildrenFromMap(i,s,t+1)});o._animationEnd()})},_animationEnd:function(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","")),this._inZoomAnimation--,this.fire("animationend")},_forceLayout:()=>{_.Util.falseFn(document.body.offsetWidth)}}),_.MarkerCluster=_.Marker.extend({initialize:function(n,t,e,i){_.Marker.prototype.initialize.call(this,e?e._cLatLng||e.getLatLng():new _.LatLng(0,0),{icon:this,pane:n.options.clusterPane}),this._group=n,this._zoom=t,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new _.LatLngBounds,e&&this._addChild(e),i&&this._addChild(i)},getAllChildMarkers:function(n){n=n||[];for(let t=this._childClusters.length-1;t>=0;t--)this._childClusters[t].getAllChildMarkers(n);for(let t=this._markers.length-1;t>=0;t--)n.push(this._markers[t]);return n},getChildCount:function(){return this._childCount},zoomToBounds:function(n){for(var t=this._childClusters.slice(),e=this._group._map,i=e.getBoundsZoom(this._bounds),s=this._zoom+1,o=e.getZoom(),r;t.length>0&&i>s;){s++;let a=[];for(r=0;r<t.length;r++)a=a.concat(t[r]._childClusters);t=a}i>s?this._group._map.setView(this._latlng,s):i<=o?this._group._map.setView(this._latlng,o+1):this._group._map.fitBounds(this._bounds,n)},getBounds:function(){var n=new _.LatLngBounds;return n.extend(this._bounds),n},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},createIcon:function(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow:function(){return this._iconObj.createShadow()},_addChild:function(n,t){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(n),n instanceof _.MarkerCluster?(t||(this._childClusters.push(n),n.__parent=this),this._childCount+=n._childCount):(t||this._markers.push(n),this._childCount++),this.__parent&&this.__parent._addChild(n,!0)},_setClusterCenter:function(n){this._cLatLng||(this._cLatLng=n._cLatLng||n._latlng)},_resetBounds:function(){var n=this._bounds;n._southWest&&(n._southWest.lat=1/0,n._southWest.lng=1/0),n._northEast&&(n._northEast.lat=-1/0,n._northEast.lng=-1/0)},_recalculateBounds:function(){var n=this._markers,t=this._childClusters,e=0,i=0,s=this._childCount,o,r,a,l;if(s!==0){for(this._resetBounds(),o=0;o<n.length;o++)a=n[o]._latlng,this._bounds.extend(a),e+=a.lat,i+=a.lng;for(o=0;o<t.length;o++)r=t[o],r._boundsNeedUpdate&&r._recalculateBounds(),this._bounds.extend(r._bounds),a=r._wLatLng,l=r._childCount,e+=a.lat*l,i+=a.lng*l;this._latlng=this._wLatLng=new _.LatLng(e/s,i/s),this._boundsNeedUpdate=!1}},_addToMap:function(n){n&&(this._backupLatlng=this._latlng,this.setLatLng(n)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(n,t,e){this._recursively(n,this._group._map.getMinZoom(),e-1,i=>{var s=i._markers,o,r;for(o=s.length-1;o>=0;o--)r=s[o],r._icon&&(r._setPos(t),r.clusterHide())},i=>{var s=i._childClusters,o,r;for(o=s.length-1;o>=0;o--)r=s[o],r._icon&&(r._setPos(t),r.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(n,t,e,i){this._recursively(n,i,t,s=>{s._recursivelyAnimateChildrenIn(n,s._group._map.latLngToLayerPoint(s.getLatLng()).round(),e),s._isSingleParent()&&e-1===i?(s.clusterShow(),s._recursivelyRemoveChildrenFromMap(n,t,e)):s.clusterHide(),s._addToMap()})},_recursivelyBecomeVisible:function(n,t){this._recursively(n,this._group._map.getMinZoom(),t,null,e=>{e.clusterShow()})},_recursivelyAddChildrenToMap:function(n,t,e){this._recursively(e,this._group._map.getMinZoom()-1,t,i=>{if(t!==i._zoom)for(let s=i._markers.length-1;s>=0;s--){const o=i._markers[s];e.contains(o._latlng)&&(n&&(o._backupLatlng=o.getLatLng(),o.setLatLng(n),o.clusterHide&&o.clusterHide()),i._group._featureGroup.addLayer(o))}},i=>{i._addToMap(n)})},_recursivelyRestoreChildPositions:function(n){for(let t=this._markers.length-1;t>=0;t--){const e=this._markers[t];e._backupLatlng&&(e.setLatLng(e._backupLatlng),delete e._backupLatlng)}if(n-1===this._zoom)for(let t=this._childClusters.length-1;t>=0;t--)this._childClusters[t]._restorePosition();else for(let t=this._childClusters.length-1;t>=0;t--)this._childClusters[t]._recursivelyRestoreChildPositions(n)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(n,t,e,i){var s,o;this._recursively(n,t-1,e-1,r=>{for(o=r._markers.length-1;o>=0;o--)s=r._markers[o],(!i||!i.contains(s._latlng))&&(r._group._featureGroup.removeLayer(s),s.clusterShow&&s.clusterShow())},r=>{for(o=r._childClusters.length-1;o>=0;o--)s=r._childClusters[o],(!i||!i.contains(s._latlng))&&(r._group._featureGroup.removeLayer(s),s.clusterShow&&s.clusterShow())})},_recursively:function(n,t,e,i,s){var o=this._childClusters,r=this._zoom,a,l;if(t<=r&&(i&&i(this),s&&r===e&&s(this)),r<t||r<e)for(a=o.length-1;a>=0;a--)l=o[a],n.intersects(l._bounds)&&l._recursively(n,t,e,i,s)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}}),_.Marker.include({clusterHide:function(){return this.options.opacityWhenUnclustered=this.options.opacity||1,this.setOpacity(0)},clusterShow:function(){var n=this.setOpacity(this.options.opacity||this.options.opacityWhenUnclustered);return delete this.options.opacityWhenUnclustered,n}}),_.DistanceGrid=function(n){this._cellSize=n,this._sqCellSize=n*n,this._grid={},this._objectPoint={}},_.DistanceGrid.prototype={addObject:function(n,t){var e=this._getCoord(t.x),i=this._getCoord(t.y),s=this._grid;s[i]=s[i]||{};var o=s[i];o[e]=o[e]||[];var r=o[e],a=_.Util.stamp(n);this._objectPoint[a]=t,r.push(n)},updateObject:function(n,t){this.removeObject(n),this.addObject(n,t)},removeObject:function(n,t){var e=this._getCoord(t.x),i=this._getCoord(t.y),s=this._grid;s[i]=s[i]||{};var o=s[i];o[e]=o[e]||[];var r=o[e],a,l;for(delete this._objectPoint[_.Util.stamp(n)],a=0,l=r.length;a<l;a++)if(r[a]===n)return r.splice(a,1),l===1&&delete o[e],!0},eachObject:function(n,t){var e,i,s,o,r,a,l,h=this._grid;for(e in h){r=h[e];for(i in r)for(a=r[i],s=0,o=a.length;s<o;s++)l=n.call(t,a[s]),l&&(s--,o--)}},getNearObject:function(n){var t=this._getCoord(n.x),e=this._getCoord(n.y),i,s,o,r,a,l,h,d,c=this._objectPoint,u=this._sqCellSize,p=null;for(i=e-1;i<=e+1;i++)if(r=this._grid[i],r){for(s=t-1;s<=t+1;s++)if(a=r[s],a)for(o=0,l=a.length;o<l;o++)h=a[o],d=this._sqDist(c[_.Util.stamp(h)],n),d<u&&(u=d,p=h)}return p},_getCoord:function(n){return Math.floor(n/this._cellSize)},_sqDist:(n,t)=>{var e=t.x-n.x,i=t.y-n.y;return e*e+i*i}},_.QuickHull={getDistant:(n,t)=>{var e=t[1].lat-t[0].lat,i=t[0].lng-t[1].lng;return i*(n.lat-t[0].lat)+e*(n.lng-t[0].lng)},findMostDistantPointFromBaseLine:function(n,t){var e=0,i=null,s=[],o,r,a;for(o=t.length-1;o>=0;o--){if(r=t[o],a=this.getDistant(r,n),a>0)s.push(r);else continue;a>e&&(e=a,i=r)}return{maxPoint:i,newPoints:s}},buildConvexHull:function(n,t){var e=[],i=this.findMostDistantPointFromBaseLine(n,t);return i.maxPoint?(e=e.concat(this.buildConvexHull([n[0],i.maxPoint],i.newPoints)),e=e.concat(this.buildConvexHull([i.maxPoint,n[1]],i.newPoints)),e):[n[0]]},getConvexHull:function(n){var t=!1,e=!1,i=!1,s=!1,o=null,r=null,a=null,l=null,h=null,d=null,c;for(c=n.length-1;c>=0;c--){const p=n[c];(t===!1||p.lat>t)&&(o=p,t=p.lat),(e===!1||p.lat<e)&&(r=p,e=p.lat),(i===!1||p.lng>i)&&(a=p,i=p.lng),(s===!1||p.lng<s)&&(l=p,s=p.lng)}e!==t?(d=r,h=o):(d=l,h=a);var u=[].concat(this.buildConvexHull([d,h],n),this.buildConvexHull([h,d],n));return u}},_.MarkerCluster.include({getConvexHull:function(){var n=this.getAllChildMarkers(),t=[],e,i;for(i=n.length-1;i>=0;i--)e=n[i].getLatLng(),t.push(e);return _.QuickHull.getConvexHull(t)}}),_.MarkerCluster.include({_2PI:Math.PI*2,_circleFootSeparation:25,_circleStartAngle:Math.PI/6,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(!(this._group._spiderfied===this||this._group._inZoomAnimation)){var n=this.getAllChildMarkers(),t=this._group,e=t._map,i=e.latLngToLayerPoint(this._latlng),s;this._group._unspiderfy(),this._group._spiderfied=this,n.length>=this._circleSpiralSwitchover?s=this._generatePointsSpiral(n.length,i):(i.y+=10,s=this._generatePointsCircle(n.length,i)),this._animationSpiderfy(n,s)}},unspiderfy:function(n){this._group._inZoomAnimation||(this._animationUnspiderfy(n),this._group._spiderfied=null)},_generatePointsCircle:function(n,t){var e=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+n),i=e/this._2PI,s=this._2PI/n,o=[],r,a;for(o.length=n,r=n-1;r>=0;r--)a=this._circleStartAngle+r*s,o[r]=new _.Point(t.x+i*Math.cos(a),t.y+i*Math.sin(a))._round();return o},_generatePointsSpiral:function(n,t){var e=this._group.options.spiderfyDistanceMultiplier,i=e*this._spiralLengthStart,s=e*this._spiralFootSeparation,o=e*this._spiralLengthFactor*this._2PI,r=0,a=[],l;for(a.length=n,l=n-1;l>=0;l--)r+=s/i+l*5e-4,a[l]=new _.Point(t.x+i*Math.cos(r),t.y+i*Math.sin(r))._round(),i+=o/r;return a},_noanimationUnspiderfy:function(){var n=this._group,t=n._map,e=n._featureGroup,i=this.getAllChildMarkers(),s,o;for(n._ignoreMove=!0,this.setOpacity(1),o=i.length-1;o>=0;o--)s=i[o],e.removeLayer(s),s._preSpiderfyLatlng&&(s.setLatLng(s._preSpiderfyLatlng),delete s._preSpiderfyLatlng),s.setZIndexOffset&&s.setZIndexOffset(0),s._spiderLeg&&(t.removeLayer(s._spiderLeg),delete s._spiderLeg);n.fire("unspiderfied",{cluster:this,markers:i}),n._ignoreMove=!1,n._spiderfied=null}}),_.MarkerClusterNonAnimated=_.MarkerCluster.extend({_animationSpiderfy:function(n,t){var e=this._group,i=e._map,s=e._featureGroup,o=this._group.options.spiderLegPolylineOptions,r,a,l,h;for(e._ignoreMove=!0,r=0;r<n.length;r++)h=i.layerPointToLatLng(t[r]),a=n[r],l=new _.Polyline([this._latlng,h],o),i.addLayer(l),a._spiderLeg=l,a._preSpiderfyLatlng=a._latlng,a.setLatLng(h),a.setZIndexOffset&&a.setZIndexOffset(1e6),s.addLayer(a);this.setOpacity(.3),e._ignoreMove=!1,e.fire("spiderfied",{cluster:this,markers:n})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),_.MarkerCluster.include({_animationSpiderfy:function(n,t){var e=this._group,i=e._map,s=e._featureGroup,o=this._latlng,r=i.latLngToLayerPoint(o),a=_.Path.SVG,l=Object.assign({},this._group.options.spiderLegPolylineOptions),h=l.opacity,d,c,u,p,y,g;for(h===void 0&&(h=_.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),a?(l.opacity=0,l.className=`${l.className||""} leaflet-cluster-spider-leg`):l.opacity=h,e._ignoreMove=!0,d=0;d<n.length;d++)c=n[d],g=i.layerPointToLatLng(t[d]),u=new _.Polyline([o,g],l),i.addLayer(u),c._spiderLeg=u,a&&(p=u._path,y=p.getTotalLength()+.1,p.style.strokeDasharray=y,p.style.strokeDashoffset=y),c.setZIndexOffset&&c.setZIndexOffset(1e6),c.clusterHide&&c.clusterHide(),s.addLayer(c),c._setPos&&c._setPos(r);for(e._forceLayout(),e._animationStart(),d=n.length-1;d>=0;d--)g=i.layerPointToLatLng(t[d]),c=n[d],c._preSpiderfyLatlng=c._latlng,c.setLatLng(g),c.clusterShow&&c.clusterShow(),a&&(u=c._spiderLeg,p=u._path,p.style.strokeDashoffset=0,u.setStyle({opacity:h}));this.setOpacity(.3),e._ignoreMove=!1,setTimeout(()=>{e._animationEnd(),e.fire("spiderfied",{cluster:this,markers:n})},200)},_animationUnspiderfy:function(n){var t=this._group,e=t._map,i=t._featureGroup,s=n?e._latLngToNewLayerPoint(this._latlng,n.zoom,n.center):e.latLngToLayerPoint(this._latlng),o=this.getAllChildMarkers(),r=_.Path.SVG,a,l,h,d,c,u;for(t._ignoreMove=!0,t._animationStart(),this.setOpacity(1),l=o.length-1;l>=0;l--)a=o[l],a._preSpiderfyLatlng&&(a.closePopup(),a.setLatLng(a._preSpiderfyLatlng),delete a._preSpiderfyLatlng,u=!0,a._setPos&&(a._setPos(s),u=!1),a.clusterHide&&(a.clusterHide(),u=!1),u&&i.removeLayer(a),r&&(h=a._spiderLeg,d=h._path,c=d.getTotalLength()+.1,d.style.strokeDashoffset=c,h.setStyle({opacity:0})));t._ignoreMove=!1,setTimeout(()=>{var p=0;for(l=o.length-1;l>=0;l--)a=o[l],a._spiderLeg&&p++;for(l=o.length-1;l>=0;l--)a=o[l],a._spiderLeg&&(a.clusterShow&&a.clusterShow(),a.setZIndexOffset&&a.setZIndexOffset(0),p>1&&i.removeLayer(a),e.removeLayer(a._spiderLeg),delete a._spiderLeg);t._animationEnd(),t.fire("unspiderfied",{cluster:this,markers:o})},200)}}),_.MarkerClusterGroup.include({_spiderfied:null,unspiderfy:function(...n){this._unspiderfy.apply(this,n)},_spiderfierOnAdd:function(){this._map.on("click",this._unspiderfyWrapper,this),this._map.options.zoomAnimation&&this._map.on("zoomstart",this._unspiderfyZoomStart,this),this._map.on("zoomend",this._noanimationUnspiderfy,this),_.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove:function(){this._map.off("click",this._unspiderfyWrapper,this),this._map.off("zoomstart",this._unspiderfyZoomStart,this),this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._map.off("zoomend",this._noanimationUnspiderfy,this),this._noanimationUnspiderfy()},_unspiderfyZoomStart:function(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(n){this._map._mapPane.classList.contains("leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(n))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(n){this._spiderfied&&this._spiderfied.unspiderfy(n)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(n){n._spiderLeg&&(this._featureGroup.removeLayer(n),n.clusterShow&&n.clusterShow(),n.setZIndexOffset&&n.setZIndexOffset(0),this._map.removeLayer(n._spiderLeg),delete n._spiderLeg)}}),_.MarkerClusterGroup.include({refreshClusters:function(n){return n?n instanceof _.MarkerClusterGroup?n=n._topClusterLevel.getAllChildMarkers():n instanceof _.LayerGroup?n=n._layers:n instanceof _.MarkerCluster?n=n.getAllChildMarkers():n instanceof _.Marker&&(n=[n]):n=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(n),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(n),this},_flagParentsIconsNeedUpdate:n=>{var t,e;for(t in n)for(e=n[t].__parent;e;)e._iconNeedsUpdate=!0,e=e.__parent},_refreshSingleMarkerModeMarkers:function(n){var t,e;for(t in n)e=n[t],this.hasLayer(e)&&e.setIcon(this._overrideMarkerIcon(e))}}),_.Marker.include({refreshIconOptions:function(n,t){var e=this.options.icon;return _.setOptions(e,n),this.setIcon(e),t&&this.__parent&&this.__parent._group.refreshClusters(this),this}});const Ve=()=>typeof window<"u"&&typeof document<"u";function Yn(n,t){let e;return function(...i){clearTimeout(e),e=setTimeout(()=>n.apply(this,i),t)}}const A=(n,t,e)=>e===void 0?n.getAttribute(t)??null:(e===null?n.removeAttribute(t):n.getAttribute(t)!==e&&n.setAttribute(t,e),null),en=(n,...t)=>{const[e,...i]=t;for(const s of e.split(" "))n.addEventListener(s,...i);return()=>Ke(n,...t)},Ke=(n,...t)=>{const[e,...i]=t;for(const s of e.split(" "))n.removeEventListener(s,...i)},ce=(n,t,e)=>{const i=document.createElement(n);if(e&&(i.textContent=e),t)for(const[s,o]of Object.entries(t))A(i,s,o);return i},ue=typeof HTMLElement>"u"?class{}:HTMLElement,pe=(n,t)=>!Ve()||window.customElements.get(n)||window.customElements.define(n,t),Xn=`/**
|
|
604
604
|
* NOTE:
|
|
605
605
|
* - Dark mode styles are in styles.module.css to leverage data-color-scheme attribute
|
|
606
606
|
* - This file is using --mtds- not --mtds- since we're inside shadow dom
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import v from "../styles.module.css.js";
|
|
2
|
-
import { isBrowser as C, tag as
|
|
3
|
-
import
|
|
2
|
+
import { isBrowser as C, tag as h, defineElement as E, MTDSElement as k, onMutation as w, debounce as T, on as $, off as S, attr as l } from "../utils.js";
|
|
3
|
+
import x from "./chart.css.js";
|
|
4
4
|
import { toAxis as A } from "./chart-axis.js";
|
|
5
5
|
import { toBars as L } from "./chart-bars.js";
|
|
6
6
|
import { toLines as O } from "./chart-lines.js";
|
|
7
7
|
import { toPies as R } from "./chart-pies.js";
|
|
8
|
-
const
|
|
8
|
+
const f = "click keydown mousemove mouseout", b = "mtds-chart-tooltip", i = C() ? document.getElementById(b) || h("div", {
|
|
9
9
|
"aria-hidden": "true",
|
|
10
10
|
class: v._tooltip,
|
|
11
11
|
hidden: "",
|
|
12
|
-
id:
|
|
12
|
+
id: b
|
|
13
13
|
}) : null;
|
|
14
14
|
class P extends k {
|
|
15
15
|
#t;
|
|
@@ -28,25 +28,25 @@ class P extends k {
|
|
|
28
28
|
characterData: !0,
|
|
29
29
|
childList: !0,
|
|
30
30
|
subtree: !0
|
|
31
|
-
}), requestAnimationFrame(() => this.attributeChangedCallback()),
|
|
31
|
+
}), requestAnimationFrame(() => this.attributeChangedCallback()), $(this, f, this);
|
|
32
32
|
}
|
|
33
33
|
disconnectedCallback() {
|
|
34
|
-
|
|
34
|
+
i && (i.hidden = !0), S(this, f, this), this.#e?.(), this.#t?.(), this.#t = this.#e = void 0;
|
|
35
35
|
}
|
|
36
36
|
attributeChangedCallback() {
|
|
37
37
|
const e = D(this.querySelector("table"));
|
|
38
38
|
if (!e[0]) return;
|
|
39
|
-
Array.from(this.shadowRoot?.children || []).map((
|
|
40
|
-
const [t,
|
|
39
|
+
Array.from(this.shadowRoot?.children || []).map((p) => p.remove());
|
|
40
|
+
const [t, r] = (l(this, "data-variant") || "column").split("-"), s = l(this, "data-aspect") || void 0, a = h("style", {}, x), d = h("div", {
|
|
41
41
|
"aria-hidden": "hidden",
|
|
42
42
|
class: "legends",
|
|
43
43
|
role: "group"
|
|
44
44
|
});
|
|
45
|
-
e.slice(1).forEach(([{ value:
|
|
46
|
-
|
|
45
|
+
e.slice(1).forEach(([{ value: p, style: g }]) => {
|
|
46
|
+
d.appendChild(h("div", { class: "legend", style: g }, p));
|
|
47
47
|
});
|
|
48
|
-
const { axis:
|
|
49
|
-
(t === "column" || t === "bar") &&
|
|
48
|
+
const { axis: c, groups: n, total: m } = A(e, { aspect: s, type: r });
|
|
49
|
+
(t === "column" || t === "bar") && n.append(...L(e)), (t === "line" || t === "area") && n.append(O(e, { total: m, variant: t, type: r })), (t === "doughnut" || t === "pie") && this.shadowRoot?.append(R(e, { aspect: s, variant: t })), this.shadowRoot?.append(c, d, a);
|
|
50
50
|
}
|
|
51
51
|
handleEvent(e) {
|
|
52
52
|
e.type === "click" || e.type === "keydown" ? q(e, this) : z(e);
|
|
@@ -58,28 +58,27 @@ class P extends k {
|
|
|
58
58
|
}
|
|
59
59
|
function q(o, e) {
|
|
60
60
|
if (o instanceof KeyboardEvent && o.key !== "Enter") return;
|
|
61
|
-
const t = o.composedPath()[0],
|
|
62
|
-
|
|
61
|
+
const t = o.composedPath()[0], r = e.querySelector("table"), [s, a] = t instanceof Element && l(t, "data-event")?.split("-").map(Number) || [];
|
|
62
|
+
r?.rows[s]?.cells[a]?.querySelector("a,button")?.click?.();
|
|
63
63
|
}
|
|
64
|
-
let
|
|
64
|
+
let y = "";
|
|
65
65
|
function z(o) {
|
|
66
|
-
if (!
|
|
67
|
-
|
|
66
|
+
if (!i) return;
|
|
67
|
+
i?.isConnected || document.body.append(i);
|
|
68
68
|
const e = o.composedPath()[0], t = e instanceof Element && e.getAttribute("aria-label") || "";
|
|
69
|
-
t && (
|
|
69
|
+
t && (i.style.transform = `translate(${Math.min(o.clientX, window.innerWidth)}px, ${o.clientY}px)`), t !== y && (t && (i.textContent = t), y = t, i.hidden = !t);
|
|
70
70
|
}
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const n = c(e.cells[0]), r = c(o?.rows[0].cells[i]), h = `${n}: ${c(s)}${r ? ` (${r})` : ""}`;
|
|
71
|
+
const u = (o) => o?.textContent?.trim() || "", D = (o) => Array.from(o?.rows || []).map(
|
|
72
|
+
(e, t, { length: r }) => Array.from(e.cells, (s, a) => {
|
|
73
|
+
const d = u(e.cells[0]), c = u(o?.rows[0].cells[a]), n = u(s), m = r === 2 ? `${c}: ${n}` : `${d}: ${n}${c ? ` (${c})` : ""}`;
|
|
75
74
|
return l(s, "tabindex", "-1"), {
|
|
76
|
-
number:
|
|
75
|
+
number: a && t && Number.parseFloat(n) || 0,
|
|
77
76
|
// First row and column is not a number
|
|
78
|
-
event: s.querySelector("a,button") && `${t}-${
|
|
77
|
+
event: s.querySelector("a,button") && `${t}-${a}`,
|
|
79
78
|
// Reference to proxy events
|
|
80
79
|
style: `--color: var(--mtdsc-chart-color-${t}, var(--mtdsc-chart-color-base))`,
|
|
81
|
-
value:
|
|
82
|
-
tooltip: l(s, "data-tooltip") ||
|
|
80
|
+
value: n,
|
|
81
|
+
tooltip: l(s, "data-tooltip") || m
|
|
83
82
|
};
|
|
84
83
|
})
|
|
85
84
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-element.js","sources":["../../designsystem/chart/chart-element.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport {\n\tattr,\n\tdebounce,\n\tdefineElement,\n\tisBrowser,\n\tMTDSElement,\n\toff,\n\ton,\n\tonMutation,\n\ttag,\n} from \"../utils\";\nimport css from \"./chart.css?raw\";\nimport { toAxis } from \"./chart-axis\";\nimport { toBars } from \"./chart-bars\";\nimport { toLines } from \"./chart-lines\";\nimport { toPies } from \"./chart-pies\";\n\nexport type ChartData = ReturnType<typeof toData>;\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t\"mtds-chart\": MTDSChartElement;\n\t}\n}\n\nconst EVENTS = \"click keydown mousemove mouseout\";\nconst TOOLTIP_ID = \"mtds-chart-tooltip\";\nconst TOOLTIP = isBrowser()\n\t? document.getElementById(TOOLTIP_ID) ||\n\t\ttag(\"div\", {\n\t\t\t\"aria-hidden\": \"true\",\n\t\t\tclass: styles._tooltip,\n\t\t\thidden: \"\",\n\t\t\tid: TOOLTIP_ID,\n\t\t})\n\t: null;\n\nexport class MTDSChartElement extends MTDSElement {\n\t#unmutate?: () => void;\n\t#unresize?: () => void;\n\n\tstatic get observedAttributes() {\n\t\treturn [\"data-variant\", \"data-aspect\"]; // Using ES2015 syntax for backwards compatibility\n\t}\n\tconstructor() {\n\t\tsuper();\n\t\tthis.attachShadow({ mode: \"open\" });\n\t}\n\tconnectedCallback() {\n\t\tconst render = debounce(() => this.attributeChangedCallback(), 100);\n\t\tconst resize = new ResizeObserver(() => this.handleResize());\n\t\tresize.observe(this);\n\t\tthis.#unresize = () => resize.disconnect();\n\t\tthis.#unmutate = onMutation(this, render, {\n\t\t\tattributeFilter: [\"data-tooltip\"],\n\t\t\tattributes: true,\n\t\t\tcharacterData: true,\n\t\t\tchildList: true,\n\t\t\tsubtree: true,\n\t\t});\n\t\trequestAnimationFrame(() => this.attributeChangedCallback()); // Initial setup when children is mounted\n\t\ton(this, EVENTS, this);\n\t}\n\tdisconnectedCallback() {\n\t\tif (TOOLTIP) TOOLTIP.hidden = true;\n\t\toff(this, EVENTS, this);\n\t\tthis.#unresize?.();\n\t\tthis.#unmutate?.();\n\t\tthis.#unmutate = this.#unresize = undefined;\n\t}\n\tattributeChangedCallback() {\n\t\tconst data = toData(this.querySelector(\"table\"));\n\t\tif (!data[0]) return; // We require at least one row\n\n\t\tArray.from(this.shadowRoot?.children || []).map((el) => el.remove()); // Clear shadowRoot\n\t\tconst [variant, type] = (attr(this, \"data-variant\") || \"column\").split(\"-\");\n\t\tconst aspect = attr(this, \"data-aspect\") || undefined;\n\t\tconst style = tag(\"style\", {}, css);\n\t\tconst legend = tag(\"div\", {\n\t\t\t\"aria-hidden\": \"hidden\",\n\t\t\tclass: \"legends\",\n\t\t\trole: \"group\",\n\t\t});\n\t\tdata.slice(1).forEach(([{ value, style }]) => {\n\t\t\tlegend.appendChild(tag(\"div\", { class: \"legend\", style }, value));\n\t\t});\n\n\t\tconst { axis, groups, total } = toAxis(data, { aspect, type });\n\t\tif (variant === \"column\" || variant === \"bar\")\n\t\t\tgroups.append(...toBars(data));\n\t\tif (variant === \"line\" || variant === \"area\")\n\t\t\tgroups.append(toLines(data, { total, variant, type }));\n\t\tif (variant === \"doughnut\" || variant === \"pie\")\n\t\t\tthis.shadowRoot?.append(toPies(data, { aspect, variant }));\n\n\t\tthis.shadowRoot?.append(axis, legend, style); // Axis must be first\n\t}\n\thandleEvent(e: Event) {\n\t\tif (e.type === \"click\" || e.type === \"keydown\") onClick(e, this);\n\t\telse onMoveTooltip(e as MouseEvent);\n\t}\n\thandleResize() {\n\t\tconst axis = this.shadowRoot?.firstElementChild as HTMLElement | null;\n\t\tconst steps = axis?.firstElementChild as HTMLElement | null;\n\t\taxis?.classList.toggle(\"axisStepsYHalf\", (steps?.offsetHeight || 0) < 400);\n\t\taxis?.classList.toggle(\"axisStepsXHalf\", (steps?.offsetWidth || 0) < 500);\n\t}\n}\n\nfunction onClick(event: Event, self: MTDSChartElement) {\n\tif (event instanceof KeyboardEvent && event.key !== \"Enter\") return; // Only handle enter key\n\tconst el = event.composedPath()[0];\n\tconst table = self.querySelector(\"table\");\n\tconst [tr, td] =\n\t\t(el instanceof Element && attr(el, \"data-event\")?.split(\"-\").map(Number)) ||\n\t\t[];\n\n\ttable?.rows[tr]?.cells[td]?.querySelector<HTMLElement>(\"a,button\")?.click?.();\n}\n\nlet TOOLTIP_TEXT = \"\";\nfunction onMoveTooltip(event: MouseEvent) {\n\tif (!TOOLTIP) return;\n\tif (!TOOLTIP?.isConnected) document.body.append(TOOLTIP); // Ensure connected\n\n\tconst el = event.composedPath()[0];\n\tconst tip = (el instanceof Element && el.getAttribute(\"aria-label\")) || \"\";\n\n\tif (tip)\n\t\tTOOLTIP.style.transform = `translate(${Math.min(event.clientX, window.innerWidth)}px, ${event.clientY}px)`;\n\tif (tip !== TOOLTIP_TEXT) {\n\t\tif (tip) TOOLTIP.textContent = tip;\n\t\tTOOLTIP_TEXT = tip;\n\t\tTOOLTIP.hidden = !tip;\n\t}\n}\n\nconst text = (el?: Element | null) => el?.textContent?.trim() || \"\"; // Helper to get trimmed text\nconst toData = (table?: HTMLTableElement | null) =>\n\tArray.from(table?.rows || [], (row, rowIndex) =>\n\t\tArray.from(row.cells, (cell, cellIndex) => {\n\t\t\tconst rowHeading = text(row.cells[0]);\n\t\t\tconst colHeading = text(table?.rows[0].cells[cellIndex]);\n\t\t\tconst tooltip = `${rowHeading}: ${text(cell)}${colHeading ? ` (${colHeading})` : \"\"}`;\n\t\t\tattr(cell, \"tabindex\", \"-1\");\n\n\t\t\treturn {\n\t\t\t\tnumber: (cellIndex && rowIndex && Number.parseFloat(text(cell))) || 0, // First row and column is not a number\n\t\t\t\tevent: cell.querySelector(\"a,button\") && `${rowIndex}-${cellIndex}`, // Reference to proxy events\n\t\t\t\tstyle: `--color: var(--mtdsc-chart-color-${rowIndex}, var(--mtdsc-chart-color-base))`,\n\t\t\t\tvalue: text(cell),\n\t\t\t\ttooltip: attr(cell, \"data-tooltip\") || tooltip,\n\t\t\t};\n\t\t}),\n\t);\n\ndefineElement(\"mtds-chart\", MTDSChartElement);\n"],"names":["EVENTS","TOOLTIP_ID","TOOLTIP","isBrowser","tag","styles","MTDSChartElement","MTDSElement","#unmutate","#unresize","render","debounce","resize","onMutation","on","off","data","toData","el","variant","type","attr","aspect","style","css","legend","value","axis","groups","total","toAxis","toBars","toLines","toPies","onClick","steps","event","self","table","tr","td","TOOLTIP_TEXT","onMoveTooltip","tip","text","row","rowIndex","cell","cellIndex","rowHeading","colHeading","t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AA7B,EAAK0B,GAAM,YAAY,IAAI,GAEpB;AAAA,MACN,QAASC,KAAaF,KAAY,OAAO,WAAWF,EAAKG,CAAI,CAAC,KAAM;AAAA;AAAA,MACpE,OAAOA,EAAK,cAAc,UAAU,KAAK,GAAGD,CAAQ,IAAIE,CAAS;AAAA;AAAA,MACjE,OAAO,oCAAoCF,CAAQ;AAAA,MACnD,OAAOF,EAAKG,CAAI;AAAA,MAChB,SAAS1B,EAAK0B,GAAM,cAAc,KAAKI;AAAA,IAAA;AAAA,EAEzC,CAAC;AACF;AAEDC,EAAc,cAAc9C,CAAgB;"}
|
|
1
|
+
{"version":3,"file":"chart-element.js","sources":["../../designsystem/chart/chart-element.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport {\n\tattr,\n\tdebounce,\n\tdefineElement,\n\tisBrowser,\n\tMTDSElement,\n\toff,\n\ton,\n\tonMutation,\n\ttag,\n} from \"../utils\";\nimport css from \"./chart.css?raw\";\nimport { toAxis } from \"./chart-axis\";\nimport { toBars } from \"./chart-bars\";\nimport { toLines } from \"./chart-lines\";\nimport { toPies } from \"./chart-pies\";\n\nexport type ChartData = ReturnType<typeof toData>;\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t\"mtds-chart\": MTDSChartElement;\n\t}\n}\n\nconst EVENTS = \"click keydown mousemove mouseout\";\nconst TOOLTIP_ID = \"mtds-chart-tooltip\";\nconst TOOLTIP = isBrowser()\n\t? document.getElementById(TOOLTIP_ID) ||\n\t\ttag(\"div\", {\n\t\t\t\"aria-hidden\": \"true\",\n\t\t\tclass: styles._tooltip,\n\t\t\thidden: \"\",\n\t\t\tid: TOOLTIP_ID,\n\t\t})\n\t: null;\n\nexport class MTDSChartElement extends MTDSElement {\n\t#unmutate?: () => void;\n\t#unresize?: () => void;\n\n\tstatic get observedAttributes() {\n\t\treturn [\"data-variant\", \"data-aspect\"]; // Using ES2015 syntax for backwards compatibility\n\t}\n\tconstructor() {\n\t\tsuper();\n\t\tthis.attachShadow({ mode: \"open\" });\n\t}\n\tconnectedCallback() {\n\t\tconst render = debounce(() => this.attributeChangedCallback(), 100);\n\t\tconst resize = new ResizeObserver(() => this.handleResize());\n\t\tresize.observe(this);\n\t\tthis.#unresize = () => resize.disconnect();\n\t\tthis.#unmutate = onMutation(this, render, {\n\t\t\tattributeFilter: [\"data-tooltip\"],\n\t\t\tattributes: true,\n\t\t\tcharacterData: true,\n\t\t\tchildList: true,\n\t\t\tsubtree: true,\n\t\t});\n\t\trequestAnimationFrame(() => this.attributeChangedCallback()); // Initial setup when children is mounted\n\t\ton(this, EVENTS, this);\n\t}\n\tdisconnectedCallback() {\n\t\tif (TOOLTIP) TOOLTIP.hidden = true;\n\t\toff(this, EVENTS, this);\n\t\tthis.#unresize?.();\n\t\tthis.#unmutate?.();\n\t\tthis.#unmutate = this.#unresize = undefined;\n\t}\n\tattributeChangedCallback() {\n\t\tconst data = toData(this.querySelector(\"table\"));\n\t\tif (!data[0]) return; // We require at least one row\n\n\t\tArray.from(this.shadowRoot?.children || []).map((el) => el.remove()); // Clear shadowRoot\n\t\tconst [variant, type] = (attr(this, \"data-variant\") || \"column\").split(\"-\");\n\t\tconst aspect = attr(this, \"data-aspect\") || undefined;\n\t\tconst style = tag(\"style\", {}, css);\n\t\tconst legend = tag(\"div\", {\n\t\t\t\"aria-hidden\": \"hidden\",\n\t\t\tclass: \"legends\",\n\t\t\trole: \"group\",\n\t\t});\n\t\tdata.slice(1).forEach(([{ value, style }]) => {\n\t\t\tlegend.appendChild(tag(\"div\", { class: \"legend\", style }, value));\n\t\t});\n\n\t\tconst { axis, groups, total } = toAxis(data, { aspect, type });\n\t\tif (variant === \"column\" || variant === \"bar\")\n\t\t\tgroups.append(...toBars(data));\n\t\tif (variant === \"line\" || variant === \"area\")\n\t\t\tgroups.append(toLines(data, { total, variant, type }));\n\t\tif (variant === \"doughnut\" || variant === \"pie\")\n\t\t\tthis.shadowRoot?.append(toPies(data, { aspect, variant }));\n\n\t\tthis.shadowRoot?.append(axis, legend, style); // Axis must be first\n\t}\n\thandleEvent(e: Event) {\n\t\tif (e.type === \"click\" || e.type === \"keydown\") onClick(e, this);\n\t\telse onMoveTooltip(e as MouseEvent);\n\t}\n\thandleResize() {\n\t\tconst axis = this.shadowRoot?.firstElementChild as HTMLElement | null;\n\t\tconst steps = axis?.firstElementChild as HTMLElement | null;\n\t\taxis?.classList.toggle(\"axisStepsYHalf\", (steps?.offsetHeight || 0) < 400);\n\t\taxis?.classList.toggle(\"axisStepsXHalf\", (steps?.offsetWidth || 0) < 500);\n\t}\n}\n\nfunction onClick(event: Event, self: MTDSChartElement) {\n\tif (event instanceof KeyboardEvent && event.key !== \"Enter\") return; // Only handle enter key\n\tconst el = event.composedPath()[0];\n\tconst table = self.querySelector(\"table\");\n\tconst [tr, td] =\n\t\t(el instanceof Element && attr(el, \"data-event\")?.split(\"-\").map(Number)) ||\n\t\t[];\n\n\ttable?.rows[tr]?.cells[td]?.querySelector<HTMLElement>(\"a,button\")?.click?.();\n}\n\nlet TOOLTIP_TEXT = \"\";\nfunction onMoveTooltip(event: MouseEvent) {\n\tif (!TOOLTIP) return;\n\tif (!TOOLTIP?.isConnected) document.body.append(TOOLTIP); // Ensure connected\n\n\tconst el = event.composedPath()[0];\n\tconst tip = (el instanceof Element && el.getAttribute(\"aria-label\")) || \"\";\n\n\tif (tip)\n\t\tTOOLTIP.style.transform = `translate(${Math.min(event.clientX, window.innerWidth)}px, ${event.clientY}px)`;\n\tif (tip !== TOOLTIP_TEXT) {\n\t\tif (tip) TOOLTIP.textContent = tip;\n\t\tTOOLTIP_TEXT = tip;\n\t\tTOOLTIP.hidden = !tip;\n\t}\n}\n\nconst text = (el?: Element | null) => el?.textContent?.trim() || \"\"; // Helper to get trimmed text\nconst toData = (table?: HTMLTableElement | null) =>\n\tArray.from(table?.rows || []).map((row, rowIndex, { length }) =>\n\t\tArray.from(row.cells, (cell, cellIndex) => {\n\t\t\tconst rowHeading = text(row.cells[0]);\n\t\t\tconst colHeading = text(table?.rows[0].cells[cellIndex]);\n\t\t\tconst value = text(cell);\n\t\t\tconst tooltip =\n\t\t\t\tlength === 2 // If only header and one row, use simple tooltip only showing value\n\t\t\t\t\t? `${colHeading}: ${value}`\n\t\t\t\t\t: `${rowHeading}: ${value}${colHeading ? ` (${colHeading})` : \"\"}`;\n\t\t\tattr(cell, \"tabindex\", \"-1\");\n\n\t\t\treturn {\n\t\t\t\tnumber: (cellIndex && rowIndex && Number.parseFloat(value)) || 0, // First row and column is not a number\n\t\t\t\tevent: cell.querySelector(\"a,button\") && `${rowIndex}-${cellIndex}`, // Reference to proxy events\n\t\t\t\tstyle: `--color: var(--mtdsc-chart-color-${rowIndex}, var(--mtdsc-chart-color-base))`,\n\t\t\t\tvalue,\n\t\t\t\ttooltip: attr(cell, \"data-tooltip\") || tooltip,\n\t\t\t};\n\t\t}),\n\t);\n\ndefineElement(\"mtds-chart\", MTDSChartElement);\n"],"names":["EVENTS","TOOLTIP_ID","TOOLTIP","isBrowser","tag","styles","MTDSChartElement","MTDSElement","#unmutate","#unresize","render","debounce","resize","onMutation","on","off","data","toData","el","variant","type","attr","aspect","style","css","legend","value","axis","groups","total","toAxis","toBars","toLines","toPies","onClick","steps","event","self","table","tr","td","TOOLTIP_TEXT","onMoveTooltip","tip","text","row","rowIndex","length","cell","cellIndex","rowHeading","colHeading","tooltip","defineElement"],"mappings":";;;;;;;AA0BA,MAAMA,IAAS,oCACTC,IAAa,sBACbC,IAAUC,MACb,SAAS,eAAeF,CAAU,KACnCG,EAAI,OAAO;AAAA,EACV,eAAe;AAAA,EACf,OAAOC,EAAO;AAAA,EACd,QAAQ;AAAA,EACR,IAAIJ;AACL,CAAC,IACA;AAEI,MAAMK,UAAyBC,EAAY;AAAA,EACjDC;AAAA,EACAC;AAAA,EAEA,WAAW,qBAAqB;AAC/B,WAAO,CAAC,gBAAgB,aAAa;AAAA,EACtC;AAAA,EACA,cAAc;AACb,UAAA,GACA,KAAK,aAAa,EAAE,MAA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