// 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
require({cache:{"url:widgets/Geoprocessing/editors/SelectFeatureSetFromDraw.html":'\x3cdiv\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"inputNode"\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"featuresetNode"\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e\r\n'}});
define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/html dijit/_TemplatedMixin jimu/dijit/DrawBox esri/symbols/jsonUtils esri/tasks/FeatureSet esri/geometry/Polygon esri/graphic esri/graphicsUtils ./BaseFeatureSetEditor dojo/text!./SelectFeatureSetFromDraw.html ../LayerOrderUtil".split(" "),function(g,h,k,d,l,m,n,p,q,e,r,t,u,v){return g([t,l],{editorName:"SelectFeatureSetFromDraw",templateString:u,constructor:function(a){this.inherited(arguments);this.paramName=a.param.name;this.drawLayerId=
a.widgetUID+a.param.name},postCreate:function(){this.inherited(arguments);d.addClass(this.domNode,"jimu-gp-editor-draw");d.addClass(this.domNode,"jimu-gp-editor-base");var a={types:this.types,drawLayerId:this.drawLayerId,showClear:this.showClear,map:this.map};this.param.symbol&&(a[this.types[0]+"Symbol"]=n.fromJson(this.param.symbol));this.drawBox=new m(a);d.place(this.drawBox.domNode,this.inputNode);this.drawBox.startup();try{(new v(this.config,this.map)).calculateLayerIndex(this.paramName,this.widgetUID).then(h.hitch(this,
function(b){-1!==b&&this.map.reorderLayer(this.drawBox.drawLayer,b)}))}catch(b){console.error(b.message)}this.startup()},getValue:function(){return 0===this.activeViewIndex?this.drawBox.drawLayer&&0<this.drawBox.drawLayer.graphics.length?this._createFeatureSet(this.drawBox.drawLayer.graphics):null:this.getFeatureSet()},_createFeatureSet:function(a){var b=new p,f=[];a=r.getGeometries(a);k.forEach(a,function(c){c="extent"===c.type?new e(q.fromExtent(c)):new e(c);f.push(c)});b.features=f;return b}})});