// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://@sbaseurl@/jsapi/jsapi/esri/copyright.txt and http://www.arcgis.com/apps/webappbuilder/copyright.txt for details.

//>>built
define("dojo/_base/declare jimu/BaseFeatureAction jimu/WidgetManager dojo/Deferred esri/tasks/query dojo/_base/lang dojo/dom-class".split(" "),function(h,k,l,m,n,f,g){return h(k,{map:null,iconFormat:"png",isFeatureSupported:function(a){return 1===a.features.length&&a.features[0].geometry?!0:!1},onExecute:function(a){return l.getInstance().triggerWidgetOpen(this.widgetId).then(f.hitch(this,function(b){var c=a.features[0];g.add(b.panelContainer,"loading");this._getFeatureGeometry(c,b).then(f.hitch(this,
function(d){c.geometry=d;setTimeout(function(){b._setEventLocation({feature:c,type:"add"})},500)}))}))},_getFeatureGeometry:function(a,b){var c=new m;if(a&&a.getSourceLayer){var d=a.getSourceLayer();d.queryFeatures&&d.objectIdField&&d.getMaxAllowableOffset&&0<d.getMaxAllowableOffset()&&a.attributes.hasOwnProperty(d.objectIdField)?(g.add(b.panelContainer,"loading"),b=new n,b.returnGeometry=!0,b.maxAllowableOffset=0,b.objectIds=[a.attributes[d.objectIdField]],b.outSpatialReference=this.map.spatialReference,
d.queryFeatures(b).then(function(e){e&&e.features&&e.features[0]&&e.features[0].geometry?c.resolve(e.features[0].geometry):c.resolve(a.geometry)},function(e){console.log(e);c.resolve(a.geometry)})):c.resolve(a.geometry)}else c.resolve(a.geometry);return c}})});