/*!@license
 * Infragistics.Web.ClientUI Editors 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery.js
 *	jquery.ui-1.9.0.js
 *	infragistics.util.js
 *  infragistics.util.jquery.js
 *  infragistics.ui.widget.js
 *  infragistics.ui.popover.js
 *  infragistics.ui.notifier.js
 *	infragistics.ui.validator.js
 */
"use strict";(function(factory){if(typeof define==="function"&&define.amd){define(["./infragistics.ui.widget","./infragistics.ui.validator"],factory)}else{return factory(jQuery)}})(function($){/*!@license
* Infragistics.Web.ClientUI Editors localization resources 21.2.12
*
* Copyright (c) 2011-2022 Infragistics Inc.
*
* http://www.infragistics.com/
*
*/
(function($){$.ig=$.ig||{};$.ig.Editor=$.ig.Editor||{};$.ig.locale=$.ig.locale||{};$.ig.locale.en=$.ig.locale.en||{};$.ig.locale.en.Editor={spinUpperTitle:"Increment",spinLowerTitle:"Decrement",buttonTitle:"Show list",clearTitle:"Clear value",ariaTextEditorFieldLabel:"Text Editor",ariaNumericEditorFieldLabel:"Numeric Editor",ariaCurrencyEditorFieldLabel:"Currency Editor",ariaPercentEditorFieldLabel:"Percent Editor",ariaMaskEditorFieldLabel:"Mask Editor",ariaDateEditorFieldLabel:"Date Editor",ariaDatePickerFieldLabel:"Date Picker",ariaTimePickerFieldLabel:"Time Picker",ariaSpinUpButton:"Spin up",ariaSpinDownButton:"Spin down",ariaDropDownButton:"Drop down",ariaClearButton:"Clear",ariaCalendarButton:"Calendar",datePickerButtonTitle:"Show calendar",updateModeUnsupportedValue:'updateMode requires a different configuration. Choose a value between "onChange" and "immediate".',updateModeNotSupported:'updateMode property supports only "onchange" mode for igMaskEditor, igDateEditor and igDatePicker extensions',renderErrMsg:"A base editor cannot be instantiated directly. Try with a text, numeric, date, or other editor.",multilineErrMsg:'textArea requires a different configuration. The textMode should be set to "multiline".',targetNotSupported:"This target element is not supported.",placeHolderNotSupported:"The placeholder attribute is not supported by your browser.",allowedValuesMsg:"Pick a value from the drop-down list",maxLengthErrMsg:"Entry is too long and was trimmed to {0} symbols",maxLengthWarningMsg:"Entry reached the maximum length of {0} for this field",minLengthErrMsg:"At least {0} characters should be entered",maxValErrMsg:"Entry reached the maximum value of {0} for this field",minValErrMsg:"Entry reached the minimum value of {0} for this field",maxValExceedRevertErrMsg:"Entry exceeded the maximum value of {0} and was reverted to previous one",minValExceedRevertErrMsg:"Entry was less than the minimum value of {0} and was reverted to previous one",maxValExceedSetErrMsg:"Entry exceeded the maximum value of {0} and was set to the maximum value",minValExceedSetErrMsg:"Entry was less than the minimum value of {0} and was set to the minimum value",maxValExceededWrappedAroundErrMsg:"Entry exceeded the maximum value of {0} and was set to the minimum allowed one",minValExceededWrappedAroundErrMsg:"Entry was less than the minimum value of {0} and was set to the maximum allowed one",btnValueNotSupported:'A different button value is required. Choose a value between "dropdown", "clear" and "spin".',scientificFormatErrMsg:'A different scientificFormat is required. Choose a value between "E", "e", "E+" and "e+".',spinDeltaIsOfTypeNumber:"A different type of spinDelta is required. A positive number should be entered.",spinDeltaIsOfTypeNumberForPeriod:"A different type of spinDelta is required for the {0}. A positive number between {1} and {2} should be entered.",spinDeltaIsOfTypeNumberOrObject:"A different type of spinDelta is required. A positive number or an object, defining different time period deltas, should be entered.",spinDeltaShouldBeInRange:"The spinDelta option for {0} should be between {1} and {2}",spinDeltaCouldntBeNegative:"The spinDelta option cannot be negative. A positive number should be entered.",spinDeltaContainsExceedsMaxDecimals:"Maximum allowed fractions for spinDelta are set to {0}. Either change MaxDecimals or try to shrink your value.",spinDeltaIncorrectFloatingPoint:'A floating point spinDelta requires a different configuration. Set the dataMode of the editor to either "double" or "float" or set spinDelta to integer.',numericEditorNoSuchMethod:"The numeric editor does not support this method.",numericEditorNoSuchOption:"The numeric editor does not support this option.",displayFactorIsOfTypeNumber:"displayFactor requires a different value. Its value should be set to 1 or 100 as a number.",displayFactorAllowedValue:"displayFactor requires a different value. Its value should be set to 1 or 100 as a number.",instantiateCheckBoxErrMsg:"igCheckboxEditor requires a different element. Use INPUT, SPAN or DIV element.",cannotParseNonBoolValue:"igCheckboxEditor requires a different value. A boolean value should be provided.",cannotSetNonBoolValue:"igCheckboxEditor requires a different value. A boolean value should be provided.",maskEditorNoSuchMethod:"The mask editor does not support this method.",datePickerEditorNoSuchMethod:"The date editor does not support this method.",datePickerNoSuchMethodDropDownContainer:"The date editor does not support this method. Use 'getCalendar' one instead.",buttonTypeIsDropDownOnly:"Datepicker allows only dropdown and clear values for the buttonType option.",dateEditorOffsetRange:"The displayTimeOffset option should be between -720 and 840, which represents the offset in minutes, according to the UTC, of all the timezones from the westernmost (\u221212:00) to the easternmost (+14:00).",setOptionError:"Runtime changes are not allowed for the following option: ",invalidDate:"Invalid date",maskMessage:"All required positions should be filled",maskRevertMessage:"All required positions should be filled, that is why the value was reverted to the last valid one.",dateMessage:"A valid date should be entered",centuryThresholdValidValues:"centuryThreshold property shoud be between 0 and 99.",noListItemsNoButton:"No spin or dropdown button is rendered because there are no listitems.",decimalNumber:"When dataMode is '{0}', the {1} option can accept numeric values between 0 and {2}.",decimalSeparatorErrorMsg:"The decimalSeparator option requires a different value. Its value should be a single character.",decimalSeparatorEqualsGroupSeparatorErrorMsg:"The groupSeparator and the decimalSeparator options can not have equal values.",timePickerNoSuchMethod:"The time picker does not support this method."};$.ig.Editor.locale=$.ig.Editor.locale||$.ig.locale.en.Editor;return $.ig.locale.en.Editor})($);$.widget("ui.igBaseEditor",$.ui.igWidget,{localeWidgetName:"Editor",options:{width:null,height:null,value:null,tabIndex:null,allowNullValue:false,nullValue:null,inputName:null,readOnly:false,disabled:false,validatorOptions:null},css:{editor:"ui-igedit-input",container:"ui-igedit ui-igedit-container ui-widget ui-corner-all ui-state-default",hover:"ui-state-hover",active:"ui-state-active",focus:"ui-state-focus",disabled:"ui-state-disabled"},events:{rendering:"rendering",rendered:"rendered",mousedown:"mousedown",mouseup:"mouseup",mousemove:"mousemove",mouseover:"mouseover",mouseout:"mouseout",blur:"blur",focus:"focus",keydown:"keydown",keypress:"keypress",keyup:"keyup",valueChanging:"valueChanging",valueChanged:"valueChanged"},_createWidget:function(options){this._definedOptions=options;this._superApply(arguments)},_create:function(){this._initialize();this._readAttributes();this._saveDOMContent();this._render();this.localeContainer=this._editorContainer},_initialize:function(){this._timeouts=[]},_readAttributes:function(){this._saveAttributes();this._removeAttributesAndSetThemAsOptions()},_saveAttributes:function(){var i;var element=this.element[0],attr;this._initialAttributes=[];attr=element.attributes;for(i=0;i<attr.length;i++){if(attr[i].name!=="id"){this._initialAttributes.push({name:attr[i].name,attrValue:attr[i].value})}}},_removeAttributesAndSetThemAsOptions:function(){var element=this.element,name=element.attr("name"),value=element.attr("value"),disabled=element.attr("disabled"),readOnly=element.attr("readOnly");if(name){element.removeAttr("name");if(this.options.inputName===null){this.options.inputName=name}}if(value){element.removeAttr("value");if(this.options.value===null){this.options.value=value}}if(disabled){element.removeAttr("disabled");if(this._definedOptions===undefined||this._definedOptions.disabled===undefined){this.options.disabled=true}}if(readOnly){element.removeAttr("readonly");if(this._definedOptions===undefined||this._definedOptions.readOnly===undefined){this.options.readOnly=true}}delete this._definedOptions},_saveDOMContent:function(){if(this.element.children().length>0){this._initialDOMContent=this.element.children().clone(true);this.element.empty()}},_render:function(){throw new Error(this._getLocaleValue("renderErrMsg"))},_applyOptions:function(){if(this.options.tabIndex!==null){this._setTabIndex(this.options.tabIndex)}if(this.options.readOnly){this._setReadOnly(true)}if(this.options.disabled){this._setDisabled(true)}if(this.options.inputName){this.inputName(this.options.inputName)}if(this.options.validatorOptions){this._setupValidator()}},_attachEvents:function(){var self=this;this._editorContainer.on({"mousedown.editor":function(event){self._triggerMouseDown(event)},"mouseup.editor":function(event){self._triggerMouseUp(event)},"mousemove.editor":function(event){self._triggerMouseMove(event)},"mouseover.editor":function(event){self._triggerMouseOver(event)},"mouseout.editor":function(event){self._triggerMouseOut(event)}})},_setupValidator:function(){if(this.element.igValidator){var validatorOptions=$.extend({},{language:this.options.language,locale:this.options.locale},this.options.validatorOptions);this._validator=this.element.igValidator(validatorOptions).data("igValidator");this._validator.owner=this}},_destroyValidator:function(){if(this._validator&&this._validator.owner===this){this._validator.destroy();this._validator=null}},_applyAria:function(){var ariaLabeledBy=this.element.attr("aria-labelledby");if(ariaLabeledBy){this.element.removeAttr("aria-labelledby");this._editorInput.attr("aria-labelledby",ariaLabeledBy)}if(this._dropDownButton){this._editorInput.attr("role","combobox")}else{this._editorInput.attr("role","textbox")}},_triggerRendering:function(){var args={element:this.element,owner:this};return this._trigger(this.events.rendering,null,args)},_triggerRendered:function(){var args={element:this.element,owner:this};this._trigger(this.events.rendered,null,args)},_triggerMouseMove:function(event){var args={owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.mousemove,event,args)},_triggerMouseDown:function(event){this._editorContainer.addClass(this.css.active);var args={owner:this,element:event.target,editorInput:this._editorInput};return this._trigger(this.events.mousedown,event,args)},_triggerMouseUp:function(event){this._editorContainer.removeClass(this.css.active);var args={owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.mouseup,event,args)},_triggerMouseOver:function(event){this._editorContainer.addClass(this.css.hover);var args={originalEvent:event,owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.mouseover,event,args)},_triggerMouseOut:function(event){this._editorContainer.removeClass(this.css.hover);var args={originalEvent:event,owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.mouseout,event,args)},_triggerFocus:function(event){this._editorContainer.addClass(this.css.focus);var args={originalEvent:event,owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.focus,event,args)},_triggerBlur:function(event){this._editorContainer.removeClass(this.css.focus);this._editorContainer.removeClass(this.css.active);this._clearEditorNotifier();var args={owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.blur,event,args)},_setOption:function(option,value){var prevValue=this.options[option];if(prevValue===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"readOnly":this._setReadOnly(value);break;case"disabled":this._setDisabled(value);break;case"width":this._setWidth(value);break;case"height":this._setHeight(value);break;case"validatorOptions":this._setupValidator();break;case"tabIndex":this._setTabIndex(value);break;case"inputName":this._valueInput.attr("name",value);break;default:this.options[option]=prevValue;this._super(option,value);break}},_validateValue:function(val){return val?true:false},_updateValue:function(value){this._valueInput.val(value);this.options.value=value},_clearValue:function(textOnly){var newValue="";if(this.options.allowNullValue){newValue=this.options.nullValue}if(!this._validateValue(newValue)){newValue=""}if(textOnly){this._editorInput.val(newValue)}else{this._updateValue(newValue)}},_detachEvents:function(){if(this._detachButtonsEvents){this._detachButtonsEvents()}if(this._detachListEvents){this._detachListEvents()}if(this._editorContainer){this._editorContainer.off("mousedown.editor mouseup.editor mouseover.editor mouseout.editor")}},_detachButtonsEvents:function(){if(this._dropDownList){this._detachListEvents()}if(this._dropDownButton){this._detachButtonsEvents(this._dropDownButton)}if(this._clearButton){this._detachButtonsEvents(this._clearButton)}if(this._spinUpButton){this._detachButtonsEvents(this._spinUpButton)}if(this._spinDownButton){this._detachButtonsEvents(this._spinDownButton)}},_restoreDOMStructure:function(){this._removeDOM();this._removeAttributes();this._setPropsDefaults();this._recoverInitialAttributes();this._recoverInitialDOMContent()},_removeDOM:function(){this._removeList();this._removeClearButton();this._removeSpinButtons();this._removeContainer()},_removeContainer:function(){if(this._valueInput){this._valueInput.remove()}if(this.element.is("input")){this.element.unwrap().unwrap()}else if(this.element.is("div")){this.element.empty()}else if(this.element.is("span")){this.element.empty();this.element.unwrap().unwrap()}},_removeList:function(){if(this._dropDownList){this._deleteList();this._deleteDropDownButton()}},_removeClearButton:function(){if(this._clearButton){this._clearButton.remove();delete this._clearButton}},_removeSpinButtons:function(){if(this._spinUpButton){this._spinUpButton.remove();delete this._spinUpButton}if(this._spinDownButton){this._spinDownButton.remove();delete this._spinDownButton}},_removeAttributes:function(){var element=this.element,attr=element[0].attributes,concatenatedAttr="",i;for(i=0;i<attr.length;i++){if(attr[i].name!=="id"){concatenatedAttr+=attr[i].name+" "}}element.removeAttr(concatenatedAttr.trim())},_setPropsDefaults:function(){var element=this.element[0];element.disabled=false;element.readOnly=false;element.checked=false;element.value=null},_recoverInitialAttributes:function(){var i;if(this._initialAttributes){for(i=0;i<this._initialAttributes.length;i++){if(this._initialAttributes[i].name!=="id"){this.element.attr(this._initialAttributes[i].name,this._initialAttributes[i].attrValue);if(this._initialAttributes[i].name==="value"&&this.element.is("input")){$(this.element).val(this._initialAttributes[i].attrValue)}}}delete this._initialAttributes}},_recoverInitialDOMContent:function(){if(this._initialDOMContent){this._initialDOMContent.appendTo(this.element);delete this._initialDOMContent}},_clearStyling:function(){if(this._editorContainer){this._editorContainer.removeClass(this.css.container).removeClass(this.css.hover).removeClass(this.css.active)}if(this._editorInput){this._editorInput.removeClass(this.css.editor)}},_deleteInternalProperties:function(){delete this._editorInput;delete this._editorContainer;delete this._valueInput;if(this._timeouts){delete this._timeouts}},_clearTimeouts:function(){var i,timeouts=this._timeouts;if(timeouts&&timeouts instanceof Array){for(i=0;i<timeouts.length;i++){clearTimeout(timeouts[i])}this._timeouts=[]}},_disableEditor:function(applyDisabledClass){if(applyDisabledClass){this._editorContainer.addClass(this.css.disabled)}this._detachEvents()},_setEditableMode:function(){this._editorInput.prop("readonly",false);this._valueInput.prop("readonly",false);this._editorInput.prop("disabled",false);this._valueInput.prop("disabled",false);this._editorContainer.removeClass(this.css.disabled);this._attachEvents()},_setDisabled:function(activate){if(activate){this._editorInput.prop("disabled",true);this._valueInput.prop("disabled",true);this._disableEditor(true)}else{this._editorInput.prop("disabled",false);this._valueInput.prop("disabled",false);if(!this.options.readOnly){this._setEditableMode()}}},_setReadOnly:function(activate){if(activate){this._editorInput.prop("readonly",true);this._valueInput.prop("readonly",true);this._disableEditor()}else{this._editorInput.prop("readonly",false);this._valueInput.prop("readonly",false);if(!this.options.disabled){this._setEditableMode()}this._editorInput.off(".readonly")}},_setWidth:function(width){if(width){this._editorContainer.css("width",this.options.width)}},_setHeight:function(height){if(height){this._editorContainer.css("height",this.options.height)}},_setTabIndex:function(index){this._editorInput.attr("tabIndex",index)},_setFocusDelay:function(delay){var self=this;if(delay){this._timeouts.push(setTimeout(function(){self.field().focus()},delay))}else{this.field().focus()}},_setFocus:function(event){if(this._focused){return}this._focused=true;this._enterEditMode();if(event){this._triggerFocus(event)}},_setBlur:function(event){var newValue;if(this._cancelBlurOnInput){this._editorInput.focus();delete this._cancelBlurOnInput}else{this._triggerBlur(event);newValue=$(event.target).val();this._currentInputTextValue=this._editorInput.val();this._processValueChanging(newValue);this._processTextChanged();this._exitEditMode();if(this._dropDownList&&this._dropDownList.is(":visible")&&this._triggerDropDownClosing()){this._hideDropDownList()}this._focused=false;this._clearTimeouts();if(this._validator){this._validator._validateInternal(this.element,event,true)}if(this._inComposition===true){delete this._inComposition}}},inputName:function(newValue){if(newValue){this.options.inputName=newValue;this._valueInput.attr("name",newValue)}else{return this.options.inputName}},value:function(newValue){var listIndex;if(newValue!==undefined){this._clearEditorNotifier();if(this.options.maxLength){if(newValue&&newValue.toString().length>this.options.maxLength){newValue=newValue.toString().substring(0,this.options.maxLength);this._sendNotification("warning",{optName:"maxLengthErrMsg",arg:this.options.maxLength})}}if(this._validateValue(newValue)){if(this.options.toUpper){if(newValue){newValue=newValue.toLocaleUpperCase()}}else if(this.options.toLower){if(newValue){newValue=newValue.toLocaleLowerCase()}}if(this._dropDownList&&this.options.isLimitedToListValues&&(listIndex=this._valueIndexInList(newValue))!==-1){newValue=this.options.listItems[listIndex]}this._updateValue(newValue);this._editorInput.val(this._getDisplayValue())}else{this._clearValue();if(this._focused!==true){this._exitEditMode()}}}else{return this.options.value}this._checkClearButtonState()},field:function(){return this._editorInput},editorContainer:function(){return this._editorContainer},hasFocus:function(){return this._focused},setFocus:function(delay){this._setFocusDelay(delay)},hide:function(){this._editorContainer.hide()},show:function(){this._editorContainer.show()},validator:function(){return this._validator},isValid:function(){this._skipMessages=true;var valid=this._validateValue(this._editMode?this.field().val():this.value());this._skipMessages=false;return valid},validate:function(){if(this.options.validatorOptions){return this.validator().validate()}else{return this._validateValue(this.value())}},destroy:function(){this._destroyValidator();this._detachEvents();this._clearTimeouts();this._clearStyling();this._restoreDOMStructure();this._deleteInternalProperties();delete this.options;this._superApply(arguments);return this}});$.extend($.ui.igBaseEditor,{version:"21.2.12"});$.widget("ui.igTextEditor",$.ui.igBaseEditor,{options:{buttonType:"none",listItems:null,listWidth:0,listItemHoverDuration:0,dropDownAttachedToBody:false,dropDownAnimationDuration:300,visibleItemsCount:5,includeKeys:null,excludeKeys:null,textAlign:"left",placeHolder:null,selectionOnFocus:"selectAll",textMode:"text",spinWrapAround:false,isLimitedToListValues:false,revertIfNotValid:true,preventSubmitOnEnter:false,dropDownOrientation:"auto",maxLength:null,dropDownOnReadOnly:false,toUpper:false,toLower:false,suppressNotifications:false,suppressKeyboard:false},css:{editorInputContainer:"ui-igeditor-input-container ui-corner-all",spinButtonUpImage:"ui-igedit-spinupperimage ui-icon-carat-1-n ui-icon "+"ui-igedit-buttondefault ui-igedit-spinbutton ui-igedit-buttonimage",spinButtonDownImage:"ui-igedit-spinlowerimage ui-icon-carat-1-s ui-icon "+"ui-igedit-buttondefault ui-igedit-spinbutton ui-igedit-buttonimage",dropDownImage:"ui-icon ui-icon-triangle-1-s ui-igedit-buttonimage",dropDownButton:"ui-igedit-dropdown-button ",clearButtonImage:"ui-igedit-buttonimage ui-icon-circle-close "+"ui-icon ui-igedit-buttondefault",clearButton:"ui-igedit-cleararea ui-state-default",buttonCommon:"ui-igedit-button-common ui-unselectable "+"ui-igedit-button-ltr ui-state-default",dropDownList:"ui-igedit-dropdown ui-widget",listItem:"ui-igedit-listitem ui-state-default",listItemHover:"ui-igedit-listitemhover ui-state-hover",listItemActive:"ui-state-active ui-igedit-listitemactive",listItemSelected:"ui-igedit-listitemselected ui-state-highlight",buttonHover:"ui-igedit-buttonhover ui-state-hover",buttonPressed:"ui-igedit-buttonpressed ui-state-highlight",placeHolder:"ui-igedit-placeholder",textArea:"ui-igedit-textarea"},events:{dropDownListOpening:"dropDownListOpening",dropDownListOpened:"dropDownListOpened",dropDownListClosing:"dropDownListClosing",dropDownListClosed:"dropDownListClosed",dropDownItemSelecting:"dropDownItemSelecting",dropDownItemSelected:"dropDownItemSelected",textChanged:"textChanged"},_create:function(){$.ui.igBaseEditor.prototype._create.call(this)},_changeLocaleForNotifier:function(){var notifier=this._editorContainer.data("igNotifier"),message;if(notifier&&notifier.isVisible()){message=this._getMessageForNotifier(this._notifierMessage);notifier.notify(notifier.options.state,message)}},_changeLocaleForValidator:function(){if(this._validator){this._validator.options.locale=this.options.locale;this._validator.options.language=this.options.language}},changeLocale:function(){this._superApply(arguments);this._changeLocaleForNotifier();this._changeLocaleForValidator()},_setOption:function(option,value){var prevValue=this.options[option];if(prevValue===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"value":this.value(value);break;case"placeHolder":this._applyPlaceHolder();break;case"suppressNotifications":if(value){this._clearEditorNotifier()}break;case"listItems":if(prevValue!==null){this._deleteList()}this._createList();this._clearValue();break;case"listWidth":this._setDropDownListWidth();break;case"spinWrapAround":if(value){this._enableSpinButton(this._spinDownButton,"spinDown");this._enableSpinButton(this._spinUpButton,"spinUp")}else{this._setSpinButtonsState(this.value())}break;case"excludeKeys":if(value===""){this._excludeKeysArray=[]}else{this._excludeKeysArray=value.toString().split("")}break;case"includeKeys":if(value===""){this._includeKeysArray=[]}else{this._includeKeysArray=value.toString().split("")}break;case"textAlign":this._editorInput.css("text-align",value);break;case"dropDownOnReadOnly":case"visibleItemsCount":case"buttonType":case"dropDownAttachedToBody":this.options[option]=prevValue;throw new Error(this._getLocaleValue("setOptionError")+option);default:this.options[option]=prevValue;this._super(option,value);break}},_updateValue:function(value){if(value!==null&&value!==undefined){value=value.toString()}this._super(value);if(this._dropDownList){this._updateDropdownSelection(value)}},_applyOptions:function(){var initialValue;this._editMode=false;this._focused=false;this._super();if(this.options.includeKeys){this._includeKeysArray=this.options.includeKeys.toString().split("")}if(this.options.excludeKeys){this._excludeKeysArray=this.options.excludeKeys.toString().split("")}initialValue=this.options.value;if(this.options.allowNullValue&&initialValue===null){initialValue=this.options.nullValue}if(this.options.maxLength){if(initialValue&&initialValue.toString().length>this.options.maxLength){initialValue=initialValue.toString().substring(0,this.options.maxLength);this._sendNotification("warning",{optName:"maxLengthErrMsg",arg:this.options.maxLength})}}if(this._validateValue(initialValue)){this._setInitialValue(initialValue);this._editorInput.val(this._getDisplayValue())}else{this._setInitialValue("");this._editorInput.val(this._getDisplayValue())}this._applyPlaceHolder()},_render:function(){var editorElementWrapper,editorElement,tempTimeStamp;this._triggerRendering();if(this.element.attr("id")!==undefined){this.id=this.element.attr("id")}else{tempTimeStamp=new Date;this.id=tempTimeStamp.getTime()}if(this.element.is("div")||this.element.is("span")){if(this.options.textMode==="multiline"){editorElement=$("<textarea rows='4' cols='50'></textarea>");editorElement.addClass(this.css.textArea)}else if(this.options.textMode==="password"){editorElement=$("<input type='password' autocomplete='off'/>")}else{editorElement=$("<input type='text' />")}if(this.element.is("span")){editorElement=this.element.html(editorElement)}editorElementWrapper=editorElement.wrap($("<div></div>")).parent();editorElementWrapper.addClass(this.css.editorInputContainer);this._editorInputWrapper=editorElementWrapper;if(this.element.is("span")){this._editorInput=editorElement.children(0);this._editorContainer=editorElementWrapper.wrap($("<div></div>")).parent()}else{this._editorInput=editorElement;this._editorContainer=this.element}this._editorContainer.prepend(editorElementWrapper)}else if(this.element.is("input")){this._editorContainer=this.element.wrap($("<div></div>")).parent();this._editorInput=this.element;editorElementWrapper=this._editorInput.wrap($("<div></div>")).parent();editorElementWrapper.addClass(this.css.editorInputContainer);this._editorInputWrapper=editorElementWrapper}else if(this.element.is("textarea")){if(this.options.textMode!=="multiline"){throw new Error(this._getLocaleValue("multilineErrMsg"))}else{this._editorContainer=this.element.wrap($("<div></div>")).parent();this._editorInput=this.element;this._editorInput.addClass(this.css.textArea);editorElementWrapper=this._editorInput.wrap($("<div></div>")).parent();editorElementWrapper.addClass(this.css.editorInputContainer);this._editorInputWrapper=editorElementWrapper}}else{throw new Error(this._getLocaleValue("targetNotSupported"))}this._editorContainer.addClass(this.css.container);this._editorInput.addClass(this.css.editor);this._editorInput.css("height","100%");if((this.element.is("input")||this.element.is("textarea"))&&this._editorInput.attr("id")!==undefined){this._editorInputId=this._editorInput.attr("id")}else{this._editorInput.attr("id",this.id+"EditingInput");this._editorInputId=this.id+"EditingInput"}if(!$.ig.util.isIE8){if(this.options.textMode!=="multiline"){if(this.options.textMode==="password"){this._editorInput.attr("type","password");this._editorInput.attr("autocomplete","off")}else{this._editorInput.attr("type","text")}}}if(this.options.buttonType&&this.options.buttonType!=="none"&&this.options.textMode!=="multiline"&&this.options.textMode!=="password"){this._renderButtons()}if(this.options.width){this._editorContainer.css("width",this.options.width)}if(this.options.height){this._editorContainer.css("height",this.options.height)}if(this.options.textMode==="multiline"){this._valueInput=$("<textarea style='display:none'></textarea>")}else{this._valueInput=$("<input type='hidden'></input>")}this._editorInput.after(this._valueInput);this._editorInput.css("text-align",this.options.textAlign);this._createList();this._attachEvents();this._applyOptions();this._applyAria();this._checkClearButtonState();this._triggerRendered()},_applyAria:function(){this._super();this._applyInputAriaLabel()},_applyInputAriaLabel:function(){var ariaLabelText,localeid;switch(this.widgetName){case"igTextEditor":localeid="ariaTextEditorFieldLabel";break;case"igNumericEditor":localeid="ariaNumericEditorFieldLabel";break;case"igCurrencyEditor":localeid="ariaCurrencyEditorFieldLabel";break;case"igPercentEditor":localeid="ariaPercentEditorFieldLabel";break;case"igMaskEditor":localeid="ariaMaskEditorFieldLabel";break;case"igDateEditor":localeid="ariaDateEditorFieldLabel";break;case"igDatePicker":localeid="ariaDatePickerFieldLabel";break;case"igTimePicker":localeid="ariaTimePickerFieldLabel";break;default:{localeid="ariaTextEditorFieldLabel";break}}ariaLabelText=this._getLocaleValue(localeid);this._editorInput.attr({"aria-label":ariaLabelText,"data-localeid":localeid,"data-localeattr":"aria-label"})},_getMessageForNotifier:function(messageObj){var optName=messageObj.optName,message=this._getLocaleValue(optName),arg=messageObj.arg;return arg!==undefined?$.ig.util.stringFormat(message,arg):message},_sendNotification:function(state,messageObj){var message=this._getMessageForNotifier(messageObj);if(this.options.suppressNotifications||this._skipMessages){this._currentMessage=message;return}if(!this._editorContainer.data("igNotifier")){this._editorContainer.igNotifier()}this._notifierMessage=messageObj;this._editorContainer.igNotifier("notify",state,message)},_applyPlaceHolder:function(){if(this.options.placeHolder&&this.options.placeHolder!==""){this._editorInput.attr("placeholder",this.options.placeHolder);this._editorInput.addClass(this.css.placeHolder);if(this._placeHolderNotSupported()){throw new Error(this._getLocaleValue("placeHolderNotSupported"))}}else if(this._editorInput.attr("placeholder")){this._editorInput.removeAttr("placeholder")}},_placeHolderNotSupported:function(){return document.createElement("input").placeholder===undefined},_setInitialValue:function(value){this._updateValue(value)},_disableEditor:function(applyDisabledClass){if(this.options.dropDownOnReadOnly){if(applyDisabledClass){this._editorInput.addClass(this.css.disabled)}}else{if(applyDisabledClass){this._editorContainer.addClass(this.css.disabled)}this._detachEvents()}if(this._dropDownList&&!this.options.dropDownOnReadOnly){if(applyDisabledClass){this._dropDownList.addClass(this.css.disabled)}this._detachListEvents()}if(this._dropDownButton&&!this.options.dropDownOnReadOnly){this._dropDownButton.addClass(this.css.disabled);this._detachButtonsEvents(this._dropDownButton)}if(this._clearButton){this._clearButton.addClass(this.css.disabled);this._detachButtonsEvents(this._clearButton)}if(this._spinUpButton){this._spinUpButton.addClass(this.css.disabled);this._detachButtonsEvents(this._spinUpButton)}if(this._spinDownButton){this._spinDownButton.addClass(this.css.disabled);this._detachButtonsEvents(this._spinDownButton)}},_disableSpinButton:function(target){if(target&&!target.attr("disabled")&&!this.options.spinWrapAround){target.addClass(this.css.disabled);target.attr("disabled","disabled");target.prop("disabled",true);target.removeClass(this.css.buttonHover);if(target._pressed){delete target._pressed;target.removeClass(this.css.buttonPressed)}if(target._spinTimeOut){clearTimeout(target._spinTimeOut);delete this._spinUpButton._spinTimeOut}if(target._spinInterval){clearInterval(target._spinInterval);delete target._spinInterval}this._detachButtonsEvents(target)}},_enableSpinButton:function(target,type){if(target&&target.attr("disabled")){target.removeClass(this.css.disabled);target.removeAttr("disabled");target.prop("disabled",false);this._attachButtonsEvents(type,target)}},_exceedsMaxValue:function(){return this._dropDownList&&!this._getSpinItem("up").length},_lessThanMinValue:function(){return this._dropDownList&&!this._getSpinItem("down").length},_setSpinButtonsState:function(val){if(typeof val==="string"||val instanceof String){val=val.trim()}if(val===null){this._enableSpinButton(this._spinDownButton,"spinDown");this._enableSpinButton(this._spinUpButton,"spinUp");return}if(val!==""&&!this.options.spinWrapAround){if(this._exceedsMaxValue(val)){this._disableSpinButton(this._spinUpButton);this._enableSpinButton(this._spinDownButton,"spinDown")}else if(this._lessThanMinValue(val)){this._disableSpinButton(this._spinDownButton);
this._enableSpinButton(this._spinUpButton,"spinUp")}else{this._enableSpinButton(this._spinDownButton,"spinDown");this._enableSpinButton(this._spinUpButton,"spinUp")}}},_replaceCharAt:function(stringValue,index,ch){if(stringValue!==undefined){return stringValue.substring(0,index)+ch+stringValue.substring(index+1)}},_getStringRange:function(stringValue,start,end){if(stringValue!==undefined){return stringValue.substring(start,end)}},_replaceStringRange:function(stringValue,replacementValue,indexStart,indexEnd){var i=0;while(indexStart<=indexEnd){stringValue=this._replaceCharAt(stringValue,indexStart,replacementValue.charAt(i));i++;indexStart++}return stringValue},_valueIndexInList:function(val){if(!val&&val!==0){return-1}var loweredItems=$.map(this.options.listItems,function(item){return item.toString().toLowerCase()});return $.inArray(val.toString().toLowerCase(),loweredItems)},_validateValue:function(val){var result;if(val===undefined){result=false}else if(val===null){if(this.options.allowNullValue){result=val===this.options.nullValue?true:false}else{result=false}}else if(this.options.isLimitedToListValues&&this._dropDownList){if(this._valueIndexInList(val)!==-1){result=true}else{this._sendNotification("warning",{optName:"allowedValuesMsg"});result=false}}else if(this.options.maxLength){if(val.toString().length<=this.options.maxLength){result=true}else{result=false}}else{result=true}return result},_setEditableMode:function(){this._super("_setEditableMode");if(this._dropDownList&&!this.options.dropDownOnReadOnly){this._dropDownList.removeClass(this.css.disabled);this._attachListEvents()}if(this._dropDownButton&&!this.options.dropDownOnReadOnly){this._dropDownButton.removeClass(this.css.disabled);this._attachButtonsEvents("dropdown",this._dropDownButton)}if(this._clearButton){this._clearButton.removeClass(this.css.disabled);this._attachButtonsEvents("clear",this._clearButton)}if(this._spinUpButton&&this.options.value!==this.options.maxValue){this._spinUpButton.removeClass(this.css.disabled);this._attachButtonsEvents("spinUp",this._spinUpButton)}if(this._spinDownButton&&this.options.value!==this.options.minValue){this._spinDownButton.removeClass(this.css.disabled);this._attachButtonsEvents("spinDown",this._spinDownButton)}},_calculateDropDownListOrientation:function(){var containerOffset=this._editorContainer.igOffset(),containerTop=containerOffset.top,containerHeight=parseFloat(this._editorContainer.css("height")),dropDownAndEditorHeight=parseInt(containerTop+containerHeight+this._listInitialHeight),windowHeight=$(window).height(),orientation;if(this.options.dropDownOrientation==="auto"){if(dropDownAndEditorHeight<windowHeight+$(window).scrollTop()){orientation="bottom"}else if(containerTop-this._listInitialHeight>0){orientation="top"}else{orientation="bottom"}}else{orientation=this.options.dropDownOrientation}return orientation},_positionDropDownList:function(){var containerOffset=this._editorContainer.igOffset(),containerTop=containerOffset.top,containerLeft=containerOffset.left,containerHeight=parseFloat(this._editorContainer.css("height")),orientation=this._calculateDropDownListOrientation();if(this.options.dropDownAttachedToBody){this._dropDownList.css("left",containerLeft);if(orientation==="bottom"){this._dropDownList.css("top",containerTop+containerHeight);this._dropDownListOrientation="down";this._dropDownList.removeClass("ui-igedit-dropdown-orientation-top");this._dropDownList.addClass("ui-igedit-dropdown-orientation-bottom")}else{this._dropDownList.css("top",containerTop-this._listInitialHeight);this._dropDownListOrientation="up";this._dropDownList.removeClass("ui-igedit-dropdown-orientation-bottom");this._dropDownList.addClass("ui-igedit-dropdown-orientation-top")}}else{this._dropDownList.css("left","");if(orientation==="bottom"){this._dropDownList.css("top","");this._dropDownListOrientation="down";this._dropDownList.removeClass("ui-igedit-dropdown-orientation-top");this._dropDownList.addClass("ui-igedit-dropdown-orientation-bottom")}else{this._dropDownList.css("top",-this._listInitialHeight);this._dropDownListOrientation="up";this._dropDownList.removeClass("ui-igedit-dropdown-orientation-bottom");this._dropDownList.addClass("ui-igedit-dropdown-orientation-top")}}this._setDropDownListWidth()},_createList:function(){if(Array.isArray(this.options.listItems)){this.options.listItems=this.options.listItems.filter(function(item){return item||item===0})}if(this.options.textMode!=="multiline"&&this.options.textMode!=="password"&&this.options.listItems&&this.options.listItems.length>0){if(this.options.buttonType.toString().indexOf("dropdown")===-1){this._renderDropDownButton()}this._renderList();this._positionDropDownList();this._attachListEvents()}},_renderList:function(){var i,list=this.options.listItems,itemValue,currentItem,itemHeight,dropdown,id=this.id,html,listBorderHeight;html="<div id='"+id+"_list"+"' tabindex='-1' class='"+this.css.dropDownList+"' role='listbox' aria-activedescendant='"+this._editorInputId+"'>";this._editorInput.attr("aria-owns",this.id+"_list");for(i=0;i<list.length;i++){itemValue=list[i]?this._getEditModeValue(list[i]):list[i];currentItem="<span id='"+id+"_item_"+(i+1)+"' tabindex='-1' role='option' aria-selected='false' aria-posinset='"+(i+1).toString()+"' class='"+this.css.listItem+"' title='"+itemValue+"'>"+itemValue+"</span>";html+=currentItem}html+="</div>";dropdown=$(html);if(this.options.dropDownAttachedToBody){$(document.body).append(dropdown)}else{this._editorContainer.append(dropdown)}itemHeight=dropdown.children().eq(0).outerHeight();if(itemHeight===0){itemHeight=23}if(this._calculateDropDownListOrientation()==="bottom"){listBorderHeight=parseInt(dropdown.css("borderBottomWidth"))}else{listBorderHeight=parseInt(dropdown.css("borderTopWidth"))}if(list.length<this.options.visibleItemsCount){dropdown.css("height",parseFloat(itemHeight*list.length+listBorderHeight));this._listInitialHeight=parseFloat(itemHeight*list.length+listBorderHeight)}else{dropdown.css("height",parseFloat(itemHeight*this.options.visibleItemsCount)+listBorderHeight);this._listInitialHeight=parseFloat(itemHeight*this.options.visibleItemsCount)+listBorderHeight}this._dropDownList=dropdown;this._setDropDownListWidth();dropdown.hide();dropdown.visible=false},_setDropDownListWidth:function(){if(this.options.listWidth&&this.options.listWidth>0){this._dropDownList.css("width",this.options.listWidth)}else{this._dropDownList.css("width",this._editorContainer.css("width"))}},_attachListEvents:function(){var self=this;this._dropDownList.on({"mouseenter.editorList":function(event){var item=event.target;$(item).addClass(self.css.listItemHover,self.options.listItemHoverDuration);$(item).attr("data-hovered",true)},"mouseleave.editorList":function(event){var item=event.target;$(item).removeClass(self.css.listItemHover,self.options.listItemHoverDuration);$(item).removeAttr("data-hovered")},"click.editorList":function(event){self._triggerListItemClick(event.target)},"mousedown.editorList":function(event){event.preventDefault();if(!$.ig.util.isIE8){event.stopPropagation()}}},".ui-igedit-listitem");this._dropDownList.on("mousedown.editorList",function(event){self._listMouseDownHandler(event)})},_listMouseDownHandler:function(event){if($.ig.util.isIE||$.ig.util.isEdge){this._cancelBlurOnInput=true}else{event.preventDefault();event.stopPropagation()}},_deleteList:function(){this._detachListEvents();this._dropDownList.remove();delete this._dropDownList},_deleteDropDownButton:function(){this._detachButtonsEvents(this._dropDownButton);this._dropDownButton.remove();delete this._dropDownButton},_detachListEvents:function(){if(this._dropDownList){this._dropDownList.off("mouseenter.editorList mouseleave.editorList ");this._dropDownList.off("click.editorList mousedown.editorList")}},_renderDropDownButton:function(){var dropDownButton=$("<div></div>"),dropDownIcon=$("<div></div>");if(this._dropDownButton){return}dropDownButton.addClass(this.css.buttonCommon).attr({role:"button",tabindex:-1,id:this.id+"_dropDownButton",title:this._getLocaleValue("buttonTitle"),"data-localeid":"buttonTitle","data-localeattr":"title"});this._editorContainer.prepend(dropDownButton.addClass(this.css.dropDownButton).append(dropDownIcon.addClass(this.css.dropDownImage)));this._dropDownButton=dropDownButton;this._attachButtonsEvents("dropdown",dropDownButton)},_renderSpinButtons:function(){var spinButtonUp=$("<div></div>"),spinButtonUpImage=$("<div></div>"),spinButtonDown=$("<div></div>"),spinButtonDownImage=$("<div></div>");if(this._spinUpButton){return}spinButtonUp.addClass(this.css.buttonCommon).attr({title:this._getLocaleValue("spinUpperTitle"),role:"button",tabindex:-1,id:this.id+"_spinUpButton","data-localeid":"spinUpperTitle","data-localeattr":"title"}).append(spinButtonUpImage.addClass(this.css.spinButtonUpImage));spinButtonDown.addClass(this.css.buttonCommon).attr({title:this._getLocaleValue("spinLowerTitle"),role:"button",tabindex:-1,id:this.id+"_spinDownButton","data-localeid":"spinLowerTitle","data-localeattr":"title"}).append(spinButtonDownImage.addClass(this.css.spinButtonDownImage));this._editorContainer.prepend(spinButtonDown).prepend(spinButtonUp);this._attachButtonsEvents("spinDown",spinButtonDown);this._attachButtonsEvents("spinUp",spinButtonUp);this._spinUpButton=spinButtonUp;this._spinDownButton=spinButtonDown},_renderClearButton:function(){var clearButton=$("<div></div>"),buttonClearIcon=$("<div></div>");if(this._clearButton){return}clearButton.addClass(this.css.buttonCommon).attr({title:this._getLocaleValue("clearTitle"),role:"button",id:this.id+"_clearButton",tabindex:-1,"data-localeid":"clearTitle","data-localeattr":"title"}).append(buttonClearIcon.addClass(this.css.clearButtonImage));this._editorContainer.prepend(clearButton.addClass(this.css.clearButton));this._clearButton=clearButton;this._attachButtonsEvents("clear",clearButton)},_renderButtons:function(){var buttons=this.options.buttonType.toString().split(/[\s,]+/),buttonsCountRendered=0;if($.inArray("clear",buttons)!==-1){this._renderClearButton();buttonsCountRendered++}if($.inArray("spin",buttons)!==-1){if(this._numericType||this.options.listItems&&this.options.listItems!==null&&this.options.listItems.length>0){this._renderSpinButtons();buttonsCountRendered+=2}else if(this.options.listItems===null||this.options.listItems.length===0){throw new Error(this._getLocaleValue("noListItemsNoButton"))}}if($.inArray("dropdown",buttons)!==-1){if(this.options.listItems&&this.options.listItems!==null&&this.options.listItems.length>0){this._renderDropDownButton();buttonsCountRendered++}else if(this.options.listItems===null||this.options.listItems.length===0){throw new Error(this._getLocaleValue("noListItemsNoButton"))}}if(buttonsCountRendered===0){throw new Error(this._getLocaleValue("btnValueNotSupported"))}},_attachButtonsEvents:function(type,target){var self=this;if(!target){return}this._detachButtonsEvents(target);target.on({"mouseenter.button":function(){target.addClass(self.css.buttonHover)},"mouseleave.button":function(){target.removeClass(self.css.buttonHover);if(target._pressed){delete target._pressed;target.removeClass(self.css.buttonPressed)}if(target._spinTimeOut){clearTimeout(target._spinTimeOut);delete target._spinTimeOut}if(target._spinInterval){clearInterval(target._spinInterval);delete target._spinInterval}},"mousedown.button":function(event){if(event.button===0||event.button===1&&$.ig.util.isIE8){target.addClass(self.css.buttonPressed);target._pressed=true;event.preventDefault();if(type==="spinUp"||type==="spinDown"){self._handleSpinEvent(type,target)}}event.stopPropagation()},"mouseup.button":function(){target.removeClass(self.css.buttonPressed);delete target._pressed;if(target._spinTimeOut){clearTimeout(target._spinTimeOut);delete target._spinTimeOut}if(target._spinInterval){clearInterval(target._spinInterval);delete target._spinInterval}},"click.button":function(event){self._triggerButtonClick(event,type)}})},_detachButtonsEvents:function(target){if(target){target.off("mouseenter.button mouseleave.button mousedown.button mouseup.button click.button")}},_attachEvents:function(){var self=this;self._super();this._editorInput.on({"focus.editor":function(event){self._setFocus(event)},"input.editor":function(){if(!self._editMode){self._processTextChanged();self._processValueChanging(self._editorInput.val())}},"dragenter.editor":function(){if(!self._focused&&!self._editMode){self._dragging=true;self._enterEditMode()}},"dragleave.editor":function(e){if($.ig.util.isFF&&e.relatedTarget===this){return}if(self._dragging&&self._editMode){self._exitEditMode();delete self._dragging}},"blur.editor":function(event){self._setBlur(event)},"paste.editor":function(event){self._currentInputTextValue=self._editorInput.val();self._pasteHandler(event)},"drop.editor":function(event){self._focused=true;delete self._dragging;self._pasteHandler(event,true)},"keydown.editor":function(event){if((event.keyCode===8||event.keyCode===46)&&self._editorInput.val()!==self._currentInputTextValue){self._processTextChanged()}self._triggerKeyDown(event)},"keyup.editor":function(event){self._triggerKeyUp(event);self._processTextChanged()},"keypress.editor":function(event){self._triggerKeyPress(event)},"compositionstart.editor":function(){var widgetName=self.widgetName,cursorPosition=self._getCursorPosition();if(cursorPosition===-1){switch(widgetName){case"igMaskEditor":case"igDateEditor":case"igDatePicker":{self._editorInput.val(self._maskWithPrompts);self._setCursorPosition(0)}break;default:}}self._compositionStartValue=self._editorInput.val();self._compositionStartIndex=self._getCursorPosition();self._inComposition=true},"compositionend.editor":function(){setTimeout(function(){var value,widgetName=self.widgetName,cursorPosition=self._getCursorPosition(),selection={start:cursorPosition,end:cursorPosition};if(self._focused!==true){return}switch(widgetName){case"igMaskEditor":{value=self._replaceStringRange(self._compositionStartValue,self._currentCompositionValue,self._compositionStartIndex,self._compositionStartIndex+self._currentCompositionValue.length-1)}break;default:{value=self._editorInput.val()}}self._insert(value,self._compositionStartValue,selection);delete self._inComposition;delete self._compositionStartIndex;delete self._currentCompositionValue;delete self._compositionStartValue},0)},"compositionupdate.editor":function(evt){if(typeof self._compositionStartIndex==="undefined"){var startIndex=self._getCursorPosition();startIndex-=evt.originalEvent.data?evt.originalEvent.data.length:1;self._compositionStartIndex=startIndex;self._compositionStartValue=self._editorInput.val().substring(0,startIndex)}setTimeout(function(){self._currentCompositionValue=$(evt.target).val().toString().substring(self._compositionStartIndex,self._getCursorPosition())},0)}})},_detachEvents:function(){this._super();if(this._editorInput){this._editorInput.off("focus.editor input.editor blur.editor paste.editor");this._editorInput.off("dragenter.editor dragleave.editor drop.editor");this._editorInput.off("keydown.editor keyup.editor keypress.editor");this._editorInput.off("compositionstart.editor compositionend.editor compositionupdate.editor")}},_processValueChanging:function(value){if(value!==this.value()){if(!(this.value()===null&&value==="")){this._triggerInternalValueChange(value)}}},_triggerInternalValueChange:function(value){var noCancel=this._triggerValueChanging(value);if(noCancel){this._processInternalValueChanging(value);this._triggerValueChanged(value)}},_processInternalValueChanging:function(value){var listIndex;if(this.options.maxLength){if(value&&value.toString().length>this.options.maxLength){value=value.toString().substring(0,this.options.maxLength);this._sendNotification("warning",{optName:"maxLengthErrMsg",arg:this.options.maxLength})}}if(this._validateValue(value)){if(this._dropDownList&&this.options.isLimitedToListValues&&(listIndex=this._valueIndexInList(value))!==-1){value=this.options.listItems[listIndex]}this._updateValue(value)}else{if(this.options.revertIfNotValid){value=this._valueInput.val();this._updateValue(value)}else{this._clearValue();value=this._valueInput.val()}}},_triggerKeyDown:function(event){var e=event,noCancel,activeItem,args,currentInputVal,selection;args={owner:this,element:event.target,key:event.keyCode,editorInput:this._editorInput};noCancel=this._trigger(this.events.keydown,event,args);if(noCancel){this._clearEditorNotifier();if(e.keyCode===13){if(event.altKey&&this.options.textMode==="multiline"){this._carryOverNewLine(this._editorInput.val())}else{currentInputVal=this._editorInput.val();if(this._dropDownList&&this._dropDownList.is(":visible")){activeItem=this._dropDownList.children(".ui-igedit-listitem").filter("[data-active='true']");if(activeItem.length>0){this._triggerListItemClick(activeItem)}else{this._toggleDropDown();this._processValueChanging(currentInputVal);this._enterEditMode()}}else{this._processValueChanging(currentInputVal);if(this.options.textMode!=="multiline"){this._enterEditMode()}}}}else{if(this._dropDownList){if(e.keyCode===38){if(e.altKey&&this._dropDownList.is(":visible")){this._toggleDropDown()}else if(this._dropDownList.is(":visible")){activeItem=this._dropDownList.children(".ui-igedit-listitem").filter("[data-active='true']");if(activeItem.length>0&&!activeItem.is(":first-child")){this._hoverPreviousDropDownListItem()}else{this._toggleDropDown()}e.preventDefault()}}else if(e.keyCode===40||e.keyCode===38&&e.altKey){if(!this._dropDownList.is(":visible")){this._toggleDropDown()}else{this._hoverNextDropDownListItem()}e.preventDefault()}else if(e.keyCode===27&&this._dropDownList.is(":visible")){this._toggleDropDown()}}if(this.options.maxLength){currentInputVal=this._editorInput.val();if(currentInputVal.length===this.options.maxLength&&(e.keyCode>46||e.keyCode===32)&&!e.altKey&&!e.ctrlKey){selection=this._getSelection(this._editorInput[0]);if(selection.start===selection.end){e.preventDefault();this._sendNotification("warning",{optName:"maxLengthWarningMsg",arg:this.options.maxLength})}}}}}return noCancel},_triggerKeyUp:function(event){var args={originalEvent:event,owner:this,key:event.keyCode,element:event.target,editorInput:this._editorInput};this._trigger(this.events.keyup,event,args)},_validateNonCharacter:function(event){if($.ig.util.isFF){var e=event;if($.inArray(e.keyCode,[46,8,9,27,13,110,190])!==-1||e.which===97&&e.ctrlKey===true||e.which===99&&e.ctrlKey===true||e.which===120&&e.ctrlKey===true||e.which===118&&e.ctrlKey===true||e.which===122&&e.ctrlKey===true||e.which===121&&e.ctrlKey===true||e.keyCode>=35&&e.keyCode<=40){return true}}else{if(event.keyCode===13){return true}return false}},_triggerKeyPress:function(event){if(this._validateNonCharacter(event)||this._validateKey(event)){var args={owner:this,element:event.target,key:event.keyCode,originalEvent:event,editorInput:this._editorInput};if(this.options.preventSubmitOnEnter&&event.keyCode===13&&!event.shiftKey&&this.options.textMode!=="multiline"){event.preventDefault();event.stopPropagation()}if((this.options.toUpper||this.options.toLower)&&!this._validateNonCharacter(event)){var keyCode=event.which?event.which:event.keyCode;if(keyCode){var charStr,transformedChar,key,selection,val;charStr=String.fromCharCode(keyCode);if(this.options.toUpper){transformedChar=charStr.toLocaleUpperCase()}else{transformedChar=charStr.toLocaleLowerCase()}key=transformedChar.charCodeAt(0);args.key=key;selection=this._getSelection(this._editorInput[0]);val=this._editorInput.val();this._editorInput.val(val.slice(0,selection.start)+transformedChar+val.slice(selection.end));this._setCursorPosition(selection.start+1);event.preventDefault()}}return this._trigger(this.events.keypress,event,args)}else{event.preventDefault();event.stopPropagation()}},_triggerValueChanged:function(originalValue){var args={owner:this,editorInput:this._editorInput,newValue:this.options.value};if(originalValue){args.originalValue=originalValue}this._trigger(this.events.valueChanged,null,args)},_triggerValueChanging:function(newValue){var args={owner:this,editorInput:this._editorInput,oldValue:this.value(),newValue:newValue};return this._trigger(this.events.valueChanging,null,args)},_triggerListItemClick:function(item){var noCancel;noCancel=this._triggerDropDownItemSelecting(item);if(noCancel){this._setSelectedItemByIndex($(item).index());if(this._dropDownList.is(":visible")&&this._triggerDropDownClosing()){this._hideDropDownList()}this._currentInputTextValue=this._editorInput.val();this._processValueChanging($(item).text());if(this._editMode){this._enterEditMode()}else{this._editorInput.val(this._getDisplayValue());this._processTextChanged()}this._triggerDropDownItemSelected()}},_triggerButtonClick:function(event,buttonType){if(buttonType){switch(buttonType){case"dropdown":{this._toggleDropDown()}break;case"clear":{this._currentInputTextValue=this._editorInput.val();if(this._editorIsCleared()){if(!this.options.allowNullValue){this._clearValue()}return}if(!this._editMode){this._clearValue();this._processTextChanged();this._exitEditMode();this._triggerValueChanged()}else{this._clearValue(true);this._processTextChanged();this._positionCursor()}}break}}},_triggerDropDownClosing:function(){var args={editor:this._editorContainer,owner:this,editorInput:this._editorInput,list:this._dropDownList};return this._trigger(this.events.dropDownListClosing,null,args)},_triggerDropDownClosed:function(){var args={editor:this._editorContainer,owner:this,editorInput:this._editorInput,list:this._dropDownList};this._trigger(this.events.dropDownListClosed,null,args)},_triggerDropDownOpening:function(){var args={editor:this._editorContainer,owner:this,editorInput:this._editorInput,list:this._dropDownList};return this._trigger(this.events.dropDownListOpening,null,args)},_triggerDropDownOpened:function(){var args={owner:this,editorInput:this._editorInput,list:this._dropDownList};if(this._scrollTopDropDownPosition!==undefined){this._dropDownList.scrollTop(this._scrollTopDropDownPosition)}return this._trigger(this.events.dropDownListOpened,null,args)},_triggerDropDownItemSelecting:function(item){var args={editor:this._editorContainer,owner:this,editorInput:this._editorInput,list:this._dropDownList,item:item};return this._trigger(this.events.dropDownItemSelecting,null,args)},_triggerDropDownItemSelected:function(){var args={owner:this,editorInput:this._editorInput,list:this._dropDownList,item:this.getSelectedListItem()[0]};this._trigger(this.events.dropDownItemSelected,null,args)},_processTextChanged:function(){var currentVal=this._editorInput.val(),previousVal=this._currentInputTextValue;if(currentVal!==previousVal){if(previousVal===undefined){previousVal=""}this._triggerTextChanged(previousVal,currentVal);if(this._editMode&&this._dropDownList){this._updateDropdownSelection(this._valueFromText(currentVal))}if(this._validator){this._validator._validateInternal(this.element,null,false,this._editMode?this._valueFromText(currentVal):this.value())}this._currentInputTextValue=currentVal}this._checkClearButtonState();this._setSpinButtonsState(currentVal)},_triggerTextChanged:function(oldValue,newValue){var args={owner:this,text:newValue,oldText:oldValue?oldValue:""};this._trigger(this.events.textChanged,null,args)},_checkClearButtonState:function(){if(this._clearButton){if(this._editorIsCleared()){this._clearButton.hide()}else{this._clearButton.show()}}},_editorIsCleared:function(){var result=false,currentVal=this._editorInput.val();if(currentVal===""){result=true}return result},_elementPositionInViewport:function(el){var areaTop=Math.ceil(el.parent().igOffset().top),elementoffset=Math.ceil(el.igOffset().top),elementHeight=Math.ceil(el.outerHeight()),listVisibleHeight=el.parent().outerHeight(),result;if(elementoffset-areaTop<0){result="top"}else if(elementoffset+elementHeight-areaTop<listVisibleHeight){result="inside"}else if(elementoffset+elementHeight-areaTop>listVisibleHeight){result="bottom"}return result},_hoverPreviousDropDownListItem:function(){var newItem,position,currentItem=this._listItems().filter("[data-active='true']");newItem=this._getSpinItem("up",currentItem);if(newItem.length>0){position=this._elementPositionInViewport(newItem);if(position==="top"){this._dropDownList.scrollTop(this._dropDownList.scrollTop()-newItem.outerHeight())}else if(position==="bottom"){this._dropDownList.scrollTop(this._dropDownList.scrollTop()+newItem.igPosition().top)}currentItem.removeClass(this.css.listItemActive,this.options.listItemHoverDuration);currentItem.removeAttr("data-active");newItem.addClass(this.css.listItemActive,this.options.listItemHoverDuration);newItem.attr("data-active",true)}},_hoverNextDropDownListItem:function(){var newItem,position,currentItem=this._listItems().filter("[data-active='true']");newItem=this._getSpinItem("down",currentItem);if(newItem.length>0){position=this._elementPositionInViewport(newItem);if(position==="bottom"){this._dropDownList.scrollTop(this._dropDownList.scrollTop()+newItem.outerHeight())}else if(position==="top"){this._dropDownList.scrollTop(this._dropDownList.scrollTop()+newItem.igPosition().top)}currentItem.removeClass(this.css.listItemActive,this.options.listItemHoverDuration);currentItem.removeAttr("data-active");newItem.addClass(this.css.listItemActive,this.options.listItemHoverDuration);newItem.attr("data-active",true)}},_pasteHandler:function(e,drop){var self=this,previousValue=$(e.target).val(),newValue,selection;this._currentInputTextValue=this._editorInput.val();this._timeouts.push(setTimeout(function(){newValue=self._editorInput.val();selection=self._getSelection(self._editorInput[0]);self._insert(newValue,previousValue,selection);if(drop){if(self._editorInput.is(":focus")){self._triggerFocus(e)}else{self._processValueChanging(newValue);self._focused=false;self._exitEditMode()}}},10))},_insertHandler:function(string){var selection=this._getSelection(this.field()[0]),previousValue,newValue;if(string){if(this._editMode){previousValue=this._editorInput.val();newValue=this._replaceDisplayValue(selection,previousValue,string)}else{previousValue=this.value();newValue=string}this._insert(newValue,previousValue)}},_replaceDisplayValue:function(selection,previousValue,string){return previousValue.substring(0,selection.start)+string+previousValue.substring(selection.end,previousValue.length)},_insert:function(newValue,previousValue,selection){var i,ch;if(this.options.maxLength){if(newValue&&newValue.toString().length>this.options.maxLength){newValue=newValue.toString().substring(0,this.options.maxLength);this._sendNotification("warning",{optName:"maxLengthErrMsg",arg:this.options.maxLength})}}if(this._validateValue(newValue)){if(this.options.toUpper){if(newValue){newValue=newValue.toLocaleUpperCase()}}else if(this.options.toLower){if(newValue){newValue=newValue.toLocaleLowerCase()}}if(this.options.includeKeys!==null){for(i=0;i<newValue.length;i++){ch=newValue.charAt(i);if($.inArray(ch,this._includeKeysArray)!==-1){continue}else{newValue=this._replaceCharAt(newValue,i,"");i--}}}if(this.options.excludeKeys!==null){for(i=0;i<newValue.length;i++){ch=newValue.charAt(i);if($.inArray(ch,this._excludeKeysArray)!==-1){newValue=this._replaceCharAt(newValue,i,"");i--}}}if(this._editMode){this._editorInput.val(newValue);if(selection!==undefined){this._setSelectionRange(this._editorInput[0],selection.start,selection.end)}}else{this._processInternalValueChanging(newValue);this._exitEditMode()}this._processTextChanged()}else{this._editorInput.val(previousValue)}},_markDropDownHoverActiveItem:function(){var activeItem=this._dropDownList.children(".ui-igedit-listitem").filter(".ui-igedit-listitemselected");if(!activeItem.length){return}if(this._dropDownList.parent().hasClass("ui-effects-wrapper")){this._scrollTopDropDownPosition=this._dropDownList.scrollTop()+activeItem.position().top}if(this._elementPositionInViewport(activeItem)!=="inside"){this._dropDownList.scrollTop(this._dropDownList.scrollTop()+activeItem.igPosition().top)}activeItem.attr("data-active",true)},_clearDropDownHoverActiveItem:function(){var hoveredItem=this._dropDownList.children(".ui-igedit-listitem").filter("[data-hovered='true']"),activeItem=this._dropDownList.children(".ui-igedit-listitem").filter("[data-active='true']");if(hoveredItem.length>0){hoveredItem.removeClass(this.css.listItemHover);hoveredItem.removeAttr("data-hovered")}if(activeItem.length>0){activeItem.removeClass(this.css.listItemActive);activeItem.removeAttr("data-active")}},_showDropDownList:function(){var direction;this._positionDropDownList();if(this._dropDownListOrientation==="up"){direction="down"}else{direction="up"}try{$(this._dropDownList).show("blind",{direction:direction},this.options.dropDownAnimationDuration,$.proxy(this._triggerDropDownOpened,this))}catch(ex){$(this._dropDownList).show(this.options.dropDownAnimationDuration,$.proxy(this._triggerDropDownOpened,this))}this._editorInput.attr("aria-expanded",true);this._markDropDownHoverActiveItem()},_hideDropDownList:function(){var direction;if(this._dropDownListOrientation==="up"){direction="down"}else{direction="up"}try{$(this._dropDownList).hide("blind",{direction:direction},this.options.dropDownAnimationDuration,$.proxy(this._triggerDropDownClosed,this))}catch(ex){$(this._dropDownList).hide(this.options.dropDownAnimationDuration,$.proxy(this._triggerDropDownClosed,this))}this._editorInput.attr("aria-expanded",false);this._clearDropDownHoverActiveItem()},_toggleDropDown:function(){var noCancel;if(this._dropDownList.is(":visible")){noCancel=this._triggerDropDownClosing();if(noCancel){this._hideDropDownList()}}else{noCancel=this._triggerDropDownOpening();if(noCancel){if(!this._editMode&&!this.options.suppressKeyboard){this._editorInput.focus()}if(this._editMode&&this.options.suppressKeyboard){this._editorInput.blur()}this._showDropDownList()}}},_validateKey:function(event){var ch,result;if(this.options.excludeKeys){ch=String.fromCharCode(event.charCode||event.which);if($.inArray(ch,this._excludeKeysArray)!==-1){result=false}else{result=true}}else if(this.options.includeKeys){ch=String.fromCharCode(event.charCode||event.which);if($.inArray(ch,this._includeKeysArray)!==-1){result=true}else{result=false}}else{result=true}return result},_enterEditMode:function(){var val=this._valueInput.val(),selection=this._getSelection(this._editorInput[0]);this._editMode=true;this._currentInputTextValue=this._editorInput.val();this._editorInput.val(this._getEditModeValue(val));this._positionCursor(selection.start,selection.end);this._processTextChanged()},_getEditModeValue:function(val){return val},_exitEditMode:function(){if(this.options.textMode==="text"&&!$.ig.util.isIE8){this._editorInput.attr("type","text")}this._currentInputTextValue=this._editorInput.val();this._editorInput.val(this._getDisplayValue());this._editMode=false;this._processTextChanged()},_getDisplayValue:function(){return this._valueInput.val()},_valueFromText:function(text){return text},_setCursorPosition:function(positionIndex){this._setSelectionRange(this._editorInput[0],positionIndex,positionIndex)},_setSelectionRange:function(input,selectionStart,selectionEnd){if(input.setSelectionRange){if(!$.contains(document.documentElement,input)&&$.ig.util.isIE){return}input.setSelectionRange(selectionStart,selectionEnd)}else if(input.createTextRange){var range=input.createTextRange();range.collapse(true);range.moveEnd("character",selectionEnd);range.moveStart("character",selectionStart);range.select()}},_positionCursor:function(startPosition,endPosition){if(this._dragging){return}var currentValue=this._editorInput.val(),self=this;if(currentValue&&currentValue.length>0){switch(this.options.selectionOnFocus){case"selectAll":{if($.ig.util.isChrome||$.ig.util.isSafari){this._timeouts.push(setTimeout(function(){self._setSelectionRange(self._editorInput[0],0,currentValue.length)},100))}else{this._editorInput.select()}}break;case"atStart":{if($.ig.util.isChrome||$.ig.util.isSafari){this._timeouts.push(setTimeout(function(){
self._setSelectionRange(self._editorInput[0],0,0)},100))}else{this._setSelectionRange(this._editorInput[0],0,0)}}break;case"atEnd":{if($.ig.util.isChrome||$.ig.util.isSafari){this._timeouts.push(setTimeout(function(){self._setSelectionRange(self._editorInput[0],currentValue.length,currentValue.length)},100))}else{this._setSelectionRange(this._editorInput[0],currentValue.length,currentValue.length)}}break;case"browserDefault":{if(startPosition>=0){if(endPosition){if(endPosition>currentValue.length){endPosition=currentValue.length}}else{endPosition=startPosition}if($.ig.util.isChrome||$.ig.util.isSafari){this._timeouts.push(setTimeout(function(){self._setSelectionRange(self._editorInput[0],startPosition,endPosition)},100))}else{this._setSelectionRange(this._editorInput[0],startPosition,endPosition)}}else{if($.ig.util.isChrome||$.ig.util.isSafari){this._timeouts.push(setTimeout(function(){self._setSelectionRange(self._editorInput[0],0,currentValue.length)},100))}else{this._editorInput.select()}}}break;default:break}}else{this._editorInput.select()}},_carryOverNewLine:function(value){var cursorPosition=this._getCursorPosition(),substrings=this._splitString(value,cursorPosition);this._editorInput.val(substrings.before+"\r\n"+substrings.after);this._setCursorPosition(cursorPosition+1)},_splitString:function(value,index){return{before:value.substring(0,index),after:value.substring(index)}},_spin:function(type,fireEvent){var nextItem;if(this._dropDownList){nextItem=this._getSpinItem(type);if(!nextItem.length){return}if(fireEvent&&!this._triggerDropDownItemSelecting(nextItem[0])){return}this._currentInputTextValue=this._editorInput.val();if(this._editMode){this._editorInput.val(nextItem.text());this._processTextChanged();this._editorInput.select()}else{this._processValueChanging(nextItem.text());this._editorInput.val(this._getDisplayValue());this._processTextChanged()}if(fireEvent){this._triggerDropDownItemSelected()}}},_getSpinItem:function(spinType,selected){var items=this._listItems(),newItem,currentItem;if(!items.length){return items}if(selected){currentItem=selected}else{currentItem=this.getSelectedListItem()}if(currentItem.length>0){newItem=currentItem[spinType==="up"?"prev":"next"]();if(!newItem.length&&this.options.spinWrapAround){newItem=items[spinType==="up"?"last":"first"]()}return newItem}else{return items.first()}},_handleSpinUpEvent:function(){this._spin("up",true)},_handleSpinDownEvent:function(){this._spin("down",true)},_handleSpinEvent:function(type,target){var self=this;if(type==="spinUp"){this._handleSpinUpEvent();if(!target.attr("disabled")&&!target._spinTimeOut){target._spinTimeOut=setTimeout(function(){target._spinInterval=setInterval(function(){self._handleSpinUpEvent()},75)},300)}}else if(type==="spinDown"){this._handleSpinDownEvent();if(!target.attr("disabled")&&!target._spinTimeOut){target._spinTimeOut=setTimeout(function(){target._spinInterval=setInterval(function(){self._handleSpinDownEvent()},75)},300)}}this._timeouts.push(target._spinTimeOut)},_clearValue:function(textOnly){this._super(textOnly)},_clearEditorNotifier:function(){var notifier=this._editorContainer.data("igNotifier");if(notifier&&notifier.options.state==="warning"&&notifier.isVisible()){notifier.hide()}},_getCursorPosition:function(){var selection=this._getSelection(this._editorInput[0]);if(selection.end-selection.start===this._editorInput.val().length&&this._editorInput.val().length>0){return-1}else{return selection.start}},_getSelection:function(editor){var startPosition=0,endPosition=0;if(editor.selectionStart!==undefined){startPosition=editor.selectionStart;endPosition=editor.selectionEnd}else if(document.selection){var globalSelection=document.selection.createRange(),range,rangeClone;if(globalSelection!==null){range=editor.createTextRange();rangeClone=range.duplicate();range.moveToBookmark(globalSelection.getBookmark());endPosition=range.text.length;rangeClone.setEndPoint("EndToStart",range);startPosition=rangeClone.text.length;endPosition+=startPosition}}return{start:startPosition,end:endPosition}},_listItems:function(){return this._dropDownList.children(".ui-igedit-listitem")},_getListItemByIndex:function(index){return this._listItems().eq(index)},_getSelectedItemIndex:function(){var items=this._listItems(),i;for(i=0;i<items.length;i++){if($(items[i]).hasClass(this.css.listItemSelected)){return i}}return-1},_setSelectedItemByIndex:function(index){var oldSelectedItem,newSelectedItem,position;if(this._getSelectedItemIndex()!==index){oldSelectedItem=this.getSelectedListItem();oldSelectedItem.removeClass(this.css.listItemSelected);oldSelectedItem.removeAttr("data-active");oldSelectedItem.attr("aria-selected",false);newSelectedItem=this._getListItemByIndex(index);newSelectedItem.addClass(this.css.listItemSelected);newSelectedItem.attr("aria-selected",true);if(this.dropDownVisible()){position=this._elementPositionInViewport(newSelectedItem);if(position!=="inside"){this._dropDownList.scrollTop(this._dropDownList.scrollTop()+newSelectedItem.igPosition().top)}this._clearDropDownHoverActiveItem();newSelectedItem.attr("data-active",true)}}},_updateDropdownSelection:function(currentVal){var current=this.getSelectedListItem().index(),selectedIndex=this._valueIndexInList(currentVal);if(current!==selectedIndex){if(selectedIndex>-1){this._setSelectedItemByIndex(selectedIndex)}else{this.getSelectedListItem().removeClass(this.css.listItemSelected).attr("aria-selected",false).removeAttr("data-active");if(this.dropDownVisible()){this._clearDropDownHoverActiveItem()}}}},displayValue:function(){return this._getDisplayValue()},dropDownContainer:function(){return this._dropDownList?this._dropDownList:null},showDropDown:function(){this._showDropDownList()},hideDropDown:function(){this._hideDropDownList()},dropDownButton:function(){return this._dropDownButton},dropDownVisible:function(){return this._dropDownList.is(":visible")},clearButton:function(){return this._clearButton},findListItemIndex:function(text,matchType){var list=this.options.listItems,matchCase="i",index=-1,regString,regExp,i;if(!list||list.length===0){return-1}switch(matchType){case"startsWith":regString="^{pattern}";break;case"endsWith":regString="{pattern}$";break;case"exact":regString="^{pattern}$";matchCase=undefined;break;default:regString="{pattern}";break}regExp=new RegExp(regString.replace("{pattern}",$.ig.util.escapeRegExp(text)),matchCase);for(i=0;i<list.length;i++){if(regExp.test(list[i])){index=i}}return index},selectedListIndex:function(index){if(index!==undefined&&typeof this.options.listItems[index]!=="undefined"){this._processInternalValueChanging(this.options.listItems[index])}else{return this._getSelectedItemIndex()}},getSelectedListItem:function(){return this._listItems().filter(".ui-igedit-listitemselected")},getSelectedText:function(){var text=this._editMode?this._editorInput.val():this.displayValue(),startIndex=this.getSelectionStart(),endIndex=this.getSelectionEnd();if(startIndex===undefined||endIndex===undefined||startIndex===null||endIndex===null||startIndex===endIndex){return""}return text.substring(startIndex,endIndex)},getSelectionStart:function(){return this._getSelection(this._editorInput[0]).start},getSelectionEnd:function(){return this._getSelection(this._editorInput[0]).end},insert:function(string){this._insertHandler(string)},select:function(start,end){this._setSelectionRange(this._editorInput[0],start,end)},spinUp:function(){this._spin("up")},spinDown:function(){this._spin("down")},spinUpButton:function(){return this._spinUpButton},spinDownButton:function(){return this._spinDownButton}});$.extend($.ui.igTextEditor,{version:"21.2.12"});$.widget("ui.igNumericEditor",$.ui.igTextEditor,{options:{listItems:null,negativeSign:null,negativePattern:null,decimalSeparator:null,groupSeparator:null,groups:null,maxDecimals:null,minDecimals:null,roundDecimals:true,textAlign:"right",dataMode:"double",minValue:null,maxValue:null,allowNullValue:false,spinDelta:1,scientificFormat:null,spinWrapAround:false,isLimitedToListValues:false,maxLength:null,excludeKeys:null,includeKeys:null,toLower:null,toUpper:null,textMode:"text",value:null},events:{},css:{negative:"ui-igedit-negative"},_create:function(){$.ui.igTextEditor.prototype._create.call(this);if(!$.ig.util.isIE8){this._editorInput.attr("type","tel")}},_initialize:function(){this._super();this._setNumericType();this._validateDecimalSettings();this._validateRegionalSettings();this._applyDataModeSettings();var numericChars="0123456789",dataMode=this.options.dataMode;if(dataMode==="double"||dataMode==="float"){numericChars+=this._getOptionOrRegionalValue("decimalSeparator");if(this._getOptionOrRegionalValue("decimalSeparator")!=="."){numericChars+="."}}if(this._getScientificFormat()){numericChars+=this._getScientificFormat()}if(dataMode==="double"||dataMode==="float"||dataMode==="long"||dataMode==="int"||dataMode==="short"||dataMode==="sbyte"){numericChars+=this._getRegionalValue("negativeSign")}if(this.options.excludeKeys){this.options.excludeKeys=null}if(this._getOptionOrRegionalValue("decimalSeparator").toString().length>1){throw new Error(this._getLocaleValue("decimalSeparatorErrorMsg"))}this.options.includeKeys=numericChars;if(this._getOptionOrRegionalValue("decimalSeparator")===this._getOptionOrRegionalValue("groupSeparator")){throw new Error(this._getLocaleValue("decimalSeparatorEqualsGroupSeparatorErrorMsg"))}},_setNumericType:function(){this._numericType="numeric"},_getScientificFormat:function(){var result;if(this.options.scientificFormat){switch(this.options.scientificFormat){case"E":case"E+":{result="E"}break;case"e":case"e+":{result="e"}break;default:{result="e";throw new Error(this._getLocaleValue("scientificFormatErrMsg"))}}}else{result=null}return result},_validateRegionalSettings:$.noop,_getOptionOrRegionalValue:function(name){var regName;if(name==="negativeSign"||name==="percentSymbol"||name==="currencySymbol"||name==="displayFactor"){regName=name}else{regName=this._numericType+name.substr(0,1).toUpperCase()+name.substr(1)}return this.options[name]!==null?this.options[name]:this._getRegionalValue(regName)},_setInitialValue:function(value){value=this._getValueBetweenMinMax(value);this._super(value)},_applyOptions:function(){this._super();this._validateSpinSettings();if(this.options.maxLength!==null){this.options.maxLength=null}if(this.options.value<0){this._editorInput.addClass(this.css.negative)}},_validateSpinSettings:function(){var delta,fractional;if(this.options.buttonType==="spin"){this._setSpinButtonsState(this.options.value)}if(this.options.spinDelta!==1){delta=this.options.spinDelta;if(typeof delta!=="number"){this.options.spinDelta=1;throw new Error(this._getLocaleValue("spinDeltaIsOfTypeNumber"))}if(delta<0){this.options.spinDelta=1;throw new Error(this._getLocaleValue("spinDeltaCouldntBeNegative"))}if(this.options.dataMode==="float"||this.options.dataMode==="double"){if(delta%1!==0){fractional=delta.toString().substring(delta.toString().indexOf(".")+1);if(fractional.toString().length>this._getOptionOrRegionalValue("maxDecimals")){throw new Error($.ig.util.stringFormat(this._getLocaleValue("spinDeltaContainsExceedsMaxDecimals"),this._getOptionOrRegionalValue("maxDecimals")))}}}else{if(delta%1!==0){throw new Error(this._getLocaleValue("spinDeltaIncorrectFloatingPoint"))}}}if(this.options.scientificFormat){this.options.spinDelta=Number(this.options.spinDelta.toExponential())}},_validateDecimalSettings:function(){var minDecimalsName=this._numericType+"MinDecimals",maxDecimalsName=this._numericType+"MaxDecimals";if(this.options.minDecimals===null){this.options.minDecimals=this._getRegionalValue(minDecimalsName)}try{this._validateDecimalSetting("minDecimals",this.options.minDecimals)}catch(e){this.options.minDecimals=this._getRegionalValue(minDecimalsName);throw e}if(this.options.maxDecimals===null){this.options.maxDecimals=this._getRegionalValue(maxDecimalsName)}try{this._validateDecimalSetting("maxDecimals",this.options.maxDecimals)}catch(e){this.options.maxDecimals=this._getRegionalValue(maxDecimalsName);throw e}this._validateDecimalMinMax()},_validateDecimalSetting:function(name,value){var mode=this.options.dataMode,boundary;if(mode==="double"){boundary=15}else if(mode==="float"){boundary=7}if(value===""||isNaN(value)||!isNaN(value)&&(value<0||value>boundary)){throw new Error($.ig.util.stringFormat(this._getLocaleValue("decimalNumber"),mode,name,boundary))}},_validateDecimalMinMax:function(){if(this._getOptionOrRegionalValue("minDecimals")>this._getOptionOrRegionalValue("maxDecimals")){this.options.maxDecimals=this._getOptionOrRegionalValue("minDecimals")}},_getValueBetweenMinMax:function(value){if(!(this.options.allowNullValue&&value===this.options.nullValue)){if(!isNaN(this.options.minValue)&&this.options.minValue>value){value=this.options.minValue}else if(!isNaN(this.options.maxValue)&&this.options.maxValue<value){value=this.options.maxValue}}return value},_setOption:function(option,value){var prevValue=this.options[option];if(prevValue===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"scientificFormat":if(this._getScientificFormat()||value===null){if(prevValue){if(prevValue==="e+"||prevValue==="E+"){prevValue=prevValue.replace("+","")}this.options.includeKeys=this.options.includeKeys.replace(prevValue,"")}if(value===null){this._includeKeysArray=this.options.includeKeys.split("");break}var numericChars=this._getScientificFormat();this.options.includeKeys+=numericChars;this._includeKeysArray=this.options.includeKeys.split("")}break;case"spinDelta":if(typeof value!=="number"){this.options[option]=prevValue;throw new Error(this._getLocaleValue("spinDeltaIsOfTypeNumber"))}else if(value<0){this.options[option]=prevValue;throw new Error(this._getLocaleValue("spinDeltaCouldntBeNegative"))}else if(this.options.dataMode!=="float"&&this.options.dataMode!=="double"&&value%1!==0){this.options[option]=prevValue;throw new Error(this._getLocaleValue("spinDeltaIncorrectFloatingPoint"))}else if(this.options.scientificFormat){this.options[option]=Number(value.toExponential())}break;case"minValue":case"maxValue":if(isNaN(value)){this.options[option]=prevValue;return}if(value===null){this._applyDataModeSettings()}else{this._processInternalValueChanging(this.value());if(!this._editMode){this._editorInput.val(this._getDisplayValue())}}this._setSpinButtonsState(this.value());break;case"minDecimals":case"maxDecimals":try{this._validateDecimalSetting(option,value)}catch(e){this.options[option]=prevValue;throw e}if(this.options[option]!==prevValue){this._validateDecimalMinMax();this._processInternalValueChanging(this.value());if(!this._editMode){this._editorInput.val(this._getDisplayValue())}}break;case"decimalSeparator":if(value.toString().length>1){this.options[option]=prevValue;throw new Error(this._getLocaleValue("decimalSeparatorErrorMsg"))}if(this.options[option]===this._getOptionOrRegionalValue("groupSeparator")){throw new Error(this._getLocaleValue("decimalSeparatorEqualsGroupSeparatorErrorMsg"))}break;case"groupSeparator":if(this.options[option]===null){this.options[option]=this._getRegionalValue("numericGroupSeparator")}if(this.options[option]===this._getOptionOrRegionalValue("decimalSeparator")){throw new Error(this._getLocaleValue("decimalSeparatorEqualsGroupSeparatorErrorMsg"))}break;case"excludeKeys":case"includeKeys":this.options[option]=prevValue;throw new Error(this._getLocaleValue("numericEditorNoSuchOption"));default:this.options[option]=prevValue;this._super(option,value);break}},_processValueChanging:function(value){var displayFactor=this._getOptionOrRegionalValue("displayFactor");if(typeof value==="string"||value instanceof String){value=value.trim();value=this._parseNumericValueByMode(value,this._numericType,this.options.dataMode);if(value===""&&!this.options.allowNullValue){value=0}if(this._numericType==="percent"&&displayFactor){if(value!==""&&!isNaN(value)){value=this._divideWithPrecision(value,displayFactor)}}}this._super(value)},_processInternalValueChanging:function(value){value=this._parseNumericValueByMode(value,this._numericType,this.options.dataMode);if(value!==""&&!isNaN(value)){if(!isNaN(this.options.maxValue)&&value>this.options.maxValue){value=this.options.maxValue;this._sendNotification("warning",{optName:"maxValExceedSetErrMsg",arg:this.options.maxValue})}else if(!isNaN(this.options.minValue)&&value<this.options.minValue){value=this.options.minValue;this._sendNotification("warning",{optName:"minValExceedSetErrMsg",arg:this.options.minValue})}}if(!this._validateValue(value)){if(value!==""&&!isNaN(value)){if(this.options.revertIfNotValid){value=this._valueInput.val()}else if(this.options.isLimitedToListValues){value=""}}else{if(this.options.allowNullValue){value=this.options.nullValue}else{if(this.options.revertIfNotValid){value=this._valueInput.val()}else{value=0;if(this.options.minValue>0){value=this.options.minValue}else if(this.options.maxValue<0){value=this.options.maxValue}else{value=0}}}}}if(value!==this.value()){if(value===""&&this.options.allowNullValue&&this.options.nullValue===null){this._clearValue()}else{this._updateValue(value)}}this._setSpinButtonsState(value)},_triggerKeyDown:function(event){var e=event,noCancel,args,currentInputVal;args={owner:this,element:event.target,key:event.keyCode,editorInput:this._editorInput};noCancel=this._trigger(this.events.keydown,event,args);if(noCancel){this._clearEditorNotifier();if(e.keyCode===13){currentInputVal=this._editorInput.val();if(this._dropDownList&&this._dropDownList.is(":visible")){this._super(event)}else{this._processValueChanging(currentInputVal);this._enterEditMode()}}else if(e.keyCode===38){if(e.altKey&&this._dropDownList&&this._dropDownList.is(":visible")){this._toggleDropDown()}else if(this._dropDownList&&this._dropDownList.is(":visible")){this._hoverPreviousDropDownListItem()}else if(!this.options.readOnly||this.options.readOnly&&this.options.isLimitedToListValues){this._handleSpinUpEvent()}e.preventDefault()}else if(e.keyCode===40){if(e.altKey&&this._dropDownList&&!this._dropDownList.is(":visible")){this._toggleDropDown()}else if(this._dropDownList&&this._dropDownList.is(":visible")){this._hoverNextDropDownListItem()}else if(!this.options.readOnly||this.options.readOnly&&this.options.isLimitedToListValues){this._handleSpinDownEvent()}e.preventDefault()}else if(e.keyCode===27&&this._dropDownList&&this._dropDownList.is(":visible")){this._toggleDropDown()}}return noCancel},_applyDataModeSettings:function(){switch(this.options.dataMode){case"double":{this._setMinMaxValues(-Number.MAX_VALUE,Number.MAX_VALUE)}break;case"float":{var floatMinValue=-3.40282347e38,floatMaxValue=3.40282347e38;this._setMinMaxValues(floatMinValue,floatMaxValue)}break;case"long":{var longMinValue=-0x8000000000000000,longMaxValue=0x8000000000000000;this._setMinMaxValues(longMinValue,longMaxValue)}break;case"ulong":{var ulongMinValue=0,ulongMaxValue=0x10000000000000000;this._setMinMaxValues(ulongMinValue,ulongMaxValue)}break;case"int":{var intMinValue=-2147483647,intMaxValue=2147483647;this._setMinMaxValues(intMinValue,intMaxValue)}break;case"uint":{var uintMinValue=0,uintMaxValue=4294967295;this._setMinMaxValues(uintMinValue,uintMaxValue)}break;case"short":{var shortMinValue=-32768,shortMaxValue=32767;this._setMinMaxValues(shortMinValue,shortMaxValue)}break;case"ushort":{var ushortMinValue=0,ushortMaxValue=65535;this._setMinMaxValues(ushortMinValue,ushortMaxValue)}break;case"sbyte":{var sbyteMinValue=-127,sbyteMaxValue=127;this._setMinMaxValues(sbyteMinValue,sbyteMaxValue)}break;case"byte":{var byteMinValue=0,byteMaxValue=256;this._setMinMaxValues(byteMinValue,byteMaxValue)}break;default:{this.options.dataMode="double";this._setMinMaxValues(Number.MIN_VALUE,Number.MAX_VALUE)}}},_setMinMaxValues:function(typeMinValue,typeMaxValue){if(this.options.minValue===null||this.options.minValue<typeMinValue){this.options.minValue=typeMinValue}if(this.options.maxValue===null||this.options.maxValue>typeMaxValue){this.options.maxValue=typeMaxValue}},_parseNumericValueByMode:function(value,numericEditorType,dataMode){var val,stringValue,exponent,exponentIndex,decimalSeparator=this._getOptionOrRegionalValue("decimalSeparator"),groupSeparator=this._getOptionOrRegionalValue("groupSeparator"),maxDecimals=this._getOptionOrRegionalValue("maxDecimals");if(value===null||value===""){return value}if($.type(value)!=="number"){value=$.ig.util.IMEtoNumberString(value,$.ig.util.IMEtoENNumbersMapping());value=value.toString().replace(new RegExp($.ig.util.escapeRegExp(groupSeparator),"g"),"");if(this._getOptionOrRegionalValue("negativeSign")!=="-"){value=value.replace(this._getOptionOrRegionalValue("negativeSign"),"-")}if(numericEditorType==="percent"){value=value.replace(this._getOptionOrRegionalValue("percentSymbol"),"").trim()}else if(numericEditorType==="currency"){value=value.replace(this._getOptionOrRegionalValue("currencySymbol"),"").trim()}if(value.indexOf(decimalSeparator)!==-1){value=value.replace(decimalSeparator,".")}}if(dataMode==="double"||dataMode==="float"){stringValue=value.toString().toLowerCase();if(stringValue.indexOf("e")!==-1){val=value=Number(value);if(value<1){if(!this.options.scientificFormat){stringValue=value.toFixed(this._getOptionOrRegionalValue("maxDecimals")+1)}else{stringValue=value.toString().toLowerCase();exponentIndex=stringValue.indexOf("e");exponent=stringValue.substring(exponentIndex+1);stringValue=stringValue.substring(0,exponentIndex)}}else{return value}}if(stringValue.indexOf(".")!==-1){var integerDigits,fractionalDigits;decimalSeparator=".";fractionalDigits=stringValue.substring(stringValue.indexOf(decimalSeparator)+1);if(fractionalDigits.indexOf(decimalSeparator)>0){fractionalDigits=fractionalDigits.substring(0,fractionalDigits.indexOf(decimalSeparator))}if(fractionalDigits.length>maxDecimals){if(this.options.roundDecimals){stringValue=Math.round10(stringValue,-maxDecimals).toFixed(maxDecimals);if(stringValue.indexOf(decimalSeparator)>-1){fractionalDigits=stringValue.substring(stringValue.indexOf(decimalSeparator)+1)}else{fractionalDigits=""}}else{fractionalDigits=fractionalDigits.substring(0,maxDecimals)}}if(stringValue.indexOf(decimalSeparator)>-1){integerDigits=stringValue.substring(0,stringValue.indexOf(decimalSeparator))}else{integerDigits=stringValue}val=integerDigits+"."+fractionalDigits;if(exponent){val+="e"+exponent}val=val/1}else if(!exponent){val=parseInt(value)}}else{if(value.toString().toLowerCase().indexOf("e")!==-1){value=Number(value).toFixed()}if(this._numericType==="percent"&&this.options.displayFactor===100&&this.options.dataMode==="int"&&parseInt(value)!==parseInt(this._editorInput.val())){val=value}else{val=parseInt(value)}}return val},_multiplyWithPrecision:function(value1,value2,precision){var fractionalDigits,fractionalDigits2,result;if(!precision){fractionalDigits=value1.toString().indexOf(".")>0?value1.toString().substring(value1.toString().indexOf(".")+1):"";fractionalDigits2=value2.toString().indexOf(".")>0?value2.toString().substring(value2.toString().indexOf(".")+1):"";if(fractionalDigits2.length){fractionalDigits+=fractionalDigits2}precision=Math.pow(10,fractionalDigits.length)}value1*=precision;value2*=precision;result=value1*value2/(precision*precision);return result.toFixed(fractionalDigits.length)*1},_divideWithPrecision:function(value1,value2){var fractionalDigits,fractionalDigits2,precision;fractionalDigits=value1.toString().indexOf(".")>0?value1.toString().substring(value1.toString().indexOf(".")+1):"";fractionalDigits2=value2.toString().indexOf(".")>0?value2.toString().substring(value2.toString().indexOf(".")+1):"";if(fractionalDigits2.length>fractionalDigits.length){fractionalDigits=fractionalDigits2}precision=Math.pow(10,fractionalDigits.length);value1=this._multiplyWithPrecision(value1,precision);value2=this._multiplyWithPrecision(value2,precision);return value1/value2},_updateValue:function(value){var val=value,dataMode=this.options.dataMode;if(value===null){value=""}else{value=val=this._parseNumericValueByMode(value,this._numericType,dataMode)}this.options.value=val;this._valueInput.val(value);if(this._dropDownList){this._updateDropdownSelection(val)}},_validateKey:function(event){if(this._super(event)){var dataMode=this.options.dataMode,ch,val,negativeSign=this._getOptionOrRegionalValue("negativeSign"),nextCh,prevCh,leadPos=0,nextDirection=1,cursorPos=this._getCursorPosition(),isDecimal=event.which?event.which===46:false;ch=String.fromCharCode(event.charCode||event.which).toLowerCase();if(cursorPos===-1){return ch!=="e"}val=this._editorInput.val().toLowerCase();nextCh=val.substring(cursorPos,cursorPos+nextDirection);if(cursorPos===leadPos&&nextCh===negativeSign){return false}prevCh=val.substring(cursorPos-nextDirection,cursorPos);if(ch===negativeSign){return(cursorPos===leadPos||prevCh==="e")&&nextCh!==negativeSign}if(ch==="e"&&val.indexOf("e")!==-1){return false}if(dataMode==="double"||dataMode==="float"){var decimalSeparator=this._getOptionOrRegionalValue("decimalSeparator");if(decimalSeparator!=="."&&isDecimal&&(val.indexOf(".")!==-1||val.indexOf(decimalSeparator)!==-1)&&cursorPos!==-1){return false}if((ch===decimalSeparator||isDecimal)&&(val.indexOf(decimalSeparator)!==-1||val.indexOf(".")!==-1)&&cursorPos!==-1){return false}else{return true}}else{return true}}else{return false}},_validateValue:function(val){var result;if(this._super(val)&&!isNaN(val=this._parseNumericValueByMode(val,this._numericType,this.options.dataMode))){{result=true}}else{result=false}return result},_insert:function(newValue,previousValue,selection){var newLength=newValue.length,diff;if(!isNaN(newValue=this._parseNumericValueByMode(newValue,this._numericType,this.options.dataMode))){if(!isNaN(this.options.maxValue)&&newValue>this.options.maxValue){newValue=this.options.maxValue;this._sendNotification("warning",{optName:"maxValExceedSetErrMsg",arg:this.options.maxValue})}else if(!isNaN(this.options.minValue)&&newValue<this.options.minValue){newValue=this.options.minValue;this._sendNotification("warning",{optName:"minValExceedSetErrMsg",arg:this.options.minValue})}if(!this._validateValue(newValue)&&this.options.revertIfNotValid){newValue=previousValue}}else if(this.options.revertIfNotValid){newValue=previousValue}else{newValue=""}if(this._editMode){this._editorInput.val(this._getEditModeValue(newValue));if(selection!==undefined){diff=newLength-newValue.toString().length;selection.start-=diff;selection.end-=diff;this._setSelectionRange(this._editorInput[0],selection.start,selection.end)}}else{this._processInternalValueChanging(newValue);this._exitEditMode()}this._setSpinButtonsState(newValue);this._processTextChanged()},_clearValue:function(textOnly){var newValue=0;if(this.options.allowNullValue){newValue=this.options.nullValue}newValue=this._getValueBetweenMinMax(newValue);if(!this._validateValue(newValue)){newValue="";this._editorInput.val("")}else{this._editorInput.val(newValue)}if(!textOnly){this._updateValue(newValue)}},_convertScientificToNumeric:function(num){var stringValue=num.toString(),scientificPrecision=stringValue.substring(stringValue.toLowerCase().indexOf("e")+1);num=num/1;scientificPrecision=Math.abs(scientificPrecision);if(scientificPrecision<=20){if(scientificPrecision<this.options.minDecimals){scientificPrecision=this.options.minDecimals}stringValue=num.toFixed(scientificPrecision)}return stringValue},_getDisplayValue:function(){var value=this._valueInput.val(),decimalSeparator=this._getOptionOrRegionalValue("decimalSeparator"),decimalPoint=".",minDecimals=this._getOptionOrRegionalValue("minDecimals"),dataMode=this.options.dataMode,displayFactor=this._getOptionOrRegionalValue("displayFactor"),stringValue,displayValue,integerDigits,fractionalDigits,scientificValue,scientificExponent,negativeSign,positivePattern,negativePattern,groups,groupSeparator,symbol="";if(value===this.options.nullValue||value===""||isNaN(value)){if(isNaN(value)){this._valueInput.val("");return""}else{return value}}if(this._numericType!=="numeric"){positivePattern=this._getOptionOrRegionalValue("positivePattern");symbol=this._getOptionOrRegionalValue(this._numericType+"Symbol")}negativePattern=this._getOptionOrRegionalValue("negativePattern");var originalArray=this._getOptionOrRegionalValue("groups");groups=originalArray.filter(function(item){return item!==0});groupSeparator=this._getOptionOrRegionalValue("groupSeparator");if(this._numericType==="percent"&&displayFactor){value=this._multiplyWithPrecision(value,displayFactor);value=this._parseNumericValueByMode(value,this._numericType,this.options.dataMode)}stringValue=value.toString().toLowerCase();if(this.options.scientificFormat){if(stringValue.indexOf("e")===-1){stringValue=(stringValue/1).toExponential();scientificValue=stringValue.split("e")[0];scientificExponent=stringValue.split(/e\+?/).pop()}}else if(stringValue.indexOf("e")!==-1){stringValue=this._convertScientificToNumeric(stringValue)}displayValue=stringValue;if(dataMode==="double"||dataMode==="float"){if(stringValue.indexOf("e")!==-1){displayValue=stringValue}else{if(stringValue.indexOf(decimalPoint)!==-1){fractionalDigits=stringValue.substring(stringValue.indexOf(decimalPoint)+1);if(fractionalDigits.length<minDecimals){var missingDecimals=minDecimals-fractionalDigits.length;while(missingDecimals>0){fractionalDigits+="0";missingDecimals--}}integerDigits=stringValue.substring(0,stringValue.indexOf(decimalPoint))}else{integerDigits=stringValue;if(minDecimals>0){stringValue=parseInt(stringValue).toFixed(minDecimals);fractionalDigits=stringValue.substring(stringValue.indexOf(decimalPoint)+1)}}integerDigits=this._applyGroups(integerDigits,groups,groupSeparator);if(fractionalDigits&&fractionalDigits.length>0){displayValue=integerDigits+decimalSeparator+fractionalDigits}else{displayValue=integerDigits}}}else if(stringValue.indexOf("e")===-1){displayValue=this._applyGroups(value.toString(),groups,groupSeparator)}if(this.options.scientificFormat){if(scientificExponent>0){displayValue=scientificValue+this.options.scientificFormat+scientificExponent}else{displayValue=stringValue.replace("e",this._getScientificFormat())}displayValue=displayValue.replace(decimalPoint,decimalSeparator)}if(value<0){negativeSign=this._getOptionOrRegionalValue("negativeSign");displayValue=displayValue.replace("-","");displayValue=negativePattern.replace("n",displayValue).replace("$",symbol).replace("-",negativeSign)}else if(positivePattern){displayValue=positivePattern.replace("n",displayValue).replace("$",symbol)}return displayValue},_valueFromText:function(text){return this._parseNumericValueByMode(text,this._numericType,this.options.dataMode)},_applyGroups:function(integerDigits,groups,groupSeparator){var digitsPosition=integerDigits.length-1,br=1,l=groups.length,digitsLimit=0,group;group=groups.length>0?groups[0]:0;if(group>integerDigits.length||group===0){return integerDigits}if(parseFloat(integerDigits)<0){digitsLimit=1}for(digitsPosition;digitsPosition>digitsLimit;digitsPosition--){if(--group===0){integerDigits=integerDigits.substring(0,digitsPosition)+groupSeparator+integerDigits.substring(digitsPosition);if(br===l){group=groups[--br]}else{group=groups[br];br++}}}return integerDigits},_enterEditMode:function(){if(!$.ig.util.isIE8){this._editorInput.attr("type","tel")}if(this._valueInput.val()<0){this._editorInput.removeClass(this.css.negative)}this._super()},_getEditModeValue:function(val){if(this.options.scientificFormat){val=Number(val).toExponential().replace("e",this._getScientificFormat()).replace("+","")}else if(val.toString().indexOf("e")!==-1){val=this._convertScientificToNumeric(val).replace("+","")}if(this._getOptionOrRegionalValue("decimalSeparator")!=="."){val=val.toString().replace(".",this._getOptionOrRegionalValue("decimalSeparator"))}if(this._getOptionOrRegionalValue("negativeSign")!=="-"){val=val.toString().replace("-",this._getOptionOrRegionalValue("negativeSign"))}return val},_exitEditMode:function(){this._super();if(this.value()<0){this._editorInput.addClass(this.css.negative);
}else{this._editorInput.removeClass(this.css.negative)}},_getSpinValue:function(spinType,currentValue,delta){var fractional,scientificPrecision,spinPrecision,valuePrecision,spinDelta,toFixedVal,precision,spinDeltaValue=this.options.spinDelta;if(delta){spinDeltaValue=Number(delta)}if(currentValue.toString().toLowerCase().indexOf("e")!==-1){currentValue=Number(currentValue);if(spinDeltaValue.toString().toLowerCase().indexOf("e")===-1){spinDelta=Number(spinDeltaValue.toExponential())}else{spinDelta=spinDeltaValue}if(spinType==="spinUp"){currentValue+=spinDelta}else{currentValue-=spinDelta}}else if(currentValue.toString().indexOf(".")!==-1){fractional=currentValue.substring(currentValue.toString().indexOf(".")+1);toFixedVal=fractional.toString().length;currentValue=currentValue/1;if(spinDeltaValue.toString().toLowerCase().indexOf("e")!==-1){currentValue=Number(currentValue.toExponential());scientificPrecision=spinDeltaValue.toString().toLowerCase().substring(spinDeltaValue.toString().toLowerCase().indexOf("e")+1);spinPrecision=Math.abs(scientificPrecision)}else{spinPrecision=spinDeltaValue.toString().toLowerCase().substring(spinDeltaValue.toString().toLowerCase().indexOf(".")+1).length;valuePrecision=currentValue.toString().substring(currentValue.toString().indexOf(".")+1).length;spinPrecision=valuePrecision>spinPrecision?valuePrecision:spinPrecision}precision=Math.pow(10,spinPrecision);if(spinType==="spinUp"){if(currentValue===0&&scientificPrecision){currentValue=spinDeltaValue.toFixed(spinPrecision)}else{currentValue=(Math.round(currentValue*precision)+Math.round(spinDeltaValue*precision))/precision}}else{if(currentValue===0&&scientificPrecision){currentValue=(-spinDeltaValue).toFixed(spinPrecision)}else{currentValue=(Math.round(currentValue*precision)-Math.round(spinDeltaValue*precision))/precision}}if(currentValue.toString().substring(currentValue.toString().indexOf(".")+1).length<fractional.length){currentValue=currentValue.toFixed(toFixedVal)}}else{currentValue=currentValue/1;if(spinDeltaValue%1===0){if(spinType==="spinUp"){currentValue+=spinDeltaValue}else{currentValue-=spinDeltaValue}}else{if(spinDeltaValue.toString().toLowerCase().indexOf("e")!==-1){scientificPrecision=spinDeltaValue.toString().toLowerCase().substring(spinDeltaValue.toString().toLowerCase().indexOf("e")+1);spinPrecision=Math.abs(scientificPrecision)}else{spinPrecision=spinDeltaValue.toString().toLowerCase().substring(spinDeltaValue.toString().toLowerCase().indexOf(".")+1).length}precision=Math.pow(10,spinPrecision);if(spinType==="spinUp"){if(currentValue===0){currentValue=spinDeltaValue.toFixed(spinPrecision)}else{currentValue=(Math.round(currentValue*precision)+Math.round(spinDeltaValue*precision))/precision}}else{if(currentValue===0){currentValue=(-spinDeltaValue).toFixed(spinPrecision)}else{currentValue=(Math.round(currentValue*precision)-Math.round(spinDeltaValue*precision))/precision}}}}return currentValue},_spinUp:function(delta){var currVal,noCancel;if(this._dropDownList&&this.options.isLimitedToListValues){this._spin("up");return}if(this._focused){currVal=this._valueFromText(this._editorInput.val()).toString()}else{if(this.value()||this.value()===0){currVal=this.value().toString()}else{currVal=""}}this._clearEditorNotifier();this._currentInputTextValue=this._editorInput.val();currVal=this._getSpinValue("spinUp",currVal,delta);if(currVal>this.options.maxValue&&this.options.spinWrapAround||currVal<this.options.minValue||this._currentInputTextValue===this.options.maxValue.toString()&&this.options.spinWrapAround){currVal=this.options.minValue;this._sendNotification("warning",{optName:"maxValExceededWrappedAroundErrMsg",arg:this.options.maxValue})}else if(currVal>=this.options.maxValue&&!this.options.spinWrapAround){currVal=this.options.maxValue;this._sendNotification("warning",{optName:"maxValErrMsg",arg:[this.options.maxValue]})}if(this._focused){currVal=this._getEditModeValue(currVal);this._editorInput.val(currVal);this._processTextChanged()}else{noCancel=this._triggerValueChanging(currVal);if(noCancel){this._updateValue(currVal);this._exitEditMode();this._triggerValueChanged(currVal)}}this._setSpinButtonsState(currVal)},_editorIsCleared:function(){var result=false,currentVal=this._editorInput.val();if(currentVal===""||currentVal==="0"){result=true}return result},_spinDown:function(delta){var currVal,noCancel;if(this._dropDownList&&this.options.isLimitedToListValues){this._spin("down");return}if(this._focused){currVal=this._valueFromText(this._editorInput.val()).toString()}else{if(this.value()||this.value()===0){currVal=this.value().toString()}else{currVal=""}}this._clearEditorNotifier();this._currentInputTextValue=this._editorInput.val();currVal=this._getSpinValue("spinDown",currVal,delta);if(currVal<this.options.minValue&&this.options.spinWrapAround||currVal>this.options.maxValue||this._currentInputTextValue===this.options.minValue.toString()&&this.options.spinWrapAround){currVal=this.options.maxValue;this._sendNotification("warning",{optName:"minValExceededWrappedAroundErrMsg",arg:this.options.minValue})}else if(currVal<=this.options.minValue&&!this.options.spinWrapAround){currVal=this.options.minValue;this._sendNotification("warning",{optName:"minValErrMsg",arg:this.options.minValue})}if(this._focused){currVal=this._getEditModeValue(currVal);this._editorInput.val(currVal);this._processTextChanged()}else{noCancel=this._triggerValueChanging(currVal);if(noCancel){this._updateValue(currVal);this._exitEditMode();this._triggerValueChanged(currVal)}}this._setSpinButtonsState(currVal)},_exceedsMaxValue:function(value){if(this.options.isLimitedToListValues){return this._super(value)}return this.options.maxValue!==null&&value>=this.options.maxValue},_lessThanMinValue:function(value){if(this.options.isLimitedToListValues){return this._super(value)}return this.options.minValue!==null&&value<=this.options.minValue},_handleSpinUpEvent:function(){if(this._dropDownList&&this.options.isLimitedToListValues){this._super()}else{this._spinUp();if(this._focused){this._editorInput.select()}}},_handleSpinDownEvent:function(){if(this._dropDownList&&this.options.isLimitedToListValues){this._super()}else{this._spinDown();if(this._focused){this._editorInput.select()}}},_setSpinButtonsState:function(val){val=this._valueFromText(val);this._super(val)},value:function(newValue){if(newValue!==undefined){this._clearEditorNotifier();if(newValue!==null&&!isNaN(this._parseNumericValueByMode(newValue,this._numericType,this.options.dataMode))){if(newValue!==""&&!isNaN(newValue)){if(!isNaN(this.options.maxValue)&&newValue>this.options.maxValue){newValue=this.options.maxValue;this._sendNotification("warning",{optName:"maxValExceedSetErrMsg",arg:this.options.maxValue})}else if(!isNaN(this.options.minValue)&&newValue<this.options.minValue){newValue=this.options.minValue;this._sendNotification("warning",{optName:"minValExceedSetErrMsg",arg:this.options.value})}}if(this._validateValue(newValue)){this._updateValue(newValue);if(!this._focused){this._editorInput.val(this._getDisplayValue())}else{this._enterEditMode()}}else{if(newValue<this.options.minValue){newValue=this.options.minValue}else if(newValue>this.options.maxValue){newValue=this.options.maxValue}this._updateValue(newValue);if(!this._focused){this._editorInput.val(this._getDisplayValue())}else{this._enterEditMode()}}this._setSpinButtonsState(newValue)}else{if(this.options.revertIfNotValid&&!(newValue===null&&this.options.allowNullValue)){newValue=this._valueInput.val();this._updateValue(newValue)}else{this._clearValue()}}if(newValue<0){this._editorInput.addClass(this.css.negative)}else{this._editorInput.removeClass(this.css.negative)}}else{return this.options.value}this._checkClearButtonState()},findListItemIndex:function(number){var list=this.options.listItems,i;for(i=0;i<list.length;i++){if(this._parseNumericValueByMode(list[i],this._numericType,this.options.dataMode)===number){return i}}return-1},getSelectedText:function(){throw new Error(this._getLocaleValue("numericEditorNoSuchMethod"))},getSelectionStart:function(){throw new Error(this._getLocaleValue("numericEditorNoSuchMethod"))},getSelectionEnd:function(){throw new Error(this._getLocaleValue("numericEditorNoSuchMethod"))},spinUp:function(delta){this._spinUp(delta)},spinDown:function(delta){this._spinDown(delta)},selectListIndexUp:function(){this._spinUp()},selectListIndexDown:function(){this._spinDown()},getRegionalOption:function(){return this._getRegionalValue()},changeRegional:function(){if(this._focused){this._enterEditMode()}else{this._editorInput.val(this._getDisplayValue())}}});$.extend($.ui.igNumericEditor,{version:"21.2.12"});$.widget("ui.igCurrencyEditor",$.ui.igNumericEditor,{options:{positivePattern:null,currencySymbol:null},events:{},_create:function(){$.ui.igNumericEditor.prototype._create.call(this)},_setNumericType:function(){this._numericType="currency"},currencySymbol:function(symbol){if(symbol){this.options.currencySymbol=symbol}else{return this._getOptionOrRegionalValue("currencySymbol")}}});$.extend($.ui.igCurrencyEditor,{version:"21.2.12"});$.widget("ui.igPercentEditor",$.ui.igNumericEditor,{options:{positivePattern:null,percentSymbol:null,displayFactor:100,dataMode:"float",spinDelta:.01},events:{},_create:function(){$.ui.igNumericEditor.prototype._create.call(this)},_setNumericType:function(){this._numericType="percent"},_insert:function(newValue,previousValue,selection){var newLength=newValue.length,displayFactor=this._getOptionOrRegionalValue("displayFactor"),diff;if(!isNaN(newValue=this._parseNumericValueByMode(newValue,this._numericType,this.options.dataMode))){if(!isNaN(this.options.maxValue)&&newValue/displayFactor>this.options.maxValue){newValue=this.options.maxValue*displayFactor;this._sendNotification("warning",{optName:"maxValExceedSetErrMsg",arg:this.options.maxValue})}else if(!isNaN(this.options.minValue)&&newValue/displayFactor<this.options.minValue){newValue=this.options.minValue*displayFactor;this._sendNotification("warning",{optName:"minValExceedSetErrMsg",arg:this.options.minValue})}if(!this._validateValue(newValue/displayFactor)&&this.options.revertIfNotValid){newValue=previousValue}}else if(this.options.revertIfNotValid){newValue=previousValue}else{newValue=""}if(this._editMode){this._editorInput.val(newValue);if(selection!==undefined){diff=newLength-newValue.toString().length;selection.start-=diff;selection.end-=diff;this._setSelectionRange(this._editorInput[0],selection.start,selection.end)}}else{newValue=this._divideWithPrecision(newValue,displayFactor);this._processInternalValueChanging(newValue);this._exitEditMode()}this._setSpinButtonsState(newValue/displayFactor);this._processTextChanged()},_validateRegionalSettings:function(){if(this.options.displayFactor!==null){if(typeof this._getOptionOrRegionalValue("displayFactor")!=="number"){throw new Error(this._getLocaleValue("displayFactorIsOfTypeNumber"))}else if(this._getOptionOrRegionalValue("displayFactor")!==1&&this._getOptionOrRegionalValue("displayFactor")!==100){throw new Error(this._getLocaleValue("displayFactorAllowedValue"))}}},_getOptionOrRegionalValue:function(name){var regionalValue=this._super(name);if(name==="maxDecimals"&&this.options.displayFactor===100){regionalValue+=2}return regionalValue},_setOption:function(option,value){var prevValue=this.options[option];if(prevValue===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"displayFactor":if(typeof value!=="number"){this.options[option]=prevValue;throw new Error(this._getLocaleValue("displayFactorIsOfTypeNumber"))}else if(value!==1&&value!==100){this.options[option]=prevValue;throw new Error(this._getLocaleValue("displayFactorAllowedValue"))}break;default:this.options[option]=prevValue;this._super(option,value);break}},_getEditModeValue:function(val){if(val!==""&&!isNaN(val)){val=this._multiplyWithPrecision(parseFloat(val),this._getOptionOrRegionalValue("displayFactor"))}return this._super(val)},_valueFromText:function(text){var val=this._parseNumericValueByMode(text,this._numericType,this.options.dataMode);return this._divideWithPrecision(val,this.options.displayFactor)},insert:function(string){this._insertHandler(string)},percentSymbol:function(symbol){if(symbol){this.options.percentSymbol=symbol}else{return this._getOptionOrRegionalValue("percentSymbol")}}});$.extend($.ui.igPercentEditor,{version:"21.2.12"});$.widget("ui.igMaskEditor",$.ui.igTextEditor,{options:{buttonType:"none",inputMask:"CCCCCCCCCC",dataMode:"allText",unfilledCharsPrompt:"_",padChar:" ",emptyChar:" ",includeKeys:null,excludeKeys:null,spinWrapAround:false,listItems:null,listWidth:0,listItemHoverDuration:0,isLimitedToListValues:false,dropDownOrientation:"auto",dropDownAttachedToBody:false,dropDownAnimationDuration:300,dropDownOnReadOnly:false,textMode:"text",visibleItemsCount:5,maxLength:null,value:null,suppressKeyboard:false},events:{dropDownListOpening:"dropDownListOpening",dropDownListOpened:"dropDownListOpened",dropDownListClosing:"dropDownListClosing",dropDownListClosed:"dropDownListClosed",dropDownItemSelecting:"dropDownItemSelecting",dropDownItemSelected:"dropDownItemSelected"},_create:function(){$.ui.igTextEditor.prototype._create.call(this)},_initialize:function(){this._super();if(this.options.maxLength){this.options.maxLength=null}if(this.options.listItems){this.options.listItems=null}if(this._maskFlagsArray){this._maskFlagsArray=$.merge(this._maskFlagsArray,["C","&","a","A","?","L","9","0","<",">","#"])}else{this._maskFlagsArray=["C","&","a","A","?","L","9","0","<",">","#"]}this._promptCharsIndices=[]},_applyOptions:function(){this._getMaskLiteralsAndRequiredPositions();this._super()},_getEditModeValue:function(){if(this._maskedValue===""){return this._maskWithPrompts}else{return this._maskedValue}},_insert:function(newValue,previousValue,selection){if(this.options.toUpper){if(newValue){newValue=newValue.toLocaleUpperCase()}}else if(this.options.toLower){if(newValue){newValue=newValue.toLocaleLowerCase()}}this._promptCharsIndices=[];if(this._editMode){this._insertEditMode(newValue,selection)}else if(newValue!==previousValue){this._insertDisplayMode(newValue)}this._processTextChanged()},_insertEditMode:function(newValue,selection){newValue=this._parseValueByMask(newValue);this._editorInput.val(newValue);if(selection!==undefined){this._setSelectionRange(this._editorInput[0],selection.start,selection.end)}},_insertDisplayMode:function(newValue){newValue=this._parseValueByMask(newValue);this._processInternalValueChanging(newValue);this._exitEditMode()},_pasteHandler:function(e,drop){var self=this,previousValue=$(e.target).val(),newValue,data,selection,dtObj=drop?e.originalEvent.dataTransfer:e.originalEvent&&e.originalEvent.clipboardData||window.clipboardData;data=dtObj&&dtObj.getData("Text");data=data.replace(/[\r\n]{1,2}$/g,"");this._currentInputTextValue=this._editorInput.val();this._timeouts.push(setTimeout(function(){selection=self._getSelection(e.target);if(selection.start===selection.end){selection.start-=data.length;newValue=self._replaceDisplayValue(selection,previousValue,data);selection.start=selection.end}else{newValue=self._replaceDisplayValue(selection,previousValue,data)}if(self._validateValueAgainstMask(newValue)){self._insert(newValue,previousValue,selection)}else{if(self.options.revertIfNotValid){newValue=self._valueInput.val();self._updateValue(newValue)}else{self._clearValue()}if(self._focused){self._enterEditMode()}}if(drop){if(self._editorInput.is(":focus")){self._triggerFocus(e)}else{self._processValueChanging(newValue);self._focused=false;self._exitEditMode()}}},10))},_replaceDisplayValue:function(selection,previousValue,newValue){var value=previousValue,i=selection.start,j=0,currentChar,newChar;newValue=newValue.toString();for(;i<previousValue.length&&j<newValue.length;i++,j++){currentChar=previousValue.charAt(i);newChar=newValue.charAt(j);if($.inArray(i,this._literalIndices)!==-1){if(currentChar!==newChar){selection.end++;j--}}else{value=value.substring(0,i)+newChar+value.substring(i+1,previousValue.length)}}return value},_attachEvents:function(){var self=this;self._super();this._editorInput.on({"dragend.editor":function(){self._handleDeleteKey(true)},"cut.editor":function(){self._handleDeleteKey(true)}})},_detachEvents:function(){this._super();if(this._editorInput){this._editorInput.off("cut.editor dragend.editor")}},_getMaskLiteralsAndRequiredPositions:function(){var mask,literalIndices=[],requiredFieldsIndices=[],maskFlagsArray=this._maskFlagsArray,output,maskChar,unescapedMask,i,j,isToLower=false,isToUpper=false,toLowerIndices=[],toUpperIndices=[];output=unescapedMask=mask=this.options.inputMask;for(i=0,j=0;i<mask.length;i++,j++){maskChar=mask.charAt(i);if($.inArray(maskChar,maskFlagsArray)!==-1){if(isToLower&&maskChar!=="9"&&maskChar!=="0"&&maskChar!=="#"){toLowerIndices.push(j)}else if(isToUpper&&maskChar!=="9"&&maskChar!=="0"&&maskChar!=="#"){toUpperIndices.push(j)}if(maskChar==="&"||maskChar==="A"||maskChar==="L"||maskChar==="0"){requiredFieldsIndices.push(j)}else if(maskChar===">"){if(!isToUpper){isToUpper=true;if(isToLower){isToLower=false;toLowerIndices.pop()}}else{isToUpper=false;toUpperIndices.pop()}unescapedMask=this._replaceCharAt(unescapedMask,j,"");j--}else if(maskChar==="<"){if(!isToLower){isToLower=true;if(isToUpper){isToUpper=false;toUpperIndices.pop()}}else{isToLower=false;toLowerIndices.pop()}unescapedMask=this._replaceCharAt(unescapedMask,j,"");j--}}else if(maskChar==="\\"){if($.inArray(mask.charAt(i+1),maskFlagsArray)!==-1){unescapedMask=this._replaceCharAt(unescapedMask,j,"");i++}literalIndices.push(j)}else{literalIndices.push(j)}}this._literalIndices=literalIndices;this._requiredIndices=requiredFieldsIndices;this._toLowerIndices=toLowerIndices;this._toUpperIndices=toUpperIndices;this._unescapedMask=unescapedMask},_validateValue:function(val){if(val===undefined||val===null){return this._super(val)}else{return this._validateValueAgainstMask(val)}},_parseValueByMask:function(value){var mask=this.options.inputMask,outputVal=mask,ch,maskFlagsArray=this._maskFlagsArray,length=mask.length,i,j,tempChar;value=value===0||value?value.toString():"";if(length&&length>0){if(value.indexOf(this.options.unfilledCharsPrompt!==-1)){i=225;tempChar=String.fromCharCode(i);while(mask.indexOf(tempChar)!==-1&&value.indexOf(tempChar)!==-1){i++}}for(i=0,j=0;i<length;i++,j++){ch=value.charAt(j);if(this._validateCharOnPosition(ch,i)===null){if(mask.charAt(i)==="\\"){var flags=["C","&","a","A","?","L","0","9","#"];if(flags.indexOf(ch)>-1){i++}else{i++;j--}}else if(mask.charAt(i)==="<"||mask.charAt(i)===">"){j--}else if($.inArray(i,this._literalIndices)!==-1){if(mask.charAt(i)!==ch){j--}}}else if(this._validateCharOnPosition(ch,i)===true){if(ch===this.options.unfilledCharsPrompt){outputVal=this._replaceCharAt(outputVal,i,tempChar)}else{outputVal=this._replaceCharAt(outputVal,i,ch)}}else{outputVal=this._replaceCharAt(outputVal,i,this.options.unfilledCharsPrompt)}}for(i=0;i<outputVal.length;i++){ch=outputVal.charAt(i);if(ch==="\\"&&$.inArray(outputVal.charAt(i+1),maskFlagsArray)!==-1){outputVal=this._replaceCharAt(outputVal,i,"")}else if(ch==="<"||ch===">"){outputVal=this._replaceCharAt(outputVal,i,"");i--}else if($.inArray(i,this._toLowerIndices)!==-1){if(ch===tempChar){outputVal=this._replaceCharAt(outputVal,i,this.options.unfilledCharsPrompt);this._promptCharsIndices.push(i)}outputVal=this._replaceCharAt(outputVal,i,outputVal.charAt(i).toLocaleLowerCase())}else if($.inArray(i,this._toUpperIndices)!==-1){outputVal=this._replaceCharAt(outputVal,i,outputVal.charAt(i).toLocaleUpperCase());if(ch===tempChar){outputVal=this._replaceCharAt(outputVal,i,this.options.unfilledCharsPrompt);this._promptCharsIndices.push(i)}}else if(ch===tempChar){outputVal=this._replaceCharAt(outputVal,i,this.options.unfilledCharsPrompt);this._promptCharsIndices.push(i)}}}return outputVal},_getValueByDataMode:function(maskedVal){var dataModeValue,regExpr,i,ch,index,tempChar,dataMode=this.options.dataMode;maskedVal=maskedVal!==undefined?maskedVal:this._maskedValue;if(this._promptCharsIndices.length>0){i=225;tempChar=String.fromCharCode(i);while(maskedVal.indexOf(tempChar)!==-1){i++}for(i=0;i<this._promptCharsIndices.length;i++){index=this._promptCharsIndices[i];maskedVal=this._replaceCharAt(maskedVal,index,tempChar)}}switch(dataMode){case"allText":{dataModeValue="";for(i=0;i<maskedVal.length;i++){ch=maskedVal.charAt(i);if(ch===this.options.unfilledCharsPrompt){if($.inArray(i,this._requiredIndices)!==-1){ch=this.options.emptyChar}else{ch=""}}dataModeValue+=ch}if(this._promptCharsIndices.length>0){regExpr=new RegExp($.ig.util.escapeRegExp(tempChar),"g");dataModeValue=dataModeValue.replace(regExpr,this.options.unfilledCharsPrompt)}}break;case"rawText":{dataModeValue="";for(i=0;i<maskedVal.length;i++){ch=maskedVal.charAt(i);if($.inArray(i,this._literalIndices)===-1&&ch!==this.options.unfilledCharsPrompt){if(this._promptCharsIndices.length>0&&ch===tempChar){dataModeValue+=this.options.unfilledCharsPrompt}else{dataModeValue+=ch}}}}break;case"rawTextWithRequiredPrompts":{dataModeValue="";for(i=0;i<maskedVal.length;i++){ch=maskedVal.charAt(i);if($.inArray(i,this._literalIndices)===-1){if(ch===this.options.unfilledCharsPrompt){if($.inArray(i,this._requiredIndices)!==-1){dataModeValue+=this.options.emptyChar}}else{if(this._promptCharsIndices.length>0&&ch===tempChar){dataModeValue+=this.options.unfilledCharsPrompt}else{dataModeValue+=ch}}}}}break;case"rawTextWithAllPrompts":{dataModeValue="";for(i=0;i<maskedVal.length;i++){ch=maskedVal.charAt(i);if($.inArray(i,this._literalIndices)===-1){if(ch===this.options.unfilledCharsPrompt){dataModeValue+=this.options.emptyChar}else{if(this._promptCharsIndices.length>0&&ch===tempChar){dataModeValue+=this.options.unfilledCharsPrompt}else{dataModeValue+=ch}}}}}break;case"rawTextWithLiterals":{dataModeValue="";for(i=0;i<maskedVal.length;i++){ch=maskedVal.charAt(i);if(ch!==this.options.unfilledCharsPrompt){if(this._promptCharsIndices.length>0&&ch===tempChar){dataModeValue+=this.options.unfilledCharsPrompt}else{dataModeValue+=ch}}}}break;case"rawTextWithRequiredPromptsAndLiterals":{dataModeValue="";for(i=0;i<maskedVal.length;i++){ch=maskedVal.charAt(i);if($.inArray(i,this._literalIndices)===-1){if(ch===this.options.unfilledCharsPrompt){if($.inArray(i,this._requiredIndices)!==-1){dataModeValue+=this.options.emptyChar}}else{if(this._promptCharsIndices.length>0&&ch===tempChar){dataModeValue+=this.options.unfilledCharsPrompt}else{dataModeValue+=ch}}}else{dataModeValue+=ch}}}break;default:{dataModeValue="";for(i=0;i<maskedVal.length;i++){ch=maskedVal.charAt(i);if(ch===this.options.unfilledCharsPrompt){if($.inArray(i,this._requiredIndices)!==-1){ch=this.options.emptyChar}else{ch=""}}dataModeValue+=ch}if(this._promptCharsIndices.length>0){regExpr=new RegExp($.ig.util.escapeRegExp(tempChar),"g");dataModeValue=dataModeValue.replace(regExpr,this.options.unfilledCharsPrompt)}}}return dataModeValue},_updateValue:function(value){if(value===""){this.options.value="";this._valueInput.val("");this._maskedValue=""}else if(value===null){if(this.options.allowNullValue){if(this.options.nullValue===null){this._maskedValue="";this._valueInput.val("");this.options.value=this.options.nullValue}else{this._maskedValue=this._parseValueByMask(this.options.nullValue);this.options.value=this._getValueByDataMode();this._valueInput.val(this.options.value)}}else{this.options.value="";this._valueInput.val("");this._maskedValue=""}}else{this._maskedValue=value;this.options.value=this._getValueByDataMode();this._valueInput.val(this.options.value)}},_clearValue:function(textOnly){var newValue="";if(this.options.allowNullValue){newValue=this.options.nullValue}if(this._validateValue(newValue)){this._editorInput.val(this._parseValueByMask(newValue))}else{newValue="";this._editorInput.val(this._maskWithPrompts)}if(!textOnly){this._updateValue(newValue)}if(this._editMode===false){this._exitEditMode()}},_getDisplayValue:function(){return this._replaceValueInMask(this.options.unfilledCharsPrompt,this.options.padChar)},_getMaskedValue:function(maskedValue){return this._replaceValueInMask(this.options.emptyChar,this.options.unfilledCharsPrompt,maskedValue)},_replaceValueInMask:function(oldChar,newChar,maskedValue){var result,maskedVal=maskedValue||this._maskedValue,i,j,p,maskChar,tempChar,index,regExpr,inputMask=this.options.inputMask,maskFlagsArray=this._maskFlagsArray;result=maskedVal;if(this._promptCharsIndices.length>0){i=225;tempChar=String.fromCharCode(i);while(maskedVal.indexOf(tempChar)!==-1){i++}for(i=0;i<this._promptCharsIndices.length;i++){index=this._promptCharsIndices[i];maskedVal=this._replaceCharAt(maskedVal,index,tempChar)}}for(i=0,j=0,p=0;i<maskedVal.length;i++,j++,p++){if(inputMask.charAt(j)==="<"||inputMask.charAt(j)===">"){j++}if(inputMask.charAt(j)==="\\"&&$.inArray(inputMask.charAt(j+1),maskFlagsArray)!==-1){j++;continue}if(maskedVal.charAt(i)===oldChar){maskChar=inputMask.charAt(j);if(maskChar==="&"||maskChar==="A"||maskChar==="L"||maskChar==="0"){result=this._replaceCharAt(result,p,newChar)}else if(maskChar!==" "){result=this._replaceCharAt(result,p,"");p--}}}if(this._promptCharsIndices.length>0){regExpr=new RegExp($.ig.util.escapeRegExp(tempChar),"g");result=result.replace(regExpr,oldChar)}return result},_valueFromText:function(text){return this._getValueByDataMode(text)},_editorIsCleared:function(){var result=false,currentVal=this._editorInput.val();if(currentVal===""||currentVal===this._maskWithPrompts){result=true}return result},_validateValueAgainstMask:function(value){var i,j,length=value.length,result=true,ch,mask=this._unescapedMask;if(length&&length>0){for(j=0,i=0;i<mask.length&&j<value.length;i++,j++){ch=value.charAt(j);if($.inArray(i,this._literalIndices)!==-1){if(mask.charAt(i)!==ch){j--}continue}if(!(this._focused&&ch===this.options.unfilledCharsPrompt)&&this._validateCharOnPosition(ch,i,mask)===false){return false}}}else{result=true}return result},_setInitialValue:function(value){this._maskWithPrompts=this._parseValueByMask("");this._getMaskLiteralsAndRequiredPositions();if(value===null||value===""){this._updateValue(value);this._maskedValue=""}else{this._maskedValue=this._parseValueByMask(value);this._updateValue(this._maskedValue)}this._checkClearButtonState()},_triggerInternalValueChange:function(value){var oldValue=this.options.value,message;if(value===this._maskWithPrompts&&this._promptCharsIndices.length===0){value=""}var noCancel=this._triggerValueChanging(value);if(noCancel){this._processInternalValueChanging(value);if(this.options.value!==oldValue){this._triggerValueChanged(value)}if(value!==""&&!this._validateRequiredPrompts(value)){if(this.options.revertIfNotValid){message="maskRevertMessage"}else{message="maskMessage"}this._sendNotification("warning",{optName:message})}}},_validateRequiredPrompts:function(value){var i;if(value===""){return true}for(i=0;i<this._requiredIndices.length;i++){var ch=value.charAt(this._requiredIndices[i]);if(ch===this.options.unfilledCharsPrompt){if(this._promptCharsIndices.length>0&&$.inArray(this._requiredIndices[i],this._promptCharsIndices)!==-1){continue}else{return false}}}return true},_processInternalValueChanging:function(value){if(this._validateValue(value)&&(this.options.revertIfNotValid&&this._validateRequiredPrompts(value)||!this.options.revertIfNotValid)){if(value.length&&value.length!==this._maskWithPrompts.length){value=this._parseValueByMask(value)}this._updateValue(value)}else{if(this.options.revertIfNotValid){value=this._getMaskedValue(this._maskedValue||this._valueInput.val().trim());this._updateValue(value);value=this._parseValueByMask(value.trim());this._editorInput.val(value)}else{this._clearValue();value=this._valueInput.val();if(this._focused){this._enterEditMode()}}}},_triggerKeyDown:function(event){var key=!event.charCode?event.which:event.charCode,cursorStartPosition=this._getSelection(this._editorInput[0]).start,ch,transformedChar,noCancel;noCancel=this._super(event);if(noCancel){if(key===8){this._handleBackSpaceKey();event.preventDefault()}else if(key===46){this._handleDeleteKey();event.preventDefault()}else if($.inArray(cursorStartPosition,this._toUpperIndices)!==-1&&this._inComposition!==true){if(!event.ctrlKey&&!event.altKey&&(key>46&&key<91||key>145)){if(!$.ig.util.isWebKit||key!==229){ch=String.fromCharCode(key);transformedChar=ch.toLocaleUpperCase();this._editorInput.val(this._replaceCharAt(this._editorInput.val(),cursorStartPosition,transformedChar));this._setCursorPosition(cursorStartPosition+1);event.preventDefault()}}}else if($.inArray(cursorStartPosition,this._toLowerIndices)!==-1&&this._inComposition!==true){if(!event.ctrlKey&&!event.altKey&&(key>46&&key<91||key>145)){if(!$.ig.util.isWebKit||key!==229){ch=String.fromCharCode(key);transformedChar=ch.toLocaleLowerCase();this._editorInput.val(this._replaceCharAt(this._editorInput.val(),cursorStartPosition,transformedChar));this._setCursorPosition(cursorStartPosition+1);event.preventDefault()}}}}return noCancel},_triggerKeyPress:function(event){var cursorPosition,key=!event.charCode?event.which:event.charCode,ch;if(this._super(event)){cursorPosition=this._getCursorPosition();if(key===46&&this._promptCharsIndices.length>0){if($.inArray(cursorPosition,this._promptCharsIndices)!==-1){this._promptCharsIndices=this._promptCharsIndices.splice($.inArray(cursorPosition,this._promptCharsIndices),1)}}else if(key===8&&this._promptCharsIndices.length>0){if($.inArray(cursorPosition-1,this._promptCharsIndices)!==-1){this._promptCharsIndices=this._promptCharsIndices.splice($.inArray(cursorPosition-1,this._promptCharsIndices),1)}}else{ch=String.fromCharCode(key);if(ch===this.options.unfilledCharsPrompt&&$.inArray(cursorPosition,this._promptCharsIndices)===-1){this._promptCharsIndices.push(cursorPosition)}}}},_validateKey:function(event){var result,ch,key,cursorPosition=this._getCursorPosition();if(this._super(event)&&this.options.inputMask){key=!event.charCode?event.which:event.charCode;if($.ig.util.isFF&&this._validateNonCharacter(event)){result=true}else if(key!==8&&key!==46){ch=String.fromCharCode(key);if(cursorPosition===-1){this._editSelectAllStarted=true;this._editorValueBeforeClear=this._editorInput.val();this._editorInput.val(this._maskWithPrompts);cursorPosition++}while($.inArray(cursorPosition,this._literalIndices)!==-1||cursorPosition===this._maskWithPrompts.length){cursorPosition++}result=this._validateKeyCharAgainstMask(ch,cursorPosition,this._unescapedMask);if(result===true){if($.ig.util.isFF&&event.keyCode===37){this._setSelectionRange(this._editorInput[0],cursorPosition,cursorPosition-1)}else{this._setSelectionRange(this._editorInput[0],cursorPosition,cursorPosition+1)}}}}else{result=false}if(result===false&&this._editSelectAllStarted){this._editorInput.val(this._editorValueBeforeClear);this._editorInput.select();delete this._editSelectAllStarted;delete this._editorValueBeforeClear}if(result===true&&this._editSelectAllStarted){delete this._editSelectAllStarted;delete this._editorValueBeforeClear}return result},_validateKeyCharAgainstMask:function(ch,cursorPosition,inputMask){var mask=inputMask||this.options.inputMask,isValid;if(cursorPosition>=this._maskWithPrompts.length){isValid=false}else{if(this._validateCharOnPosition(ch,cursorPosition,mask)===null){isValid=this._validateKeyCharAgainstMask(ch,cursorPosition+1)}else{isValid=this._validateCharOnPosition(ch,cursorPosition,mask)}}return isValid},_validateCharOnPosition:function(ch,position,inputMask){var maskSymbol,mask,isValid,regex,inputChar=ch,letterOrDigitRegEx="[\\d\\u00C0-\\u1FFF\\u2C00-\\uD7FFa-zA-Z]",letterRegEx="[\\u00C0-\\u1FFF\\u2C00-\\uD7FFa-zA-Z]",digitRegEx="[\\d]",digitSpecialRegEx="[\\d_\\+]";mask=inputMask||this.options.inputMask;maskSymbol=mask.charAt(position);switch(maskSymbol){case"C":case"&":{if(inputChar===""){isValid=false}else{isValid=true}}break;case"a":case"A":{regex=new RegExp(letterOrDigitRegEx);if(regex.test(inputChar)){isValid=true}else{isValid=false;
}}break;case"?":case"L":{regex=new RegExp(letterRegEx);if(regex.test(inputChar)){isValid=true}else{isValid=false}}break;case"0":case"9":{regex=new RegExp(digitRegEx);if(regex.test(inputChar)){isValid=true}else{isValid=false}}break;case"#":{regex=new RegExp(digitSpecialRegEx);if(regex.test(inputChar)){isValid=true}else{isValid=false}}break;default:{isValid=null}}return isValid},_setOption:function(option,value){var prevValue=this.options[option];if(prevValue===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"inputMask":this.options[option]=prevValue;throw new Error(this._getLocaleValue("setOptionError")+option);case"excludeKeys":case"includeKeys":case"unfilledCharsPrompt":this.options[option]=prevValue;throw new Error(this._getLocaleValue("setOptionError")+option);default:this.options[option]=prevValue;this._super(option,value);break}},_handleBackSpaceKey:function(){var selection=this._getSelection(this._editorInput[0]),startPosition=selection.start,endPosition=selection.end,index=endPosition;if(startPosition===endPosition){startPosition--}index--;for(index;index>startPosition-1;index--){while($.inArray(index,this._literalIndices)!==-1||index===-1){index--}if(index>-1){this._editorInput.val(this._replaceCharAt(this._editorInput.val(),index,this.options.unfilledCharsPrompt));this._setCursorPosition(index)}}},_handleDeleteKey:function(skipCursorPosition){var selection=this._getSelection(this._editorInput[0]),startPosition=selection.start,endPosition=selection.end,index=startPosition;if(startPosition===endPosition){endPosition++}for(index;index<endPosition;index++){while($.inArray(index,this._literalIndices)!==-1&&index<=this._maskWithPrompts.length){index++}if(index!==this._maskWithPrompts.length){this._editorInput.val(this._replaceCharAt(this._editorInput.val(),index,this.options.unfilledCharsPrompt));if(!skipCursorPosition){this._setCursorPosition(index+1)}}else{if(!skipCursorPosition){this._setCursorPosition(index)}}}},value:function(newValue){if(newValue!==undefined){this._clearEditorNotifier();if(newValue!==null){this._promptCharsIndices=[];newValue=this._parseValueByMask(newValue)}if(newValue===this._maskWithPrompts){newValue=""}this._updateValue(newValue);this._editorInput.val(this._editMode?this._maskedValue:this._getDisplayValue())}else{return this.options.value}this._checkClearButtonState()},dropDownContainer:function(){throw new Error(this._getLocaleValue("maskEditorNoSuchMethod"))},showDropDown:function(){throw new Error(this._getLocaleValue("maskEditorNoSuchMethod"))},hideDropDown:function(){throw new Error(this._getLocaleValue("maskEditorNoSuchMethod"))},dropDownButton:function(){throw new Error(this._getLocaleValue("maskEditorNoSuchMethod"))},spinUpButton:function(){throw new Error(this._getLocaleValue("maskEditorNoSuchMethod"))},spinDownButton:function(){throw new Error(this._getLocaleValue("maskEditorNoSuchMethod"))},dropDownVisible:function(){throw new Error(this._getLocaleValue("maskEditorNoSuchMethod"))},findListItemIndex:function(){throw new Error(this._getLocaleValue("maskEditorNoSuchMethod"))},selectedListIndex:function(){throw new Error(this._getLocaleValue("maskEditorNoSuchMethod"))},getSelectedListItem:function(){throw new Error(this._getLocaleValue("maskEditorNoSuchMethod"))},spinUp:function(){throw new Error(this._getLocaleValue("maskEditorNoSuchMethod"))},spinDown:function(){throw new Error(this._getLocaleValue("maskEditorNoSuchMethod"))},isValid:function(){var value,valid;this._skipMessages=true;if(this._editMode){value=this.field().val();valid=this._validateRequiredPrompts(value)}else{value=this.options.value;valid=this._validateValue(value);if(value!==""&&!this._validateRequiredPrompts(this._maskedValue)){valid=false;this._sendNotification("warning",{optName:"maskMessage"})}}this._skipMessages=false;return valid}});$.extend($.ui.igMaskEditor,{version:"21.2.12"});$.widget("ui.igDateEditor",$.ui.igMaskEditor,{options:{value:null,minValue:null,maxValue:null,dateDisplayFormat:null,dateInputFormat:null,dataMode:"date",displayTimeOffset:null,buttonType:"none",spinDelta:1,limitSpinToCurrentField:false,enableUTCDates:false,centuryThreshold:29,yearShift:0,nullValue:null,isLimitedToListValues:false,listItemHoverDuration:0,listItems:null,listWidth:0,dropDownAnimationDuration:0,dropDownAttachedToBody:false,dropDownOnReadOnly:false,inputMask:"CCCCCCCCCC",unfilledCharsPrompt:"_",padChar:" ",emptyChar:" ",toUpper:false,toLower:false,suppressKeyboard:false},events:{dropDownListOpening:"dropDownListOpening",dropDownListOpened:"dropDownListOpened",dropDownListClosing:"dropDownListClosing",dropDownListClosed:"dropDownListClosed",dropDownItemSelecting:"dropDownItemSelecting",dropDownItemSelected:"dropDownItemSelected"},_create:function(){$.ui.igMaskEditor.prototype._create.call(this)},_initialize:function(){var offset=this.options.displayTimeOffset;this._super();this._applyRegionalSettings();this.options.inputMask=this._convertDateMaskToDigitMask(this._inputFormat);this._setNumericType();this._mvcDateRegex=/^\/Date\((.*?)\)\/$/i;if(offset!==null&&(offset>840||offset<-720)){throw new Error(this._getLocaleValue("dateEditorOffsetRange"))}},_setNumericType:function(){this._numericType="datetime"},_setOption:function(option,value){var prevValue=this.options[option],date;if($.type(prevValue)==="date"){date=this._getDateObjectFromValue(value);if($.type(date)==="date"&&prevValue.getTime()===date.getTime()){return}}else if(prevValue===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"displayTimeOffset":if(this._editMode){this._updateMaskedValue();this._enterEditMode()}else{this._editorInput.val(this._getDisplayValue())}break;case"minValue":case"maxValue":if(!this._isValidDate(value)){this.options[option]=prevValue;return}if(value!==null){this.options[option]=this._getDateObjectFromValue(value);this._processInternalValueChanging(this.value());if(!this._editMode){this._editorInput.val(this._getDisplayValue());this._currentInputTextValue=this._editorInput.val()}}this._setSpinButtonsState(this.value());break;case"listItems":case"dateInputFormat":this.options[option]=prevValue;throw new Error(this._getLocaleValue("setOptionError")+option);case"dateDisplayFormat":this._applyRegionalSettings();if(!this._editMode){this._editorInput.val(this._getDisplayValue())}break;case"spinDelta":try{this._validateSpinSettings()}catch(e){this.options[option]=prevValue;throw e}break;default:this.options[option]=prevValue;this._super(option,value);break}},_applyRegionalSettings:function(){var iFormat=this.options.dateInputFormat,dFormat=this.options.dateDisplayFormat;if(iFormat!==null){if(iFormat==="date"||iFormat==="dateLong"||iFormat==="dateTime"||iFormat==="time"||iFormat==="timeLong"){this._inputFormat=this._getRegionalValue(iFormat+"Pattern")}else{this._inputFormat=iFormat}}else{this._inputFormat=this._getRegionalValue("datePattern")}if(dFormat!==null){if(dFormat==="date"||dFormat==="dateLong"||dFormat==="dateTime"||dFormat==="time"||dFormat==="timeLong"){this._displayFormat=this._getRegionalValue(dFormat+"Pattern")}else{this._displayFormat=dFormat}}else{this._displayFormat=this._inputFormat}},changeRegional:function(){var timeouts=this._timeouts;this._initialize();this._timeouts=timeouts;this._setInitialValue(this._dateObjectValue);if(this._focused){this._enterEditMode()}},_setInitialValue:function(value){this._maskWithPrompts=this._parseValueByMask("");if(value===null||value===""){this._updateValue(value);this._maskedValue=""}else{if(this._validateValue(value)){this._updateValue(this._getDateObjectFromValue(value));this._updateMaskedValue()}this._editorInput.val(this._getDisplayValue())}this._checkClearButtonState();this._setSpinButtonsState(value)},_applyOptions:function(){this._validateSpinSettings();if(this.options.centuryThreshold>99||this.options.centuryThreshold<0){this.options.centuryThreshold=29;throw new Error(this._getLocaleValue("centuryThresholdValidValues"))}if(this.options.minValue){if(!this._isValidDate(new Date(this.options.minValue))){throw new Error(this._getLocaleValue("invalidDate"))}else{this.options.minValue=this._getDateObjectFromValue(this.options.minValue)}}if(this.options.maxValue){if(!this._isValidDate(new Date(this.options.maxValue))){throw new Error(this._getLocaleValue("invalidDate"))}else{this.options.maxValue=this._getDateObjectFromValue(this.options.maxValue)}}this.options.value=this._getValueBetweenMinMax(this.options.value);this._super()},_validateSpinSettings:function(){var delta=this.options.spinDelta,deltaRanges,key;if(typeof delta==="number"){if(delta<0){throw new Error(this._getLocaleValue("spinDeltaCouldntBeNegative"))}else{this.options.spinDelta=parseInt(delta,10)}}else if(typeof delta==="object"){deltaRanges={year:10,month:12,day:28,hours:this._dateIndices.hh24?24:12,minutes:60,seconds:60,milliseconds:1e3};for(key in deltaRanges){if(deltaRanges.hasOwnProperty(key)){this._validateSpinSettingsForTimePeriod(key,deltaRanges[key])}}}else{throw new Error(this._getLocaleValue("spinDeltaIsOfTypeNumberOrObject"))}},_validateSpinSettingsForTimePeriod:function(name,maxRange){var delta=this.options.spinDelta[name];if(delta===undefined){this.options.spinDelta[name]=1;return}if(typeof delta!=="number"){throw new Error($.ig.util.stringFormat(this._getLocaleValue("spinDeltaIsOfTypeNumberForPeriod"),name,0,maxRange))}else if(delta<0||delta>maxRange){throw new Error($.ig.util.stringFormat(this._getLocaleValue("spinDeltaShouldBeInRange"),name,0,maxRange))}else{this.options.spinDelta[name]=parseInt(delta,10)}},_triggerKeyDown:function(event){var key=!event.charCode?event.which:event.charCode,noCancel;noCancel=this._super(event);if(noCancel){if(key===38&&!(this instanceof $.ui.igDatePicker)){this._spinUpEditMode();event.preventDefault()}if(key===40&&!(this instanceof $.ui.igDatePicker)){this._spinDownEditMode();event.preventDefault()}if(key===13){this._enterEditMode()}}return noCancel},_exceedsMaxValue:function(value){if(!this._editMode){value=this.value()}return this.options.maxValue!==null&&this._getDateObjectFromValue(value).getTime()>=this._getDateObjectFromValue(this.options.maxValue).getTime()},_lessThanMinValue:function(value){if(!this._editMode){value=this.value()}return this.options.minValue!==null&&this._getDateObjectFromValue(value).getTime()<=this._getDateObjectFromValue(this.options.minValue).getTime()},_handleSpinUpEvent:function(){this._spin(this.options.spinDelta,true)},_handleSpinDownEvent:function(){this._spin(this._setNegativeDelta(this.options.spinDelta),true)},_setNegativeDelta:function(delta){var revDelta={},key;if(typeof delta==="object"){for(key in delta){if(delta.hasOwnProperty(key)){revDelta[key]=delta[key]*-1}}}else{revDelta=delta*-1}return revDelta},_getDelta:function(delta,name){return typeof delta==="object"?delta[name]:delta},_serializeDate:function(sDate){if(this.options.dataMode==="date"){if(this.options.enableUTCDates){sDate=sDate.toISOString()}else{sDate=$.ig.toLocalISOString(sDate)}}else{sDate=this.options.value}return sDate},_getDateField:function(flag,date){var shift=this.options.yearShift,value;if(!date||isNaN(date.getTime())){return null}value=date["get"+flag]();if(flag==="FullYear"&&shift){value+=shift}return value},_setDateField:function(flag,date,newValue){var shift=this.options.yearShift;if(!date){return}if(flag==="FullYear"&&shift){newValue-=shift}date["set"+flag](newValue)},_setNewDateMidnight:function(){var date=new Date;this._setDateField("Hours",date,0);this._setDateField("Minutes",date,0);this._setDateField("Seconds",date,0);this._setDateField("Milliseconds",date,0);return date},_getInternalMaskedValue:function(newDate){return this._updateMaskedValue(newDate,true)},_replaceDisplayValue:function(selection,previousValue,newValue){if(selection.start===0){newValue=this._formatDateString(newValue.toString())}return this._super(selection,previousValue,newValue)},_formatDateString:function(value){var dateMask,periodName,startIndex,endIndex,prompt=this.options.unfilledCharsPrompt;dateMask=this._parseValueByMask(value);if(dateMask.indexOf(prompt)>=0){for(periodName in this._dateIndices){startIndex=this._dateIndices[periodName];switch(periodName){case"fourDigitYear":case"ffLength":case"hh24":startIndex=null;break;case"yy":endIndex=startIndex+(this._dateIndices.fourDigitYear?4:2);break;case"ff":endIndex=startIndex+this._dateIndices.ffLength;break;default:endIndex=startIndex+2;break}if(startIndex!==null){dateMask=(startIndex>0?dateMask.substring(0,startIndex):"")+this._reverseMaskWithUnderscore(dateMask.substring(startIndex,endIndex))+(endIndex<dateMask.length?dateMask.substring(endIndex,dateMask.length):"")}}}return dateMask},_reverseMaskWithUnderscore:function(mask){var count,reg,match,reversedMask,regPrompt,prompt=this.options.unfilledCharsPrompt;reg=new RegExp("(\\d{1,3}\\"+prompt+"{1,3})","g");regPrompt=new RegExp("\\"+prompt,"g");match=reg.exec(mask);if(match&&match[0]){count=(mask.match(regPrompt)||[]).length;reversedMask=Array(count+1).join(prompt)+match[0].replace(regPrompt,"");mask=mask.replace(match[0],reversedMask)}return mask},_updateMaskedValue:function(newDate,returnValue){var currentMaskValue=this._maskWithPrompts?this._maskWithPrompts:this._parseValueByMask(""),regional=this.options.regional,dateObj,year,month,day,hours,minutes,seconds,milliseconds;dateObj=newDate?newDate:this._dateObjectValue;if(this.options.displayTimeOffset!==null){dateObj=this._getDateOffset(dateObj)}if(dateObj&&dateObj.getTime()===dateObj.getTime()){if(this._dateIndices.yy!==undefined){year=this._getDateField("FullYear",dateObj).toString();if(this._dateIndices.fourDigitYear){if(year.toString().length<4){while(year.toString().length<4){year="0"+year}}currentMaskValue=this._replaceStringRange(currentMaskValue,year,this._dateIndices.yy,this._dateIndices.yy+3)}else{year=year.substring(2);currentMaskValue=this._replaceStringRange(currentMaskValue,year,this._dateIndices.yy,this._dateIndices.yy+1)}}if(this._dateIndices.MM!==undefined){month=this._getDateField("Month",dateObj);month++;if(month<10){month="0"+month.toString()}else{month=month.toString()}currentMaskValue=this._replaceStringRange(currentMaskValue,month,this._dateIndices.MM,this._dateIndices.MM+1)}if(this._dateIndices.dd!==undefined){day=this._getDateField("Date",dateObj);if(day<10){day="0"+day.toString()}else{day=day.toString()}currentMaskValue=this._replaceStringRange(currentMaskValue,day,this._dateIndices.dd,this._dateIndices.dd+1)}if(this._dateIndices.hh!==undefined){hours=this._getDateField("Hours",dateObj);if(!this._dateIndices.hh24&&hours>12){hours-=12}if(!this._dateIndices.hh24&&hours===0){hours=12}if(hours<10){hours="0"+hours.toString()}else{hours=hours.toString()}currentMaskValue=this._replaceStringRange(currentMaskValue,hours,this._dateIndices.hh,this._dateIndices.hh+1)}if(this._dateIndices.mm!==undefined){minutes=this._getDateField("Minutes",dateObj);if(minutes<10){minutes="0"+minutes.toString()}else{minutes=minutes.toString()}currentMaskValue=this._replaceStringRange(currentMaskValue,minutes,this._dateIndices.mm,this._dateIndices.mm+1)}if(this._dateIndices.ss!==undefined){seconds=this._getDateField("Seconds",dateObj);if(seconds<10){seconds="0"+seconds.toString()}else{seconds=seconds.toString()}currentMaskValue=this._replaceStringRange(currentMaskValue,seconds,this._dateIndices.ss,this._dateIndices.ss+1)}if(this._dateIndices.tt!==undefined){hours=this._getDateField("Hours",dateObj);if(hours>=12&&hours<24){if(this._dateIndices._ttLength===1){currentMaskValue=this._replaceCharAt(currentMaskValue,this._dateIndices.tt,"P")}else{currentMaskValue=this._replaceStringRange(currentMaskValue,"PM",this._dateIndices.tt,this._dateIndices.tt+1)}}else{if(this._dateIndices._ttLength===1){currentMaskValue=this._replaceCharAt(currentMaskValue,this._dateIndices.tt,"A")}else{currentMaskValue=this._replaceStringRange(currentMaskValue,"AM",this._dateIndices.tt,this._dateIndices.tt+1)}}}if(this._dateIndices.ff!==undefined){milliseconds=this._getDateField("Milliseconds",dateObj);if(this._dateIndices.ffLength===1){currentMaskValue=this._replaceCharAt(currentMaskValue,this._dateIndices.ff,$.ig.millisecondsToString(milliseconds,"fff",regional).toString())}else if(this._dateIndices.ffLength===2){currentMaskValue=this._replaceStringRange(currentMaskValue,$.ig.millisecondsToString(milliseconds,"ff",regional).toString(),this._dateIndices.ff,this._dateIndices.ff+1)}else{currentMaskValue=this._replaceStringRange(currentMaskValue,$.ig.millisecondsToString(milliseconds,"f",regional).toString(),this._dateIndices.ff,this._dateIndices.ff+2)}}}if(returnValue===true){return currentMaskValue}else{this._maskedValue=currentMaskValue}},_convertDateMaskToDigitMask:function(mask){var x,i,j,flag=-1,txt="",maskVal=mask;this._dateIndices={};this._dateIndices.fourDigitYear=false;if(!maskVal){maskVal=""}maskVal=maskVal.replace("dddd","ddd").replace("ddd,","").replace("ddd ","").replace(" ddd","").replace("ddd","");maskVal=maskVal.replace(/\x08/g," ").replace(/\x09/g," ");maskVal=maskVal.replace(/\\f/g,"\x01").replace(/\\d/g,"\x02").replace(/\\s/g,"\x03").replace(/\\m/g,"\x04").replace(/\\t/g,"\x05").replace(/\\H/g,"\x06").replace(/\\h/g,"\x07").replace(/\\M/g,"\b").replace(/\\y/g,"\t");maskVal=maskVal.replace(/9/g,"\x11").replace(/0/g,"\x12");maskVal=maskVal.replace("fff","24").replace("ff","23").replace("f","22");maskVal=maskVal.replace("dddd","").replace("ddd","").replace("dd","09").replace("d","08").replace("ss","19").replace("s","18").replace("mm","17").replace("m","16");maskVal=maskVal.replace("tt","15").replace("t","14").replace("HH","13").replace("H","12").replace("hh","11").replace("h","10");maskVal=maskVal.replace("MMMM","MM").replace("MMM","MM").replace("MM","05").replace("M","04");maskVal=maskVal.replace("yyyy","03").replace("yy","02").replace("y","01");maskVal=maskVal.replace(/\x01/g,"g").replace(/\x02/g,"d").replace(/\x03/g,"s").replace(/\x04/g,"m").replace(/\x05/g,"t").replace(/\x06/g,"H").replace(/\x07/g,"h").replace(/\x08/g,"M").replace(/\x09/g,"y");for(i=0,j=0;i<maskVal.length;i++,j++){x=maskVal.charCodeAt(i);if(x<48||x>57){flag=maskVal.charAt(i);if(flag==="\\"&&i+1<maskVal.length&&$.inArray(maskVal.charAt(i+1),this._maskFlagsArray)!==-1||maskVal.charAt(i+1)==="\x11"||maskVal.charAt(i+1)==="\x12"){j--}txt+=maskVal.charAt(i);continue}flag=(x-48)*10+maskVal.charCodeAt(++i)-48;if(flag===14){txt+="L"}else if(flag===15){txt+="LL"}else if(flag===22){txt+="0"}else{txt+="90";if(flag===3){txt+="00"}if(flag===24){txt+="0"}}switch(flag){case 4:case 5:case 6:case 7:{if(this._dateIndices.MM){j++;break}else{this._dateIndices.MM=j;j++}}break;case 8:case 9:case 20:case 21:{if(this._dateIndices.dd){j++;break}else{this._dateIndices.dd=j;j++}}break;case 1:case 2:{if(this._dateIndices.yy){j++;break}else{this._dateIndices.yy=j;j++;this._dateIndices.fourDigitYear=false}}break;case 3:{if(this._dateIndices.yy){j+=3;break}else{this._dateIndices.yy=j;j+=3;this._dateIndices.fourDigitYear=true}}break;case 14:{if(this._dateIndices.tt){break}else{this._dateIndices.tt=j;j++;this._dateIndices._ttLength=1}}break;case 15:{if(this._dateIndices.tt){j++;break}else{this._dateIndices.tt=j;j++;this._dateIndices._ttLength=2}}break;case 10:case 11:{if(this._dateIndices.hh){j+=2;break}else{this._dateIndices.hh=j;this._dateIndices.hh24=false;j++}}break;case 12:case 13:{if(this._dateIndices.hh){j+=2;break}else{this._dateIndices.hh=j;this._dateIndices.hh24=true;j++}}break;case 16:case 17:{if(this._dateIndices.mm){j++;break}else{this._dateIndices.mm=j;j++}}break;case 18:case 19:{if(this._dateIndices.ss){j++;break}else{this._dateIndices.ss=j;j++}}break;case 22:{if(this._dateIndices.ff){break}else{this._dateIndices.ff=j;this._dateIndices.ffLength=1}}break;case 23:{if(this._dateIndices.ff){j++;break}else{this._dateIndices.ff=j;this._dateIndices.ffLength=2;j++}}break;case 24:{if(this._dateIndices.ff){j+=2;break}else{this._dateIndices.ff=j;this._dateIndices.ffLength=3;j+=2}}break;default:}}txt=txt.replace(/\x11/g,9).replace(/\x12/g,0);return txt},_validateKey:function(event){var result=true,ch,key,cursorPosition;if(this._super(event)===true){cursorPosition=this._getCursorPosition();if(cursorPosition===this._dateIndices.MM||cursorPosition-1===this._dateIndices.MM){result=this._validateMonthInput(event,cursorPosition)}else if(cursorPosition===this._dateIndices.dd||cursorPosition-1===this._dateIndices.dd){result=this._validateDayInput(event,cursorPosition)}else if(cursorPosition===this._dateIndices.hh||cursorPosition-1===this._dateIndices.hh){result=this._validateHoursInput(event,cursorPosition)}else if(cursorPosition===this._dateIndices.mm||cursorPosition-1===this._dateIndices.mm){result=this._validateMinutesInput(event,cursorPosition)}else if(cursorPosition===this._dateIndices.ss||cursorPosition-1===this._dateIndices.ss){result=this._validateSecondsInput(event,cursorPosition)}else if(cursorPosition===this._dateIndices.tt||cursorPosition-1===this._dateIndices.tt){result=this._validateMidDayInput(event,cursorPosition);if(result===true){key=!event.charCode?event.which:event.charCode;ch=String.fromCharCode(key);if(ch.toLocaleLowerCase()==="a"){this._editorInput.val(this._replaceCharAt(this._editorInput.val(),cursorPosition,"A"))}else{this._editorInput.val(this._replaceCharAt(this._editorInput.val(),cursorPosition,"P"))}if(this._dateIndices._ttLength===2){this._editorInput.val(this._replaceCharAt(this._editorInput.val(),++cursorPosition,"M"))}this._setCursorPosition(++cursorPosition);event.preventDefault()}}else{result=true}if(result===null){cursorPosition++;while($.inArray(cursorPosition,this._literalIndices)!==-1||cursorPosition===this._maskWithPrompts.length){cursorPosition++}this._setCursorPosition(cursorPosition);result=this._validateKey(event)}if(result===false){this._setCursorPosition(cursorPosition)}}else{result=false}return result},_setBlur:function(event){var newValue,oldVal,convertedDate;if(this._cancelBlurOnInput){this._editorInput.focus();delete this._cancelBlurOnInput}else{this._triggerBlur(event);newValue=$(event.target).val();oldVal=this._dateObjectValue;if(this._inComposition===true){newValue=$.ig.util.IMEtoNumberString(newValue,$.ig.util.IMEtoENNumbersMapping());newValue=this._parseValueByMask(newValue);if(newValue===this._maskWithPrompts&&this.options.revertIfNotValid){newValue=oldVal||""}}convertedDate=this._parseDateFromMaskedValue(newValue);if(newValue===this._maskWithPrompts){if(oldVal){this._processValueChanging(newValue)}}else if(!oldVal){this._processValueChanging(newValue)}else if(convertedDate!==""&&convertedDate-oldVal!==0){this._processValueChanging(newValue)}this._exitEditMode();this._focused=false;this._clearTimeouts();if(this._validator){this._validator._validateInternal(this.element,event,true)}}},_validateDayInput:function(event,position){var result=false,key=!event.charCode?event.which:event.charCode,ch=String.fromCharCode(key),num=parseInt(ch),charAtCurrentPosition=parseInt(this._editorInput.val().charAt(position)),charAtPreviousPosition,charAtNextPosition;if(position===this._dateIndices.dd){if(num<4){charAtNextPosition=parseInt(this._editorInput.val().charAt(position+1));if(!isNaN(charAtNextPosition)&&charAtNextPosition>1&&num===3){result=null}else{result=true}}else{if(!isNaN(charAtCurrentPosition)&&charAtCurrentPosition===3){result=null}else{this._setSelectionRange(this._editorInput[0],position+1,position+2);result=true}}}else{charAtPreviousPosition=parseInt(this._editorInput.val().charAt(position-1));if(!isNaN(charAtPreviousPosition)&&charAtPreviousPosition===3){if(num===0||num===1){result=true}else{this._setCursorPosition(position-1);this._handleDeleteKey();this._setSelectionRange(this._editorInput[0],position,position+1);result=true}}else{result=true}}return result},_validateMonthInput:function(event,position){var result=false,key=!event.charCode?event.which:event.charCode,ch=String.fromCharCode(key),num=parseInt(ch),charAtCurrentPosition=parseInt(this._editorInput.val().charAt(position)),charAtPreviousPosition,charAtNextPosition;position=position?position:this._getCursorPosition();if(position===this._dateIndices.MM){if(num<2){charAtNextPosition=parseInt(this._editorInput.val().charAt(position+1));if(!isNaN(charAtNextPosition)&&charAtNextPosition>2&&num===1){result=null}else{result=true}}else{if(!isNaN(charAtCurrentPosition)&&charAtCurrentPosition===1){if(num===2){result=true}else{result=null}}else if(this._editorInput.val().charAt(position)===this.options.unfilledCharsPrompt){if(num<2){result=true}else{result=null}}else{this._setSelectionRange(this._editorInput[0],position+1,position+2);result=true}}}else{charAtPreviousPosition=parseInt(this._editorInput.val().charAt(position-1));if(!isNaN(charAtPreviousPosition)&&charAtPreviousPosition===1){if(num===0||num===1||num===2){result=true}else{this._setCursorPosition(position-1);this._handleDeleteKey();this._setSelectionRange(this._editorInput[0],position,position+1);result=true}}else{result=true}}return result},_validateMidDayInput:function(event,position){var result=false,key=!event.charCode?event.which:event.charCode,ch=String.fromCharCode(key);position=position?position:this._getCursorPosition();if(position===this._dateIndices.tt){if(ch.toString().toLocaleLowerCase()==="a"||ch.toString().toLocaleLowerCase()==="p"){result=true}else{result=false}}else{result=null}return result},_validateHoursInput:function(event,position){var result=false,key=!event.charCode?event.which:event.charCode,ch=String.fromCharCode(key),num=parseInt(ch),charAtPreviousPosition,charAtNextPosition;position=position?position:this._getCursorPosition();if(position===this._dateIndices.hh){if(this._dateIndices.hh24){if(num===0||num===1){result=true}else if(num===2){charAtNextPosition=parseInt(this._editorInput.val().charAt(position+1));if(!isNaN(charAtNextPosition)&&charAtNextPosition>4){result=null}else{result=true}}else{result=null}}else{if(num===0){result=true}else if(num===1){charAtNextPosition=parseInt(this._editorInput.val().charAt(position+1));if(!isNaN(charAtNextPosition)&&charAtNextPosition>2){result=null}else{result=true}}else{result=null}}}else{charAtPreviousPosition=parseInt(this._editorInput.val().charAt(position-1));if(this._dateIndices.hh24){if(!isNaN(charAtPreviousPosition)&&charAtPreviousPosition===2){if(num<=4){result=true}else{result=true;this._setCursorPosition(position-1);this._handleDeleteKey();this._setSelectionRange(this._editorInput[0],position,position+1)}}else{result=true}}else{if(!isNaN(charAtPreviousPosition)&&charAtPreviousPosition===1){if(num<=2){result=true}else{this._setCursorPosition(position-1);this._handleDeleteKey();this._setSelectionRange(this._editorInput[0],position,position+1);result=true}}else{result=true}}}return result},_validateMinutesInput:function(event,position){var result=false,key=!event.charCode?event.which:event.charCode,ch=String.fromCharCode(key),num=parseInt(ch);position=position?position:this._getCursorPosition();if(position===this._dateIndices.mm){if(num<6){result=true}else{result=true;this._handleDeleteKey();this._setSelectionRange(this._editorInput[0],position+1,position+2)}}else{result=true}return result},_validateSecondsInput:function(event,position){var result=false,key=!event.charCode?event.which:event.charCode,ch=String.fromCharCode(key),num=parseInt(ch);position=position?position:this._getCursorPosition();if(position===this._dateIndices.ss){if(num<6){result=true}else{this._handleDeleteKey();this._setSelectionRange(this._editorInput[0],position+1,position+2);result=true}}else{result=true}return result},_fillCentury:function(year){if(!isNaN(year)){if(year>=0&&year<=this.options.centuryThreshold){year=2e3+year}else if(year<100){year=1900+year}}return year},_triggerInternalValueChange:function(value){if(value===this._maskWithPrompts){value=""}var noCancel=this._triggerValueChanging(value);if(noCancel){this._processInternalValueChanging(value);this._triggerValueChanged(value)}},_processInternalValueChanging:function(value){var parsedVal,cursorPosition;if(value===""){cursorPosition=this._getCursorPosition();this._clearValue();if(this._focused&&cursorPosition!==undefined){cursorPosition=cursorPosition===-1?cursorPosition++:cursorPosition;this._setCursorPosition(cursorPosition)}return}if($.type(value)==="date"){parsedVal=value}else{if(value.length!==this._maskWithPrompts.length){value=this._parseValueByMask(value)}parsedVal=this._parseDateFromMaskedValue(value)}parsedVal=this._getValueBetweenMinMax(parsedVal);if(this._validateValue(parsedVal)){this._updateValue(parsedVal)}else{if(this.options.revertIfNotValid){value=this._valueInput.val();this._updateValue(value)}else{this._clearValue();value=this._valueInput.val()}}},_insertEditMode:function(newValue,selection){newValue=$.ig.util.IMEtoNumberString(newValue,$.ig.util.IMEtoENNumbersMapping());newValue=this._parseValueByMask(newValue);if(newValue===this._maskWithPrompts&&this.options.revertIfNotValid){newValue=this._maskedValue;selection.start=0;selection.end=newValue.length}this._editorInput.val(newValue);if(selection!==undefined){this._setSelectionRange(this._editorInput[0],selection.start,selection.end)}},_isValidDate:function(date){date=this._getDateObjectFromValue(date);return date.getTime()===date.getTime()},_validateValue:function(val){var result,dateObj,minValue,maxValue;if(val===null||val===""){return this._super(val)}dateObj=this._getDateObjectFromValue(val);if(this.options.minValue){minValue=this._getDateObjectFromValue(this.options.minValue)}if(this.options.maxValue){maxValue=this._getDateObjectFromValue(this.options.maxValue)}if(this._isValidDate(dateObj)){if(this.options.maxValue&&this._isValidDate(maxValue)&&dateObj>maxValue){result=false}else if(this.options.minValue&&this._isValidDate(minValue)&&dateObj<minValue){result=false}else{result=true}}else{result=false}return result},_getValueBetweenMinMax:function(date){var validDate=date;if(date!==null&&this._isValidDate(date)){if(this.options.maxValue&&date>this.options.maxValue){validDate=this._getDateObjectFromValue(this.options.maxValue);this._sendNotification("warning",{optName:"maxValExceedSetErrMsg",arg:this._getDisplayValue(new Date(this.options.maxValue))})}else if(this.options.minValue&&date<this.options.minValue){validDate=this._getDateObjectFromValue(this.options.minValue);this._sendNotification("warning",{optName:"minValExceedSetErrMsg",arg:this._getDisplayValue(new Date(this.options.minValue))})}}return validDate},_updateValue:function(value){if(value===null){this._maskedValue=this._maskWithPrompts;this._valueInput.val("");this.options.value=this.options.allowNullValue?null:"";this._dateObjectValue=null}else if(value===""){this._maskedValue=this._maskWithPrompts;this._valueInput.val("");this.options.value="";this._dateObjectValue=null}else{this._dateObjectValue=this._getDateObjectFromValue(value);this._updateMaskedValue();this.options.value=this._getValueByDataMode();this._valueInput.val(this._serializeDate(this._dateObjectValue))}},_clearValue:function(textOnly){var newValue="",maskedValue=this._maskWithPrompts;if(this.options.allowNullValue){if(this._validateValue(this.options.nullValue)){newValue=this.options.nullValue;if(newValue!==null&&newValue!==""){newValue=this._getDateObjectFromValue(this.options.nullValue);maskedValue=this._updateMaskedValue(this.options.nullValue,true)}}}this._editorInput.val(maskedValue);if(!textOnly){this._updateValue(newValue)}if(this._editMode===false){this._exitEditMode()}},_getDateObjectFromValue:function(value){var date;if(this._mvcDateRegex.test(value)){date=new Date(parseInt(value.replace(this._mvcDateRegex,"$1"),10))}else if($.type(value)==="date"){date=new Date(value.getTime())}else{date=new Date(value)}return date},_getValueByDataMode:function(){var dataModeValue,maskedVal=this._maskedValue?this._maskedValue:this._maskWithPrompts,dataMode=this.options.dataMode;switch(dataMode){case"date":{dataModeValue=this._dateObjectValue}break;case"displayModeText":{dataModeValue=this._getDisplayValue()}break;case"editModeText":{dataModeValue=maskedVal;
}break;default:{dataModeValue=this._dateObjectValue}}return dataModeValue},_getDateOffset:function(date){var newDate,zoneOffset;if(!date){return date}newDate=new Date(date.getTime());zoneOffset=newDate.getTimezoneOffset();newDate.setUTCMinutes(newDate.getUTCMinutes()+zoneOffset+this.options.displayTimeOffset);if(zoneOffset!==newDate.getTimezoneOffset()){newDate.setUTCMinutes(newDate.getUTCMinutes()+newDate.getTimezoneOffset()-zoneOffset)}return newDate},_getYearShift:function(date){var newDate;newDate=new Date(date.getTime());newDate.setFullYear(date.getFullYear()+this.options.yearShift);return newDate},_clearDateOffset:function(date){date.setUTCMinutes(date.getUTCMinutes()-date.getTimezoneOffset()-this.options.displayTimeOffset)},_parseDateFromMaskedValue:function(value){var dateField,monthField,yearField,hourField,minutesField,secondsField,millisecondsField,midDayField,dateStartIndex=this._dateIndices.dd,regExpr,ffCount,lastDayOfMonth,monthStartIndex=this._dateIndices.MM,yearStartIndex=this._dateIndices.yy,hourStartIndex=this._dateIndices.hh,minuteStartIndex=this._dateIndices.mm,secondsStartIndex=this._dateIndices.ss,midDayStartIndex=this._dateIndices.tt,millisecondsStartIndex=this._dateIndices.ff,extractedDate="";if(value===""||value===null||$.type(value)==="date"){return extractedDate}if(dateStartIndex!==undefined&&dateStartIndex!==null){dateField=value.substring(dateStartIndex,dateStartIndex+2);if(dateField.indexOf(this.options.unfilledCharsPrompt)!==-1){regExpr=new RegExp($.ig.util.escapeRegExp(this.options.unfilledCharsPrompt),"g");dateField=dateField.replace(regExpr,"")}if(dateField!==""){dateField=parseInt(dateField,10);if(dateField<=0){dateField=null}}else{dateField=null}}if(monthStartIndex!==undefined&&monthStartIndex!==null){monthField=value.substring(monthStartIndex,monthStartIndex+2);if(monthField.indexOf(this.options.unfilledCharsPrompt)!==-1){regExpr=new RegExp($.ig.util.escapeRegExp(this.options.unfilledCharsPrompt),"g");monthField=monthField.replace(regExpr,"")}if(monthField!==""){monthField=parseInt(monthField,10);if(monthField<=0){monthField=null}else{monthField--}}else{monthField=null}}if(yearStartIndex!==undefined&&yearStartIndex!==null){if(this._dateIndices.fourDigitYear){yearField=value.substring(yearStartIndex,yearStartIndex+4)}else{yearField=value.substring(yearStartIndex,yearStartIndex+2)}if(yearField.indexOf(this.options.unfilledCharsPrompt)!==-1){regExpr=new RegExp($.ig.util.escapeRegExp(this.options.unfilledCharsPrompt),"g");yearField=yearField.replace(regExpr,"")}if(yearField!==""){yearField=parseInt(yearField,10);yearField=this._fillCentury(yearField)}else{yearField=null}}if(midDayStartIndex!==undefined&&midDayStartIndex!==null){midDayField=value.substring(midDayStartIndex,midDayStartIndex+1);if(midDayField===this.options.unfilledCharsPrompt){midDayField=null}else{midDayField=midDayField.toLocaleLowerCase()}}if(hourStartIndex!==undefined&&hourStartIndex!==null){hourField=value.substring(hourStartIndex,hourStartIndex+2);if(hourField.indexOf(this.options.unfilledCharsPrompt)!==-1){regExpr=new RegExp($.ig.util.escapeRegExp(this.options.unfilledCharsPrompt),"g");hourField=hourField.replace(regExpr,"")}if(hourField!==""){hourField=parseInt(hourField,10);if(this._dateIndices.hh24===false){if(midDayField&&midDayField==="p"){if(hourField!==12){hourField+=12}}else if(hourField===12){hourField=0}}}else{hourField=null}}if(minuteStartIndex!==undefined&&minuteStartIndex!==null){minutesField=value.substring(minuteStartIndex,minuteStartIndex+2);if(minutesField.indexOf(this.options.unfilledCharsPrompt)!==-1){regExpr=new RegExp($.ig.util.escapeRegExp(this.options.unfilledCharsPrompt),"g");minutesField=minutesField.replace(regExpr,"")}if(minutesField!==""){minutesField=parseInt(minutesField,10)}else{minutesField=null}}if(secondsStartIndex!==undefined&&secondsStartIndex!==null){secondsField=value.substring(secondsStartIndex,secondsStartIndex+2);if(secondsField.indexOf(this.options.unfilledCharsPrompt)!==-1){regExpr=new RegExp($.ig.util.escapeRegExp(this.options.unfilledCharsPrompt),"g");secondsField=secondsField.replace(regExpr,"")}if(secondsField!==""){secondsField=parseInt(secondsField,10)}else{secondsField=null}}if(millisecondsStartIndex!==undefined&&millisecondsStartIndex!==null){millisecondsField=value.substring(millisecondsStartIndex,millisecondsStartIndex+this._dateIndices.ffLength);if(millisecondsField.indexOf(this.options.unfilledCharsPrompt)!==-1){regExpr=new RegExp($.ig.util.escapeRegExp(this.options.unfilledCharsPrompt),"g");millisecondsField=millisecondsField.replace(regExpr,"")}if(millisecondsField!==""){if(millisecondsField.length<this._dateIndices.ffLength){ffCount=this._dateIndices.ffLength-millisecondsField.length;millisecondsField=parseInt(millisecondsField,10)*Math.pow(10,ffCount)}millisecondsField=parseInt(millisecondsField,10);if(this._dateIndices.ffLength===2){millisecondsField*=10}else if(this._dateIndices.ffLength===1){millisecondsField*=100}}else{millisecondsField=null}}if(!this._dateObjectValue){if(yearField!==null&&yearField!==undefined&&monthField!==null&&monthField!==undefined&&dateField!==null&&dateField!==undefined){extractedDate=new Date(yearField,monthField,dateField)}else{extractedDate=this._setNewDateMidnight();if(yearField!==null&&yearField!==undefined){this._setDateField("FullYear",extractedDate,yearField)}if(monthField!==null&&monthField!==undefined){this._setDateField("Month",extractedDate,monthField)}if(dateField!==null&&dateField!==undefined){lastDayOfMonth=this._lastDayOfMonth(this._getDateField("FullYear",extractedDate),this._getDateField("Month",extractedDate)+1);if(dateField>lastDayOfMonth){dateField=lastDayOfMonth}this._setDateField("Date",extractedDate,dateField)}}}else{if(this.options.displayTimeOffset!==null){extractedDate=this._getDateOffset(this._dateObjectValue)}else{extractedDate=new Date(this._dateObjectValue.getTime())}}if(yearField!==null&&yearField!==undefined){this._setDateField("FullYear",extractedDate,yearField)}if(monthField!==null&&monthField!==undefined){if(dateField!==null&&dateField!==undefined){this._setDateField("Date",extractedDate,"15")}this._setDateField("Month",extractedDate,monthField)}if(dateField!==null&&dateField!==undefined){lastDayOfMonth=this._lastDayOfMonth(this._getDateField("FullYear",extractedDate),this._getDateField("Month",extractedDate)+1);if(dateField>lastDayOfMonth){dateField=lastDayOfMonth}this._setDateField("Date",extractedDate,dateField)}if(hourField!==null&&hourField!==undefined){this._setDateField("Hours",extractedDate,hourField)}if(minutesField!==null&&minutesField!==undefined){this._setDateField("Minutes",extractedDate,minutesField)}if(secondsField!==null&&secondsField!==undefined){this._setDateField("Seconds",extractedDate,secondsField)}if(millisecondsField!==null&&millisecondsField!==undefined){this._setDateField("Milliseconds",extractedDate,millisecondsField)}if(this.options.displayTimeOffset!==null){this._clearDateOffset(extractedDate)}return extractedDate},_getDisplayValue:function(date){var dateObject=date?date:this._dateObjectValue;if(!dateObject){return""}if(this.options.yearShift!==null){dateObject=this._getYearShift(dateObject)}if(this.options.displayTimeOffset!==null){dateObject=this._getDateOffset(dateObject)}return $.ig.formatDate(this._displayFormat,dateObject,this.options.regional)},_valueFromText:function(text){var dateFromText=this._parseDateFromMaskedValue(text),dataModeValue;switch(this.options.dataMode){case"date":{dataModeValue=dateFromText}break;case"displayModeText":{dataModeValue=this._getDisplayValue(dateFromText)}break;case"editModeText":{dataModeValue=this._getInternalMaskedValue(dateFromText)}break;default:{dataModeValue=dateFromText}}return dataModeValue},_handleBackSpaceKey:function(){var cursorPosition;this._super();cursorPosition=this._getSelection(this._editorInput[0]).start;if(cursorPosition===this._dateIndices.tt||cursorPosition-1===this._dateIndices.tt){if(this._dateIndices._ttLength===2){if(cursorPosition===this._dateIndices.tt){this._setCursorPosition(cursorPosition+1);$.ui.igMaskEditor.prototype._handleDeleteKey.call(this);this._setCursorPosition(cursorPosition)}else{this._super()}}}},_handleDeleteKey:function(skipCursorPosition){var cursorPosition=this._getSelection(this._editorInput[0]).start;if(cursorPosition===this._maskWithPrompts.length){return}this._super(skipCursorPosition);cursorPosition=this._getSelection(this._editorInput[0]).start;if(cursorPosition-2===this._dateIndices.tt||cursorPosition-1===this._dateIndices.tt){if(this._dateIndices._ttLength===2){if(cursorPosition-1===this._dateIndices.tt){this._super(skipCursorPosition)}else{if(!skipCursorPosition){this._setCursorPosition(cursorPosition-1)}$.ui.igMaskEditor.prototype._handleBackSpaceKey.call(this);if(!skipCursorPosition){this._setCursorPosition(cursorPosition)}}}}},_setMillisecondsEditMode:function(mask,time,currentMilliseconds,delta){var isLimited=this.options.limitSpinToCurrentField,newMilliseconds,secondsUpdateDelta=0,currentSecond,timeSecond,boundary;delta=this._getDelta(delta,"milliseconds");switch(this._dateIndices.ffLength){case 1:boundary=10;break;case 2:boundary=100;break;case 3:boundary=1e3;break}if(currentMilliseconds+delta>=boundary){if(isLimited){newMilliseconds=currentMilliseconds}else{newMilliseconds=currentMilliseconds+delta-boundary;secondsUpdateDelta=1}}else if(currentMilliseconds+delta<0){if(isLimited){newMilliseconds=currentMilliseconds}else{if(currentMilliseconds+delta===0){newMilliseconds=0}else{newMilliseconds=boundary+(currentMilliseconds+delta);secondsUpdateDelta=-1}}}else{newMilliseconds=currentMilliseconds+delta}mask=this._setTimeEditMode(mask,time,currentMilliseconds,newMilliseconds);if(secondsUpdateDelta!==undefined&&secondsUpdateDelta!==0){timeSecond=this._createSecondsPosition();if(timeSecond!==null){currentSecond=parseInt(this._getStringRange(mask,timeSecond.startPosition,timeSecond.endPosition),10);mask=this._setSecondsEditMode(mask,timeSecond,currentSecond,secondsUpdateDelta)}else{if(!isLimited){this._setDateField("Seconds",this._dateObjectValue,this._getDateField("Seconds",this._dateObjectValue)+secondsUpdateDelta)}}}return mask},_setSecondsEditMode:function(mask,time,currentSecond,delta){var isLimited=this.options.limitSpinToCurrentField,newSecond,minuteUpdateDelta=0,currentMinute,timeMinute;delta=this._getDelta(delta,"seconds");delta=delta%60;if(currentSecond+delta>=60){if(isLimited){newSecond=currentSecond}else{newSecond=currentSecond+delta-60;minuteUpdateDelta=1}}else if(currentSecond+delta<1){if(isLimited){newSecond=currentSecond}else{if(currentSecond+delta===0){newSecond=0}else{newSecond=60+(currentSecond+delta);minuteUpdateDelta=-1}}}else{newSecond=currentSecond+delta}mask=this._setTimeEditMode(mask,time,currentSecond,newSecond);if(minuteUpdateDelta!==undefined&&minuteUpdateDelta!==0){timeMinute=this._createMinutesPosition();if(timeMinute!==null){currentMinute=parseInt(this._getStringRange(mask,timeMinute.startPosition,timeMinute.endPosition),10);mask=this._setMinutesEditMode(mask,timeMinute,currentMinute,minuteUpdateDelta)}else{if(!isLimited){this._setDateField("Minutes",this._dateObjectValue,this._getDateField("Minutes",this._dateObjectValue)+minuteUpdateDelta)}}}return mask},_setMinutesEditMode:function(mask,time,currentMinute,delta){var isLimited=this.options.limitSpinToCurrentField,newMinute,hourUpdateDelta=0,currentHour,timeHour;delta=this._getDelta(delta,"minutes");delta=delta%60;if(currentMinute+delta>=60){if(isLimited){newMinute=currentMinute}else{newMinute=currentMinute+delta-60;hourUpdateDelta=1}}else if(currentMinute+delta<1){if(isLimited){newMinute=currentMinute}else{if(currentMinute+delta===0){newMinute=0}else{newMinute=60+(currentMinute+delta);hourUpdateDelta=-1}}}else{newMinute=currentMinute+delta}mask=this._setTimeEditMode(mask,time,currentMinute,newMinute);if(hourUpdateDelta!==undefined&&hourUpdateDelta!==0){timeHour=this._createHoursPosition();if(timeHour!==null){currentHour=parseInt(this._getStringRange(mask,timeHour.startPosition,timeHour.endPosition),10);mask=this._setHoursEditMode(mask,timeHour,currentHour,hourUpdateDelta)}else{if(!isLimited){this._setDateField("Hours",this._dateObjectValue,this._getDateField("Hours",this._dateObjectValue)+hourUpdateDelta)}}}return mask},_setHoursEditMode:function(mask,time,currentHour,delta){var isLimited=this.options.limitSpinToCurrentField,is24format=this._dateIndices.hh24,dayUpdateDelta=false,amPmUpdateDelta=false,newHour,hours,wrapUpHours,wrapDownHours,currentDay,currentAmPm,timeDay,timeAmPm,dayDelta;delta=this._getDelta(delta,"hours");if(is24format){hours=24;newHour=currentHour+(Math.abs(delta)===24?delta:delta%24);wrapUpHours=newHour>=hours;wrapDownHours=newHour<0}else{hours=12;newHour=currentHour+(Math.abs(delta)===12?delta:delta%12);wrapUpHours=newHour>hours;wrapDownHours=newHour<1;currentAmPm=mask.toLowerCase().indexOf(" pm")>=0?"pm":"am"}if(wrapUpHours){if(isLimited){newHour=currentHour}else{dayDelta=delta!==0?1:0;if(is24format){newHour-=hours;dayUpdateDelta=true}else{if(newHour>=13){if(newHour>13||delta>1){amPmUpdateDelta=true}if(currentAmPm==="pm"&&(currentHour<12||currentHour===12&&delta===12)){dayUpdateDelta=true}newHour=newHour-hours}}}}else if(wrapDownHours){if(isLimited){newHour=currentHour}else{dayDelta=delta!==0?-1:0;if(is24format){newHour+=hours;dayUpdateDelta=true}else{if(newHour<0||Math.abs(delta)===12){if(newHour<hours||delta<-1){amPmUpdateDelta=true}if(currentAmPm==="am"){dayUpdateDelta=true}}newHour=12+newHour}}}else{if(!is24format){if(delta>0&&newHour>=12&&newHour-delta<12){dayDelta=delta!==0?1:0;amPmUpdateDelta=true;if(currentAmPm==="pm"){dayUpdateDelta=true}}if(delta<0&&newHour<=12&&newHour-delta>=12){dayDelta=delta!==0?-1:0;amPmUpdateDelta=true;if(currentAmPm==="am"){dayUpdateDelta=true}}}}mask=this._setTimeEditMode(mask,time,currentHour,newHour);if(amPmUpdateDelta){timeAmPm=this._createAmOrPmPosition();if(timeAmPm!==null){mask=this._setAmOrPmEditMode(mask,timeAmPm,currentAmPm)}}if(dayUpdateDelta){timeDay=this._createDayPosition();if(timeDay!==null){currentDay=parseInt(this._getStringRange(mask,timeDay.startPosition,timeDay.endPosition),10);mask=this._setDayEditMode(mask,timeDay,currentDay,dayDelta)}else{if(!isLimited){this._setDateField("Date",this._dateObjectValue,this._getDateField("Date",this._dateObjectValue)+dayDelta)}}}return mask},_setAmOrPmEditMode:function(mask,time,currentAmOrPm,noSwap){var newAmOrPm;if(noSwap){newAmOrPm=currentAmOrPm}else{if(currentAmOrPm.toLocaleLowerCase()==="am"){newAmOrPm="PM"}else{newAmOrPm="AM"}}mask=this._setTimeEditMode(mask,time,currentAmOrPm,newAmOrPm);return mask},_lastDayOfMonth:function(year,month){var day;if(month===1||month===3||month===5||month===7||month===8||month===10||month===12){day=31}else if(month===4||month===6||month===9||month===11){day=30}else if(month===2&&year%4===0){day=29}else if(month===2&&year%4!==0){day=28}return day},_setDayEditMode:function(mask,time,currentDay,delta){var isLimited=this.options.limitSpinToCurrentField,currentYear,currentMonth,lastDayOfMonth,lastDayOfPreviousMonth,newDay,monthUpdateDelta,timeYear,timeMonth,today;delta=this._getDelta(delta,"day");today=new Date;timeYear=this._createYearPosition();if(timeYear===null){currentYear=today.getFullYear()}else{currentYear=parseInt(this._getStringRange(mask,timeYear.startPosition,timeYear.endPosition),10)}timeMonth=this._createMonthPosition();if(timeMonth===null){currentMonth=today.getMonth()+1}else{currentMonth=parseInt(this._getStringRange(mask,timeMonth.startPosition,timeMonth.endPosition),10)}lastDayOfMonth=this._lastDayOfMonth(currentYear,currentMonth);lastDayOfPreviousMonth=this._lastDayOfMonth(currentYear,currentMonth-1!==0?currentMonth-1:12);if(currentDay+delta>lastDayOfMonth){if(isLimited){newDay=currentDay}else{newDay=currentDay+delta-lastDayOfMonth;monthUpdateDelta=1}}else if(currentDay+delta<1){if(isLimited){newDay=currentDay}else{newDay=lastDayOfPreviousMonth+(currentDay+delta);monthUpdateDelta=-1}}else{newDay=currentDay+delta}mask=this._setTimeEditMode(mask,time,currentDay,newDay);if(monthUpdateDelta!==undefined&&monthUpdateDelta!==0){timeMonth=this._createMonthPosition();if(timeMonth!==null){currentMonth=parseInt(this._getStringRange(mask,timeMonth.startPosition,timeMonth.endPosition),10);mask=this._setMonthEditMode(mask,timeMonth,currentMonth,monthUpdateDelta)}else{if(!isLimited){this._setDateField("Month",this._dateObjectValue,this._getDateField("Month",this._dateObjectValue)+monthUpdateDelta)}}}return mask},_setMonthEditMode:function(mask,time,currentMonth,delta){var isLimited=this.options.limitSpinToCurrentField,newMonth,yearUpdateDelta=0,currentYear,timeYear;delta=this._getDelta(delta,"month");if(currentMonth+delta>12){if(isLimited){newMonth=currentMonth}else{newMonth=currentMonth+delta-12;yearUpdateDelta=1}}else if(currentMonth+delta<1){if(isLimited){newMonth=currentMonth}else{newMonth=12+(currentMonth+delta);yearUpdateDelta=-1}}else{newMonth=currentMonth+delta}mask=this._setTimeEditMode(mask,time,currentMonth,newMonth);if(yearUpdateDelta!==undefined&&yearUpdateDelta!==0){timeYear=this._createYearPosition();if(timeYear!==null){currentYear=parseInt(this._getStringRange(mask,timeYear.startPosition,timeYear.endPosition),10);mask=this._setYearEditMode(mask,timeYear,currentYear,yearUpdateDelta)}else{if(!isLimited){this._setDateField("FullYear",this._dateObjectValue,this._getDateField("FullYear",this._dateObjectValue)+yearUpdateDelta)}}}return mask},_setYearEditMode:function(mask,time,currentYear,delta){var newYear;delta=this._getDelta(delta,"year");if(currentYear+delta<0){newYear=currentYear}else{newYear=currentYear+delta}newYear=newYear.toString();if(!this._dateIndices.fourDigitYear){newYear=newYear.substring(newYear.length-2,newYear.length)}mask=this._setTimeEditMode(mask,time,currentYear,newYear);return mask},_setTimeEditMode:function(mask,time,currentValue,newValue){var newValueAsString;newValueAsString=newValue.toString();if(newValueAsString.length===1){if(!(time.name==="milliseconds"&&this._dateIndices.ffLength===1)){newValueAsString="0"+newValueAsString}if(time.name==="milliseconds"&&this._dateIndices.ffLength===3){newValueAsString="0"+newValueAsString}if(time.name==="year"&&this._dateIndices.fourDigitYear){newValueAsString="00"+newValueAsString}}else if(newValueAsString.length===2&&time.name==="year"&&this._dateIndices.fourDigitYear){newValueAsString="00"+newValueAsString}else if(newValueAsString.length===3&&time.name==="year"&&this._dateIndices.fourDigitYear){newValueAsString="0"+newValueAsString}mask=this._replaceStringRange(mask,newValueAsString,time.startPosition,time.endPosition-1);return mask},_createYearPosition:function(){var time=null;if(this._dateIndices.yy!==undefined){time={};time.name="year";time.startPosition=this._dateIndices.yy;time.length=this._dateIndices.fourDigitYear?4:2;time.endPosition=time.startPosition+time.length}return time},_createMonthPosition:function(){var time=null;if(this._dateIndices.MM!==undefined){time={};time.name="month";time.startPosition=this._dateIndices.MM;time.length=2;time.endPosition=time.startPosition+time.length}return time},_createDayPosition:function(){var time=null;if(this._dateIndices.dd!==undefined){time={};time.name="day";time.startPosition=this._dateIndices.dd;time.length=2;time.endPosition=time.startPosition+time.length}return time},_createAmOrPmPosition:function(){var time=null;if(this._dateIndices.tt!==undefined){time={};time.name="amOrPm";time.startPosition=this._dateIndices.tt;time.length=2;time.endPosition=time.startPosition+time.length}return time},_createHoursPosition:function(){var time=null;if(this._dateIndices.hh!==undefined){time={};time.name="hours";time.startPosition=this._dateIndices.hh;time.length=2;time.endPosition=time.startPosition+time.length}return time},_createMinutesPosition:function(){var time=null;if(this._dateIndices.mm!==undefined){time={};time.name="minutes";time.startPosition=this._dateIndices.mm;time.length=2;time.endPosition=time.startPosition+time.length}return time},_createSecondsPosition:function(){var time=null;if(this._dateIndices.ss!==undefined){time={};time.name="seconds";time.startPosition=this._dateIndices.ss;time.length=2;time.endPosition=time.startPosition+time.length}return time},_createMillisecondsPosition:function(){var time=null;if(this._dateIndices.ff!==undefined){time={};time.name="milliseconds";time.startPosition=this._dateIndices.ff;time.length=this._dateIndices.ffLength;time.endPosition=time.startPosition+time.length}return time},_getTimePosition:function(){var cursorPosition=this._getCursorPosition(),indices=this._dateIndices,time=null;if(cursorPosition<0){cursorPosition=0}if(cursorPosition>=indices.yy&&(indices.fourDigitYear&&cursorPosition<=indices.yy+4||(indices.fourDigitYear===undefined||indices.fourDigitYear===false)&&cursorPosition<=indices.yy+2)){time=this._createYearPosition()}else if(cursorPosition>=indices.MM&&cursorPosition<=indices.MM+2){time=this._createMonthPosition()}else if(cursorPosition>=indices.dd&&cursorPosition<=indices.dd+2){time=this._createDayPosition()}else if(cursorPosition>=indices.tt&&cursorPosition<=indices.tt+2){time=this._createAmOrPmPosition()}else if(cursorPosition>=indices.hh&&cursorPosition<=indices.hh+2){time=this._createHoursPosition()}else if(cursorPosition>=indices.mm&&cursorPosition<=indices.mm+2){time=this._createMinutesPosition()}else if(cursorPosition>=indices.ss&&cursorPosition<=indices.ss+2){time=this._createSecondsPosition()}else if(cursorPosition>=indices.ff&&cursorPosition<=indices.ff+indices.ffLength){time=this._createMillisecondsPosition()}return time},_updateTimeMask:function(mask,time,delta){var currentValueString,currentValue,range,index,unfilled=this.options.unfilledCharsPrompt;currentValueString=range=this._getStringRange(mask,time.startPosition,time.endPosition);for(index=0;index<range.length;index++){if(currentValueString.indexOf(unfilled)===index){currentValueString=currentValueString.replace(unfilled,"0")}else{break}}if(time.name!=="amOrPm"){currentValue=parseInt(currentValueString,10)}if(!this._dateObjectValue&&mask.indexOf(unfilled)>=0){mask=this._initEmptyMask(this._dateObjectValue,mask);mask=mask.substring(0,time.startPosition)+currentValueString+mask.substring(time.endPosition,mask.length)}switch(time.name){case"year":mask=this._setYearEditMode(mask,time,currentValue,delta);break;case"month":mask=this._setMonthEditMode(mask,time,currentValue,delta);break;case"day":mask=this._setDayEditMode(mask,time,currentValue,delta);break;case"amOrPm":currentValue=this._getStringRange(mask,time.startPosition,time.endPosition);mask=this._setAmOrPmEditMode(mask,time,currentValue);break;case"hours":mask=this._setHoursEditMode(mask,time,currentValue,delta);break;case"minutes":mask=this._setMinutesEditMode(mask,time,currentValue,delta);break;case"seconds":mask=this._setSecondsEditMode(mask,time,currentValue,delta);break;case"milliseconds":mask=this._setMillisecondsEditMode(mask,time,currentValue,delta);break}return mask},_initEmptyMask:function(date,mask){mask=mask||this._maskWithPrompts;var timeYear,timeMonth,timeDay,timeHours,timeAmOrPM,timeMinutes,timeSeconds,timeMilliseconds,year,month,day,hours,amPM,minutes,seconds,milliseconds;if(!date){date=this._parseDateFromMaskedValue(mask)}timeYear=this._createYearPosition();timeMonth=this._createMonthPosition();timeDay=this._createDayPosition();timeHours=this._createHoursPosition();timeAmOrPM=this._createAmOrPmPosition();timeMinutes=this._createMinutesPosition();timeSeconds=this._createSecondsPosition();timeMilliseconds=this._createMillisecondsPosition();year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();hours=date.getHours();amPM=!this._dateIndices.hh24&&hours>=12?"PM":"AM";hours=!this._dateIndices.hh24&&hours>12?hours-12:hours;minutes=date.getMinutes();seconds=date.getSeconds();milliseconds=date.getMilliseconds();if(timeYear){mask=this._setYearEditMode(mask,timeYear,year,0)}if(timeMonth){mask=this._setMonthEditMode(mask,timeMonth,month,0)}if(timeDay){mask=this._setDayEditMode(mask,timeDay,day,0)}if(timeHours){mask=this._setHoursEditMode(mask,timeHours,hours,0)}if(timeAmOrPM){mask=this._setAmOrPmEditMode(mask,timeAmOrPM,amPM,true)}if(timeMinutes){mask=this._setMinutesEditMode(mask,timeMinutes,minutes,0)}if(timeSeconds){mask=this._setSecondsEditMode(mask,timeSeconds,seconds,0)}if(timeMilliseconds){mask=this._setMillisecondsEditMode(mask,timeMilliseconds,milliseconds,0)}return mask},_spinEditMode:function(delta,userInteraction){var self=this,cursorPosition=this._getCursorPosition(),mask=this._editorInput.val(),time;time=this._getTimePosition();if(!time){return}if(mask===undefined){return}else if(mask===""||mask===this._maskWithPrompts){mask=this._initEmptyMask(this._dateObjectValue,mask)}else{mask=this._updateTimeMask(mask,time,delta)}this._editorInput.val(mask);if(userInteraction){this._processTextChanged()}self._setCursorPosition(cursorPosition)},_setTimePeriod:function(periodName,delta,userInteraction){var date,period,newPeriod;if(!this._dateObjectValue||!this._isValidDate(this._dateObjectValue)){date=this._setNewDateMidnight();delta=0}else{date=new Date(this._dateObjectValue)}period=this._getDateField(periodName,date);newPeriod=period+delta;if(!this._isNewPeriodLimited(periodName,newPeriod,delta,date)){this._setDateField(periodName,date,newPeriod);if(userInteraction){this._triggerInternalValueChange(date);this._editorInput.val(this._getDisplayValue());this._processTextChanged()}else{this._processInternalValueChanging(date);this._editorInput.val(this._getDisplayValue())}}},_isNewPeriodLimited:function(name,value,delta,date){var isLimited=false;if(this.options.limitSpinToCurrentField){if(delta<0){if(value<0){isLimited=true}}else if(name==="Month"&&value===13||name==="Month"&&value===this._lastDayOfMonth(date.getFullYear()&&date.getMonth())+1||(name==="Hours"||name==="Minutes"||name==="Seconds")&&value===60||name==="Milliseconds"&&value===1e3){isLimited=true}}return isLimited},_spinDisplayMode:function(delta,userInteraction){var indices=this._dateIndices,periodName;if(indices.dd!==undefined){periodName="Date";delta=this._getDelta(delta,"day")}else if(indices.ff!==undefined){periodName="Milliseconds";delta=this._getDelta(delta,"milliseconds");if(indices.ffLength===2){delta=delta*10}else if(indices.ffLength===1){delta=delta*100}}else if(indices.ss!==undefined){periodName="Seconds";delta=this._getDelta(delta,"seconds")}else if(indices.mm!==undefined){periodName="Minutes";delta=this._getDelta(delta,"minutes")}else if(indices.hh!==undefined){periodName="Hours";delta=this._getDelta(delta,"hours")}else if(indices.MM!==undefined){periodName="Month";delta=this._getDelta(delta,"month")}else{periodName="FullYear";delta=this._getDelta(delta,"year")}this._setTimePeriod(periodName,delta,userInteraction)},_spin:function(delta,userInteraction){if(!delta){return}this._clearEditorNotifier();this._currentInputTextValue=this._editorInput.val();if(this._editMode){this._spinEditMode(delta,userInteraction)}else{this._spinDisplayMode(delta,userInteraction)}},_spinUpEditMode:function(delta){this._spinEditMode(delta?delta:this.options.spinDelta)},_spinDownEditMode:function(delta){this._spinEditMode(delta!==undefined?this._setNegativeDelta(delta):this._setNegativeDelta(this.options.spinDelta))},value:function(newValue){var parsedVal;if(newValue!==undefined){this._clearEditorNotifier();parsedVal=this._getDateObjectFromValue(newValue);if(newValue!==null&&this._isValidDate(parsedVal)){if(this.options.maxValue&&parsedVal>this.options.maxValue){newValue=this._getDateObjectFromValue(this.options.maxValue);this._sendNotification("warning",{optName:"maxValExceedSetErrMsg",arg:this._getDisplayValue(new Date(this.options.maxValue))})}else if(this.options.minValue&&parsedVal<this.options.minValue){newValue=this._getDateObjectFromValue(this.options.minValue);this._sendNotification("warning",{optName:"minValExceedSetErrMsg",arg:this._getDisplayValue(new Date(this.options.minValue))})}}if(this._validateValue(newValue)){this._updateValue(newValue);this._updateMaskedValue()}else{if(this.options.revertIfNotValid&&!(newValue===null&&this.options.allowNullValue)){newValue=this._valueInput.val();this._updateValue(newValue)}else{this._clearValue()}}this._editorInput.val(this._editMode?this._maskedValue:this._getDisplayValue());this._setSpinButtonsState(newValue)}else{if(this.options.value){return this._getValueByDataMode()}else{return this.options.value}}this._checkClearButtonState()},getSelectedDate:function(){return new Date(this._dateObjectValue.getTime())},selectDate:function(date){this._updateValue(date);this._exitEditMode()},spinUp:function(delta){delta=parseInt(delta,10);this._spin(!isNaN(delta)&&delta>=0?delta:this.options.spinDelta)},spinDown:function(delta){delta=parseInt(delta,10);this._spin(!isNaN(delta)&&delta>=0?this._setNegativeDelta(delta):this._setNegativeDelta(this.options.spinDelta))},spinUpButton:function(){return $.ui.igTextEditor.prototype.spinUpButton.call(this)},spinDownButton:function(){return $.ui.igTextEditor.prototype.spinDownButton.call(this)},isValid:function(){var value,valid;value=this.field().val();this._skipMessages=true;if(this._editMode){if(value===this._maskWithPrompts){valid=false}else{valid=this._validateValue(this._parseDateFromMaskedValue(value))}}else{valid=this._validateValue(this._dateObjectValue);if(value!==""&&!valid){valid=false;this._sendNotification("warning",{optName:"dateMessage"})}}this._skipMessages=false;return valid},dropDownButton:function(){throw new Error(this._getLocaleValue("datePickerNoSuchMethodDropDownContainer"))},dropDownContainer:function(){throw new Error(this._getLocaleValue("datePickerNoSuchMethodDropDownContainer"))},dropDownVisible:function(){throw new Error(this._getLocaleValue("datePickerNoSuchMethodDropDownContainer"))},findListItemIndex:function(){throw new Error(this._getLocaleValue("datePickerEditorNoSuchMethod"))},getSelectedListItem:function(){throw new Error(this._getLocaleValue("datePickerEditorNoSuchMethod"))},selectedListIndex:function(){throw new Error(this._getLocaleValue("datePickerEditorNoSuchMethod"))}});$.extend($.ui.igDateEditor,{version:"21.2.12"});$.widget("ui.igDatePicker",$.ui.igDateEditor,{options:{buttonType:"dropdown",datepickerOptions:null,dropDownOnReadOnly:false,dropDownAttachedToBody:false,isLimitedToListValues:false,listItemHoverDuration:0,listItems:null,listWidth:0,suppressKeyboard:false},events:{dropDownListOpening:"dropDownListOpening",dropDownListOpened:"dropDownListOpened",dropDownListClosing:"dropDownListClosing",dropDownItemSelecting:"dropDownItemSelecting",dropDownListClosed:"dropDownListClosed",dropDownItemSelected:"dropDownItemSelected",itemSelected:"itemSelected"},_setDropDownListWidth:function(){},_listMouseDownHandler:function(){},_updateDropdownSelection:function(){var pickerInst,cursorPosition,parsedDate,val=this._editorInput.val();if(this._pickerOpen&&this._validateRequiredPrompts(val)){cursorPosition=this._getCursorPosition();pickerInst=$.data(this._editorInput[0],"datepicker");parsedDate=this._parseDateFromMaskedValue(val);if(this.options.displayTimeOffset!==null){parsedDate=this._getDateOffset(parsedDate)}this._editorInput.datepicker("setDate",parsedDate);this._editorInput.val(val);if(pickerInst){pickerInst.lastVal=val}this._setCursorPosition(cursorPosition)}},_disableEditor:function(applyDisabledClass){if(this.options.dropDownOnReadOnly){if(applyDisabledClass){this._editorInput.addClass(this.css.disabled)}this._detachEvents()}else{if(applyDisabledClass){this._editorContainer.addClass(this.css.disabled)}this._detachEvents()}if(this._dropDownButton&&!this.options.dropDownOnReadOnly){this._dropDownButton.addClass(this.css.disabled);this._detachButtonsEvents(this._dropDownButton)}if(this._clearButton){this._clearButton.addClass(this.css.disabled);this._detachButtonsEvents(this._clearButton)}if(this._spinUpButton){this._spinUpButton.addClass(this.css.disabled);this._detachButtonsEvents(this._spinUpButton)}if(this._spinDownButton){
this._spinDownButton.addClass(this.css.disabled);this._detachButtonsEvents(this._spinDownButton)}},_setFocus:function(event){if(this._shouldNotFocusInput){event.target.blur();delete this._shouldNotFocusInput;event.preventDefault();return}this._super(event)},_setBlur:function(event){if(this._pickerOpen){return}else{this._super(event)}},_pickerDefaults:function(){var self=this,pickerDefaults;pickerDefaults={showOn:"",duration:self.options.dropDownAnimationDuration?self.options.dropDownAnimationDuration:"normal",onSelect:function(dateText,inst){var date,dateFromPicker=$(this).datepicker("getDate");if(self._dateObjectValue){if(self.options.displayTimeOffset!==null){date=self._getDateOffset(self._dateObjectValue)}else{date=new Date(self._dateObjectValue)}}else{date=self._setNewDateMidnight()}self._setDateField("FullYear",date,dateFromPicker.getFullYear());self._setDateField("Date",date,15);self._setDateField("Month",date,dateFromPicker.getMonth());self._setDateField("Date",date,dateFromPicker.getDate());if(self.options.displayTimeOffset!==null){self._clearDateOffset(date)}self._processValueChanging(date);inst.lastVal=self._getEditModeValue();self._editorInput.val(inst.lastVal);self._triggerItemSelected.call(self,inst.dpDiv.find(".ui-datepicker-calendar>tbody>tr>td .ui-state-hover"),dateFromPicker);self._processTextChanged();if(self.options.readOnly===true||self.options.disabled===true){self._exitEditMode()}else{self._focused=false;if(!self.options.suppressKeyboard){self._editorInput.focus()}}},beforeShow:function(){self._pickerOpen=true},onClose:function(){delete self._pickerOpen;if(!self._editorInput.is(document.activeElement)){self._editorInput.blur()}self._triggerDropDownClosed()}};return pickerDefaults},_renderList:function(){var self=this,options,regional;regional=$.extend({},self._dpRegion(),self.options.datepickerOptions)||{};options=$.extend(regional,this._pickerDefaults());if(regional.onSelect){var igOnSelect=regional.onSelect;options.onSelect=function(dateText,inst){igOnSelect.call(this,dateText,inst);if(self.options.datepickerOptions&&self.options.datepickerOptions.onSelect){self.options.datepickerOptions.onSelect.call(this,dateText,inst)}}}if(regional.onClose){var igOnClose=regional.onClose;options.onClose=function(dateText,inst){igOnClose.call(this);if(self.options.datepickerOptions&&self.options.datepickerOptions.onClose){self.options.datepickerOptions.onClose.call(this,dateText,inst)}}}if(self.options.datepickerOptions&&self.options.datepickerOptions.beforeShow){var isBeforeShow=regional.beforeShow;options.beforeShow=function(input){isBeforeShow.call(this);if(self.options.datepickerOptions&&self.options.datepickerOptions.beforeShow){self.options.datepickerOptions.beforeShow.call(this,input)}}}if(self.options.datepickerOptions&&self.options.datepickerOptions.onChangeMonthYear){var isOnChangeMonthYear=regional.onChangeMonthYear;options.onChangeMonthYear=function(year,month,date){isOnChangeMonthYear.call(this,year,month,date);if(self.options.suppressKeyboard){self._shouldNotFocusInput=true}}}else{options.onChangeMonthYear=function(){if(self.options.suppressKeyboard){self._shouldNotFocusInput=true}}}this._editorInput.datepicker(options);this._dropDownList=this._editorInput.datepicker("widget")},_renderDropDownButton:function(){var dropDownButton=$("<div></div>"),dropDownIcon=$("<div></div>");dropDownButton.addClass(this.css.buttonCommon).attr({title:this._getLocaleValue("datePickerButtonTitle"),role:"button",tabindex:-1,id:this.id+"_calendarButton","data-localeid":"datePickerButtonTitle","data-localeattr":"title"});this._editorContainer.prepend(dropDownButton.addClass(this.css.dropDownButton).append(dropDownIcon.addClass(this.css.dropDownImage)));this._dropDownButton=dropDownButton;this._attachButtonsEvents("dropdown",dropDownButton)},_dpRegion:function(){var reg=this.options.regional,lastRegional,regional=null,abbreviation="";if($.datepicker&&typeof reg==="string"){if(reg==="defaults"){if(typeof $.ig.util.regional==="string"&&$.ig.util.regional){abbreviation=$.ig.util.regional}}else{abbreviation=reg}regional=$.datepicker.regional[abbreviation]||$.datepicker.regional[""]}if(regional===null&&$.datepicker){for(lastRegional in $.datepicker.regional){}if($.datepicker.regional[lastRegional]){regional=$.datepicker.regional[lastRegional]}}return regional},_create:function(){$.ui.igDateEditor.prototype._create.call(this)},_initialize:function(){this._super();this.options.listItems=["datePicker"]},_applyOptions:function(){this._super();if(!this.options.minValue&&this.options.datepickerOptions&&this.options.datepickerOptions.minDate){if(this._isValidDate(this.options.datepickerOptions.minDate)){this.options.minValue=this.options.datepickerOptions.minDate;if(this.options.displayTimeOffset!==null){this._editorInput.datepicker("option","minDate",this._getDateOffset(this._getDateObjectFromValue(this.options.datepickerOptions.minDate)));this._editorInput.val(this._getDisplayValue())}}}if(!this.options.maxValue&&this.options.datepickerOptions&&this.options.datepickerOptions.maxDate){if(this._isValidDate(this.options.datepickerOptions.minDate)){this.options.maxValue=this.options.datepickerOptions.maxDate;if(this.options.displayTimeOffset!==null){this._editorInput.datepicker("option","maxDate",this._getDateOffset(this._getDateObjectFromValue(this.options.datepickerOptions.maxDate)));this._editorInput.val(this._getDisplayValue())}}}},_positionDropDownList:function(){},_setOption:function(option,value){var prevValue=this.options[option];if(prevValue===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"datepickerOptions":var pickerOptions=this._editorInput.data("datepicker").settings,settings,self=this,options;settings=$.extend(value,this._pickerDefaults());options=$.extend(pickerOptions,settings);if(settings.onSelect){var igOnSelect=settings.onSelect;options.onSelect=function(dateText,inst){igOnSelect.call(this,dateText,inst);if(self.options.datepickerOptions&&self.options.datepickerOptions.onSelect){self.options.datepickerOptions.onSelect.call(this,dateText,inst)}}}if(settings.onClose){var igOnClose=settings.onClose;pickerOptions.onClose=function(dateText,inst){igOnClose.call(this);if(self.options.datepickerOptions&&self.options.datepickerOptions.onClose){self.options.datepickerOptions.onClose.call(this,dateText,inst)}}}this._editorInput.data("datepicker").settings=pickerOptions;if(value.minDate&&this._editorInput.data("datepicker").settings.minDate!==this.options.minValue){this._setOption("minValue",this._editorInput.data("datepicker").settings.minDate)}if(value.maxDate&&this._editorInput.data("datepicker").settings.maxDate!==this.options.maxValue){this._setOption("maxValue",this._editorInput.data("datepicker").settings.maxDate)}break;case"minValue":case"maxValue":this.options[option]=prevValue;this._super(option,value);this._editorInput.datepicker("option","minDate",this.options.minValue);this._editorInput.datepicker("option","maxDate",this.options.maxValue);this._editorInput.val(this._currentInputTextValue);break;default:this.options[option]=prevValue;this._super(option,value);break}},_triggerKeyDown:function(event){if(event.keyCode===38&&!event.altKey){if(!event.ctrlKey){this._spinUpEditMode();event.preventDefault()}}else if(event.keyCode===40&&!event.altKey){if(!event.ctrlKey){this._spinDownEditMode();event.preventDefault()}}else{this._super(event)}},_triggerDropDownOpened:function(){var args={owner:this,editorInput:this._editorInput,calendar:this._dropDownList};this._trigger(this.events.dropDownListOpened,null,args)},_triggerDropDownOpening:function(){var args={owner:this,editorInput:this._editorInput,calendar:this._dropDownList};return this._trigger(this.events.dropDownListOpening,null,args)},_triggerDropDownClosed:function(){var args={owner:this,editorInput:this._editorInput,calendar:this._dropDownList};this._trigger(this.events.dropDownListClosed,null,args)},_toggleDropDown:function(){var noCancel;if(this._dropDownList.is(":visible")&&(!!this._focused||this.options.readOnly)&&!!this._dropDownOpened){this._hideDropDownList()}else{noCancel=this._triggerDropDownOpening();if(noCancel){this._showDropDownList()}}},_triggerItemSelected:function(htmlItem,dateFromPicker){var args={owner:this,dateFromPicker:dateFromPicker,item:htmlItem,calendar:this._dropDownList};this._trigger(this.events.itemSelected,null,args)},_showDropDownList:function(){this._dropDownOpened=true;var self=this,direction,currentDate=this._dateObjectValue,currentInputValue,pickerInst;this._cancelBlurDatePickerOpen=true;this._positionDropDownList();if(this.options.dropDownOrientation==="top"){direction="up"}else{direction="down"}if(this._editMode&&this._editorInput.val()!==this._maskWithPrompts){currentDate=this._parseDateFromMaskedValue(this._editorInput.val())}if(currentDate){if(this.options.displayTimeOffset!==null){currentDate=this._getDateOffset(currentDate)}if(!this._editMode){this._enterEditMode()}currentInputValue=this._editorInput.val();$(this._editorInput).datepicker("setDate",currentDate)}if(currentInputValue===undefined){currentInputValue=this._editorInput.val()}pickerInst=$.data(this._editorInput[0],"datepicker");try{if(this.options.suppressKeyboard){if(this._focused){this._editorInput.blur()}this._shouldNotFocusInput=true}this._editorInput.datepicker("option","showOptions",{direction:direction});this._editorInput.datepicker("show");if(currentInputValue){this._editorInput.val(currentInputValue);if(pickerInst){pickerInst.lastVal=currentInputValue}}}catch(ex){this._editorInput.datepicker("show");if(currentInputValue){this._editorInput.val(currentInputValue)}}this._dropDownList.promise().done(function(){self._triggerDropDownOpened()})},_hideDropDownList:function(){this._dropDownOpened=false;this._editorInput.datepicker("hide");this._editorInput.attr("aria-expanded",false)},_deleteList:function(){this._detachListEvents();delete this._dropDownList},changeRegional:function(){var regional,opts=this.options.datepickerOptions;regional=$.extend({},this._dpRegion());if(opts&&typeof opts==="object"){for(var key in regional){if(regional.hasOwnProperty(key)){regional[key]=opts[key]||regional[key]}}}this._editorInput.datepicker("option",regional);this._super()},getCalendar:function(){return $.ui.igTextEditor.prototype.dropDownContainer.call(this)},dropDownContainer:function(){throw new Error(this._getLocaleValue("datePickerNoSuchMethodDropDownContainer"))},findListItemIndex:function(){throw new Error(this._getLocaleValue("datePickerEditorNoSuchMethod"))},getSelectedListItem:function(){throw new Error(this._getLocaleValue("datePickerEditorNoSuchMethod"))},selectedListIndex:function(){throw new Error(this._getLocaleValue("datePickerEditorNoSuchMethod"))},showDropDown:function(){$.ui.igTextEditor.prototype.showDropDown.call(this)},hideDropDown:function(){$.ui.igTextEditor.prototype.hideDropDown.call(this)},dropDownButton:function(){return $.ui.igTextEditor.prototype.dropDownButton.call(this)},dropDownVisible:function(){return $.ui.igTextEditor.prototype.dropDownVisible.call(this)},destroy:function(){if(this._editorInput){this._editorInput.datepicker("hide");this._editorInput.datepicker("destroy")}this._superApply(arguments);return this}});$.extend($.ui.igDatePicker,{version:"21.2.12"});$.widget("ui.igCheckboxEditor",$.ui.igBaseEditor,{options:{checked:false,size:"normal",iconClass:"ui-icon-check",tabIndex:0,readOnly:false,allowNullValue:false,nullValue:null},css:{container:"ui-state-default ui-corner-all ui-widget ui-checkbox-container ui-igcheckbox-normal",containerChecked:"ui-state-checkbox-checked",checkboxIcon:"ui-icon",iconCentered:"ui-icon-custom",checked:"ui-igcheckbox-normal-on",unchecked:"ui-igcheckbox-normal-off",checkboxInput:"ui-helper-hidden"},events:{valueChanging:"valueChanging",valueChanged:"valueChanged"},_triggerKeyUp:function(event){var args={originalEvent:event,owner:this,key:event.keyCode,element:event.target,editorInput:this._editorInput};this._trigger(this.events.keyup,event,args)},_triggerKeyPress:function(event){var args={originalEvent:event,owner:this,key:event.keyCode,element:event.target,editorInput:this._editorInput};this._trigger(this.events.keypress,event,args)},_triggerKeyDown:function(event){var args={originalEvent:event,owner:this,key:event.keyCode,element:event.target,editorInput:this._editorInput};this._trigger(this.events.keydown,event,args)},_create:function(){this._checkedClass=this.css.checked;this._uncheckedClass=this.css.unchecked;$.ui.igBaseEditor.prototype._create.call(this)},_render:function(){this._triggerRendering();if(this.element.is("div")){this._editorContainer=this.element;this._editorInput=$("<span></span>");this._valueInput=$("<input type='checkbox'></input>");this._editorContainer.prepend(this._editorInput);this._editorInput.after(this._valueInput)}else if(this.element.is("input")){this._valueInput=this.element;this._editorInput=$("<span></span>");this._editorContainer=this.element.wrap($("<div></div>")).parent();this._valueInput.before(this._editorInput)}else if(this.element.is("span")){this._editorInput=this.element;this._valueInput=$("<input type='checkbox'></input>");this._editorContainer=this.element.wrap($("<div></div>")).parent();this._editorInput.after(this._valueInput)}else{throw new Error(this._getLocaleValue("instantiateCheckBoxErrMsg"))}this._editorContainer.addClass(this.css.container).attr("role","checkbox");this._editorInput.addClass(this.css.checkboxIcon).addClass(this.options.iconClass).addClass(this.css.checked);this._valueInput.addClass(this.css.checkboxInput).attr("aria-hidden","true");if(!$.ig.util.isIE8&&this._valueInput.attr("type")!=="checkbox"){this._valueInput.attr("type","checkbox")}this._attachEvents();this._applyOptions();this._applyAria();this._triggerRendered()},_applyAria:function(){var ariaLabeledBy=this.element.attr("aria-labelledby");if(ariaLabeledBy){this.element.removeAttr("aria-labelledby");this._editorContainer.attr("aria-labelledby",ariaLabeledBy)}},_applyOptions:function(){var checked=this.options.checked;this._super();if(checked){this._initialState()}else{this.options.checked=false}if(this.options.value){this._inputValue=this.options.value;this.value(this.options.value)}this._size(this.options.size);this._setWidth(this.options.width);this._setHeight(this.options.height);this._updateState(checked&&checked!=="false"?true:false)},_setOption:function(option,value){var iconClass=this.options.iconClass;this._super(option,value);switch(option){case"checked":this._updateState(value&&value!=="false"?true:false);break;case"value":this._inputValue=value;this._updateState(this.options.checked);break;case"size":this._size(value);break;case"iconClass":this._setIconClass(iconClass,value);break;default:break}},_readAttributes:function(){var checked=this.element.attr("checked");this._super(this.element);if(checked){this.element.removeAttr("checked");this.options.checked=true}},_attachEvents:function(){var self=this;this._super();this._editorContainer.on({"click.editor":function(event){var internalChecked=self._inputValue!==undefined?self.options.checked:true;if(self._valueInput[0].checked!==internalChecked){self._valueInput[0].checked=internalChecked;this.focus()}self._toggleInternal(event)},"mousedown.editor":function(event){this.focus();event.preventDefault();return false},"focus.editor":function(event){self._setFocus(event,self._cancelFocusTrigger)},"blur.editor":function(event){self._setBlur(event)},"keyup.editor":function(event){var keyCode=event.keyCode||event.which||0;self._triggerKeyUp(event);if(keyCode===32){self._toggleInternal(event);event.preventDefault()}},"keydown.editor":function(event){self._triggerKeyDown(event)},"keypress.editor":function(event){var keyCode=event.keyCode||event.which||0;self._triggerKeyPress(event);if(keyCode===32){event.preventDefault()}}})},_triggerValueChanging:function(event,newState,newValue){var args={owner:this,element:event.target,editorInput:this._editorInput,oldState:this.options.checked,newState:newState,oldValue:this.value(),newValue:newValue};return this._trigger(this.events.valueChanging,event,args)},_triggerValueChanged:function(event){var args={owner:this,element:event.target,editorInput:this._editorInput,newState:this.options.checked,newValue:this.value()};this._trigger(this.events.valueChanged,event,args);this._trigger(this.options.checked?this.events.checked:this.events.unchecked,event,args)},_triggerFocus:function(event){var args={originalEvent:event,owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.focus,event,args)},_triggerBlur:function(event){var args={owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.blur,event,args)},_getState:function(){var state;if(this._inputValue!==undefined){state=this._valueInput[0].checked}else{var value=this._tryParseBool(this._valueInput[0].value);if(value.ret){state=value.p1}else{throw new Error(this._getLocaleValue("cannotParseNonBoolValue"))}}return state},_tryParseBool:function(value){if(typeof value==="boolean"){return{ret:true,p1:value}}else if(typeof value==="string"){return $.ig.Boolean.prototype.tryParse(value)}},_toggleInternal:function(event){var noCancel,newState,newVal;newState=!this._getState();newVal=this.value();if(this._inputValue===undefined){newVal=newState}noCancel=this._triggerValueChanging(event,newState,newVal);if(noCancel){this._updateState(newState);this._triggerValueChanged(event);if(this._validator){this._validator._validateInternal(this.element,event)}}},_initialState:function(){this._valueInput.attr("checked","checked")},_updateState:function(value){this.options.checked=value;this._editorContainer.attr("aria-checked",value);if(value){this._editorInput.removeClass(this._uncheckedClass);this._editorContainer.addClass(this.css.containerChecked)}else{this._editorInput.addClass(this._uncheckedClass);this._editorContainer.removeClass(this.css.containerChecked)}if(this._inputValue!==undefined){this._valueInput[0].checked=value;this._valueInput[0].value=this._inputValue}else{this._valueInput[0].checked=true;this._valueInput[0].value=value}},_removeDOM:function(){if(this.element.is("div")){this.element.empty()}else if(this.element.is("input")&&this._editorInput){this._editorInput.remove();this.element.unwrap()}else if(this.element.is("span")&&this._valueInput){this._valueInput.remove();this.element.unwrap()}},_detachEvents:function(){if(this._editorContainer){this._editorContainer.off("click.editor mousedown.editor focus.editor blur.editor keydown.editor")}this._super()},_clearStyling:function(){if(this._editorContainer){this._editorContainer.removeClass(this.css.checkboxContainer).removeClass(this.css.containerChecked).removeAttr("role")}if(this._editorInput){this._editorInput.removeClass(this._checkedClass).removeClass(this._uncheckedClass).removeClass(this.css.checkboxIcon).removeClass(this.options.iconClass)}if(this._valueInput){this._valueInput.removeClass(this.css.checkboxInput).removeAttr("aria-hidden")}this._super()},_deleteInternalProperties:function(){delete this._checkedClass;delete this._uncheckedClass;this._super()},_size:function(size){if(size){this._editorContainer.removeClass("ui-igcheckbox-verysmall ui-igcheckbox-small").removeClass("ui-igcheckbox-normal ui-igcheckbox-large");this._editorContainer.addClass("ui-igcheckbox-"+size);this._editorInput.removeClass(this._checkedClass).removeClass(this._uncheckedClass);this._checkedClass="ui-igcheckbox-"+size+"-on";this._uncheckedClass="ui-igcheckbox-"+size+"-off";this._editorInput.addClass(this._checkedClass)}},_setTabIndex:function(index){this._editorContainer.attr("tabIndex",index)},_setWidth:function(width){this._super(width);if(width){this._editorInput.addClass(this.css.iconCentered)}},_setHeight:function(height){this._super(height);if(height){this._editorInput.addClass(this.css.iconCentered)}},_setIconClass:function(oldIconClass,iconClass){this._editorInput.removeClass(oldIconClass).addClass(iconClass)},_setFocus:function(event,triggerEvent){this._editorContainer.addClass(this.css.focus);if(event&&!triggerEvent){this._triggerFocus(event)}else{delete this._cancelFocusTrigger}},_setFocusDelay:function(delay){var self=this;if(delay){this._timeouts.push(setTimeout(function(){self._cancelFocusTrigger=true;self._editorContainer.focus();self._setFocus()},delay))}else{this._cancelFocusTrigger=true;this._editorContainer.focus();this._setFocus()}},_setBlur:function(event){this._editorContainer.removeClass(this.css.focus);this._triggerBlur(event);if(this._validator){this._validator._validateInternal(this.element,event,true)}},isValid:function(){return true},value:function(newValue){if(newValue!==undefined){if(this._inputValue===undefined){var result=this._tryParseBool(newValue);if(result&&result.ret){this._updateState(result.p1)}else{throw new Error(this._getLocaleValue("cannotSetNonBoolValue"))}}else{this.options.value=newValue;this._inputValue=newValue;this._updateState(this._getState())}}else{if(this._inputValue===undefined){return this._getState()}return this.options.value}},toggle:function(){if(this._getState()){this._updateState(false)}else{this._updateState(true)}}});$.extend($.ui.igCheckboxEditor,{version:"21.2.12"});$.widget("ui.igTimePicker",$.ui.igDateEditor,{options:{itemsDelta:{hours:0,minutes:30},spinDelta:{hours:1,minutes:30},timeInputFormat:"time",timeDisplayFormat:null,isLimitedToListValues:false,suppressKeyboard:false,dropDownOrientation:"auto",visibleItemsCount:5,listWidth:0,listItemHoverDuration:0,dropDownAttachedToBody:false,dropDownAnimationDuration:300,buttonType:"dropdown",spinWrapAround:true,dateDisplayFormat:null,dateInputFormat:null,yearShift:null,displayTimeOffset:null},events:{dropDownListOpening:"dropDownListOpening",dropDownListOpened:"dropDownListOpened",dropDownListClosing:"dropDownListClosing",dropDownListClosed:"dropDownListClosed",dropDownItemSelecting:"dropDownItemSelecting",dropDownItemSelected:"dropDownItemSelected"},_initialize:function(){if(this.options.timeDisplayFormat){this.options.dateDisplayFormat=this._parseTimeMask(this.options.timeDisplayFormat)}this.options.dateInputFormat=this._parseTimeMask(this.options.timeInputFormat);this._super();if(this.options.minValue){this.options.minValue=this._parseDateFromMaskedValue(this.options.minValue)}if(this.options.maxValue){this.options.maxValue=this._parseDateFromMaskedValue(this.options.maxValue)}var buttons=this.options.buttonType.toString().split(/[\s,]+/);if($.inArray("dropdown",buttons)!==-1&&$.inArray("spin",buttons)===-1){this._populateDropDown(this.options.minValue,this.options.maxValue)}},getSelectedListItem:function(){return $.ui.igTextEditor.prototype.getSelectedListItem.call(this)},dropDownVisible:function(){return $.ui.igTextEditor.prototype.dropDownVisible.call(this)},dropDownButton:function(){return $.ui.igTextEditor.prototype.dropDownButton.call(this)},dropDownContainer:function(){return $.ui.igTextEditor.prototype.dropDownContainer.call(this)},findListItemIndex:function(text,matchType){return $.ui.igTextEditor.prototype.findListItemIndex.call(this,text,matchType)},selectedListIndex:function(index){return $.ui.igTextEditor.prototype.selectedListIndex.call(this,index)},_getEditModeValue:function(val){if($.type(val)==="date"){return this._updateMaskedValue(val,true)}else{return this._super()}},_populateDropDown:function(minValue,maxValue){if(minValue){minValue=minValue.getHours()*60+minValue.getMinutes()}else{minValue=0}if(maxValue){maxValue=maxValue.getHours()*60+maxValue.getMinutes()}else{maxValue=1440}var timeDeltaMinutes=this.options.itemsDelta.hours*60+this.options.itemsDelta.minutes;var startMinutes=minValue/timeDeltaMinutes;var dropDownItemsCount=0;if(timeDeltaMinutes>0&&timeDeltaMinutes<=1440){dropDownItemsCount=1440/timeDeltaMinutes}var initDate=new Date;initDate.setHours(0);initDate.setMinutes(0);initDate.setSeconds(0);this.options.listItems=[];this.options.timeItems=[];for(var i=startMinutes;i<dropDownItemsCount;i++){var date=new Date(initDate);date.setMinutes(timeDeltaMinutes*i);if(timeDeltaMinutes*i>=minValue&&timeDeltaMinutes*i<=maxValue){this.options.listItems.push(date);this.options.timeItems.push(date.toTimeString())}}},_parseTimeMask:function(mask){return mask.replace(/M/g,"\\M").replace(/d/g,"\\d").replace(/y/g,"\\y").replace(/s/g,"\\s").replace(/f/g,"\\f")},_validateValue:function(val){if(this._super(val)){return $.ui.igTextEditor.prototype._validateValue.call(this,val)}else{return false}},_setOption:function(option,value){var prevValue=this.options[option];if(prevValue===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"timeDisplayFormat":this._super("dateDisplayFormat",this._parseTimeMask(value));break;case"timeInputFormat":case"itemsDelta":case"minValue":case"maxValue":this.options[option]=prevValue;throw new Error(this._getLocaleValue("setOptionError")+option);default:this.options[option]=prevValue;this._super(option,value);break}},value:function(newValue){if(newValue===undefined||$.type(newValue)==="date"){return this._super(newValue)}else{return this._super(this._parseDateFromMaskedValue(newValue))}},_updateValue:function(value){this._super(value);if(this._dropDownList!==undefined){this._updateDropdownSelection(value)}},_updateDropdownSelection:function(currentVal){if($.type(currentVal)==="date"){this._super(currentVal)}else{if(this.options.dataMode==="displayModeText"){currentVal=this._parseValueByMask(currentVal)}this._super(this._parseDateFromMaskedValue(currentVal))}},_valueIndexInList:function(val){if(!val&&val!==0){return-1}return $.inArray(val.toTimeString(),this.options.timeItems)},_setBlur:function(event){this._super(event);if(this._dropDownList&&this._dropDownList.is(":visible")&&this._triggerDropDownClosing()){this._hideDropDownList()}},_applyOptions:function(){if($.type(this.options.value)!=="date"&&this.options.value!==null){var convertedValue=this._getDateObjectFromValue(this.options.value);if(!isNaN(convertedValue)){this.options.value=convertedValue}else{this.options.value=this._parseDateFromMaskedValue(this.options.value)}}this._super()},_triggerKeyDown:function(event){if(this._dropDownList){$.ui.igNumericEditor.prototype._triggerKeyDown.call(this,event)}else{this._super(event)}},_spin:function(type,fireEvent){if(this.options.isLimitedToListValues&&this._dropDownList){$.ui.igNumericEditor.prototype._spin.call(this,type,fireEvent)}else{this._super(type,fireEvent)}},_handleSpinUpEvent:function(){if(this.options.isLimitedToListValues&&this._dropDownList){$.ui.igNumericEditor.prototype._handleSpinUpEvent.call(this)}else{this._super()}},_handleSpinDownEvent:function(){if(this.options.isLimitedToListValues&&this._dropDownList){$.ui.igNumericEditor.prototype._handleSpinDownEvent.call(this)}else{this._super()}},selectDate:function(){throw new Error(this._getLocaleValue("timePickerNoSuchMethod"))}});$.extend($.ui.igTimePicker,{version:"21.2.12"});return $});