(()=>{function e(e){return e instanceof Array?e:[e]}LeafletWidget.methods.addGroupedLayersControl=function(r,t,o){(function(){var a=this;LeafletWidget.methods.removeGroupedLayersControl.call(a);let n=!0;const s={};$.each(e(r),((e,r)=>{const t=a.layerManager.getLayerGroup(r,!0);t&&(s[r]=t,a.hasLayer(t)&&(n?n=!1:a.removeLayer(t)))}));const l={};Object.keys(t).forEach((function(e){l[e]={},Object.keys(t[e]).forEach((function(r){var o=t[e][r];const n=a.layerManager.getLayerGroup(o,!0);n&&(l[e][r]=n)}))})),o.exclusiveGroups&&(o.exclusiveGroups=e(o.exclusiveGroups)),a.currentLayersControl=L.control.groupedLayers(s,l,o),a.addControl(a.currentLayersControl)}).call(this)},LeafletWidget.methods.addGroupedBaseLayer=function(e,r){(function(){if(this.currentLayersControl){const t=this.layerManager.getLayerGroup(e,!0);t&&this.currentLayersControl.addBaseLayer(t,r)}}).call(this)},LeafletWidget.methods.addGroupedOverlay=function(e,r,t){(function(){if(this.currentLayersControl){const o=this.layerManager.getLayerGroup(e,!0);o&&this.currentLayersControl.addOverlay(o,r,t)}}).call(this)},LeafletWidget.methods.removeGroupedOverlay=function(e){(function(){if(this.currentLayersControl){const r=this.layerManager.getLayerGroup(e,!0);r&&this.currentLayersControl.removeLayer(r)}}).call(this)},LeafletWidget.methods.removeGroupedLayersControl=function(){(function(){this.currentLayersControl&&(this.removeControl(this.currentLayersControl),this.currentLayersControl=null)}).call(this)}})();