// 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/on dojo/Evented dojo/_base/lang dojo/_base/html dojo/_base/array dojo/_base/declare dijit/_WidgetBase dijit/_TemplatedMixin jimu/FilterManager jimu/utils esri/lang".split(" "),function(k,p,d,q,g,r,t,u,v,f,w){return r([t,u,p],{baseClass:"jimu-filter-value-provider",fieldName:null,shortType:null,_enabled:!1,cascade:"none",filterCodedValue:!1,fieldPopupInfo:null,nls:null,url:null,layerDefinition:null,fieldInfo:null,partObj:null,runtime:!0,staticValues:null,codedValues:null,layerInfo:null,
popupInfo:null,operatorInfo:null,filterCodedValueIfPossible:!1,postMixInProperties:function(){this.inherited(arguments);this.shortType=this.partObj.fieldObj.shortType;this.fieldName=this.partObj.fieldObj.name;this.cascade=this.partObj.interactiveObj&&this.partObj.interactiveObj.cascade;this.runtime&&this.codedValues&&this.filterCodedValueIfPossible&&f.isCodedValuesSupportFilter(this.layerDefinition,this.codedValues.length)?this.filterCodedValue=!0:this.filterCodedValue=!1;this.popupInfo&&this.popupInfo.fieldInfos&&
0<this.popupInfo.fieldInfos.length&&g.some(this.popupInfo.fieldInfos,d.hitch(this,function(a){return a.fieldName===this.fieldName?(this.fieldPopupInfo=a,!0):!1}))},postCreate:function(){this.inherited(arguments);this.filterManager=v.getInstance()},getDijits:function(){return[]},bindChangeEvents:function(){var a=this.getDijits();g.forEach(a,d.hitch(this,function(b){b.declaredClass&&0===b.declaredClass.indexOf("dijit.")&&q.addClass(b.domNode,b.declaredClass.replace(/\./g,"-"));this.own(k(b,"change",
d.hitch(this,this._onChanged)));this.own(k(b,"enter",d.hitch(this,this._onEnter)))}))},_onChanged:function(){this._onEnterTriggered||this.emit("change")},_onEnterTriggered:!1,_onEnter:function(){this._onEnterTriggered=!0;this.emit("change");this.emit("enter");setTimeout(d.hitch(this,function(){this._onEnterTriggered=!1}),100)},tryLocaleNumber:function(a){var b=f.localizeNumber(a);if(null===b||void 0===b)b=a;return b},getPartObject:function(){var a=this.getValueObject();if(!a)return null;var b=d.clone(this.partObj);
b.valueObj=a;return b},setValueObject:function(){},getValueObject:function(){},tryGetValueObject:function(){return this.getValueObject()},setRequired:function(){},getStatus:function(){var a=1,b=this.getDijits();0<b.length&&(a=g.map(b,d.hitch(this,function(c){return"function"===typeof c.getStatus?c.getStatus():this.getStatusForDijit(c)})),a=Math.min.apply(a,a));return a},getStatusForDijit:function(a){return a.validate()?a.get("DisplayedValue")?1:0:-1},isInvalidValue:function(){return 0>this.getStatus()},
isEmptyValue:function(){return 0===this.getStatus()},isValidValue:function(){return 0<this.getStatus()},isBlankValueProvider:function(){return!1},getFilterExpr:function(){var a="1\x3d1";a=this.getLayerFilterExpr();if("all"===this.cascade||"previous"===this.cascade){var b=this.getCascadeFilterExpr();a="("+a+") AND ("+b+")"}return a},getLayerFilterExpr:function(){var a="1\x3d1";this.layerInfo&&(a=this.layerInfo.getFilter());a||(a="1\x3d1");return a},_getWebMapFilterExpr:function(){var a="";this.layerInfo&&
(a=this.layerInfo.getFilterOfWebmap());a||(a="1\x3d1");return a},getDropdownFilterExpr:function(a){var b="1\x3d1";a=this.layerInfo&&this.runtime&&a?this.filterManager.getFilterExp(this.layerInfo.id,a):this._getWebMapFilterExpr();"all"===this.cascade||"previous"===this.cascade?(b=this.getCascadeFilterExpr(),b=a?"("+a+") AND ("+b+")":"("+b+")"):a&&(b=a);return b},getCascadeFilterExpr:function(){return"1\x3d1"},getDropdownFilterPartsObj:function(){var a={parts:[]};if("all"===this.cascade||"previous"===
this.cascade)a=this.getCascadeFilterPartsObj();return a},getCascadeFilterPartsObj:function(){return{}},getCodedValueListByPartsObj:function(a,b,c,l){var m=f.getFieldInfoByFieldName(a.fields,b),h=a.typeIdField,e=null;c=c.parts;for(var x in c){var n=c[x];if(n.fieldObj.name===h){h=n.valueObj.value;e=f._getCodedValueBySubTypeId(a,b,h,m);break}}e||(e=l?l:f._getAllCodedValue(a,m));if(e&&0<e.length)var y=e[0].value;return{selectedValue:y,valueLabels:e}},isDefined:function(a){return w.isDefined(a)},disable:function(){this._enabled=
!1},enable:function(){this._enabled=!0},isEnabled:function(){return this._enabled},destroy:function(){this.inherited(arguments)}})});