import{useMemo as o}from"react";import{useControl as e}from"@vis.gl/react-mapbox";import r from"@mapbox/mapbox-gl-draw";import{getDrawStyles as a}from"./draw-styles.js";import{useDrawEventHandlers as n}from"./useDrawEventHandlers.js";import{useDrawInitialization as t}from"./useDrawInitialization.js";import"@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css";var i=function(i){var l=i.mapStyle,m=i.initialPolygon,p=i.onDrawCreate,s=i.onDrawUpdate,d=i.onDrawDelete,w=i.onModeChange,f=i.onSelectionChange,D=i.drawRef,g=o((function(){return{onDrawCreate:p,onDrawUpdate:s,onDrawDelete:d,onModeChange:w,onSelectionChange:f}}),[p,s,d,w,f]),u=n(g,D),c=u.onAdd,C=u.onRemove,b=e((function(){return new r({displayControlsDefault:!1,defaultMode:"simple_select",styles:a(l),keybindings:!1})}),c,C,{position:"top-right"});return t(b,D,m),null};i.displayName="DrawControl";export{i as DrawControl};
//# sourceMappingURL=DrawControl.js.map
