import{__decorate}from"tslib";import{validation}from"../../Validation.js";import{MapProvider}from"./MapProvider.js";import{activate}from"../../Hooks.js";import{inline}from"./tools.js";import{isArcGisApiVersion3x}from"./ArcGisApiVersion.js";let ClearGraphics=class{execute(r,i,a){const e=validation.id("layerId",r.layerId,void 0),o=a.create();return inline(o.load(),function(){if(e){const r=o.findLayer(e);return r&&r.clearFeatures(),{}}isArcGisApiVersion3x?o.map.graphics.clear():o.view.graphics.removeAll()})}};ClearGraphics.action="gcx:wf:arcgis::ClearGraphicsLayer",ClearGraphics.suite="gcx:wf:builtin",ClearGraphics=__decorate([activate(MapProvider)],ClearGraphics);export{ClearGraphics};