// 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","dojo/Deferred","dojo/_base/html","dojo/_base/lang","./LayerChooserFromMap"],function(f,g,h,e,d){return f([d],{baseClass:"jimu-featurelayer-chooser-from-map",declaredClass:"jimu.dijit.FeaturelayerChooserFromMap",types:null,showLayerFromFeatureSet:!1,showTable:!1,onlyShowVisible:!1,ignoredFeaturelayerIds:null,mustSupportStatistics:!1,ignoreVirtualLayer:!1,postMixInProperties:function(){this.inherited(arguments);this.ignoredFeaturelayerIds||(this.ignoredFeaturelayerIds=
[]);this.basicFilter=e.hitch(this,this.basicFilter);this.filter=d.createFeaturelayerFilter(this.types,this.showLayerFromFeatureSet,this.showTable,this.mustSupportStatistics);this.ignoreVirtualLayer&&(this.filter=d.andCombineFilters([this.filter,e.hitch(this,this._ignoreVirtualLayerFilter)]))},postCreate:function(){this.inherited(arguments);h.addClass(this.domNode,"jimu-basic-layer-chooser-from-map")},_ignoreVirtualLayerFilter:function(b){return b.getLayerType().then(function(a){return!("ArcGISDynamicMapServiceLayer"===
a||"ArcGISTiledMapServiceLayer"===a||"GroupLayer"===a)})},basicFilter:function(b){var a=new g;0<=this.ignoredFeaturelayerIds.indexOf(b.id)?a.resolve(!1):this.onlyShowVisible&&"Table"!==b.getLayerType()?a.resolve(b.isShowInMap()):a.resolve(!0);return a},getHandledItem:function(b){var a=this.inherited(arguments),c=b&&b.layerInfo;c=c&&c.layerObject;a.url=c&&c.url||"";return a}})});