// 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/TimeSlider/setting/LayersConfig.html":'\x3cdiv class\x3d"layout"\x3e\r\n  \x3cdiv class\x3d"title"\x3e${nls.layerTimeExtent}\x3c/div\x3e\r\n  \x3cdiv class\x3d"layers-table-container"\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"layersContainer" class\x3d"rows-container"\x3e\x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e'}});
define("dojo/Evented dojo/_base/declare dojo/_base/lang esri/lang dojo/_base/html dojo/_base/array dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/on dojo/text!./LayersConfig.html jimu/LayerInfos/LayerInfos ../utils jimu/utils jimu/dijit/CheckBox".split(" "),function(k,l,d,h,e,f,m,n,p,q,r,t,u,g,v){return l([m,n,p,k],{templateString:r,layersCheckboxes:[],startup:function(){this.layersCheckboxes=[];t.getInstance(this.map,this.map.itemInfo).then(d.hitch(this,function(a){this._layerInfosObj=
a;a=this._layerInfosObj.getLayerInfoArray();f.forEach(a,d.hitch(this,function(b){h.isDefined(b.layerObject.timeInfo)&&h.isDefined(b.layerObject.timeInfo.timeExtent)&&this.addARow(b)}));this.emit("initTimeExtent",this.getFullTimeExtent());this.emit("initedLaysers",this.getFullTimeExtent());170<=50*a.length?e.setStyle(this.layersContainer,"overflow-y","auto"):e.setStyle(this.layersContainer,"overflow-y","hidden")}));this.inherited(arguments)},_creatTableRow:function(a,b,c){a=e.create("div",{"class":"row"},
a);b=e.create("div",{"class":"layer-name",innerHTML:g.sanitizeHTML(b||"")},a);c=e.create("div",{"class":"time-info",innerHTML:g.sanitizeHTML(c||"")},a);return{layerNameDom:b,timeInfoDom:c}},addARow:function(a){var b=this._creatTableRow(this.layersContainer),c=new v({label:a.id,_layerId:a.id,checked:!0},b.layerNameDom);this.own(q(c,"change",d.hitch(this,function(){this.emit("change",this.getFullTimeExtent())})));if(a.layerObject.timeInfo&&h.isDefined(a.layerObject.timeInfo.timeExtent)){var w=g.localizeDate(a.layerObject.timeInfo.timeExtent.startTime),
x=g.localizeDate(a.layerObject.timeInfo.timeExtent.endTime);e.setAttr(b.timeInfoDom,"innerHTML",g.sanitizeHTML(w+"   "+this.nls.timeTo+"   "+x));c.timeExtent=a.layerObject.timeInfo.timeExtent}this.layersCheckboxes.push(c);return b},getFullTimeExtent:function(){if(0===this.layersCheckboxes.length)return null;var a=[];f.forEach(this.layersCheckboxes,d.hitch(this,function(c){c.timeExtent&&!0===c.getValue()&&a.push(c.timeExtent)}));if(0<a.length)var b=u.getFullTimeExtent(a,!0);else return null;return{timeExtent:b}},
setConfig:function(a){a&&f.forEach(this.layersCheckboxes,d.hitch(this,function(b){f.forEach(a,d.hitch(this,function(c){b._layerId===c.id&&(!0===c.isTimeEnable?b.setValue(!0):b.setValue(!1))}))}))},getConfig:function(){var a=[];f.forEach(this.layersCheckboxes,d.hitch(this,function(b){a.push({id:b._layerId,isTimeEnable:b.checked})}));return a},isValid:function(){return!0}})});