// 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:jimu/dijit/templates/dateTimePicker.html":'\x3cdiv data-dojo-attach-point\x3d"dateTimeBox" class\x3d"jimu-dateTimeBox"\x3e\r\n\t\x3cdiv data-dojo-attach-point\x3d"calendarDiv"\x3e\x3c/div\x3e\r\n\t\x3cdiv data-dojo-attach-point\x3d"timeTextContainerRuntime" class\x3d"timeTextContainer timeTextContainerRuntime"\x3e\r\n\t\t\x3cdiv class\x3d"timeTextIcon"\x3e\x3c/div\x3e\r\n\t\t\x3cdiv data-dojo-attach-point\x3d"timeTextBoxDiv"\x3e\x3c/div\x3e\r\n\t\x3c/div\x3e\r\n\t\x3cdiv data-dojo-attach-point\x3d"timeTextContainerSetting" class\x3d"timeTextContainer" style\x3d"display:none;"\x3e\r\n\t\t\x3cdiv class\x3d"timeCheckbox" data-dojo-type\x3d"jimu/dijit/CheckBox" data-dojo-attach-point\x3d"timeCheckbox" data-dojo-props\x3d"checked:true, label:\'${timeNls.showTime}\'"\x3e\x3c/div\x3e\r\n\t\t\x3cdiv data-dojo-attach-point\x3d"timeTableContainer" style\x3d"display:none;"\x3e\r\n\t\t\t\x3cdiv class\x3d"timeGroup"\x3e\r\n\t\t\t\t\x3cdiv class\x3d"timeLabel jimu-ellipsis" title\x3d"${timeUnit.hour}"\x3e${timeUnit.hour}\x3c/div\x3e\r\n\t\t\t\t\x3cdiv class\x3d"timeLabel jimu-ellipsis" title\x3d"${timeUnit.minute}"\x3e${timeUnit.minute}\x3c/div\x3e\r\n\t\t\t\t\x3cdiv class\x3d"timeLabel jimu-ellipsis" title\x3d"${timeUnit.second}"\x3e${timeUnit.second}\x3c/div\x3e\r\n\t\t\t\x3c/div\x3e\r\n\t\t\t\x3cdiv class\x3d"timeGroup"\x3e\r\n\t\t\t\t\x3cdiv data-dojo-attach-point\x3d"hourSelect" data-dojo-type\x3d"dijit/form/TimeTextBox"\r\n\t\t\t\t\tdata-dojo-props\x3d"constraints:{timePattern:\'HH\', clickableIncrement: \'T01:00:00\', visibleIncrement: \'T01:00:00\'}"\x3e\x3c/div\x3e\r\n\t\t\t\t\x3cdiv data-dojo-attach-point\x3d"minuteSelect" data-dojo-type\x3d"dijit/form/TimeTextBox"\r\n\t\t\t\t\tdata-dojo-props\x3d"constraints:{timePattern:\'mm\', clickableIncrement: \'T00:05:00\', visibleIncrement: \'T00:05:00\',pickerMin: \'T01:00:00\',pickerMax: \'T01:59:00\'}"\x3e\x3c/div\x3e\r\n\t\t\t\t\x3cdiv data-dojo-attach-point\x3d"secondSelect" data-dojo-type\x3d"dijit/form/TimeTextBox"\r\n\t\t\t\t\tdata-dojo-props\x3d"constraints:{timePattern:\'ss\', clickableIncrement: \'T00:00:05\', visibleIncrement: \'T00:00:05\',pickerMin: \'T01:00:00\',pickerMax: \'T01:00:59\'}"\x3e\x3c/div\x3e\r\n\t\t\t\x3c/div\x3e\r\n\t\t\x3c/div\x3e\r\n\t\x3c/div\x3e\r\n\x3c/div\x3e'}});
define("dojo/_base/declare dojo/_base/html dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/_base/lang jimu/utils dijit/Calendar dijit/form/TimeTextBox dojo/text!./templates/dateTimePicker.html dojo/on dojo/Evented jimu/dijit/CheckBox".split(" "),function(h,c,k,l,m,e,n,p,q,r,f,t){return h([k,l,m,t],{baseClass:"jimu-datetimepicker",declaredClass:"jimu.datetimepicker",templateString:r,value:null,fieldInfo:null,enableTime:!1,timeAccuracy:"",runtime:!1,postMixInProperties:function(){this.timeNls=
window.apiNls.widgets.imageFilter.imageFilterSettings;this.timeUnit=window.jimuNls.timeUnit},postCreate:function(){this._initSelf()},_initSelf:function(){this.calendar=new p({value:this.value,"class":"jimu-calendar"},this.calendarDiv);this.own(f(this.calendar,"change",e.hitch(this,function(){this._valueChange();this.runtime&&!this.enableTime&&this.emit("close")})));this.calendar.startup();if(this.runtime)if(c.setStyle(this.timeTextContainerSetting,"display","none"),this.enableTime){c.setStyle(this.timeTextContainerRuntime,
"display","block");var a={constraints:{timePattern:"s"===this.timeAccuracy?"HH:mm:ss":"m"===this.timeAccuracy?"HH:mm":"HH",clickableIncrement:"T00:30:00",visibleIncrement:"T01:00:00",visibleRange:"T01:00:00"}};"h"===this.timeAccuracy&&(a.constraints.clickableIncrement="T01:00:00");this.timeTextBox=new q(a,this.timeTextBoxDiv);this.own(f(this.timeTextBox,"change",e.hitch(this,function(){this.enableTime=""===this.timeTextBox.displayedValue?!1:!0;this._valueChange()})));this.timeTextBox.startup();this.timeTextBox.set("value",
this.value)}else c.setStyle(this.timeTextContainerRuntime,"display","none");else c.setStyle(this.timeTextContainerRuntime,"display","none"),c.setStyle(this.timeTextContainerSetting,"display","block"),this._initTimePickers();this._enableTime=this.enableTime;this.emit("created",this.getValueObj())},_initTimePickers:function(){this.timeCheckbox.setValue(this.enableTime);this.enableTime&&(c.setStyle(this.timeTableContainer,"display","block"),this.value&&this._setTimeBox_HMS(this.value));this.own(f(this.timeCheckbox,
"change",e.hitch(this,function(){this._changeTimeCheckStatus();this._valueChange();this.emit("timeStatusChanged")})));this.own(f(this.hourSelect,"change",e.hitch(this,function(){this._valueChange()})));this.own(f(this.minuteSelect,"change",e.hitch(this,function(){this._valueChange()})));this.own(f(this.secondSelect,"change",e.hitch(this,function(){this._valueChange()})))},_changeTimeCheckStatus:function(){(this._enableTime=this.timeCheckbox.checked)?c.setStyle(this.timeTableContainer,"display","block"):
c.setStyle(this.timeTableContainer,"display","none")},_valueChange:function(){this.emit("timeChange",this.getValueObj())},isValid:function(){if(null===this.calendar.value)return!1;if(this.runtime){if(this._enableTime&&!this.timeTextBox.isValid())return!1}else if(this.timeCheckbox.checked){if(!this.hourSelect.isValid()||!this.minuteSelect.isValid()||!this.secondSelect.isValid()||""===this.hourSelect.displayedValue||""!==this.hourSelect.displayedValue&&""!==this.secondSelect.displayedValue&&""===this.minuteSelect.displayedValue)return!1}else this.hourSelect.isValid()||
this.hourSelect.set("value",null),this.minuteSelect.isValid()||this.minuteSelect.set("value",null),this.secondSelect.isValid()||this.secondSelect.set("value",null);return!0},getValueObj:function(){if(!this.isValid())return!1;var a=new Date(this.calendar.value.toDateString());if(this.runtime){if(this.enableTime){var b=this.timeTextBox.get("value");b&&(a.setHours(b.getHours()),a.setMinutes(b.getMinutes()),a.setSeconds(b.getSeconds()))}}else if(this.enableTime=this._enableTime){b=this.hourSelect.get("value");
var d=this.minuteSelect.get("value"),g=this.secondSelect.get("value");this.timeAccuracy=g?"s":d?"m":"h";a.setHours(b?b.getHours():null);a.setMinutes(d?d.getMinutes():null);a.setSeconds(g?g.getSeconds():null)}else this.timeAccuracy="";b=n.localizeDateTimeByFieldInfo(a,this.fieldInfo,this.enableTime,this.timeAccuracy);this.value=a;return{date:a,value:b,enableTime:this.enableTime,timeAccuracy:this.timeAccuracy}},validate:function(){this.set("DisplayedValue",this.calendar.value?1:0);return!0},reset:function(){var a=
this.calendar.get("value");a&&this.value&&this.value.toDateString()===a.toDateString()||this.calendar.set("value",this.value);this.timeCheckbox.setValue(this.enableTime);this.runtime?this.enableTime&&this.timeTextBox.set("value",this.value):this._setTimeBox_HMS(this.enableTime?this.value:null)},_setTimeBox_HMS:function(a){var b=null,d=null,g=null;"h"===this.timeAccuracy?b=a:"m"===this.timeAccuracy?b=d=a:"s"===this.timeAccuracy&&(b=d=g=a);this.hourSelect.set("value",b);this.minuteSelect.set("value",
d);this.secondSelect.set("value",g)}})});