!function(p){p.jqx.jqxWidget("jqxFormattedInput","",{}),p.extend(p.jqx._jqxFormattedInput.prototype,{defineInstance:function(){var t={width:null,height:null,radix:10,decimalNotation:"default",value:"0",min:"-9223372036854775808",max:"9223372036854775807",upperCase:!1,spinButtons:!0,spinButtonsStep:1,dropDown:!1,dropDownWidth:null,popupZIndex:2e4,placeHolder:"",roundedCorners:!0,disabled:!1,rtl:!1,changeType:null,template:"",hint:!0,_opened:!1,$popup:p("
"),item:'',events:["open","close","change","radixChange"]};return this===p.jqx._jqxFormattedInput.prototype||p.extend(!0,this,t),t},createInstance:function(){var t=this;t._Long(),t._regex={2:new RegExp(/([0-1])/),8:new RegExp(/([0-7])/),10:new RegExp(/([0-9\-])/),16:new RegExp(/([0-9]|[a-f])/i)},t.render()},render:function(){var t,o=this;if(o._radixNumber=o._getRadix(o.radix),""!==o.value&&(o._number=new o.longObj.math.Long.fromString(o.value.toString(),o._radixNumber)),this.element instanceof HTMLInputElement&&((t=p("")).addClass(o.toThemeProperty("jqx-input-group")),this.host.after(t),n=this.element,e=this.host.data(),t.append(n),t[0].id=this.element.id,this.element.removeAttribute("id"),this.element.setAttribute("hint",!0),t[0].style=this.element.style,o.input=o.element,this.input instanceof HTMLInputElement||(this.input=this.host.find("input"),0'),o._arrow.appendTo(o._addon)),o.template&&o._addon.addClass(o.toThemeProperty("jqx-"+o.template))},!(o.appendSpinButtons=function(t){o._spinButtonsContainer=p(t),o._spinButtonsContainer.addClass(o.toThemeProperty("jqx-formatted-input-spin-buttons-container"));t='';o._upbutton=p(t),o._spinButtonsContainer.append(o._upbutton),o._downbutton=p(t),o._spinButtonsContainer.append(o._downbutton),o._upArrow=o._upbutton.find("div"),o._upArrow.addClass(o.toThemeProperty("jqx-icon-arrow-up")),o._downArrow=o._downbutton.find("div"),o._downArrow.addClass(o.toThemeProperty("jqx-icon-arrow-down")),o.template&&(o._upbutton.addClass(o.toThemeProperty("jqx-"+o.template)),o._downbutton.addClass(o.toThemeProperty("jqx-"+o.template))),o._spinButtonsStepLong=new o.longObj.math.Long.fromNumber(o.spinButtonsStep)})===o.rtl?o._spinButtonsContainer||!0!==o.spinButtons?o._addon||!0!==o.dropDown||2!==t&&(1!==t||!1!==o.spinButtons)||e(this):o.appendSpinButtons(this):o._addon||!0!==o.dropDown?o._spinButtonsContainer||!0!==o.spinButtons||1!==t&&(0!==t||!1!==o.dropDown)||(o.appendSpinButtons(this),o._spinButtonsContainer.addClass(o.toThemeProperty("jqx-formatted-input-spin-buttons-container-rtl")),!0===o.dropDown&&o._addon.addClass(o.toThemeProperty("jqx-formatted-input-addon-rtl"))):(e(this),!0===o.spinButtons&&o._addon.addClass(o.toThemeProperty("jqx-formatted-input-addon-rtl"))))}))}o._inputAndAddon=o.host,o.baseHost&&(o._spinButtonsContainer&&(o._inputAndAddon=o._inputAndAddon.add(o._spinButtonsContainer)),o._addon&&(o._inputAndAddon=o._inputAndAddon.add(o._addon))),o.removeHandlers(),this.addHandlers(),this.rtl&&this.host.addClass(this.toThemeProperty("jqx-rtl")),this.host.attr("role","textbox"),p.jqx.aria(this,"aria-autocomplete","both"),p.jqx.aria(this,"aria-disabled",this.disabled),p.jqx.aria(this,"aria-readonly",!1),p.jqx.aria(this,"aria-multiline",!1),p.jqx.aria(this,"aria-haspopup",!0),""!==o.value&&null!==o.value?(!0===o.upperCase?o.host.addClass(o.toThemeProperty("jqx-formatted-input-upper-case")):o.host.addClass(o.toThemeProperty("jqx-formatted-input-lower-case")),10===o._radixNumber&&"exponential"===o.decimalNotation?o.element.value=o._getDecimalNotation("exponential"):o.element.value=o.value):o._spinButtonsContainer&&o._spinButtonsContainer.addClass(o.toThemeProperty("jqx-fill-state-disabled")),10!==o._radixNumber&&"-9223372036854775808"===o.min.toString()?o._minLong=new o.longObj.math.Long.fromNumber(o.min):o._setMinMax("min"),10!==o._radixNumber&&"9223372036854775807"===o.max.toString()?o._maxLong=new o.longObj.math.Long.fromNumber(o.max):o._setMinMax("max"),this._addBarAndLabel(this.baseHost&&p(this.baseHost.children()[this.baseHost.children.length-1])||this.host),o.isMaterialized()&&setTimeout(function(){return o.hint&&(o.label[0].innerHTML=o.placeHolder),o.baseHost?void(0===o.element.value.length?o.baseHost[0].removeAttribute("hint"):o.baseHost[0].setAttribute("hint",!0)):(0===o.element.value.length?o.element.removeAttribute("hint"):o.element.setAttribute("hint",!0),void o.bar.css("top",""))})},_refreshClasses:function(t){t=t?"addClass":"removeClass";this.host[t](this.toThemeProperty("jqx-widget-content")),this.host[t](this.toThemeProperty("jqx-input")),this.host[t](this.toThemeProperty("jqx-formatted-input")),this.host[t](this.toThemeProperty("jqx-widget")),this.$popup[t](this.toThemeProperty("jqx-popup")),p.jqx.browser.msie&&this.$popup[t](this.toThemeProperty("jqx-noshadow")),this.$popup[t](this.toThemeProperty("jqx-input-popup")),this.$popup[t](this.toThemeProperty("jqx-menu")),this.$popup[t](this.toThemeProperty("jqx-menu-vertical")),this.$popup[t](this.toThemeProperty("jqx-menu-dropdown")),this.$popup[t](this.toThemeProperty("jqx-widget")),this.$popup[t](this.toThemeProperty("jqx-widget-content")),this.roundedCorners?(this.host[t](this.toThemeProperty("jqx-rc-all")),this.$popup[t](this.toThemeProperty("jqx-rc-all")),this.baseHost&&(this.baseHost[t](this.toThemeProperty("jqx-rc-all")),!1===this.rtl?(this.host[t](this.toThemeProperty("jqx-rc-l")),this._addon&&this._addon[t](this.toThemeProperty("jqx-rc-r"))):(this.host[t](this.toThemeProperty("jqx-rc-r")),this._addon&&this._addon[t](this.toThemeProperty("jqx-rc-l"))))):(this.host.removeClass(this.toThemeProperty("jqx-rc-all")),this.$popup.removeClass(this.toThemeProperty("jqx-rc-all")),this.baseHost&&(this.baseHost.removeClass(this.toThemeProperty("jqx-rc-all")),!1===this.rtl?(this.host.removeClass(this.toThemeProperty("jqx-rc-l")),this.dropDown?this._addon.removeClass(this.toThemeProperty("jqx-rc-r")):this.spinButtons&&this._spinButtonsContainer.removeClass(this.toThemeProperty("jqx-rc-r"))):(this.host.removeClass(this.toThemeProperty("jqx-rc-r")),this.dropDown?this._addon.removeClass(this.toThemeProperty("jqx-rc-l")):this.spinButtons&&this._spinButtonsContainer.removeClass(this.toThemeProperty("jqx-rc-l"))))),this.disabled?(this.host[t](this.toThemeProperty("jqx-fill-state-disabled")),this.baseHost&&(this._spinButtonsContainer&&this._spinButtonsContainer[t](this.toThemeProperty("jqx-fill-state-disabled")),this._addon&&this._addon[t](this.toThemeProperty("jqx-fill-state-disabled")))):(this.host.removeClass(this.toThemeProperty("jqx-fill-state-disabled")),this.baseHost&&""!==this.value&&null!==this.value&&(this._spinButtonsContainer&&this._spinButtonsContainer.removeClass(this.toThemeProperty("jqx-fill-state-disabled")),this._addon&&this._addon.removeClass(this.toThemeProperty("jqx-fill-state-disabled"))))},selectAll:function(){var e=this.host;setTimeout(function(){var t;"selectionStart"in e[0]?(e[0].focus(),e[0].setSelectionRange(0,e[0].value.length)):((t=e[0].createTextRange()).collapse(!0),t.moveEnd("character",e[0].value.length),t.moveStart("character",0),t.select())},10)},selectLast:function(){var t=this.host;this.selectStart(t[0].value.length)},selectFirst:function(){this.selectStart(0)},selectStart:function(e){var o=this.host;setTimeout(function(){var t;"selectionStart"in o[0]?(o[0].focus(),o[0].setSelectionRange(e,e)):((t=o[0].createTextRange()).collapse(!0),t.moveEnd("character",e),t.moveStart("character",e),t.select())},10)},focus:function(){try{this.host.focus();var t=this;setTimeout(function(){t.host.focus()},25)}catch(t){}},refresh:function(){var t,e,o,s,n,r,i=this;this._refreshClasses(!1),this._refreshClasses(!0),this.baseHost?(this.width&&this.baseHost.width(this.width),this.height&&(this.baseHost.height(this.height),t=0,e=this.baseHost.height()-2,p.jqx.browser.msie&&p.jqx.browser.version<8&&this.baseHost.css("display","inline-block"),p.each(this.baseHost.children(),function(){return 0<=this.className.indexOf("jqx-input-bar")||(0<=this.className.indexOf("jqx-input-label")||(p(this).css("height","100%"),p.jqx.browser.msie&&p.jqx.browser.version<8&&p(this).css("height",e+"px"),void(this!==i.element&&(t+=p(this).outerWidth()))))}),n="string"==typeof i.width&&"%"===i.width.charAt(i.width.length-1)?1:0,this.host.css("width",this.baseHost.width()-t-n+"px"),p.jqx.browser.msie&&p.jqx.browser.version<9&&(i._spinButtonsContainer&&(!1===i.rtl||!0===i.rtl&&i._addon)&&i._spinButtonsContainer.css("border-left-width","0"),i._addon&&(!1===i.rtl?i._addon.css("border-left-width","0"):i._spinButtonsContainer||i._addon.css("border-right-width","0")),r=0,p.jqx.browser.version<8&&(o=0,s=parseInt(i.host.css("border-left-width"),10)+parseInt(i.host.css("border-right-width"),10),n=parseInt(i.host.css("padding-left"),10)+parseInt(i.host.css("padding-right"),10),i._spinButtonsContainer&&(s+=parseInt(i._spinButtonsContainer.css("border-left-width"),10)+parseInt(i._spinButtonsContainer.css("border-right-width"),10),n+=parseInt(i._spinButtonsContainer.css("padding-left"),10)+parseInt(i._spinButtonsContainer.css("padding-right"),10),i._addon||(o=2)),i._addon&&(s+=parseInt(i._addon.css("border-left-width"),10)+parseInt(i._addon.css("border-right-width"),10),n+=parseInt(i._addon.css("padding-left"),10)+parseInt(i._addon.css("padding-right"),10),i._spinButtonsContainer||(o=2)),i.host.width(i.host.width()-(n+s)-o),r=6),i.host.height(i.baseHost.height()-(parseInt(i.host.css("border-top-width"),10)+parseInt(i.host.css("border-bottom-width"),10)+parseInt(i.host.css("padding-top"),10)+parseInt(i.host.css("padding-bottom"),10)+r)),r=i.host.height()+"px",i.host.css("min-height",r),i.host.css("line-height",r))),i.baseHost&&i.bar&&i.bar.css("top",1+i.host.outerHeight())):(this.width&&this.host.width(this.width),this.height&&this.host.height(this.height)),this.host.attr("disabled",this.disabled),this.host.attr("placeholder")||this._refreshPlaceHolder()},_refreshPlaceHolder:function(){var t=this;this.isMaterialized()&&this.hint?this.label[0].innerHTML=this.placeHolder:"placeholder"in this.element?this.host.attr("placeHolder",this.placeHolder):""===(t=this).element.value&&(this.element.value=this.placeHolder,this.host.focus(function(){t.element.value===t.placeHolder&&(t.element.value="")}),this.host.blur(function(){""!==t.element.value&&t.element.value!==t.placeHolder||(t.element.value=t.placeHolder)}))},destroy:function(){this.removeHandlers(),this.baseHost?(p.jqx.utilities.resize(this.baseHost,null,!0),this.baseHost.remove()):(p.jqx.utilities.resize(this.host,null,!0),this.host.remove()),this.$popup&&this.$popup.remove()},propertyChangedHandler:function(n,t,e,o){if("placeHolder"!==t)if("template"==t&&n.template&&(n._upbutton.removeClass(n.toThemeProperty("jqx-"+e)),n._downbutton.removeClass(n.toThemeProperty("jqx-"+e)),n._addon.removeClass(n.toThemeProperty("jqx-"+e)),n._upbutton.addClass(n.toThemeProperty("jqx-"+n.template)),n._downbutton.addClass(n.toThemeProperty("jqx-"+n.template)),n._addon.addClass(n.toThemeProperty("jqx-"+n.template))),"theme"!==t)if("disabled"===t&&p.jqx.aria(n,"aria-disabled",n.disabled),"value"!==t||e.toString().toUpperCase()===o.toString().toUpperCase()){if(e===o||"radix"!==t)return e!==o&&"decimalNotation"===t&&10===n._radixNumber&&(n.element.value="exponential"===o?n._getDecimalNotation("exponential"):n._number.toString(10)),e===o||"min"!==t&&"max"!==t?e===o||"upperCase"!==t||""===n.element.value?"spinButtons"===t?e!==o?void(n._spinButtonsContainer?s(n._spinButtonsContainer,o):r("spinButtons",o)):void 0:(e!==o&&"spinButtonsStep"===t&&(n._spinButtonsStepLong=new n.longObj.math.Long.fromNumber(o)),"dropDown"===t?e!==o?void(n._addon?s(n._addon,o):r("dropDown",o)):void 0:void n.refresh()):void(!0===o?(n.host.removeClass(n.toThemeProperty("jqx-formatted-input-lower-case")),n.host.addClass(n.toThemeProperty("jqx-formatted-input-upper-case"))):(n.host.removeClass(n.toThemeProperty("jqx-formatted-input-upper-case")),n.host.addClass(n.toThemeProperty("jqx-formatted-input-lower-case")))):(n._setMinMax(t),n._validateValue(n.value,!0),void(n.value=n.element.value));n._changeRadix(o)}else n.val(o);else p.jqx.utilities.setTheme(e,o,n.host);else n._refreshPlaceHolder();function s(t,e){var o=n.host.width(),s=t.outerWidth();!1===e?(n.host.width(o+s),t.hide(),!0===n.rtl&&(!0===n.spinButtons&&n._spinButtonsContainer.addClass(n.toThemeProperty("jqx-formatted-input-spin-buttons-container-rtl-border")),!0===n.dropDown&&n._addon.removeClass(n.toThemeProperty("jqx-formatted-input-addon-rtl")))):(n.host.width(o-s),t.show(),!0===n.rtl&&!0===n.spinButtons&&!0===n.dropDown&&(n._spinButtonsContainer.removeClass(n.toThemeProperty("jqx-formatted-input-spin-buttons-container-rtl-border")),n._addon.addClass(n.toThemeProperty("jqx-formatted-input-addon-rtl"))))}function r(t,e){var o;!0===e&&(e=p(""),n.baseHost?(o=n.baseHost.children("div"),!1===n.rtl&&"spinButtons"===t||!0===n.rtl&&"dropDown"===t?o.before(e):o.after(e),n.render(),n.host.width(n.host.width()-e.outerWidth())):(o=n.element.id,n.host.removeAttr("id"),n.host.wrap(''),o=p("#"+o),!1===n.rtl?o.append(e):o.prepend(e),(e=n.host.data()).jqxFormattedInput.host=o,e.jqxFormattedInput.element=o[0],n.baseHost=o,n.baseHost.data(e),n.render(),n.refresh()))}},select:function(t,e,o){o=o||this.$popup.find(".jqx-fill-state-pressed").attr("data-value"),this._changeRadix(parseInt(o,10)),this._setMaxLength(!0),this.close()},val:function(t){var e=this;if(!t&&""!==t||"object"==typeof t&&!0===p.isEmptyObject(t)||"binary"===t||"octal"===t||"decimal"===t||"exponential"===t||"scientific"===t||"engineering"===t||"hexadecimal"===t){if(!t||"object"==typeof t&&!0===p.isEmptyObject(t))return e.element.value;if("exponential"===t||"scientific"===t||"engineering"===t)return e._getDecimalNotation(t);var o=e._getRadix(t);return e._number.toString(o)}if((t=t.toString()).toUpperCase()===e.element.value.toString().toUpperCase())return t;o=e.element.value;!0===e.upperCase&&(t=t.toUpperCase());for(var s=t.split(""),n=0;n(BIN)"),t._popupOptions.push(t._number.toString(8)+" (OCT)"),t._popupOptions.push(t._number.toString(10)+" (DEC)"),t._popupOptions.push(t._number.toString(16)+" (HEX)")):(t._popupOptions.push("BIN"),t._popupOptions.push("OCT"),t._popupOptions.push("DEC"),t._popupOptions.push("HEX"))},_validateValue:function(t,e){var o=this;if(""===t)return!e||(o.element.value="",t);var s=new o.longObj.math.Long.fromString(t.toString(),o._radixNumber);if(s.lessThan(o._minLong)){if(e){o._number=o._minLong;var n=o._minLong.toString(o._radixNumber);return 16===o._radixNumber&&!0===o.upperCase&&(n=n.toUpperCase()),o.element.value=n}return!1}if(s.greaterThan(o._maxLong)){if(e){o._number=o._maxLong;n=o._maxLong.toString(o._radixNumber);return 16===o._radixNumber&&!0===o.upperCase&&(n=n.toUpperCase()),o.element.value=n}return!1}return!e||(o._number=s,o.element.value=t)},_getNegativeDecimal:function(t,e){var o=t;if(8===e){for(var s=new Array,n=0;n<11;n++){for(var r=parseInt(t.charAt(n),8).toString(2);3!==r.length;)r="0"+r;s.push(r)}"0"===(o=s.join("")).charAt(0)&&(o=o.slice(1))}else if(16===e){for(var i=new Array,a=0;a<8;a++){for(var h=parseInt(t.charAt(a),16).toString(2);4!==h.length;)h="0"+h;i.push(h)}o=i.join("")}for(var d="",p=0;p=u.math.Long.TWO_PWR_63_DBL_?u.math.Long.MAX_VALUE:t<0?u.math.Long.fromNumber(-t).negate():new u.math.Long(t%u.math.Long.TWO_PWR_32_DBL_|0,t/u.math.Long.TWO_PWR_32_DBL_|0)},u.math.Long.fromBits=function(t,e){return new u.math.Long(t,e)},u.math.Long.fromString=function(t,e){if(0===t.length)throw new Error("number format error: empty string");var o=e||10;if(o<2||36>>16,o=65535&this.highBits,s=this.lowBits>>>16,n=65535&this.lowBits,r=t.highBits>>>16,i=65535&t.highBits,a=t.lowBits>>>16,h=0,d=0,p=0,l=0;return p+=(l+=n+(65535&t.lowBits))>>>16,l&=65535,d+=(p+=s+a)>>>16,p&=65535,h+=(d+=o+i)>>>16,d&=65535,h+=e+r,h&=65535,u.math.Long.fromBits(p<<16|l,h<<16|d)},u.math.Long.prototype.subtract=function(t){return this.add(t.negate())},u.math.Long.prototype.multiply=function(t){if(this.isZero())return u.math.Long.ZERO;if(t.isZero())return u.math.Long.ZERO;if(this.equals(u.math.Long.MIN_VALUE))return t.isOdd()?u.math.Long.MIN_VALUE:u.math.Long.ZERO;if(t.equals(u.math.Long.MIN_VALUE))return this.isOdd()?u.math.Long.MIN_VALUE:u.math.Long.ZERO;if(this.isNegative())return t.isNegative()?this.negate().multiply(t.negate()):this.negate().multiply(t).negate();if(t.isNegative())return this.multiply(t.negate()).negate();if(this.lessThan(u.math.Long.TWO_PWR_24_)&&t.lessThan(u.math.Long.TWO_PWR_24_))return u.math.Long.fromNumber(this.toNumber()*t.toNumber());var e=this.highBits>>>16,o=65535&this.highBits,s=this.lowBits>>>16,n=65535&this.lowBits,r=t.highBits>>>16,i=65535&t.highBits,a=t.lowBits>>>16,h=65535&t.lowBits,d=0,p=0,l=0,t=0;return l+=(t+=n*h)>>>16,t&=65535,p+=(l+=s*h)>>>16,l&=65535,p+=(l+=n*a)>>>16,l&=65535,d+=(p+=o*h)>>>16,p&=65535,d+=(p+=s*a)>>>16,p&=65535,d+=(p+=n*i)>>>16,p&=65535,d+=e*h+o*a+s*i+n*r,d&=65535,u.math.Long.fromBits(l<<16|t,d<<16|p)},u.math.Long.prototype.div=function(t){if(t.isZero())throw new Error("division by zero");if(this.isZero())return u.math.Long.ZERO;var e;if(this.equals(u.math.Long.MIN_VALUE)){if(t.equals(u.math.Long.ONE)||t.equals(u.math.Long.NEG_ONE))return u.math.Long.MIN_VALUE;if(t.equals(u.math.Long.MIN_VALUE))return u.math.Long.ONE;if((e=this.shiftRight(1).div(t).shiftLeft(1)).equals(u.math.Long.ZERO))return t.isNegative()?u.math.Long.ONE:u.math.Long.NEG_ONE;var o=this.subtract(t.multiply(e));return e.add(o.div(t))}if(t.equals(u.math.Long.MIN_VALUE))return u.math.Long.ZERO;if(this.isNegative())return t.isNegative()?this.negate().div(t.negate()):this.negate().div(t).negate();if(t.isNegative())return this.div(t.negate()).negate();var s=u.math.Long.ZERO;for(o=this;o.greaterThanOrEqual(t);){e=Math.max(1,Math.floor(o.toNumber()/t.toNumber()));for(var n=Math.ceil(Math.log(e)/Math.LN2),r=n<=48?1:Math.pow(2,n-48),i=u.math.Long.fromNumber(e),a=i.multiply(t);a.isNegative()||a.greaterThan(o);)e-=r,a=(i=u.math.Long.fromNumber(e)).multiply(t);i.isZero()&&(i=u.math.Long.ONE),s=s.add(i),o=o.subtract(a)}return s},u.math.Long.prototype.modulo=function(t){return this.subtract(this.div(t).multiply(t))},u.math.Long.prototype.not=function(){return u.math.Long.fromBits(~this.lowBits,~this.highBits)},u.math.Long.prototype.and=function(t){return u.math.Long.fromBits(this.lowBits&t.lowBits,this.highBits&t.highBits)},u.math.Long.prototype.or=function(t){return u.math.Long.fromBits(this.lowBits|t.lowBits,this.highBits|t.highBits)},u.math.Long.prototype.xor=function(t){return u.math.Long.fromBits(this.lowBits^t.lowBits,this.highBits^t.highBits)},u.math.Long.prototype.shiftLeft=function(t){if(0===(t&=63))return this;var e=this.lowBits;if(t<32){var o=this.highBits;return u.math.Long.fromBits(e<>>32-t)}return u.math.Long.fromBits(0,e<>>t|e<<32-t,e>>t)}return u.math.Long.fromBits(e>>t-32,0<=e?0:-1)},u.math.Long.prototype.shiftRightUnsigned=function(t){if(0===(t&=63))return this;var e=this.highBits;if(t<32){var o=this.lowBits;return u.math.Long.fromBits(o>>>t|e<<32-t,e>>>t)}return 32===t?u.math.Long.fromBits(e,0):u.math.Long.fromBits(e>>>t-32,0)}}})}(jqxBaseFramework);