@mescius/wijmo.input 5.20261.45-nightly.d20260105.t163143 → 5.20261.45-nightly.d20260106.t035854
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es2015-commonjs.js +2 -2
- package/es2015-esm.js +2 -2
- package/es5-esm.js +2 -2
- package/index.d.ts +1 -1
- package/index.js +2 -2
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
*
|
|
3
|
-
* Wijmo Library 5.20261.45-nightly.
|
|
3
|
+
* Wijmo Library 5.20261.45-nightly.d20260106.t035854
|
|
4
4
|
* https://developer.mescius.com/wijmo
|
|
5
5
|
*
|
|
6
6
|
* Copyright(c) MESCIUS inc. All rights reserved.
|
|
@@ -11,4 +11,4 @@
|
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
"use strict";var __extends=this&&this.__extends||function(){var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};return function(e,t){extendStatics(e,t);function __(){this.constructor=e}e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}}(),__assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++){t=arguments[i];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)},__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.hasOwnProperty.call(e,i)&&(t[i]=e[i]);t.default=e;return t};Object.defineProperty(exports,"__esModule",{value:!0});var wijmo_1=require("@mescius/wijmo"),selfModule=__importStar(require("@mescius/wijmo.input"));exports.AutoCompleteClsNames={hostElement:"wj-autocomplete"};exports.CalendarClsNames={buttonsOutside:"wj-btns-outside",calendarHeader:"wj-calendar-header",calendarMonth:"wj-calendar-month",calendarMultiMonth:"wj-calendar-multimonth",calendarOuter:"wj-calendar-outer",calendarYear:"wj-calendar-year",dayOtherMonth:"wj-day-othermonth",dayToday:"wj-day-today",dayWeekend:"wj-day-weekend",header:"wj-header",hostElement:"wj-calendar",monthSelect:"wj-month-select",weekAfter:"wj-week-after",weekBefore:"wj-week-before",yearPicker:"wj-yearpicker",focused:"wj-state-focus",selectedYear:"wj-select-year",confirmationButtonContainer:"wj-calendar-confirmation-button-container",button:"wj-calendar-button"};exports.CollectionViewNavigatorClsNames={hostElement:"wj-collectionview-navigator",pager:"wj-pager"};exports.ColorPickerClsNames={colorBox:"wj-colorbox",hostElement:"wj-colorpicker"};exports.ComboBoxClsNames={hostElement:"wj-combobox",stateMatch:"wj-state-match"};exports.DropDownClsNames={dropDownPanel:"wj-dropdown-panel",hostElement:"wj-dropdown"};exports.InputClsNames={input:"wj-input",inputBtnVisible:"wj-input-btn-visible",inputGroup:"wj-input-group",inputGroupBtn:"wj-input-group-btn"};exports.InputColorClsNames={hostElement:"wj-inputcolor",inputColorBox:"wj-inputcolorbox"};exports.InputDateClsNames={hostElement:"wj-inputdate",inputDateDropDown:"wj-inputdate-dropdown",inputDateDropDownContainer:"wj-inputdate-dropdown-container"};exports.InputDateRangeClsNames={hostElement:"wj-inputdaterange"};exports.InputDateTimeClsNames={hostElement:"wj-inputdatetime",showDropDownButton:"wj-show-dropdown-button"};exports.InputMaskClsNames={hostElement:"wj-inputmask"};exports.InputNumberClsNames={hostElement:"wj-inputnumber",numeric:"wj-numeric",showSpinner:"wj-input-show-spinner"};exports.InputTimeClsNames={hostElement:"wj-inputtime"};exports.ListBoxClsNames={header:"wj-header",hostElement:"wj-listbox",listBoxItem:"wj-listbox-item"};exports.MenuClsNames={hostElement:"wj-menu",menuItems:"wj-menu-items",subItems:"wj-subitems"};exports.MultiAutoCompleteClsNames={hostElement:"wj-multi-autocomplete",token:"wj-token",tokenActive:"wj-token-active",tokenClose:"wj-token-close",tokenHelper:"wj-token-helper",tokenLabel:"wj-token-label",screenReaderOnly:"wj-sr-only"};exports.MultiSelectClsNames={hostElement:"wj-multiselect"};exports.MultiSelectListBoxClsNames={header:"wj-header",hostElement:"wj-multiselectlistbox",selectAll:"wj-select-all"};exports.PopupClsNames={dialogHeader:"wj-dialog-header",hostElement:"wj-popup",popupBackDrop:"wj-popup-backdrop",dialogBody:"wj-dialog-body",dialogFooter:"wj-dialog-footer"};wijmo_1._addCultureInfo("InputNumber",{ariaLabels:{incVal:"Increase Value",decVal:"Decrease Value",inputNumberInput:"InputNumber Input",inputNumber:"Input Number"}});var InputNumber=function(e){__extends(InputNumber,e);function InputNumber(t,i){var o=e.call(this,t)||this;o._value=null;o._min=null;o._max=null;o._format="";o._step=null;o._showBtn=!0;o._readOnly=!1;o._handleWheel=!0;o._oldText="";o._fromKb=!0;o._inputElementAriaLabel=wijmo_1.culture.InputNumber.ariaLabels.inputNumberInput;o._ariaLabelledby=null;o.textChanged=new wijmo_1.Event;o.valueChanged=new wijmo_1.Event;var n=o.getTemplate();o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.InputNumberClsNames.hostElement,n,{_tbx:"input",_btnUp:"btn-inc",_btnDn:"btn-dec"},"input");var s=o.inputElement;o.hostElement;wijmo_1.setAttribute(s,"role","spinbutton",!0);o._updateInputAriaLabel();var r=wijmo_1.culture.InputNumber.ariaLabels;wijmo_1.setAriaLabel(o._btnUp.querySelector("button"),r.incVal);wijmo_1.setAriaLabel(o._btnDn.querySelector("button"),r.decVal);o._tbx.type.match(/number/i)&&(o.inputType="");var a=o._tbx;a.autocomplete="off";a.spellcheck=!1;o._updateSymbols();var l=o.addEventListener.bind(o);l(a,"keypress",o._keypress.bind(o));l(a,"keydown",o._keydown.bind(o));l(a,"input",o._input.bind(o));wijmo_1.isMobile()&&l(a,"beforeinput",o._beforeinput.bind(o));l(a,"blur",(function(){o.text!=o._oldText&&o._setText(o.text)}));l(a,"paste",(function(){o._fromKb=!1}));l(a,"compositionstart",(function(){o._composing=!0}));l(a,"compositionend",(function(){o._composing=!1;setTimeout((function(){var e=o.text,t=o._oldText,i=o._chrPct;t&&t.indexOf(i)>-1&&e.indexOf(i)<0&&(e+=i);o._setText(e)}))}));var h=o._clickSpinner.bind(o);l(o._btnUp,"click",h);l(o._btnDn,"click",h);o._rptUp=new wijmo_1._ClickRepeater(o._btnUp.querySelector("button"));o._rptDn=new wijmo_1._ClickRepeater(o._btnDn.querySelector("button"));l(a,"wheel",(function(e){if(o.handleWheel&&!e.defaultPrevented&&!e.ctrlKey&&o._isEditable()&&o.containsFocus()){var t=wijmo_1.clamp(-e.deltaY,-1,1);o._increment((o.step||1)*t);setTimeout((function(){return o.selectAll()}));e.preventDefault()}}));o.value=0;o.isRequired=!0;o.initialize(i);return o}Object.defineProperty(InputNumber,"controlTemplate",{get:function(){InputNumber._ctrlTemplate||(InputNumber._ctrlTemplate='<div class="'+wijmo_1.ControlClsNames.template+'"><div class="'+exports.InputClsNames.input+'"><div class="'+exports.InputClsNames.inputGroup+'"><span wj-part="btn-dec" class="'+exports.InputClsNames.inputGroupBtn+'" tabindex="-1"><button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1">-</button></span><input type="tel" wj-part="input" class="'+wijmo_1.InputFormElementsClsNames.formControl+" "+exports.InputNumberClsNames.numeric+'"/><span wj-part="btn-inc" class="'+exports.InputClsNames.inputGroupBtn+'" tabindex="-1"><button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1">+</button></span></div></div></div>');return InputNumber._ctrlTemplate},set:function(e){InputNumber._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"inputElement",{get:function(){return this._tbx},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"inputType",{get:function(){return this._tbx.type},set:function(e){this._tbx.type=wijmo_1.asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"value",{get:function(){return this._value},set:function(e){if(e!=this._value)if(null==(e=wijmo_1.asNumber(e,!this.isRequired||null==e&&null==this._value)))this._setText("");else if(!isNaN(e)){var t=wijmo_1.Globalize.format(e,this.format);this._setText(t)}},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"isRequired",{get:function(){return this._tbx.required},set:function(e){this._tbx.required=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"isReadOnly",{get:function(){return this._readOnly},set:function(e){this._readOnly=wijmo_1.asBoolean(e);this.inputElement.readOnly=this._readOnly;wijmo_1.toggleClass(this.hostElement,wijmo_1.ControlStateClsNames.readOnly,this.isReadOnly)},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"handleWheel",{get:function(){return this._handleWheel},set:function(e){this._handleWheel=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"min",{get:function(){return this._min},set:function(e){if(e!=this._min){this._min=wijmo_1.asNumber(e,!0);this._updateAria()}},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"max",{get:function(){return this._max},set:function(e){if(e!=this._max){this._max=wijmo_1.asNumber(e,!0);this._updateAria()}},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"step",{get:function(){return this._step},set:function(e){this._step=wijmo_1.asNumber(e,!0);this._updateBtn()},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"format",{get:function(){return this._format},set:function(e){if(e!=this.format){this._format=wijmo_1.asString(e);this.refresh()}},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"text",{get:function(){return this._tbx.value},set:function(e){if(e!=this.text){this._oldText=this.text;this._setText(e)}},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"placeholder",{get:function(){return this._tbx.placeholder},set:function(e){this._tbx.placeholder=e},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"showSpinner",{get:function(){return this._showBtn},set:function(e){this._showBtn=wijmo_1.asBoolean(e);this._updateBtn()},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"repeatButtons",{get:function(){return!this._rptUp.disabled},set:function(e){this._rptUp.disabled=this._rptDn.disabled=!wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"ariaLabelledBy",{get:function(){return this._ariaLabelledby},set:function(e){wijmo_1._setAriaLabelBy(this,this._tbx,e,this._updateInputAriaLabel.bind(this))},enumerable:!0,configurable:!0});InputNumber.prototype.selectAll=function(){var e=this._tbx;wijmo_1.setSelectionRange(e,0,e.value.length)};InputNumber.prototype.clamp=function(e){return wijmo_1.clamp(e,this.min,this.max)};InputNumber.prototype.onTextChanged=function(e){this.textChanged.raise(this,e);this._updateState()};InputNumber.prototype.onValueChanged=function(e){this._updateAria();this.valueChanged.raise(this,e)};InputNumber.prototype.dispose=function(){this._rptUp.element=null;this._rptDn.element=null;e.prototype.dispose.call(this)};InputNumber.prototype.onGotFocus=function(t){this._oldValue=this.value;if(!this.isTouching){this._tbx.focus();this.selectAll()}e.prototype.onGotFocus.call(this,t)};InputNumber.prototype.onLostFocus=function(t){if(this._composing){this._composing=!1;this._setText(this.text)}if(this._isEditable()){var i=this.clamp(this.value);if(i==this.value||this.onInvalidInput(new wijmo_1.CancelEventArgs)){var o=wijmo_1.Globalize.format(i,this.format);this._setText(o)}}e.prototype.onLostFocus.call(this,t)};InputNumber.prototype.refresh=function(t){void 0===t&&(t=!0);e.prototype.refresh.call(this,t);if(this.hostElement){this._updateSymbols();var i=wijmo_1.Globalize.format(this.value,this.format);this._setText(i)}};InputNumber.prototype._isEditable=function(){return!this.isReadOnly&&!this.isDisabled};InputNumber.prototype._updateSymbols=function(){var e=wijmo_1.culture.Globalize.numberFormat,t=wijmo_1.Globalize._parseNumericFormat(this.format);this._chrDec=e["."]||".";this._chrTho=e[","]||",";this._chrNeg=e["-"]||"-";this._chrPls=e["+"]||"+";this._chrPct=e["%"]||"%";this._chrCur=t.curr||e.currency.symbol||"$";this._fmtSpc=t.spec;this._fmtPrc=t.prec;this._rxSym=new RegExp("^[%+\\-() \\"+this._chrDec+"\\"+this._chrCur+"\\"+this._chrNeg+"\\"+this._chrPls+"\\"+this._chrPct+"]*$");this._rxNeg=new RegExp("^\\s*(\\-|\\"+this._chrNeg+")|([^e](\\-|\\"+this._chrNeg+")|\\()")};InputNumber.prototype._isNumeric=function(e,t){var i=e==this._chrDec||e>="0"&&e<="9",o="x"==this._fmtSpc;!i&&o&&(i=e>="a"&&e<="f"||e>="A"&&e<="F");i||t||o||(i=e==this._chrPls||e==this._chrNeg||"("==e||")"==e);return i};InputNumber.prototype._getInputRange=function(e){for(var t=[0,0],i=this.text,o=!1,n=0;n<i.length;n++)if(this._isNumeric(i[n],e)){if(!o){t[0]=n;o=!0}t[1]=n+1}return t};InputNumber.prototype._flipSign=function(){var e=this._getSelStartDigits();this.value*=-1;this._setSelStartDigits(e)};InputNumber.prototype._getSelStartDigits=function(){for(var e=0,t=this._tbx.selectionStart,i=this._tbx.value,o=0;o<i.length&&o<t;o++)this._isNumeric(i[o],!0)&&e++;return e};InputNumber.prototype._setSelStartDigits=function(e){for(var t=this._tbx.value,i=0;i<t.length&&e>=0;i++)if(this._isNumeric(t[i],!0)){if(!e){wijmo_1.setSelectionRange(this._tbx,i);break}e--}else if(!e){wijmo_1.setSelectionRange(this._tbx,i);break}};InputNumber.prototype._increment=function(e){if(e){var t=this.clamp(wijmo_1.isNumber(this.value)?this.value+e:0),i=wijmo_1.Globalize.format(t,this.format,!1,!1);this._setText(i)}};InputNumber.prototype._updateBtn=function(){var e=this.showSpinner&&!!this.step,t=e;wijmo_1.setCss([this._btnUp,this._btnDn],{display:e?"":"none"});wijmo_1.toggleClass(this.hostElement,exports.InputNumberClsNames.showSpinner,e);wijmo_1.enable(this._btnUp,t);wijmo_1.enable(this._btnDn,t);this._updateAria()};InputNumber.prototype._setText=function(e,t,i){void 0===t&&(t=!1);void 0===i&&(i=!1);if(!this._composing){var o=this._tbx,n=this._chrDec,s=this._rxNeg.test(e),r=this._delKey,a=this.containsFocus();e&&this._rxSym.test(e)&&a&&(e=this.isRequired||!r?(s?"-0":"0")+(e.indexOf(n)>-1?n:""):"");this._delKey=!1;r&&0==this.value&&!this.isRequired&&(e="");if(!e){if(!this.isRequired||i){o.value="";if(this._oldText){this._oldText=e;this.onTextChanged()}if(null!=this._value){this._value=null;this.onValueChanged()}this._updateBtn();return}e="0"}var l=e.indexOf(n),h=this._format||(l>-1?"n2":"n0"),u=wijmo_1.Globalize.parseFloat(e,h);isFinite(u)||(u=this.clamp(u));if(isNaN(u))if(this.onInvalidInput(new wijmo_1.CancelEventArgs))o.value=this._oldText;else{o.value=e;this.focus()}else{var c=a&&l>-1?2:null,p=wijmo_1.Globalize.format(u,h,!1,t,c);s&&u>=0&&!r&&(p=this._chrNeg+p);a&&l>-1&&"g"==this._fmtSpc&&0!=this._fmtPrc&&(p=e).indexOf(n)<0&&(p+=n);if(o.value!=p){o.value=p;u=wijmo_1.Globalize.parseFloat(p,h)}if(this.text!=this._oldText){this._oldText=this.text;this.onTextChanged()}if(u!=this._value){this._value=u;this.onValueChanged()}this._updateBtn();this._updateState()}}};InputNumber.prototype._handleDecimalInput=function(e){if(0===this._fmtPrc){e.preventDefault();return!0}var t=this._tbx,i=t.value.indexOf(this._chrDec);if(i>-1){e.preventDefault();var o=t.selectionStart<=i?i+1:i;wijmo_1.setSelectionRange(t,o);return!0}return!1};InputNumber.prototype._beforeinput=function(e){if(!e.defaultPrevented&&!this._composing&&this._isEditable()){switch(e.data){case".":case this._chrDec:this._handleDecimalInput(e);return;case"+":case this._chrPls:this._handlePlusSign();e.preventDefault();return;case"-":case this._chrNeg:this._handleMinusSign();e.preventDefault();return}}};InputNumber.prototype._keypress=function(e){if(!e.defaultPrevented&&!this._composing&&this._isEditable()&&e.charCode&&!e.ctrlKey&&!e.metaKey&&e.keyCode!=wijmo_1.Key.Enter){var t=this._tbx,i=String.fromCharCode(e.charCode);if(this._isNumeric(i,!1)){var o=t.maxLength;if(o>-1&&t.value.length>=o&&t.selectionEnd==t.selectionStart){e.preventDefault();return}var n=this._getInputRange(!0),s=t.selectionStart,r=t.selectionEnd;if(s<n[0]&&r<t.value.length){r=Math.max(r,n[0]);wijmo_1.setSelectionRange(t,n[0],r)}if(s>=n[1]){var a=null!=this._fmtPrc?this._fmtPrc:2,l=t.value.indexOf(this._chrDec);l>-1&&s-l>a&&e.preventDefault()}}else e.preventDefault();switch(i){case"-":case this._chrNeg:this._handleMinusSign();e.preventDefault();break;case"+":case this._chrPls:this._handlePlusSign();e.preventDefault();break;case".":case this._chrDec:this._handleDecimalInput(e)}if(!e.defaultPrevented&&wijmo_1.isIE()){var h=t.value;if((s=t.selectionStart)==(r=t.selectionEnd)){t.value=h.substr(0,s)+i+h.substr(r);wijmo_1.setSelectionRange(t,s+1);e.preventDefault();this._input()}}}};InputNumber.prototype._handlePlusSign=function(){var e=this._tbx;(this.value<0||this._rxNeg.test(e.value))&&this._flipSign()};InputNumber.prototype._handleMinusSign=function(){var e=this._tbx;if(this.clamp(-1)>=0)this.value<0&&this._flipSign();else if(this.value&&e.selectionStart===e.selectionEnd)this._flipSign();else if(this.clamp(-1)<0){e.value=this._chrNeg;wijmo_1.setSelectionRange(e,1)}};InputNumber.prototype._keydown=function(e){var t=this;this._delKey=!1;if(!e.defaultPrevented&&!this._composing){var i=wijmo_1.hasClass(this._tbx,"wj-grid-ime");if(!i||e.keyCode==wijmo_1.Key.Back||e.keyCode==wijmo_1.Key.Delete){var o=this._tbx,n=o.value,s=o.selectionStart,r=o.selectionEnd;switch(e.keyCode){case 65:if(e.ctrlKey){setTimeout((function(){t.selectAll()}));e.preventDefault()}break;case wijmo_1.Key.Up:case wijmo_1.Key.Down:if(this.step&&this._isEditable()){this._increment(this.step*(e.keyCode==wijmo_1.Key.Up?1:-1));setTimeout((function(){t.selectAll()}));e.preventDefault()}break;case wijmo_1.Key.Back:this._delKey=!0;if(r-s<2&&this._isEditable()){var a=n[r-1];if(a==this._chrDec||a==this._chrPct||a==this._chrTho||")"==a){setTimeout((function(){r=a==t._chrPct?t._getInputRange(!0)[1]:r-1;wijmo_1.setSelectionRange(o,r)}));e.preventDefault()}}break;case wijmo_1.Key.Delete:this._delKey=!0;if(r-s<2&&this._isEditable())if("0"==n&&1==s)wijmo_1.setSelectionRange(o,0);else{var l=n[s];if(l==this._chrDec||l==this._chrPct){setTimeout((function(){wijmo_1.setSelectionRange(o,s+1)}));e.preventDefault()}}break;case wijmo_1.Key.Escape:this.value=this._oldValue;this.selectAll()}i&&this._delKey&&this._isEditable()&&this._setText(null,!1,!0)}}};InputNumber.prototype._input=function(){var e=this;this._composing?this._fromKb=!0:setTimeout((function(){var t=e._tbx,i=t.value,o=i.indexOf(e._chrDec),n=t.selectionStart,s=e._getSelStartDigits();"p"==e._fmtSpc&&i.length&&i.indexOf(e._chrPct)<0&&(i+=e._chrPct);e._setText(i,e._fromKb);e._fromKb=!0;if(e.containsFocus()){var r=t.value,a=r.indexOf(e._chrDec),l=e._getInputRange(!0);if(i==e._chrNeg+e._chrDec&&a>-1){wijmo_1.setSelectionRange(t,a+1);return}if(i[0]==e._chrNeg&&r[0]!=e._chrNeg){if(1==r.length)wijmo_1.setSelectionRange(t,1);else{"c"===e._fmtSpc&&e._isNegativeCurrencyByParenthesis(i)&&(s-=1);e._setSelStartDigits(s)}return}i?i==e._chrDec&&a>-1?n=a+1:n<=o&&a>-1||o<0&&a<0?n+=r.length-i.length:o<0&&a>-1&&(n=a):n=a>-1?a:l[1];n=wijmo_1.clamp(n,l[0],l[1]);wijmo_1.setSelectionRange(t,n)}}))};InputNumber.prototype._isNegativeCurrencyByParenthesis=function(e){return e.length>1&&e[1]===this._chrCur};InputNumber.prototype._clickSpinner=function(e){var t=this;if(!e.defaultPrevented&&this._isEditable()&&this.step){this._increment(this.step*(wijmo_1.contains(this._btnUp,e.target)?1:-1));if(!this.isTouching){wijmo_1.Control.sharedState.InvalidScroll=wijmo_1.isEdge();setTimeout((function(){return t.selectAll()}))}}};InputNumber.prototype._updateAria=function(){var e=this.inputElement;if(this.hostElement){wijmo_1.setAttribute(e,"aria-valuemin",this.min);wijmo_1.setAttribute(e,"aria-valuemax",this.max);wijmo_1.setAttribute(e,"aria-valuenow",this.value);wijmo_1.setAttribute(e,"aria-valuetext",this.text);wijmo_1.setAttribute(e,"step",this.step);wijmo_1.enable(this._btnDn,null==this.min||this.value>this.min);wijmo_1.enable(this._btnUp,null==this.max||this.value<this.max)}};InputNumber.prototype._updateInputAriaLabel=function(){var e=this.inputElement;this._ariaLabelledby?wijmo_1.setAttribute(e,"aria-label",null):wijmo_1.setAttribute(e,"aria-label",this._inputElementAriaLabel)};InputNumber.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.InputNumber.ariaLabels.inputNumber};InputNumber._ctrlTemplate="";return InputNumber}(wijmo_1.Control);exports.InputNumber=InputNumber;wijmo_1._addCultureInfo("InputMask",{ariaLabels:{inputMaskInput:"InputMask Input",inputMask:"Input Mask"}});var ColorPickerTabKeyAction,InputMask=function(e){__extends(InputMask,e);function InputMask(t,i){var o=e.call(this,t)||this;o._fullEdit=!1;o._inputElementAriaLabel=wijmo_1.culture.InputMask.ariaLabels.inputMaskInput;o._ariaLabelledby=null;o.valueChanged=new wijmo_1.Event;var n=o.getTemplate();o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.InputMaskClsNames.hostElement,n,{_tbx:"input"},"input");if("INPUT"==o._orgTag){var s=o._tbx.getAttribute("value");s&&(o.value=s)}o._msk=new wijmo_1._MaskProvider(o._tbx);o.isRequired=!0;o.initialize(i);o.addEventListener(o._tbx,"input",(function(){o.onValueChanged()}));o.addEventListener(o._tbx,"blur",o._commitText.bind(o));o.addEventListener(o._tbx,"keydown",(function(e){e.keyCode==wijmo_1.Key.Enter&&o._commitText()}));o._updateInputAriaLabel();return o}Object.defineProperty(InputMask,"controlTemplate",{get:function(){InputMask._ctrlTemplate||(InputMask._ctrlTemplate='<div class="'+exports.InputClsNames.input+'"><div class="'+exports.InputClsNames.inputGroup+'"><input wj-part="input" class="'+wijmo_1.InputFormElementsClsNames.formControl+'"/></div></div>');return InputMask._ctrlTemplate},set:function(e){InputMask._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"inputElement",{get:function(){return this._tbx},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"inputType",{get:function(){return this._tbx.type},set:function(e){this._tbx.type=wijmo_1.asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"value",{get:function(){return this._tbx.value},set:function(e){if(e!=this.value){this._tbx.value=wijmo_1.asString(e);e=this._msk._applyMask();this._tbx.value=e;this.onValueChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"rawValue",{get:function(){return this._msk.getRawValue()},set:function(e){e!=this.rawValue&&(this.value=wijmo_1.asString(e))},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"mask",{get:function(){return this._msk.mask||""},set:function(e){var t=this.value;this._msk.mask=wijmo_1.asString(e);this.value!=t&&this.onValueChanged()},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"promptChar",{get:function(){return this._msk.promptChar},set:function(e){var t=this.value;this._msk.promptChar=e;this.value!=t&&this.onValueChanged()},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"overwriteMode",{get:function(){return this._msk.overwriteMode},set:function(e){this._msk.overwriteMode=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"placeholder",{get:function(){return this._tbx.placeholder},set:function(e){this._tbx.placeholder=e},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"maskFull",{get:function(){return this._msk.maskFull},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"isRequired",{get:function(){return this._tbx.required},set:function(e){this._tbx.required=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"isReadOnly",{get:function(){return this._tbx.readOnly},set:function(e){this._tbx.readOnly=wijmo_1.asBoolean(e);wijmo_1.toggleClass(this.hostElement,wijmo_1.ControlStateClsNames.readOnly,this.isReadOnly)},enumerable:!0,configurable:!0});InputMask.prototype.selectAll=function(){var e=this._msk.getMaskRange();wijmo_1.setSelectionRange(this._tbx,e[0],e[1]+1)};InputMask.prototype.onValueChanged=function(e){if(this.value!=this._oldValue){this._oldValue=this.value;this.valueChanged.raise(this,e)}this._updateState()};InputMask.prototype._commitText=function(){(this.rawValue||this.isRequired)&&(this.maskFull||this.onInvalidInput(new wijmo_1.CancelEventArgs));this._updateState()};InputMask.prototype.dispose=function(){this._msk.input=null;e.prototype.dispose.call(this)};InputMask.prototype.refresh=function(t){void 0===t&&(t=!0);e.prototype.refresh.call(this,t);this.hostElement&&this._msk.refresh()};InputMask.prototype.onGotFocus=function(t){this.selectAll();e.prototype.onGotFocus.call(this,t)};Object.defineProperty(InputMask.prototype,"ariaLabelledBy",{get:function(){return this._ariaLabelledby},set:function(e){wijmo_1._setAriaLabelBy(this,this._tbx,e,this._updateInputAriaLabel.bind(this))},enumerable:!0,configurable:!0});InputMask.prototype._updateInputAriaLabel=function(){var e=this.inputElement;!e||e.id||this._ariaLabelledby?wijmo_1.setAttribute(e,"aria-label",null):wijmo_1.setAttribute(e,"aria-label",this._inputElementAriaLabel)};InputMask.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.InputMask.ariaLabels.inputMask};InputMask._ctrlTemplate="";return InputMask}(wijmo_1.Control);exports.InputMask=InputMask;wijmo_1._addCultureInfo("ColorPicker",{ariaLabels:{colorPicker:"Color Picker",satAndBrightnessPanel:"Color saturation and brightness panel",huePanel:"Color hue panel",opacityPanel:"Color opacity panel",palettePanel:"Color palette panel",saturation:"Saturation:",hue:"Hue:",opacity:"Opacity:",degrees:"degrees",brightness:"Brightness:",baseColor:"Base color:",shadeColor:"Shade color:"}});!function(e){e[e.None=0]="None";e[e.All=1]="All"}(ColorPickerTabKeyAction=exports.ColorPickerTabKeyAction||(exports.ColorPickerTabKeyAction={}));var ColorPicker=function(e){__extends(ColorPicker,e);function ColorPicker(t,i){var o=e.call(this,t)||this;o._hsb=[.5,1,1];o._alpha=1;o._ariaLabel=wijmo_1.culture.ColorPicker.ariaLabels.colorPicker;o.valueChanged=new wijmo_1.Event;o.hostElement.setAttribute("role","application");o.hostElement.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.colorPicker);var n=o.getTemplate();o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.ColorPickerClsNames.hostElement,n,{_eSB:"div-sb",_eHue:"div-hue",_eAlpha:"div-alpha",_ePreview:"div-pv",_ePal:"div-pal",_eText:"div-text"});o._palette="#FFF,#000,#F00,#FFC000,#FFFF00,#92D050,#00B050,#00B0F0,#0070C0,#7030A0".split(",");o._updatePalette();o._eHue.style.backgroundImage="url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAD4CAIAAACi6hsPAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuM4zml1AAAAGvSURBVDhPXdBPaM9xHMfxz4pWaxcmtoOhpdXSVpiyHWxqmVpDjaU5rK34XfypjTJ/p+ZPay6jhsOsRrKwaJElf9IQq03WIkv4FeMwMq221tfje1ByeFzfvd7PEKWGEKWTQRZLySWfVRRTQjmVbKWGOhLsZT+HaeY0bbTTQSfdXOcWffTzmAFeMcwoYyT5ygS/mA5hNgphip98J8kHRnnNSwZ4yH1uc4OrdHGR87RximYO0cgedlLLdqqoYAPrWMtKVrCcJSxiPmnMJUQp/Bsyk2xyyKOAQooopYwKtlDNDur5G7SBJo7RQiv/B+2hl3s84CkvGGKEOOYnxolj/mYmhBmDJ5ngCx95xxsGecYj4pB3iENeoZMO2mmlhaMcpIE4ZII6aqhmM3HMMkooopB88sghm0wySCeVlCjMCVFIYx4LWUwOeRSwhmLWU84mqqihll3sppEmjnOSs5zjEl1c4yZ99POE5wwxwns+840fTDFLFKaZZIJxkozxlmEGGSC+GF++Sy89dHOZC8Rr4lVnOMERDrCPBPXEX22jko2UEn+/mnxyWUYWC0gnNUQh/AEc0HJs6cex0gAAAABJRU5ErkJggg==)";o._eHue.style.backgroundSize="contain";if(navigator.appVersion.indexOf("MSIE 9")>-1){o._eSB.children[0].style.filter="progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffffff,endColorstr=#00ffffff,GradientType=1)";o._eSB.children[1].style.filter="progid:DXImageTransform.Microsoft.gradient(startColorstr=#00000000,endColorstr=#ff000000,GradientType=0)"}n=ColorPicker._tplCursor;o._cSB=wijmo_1.createElement(n);o._cHue=wijmo_1.createElement(n);o._cHue.style.width="100%";o._cAlpha=wijmo_1.createElement(n);o._cAlpha.style.height="100%";o._eSB.appendChild(o._cSB);o._eHue.appendChild(o._cHue);o._eAlpha.appendChild(o._cAlpha);o._keyActionTab=ColorPickerTabKeyAction.None;var s=o.addEventListener.bind(o),r=o.removeEventListener.bind(o),a=document;s(o.hostElement,"mousedown",(function(e){s(a,"mousemove",mouseMove);s(a,"mouseup",mouseUp);o._mouseDown(e)}));s(o.hostElement,"touchstart",(function(e){s(a,"touchmove",mouseMove);s(a,"touchend",mouseUp);o._mouseDown(e)}));var mouseMove=function(e){o._mouseMove(e)},mouseUp=function(e){r(a,"mousemove",mouseMove);r(a,"mouseup",mouseUp);r(a,"touchmove",mouseMove);r(a,"touchend",mouseUp);o._mouseUp(e)};s(o.hostElement,"click",(function(e){if(!o.isDisabled){var t=e.target;if(t&&"DIV"==t.tagName&&wijmo_1.contains(o._ePal,t)){var i=t.style.backgroundColor;i&&(o.value=new wijmo_1.Color(i).toString());t.focus()}}}));s(o.hostElement,"keydown",(function(e){o.isDisabled||o._keydown(e)}));o.value="#ffffff";o.initialize(i);o._updatePanels();o._eSB.setAttribute("role","slider");o._eSB.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.satAndBrightnessPanel);o._eSB.setAttribute("aria-valuemin","0");o._eSB.setAttribute("aria-valuemax","100");o._eHue.setAttribute("role","slider");o._eHue.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.huePanel);o._eHue.setAttribute("aria-valuemin","0");o._eHue.setAttribute("aria-valuemax","360");o._eAlpha.setAttribute("role","slider");o._eAlpha.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.opacityPanel);o._eAlpha.setAttribute("aria-valuemin","0");o._eAlpha.setAttribute("aria-valuemax","100");o._ePal.setAttribute("role","grid");o._ePal.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.palettePanel);o._updateTabIndex();return o}Object.defineProperty(ColorPicker,"controlTemplate",{get:function(){ColorPicker._ctrlTemplate||(ColorPicker._ctrlTemplate='<div style="position:relative;width:100%;height:100%"><div style="float:left;width:50%;height:100%;box-sizing:border-box;padding:2px"><div wj-part="div-pal"><div style="float:left;width:10%;box-sizing:border-box;padding:2px"><div style="background-color:black;width:100%"></div><div style="height:6px"></div></div></div><div wj-part="div-text" style="position:absolute;bottom:0px;display:none"></div></div><div style="float:left;width:50%;height:100%;box-sizing:border-box;padding:2px"><div wj-part="div-sb" class="'+exports.ColorPickerClsNames.colorBox+'" style="float:left;width:89%;height:89%"><div style="position:absolute;width:100%;height:100%;background:linear-gradient(to right, white 0%,transparent 100%)"></div><div style="position:absolute;width:100%;height:100%;background:linear-gradient(to top, black 0%,transparent 100%)"></div></div><div style="float:left;width:1%;height:89%"></div><div style="float:left;width:10%;height:89%"><div wj-part="div-hue" class="'+exports.ColorPickerClsNames.colorBox+'"></div></div><div style="float:left;width:89%;height:1%"></div><div style="float:left;width:89%;height:10%"><div style="width:100%;height:100%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuM4zml1AAAAAcSURBVBhXY/iPBBYgAWpKQGkwgMqDAdUk/v8HAM7Mm6GatDUYAAAAAElFTkSuQmCC)"><div wj-part="div-alpha" class="'+exports.ColorPickerClsNames.colorBox+'"></div></div></div><div style="float:left;width:1%;height:10%"></div><div style="float:left;width:10%;height:10%"><div wj-part="div-pv" class="'+exports.ColorPickerClsNames.colorBox+'" style="position:static"></div></div></div></div>');return ColorPicker._ctrlTemplate},set:function(e){ColorPicker._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(ColorPicker.prototype,"showAlphaChannel",{get:function(){return"none"!=this._eAlpha.parentElement.style.display},set:function(e){this._eAlpha.parentElement.style.display=wijmo_1.asBoolean(e)?"":"none"},enumerable:!0,configurable:!0});Object.defineProperty(ColorPicker.prototype,"showColorString",{get:function(){return"none"!=this._eText.style.display},set:function(e){this._eText.style.display=wijmo_1.asBoolean(e)?"":"none";if(wijmo_1.asBoolean(e)){this._eText.setAttribute("role","status");this._eText.setAttribute("aria-live","polite")}},enumerable:!0,configurable:!0});Object.defineProperty(ColorPicker.prototype,"value",{get:function(){return this._value},set:function(e){if(e!=this.value){var t=this.value,i=(e=wijmo_1.asString(e)).trim(),o=wijmo_1.Color.fromString(i);if(o){var n=o.getHsb();this._value=i;this._eText.innerText=i;if(this._hsb[0]!=n[0]||this._hsb[1]!=n[1]||this._hsb[2]!=n[2]||this._alpha!=o.a){if(0==n[2]){n[0]=this._hsb[0];n[1]=this._hsb[1]}else 0==n[1]&&(n[0]=this._hsb[0]);this._hsb=n;this._alpha=o.a;this.onValueChanged()}else""===t&&this.onValueChanged()}else if(""===i){var s=new wijmo_1.Color(e);this._hsb=s.getHsb();this._alpha=s.a;this._value=e;this._eText.innerText=i;this.onValueChanged()}}},enumerable:!0,configurable:!0});Object.defineProperty(ColorPicker.prototype,"palette",{get:function(){return this._palette},set:function(e){if((e=(e=wijmo_1.asArray(e)).slice(0,10)).every((function(e){return null!=wijmo_1.Color.fromString(e)}))){this._palette=e;this._updatePalette()}},enumerable:!0,configurable:!0});Object.defineProperty(ColorPicker.prototype,"ariaLabel",{get:function(){return this._ariaLabel},set:function(e){if(e!=this._ariaLabel){this._ariaLabel=e;wijmo_1.setAttribute(this.hostElement,"aria-label",this._ariaLabel)}},enumerable:!0,configurable:!0});Object.defineProperty(ColorPicker.prototype,"keyActionTab",{get:function(){return this._keyActionTab},set:function(e){this._keyActionTab=e;if(e==ColorPickerTabKeyAction.All){this.tabOrder=0;this.hostElement.setAttribute("tabindex","-1")}this._updateTabIndex()},enumerable:!0,configurable:!0});ColorPicker.prototype._setTabOrder=function(t){e.prototype._setTabOrder.call(this,t);this.isDisabled||this._updateTabIndex()};ColorPicker.prototype.onValueChanged=function(e){this._refreshSelection();this.valueChanged.raise(this,e)};ColorPicker.prototype._mouseDown=function(e){this._htDown=this._getTargetPanel(e);if(this._htDown){e.preventDefault();this._htDown.focus();this._mouseMove(e)}};ColorPicker.prototype._mouseMove=function(e){if(!this.isDisabled){var t=e.touches?e.touches[0]:e,i=this._htDown;if(i){var o=i.getBoundingClientRect(),n=this._hsb.slice(),s=this._alpha;if(i==this._eHue)n[0]=wijmo_1.clamp((t.clientY-o.top)/o.height,0,.99);else if(i==this._eSB){n[1]=wijmo_1.clamp((t.clientX-o.left)/o.width,0,1);n[2]=wijmo_1.clamp(1-(t.clientY-o.top)/o.height,0,1)}else i==this._eAlpha&&(s=wijmo_1.clamp((t.clientX-o.left)/o.width,0,1));this._updateColor(n,s)}}};ColorPicker.prototype._mouseUp=function(e){this._htDown=null};ColorPicker.prototype._updateColor=function(e,t){void 0===e&&(e=this._hsb);void 0===t&&(t=this._alpha);var i=this._hsb[0]!==e[0]||this._hsb[1]!==e[1]||this._hsb[2]!==e[2],o=this._alpha!==t;if(i||o){this._hsb=e;this._alpha=t;var n=wijmo_1.Color.fromHsb(e[0],e[1],e[2],t);this._value=n.toString();this._eText.innerText=this._value;this.onValueChanged()}};ColorPicker.prototype._updatePalette=function(){var e=this,t=new wijmo_1.Color("#fff"),i=new wijmo_1.Color("#000");this._ePal.innerHTML="";this._ePal.className="palette-grid";for(var o=Array.from({length:6},(function(){var e=document.createElement("div");e.className="palette-row";e.setAttribute("role","row");return e})),n=this.getActualTabIndex(),s=0;s<this._palette.length;s++){var r=new wijmo_1.Color(this._palette[s]),a=r.getHsb(),l=this._makePalEntry(r);l.innerHTML="​";l.setAttribute("role","columnheader");l.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.baseColor+" "+r.toString());if(0===s){this._ePalMainFirst=l;this._ePalMainFirst.setAttribute("tabindex",n)}else l.setAttribute("tabindex","-1");o[0].appendChild(l);for(var h=0;h<5;h++){var u=0===a[1]?wijmo_1.Color.interpolate(t,i,.1*h+(a[2]>.5?.05:.55)):wijmo_1.Color.fromHsb(a[0],.1+.2*h,1-.1*h),c=this._makePalEntry(u);c.setAttribute("role","gridcell");c.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.shadeColor+" "+u.toString());if(0===s&&0===h){this._ePalShadeFirst=c;this._ePalShadeFirst.setAttribute("tabindex",n)}else wijmo_1.setAttribute(c,"tabindex","-1");o[h+1].appendChild(c)}}o.forEach((function(t){e._ePal.appendChild(t)}))};ColorPicker.prototype._makePalEntry=function(e){var t=document.createElement("div");t.className="palette-gridcell";wijmo_1.setCss(t,{backgroundColor:e.toString()});return t};ColorPicker.prototype._updatePanels=function(){var e=wijmo_1.Color.fromHsb(this._hsb[0],1,1,1),t=wijmo_1.Color.fromHsb(this._hsb[0],this._hsb[1],this._hsb[2],1);this._eSB.style.backgroundColor=e.toString();this._eAlpha.style.background="linear-gradient(to right, transparent 0%, "+t.toString()+" 100%)";navigator.appVersion.indexOf("MSIE 9")>-1&&(this._eAlpha.style.filter="progid:DXImageTransform.Microsoft.gradient(startColorstr=#00000000,endColorstr="+t.toString()+", GradientType = 1)");var i=this.value.trim();this._ePreview.style.backgroundColor=i;this._cHue.style.top=(100*this._hsb[0]).toFixed(0)+"%";this._cSB.style.left=(100*this._hsb[1]).toFixed(0)+"%";this._cSB.style.top=(100-100*this._hsb[2]).toFixed(0)+"%";this._cAlpha.style.left=(100*this._alpha).toFixed(0)+"%";var o=this.getColorsDiv(),n=wijmo_1.getActiveElement();if(this.keyActionTab===ColorPickerTabKeyAction.All&&!this.hostElement.contains(n)){if(this.isDisabled)return;for(var s=!1,r=0;r<o.length;r++){var a=o[r].style.backgroundColor;if(wijmo_1.Color.fromString(i).equals(wijmo_1.Color.fromString(a))){o[r].focus();s=!0;break}}s||o[0].focus()}};ColorPicker.prototype.getColorsDiv=function(){var e=Array.from(this._ePal.querySelectorAll('[role="columnheader"]')),t=Array.from(this._ePal.querySelectorAll('[role="gridcell"]'));return e.concat(t)};ColorPicker.prototype._getTargetPanel=function(e){var t=e.target;return wijmo_1.contains(this._eSB,t)?this._eSB:wijmo_1.contains(this._eHue,t)?this._eHue:wijmo_1.contains(this._eAlpha,t)?this._eAlpha:null};ColorPicker.prototype.getActualTabIndex=function(){var e=this.tabOrder.toString();return this.keyActionTab===ColorPickerTabKeyAction.All&&!0!==this.isDisabled?e:"-1"};ColorPicker.prototype._updateTabIndex=function(){var e=this.getActualTabIndex();this._eSB.setAttribute("tabindex",e);this._eHue.setAttribute("tabindex",e);this._eAlpha.setAttribute("tabindex",e);this._ePalMainFirst.setAttribute("tabindex",e);this._ePalShadeFirst.setAttribute("tabindex",e)};ColorPicker.prototype._setIsDisabled=function(t){e.prototype._setIsDisabled.call(this,t);this._updateTabIndex()};ColorPicker.prototype._updateAriaValues=function(){var e=this._hsb;this._eSB.setAttribute("aria-valuenow",(100*e[1]).toString());this._eSB.setAttribute("aria-valuetext",wijmo_1.culture.ColorPicker.ariaLabels.saturation+" "+Math.round(100*e[1])+"%, "+wijmo_1.culture.ColorPicker.ariaLabels.brightness+" "+Math.round(100*e[2])+"%");this._eHue.setAttribute("aria-valuenow",(360*e[0]).toString());this._eHue.setAttribute("aria-valuetext",wijmo_1.culture.ColorPicker.ariaLabels.hue+" "+Math.round(360*e[0])+" "+wijmo_1.culture.ColorPicker.ariaLabels.degrees);this._eAlpha.setAttribute("aria-valuenow",(100*this._alpha).toString());this._eAlpha.setAttribute("aria-valuetext",wijmo_1.culture.ColorPicker.ariaLabels.opacity+" "+Math.round(100*this._alpha)+"%")};ColorPicker.prototype._keydown=function(e){var t=e.target;this._isInColorPalette(t)?this._handleColorNavigation(e,t):t!==this._eSB?t!==this._eHue?t!==this._eAlpha||this._handleAlphaNavigation(e):this._handleHSBNavigation(e,"hue"):this._handleHSBNavigation(e,"sb")};ColorPicker.prototype._isInColorPalette=function(e){return e&&"DIV"===e.tagName&&wijmo_1.contains(this._ePal,e)};ColorPicker.prototype._handleColorNavigation=function(e,t){var i=this.getColorsDiv(),o=this.palette.length,n=i.findIndex((function(e){return e===t})),s=null;switch(e.key){case"ArrowDown":n<i.length-1&&(s=i[n+o]);break;case"ArrowUp":n>0&&(s=i[n-o]);break;case"ArrowRight":var r=n+1;r<i.length&&(s=i[r]);break;case"ArrowLeft":var a=n-1;a>=0&&(s=i[a])}if(s){var l=s.style.backgroundColor;l&&(this.value=new wijmo_1.Color(l).toString());s.focus();e.preventDefault()}};ColorPicker.prototype._handleHSBNavigation=function(e,t){var i=this._hsb.slice();i=i.map((function(e){return wijmo_1.roundTo(e,2)}));var adjust=function(e,t,o){var n=Math.round(100*i[e]);i[e]=wijmo_1.clamp((n+t)/100,0,o)};switch(e.key){case"ArrowLeft":"sb"===t&&adjust(1,-1,1);break;case"ArrowRight":"sb"===t&&adjust(1,1,1);break;case"ArrowUp":"sb"===t?adjust(2,1,1):adjust(0,-1,.99);break;case"ArrowDown":"sb"===t?adjust(2,-1,1):adjust(0,1,.99)}if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(e.key)){this._updateColor(i,void 0);e.preventDefault()}};ColorPicker.prototype._refreshSelection=function(){this._updatePanels();this._updateAriaValues()};ColorPicker.prototype._handleAlphaNavigation=function(e){var t=this._alpha;switch(e.key){case"ArrowLeft":t=wijmo_1.clamp(t-.01,0,1);break;case"ArrowRight":t=wijmo_1.clamp(t+.01,0,1);break;default:return}this._updateColor(void 0,t);e.preventDefault()};ColorPicker._ctrlTemplate="";ColorPicker._tplCursor='<div class="wj-colorpicker-cursor"></div>';return ColorPicker}(wijmo_1.Control);exports.ColorPicker=ColorPicker;wijmo_1._addCultureInfo("CollectionViewNavigator",{ariaLabels:{byPage:{btnFirst:"Navigate to first page",btnPrev:"Navigate to previous page",btnNext:"Navigate to next page",btnLast:"Navigate to last page"},byItem:{btnFirst:"Navigate to first item",btnPrev:"Navigate to previous item",btnNext:"Navigate to next item",btnLast:"Navigate to last item"}}});var CollectionViewNavigator=function(e){__extends(CollectionViewNavigator,e);function CollectionViewNavigator(t,i){var o=e.call(this,t)||this;o._view=null;o._byPage=!1;o._fmt="{current:n0} / {count:n0}";o._liveRegionON=!1;o._ariaLabel="";var n=o.getTemplate();o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.CollectionViewNavigatorClsNames.pager+" "+exports.CollectionViewNavigatorClsNames.hostElement,n,{_btnFirst:"btn-first",_btnPrev:"btn-prev",_txtCurr:"txt-curr",_btnNext:"btn-next",_btnLast:"btn-last"},"input");o.hostElement.tabIndex=-1;o._updateAriaLabels();var s=wijmo_1.uidGenerator();o._txtCurr.id=s;[o._btnFirst,o._btnPrev,o._btnNext,o._btnLast].forEach((function(e){wijmo_1.setAttribute(e.firstElementChild,"aria-controls",o._txtCurr.id)}));wijmo_1.setAttribute(o.hostElement.firstElementChild,"role","group");wijmo_1.setAttribute(o._txtCurr,"role","status");o._rptNext=new wijmo_1._ClickRepeater(o._btnNext.querySelector("button"));o._rptPrev=new wijmo_1._ClickRepeater(o._btnPrev.querySelector("button"));o.addEventListener(o.hostElement,"click",o._click.bind(o));o.addEventListener(o.hostElement,"keydown",o._keydown.bind(o));wijmo_1.setAttribute(o.hostElement,"role","navigation");o._addA11yRelatedHandlers();o.initialize(i);o._update();return o}Object.defineProperty(CollectionViewNavigator,"controlTemplate",{get:function(){CollectionViewNavigator._ctrlTemplate||(CollectionViewNavigator._ctrlTemplate='<div class="'+exports.InputClsNames.inputGroup+'"><span wj-part="btn-first" class="'+exports.InputClsNames.inputGroupBtn+'"><button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'"><span class="'+wijmo_1.GlyphClsNames.stepBackward+'"></span></button></span><span wj-part="btn-prev" class="'+exports.InputClsNames.inputGroupBtn+'"> <button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'"><span class="'+wijmo_1.GlyphClsNames.left+'"></span> </button></span><span wj-part="txt-curr" tabIndex="0"></span><span wj-part="btn-next" class="'+exports.InputClsNames.inputGroupBtn+'"><button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'"><span class="'+wijmo_1.GlyphClsNames.right+'"></span></button></span><span wj-part="btn-last" class="'+exports.InputClsNames.inputGroupBtn+'"><button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'"><span class="'+wijmo_1.GlyphClsNames.stepForward+'"></span></button></span></div>');return CollectionViewNavigator._ctrlTemplate},set:function(e){CollectionViewNavigator._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewNavigator.prototype,"cv",{get:function(){return this._view},set:function(e){if(e!=this._view){var t=this._view;if(t){t.collectionChanged.removeHandler(this._collectionChanged);t.currentChanged.removeHandler(this._currentChanged)}t=this._view=wijmo_1.asType(e,"ICollectionView",!0);this._update();if(t){t.collectionChanged.addHandler(this._collectionChanged,this);t.currentChanged.addHandler(this._currentChanged,this)}}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewNavigator.prototype,"byPage",{get:function(){return this._byPage},set:function(e){if(e!=this._byPage){this._byPage=wijmo_1.asBoolean(e);this._update();this._updateAriaLabels()}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewNavigator.prototype,"headerFormat",{get:function(){return this._fmt},set:function(e){if(e!=this._fmt){this._fmt=wijmo_1.asString(e);this._update()}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewNavigator.prototype,"repeatButtons",{get:function(){return!this._rptNext.disabled},set:function(e){this._rptNext.disabled=this._rptPrev.disabled=!wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewNavigator.prototype,"ariaLabel",{get:function(){if(this.hostElement){var e=this.hostElement.getAttribute("aria-label");if(e)return e}return this._ariaLabel},set:function(e){if(this.ariaLabel!==e){this._ariaLabel=e;this.hostElement&&wijmo_1.setAttribute(this.hostElement,"aria-label",e)}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewNavigator.prototype,"isDisabled",{get:function(){return this._isDisabled},set:function(e){this._setIsDisabled(e)},enumerable:!0,configurable:!0});CollectionViewNavigator.prototype.focus=function(){var e=this._e;e&&e.offsetHeight&&(this.isDisabled||wijmo_1.moveFocus(e,0)||this._txtCurr.tabIndex>=0&&this._txtCurr.focus())};CollectionViewNavigator.prototype._update=function(){var e=this._view,t=this._byPage,i=e?t?e.pageIndex:e.currentPosition:0,o=e?t?e.pageCount:e.itemCount:0;if(this.isDisabled)[this._btnFirst,this._btnPrev,this._btnNext,this._btnLast].forEach((function(e){wijmo_1.enable(e,!1)}));else{wijmo_1.enable(this._btnFirst,e&&i>0);wijmo_1.enable(this._btnPrev,e&&i>0);wijmo_1.enable(this._txtCurr,null!=e);wijmo_1.enable(this._btnNext,e&&i<o-1);wijmo_1.enable(this._btnLast,e&&i<o-1)}this._updateTabIndex();this._txtCurr.textContent=wijmo_1.format(this._fmt,{current:e?i+1:0,count:e?o:0,currentItem:e?e.currentPosition+1:0,itemCount:e?e.itemCount:0,currentPage:e?e.pageIndex+1:0,pageCount:e?e.pageCount:0})};CollectionViewNavigator.prototype._currentChanged=function(){this._update()};CollectionViewNavigator.prototype._collectionChanged=function(){this._update()};CollectionViewNavigator.prototype._click=function(e){var t=e.target,i=this._view,o=this._byPage;if(i){wijmo_1.contains(this._btnFirst,t)?o?i.moveToFirstPage():i.moveCurrentToFirst():wijmo_1.contains(this._btnPrev,t)?o?i.moveToPreviousPage():i.moveCurrentToPrevious():wijmo_1.contains(this._btnNext,t)?o?i.moveToNextPage():i.moveCurrentToNext():wijmo_1.contains(this._btnLast,t)&&(o?i.moveToLastPage():i.moveCurrentToLast());(this.byPage?i.pageIndex>=i.pageCount-1||i.pageIndex<=0:i.currentPosition>=i.itemCount-1||i.currentPosition<=0)&&!this.isDisabled&&this._txtCurr.tabIndex>=0&&this._txtCurr.focus();e.preventDefault()}};CollectionViewNavigator.prototype._updateAriaLabels=function(){var e=wijmo_1.culture.CollectionViewNavigator.ariaLabels[this._byPage?"byPage":"byItem"];wijmo_1.setAttribute(this._btnFirst.firstElementChild,"aria-label",e.btnFirst);wijmo_1.setAttribute(this._btnPrev.firstElementChild,"aria-label",e.btnPrev);wijmo_1.setAttribute(this._btnNext.firstElementChild,"aria-label",e.btnNext);wijmo_1.setAttribute(this._btnLast.firstElementChild,"aria-label",e.btnLast)};CollectionViewNavigator.prototype._addA11yRelatedHandlers=function(){var e=this;this.addEventListener(this._txtCurr,"focus",(function(t){if(e._txtCurr===document.activeElement){wijmo_1.setAttribute(e._txtCurr,"aria-live","off");wijmo_1.setAttribute(e._txtCurr,"aria-label",e._txtCurr.textContent);e._liveRegionON=!1}}));this.addEventListener(this._txtCurr,"blur",(function(t){e._txtCurr!==document.activeElement&&e._txtCurr.removeAttribute("aria-label")}));[this._btnFirst.firstElementChild,this._btnPrev.firstElementChild,this._btnNext.firstElementChild,this._btnLast.firstElementChild].forEach((function(t){e.addEventListener(t,"focus",(function(t){setTimeout((function(){if(!e._liveRegionON){var t=wijmo_1._isMacOS()?"polite":"assertive";wijmo_1.setAttribute(e._txtCurr,"aria-live",t);e._liveRegionON=!0}}))}))}))};CollectionViewNavigator.prototype._setTabOrder=function(e){var t=this._e,i=null!=this._txtCurr.getAttribute("disabled");this._orgTabIndex=e;if(this.isDisabled||i){t.tabIndex=-1;this._txtCurr.tabIndex=-1}else i||(this._txtCurr.tabIndex=this._orgTabIndex)};CollectionViewNavigator.prototype._keydown=function(e){if(wijmo_1.contains(this._txtCurr,e.target)&&(e.ctrlKey||e.metaKey)&&("A"===e.key||"a"===e.key)){e.preventDefault();var t=document.createRange();t.selectNodeContents(this._txtCurr);var i=window.getSelection();i.removeAllRanges();i.addRange(t)}};CollectionViewNavigator.prototype._setIsDisabled=function(e){if((e=!!wijmo_1.asBoolean(e,!0))!=this.isDisabled){var t=this._e;if(t){this._isDisabled=e;wijmo_1.toggleClass(t,wijmo_1.ControlStateClsNames.disabled,e);this._update();this._txtCurr.tabIndex=e?-1:this._orgTabIndex}}};CollectionViewNavigator.prototype._updateTabIndex=function(){var e=this;[this._btnFirst,this._btnPrev,this._btnNext,this._btnLast].forEach((function(t){if(e._isDisabled)t.firstElementChild.setAttribute("tabindex","-1");else{t.firstElementChild.disabled?t.firstElementChild.setAttribute("tabindex","-1"):t.firstElementChild.setAttribute("tabindex",e._orgTabIndex.toString())}}))};CollectionViewNavigator._ctrlTemplate="";return CollectionViewNavigator}(wijmo_1.Control);exports.CollectionViewNavigator=CollectionViewNavigator;wijmo_1._addCultureInfo("Listbox",{ariaLabels:{listBox:"list box"}});var ListBox=function(e){__extends(ListBox,e);function ListBox(t,i){var o=e.call(this,t,null,!0)||this;o._cv=null;o._itemFormatter=null;o._pathDisplay=new wijmo_1.Binding("");o._pathValue=new wijmo_1.Binding("");o._pathChecked=new wijmo_1.Binding("");o._html=!1;o._shGroups=!1;o._checkedItems=[];o._itemRole="option";o._caseSensitive=!1;o._addMode=!1;o._isShiftDown=!1;o._shouldClearOnShift=!0;o._vThreshold=ListBox._VTHRESH;o._isVirtual=!1;o._children=[];o._ignoreItemFormatterTextArray=[];o._itemFormatterHelper=document.createElement("div");o._clientHeight=-1;o._itemHeight=30;o._itemsAbove=-1;o._itemsBelow=-1;o._eSizer=document.createElement("div");o._ePadTop=document.createElement("div");o._ePadBot=document.createElement("div");o._checking=!1;o._ignoredItemChangedEvents=!1;o._search="";o._fmtItemHandlers=0;o._itemCount=0;o._oldSel=null;o._container=null;o._oldSelectedIndex=-1;o._ariaLabel=wijmo_1.culture.Listbox.ariaLabels.listBox;o._isNeedUpdateBnd=!0;o.selectedIndexChanged=new wijmo_1.Event;o.itemsChanged=new wijmo_1.Event;o.loadingItems=new wijmo_1.Event;o.loadedItems=new wijmo_1.Event;o.itemChecked=new wijmo_1.Event;o.checkedItemsChanged=new wijmo_1.Event;o.formatItem=new wijmo_1.Event((function(){o.invalidate()}));o._handleKeyUp=function(e){if("Shift"===e.key){o._isShiftDown=!1;o._shouldClearOnShift=!0}};o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.ListBoxClsNames.hostElement,null,null);var n=o.hostElement;wijmo_1.setAttribute(n,"role","listbox",!0);o._updateAriaLabel();"SELECT"==o._orgTag&&o._initFromSelect(o.hostElement);o.addEventListener(n,"click",o._click.bind(o));o.addEventListener(n,"keydown",o._keydown.bind(o));o.addEventListener(n,"keypress",o._keypress.bind(o));o.addEventListener(n,"keyup",o._handleKeyUp.bind(o));o.addEventListener(n,"wheel",(function(e){if(n.scrollHeight>n.offsetHeight&&(e.deltaY<0&&0==n.scrollTop||e.deltaY>0&&n.scrollTop+n.offsetHeight>=n.scrollHeight)){e.preventDefault();e.stopPropagation();e.stopImmediatePropagation()}}));[o._eSizer,o._ePadTop,o._ePadBot].forEach((function(e){e.tabIndex=-1;wijmo_1.setAttribute(e,"aria-hidden",!0);wijmo_1.setCss(e,{pointerEvents:"none",opacity:"0"})}));o.initialize(i);o._updateViewRange();o.addEventListener(o.hostElement,"scroll",(function(e){o._updateViewRange()}));return o}Object.defineProperty(ListBox.prototype,"ariaLabelledBy",{get:function(){return this.hostElement.getAttribute("aria-labelledby")},set:function(e){wijmo_1._setAriaLabelBy(this,this.hostElement,e,this._updateAriaLabel.bind(this))},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"itemsSource",{get:function(){return this._items},set:function(e){if(this._items!=e){if(this._cv){this._cv.currentChanged.removeHandler(this._cvCurrentChanged,this);this._cv.collectionChanged.removeHandler(this._cvCollectionChanged,this);this._cv=null}this._items=e;this._cv=wijmo_1.asCollectionView(e);if(null!=this._cv){this._cv.currentChanged.addHandler(this._cvCurrentChanged,this);this._cv.collectionChanged.addHandler(this._cvCollectionChanged,this)}this._populateList();this.onItemsChanged();this.onSelectedIndexChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"collectionView",{get:function(){return this._cv},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"virtualizationThreshold",{get:function(){return this._vThreshold},set:function(e){if(e!=this._vThreshold){var t=this._getVirtual();this._vThreshold=wijmo_1.asNumber(e,!1,!0);t!=this._getVirtual()&&this._populateList()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"showGroups",{get:function(){return this._shGroups},set:function(e){if(e!=this._shGroups){this._shGroups=wijmo_1.asBoolean(e);this._populateList()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"isContentHtml",{get:function(){return this._html},set:function(e){if(e!=this._html){this._html=wijmo_1.asBoolean(e);this._populateList()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"itemFormatter",{get:function(){return this._itemFormatter},set:function(e){if(e!=this._itemFormatter){this._itemFormatter=wijmo_1.asFunction(e);this._populateList()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"displayMemberPath",{get:function(){return this._pathDisplay.path},set:function(e){if(e!=this.displayMemberPath){this._pathDisplay.path=wijmo_1.asString(e);this._populateList()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"selectedValuePath",{get:function(){return this._pathValue.path},set:function(e){this._pathValue.path=wijmo_1.asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"checkedMemberPath",{get:function(){return this._pathChecked.path},set:function(e){if(e!=this.checkedMemberPath){this._pathChecked.path=wijmo_1.asString(e);wijmo_1.setAttribute(this.hostElement,"aria-multiselectable",""!==this.checkedMemberPath?"true":"false");this._populateList()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"caseSensitiveSearch",{get:function(){return this._caseSensitive},set:function(e){this._caseSensitive=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"itemRole",{get:function(){return this._itemRole},set:function(e){if(e!=this.itemRole){this._itemRole=wijmo_1.asString(e);this._populateList()}},enumerable:!0,configurable:!0});ListBox.prototype.getDisplayValue=function(e,t){var i=null;if(e>-1&&wijmo_1.hasItems(this._cv)){i=this._cv.items[e];this.displayMemberPath&&(i=this._pathDisplay.getValue(i))}var o=null!=i?i.toString():"";this._itemFormatter&&!t&&(o=this._itemFormatter(e,o));return o};ListBox.prototype.getDisplayText=function(e){return this._getDisplayText(e)};ListBox.prototype._getDisplayText=function(e,t){if(t&&this._ignoreItemFormatterTextArray[e])return this._ignoreItemFormatterTextArray[e];var i=this._getChild(e);return null!=i?i.textContent:""};ListBox.prototype.isItemEnabled=function(e){var t=this._getChild(e);return null!=t&&!t.hasAttribute("disabled")&&!wijmo_1.hasClass(t,wijmo_1.ControlStateClsNames.disabled)&&!wijmo_1.hasClass(t,wijmo_1.UtilitesClsNames.separator)};Object.defineProperty(ListBox.prototype,"selectedIndex",{get:function(){return this._cv?this._cv.currentPosition:-1},set:function(e){if(this._cv){this._oldSelectedIndex=this._cv.currentPosition;this._cv.moveCurrentToPosition(wijmo_1.asNumber(e))}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"selectedItem",{get:function(){return this._cv?this._cv.currentItem:null},set:function(e){this._cv&&this._cv.moveCurrentTo(e)},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"selectedValue",{get:function(){var e=this.selectedItem;e&&this.selectedValuePath&&(e=this._pathValue.getValue(e));return e},set:function(e){var t=this._cv,i=t?t.items:null,o=this.selectedValuePath,n=-1;if(i){for(var s=0;s<i.length;s++){var r=i[s],a=o?this._pathValue.getValue(r):r;if(a===e||wijmo_1.DateTime.equals(a,e)){n=s;break}if(this.isContentHtml&&wijmo_1.isString(a)&&a.indexOf("<")>-1&&wijmo_1.toPlainText(a)===e){n=s;break}}this.selectedIndex=n}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"maxHeight",{get:function(){var e=this.hostElement,t=e?parseFloat(e.style.maxHeight):null;return isNaN(t)?null:t},set:function(e){var t=this.hostElement;if(t){e=wijmo_1.asNumber(e,!0);t.style.maxHeight=null==e?"":e+"px"}},enumerable:!0,configurable:!0});ListBox.prototype.showSelection=function(e){void 0===e&&(e=this.containsFocus());var t=this.hostElement,i=this._children,o=this._getSelectedElement(!1),n=new wijmo_1.Rect(0,0,0,0);if(o!=this._oldSel){this._updateItemAttributes(o,!0);this._updateItemAttributes(this._oldSel,!1);this._oldSel=o}o instanceof HTMLElement?n=this._getBoundingClientRect(o):this._children.length>0&&(n=this._getBoundingClientRect(this._getChild(0)));var s=this._getBoundingClientRect(t),r=0;if(this._shGroups){r=this._itemHeight;if(!this._isVirtual){var a=i[0];a&&a.offsetHeight&&wijmo_1.hasClass(a,exports.ListBoxClsNames.header)&&(r=a.offsetHeight)}}n.bottom>s.bottom?t.scrollTop+=n.bottom-s.bottom:n.top<s.top+r&&(t.scrollTop-=s.top+r-n.top);this._updateViewRange();o=this._getSelectedElement(!0);wijmo_1.setAttribute(t,"aria-activedescendant",o?o.id:null);if(e){(o&&!wijmo_1.contains(o,wijmo_1.getActiveElement())?o:t).focus()}t.tabIndex=o?-1:this._orgTabIndex};ListBox.prototype.loadList=function(){this._populateList()};ListBox.prototype.getItemChecked=function(e){var t=this._cv.items[e],i=this._pathChecked;return wijmo_1.isObject(t)&&i.path?i.getValue(t):this._getCheckboxState(e)};ListBox.prototype.setItemChecked=function(e,t){this._setItemChecked(e,t,!0)};ListBox.prototype.toggleItemChecked=function(e){this.setItemChecked(e,!this.getItemChecked(e))};Object.defineProperty(ListBox.prototype,"checkedItems",{get:function(){return this._checkedItems},set:function(e){e=Array.from(new Set(e));var t=wijmo_1.asArray(e,!1);if(!this._arrayEquals(t,this._checkedItems)){this._updateCheckedList(t);if(!this._arrayEquals(t,this._checkedItems)){this._checkedItems=t;this.onCheckedItemsChanged()}}},enumerable:!0,configurable:!0});ListBox.prototype.indexOf=function(e){return(e=wijmo_1.closest(e,"."+exports.ListBoxClsNames.listBoxItem))?e[ListBox._DIDX_KEY]:-1};ListBox.prototype.onSelectedIndexChanged=function(e){this.selectedIndexChanged.raise(this,e)};ListBox.prototype.onItemsChanged=function(e){this.itemsChanged.raise(this,e)};ListBox.prototype.onLoadingItems=function(e){this.loadingItems.raise(this,e)};ListBox.prototype.onLoadedItems=function(e){this.loadedItems.raise(this,e)};ListBox.prototype.onItemChecked=function(e){this.itemChecked.raise(this,e)};ListBox.prototype.onCheckedItemsChanged=function(e){this.checkedItemsChanged.raise(this,e)};ListBox.prototype.onFormatItem=function(e){this.formatItem.raise(this,e)};ListBox.prototype.refresh=function(t){void 0===t&&(t=!0);e.prototype.refresh.call(this,t);if(this.hostElement){var i=this._cv?this._cv.items.length:0,o=this.formatItem.handlerCount;if(i!=this._itemCount||o!=this._fmtItemHandlers){this._fmtItemHandlers=o;this._populateList()}else this._updateViewRange()}};ListBox.prototype._updateAriaLabel=function(){this.hostElement&&(this.ariaLabelledBy?wijmo_1.setAriaLabel(this.hostElement,null):wijmo_1.setAriaLabel(this.hostElement,this._ariaLabel))};ListBox.prototype._updateCheckedList=function(e){var t=this,i=this._cv,o=this._pathChecked,n=new Map;if(o&&i){var s=i.sourceCollection;if(s&&s.length){wijmo_1.isObject(s[0])||(o=null);e.forEach((function(e){n.set(e,!0)}));this._checking=!0;var r=[];s.forEach((function(e){var i=n.has(e);i&&r.push(e);o&&t._isNeedUpdateBnd&&o.setValue(e,i)}));this._checking=!1;e=r}i.items.forEach((function(e,i){t._setItemChecked(i,n.has(e),!1)}))}};ListBox.prototype._getBoundingClientRect=function(e){if(!e.offsetHeight){var t=this.indexOf(e),i=this.hostElement;if(t>-1&&i){t=this._getElementIndex(t);var o=i.getBoundingClientRect();return new wijmo_1.Rect(0,o.top-i.scrollTop+t*this._itemHeight,o.width,this._itemHeight)}}return wijmo_1.Rect.fromBoundingRect(e.getBoundingClientRect())};ListBox.prototype._updateItemAttributes=function(e,t){if(e){var i=this.checkedMemberPath?"true"===e.getAttribute("aria-selected"):null;wijmo_1.toggleClass(e,wijmo_1.ControlStateClsNames.selected,t);this._isMenuItem()||wijmo_1.setAttribute(e,"aria-selected",this._getAriaSelected(t,i));e.tabIndex=t?this._orgTabIndex:-1}};ListBox.prototype._getCheckedItems=function(){var e=this,t=this._cv,i=this._pathChecked,o=[];t&&i&&i.path&&(o=t.sourceCollection.filter((function(o,n){if(t.filter&&!t.filter(o))return!!e._addMode&&i.getValue(o);if(wijmo_1.isObject(o))return i.getValue(o);var s=t.items[n]==o?n:t.items.indexOf(o);return e.getItemChecked(s)})));return o};ListBox.prototype._arrayEquals=function(e,t){if(e==t)return!0;if(!e||!t||e.length!=t.length)return!1;for(var i=0;i<e.length;i++)if(!this._isEqual(e[i],t[i]))return!1;return!0};ListBox.prototype._getChild=function(e){e=this._getElementIndex(e);return this._children[e]};ListBox.prototype._getElementIndex=function(e){if(this._shGroups)for(var t=this._children,i=0;i<=e&&i<t.length;i++){var o=t[i];wijmo_1.hasClass(o,exports.ListBoxClsNames.header)&&e++}return e};ListBox.prototype._setItemChecked=function(e,t,i){void 0===i&&(i=!0);var o=this._cv.items[e],n=this._pathChecked,s=!1,r=this.selectedIndex,a=this._checking;if(wijmo_1.isObject(o)&&n.path){if(!!n.getValue(o)!=t){var l=wijmo_1.tryCast(this._cv,"IEditableCollectionView");s=!0;this._checking=!0;if(l){l.editItem(o);n.setValue(o,t);l.commitEdit()}else{n.setValue(o,t);l.refresh()}this._checking=a}}else if(i){var h=this._findArrayItem(this._checkedItems,o);(t&&h<0||!t&&h>=0)&&(s=!0)}this._setCheckboxState(e,t);if(i){if(s){this._checkedItems=this._checkedItemsUpdate(o,t);this.onItemChecked();this.onCheckedItemsChanged()}r!=this.selectedIndex&&this.onSelectedIndexChanged()}return s};ListBox.prototype._checkedItemsUpdate=function(e,t){var i=this._cv.sourceCollection,o=this._checkedItems,n=0;if(t){for(var s=0;s<i.length;s++){var r=i[s];if(n<o.length&&this._isEqual(r,o[n]))n++;else if(this._isEqual(r,e))return o.slice(0,n).concat([e]).concat(o.slice(n))}return o}var a=this._findArrayItem(o,e);return o.slice(0,a).concat(o.slice(a+1))};ListBox.prototype._isEqual=function(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)};ListBox.prototype._findArrayItem=function(e,t){if(!Number.isNaN(t))return e.indexOf(t);for(var i=0;i<e.length;i++)if(Number.isNaN(e[i]))return i;return-1};ListBox.prototype._cvCollectionChanged=function(){if(!this._checking){this._populateList();this.onItemsChanged()}};ListBox.prototype._cvCurrentChanged=function(){if(!this._checking){this.showSelection();this._ignoredItemChangedEvents||this.onSelectedIndexChanged()}};ListBox.prototype._populateList=function(){var e=this.hostElement,t=this._cv;this._itemCount=t?t.items.length:0;this._isVirtual=this._getVirtual();this._oldSel=null;this._itemsAbove=-1;this._itemsBelow=-1;if(e){var i=this.containsFocus(),o=void 0;this.onLoadingItems();this._children=[];var n=this._children;e.textContent="";if(t){var s=0,r=void 0,a=[];this._ignoreItemFormatterTextArray=[];if(this._shGroups&&t.groups&&t.groups.length){o={};for(var l=0;l<t.groups.length;l++){var h=t.groups[l];o[s]=h;r=this._createHeaderItem(h,l);a.push(r);for(var u=0;u<h.items.length;u++,s++){r=this._createItem(s,l);a.push(r)}}}else for(u=0;u<t.items.length;u++,s++){r=this._createItem(s);a.push(r)}var c=this._isVirtual?document.createElement("div"):e,p=0;wijmo_1.setInnerHTMLSafe(c,a.join(""));for(u=0;u<c.children.length;u++){var d=c.children[u];p==t.currentPosition&&(this._oldSel=d);d[ListBox._DIDX_KEY]=d.className.indexOf(exports.ListBoxClsNames.header)<0?p++:-1;n.push(d)}}if(this.formatItem.hasHandlers&&t){s=0;var _=t.items;for(d=new FormatItemEventArgs(0,null,null),u=0;u<n.length;u++){d._item=n[u];if(this._shGroups&&wijmo_1.hasClass(d._item,exports.ListBoxClsNames.header)){d._index=-1;d._data=o[s]}else{d._index=s;d._data=_[s++]}this.onFormatItem(d)}}if(this._isVirtual){var m=this._getCanvasContext(),f=null,b=0;for(u=0;u<n.length;u++){r=n[u];var g=m.measureText(r.textContent);if(g.width>b){f=r;b=g.width}}if(f){var w=!1,y=e.style.display,v=e.style.position;if(!e.parentElement){w=!0;(this._container||document.body).appendChild(e);wijmo_1.setCss(e,{display:"",position:"absolute"})}e.appendChild(f);var x=f.style.whiteSpace;f.style.whiteSpace="nowrap";this._ePadTop.style.width=f.offsetWidth+"px";this._itemHeight=f.offsetHeight||this._itemHeight;f.style.whiteSpace=x;this._eSizer.style.height=n.length*this._itemHeight+"px";e.appendChild(this._eSizer);this._clientHeight=e.clientHeight;wijmo_1.removeChild(this._eSizer);if(w){wijmo_1.removeChild(e);wijmo_1.setCss(e,{display:y,position:v})}wijmo_1.removeChild(f)}else this._ePadTop.style.width="";this._updateViewRange()}this.checkedItems=this._getCheckedItems();var C=this._getSelectedElement(!0);if(i){(C||e).focus()}else C&&this.showSelection();e.tabIndex=C?-1:this._orgTabIndex;this.onLoadedItems()}};ListBox.prototype._getCanvasContext=function(){var e=document.createElement("canvas").getContext("2d"),t=getComputedStyle(this.hostElement);t.fontSize&&t.fontFamily&&(e.font=t.fontSize+" "+t.fontFamily.split(",")[0]);return e};ListBox.prototype._getVirtual=function(){if(this._itemCount<=this._vThreshold)return!1;var e=this.hostElement;if(e){var t=getComputedStyle(e);if(parseInt(t.columnCount)>1||t.display.indexOf("flex")>-1||t.display.indexOf("grid")>-1)return!1}return!0};ListBox.prototype._getMaxSupportedCssHeight=function(){var e=265e5;wijmo_1.isIE()?e=15e5:wijmo_1.isFirefox()&&(e=175e5);return e};ListBox.prototype._updateViewRange=function(){var e=this.hostElement,t=this._itemHeight,i=this._children;if(!(e&&e.parentElement&&this._isVirtual&&i))return!1;var o=e.scrollTop;wijmo_1.assert(t*i.length<this._getMaxSupportedCssHeight(),"The number of items ("+i.length+") exceeds the maximum number of items ("+Math.floor(this._getMaxSupportedCssHeight()/t)+") allowed for this browser.");var n=Math.max(e.clientHeight,this._clientHeight),s=Math.floor(o/t),r=Math.min(i.length,Math.ceil((o+n)/t)-s),a=Math.max(0,i.length-s-r);if(s==this._itemsAbove&&a==this._itemsBelow)return!1;this._itemsAbove=s;this._itemsBelow=a;var l=document.createDocumentFragment(),h=this.containsFocus();this._ePadTop.style.height=s*t+"px";l.appendChild(this._ePadTop);if(this.showGroups&&!wijmo_1.hasClass(i[s],exports.ListBoxClsNames.header))for(var u=s;u>=0;u--)if(wijmo_1.hasClass(i[u],exports.ListBoxClsNames.header)){l.appendChild(i[u]);break}for(u=s;u<=s+r&&u<i.length;u++)l.appendChild(i[u]);this._ePadBot.style.height=a*t+"px";l.appendChild(this._ePadBot);e.textContent="";e.appendChild(l);var c=(s+r+a)*t-e.scrollHeight;this._ePadBot.style.height=this._ePadBot.offsetHeight-c+"px";var p=this._getSelectedElement(!0);if(h){(p||e).focus({preventScroll:!0})}e.tabIndex=p?-1:this._orgTabIndex;return!0};ListBox.prototype._getSelectedElement=function(e){var t=this.selectedIndex,i=this._getElementIndex(t),o=i>-1?this._children[i]:null;e&&o&&!o.offsetHeight&&(o=null);return o};ListBox.prototype._handleResize=function(){this._updateViewRange()};ListBox.prototype._createItem=function(e,t){var i=this._cv.items[e],o=e==this._cv.currentPosition,n=this.getDisplayValue(e),s=this.getDisplayValue(e,void 0!==this.itemFormatter);if(1!=this._html){n=wijmo_1.escapeHtml(n);s=wijmo_1.escapeHtml(s)}s=s.replace(/\bstyle\s*=/gi,"data-style=");this._itemFormatterHelper.innerHTML=s;s=this._itemFormatterHelper.textContent;this._ignoreItemFormatterTextArray.push(s);var r=null;if(this.checkedMemberPath){r=!1;wijmo_1.isObject(i)?r=!!this._pathChecked.getValue(i):this._checkedItems&&(r=this._checkedItems.indexOf(i)>-1);n='<label class="wj-checklist-item"><span class="wj-checklist-base" role="checkbox" aria-hidden="true"><span class="wj-checklist-mark"></span></span><span class="wj-checklist-caption">'+n+"</span></label>"}var a=exports.ListBoxClsNames.listBoxItem;o&&(a+=" "+wijmo_1.ControlStateClsNames.selected);r&&(a+=" "+wijmo_1.ControlStateClsNames.checked);if(this._html){var l=[wijmo_1.UtilitesClsNames.separator,wijmo_1.ControlStateClsNames.disabled];if(n.indexOf(l[0])>-1||n.indexOf(l[1])>-1){var h=wijmo_1.createElement(n);l.forEach((function(e){wijmo_1.hasClass(h,e)&&(a+=" "+e)}))}}var u="aria-describedby = listGroup-"+t;return'<div id="'+("listitem-"+e)+'" class="'+a+'" \n role="'+this.itemRole+'" \n '+(void 0!==t?u:"")+"\n "+(this._getAriaSelected(o,r)&&!this._isMenuItem()?'aria-selected="true"':"")+' \n tabindex="'+(o&&!this.isDisabled?this._orgTabIndex:-1)+'">'+n+"</div>"};ListBox.prototype._getAriaSelected=function(e,t){return!!(null!=t?t:e)||null};ListBox.prototype._createHeaderItem=function(e,t){var i=wijmo_1.escapeHtml(e.name);return'<div id="listGroup-'+t+'" class="'+exports.ListBoxClsNames.listBoxItem+" "+exports.ListBoxClsNames.header+" "+wijmo_1.ControlStateClsNames.disabled+'" role="group" tabindex="-1">'+i+"</div>"};ListBox.prototype._click=function(e){if(0==e.button&&!e.defaultPrevented){var t=this.indexOf(e.target);if(t>-1){this.selectedIndex=t;if(this.checkedMemberPath){var i=this._getCheckbox(t);if(i){var o=wijmo_1.closest(i,".wj-listbox-item");if(e.target==i||e.target==o){o.focus({preventScroll:!0});this.setItemChecked(t,i.checked)}}else{var n=this._children[this._getElementIndex(t)];if(n){n.focus({preventScroll:!0});this.setItemChecked(t,"true"!==n.getAttribute("aria-selected"))}}}else{(o=wijmo_1.closest(e.target,"."+exports.ListBoxClsNames.listBoxItem)).focus({preventScroll:!0})}}}};ListBox.prototype._keydown=function(e){var t=this.selectedIndex;if(!e.defaultPrevented){if(65==e.keyCode&&(e.ctrlKey||e.metaKey)){var i=this.collectionView;if(this.checkedMemberPath&&wijmo_1.hasItems(i)){for(var o=this._children,n=[],s=!0,r=0;r<o.length;r++)if(!wijmo_1.hasClass(o[r],wijmo_1._CLS_STATE_DISABLED)){var a=i.items[r];n.push(a);s&&!this.checkedItems.includes(a)&&(s=!1)}n.length!==i.items.length?this.checkedItems=s?this.checkedItems.filter((function(e){return!n.includes(e)})):this.checkedItems.concat(n):this.checkedItems=this.checkedItems.length!=i.items.length?i.items:[];e.preventDefault();return}}if(!e.altKey&&!e.metaKey){e.shiftKey&&(this._isShiftDown=!0);switch(e.keyCode){case wijmo_1.Key.Down:e.preventDefault();this._selectNext(e.shiftKey);break;case wijmo_1.Key.Up:e.preventDefault();this._selectPrev(e.shiftKey);break;case wijmo_1.Key.Home:e.preventDefault();e.ctrlKey&&e.shiftKey?this._selectRange(0):this._selectFirst();break;case wijmo_1.Key.End:e.preventDefault();e.ctrlKey&&e.shiftKey?this._selectRange(this._children.length-1):this._selectLast();break;case wijmo_1.Key.PageDown:e.preventDefault();this._selectNextPage();break;case wijmo_1.Key.PageUp:e.preventDefault();this._selectPrevPage();break;case wijmo_1.Key.Space:if(this.checkedMemberPath&&t>-1){var l=this._children[this._getElementIndex(t)];if(l&&this.isItemEnabled(t)&&!l.hasAttribute("disabled")){var h="true"===l.getAttribute("aria-selected");this.setItemChecked(t,!h);e.preventDefault()}}}}}};ListBox.prototype._getCheckboxState=function(e){var t=this._children[this._getElementIndex(e)];if(t)return"true"===t.getAttribute("aria-selected")};ListBox.prototype._setCheckboxState=function(e,t){var i=this._getElementIndex(e),o=this._children[i];if(o){if(o.querySelector(".wj-checklist-mark")){o.setAttribute("aria-selected",t.toString());wijmo_1.toggleClass(o,wijmo_1.ControlStateClsNames.checked,t)}else{var n=this._getCheckbox(i);if(n){n.checked=t;var s=wijmo_1.closest(n,"."+exports.ListBoxClsNames.listBoxItem);if(s){wijmo_1.toggleClass(s,wijmo_1.ControlStateClsNames.checked,t);wijmo_1.setAttribute(s,"aria-selected",!!t||null)}}}}};ListBox.prototype._getCheckbox=function(e){var t=this._children;return this.hostElement&&e>-1&&e<t.length?t[e].querySelector("input[type=checkbox]"):null};ListBox.prototype._keypress=function(e){var t=this;if(!e.defaultPrevented&&!(e.target instanceof HTMLInputElement)&&(e.charCode>32||32==e.charCode&&this._search)){e.preventDefault();this._search+=String.fromCharCode(e.charCode);this._toSearch&&clearTimeout(this._toSearch);this._toSearch=setTimeout((function(){t._toSearch=null;t._search=""}),wijmo_1.Control._SEARCH_DELAY);var i=this._findNext();if(i<0&&this._search.length>1){this._search=this._search[this._search.length-1];i=this._findNext()}i>-1&&(this.selectedIndex=i)}};ListBox.prototype._selectNext=function(e){void 0===e&&(e=!1);var t=this.selectedIndex,i=this._findNextEnabled(t+1);if(i>-1){e&&this._selectRange(i);this.selectedIndex=i}return i>-1};ListBox.prototype._selectPrev=function(e){void 0===e&&(e=!1);var t=this.selectedIndex,i=this._findPrevEnabled(t-1);if(i>-1){e&&this._selectRange(i);this.selectedIndex=i}return i>-1};ListBox.prototype._findNextEnabled=function(e){for(var t=e;t<this._children.length;t++)if(this.isItemEnabled(t))return t;return-1};ListBox.prototype._findPrevEnabled=function(e){for(var t=e;t>=0;t--)if(this.isItemEnabled(t))return t;return-1};ListBox.prototype._selectFirst=function(){for(var e=0;e<this._children.length;e++)if(this.isItemEnabled(e)){this.selectedIndex=e;return!0}return!1};ListBox.prototype._selectLast=function(){for(var e=this._children.length-1;e>=0;e--)if(this.isItemEnabled(e)){this.selectedIndex=e;return!0}return!1};ListBox.prototype._selectNextPage=function(){var e=this.hostElement.offsetHeight,t=this._children,i=this._cv?this._cv.items.length:0,o=0;if(e>0)for(var n=this.selectedIndex+1;n<i;n++){var s=t[n].scrollHeight||this._itemHeight;if(o+s>e&&this.isItemEnabled(n)){this.selectedIndex=n;return!0}o+=s}return this._selectLast()};ListBox.prototype._selectPrevPage=function(){var e=this.hostElement.offsetHeight,t=this._children,i=0;if(e>0)for(var o=this.selectedIndex-1;o>0;o--){var n=t[o].scrollHeight||this._itemHeight;if(i+n>e&&this.isItemEnabled(o)){this.selectedIndex=o;return!0}i+=n}return this._selectFirst()};ListBox.prototype._findNext=function(){if(this.hostElement){var e=this._children.length,t=this.selectedIndex;(t<0||1==this._search.length)&&t++;var i=this._search,o=this.caseSensitiveSearch;o||(i=i.toLowerCase());for(var n=0;n<e;n++){var s=(t+n)%e;if(this.isItemEnabled(s)){var r=this.getDisplayText(s).trim();o||(r=r.toLowerCase());if(0==r.indexOf(i))return s}}}return-1};ListBox.prototype._initFromSelect=function(e){for(var t=e.children,i=[],o=-1,n=0;n<t.length;n++){var s=t[n];if("OPTION"==s.tagName){s.hasAttribute("selected")&&(o=i.length);s.innerHTML?i.push({hdr:s.innerHTML,val:s.getAttribute("value"),cmdParam:s.getAttribute("cmd-param")}):i.push({hdr:'<div class="'+wijmo_1.UtilitesClsNames.separator+'"></div>'});e.removeChild(s);n--}}if(i){this.displayMemberPath="hdr";this.selectedValuePath="val";this.itemsSource=i;this.selectedIndex=o}};ListBox.prototype._setIsDisabled=function(t){e.prototype._setIsDisabled.call(this,t);this._updateTabIndex()};ListBox.prototype._setTabOrder=function(t){e.prototype._setTabOrder.call(this,t);this.isDisabled||this._updateTabIndex()};ListBox.prototype._isMenuItem=function(){return"menuitem"===this.itemRole||"menuitemcheckbox"===this.itemRole||"menuitemradio"===this.itemRole};ListBox.prototype._updateTabIndex=function(){var e=this.hostElement,t=this._getSelectedElement(!0);if(t){t.tabIndex=this.isDisabled?-1:this._orgTabIndex;e.tabIndex=-1}else e.tabIndex=this.isDisabled?-1:this._orgTabIndex};ListBox.prototype._selectRange=function(e){if(-1!==this.selectedIndex){if(this._shouldClearOnShift&&this._isShiftDown){this.checkedItems=[];this._shouldClearOnShift=!1}var t=Math.min(this.selectedIndex,e),i=Math.max(this.selectedIndex,e),o=this.collectionView.items.slice(t,i+1);this.checkedItems=Array.from(new Set(this.checkedItems.concat(o)))}};ListBox.prototype.dispose=function(){if(this._cv){this._cv.collectionChanged.removeHandler(this._cvCollectionChanged,this);this._cv.currentChanged.removeHandler(this._cvCurrentChanged,this);this._cv=null}this._items=null;if(this._toSearch){clearTimeout(this._toSearch);this._toSearch=null}this._children=null;this._eSizer=null;this._ePadTop=null;this._ePadBot=null;this._itemFormatterHelper=null;this._ignoreItemFormatterTextArray=null;this._checkedItems=null;e.prototype.dispose.call(this)};ListBox._DIDX_KEY="$WJ-DIDX";ListBox._VTHRESH=Number.MAX_VALUE/2;return ListBox}(wijmo_1.Control);exports.ListBox=ListBox;var FormatItemEventArgs=function(e){__extends(FormatItemEventArgs,e);function FormatItemEventArgs(t,i,o){var n=e.call(this)||this;n._index=wijmo_1.asNumber(t);n._data=i;n._item=wijmo_1.asType(o,HTMLElement,!0);return n}Object.defineProperty(FormatItemEventArgs.prototype,"index",{get:function(){return this._index},enumerable:!0,configurable:!0});Object.defineProperty(FormatItemEventArgs.prototype,"data",{get:function(){return this._data},enumerable:!0,configurable:!0});Object.defineProperty(FormatItemEventArgs.prototype,"item",{get:function(){return this._item},enumerable:!0,configurable:!0});return FormatItemEventArgs}(wijmo_1.EventArgs);exports.FormatItemEventArgs=FormatItemEventArgs;wijmo_1._addCultureInfo("MultiSelectListBox",{filterPlaceholder:"Filter",selectAll:"Select All",ariaLabels:{multiSelectListBox:"Multi select list box"}});var DateSelectionMode,ShowMonthPicker,CalendarTabKeyAction,MultiSelectListBox=function(e){__extends(MultiSelectListBox,e);function MultiSelectListBox(t,i){var o=e.call(this,t)||this;o._ariaLabel=wijmo_1.culture.MultiSelectListBox.ariaLabels.multiSelectListBox;o._selectAllLabel=null;o._filterPlaceholder=null;o._filterText="";o._checkOnFilter=!0;o._delay=wijmo_1.Control._SEARCH_DELAY;o.checkedItemsChanged=new wijmo_1.Event;o.selectedIndexChanged=new wijmo_1.Event;var n=o.getTemplate();o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.MultiSelectListBoxClsNames.hostElement,n,{_selectAll:"select-all",_filter:"filter",_lbHost:"list-box"});o._selectAll.style.display="none";o._filter.style.display="none";o._lbx=new ListBox(o._lbHost,{checkedMemberPath:MultiSelectListBox._DEF_CHECKED_PATH,loadedItems:function(){return o._updateCheckAllCheckbox()},checkedItemsChanged:function(e){return o.onCheckedItemsChanged(e)},selectedIndexChanged:function(){return o.onSelectedIndexChanged()}});o._cbSelectAll=o._selectAll.querySelector("input[type=checkbox]");o._spSelectAll=o._selectAll.querySelector("label>span");var s=wijmo_1.culture.MultiSelectListBox;wijmo_1.setText(o._spSelectAll,s.selectAll);o._filter.placeholder=s.filterPlaceholder;o.initialize(i);o.addEventListener(o._filter,"input",(function(){if(o._filter.value!=o._filterText){o._filterText=o._filter.value;o._toSearch&&clearTimeout(o._toSearch);o._toSearch=setTimeout((function(){o._toSearch=null;o._applyFilter()}),o.delay)}}));o.addEventListener(o._cbSelectAll,"click",(function(e){var t=o._lbx.collectionView;wijmo_1.hasItems(t)&&(o.checkedItems=e.target.checked?t.items:[])}));o.addEventListener(o.hostElement,"keydown",(function(e){var t=o.showFilterInput?o._filter:null,i=o._lbx;if(t&&e.keyCode==wijmo_1.Key.F3){wijmo_1.setSelectionRange(t,0,t.value.length);e.preventDefault()}if(wijmo_1.getActiveElement()==t){var n=!e.altKey;switch(e.keyCode){case wijmo_1.Key.Escape:case wijmo_1.Key.F4:case wijmo_1.Key.Tab:n=!1}n&&e.stopPropagation()}if(!i.containsFocus())switch(e.keyCode){case wijmo_1.Key.Up:case wijmo_1.Key.Down:o._lbx.focus();if(!e.altKey){var s=i.selectedIndex+(e.keyCode==wijmo_1.Key.Up?-1:1);i.selectedIndex=Math.max(0,s)}e.preventDefault()}}),!0);o.hostElement.tabIndex=-1;o._lbx.tabOrder=o._orgTabIndex;o._updateAriaLabel();return o}Object.defineProperty(MultiSelectListBox,"controlTemplate",{get:function(){MultiSelectListBox._ctrlTemplate||(MultiSelectListBox._ctrlTemplate='<div class="'+wijmo_1.ControlClsNames.template+" "+exports.ListBoxClsNames.hostElement+'"><input wj-part="filter" class="'+wijmo_1.InputFormElementsClsNames.formControl+'" tabindex="-1"><div wj-part="select-all" class="'+exports.MultiSelectListBoxClsNames.header+" "+exports.MultiSelectListBoxClsNames.selectAll+" "+exports.ListBoxClsNames.listBoxItem+'"><label><input type="checkbox" tabindex="-1"> <span></span></label></div><div wj-part="list-box"/></div>');return MultiSelectListBox._ctrlTemplate},set:function(e){MultiSelectListBox._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"itemsSource",{get:function(){return this._lbx.itemsSource},set:function(e){this._lbx.itemsSource=e},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"collectionView",{get:function(){return this._lbx.collectionView},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"virtualizationThreshold",{get:function(){return this._lbx.virtualizationThreshold},set:function(e){this._lbx.virtualizationThreshold=e},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"displayMemberPath",{get:function(){return this._lbx.displayMemberPath},set:function(e){this._lbx.displayMemberPath=e},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"isContentHtml",{get:function(){return this._lbx.isContentHtml},set:function(e){this._lbx.isContentHtml=e},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"caseSensitiveSearch",{get:function(){return this._lbx.caseSensitiveSearch},set:function(e){this._lbx.caseSensitiveSearch=e},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"delay",{get:function(){return this._delay},set:function(e){this._delay=wijmo_1.asNumber(e,!1,!0)},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"showGroups",{get:function(){return this._lbx.showGroups},set:function(e){this._lbx.showGroups=e},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"checkOnFilter",{get:function(){return this._checkOnFilter},set:function(e){if(e!=this.checkOnFilter){this._checkOnFilter=wijmo_1.asBoolean(e);this.checkedItems=[]}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"selectedIndex",{get:function(){return this._lbx.selectedIndex},set:function(e){this._lbx.selectedIndex=e},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"listBox",{get:function(){return this._lbx},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"showFilterInput",{get:function(){return""==this._filter.style.display},set:function(e){if(e!=this.showFilterInput){this._filter.style.display=wijmo_1.asBoolean(e)?"":"none";if(!this.showFilterInput){this._filter.value="";this._applyFilter()}}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"filterInputPlaceholder",{get:function(){return this._filterPlaceholder},set:function(e){if(e!=this._filterPlaceholder){this._filterPlaceholder=wijmo_1.asString(e);this.refresh()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"showSelectAllCheckbox",{get:function(){return""==this._selectAll.style.display},set:function(e){this._selectAll.style.display=wijmo_1.asBoolean(e)?"":"none"},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"selectAllLabel",{get:function(){return this._selectAllLabel},set:function(e){if(e!=this._selectAllLabel){this._selectAllLabel=wijmo_1.asString(e);this.refresh()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"checkedMemberPath",{get:function(){var e=this.listBox.checkedMemberPath;return e!=MultiSelectListBox._DEF_CHECKED_PATH?e:null},set:function(e){e=wijmo_1.asString(e);this.listBox.checkedMemberPath=e||MultiSelectListBox._DEF_CHECKED_PATH},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"checkedItems",{get:function(){return this.listBox.checkedItems},set:function(e){this.listBox.checkedItems=wijmo_1.asArray(e)},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"ariaLabelledBy",{get:function(){return this.hostElement.getAttribute("aria-labelledby")},set:function(e){wijmo_1._setAriaLabelBy(this,this.hostElement,e,this._updateAriaLabel.bind(this))},enumerable:!0,configurable:!0});MultiSelectListBox.prototype._updateAriaLabel=function(){var e=wijmo_1.culture.MultiSelectListBox;wijmo_1.setAriaLabel(this._selectAll,e.selectAll);wijmo_1.setAriaLabel(this._filter,e.filterPlaceholder);this.hostElement&&(this.ariaLabelledBy?wijmo_1.setAriaLabel(this.hostElement,null):wijmo_1.setAriaLabel(this.hostElement,this._ariaLabel))};MultiSelectListBox.prototype.onCheckedItemsChanged=function(e){var t=this;this._updateCheckAllCheckbox();this.checkedItemsChanged.raise(this,e);e._items&&"object"==typeof e._items[0]&&(this.checkedMemberPath||MultiSelectListBox._DEF_CHECKED_PATH)in e._items[0]&&setTimeout((function(){t._lbx._updateCheckedList(t.checkedItems)}),0)};MultiSelectListBox.prototype.onSelectedIndexChanged=function(e){this.selectedIndexChanged.raise(this,e)};MultiSelectListBox.prototype.refresh=function(t){void 0===t&&(t=!0);e.prototype.refresh.call(this,t);if(this.hostElement){var i=wijmo_1.culture.MultiSelectListBox;this._filter.placeholder=null!=this._filterPlaceholder?this._filterPlaceholder:i.filterPlaceholder;this._spSelectAll&&wijmo_1.setText(this._spSelectAll,null!=this._selectAllLabel?this._selectAllLabel:i.selectAll);this._updateCheckAllCheckbox()}};MultiSelectListBox.prototype.dispose=function(){this.listBox.dispose();e.prototype.dispose.call(this)};MultiSelectListBox.prototype._applyFilter=function(){var e=this,t=this._lbx,i=t.collectionView,o=this._filter.value,n=o?new RegExp(wijmo_1.escapeRegExp(o),t.caseSensitiveSearch?"":"i"):null,s=this.displayMemberPath,r=s?new wijmo_1.Binding(s):null,a=this.checkOnFilter?null:this.checkedItems;i.filter=function(t){if(null!=n){if(a&&a.indexOf(t)>-1)return!0;r&&(t=r.getValue(t));e.isContentHtml&&(t=wijmo_1.toPlainText(t));return null!=t&&n.test(t.toString())}return!0};t.selectedIndex=Math.max(0,t.selectedIndex);this._checkOnFilter&&(this.checkedItems=n?i.items:[])};MultiSelectListBox.prototype._updateCheckAllCheckbox=function(){var e=this._lbx.collectionView,t=this._cbSelectAll;if(wijmo_1.hasItems(e)){var i=e.items.length,o=this.checkedItems.length;wijmo_1.setChecked(t,o==i||0!=o&&null);t.disabled=!1}else{wijmo_1.setChecked(t,!1);t.checked=!1;t.disabled=!0}};MultiSelectListBox.prototype._setIsDisabled=function(t){e.prototype._setIsDisabled.call(this,t);this.hostElement.tabIndex=-1;this.isDisabled?this._lbx.tabOrder=-1:this._lbx.tabOrder=this._orgTabIndex};MultiSelectListBox.prototype._setTabOrder=function(e){this._orgTabIndex=e;this._lbx.tabOrder=e};MultiSelectListBox.prototype.tryForceClearDelayAndFilter=function(){var e=this;if(this._toSearch){var t=this._delay;this._filterText=this._filter.value;this._toSearch&&clearTimeout(this._toSearch);this._toSearch=setTimeout((function(){e._toSearch=null;e._applyFilter()}),0);this._delay=t}};MultiSelectListBox.prototype.onLostFocus=function(){this.tryForceClearDelayAndFilter();e.prototype.onLostFocus.call(this)};MultiSelectListBox._DEF_CHECKED_PATH="$checked";MultiSelectListBox._ctrlTemplate="";return MultiSelectListBox}(wijmo_1.Control);exports.MultiSelectListBox=MultiSelectListBox;wijmo_1._addCultureInfo("Calendar",{ariaLabels:{calendar:"Calendar",chooseDate:"Choose Date",chooseMonth:"Choose Month",monthView:"Month View",yearView:"Year View",selectYear:"Select Year",prvMo:"Previous Month",today:"Select Today",nxtMo:"Next Month",prvYr:"Previous Year",currMo:"Current Month",nxtYr:"Next Year"},buttons:{ok:"OK",cancel:"Cancel"}});!function(e){e[e.None=0]="None";e[e.Day=1]="Day";e[e.Month=2]="Month";e[e.Range=3]="Range"}(DateSelectionMode=exports.DateSelectionMode||(exports.DateSelectionMode={}));!function(e){e[e.None=0]="None";e[e.FirstMonth=1]="FirstMonth";e[e.LastMonth=2]="LastMonth";e[e.FirstAndLastMonths=3]="FirstAndLastMonths";e[e.AllMonths=4]="AllMonths";e[e.Outside=5]="Outside"}(ShowMonthPicker=exports.ShowMonthPicker||(exports.ShowMonthPicker={}));!function(e){e[e.None=0]="None";e[e.All=1]="All"}(CalendarTabKeyAction=exports.CalendarTabKeyAction||(exports.CalendarTabKeyAction={}));var ClickAction,KeyAction,TabKeyAction,Calendar=function(e){__extends(Calendar,e);function Calendar(t,i){var o=e.call(this,t)||this;o._yrPicker=!0;o._mtPicker=ShowMonthPicker.FirstMonth;o._wksBefore=0;o._wksAfter=0;o._rngMin=0;o._rngMax=0;o._min=null;o._max=null;o._readOnly=!1;o._handleWheel=!0;o._fdw=null;o._selMode=DateSelectionMode.Day;o._ariaLabel=wijmo_1.culture.Calendar.ariaLabels.calendar;o._tmYrHidden=0;o._fmtYrMo="y";o._fmtYr="yyyy";o._fmtDayHdr="ddd";o._fmtDay="d ";o._fmtMonths="MMM";o._fmtDayTitle="dddd";o.valueChanged=new wijmo_1.Event;o.rangeEndChanged=new wijmo_1.Event;o.rangeChanged=new wijmo_1.Event;o.displayMonthChanged=new wijmo_1.Event;o.formatItem=new wijmo_1.Event((function(){o.invalidate()}));o._updateCellFocus=function(e,t){wijmo_1.toggleClass(e,exports.CalendarClsNames.focused,t);wijmo_1.setAttribute(e,"tabIndex",t?"0":"-1");t&&o.containsFocus()&&!o._isButtonFocused()&&e.focus()};o.cancelButtonClicked=new wijmo_1.Event;o.OKButtonClicked=new wijmo_1.Event;o._enterKeyDownToSetValue=new wijmo_1.Event;o._value=o._rngEnd=wijmo_1.DateTime.newDate();o._month=o._getMonth(o._value);o._cals=[o];o._createChildren();o._createYearPicker();var n=o.hostElement,s=o.addEventListener.bind(o);s(n,"keydown",o._keydown.bind(o));s(n,"click",o._click.bind(o));o._focusValue=wijmo_1.DateTime.newDate();wijmo_1.setAttribute(n,"role","application");wijmo_1.setAttribute(o.hostElement,"aria-label",o._ariaLabel);o._keyActionTab=CalendarTabKeyAction.None;o._rptUp=new wijmo_1._ClickRepeater(o._btnPrv);o._rptDn=new wijmo_1._ClickRepeater(o._btnNxt);o.addEventListener(n,"wheel",(function(e){if(o.handleWheel&&!e.defaultPrevented&&!o.isReadOnly&&o.containsFocus()){e.deltaY<0?o._btnPrv.click():o._btnNxt.click();e.preventDefault()}}));o.initialize(i);o.refresh(!0);return o}Object.defineProperty(Calendar,"controlTemplate",{get:function(){Calendar._ctrlTemplate||(Calendar._ctrlTemplate='<div class="'+wijmo_1.ControlClsNames.content+" "+exports.CalendarClsNames.calendarOuter+'"><div wj-part="tbl-header" class='+exports.CalendarClsNames.calendarHeader+'><div wj-part="btn-month" class='+exports.CalendarClsNames.monthSelect+' role="button" aria-live="polite"><span wj-part="span-month"></span> <span class='+wijmo_1.GlyphClsNames.down+'></span></div><div class="'+wijmo_1.InputFormElementsClsNames.btnGroup+'"><button wj-part="btn-prev" class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1"><span class='+wijmo_1.GlyphClsNames.left+'></span></button><button wj-part="btn-today" class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1"><span class='+wijmo_1.GlyphClsNames.circle+'></span></button><button wj-part="btn-next" class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1"><span class='+wijmo_1.GlyphClsNames.right+'></span></button></div></div><table wj-part="tbl-month" class='+exports.CalendarClsNames.calendarMonth+' role="grid"></table><table wj-part="tbl-year" class='+exports.CalendarClsNames.calendarYear+' role="grid"></table></div>');return Calendar._ctrlTemplate},set:function(e){Calendar._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"value",{get:function(){return this._value},set:function(e){if((!wijmo_1.DateTime.sameDate(e,this._value)||!wijmo_1.DateTime.sameTime(e,this._value))&&(!(this.showConfirmationButtons&&wijmo_1.DateTime.sameDate(e,this.rangeEnd)&&wijmo_1.DateTime.sameTime(e,this.rangeEnd))||this._isSpaceDownForSetValue)){this._clearingRangeEnd=!wijmo_1.DateTime.equals(this._value,e);this.rangeEnd=null;this._clearingRangeEnd=!1;e=wijmo_1.asDate(e,!0);e=this._clamp(e);if(this._valid(e)||null==e){this.ensureVisible(e||new Date);if(!wijmo_1.DateTime.equals(this._value,e)){this._value=e;this.focusMode&&(this._focusValue=e);this.invalidate(!1);this.onValueChanged()}}if(!this.value){var t=this.min,i=this.max,o=this.displayMonth;i&&i<o?this.ensureVisible(i):t&&t>o&&this.ensureVisible(t)}}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"focusValue",{get:function(){return this._focusValue},set:function(e){e=wijmo_1.asDate(e,!0);e=this._clamp(e);if(this._valid(e)||null==e){this.ensureVisible(e||new Date);this._focusValue=e;this._getCalendars().forEach((function(t){t._focusValue=e}));this.invalidate(!1)}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"rangeEnd",{get:function(){return this._rngEnd},set:function(e){e=wijmo_1.asDate(e,!0);if((e=this._clamp(e))&&this._value&&this._rngMode()){e<this._value&&(e=this._value);var t=this._rngMin,i=this._rngMax;if(t&&t>0||i&&i>0){var o=this._value,n=Math.ceil((e.getTime()-o.getTime())/864e5)+1;t&&t>0&&n<t&&(e=wijmo_1.DateTime.addDays(o,t-1));i&&i>0&&n>i&&(e=wijmo_1.DateTime.addDays(o,i-1))}}if((this._valid(e)||null==e)&&!wijmo_1.DateTime.equals(this._rngEnd,e)){this._rngEnd=e;this.ensureVisible(e);this.invalidate(!1);this._clearingRangeEnd||this.onRangeEndChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"rangeMin",{get:function(){return this._rngMin},set:function(e){if((e=wijmo_1.asNumber(e,!0,!0))!=this._rngMin){this._rngMin=e;this._syncProp(this,"rangeMin");this._rngMode()&&this._rngEnd&&(this.rangeEnd=this._rngEnd)}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"rangeMax",{get:function(){return this._rngMax},set:function(e){if((e=wijmo_1.asNumber(e,!0,!0))!=this._rngMax){this._rngMax=e;this._syncProp(this,"rangeMax");this._rngMode()&&this._rngEnd&&(this.rangeEnd=this._rngEnd)}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"min",{get:function(){return this._min},set:function(e){if((e=wijmo_1.asDate(e,!0))!=this.min){this._min=e;this._syncProp(this,"min");this.refresh();!this.value&&e&&e>this.displayMonth&&this.ensureVisible(e)}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"max",{get:function(){return this._max},set:function(e){if((e=wijmo_1.asDate(e,!0))!=this.max){this._max=e;this._syncProp(this,"max");this.refresh();!this.value&&e&&e<this.displayMonth&&this.ensureVisible(e)}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"selectionMode",{get:function(){return this._selMode},set:function(e){var t=DateSelectionMode;if((e=wijmo_1.asEnum(e,t))!=this._selMode){this._selMode=e;this._mthMode()&&(this.monthView=!1);e!=t.Range||this._rngEnd||(this._rngEnd=this._value);this.refresh();this._syncProp(this,"selectionMode")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"isReadOnly",{get:function(){return this._readOnly},set:function(e){this._readOnly=wijmo_1.asBoolean(e);wijmo_1.toggleClass(this.hostElement,wijmo_1.ControlStateClsNames.readOnly,this.isReadOnly);this._syncProp(this,"isReadOnly")},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"handleWheel",{get:function(){return this._handleWheel},set:function(e){if(this._handleWheel!=e){this._handleWheel=wijmo_1.asBoolean(e);this._syncProp(this,"handleWheel")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"repeatButtons",{get:function(){return!this._rptUp.disabled},set:function(e){this._rptUp.disabled=this._rptDn.disabled=!wijmo_1.asBoolean(e);this._syncProp(this,"repeatButtons")},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"showYearPicker",{get:function(){return this._yrPicker},set:function(e){if(e!=this._yrPicker){this._yrPicker=wijmo_1.asBoolean(e);this._syncProp(this,"showYearPicker")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"showMonthPicker",{get:function(){return this._mtPicker},set:function(e){if(e!=this._mtPicker){var t=ShowMonthPicker;wijmo_1.isBoolean(e)&&(e=e?t.FirstMonth:t.None);this._mtPicker=wijmo_1.asEnum(e,t);wijmo_1.toggleClass(this.hostElement,wijmo_1.InputFormElementsClsNames.btnsOutside,this._getShowMonthPicker()==t.Outside);this.refresh();this._syncProp(this,"showMonthPicker")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"firstDayOfWeek",{get:function(){return this._fdw},set:function(e){if(e!=this._fdw){if((e=wijmo_1.asNumber(e,!0))&&(e>6||e<0))throw"firstDayOfWeek must be between 0 and 6 (Sunday to Saturday).";this._fdw=e;this.refresh();this._syncProp(this,"firstDayOfWeek")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"displayMonth",{get:function(){return this._month},set:function(e){e=wijmo_1.asDate(e);e=this._getMonth(e);var t=this._getDisplayMonthRange();t.to&&e>t.to&&(e=t.to);t.from&&e<t.from&&(e=t.from);if(!wijmo_1.DateTime.equals(this.displayMonth,e)){this._month=e;this.invalidate(!0);this.onDisplayMonthChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"monthCount",{get:function(){var e=this.hostElement;return e?e.querySelectorAll("."+exports.CalendarClsNames.hostElement).length+1:0},set:function(e){var t=this,i=this.hostElement;if(e!=this.monthCount&&i){var o=i.querySelectorAll("."+exports.CalendarClsNames.hostElement);e=wijmo_1.asInt(e,!1);wijmo_1.assert(e>0,"monthCount must be >= 1.");wijmo_1.assert(1==e||!wijmo_1.closest(i.parentElement,"."+exports.CalendarClsNames.hostElement),"Only top-level calendars can set monthCount.");for(var n=0;n<o.length;n++){var s=o[n];wijmo_1.removeChild(s);this._getCalendar(s).dispose()}this._cals=[this];for(n=1;n<e;n++){(s=new Calendar(document.createElement("div"),{itemFormatter:this.itemFormatter,itemValidator:this.itemValidator,formatItem:function(e,i){return t.onFormatItem(i)}}))._selMode=this._selMode;s._value=this._value;s._rngEnd=this._rngEnd;for(var r in this)if(!/^(_.*|constructor|displayMonth|monthCount|hostElement|rightToLeft|isUpdating|isTouching|keyActionTab)$/.test(r)){var a=this[r];wijmo_1.isFunction(a)||a instanceof wijmo_1.Event||(s[r]=a)}this._cals.push(s);i.appendChild(s.hostElement)}this.updateCalendarsTabindex();wijmo_1.toggleClass(i,exports.CalendarClsNames.calendarMultiMonth,e>1);this._syncProp(this,"displayMonth")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"formatYearMonth",{get:function(){return this._fmtYrMo},set:function(e){if(e!=this._fmtYrMo){this._fmtYrMo=wijmo_1.asString(e);this._syncProp(this,"formatYearMonth");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"formatDayHeaders",{get:function(){return this._fmtDayHdr},set:function(e){if(e!=this._fmtDayHdr){this._fmtDayHdr=wijmo_1.asString(e);this._syncProp(this,"formatDayHeaders");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"formatDays",{get:function(){return this._fmtDay},set:function(e){if(e!=this._fmtDay){this._fmtDay=wijmo_1.asString(e);this._syncProp(this,"formatDays");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"formatYear",{get:function(){return this._fmtYr},set:function(e){if(e!=this._fmtYr){this._fmtYr=wijmo_1.asString(e);this._syncProp(this,"formatYear");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"formatMonths",{get:function(){return this._fmtMonths},set:function(e){if(e!=this._fmtMonths){this._fmtMonths=wijmo_1.asString(e);this._syncProp(this,"formatMonths");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"showHeader",{get:function(){return"none"!=this._tbHdr.style.display},set:function(e){if(e!=this.showHeader){this._tbHdr.style.display=wijmo_1.asBoolean(e)?"":"none";this._syncProp(this,"showHeader")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"monthView",{get:function(){return"none"!=this._tbMth.style.display},set:function(e){if(e!=this.monthView){this._tbMth.style.display=e?"":"none";this._tbYr.style.display=e?"none":"";if(!e&&this.isThisMainCalendar()){var t=this.focusValue.getDate(),i=wijmo_1.DateTime.clone(this.displayMonth);i.setDate(t);this.focusValue=i}this.refresh();var o=wijmo_1.culture.Calendar.ariaLabels;wijmo_1.setAriaLabel(this._btnPrv,e?o.prvMo:o.prvYr);wijmo_1.setAriaLabel(this._btnTdy,e?o.today:o.currMo);wijmo_1.setAriaLabel(this._btnNxt,e?o.nxtMo:o.nxtYr);wijmo_1.setAriaLabel(this._btnMth,e?o.monthView:o.yearView);this._updateMonthButtonAria();this._syncProp(this,"monthView")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"weeksBefore",{get:function(){return this._wksBefore},set:function(e){if(e!=this._wksBefore){this._wksBefore=Math.floor(wijmo_1.asNumber(e,!1,!0));this._syncProp(this,"weeksBefore");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"weeksAfter",{get:function(){return this._wksAfter},set:function(e){if(e!=this._wksAfter){this._wksAfter=Math.floor(wijmo_1.asNumber(e,!1,!0));this._syncProp(this,"weeksAfter");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"itemFormatter",{get:function(){return this._itemFormatter},set:function(e){if(e!=this._itemFormatter){this._itemFormatter=wijmo_1.asFunction(e);this._syncProp(this,"itemFormatter");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"itemValidator",{get:function(){return this._itemValidator},set:function(e){if(e!=this._itemValidator){this._itemValidator=wijmo_1.asFunction(e);this._syncProp(this,"itemValidator");this.invalidate()}},enumerable:!0,configurable:!0});Calendar.prototype.hitTest=function(e){var t=e instanceof MouseEvent?e.target:e instanceof Element?e:null;wijmo_1.assert(null!=t,"MouseEvent or Element expected");return t?t[Calendar._DATE_KEY]:null};Calendar.prototype.ensureVisible=function(e){if(null!=e){var t=this._getCalendars(),i=t.indexOf(this),o=t[0],n=t[t.length-1];e<o.displayMonth||!this.monthView&&this.focusMode?this.displayMonth=wijmo_1.DateTime.addMonths(this._getMonth(e),i):e>n.displayMonth&&(this.displayMonth=wijmo_1.DateTime.addMonths(this._getMonth(e),i-t.length+1))}};Calendar.prototype.onValueChanged=function(e){this.valueChanged.raise(this,e);this._syncProp(this,"value")};Calendar.prototype.onRangeEndChanged=function(e){this.rangeEndChanged.raise(this,e);this._syncProp(this,"rangeEnd");this._value&&this._rngEnd&&this.onRangeChanged(e)};Calendar.prototype.onRangeChanged=function(e){this.rangeChanged.raise(this,e)};Calendar.prototype.onDisplayMonthChanged=function(e){this.displayMonthChanged.raise(this,e);this._syncProp(this,"displayMonth")};Calendar.prototype.onFormatItem=function(e){this.formatItem.raise(this,e)};Calendar.prototype._containsFocusImpl=function(t){return e.prototype._containsFocusImpl.call(this,t)||this._lbYears._containsFocusImpl(t)};Calendar.prototype.dispose=function(){this._rptUp.element=null;this._rptDn.element=null;this._lbYears.dispose();e.prototype.dispose.call(this)};Calendar.prototype.refresh=function(t){void 0===t&&(t=!0);var i=this.hostElement,o=this.containsFocus();if(i){e.prototype.refresh.call(this,t);t&&this._updateContent();this._updateSelection();var n=this._getDisplayMonthRange(),s=this.displayMonth,r=null==n.from||s>n.from,a=null==n.to||s<n.to;wijmo_1.enable(this._btnPrv,r);wijmo_1.enable(this._btnNxt,a);r&&a||this.containsFocus()||this.focus();var l=!0,h=wijmo_1.DateTime.newDate(),u=this._min&&this._min>h,c=this._max&&this._max<h;(u||c)&&(l=!1);wijmo_1.enable(this._btnTdy,l);if(o&&!this._isButtonFocused()){var p=(this.monthView?this._tbMth:this._tbYr).querySelector("td."+wijmo_1.ControlStateClsNames.selected)||i;p&&!this.focusMode&&p.focus()}var d=this._getCalendars();d.length>1&&this.isThisMainCalendar()&&d.forEach((function(e,i){i>0&&e.refresh(t)}))}};Calendar.prototype._getShowMonthPicker=function(){var e=ShowMonthPicker,t=this._getCalendars(),i=t.indexOf(this),o=this.showMonthPicker;switch(o){case e.FirstMonth:case e.Outside:return 0==i?o:0;case e.LastMonth:return i==t.length-1?o:0;case e.FirstAndLastMonths:return 0==i||i==t.length-1?o:0;case e.AllMonths:return o}return 0};Calendar.prototype._getDisplayMonthRange=function(){var e={from:null,to:null};if(this.min||this.max){var t=this._getCalendars(),i=t.indexOf(this),o=this._mthMode()?wijmo_1.DateTime.addYears:wijmo_1.DateTime.addMonths;this.min&&(e.from=o(this._getMonth(this.min),i));this.max&&(e.to=o(this._getMonth(this.max),i-t.length+1))}return e};Calendar.prototype._getCalendar=function(e){return wijmo_1.Control.getControl(e)};Calendar.prototype._getCalendars=function(){var e=wijmo_1.closest(this.hostElement,"."+exports.CalendarClsNames.calendarMultiMonth);return(e?this._getCalendar(e):this)._cals};Calendar.prototype._syncProp=function(e,t){var i=this;if(!this._syncing){var o=this._getCalendars();if(o&&o.length>1){var n=e[t],s=this._mthMode()?wijmo_1.DateTime.addYears:wijmo_1.DateTime.addMonths;"displayMonth"==t&&(n=s(n,-o.indexOf(e)));o[0].deferUpdate((function(){i._syncing=!0;o.forEach((function(o,r){if(o!=e){var a=o.displayMonth;o[t]="displayMonth"==t?s(n,r):n;if("value"==t){o.displayMonth=a;i._rngMode()&&(o.rangeEnd=null)}}}));i._syncing=!1}))}}};Calendar.prototype._updateContent=function(){var e=this.displayMonth,t=wijmo_1.Globalize.format,i=wijmo_1.DateTime,o=this._getShowMonthPicker();wijmo_1.setText(this._spMth,t(e,this._fmtYrMo));var n=this._btnMth.querySelector("."+wijmo_1.GlyphClsNames.down);n&&(n.style.display=this._mthMode()||!o?"none":"");var s=wijmo_1.closest(this._btnTdy,"."+wijmo_1.InputFormElementsClsNames.btnGroup);s&&(s.style.display=o?"":"none");var r=null!=this._fdw?this._fdw:wijmo_1.Globalize.getFirstDayOfWeek(),a=i.addDays(e,-(e.getDay()-r+7)%7),l=i.monthLast(e),h=this._tbMth.querySelectorAll("th");this._updateMonthButtonAria();for(var u=0;u<7&&u<h.length;u++){var c=i.addDays(a,u);wijmo_1.setText(h[u],t(c,this._fmtDayHdr));wijmo_1.setAttribute(h[u],"tabIndex","-1");wijmo_1.setAttribute(h[u],"abbr",t(c,this._fmtDayTitle))}var p=!1;this._dateViewContainsFocus()&&(p=!0);var d=this._tbMth.querySelectorAll("tr");for(u=1;u<d.length;u++)wijmo_1.removeChild(d[u]);p&&this.focus();var _=i.addDays(a,-7*this._wksBefore);for(u=0;u<this._wksBefore;u++)_=this._addWeek(_,exports.CalendarClsNames.weekBefore);for(;_<=l;)_=this._addWeek(_);for(u=0;u<this._wksAfter;u++)_=this._addWeek(_,exports.CalendarClsNames.weekAfter);h=this._tbYr.querySelectorAll("td");var m=this._tbYr.querySelectorAll("th");m.length&&wijmo_1.setText(m[0],t(e,this._fmtYr));for(u=0;u<h.length;u++){_=i.newDate(e.getFullYear(),u,1);var f=h[u],b=!this._monthInValidRange(_);f[Calendar._DATE_KEY]=_;var g=wijmo_1.Globalize.format(_,"MMMM yyyy");wijmo_1.setText(f,t(_,this._fmtMonths));wijmo_1.toggleClass(f,wijmo_1.ControlStateClsNames.disabled,b);wijmo_1.setAriaLabel(f,g);wijmo_1.setAttribute(f,"tabIndex","-1");wijmo_1.setAttribute(f,"abbr",g)}this._confirmationButtonContainer&&(this._confirmationButtonContainer.style.display=this.showConfirmationButtons?"":"none");this._updateButtonTabIndex()};Calendar.prototype._updateSelection=function(){for(var e=Calendar._DATE_KEY,t=wijmo_1.DateTime,i=this._tbMth.querySelectorAll("td"),o=0;o<i.length;o++){var n=this.rangeEnd;this._rngMode()||(n=null);var s=(u=i[o])[e],r=this.value,a=this._selMode&&null!=r&&t.sameDate(s,r),l=this._selMode&&null!=r&&t.sameDate(s,n),h=this._selMode&&null!=r&&s>r&&null!=n&&s<=n;wijmo_1.toggleClass(u,wijmo_1.ControlStateClsNames.selected,a);wijmo_1.toggleClass(u,wijmo_1.ControlStateClsNames.multiSelected,h);wijmo_1.toggleClass(u,wijmo_1.ControlStateClsNames.lastSelected,l);wijmo_1.setAttribute(u,"aria-selected",!!a||null);this._customizeCell(o,s,u)}i=this._tbYr.querySelectorAll("td");for(o=0;o<i.length;o++){var u;s=(u=i[o])[e],a=this._sameMonth(s,this.value);wijmo_1.toggleClass(u,wijmo_1.ControlStateClsNames.selected,a);wijmo_1.setAttribute(u,"aria-selected",!!a||null)}this.focusMode&&!0!==this.isDisabled&&-1!==this.tabOrder&&this._updateFocusInAccessibilityMode()};Calendar.prototype._updateFocusInAccessibilityMode=function(){for(var e=Calendar._DATE_KEY,t=wijmo_1.DateTime,i=this._getCalendars(),o=0;o<i.length;o++)for(var n=i[o]._tbMth.querySelectorAll("td"),s=0;s<n.length;s++){var r=(h=n[s])[e],a=this._selMode&&null!=this.focusValue&&t.sameDate(r,this.focusValue)&&!wijmo_1.hasClass(h,exports.CalendarClsNames.dayOtherMonth);this._updateCellFocus(h,a)}var l=i[0]._tbYr.querySelectorAll("td");for(s=0;s<l.length;s++){var h;r=(h=l[s])[e],a=null!=this.focusValue&&this._sameMonth(r,this.focusValue);this._updateCellFocus(h,a)}};Calendar.prototype._addWeek=function(e,t){for(var i=this._createElement("tr",this._tbMth,t),o=wijmo_1.DateTime,n=0;n<7;n++){var s=this._createElement("td",i),r=o.addDays(e,n);s[Calendar._DATE_KEY]=r;wijmo_1.setText(s,wijmo_1.Globalize.format(r,this._fmtDay));wijmo_1.setAriaLabel(s,wijmo_1.Globalize.format(r,"D"));var a=!this._valid(r),l=r.getDay(),h=r.getMonth()!=this.displayMonth.getMonth();wijmo_1.toggleClass(s,exports.CalendarClsNames.dayToday,o.sameDate(r,o.newDate()));wijmo_1.toggleClass(s,exports.CalendarClsNames.dayWeekend,0==l||6==l);wijmo_1.toggleClass(s,exports.CalendarClsNames.dayOtherMonth,h);wijmo_1.toggleClass(s,wijmo_1.ControlStateClsNames.invalid,a||!this._inValidRange(r));wijmo_1.setAttribute(s,"aria-disabled",a||!this._inValidRange(r))}return o.addDays(e,7)};Calendar.prototype._customizeCell=function(e,t,i){wijmo_1.isFunction(this.itemFormatter)&&this.itemFormatter(t,i);if(this.formatItem.hasHandlers){var o=new FormatItemEventArgs(e,t,i);this.onFormatItem(o)}};Calendar.prototype._canChangeValue=function(){return!this._readOnly&&this._selMode!=DateSelectionMode.None};Calendar.prototype._valid=function(e){return!(!wijmo_1.isDate(e)||!wijmo_1.DateTime.sameDate(e,this._clamp(e)))&&(!wijmo_1.isFunction(this.itemValidator)||this.itemValidator(e))};Calendar.prototype._inValidRange=function(e){var t=wijmo_1.DateTime.fromDateTime;return!(this.min&&e<t(this.min,e))&&!(this.max&&e>t(this.max,e))};Calendar.prototype._monthInValidRange=function(e){if(this.min||this.max){var t=e.getFullYear(),i=e.getMonth(),o=wijmo_1.DateTime,n=o.newDate(t,i,1),s=o.newDate(t,i+1,0);if(this.min&&this.min>s)return!1;if(this.max&&this.max<n)return!1}return!0};Calendar.prototype._sameMonth=function(e,t){return wijmo_1.isDate(e)&&wijmo_1.isDate(t)&&e.getMonth()==t.getMonth()&&e.getFullYear()==t.getFullYear()};Calendar.prototype._getValidDate=function(e,t){if(wijmo_1.isDate(e))for(var i=e.getFullYear(),o=e.getMonth()+(t?0:1),n=t?1:0,s=wijmo_1.DateTime,r=s.newDate(i,o,n),a=t?1:-1,l=0;l<31;l++){if(this._valid(r))return r;r=s.addDays(r,a)}return null};Calendar.prototype._clamp=function(e){if(e){var t=wijmo_1.DateTime.fromDateTime;if(this.min){var i=t(this.min,e);e<i&&(e=i)}if(this.max){var o=t(this.max,e);e>o&&(e=o)}}return e};Calendar.prototype._createChildren=function(){var e=this.getTemplate();this.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+exports.CalendarClsNames.hostElement,e,{_tbHdr:"tbl-header",_btnMth:"btn-month",_spMth:"span-month",_btnPrv:"btn-prev",_btnTdy:"btn-today",_btnNxt:"btn-next",_tbMth:"tbl-month",_tbYr:"tbl-year"});this._tbYr.style.display="none";var t=wijmo_1.culture.Calendar.ariaLabels;wijmo_1.setAriaLabel(this._tbMth,t.chooseDate);wijmo_1.setAriaLabel(this._tbYr,t.chooseMonth);wijmo_1.setAriaLabel(this._btnPrv,t.calendar);wijmo_1.setAriaLabel(this._btnMth,t.monthView);wijmo_1.setAriaLabel(this._btnPrv,t.prvMo);wijmo_1.setAriaLabel(this._btnTdy,t.today);wijmo_1.setAriaLabel(this._btnNxt,t.nxtMo);for(var i=this._createElement("tr",this._tbMth,exports.CalendarClsNames.header),o=0;o<7;o++){this._createElement("th",i).setAttribute("scope","col")}i=this._createElement("tr",this._tbYr,exports.CalendarClsNames.header);this._showYearListBoxButton=this._createElement("th",i);this._showYearListBoxButton.setAttribute("colspan","4");this._showYearListBoxButton.setAttribute("scope","col");wijmo_1.setAriaLabel(this._showYearListBoxButton,t.selectYear);wijmo_1.toggleClass(this._showYearListBoxButton,exports.CalendarClsNames.selectedYear);this._showYearListBoxButton.setAttribute("role","button");this._showYearListBoxButton.setAttribute("tabIndex","-1");for(var n=0;n<3;n++){i=this._createElement("tr",this._tbYr);for(var s=0;s<4;s++)this._createElement("td",i)}};Calendar.prototype._createYearPicker=function(){var e=this,t=this.hostElement,i=this._createElement("div",null,exports.DropDownClsNames.dropDownPanel+" "+exports.CalendarClsNames.yearPicker);i.tabIndex=this._orgTabIndex;this._lbYears=new ListBox(i,{lostFocus:function(t){wijmo_1.hidePopup(i);e._tmYrHidden=Date.now();e.removeEventListener(window,"touchstart");if(t.selectedIndex>-1){var o=wijmo_1.DateTime.clone(e.displayMonth);o.setFullYear(t.selectedIndex+t.itemsSource[0]);e.displayMonth=o;e.focusMode&&(e.focusValue=o)}e.keyActionTab===CalendarTabKeyAction.All&&e._showYearListBoxButton.focus()}});wijmo_1.setAriaLabel(this._lbYears.hostElement,wijmo_1.culture.Calendar.ariaLabels.selectYear);this.addEventListener(i,"keydown",(function(i){switch(i.keyCode){case wijmo_1.Key.Enter:t.focus();break;case wijmo_1.Key.Space:t.focus();i.preventDefault();break;case wijmo_1.Key.Escape:e._lbYears.selectedIndex=-1;t.focus()}i.defaultPrevented&&i.stopPropagation()}));this.addEventListener(i,"click",(function(e){t.focus()}))};Calendar.prototype._createElement=function(e,t,i){var o=document.createElement(e);i&&wijmo_1.addClass(o,i);t&&t.appendChild(o);return o};Calendar.prototype._click=function(e){if(!e.defaultPrevented&&0==e.button){var t=!1,i=e.target;if(wijmo_1.contains(this._btnMth,i)&&!this._mthMode()&&this._getShowMonthPicker()){this.monthView=!this.monthView;t=!0}else if(wijmo_1.contains(this._btnPrv,i)){this._navigate(-1);if(this.focusMode){var o=wijmo_1.DateTime.addMonths(this.focusValue,-1);this.focusValue=o}t=!0}else if(wijmo_1.contains(this._btnNxt,i)){this._navigate(1);if(this.focusMode){o=wijmo_1.DateTime.addMonths(this.focusValue,1);this.focusValue=o}t=!0}else if(wijmo_1.contains(this._btnTdy,i)){this._navigate(0);this.focusMode&&(this.focusValue=this.value);t=!0}if(i&&!t&&this._yrPicker&&wijmo_1.contains(this._tbYr,i)&&wijmo_1.closest(i,"."+exports.CalendarClsNames.header)){this._showYearPickerAction(e);return}if(i&&!t){var n=wijmo_1.closest(i,"td");if(n){var s=this.hitTest(n),r=wijmo_1.DateTime.fromDateTime;if(this.monthView){if(s&&this._canChangeValue()){var a=r(s,this._value);this._inValidRange(a)&&this._valid(a)&&(this._rngMode()&&this.value&&!this.rangeEnd&&a>=this.value?this.rangeEnd=a:this.value=a);t=!0}}else if(s){this.displayMonth=s;if(this._mthMode()){if(this._canChangeValue()){a=r(this.displayMonth,this.value);this._inValidRange(a)&&(this.value=a)}}else this.monthView=!0;t=!0}}}if(t){e.preventDefault();this.focusMode||0===e.detail||this.focus()}}};Calendar.prototype._keydown=function(e){this._isSpaceDownForSetValue=!1;if(!e.defaultPrevented){if(e.altKey)switch(e.keyCode){case wijmo_1.Key.Up:case wijmo_1.Key.Down:return;case wijmo_1.Key.End:this._navigate(0);e.preventDefault();return}var t=e.target;if(("Enter"===e.key||"Space"===e.code)&&t&&this.keyActionTab===CalendarTabKeyAction.All){if(wijmo_1.contains(this._btnMth,t)&&!this._mthMode()&&this._getShowMonthPicker()){this.monthView=!this.monthView;"Space"===e.code&&e.preventDefault();return}if(this._yrPicker&&wijmo_1.contains(this._tbYr,t)&&wijmo_1.closest(t,"."+exports.CalendarClsNames.header)){this._showYearPickerAction(e);return}}if(this.focusMode){if(("Enter"===e.key||"Space"===e.code)&&t.classList.contains(exports.CalendarClsNames.focused)){var i=wijmo_1.closest(t,"td");if(i){var o=this.hitTest(i);this._isSpaceDownForSetValue="Space"===e.code;this.setFocusModeValue(o,e)}"Space"===e.code&&e.preventDefault();return}if(!wijmo_1.contains(this._tbMth,e.target)&&(!wijmo_1.contains(this._tbYr,e.target)||wijmo_1.contains(this._tbYr.firstElementChild,e.target)))return;if("Tab"===e.key&&this.monthView){var n=this._getCalendars();if(this!==n[e.shiftKey?0:n.length-1]){var s=wijmo_1.DateTime.addMonths(this.focusValue,e.shiftKey?-1:1);this.focusValue=s;e.preventDefault()}}}if(!(e.ctrlKey||e.metaKey||e.shiftKey&&!this._rngMode())){var r=this._getKeyCode(e),a=0,l=0,h=!0;if(this.monthView)switch(r){case wijmo_1.Key.Left:a=-1;break;case wijmo_1.Key.Right:a=1;break;case wijmo_1.Key.Up:a=-7;break;case wijmo_1.Key.Down:a=7;break;case wijmo_1.Key.PageDown:l=e.altKey?12:1;break;case wijmo_1.Key.PageUp:l=e.altKey?-12:-1;break;case wijmo_1.Key.Home:case wijmo_1.Key.End:if(this._canChangeValue()&&!e.shiftKey){var u=this.value||this.displayMonth;if(p=this._getValidDate(u,r==wijmo_1.Key.Home)){this.value=wijmo_1.DateTime.fromDateTime(p,this.value);this._rngEnd=null}}break;default:h=!1}else switch(r){case wijmo_1.Key.Left:l=-1;break;case wijmo_1.Key.Right:l=1;break;case wijmo_1.Key.Up:l=-4;break;case wijmo_1.Key.Down:l=4;break;case wijmo_1.Key.PageDown:l=e.altKey?120:12;break;case wijmo_1.Key.PageUp:l=e.altKey?-120:-12;break;case wijmo_1.Key.Home:l=this.value?-this.value.getMonth():0;break;case wijmo_1.Key.End:l=this.value?11-this.value.getMonth():0;break;case wijmo_1.Key.Enter:this._mthMode()?h=!1:this.monthView=!0;break;default:h=!1}if(this._canChangeValue()&&(a||l)){var c=e.shiftKey&&null!=this.rangeEnd?this.rangeEnd:this.focusMode?this.focusValue:this.value,p=wijmo_1.DateTime;if(c){c=p.addDays(c,a);c=p.addMonths(c,l)}else c=this._getValidDate(new Date,!0);if(l&&!this._valid(c)){u=c.getMonth();for(var d=1;d<31&&!this._valid(c);d++){var _=p.addDays(c,+d),m=p.addDays(c,-d);this._valid(_)&&_.getMonth()==u?c=_:this._valid(m)&&m.getMonth()==u&&(c=m)}}for(d=0;d<31&&!this._valid(c);d++)c=p.addDays(c,a>0||l>0?1:-1);e.shiftKey&&this._rngMode()&&c>this.value?this.rangeEnd=c:this.focusMode?this.focusValue=c:this.value=c}h&&e.preventDefault()}}};Calendar.prototype._getMonth=function(e){var t=wijmo_1.DateTime;e=e||t.newDate();return t.newDate(e.getFullYear(),e.getMonth(),1)};Calendar.prototype._mthMode=function(){return this.selectionMode==DateSelectionMode.Month};Calendar.prototype._rngMode=function(){return this.selectionMode==DateSelectionMode.Range};Calendar.prototype._navigate=function(e){var t=this.monthView,i=this.displayMonth,o=wijmo_1.DateTime;switch(e){case 0:var n=o.newDate();this._canChangeValue()&&(this.value=t?o.fromDateTime(n,this.value):this._getMonth(n));i=this._getMonth(n);break;case 1:i=o.addMonths(i,t?1:12);break;case-1:i=o.addMonths(i,t?-1:-12)}this.displayMonth=i};Calendar.prototype._setTabOrder=function(t){e.prototype._setTabOrder.call(this,t);this._lbYears.tabOrder=this._orgTabIndex;this._getCalendars().forEach((function(e){e.tabOrder!=t&&(e.tabOrder=t)}));this.updateCalendarsTabindex()};Calendar.prototype._showYearPickerAction=function(e){var t=this,i=e.target;if(Date.now()-this._tmYrHidden<600)e.preventDefault();else{for(var o=this.displayMonth.getFullYear(),n=this.min?this.min.getFullYear():o-100,s=this.max?this.max.getFullYear():o+100,r=[],a=n;a<=s;a++)r.push(a);var l=this._lbYears,h=l.hostElement,u=wijmo_1.closest(i,"."+exports.CalendarClsNames.header),c=this.hostElement,p=wijmo_1.closest(c,"."+exports.InputDateClsNames.inputDateDropDown)||c;l.itemsSource=r;l.selectedIndex=o-r[0];wijmo_1.setAttribute(h,"dir",this.rightToLeft?"rtl":null);wijmo_1.setCss(h,{minWidth:"",width:u.offsetWidth});wijmo_1.showPopup(h,u,!1,!1,p);requestAnimationFrame((function(){l.showSelection(!0)}));this.addEventListener(window,"touchstart",(function(e){if(!wijmo_1.contains(h,e.target)){wijmo_1.hidePopup(h);t._tmYrHidden=Date.now();t.removeEventListener(window,"touchstart")}}));e.preventDefault()}};Object.defineProperty(Calendar.prototype,"focusMode",{get:function(){return this._focusMode},set:function(e){this._focusMode=e;this._getCalendars().forEach((function(t){t.focusMode!==e&&(t.focusMode=e)}));this.updateCalendarsTabindex();this.invalidate()},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"keyActionTab",{get:function(){return this._keyActionTab},set:function(e){this._keyActionTab=e;this._updateButtonTabIndex()},enumerable:!0,configurable:!0});Calendar.prototype._isButtonFocused=function(){var e=wijmo_1.getActiveElement();if(!e)return!1;var t=e.getAttribute("role"),i=e.type;return t&&"button"===t.toLowerCase()||i&&"button"===i.toLowerCase()};Calendar.prototype._isSameMonth=function(e,t){return e.getMonth()===t.getMonth()};Calendar.prototype._dateViewContainsFocus=function(){var e=this._tbYr.querySelectorAll("td"),t=Array.from(e).find((function(e){return e===wijmo_1.getActiveElement()}));return this._tbMth.contains(wijmo_1.getActiveElement())||void 0!==t};Calendar.prototype._updateMonthButtonAria=function(){var e=wijmo_1.culture.Calendar.ariaLabels,t=this.monthView?e.monthView:e.yearView;wijmo_1.setAriaLabel(this._btnMth,t+", "+wijmo_1.Globalize.format(this.displayMonth,this._fmtYrMo))};Calendar.prototype._isDayValid=function(e){return this._valid(e)&&this._inValidRange(e)};Calendar.prototype.cancelButtonClick=function(e){this.cancelButtonClicked.raise(this,e)};Calendar.prototype.oneCancelButtonClick=function(e){this.cancelButtonClick(e)};Calendar.prototype.OKButtonClick=function(e){this.OKButtonClicked.raise(this,e)};Calendar.prototype.onOkButtonClick=function(e){this.OKButtonClick(e);this.setFocusModeValue(this.focusValue)};Object.defineProperty(Calendar.prototype,"ariaLabel",{get:function(){return this._ariaLabel},set:function(e){if(this.ariaLabel!==e&&this.hostElement){this._ariaLabel=e;wijmo_1.setAttribute(this.hostElement,"aria-label",e)}},enumerable:!0,configurable:!0});Calendar.prototype._updateButtonTabIndex=function(){var e=this.tabOrder.toString();if(this.keyActionTab===CalendarTabKeyAction.All&&!0!==this.isDisabled){wijmo_1.setAttribute(this._btnMth,"tabindex",e);wijmo_1.setAttribute(this._btnPrv,"tabindex",e);wijmo_1.setAttribute(this._btnTdy,"tabindex",e);wijmo_1.setAttribute(this._btnNxt,"tabindex",e);wijmo_1.setAttribute(this._showYearListBoxButton,"tabindex",e)}else{wijmo_1.setAttribute(this._btnMth,"tabindex","-1");wijmo_1.setAttribute(this._btnPrv,"tabindex","-1");wijmo_1.setAttribute(this._btnTdy,"tabindex","-1");wijmo_1.setAttribute(this._btnNxt,"tabindex","-1");wijmo_1.setAttribute(this._showYearListBoxButton,"tabindex","-1")}wijmo_1.setAttribute(this._btnOK,"tabindex",e);wijmo_1.setAttribute(this._btnCancel,"tabindex",e)};Calendar.prototype._onEnterKeyDownToSetValue=function(e){this._enterKeyDownToSetValue.raise(this,e)};Object.defineProperty(Calendar.prototype,"showConfirmationButtons",{get:function(){return this._showConfirmationButtons},set:function(e){this._showConfirmationButtons=e;this._getCalendars().forEach((function(t){t._showConfirmationButtons=e}))},enumerable:!0,configurable:!0});Calendar.prototype._setIsDisabled=function(t){e.prototype._setIsDisabled.call(this,t);this._updateButtonTabIndex()};Calendar.prototype.updateCalendarsTabindex=function(){var e=this.focusMode||-1===this.tabOrder?-1:0;this._getCalendarsHostElements().forEach((function(t){t.tabIndex=e}))};Calendar.prototype.setFocusModeValue=function(e,t){var i=wijmo_1.DateTime.fromDateTime;if(this.monthView){if(e&&this._canChangeValue()){var o=i(e,this._value);if(this._inValidRange(o)&&this._valid(o))if(this._rngMode()&&this.value&&!this.rangeEnd&&o>=this.value)this.rangeEnd=o;else{t&&this._enterKeyDownToSetValue.raise(this,t);this.value=o}}}else if(e){this.displayMonth=e;if(this._mthMode()){if(this._canChangeValue()){o=i(this.displayMonth,this.value);this._inValidRange(o)&&(this.value=o)}}else this.monthView=!0}};Calendar.prototype._getCalendarsHostElements=function(){return this._getCalendars().filter((function(e,t){return t>0})).map((function(e){return e.hostElement}))};Calendar.prototype.updateConfirmationButtons=function(e){if(!this._confirmationButtonContainer){var t='<div class="'+exports.CalendarClsNames.confirmationButtonContainer+'"></div>';this._confirmationButtonContainer=wijmo_1.createElement(t);this._btnOK=wijmo_1.createElement('<button wj-part="btn-ok" class="'+wijmo_1.InputFormElementsClsNames.btn+" "+exports.CalendarClsNames.button+'"></button>');this._btnCancel=wijmo_1.createElement('<button wj-part="btn-cancel" class="'+wijmo_1.InputFormElementsClsNames.btn+" "+exports.CalendarClsNames.button+'"></button>');var i=wijmo_1.culture.Calendar.buttons;wijmo_1.setText(this._btnOK,i.ok);wijmo_1.setText(this._btnCancel,i.cancel);var o=this.addEventListener.bind(this);o(this._btnCancel,"click",this.oneCancelButtonClick.bind(this));o(this._btnOK,"click",this.onOkButtonClick.bind(this));this._confirmationButtonContainer.appendChild(this._btnOK);this._confirmationButtonContainer.appendChild(this._btnCancel);e.appendChild(this._confirmationButtonContainer)}};Calendar.prototype.setFocusValueToFirstOrLastCalendar=function(e){var t,i=this._getCalendars();t=this.monthView?e?i[0].displayMonth:i[i.length-1].displayMonth:i[0].displayMonth;var o=this.focusValue.getDate(),n=new Date(t.getFullYear(),t.getMonth()+1,0).getDate(),s=new Date(t.getFullYear(),t.getMonth(),Math.min(o,n));this.focusValue=s};Calendar.prototype.isCalendarDateCell=function(e){return!wijmo_1.isNullOrUndefined(e[Calendar._DATE_KEY])&&"td"===e.tagName.toLowerCase()};Calendar.prototype.isThisMainCalendar=function(){return this==this._getCalendars()[0]};Calendar._DATE_KEY="$WJ-DATE";Calendar._ctrlTemplate="";return Calendar}(wijmo_1.Control);exports.Calendar=Calendar;function softTouch(){return wijmo_1._getModule("wijmo.touch")}exports.softTouch=softTouch;function getDragDropTouch(){var e=softTouch();return e&&e.DragDropTouch&&e.DragDropTouch.getInstance?e.DragDropTouch.getInstance():null}exports.getDragDropTouch=getDragDropTouch;wijmo_1._addCultureInfo("DropDown",{ariaLabels:{tgl:"Toggle Dropdown"}});!function(e){e[e.Select=0]="Select";e[e.Open=1]="Open";e[e.Toggle=2]="Toggle"}(ClickAction=exports.ClickAction||(exports.ClickAction={}));!function(e){e[e.ChangeSelectionOnly=0]="ChangeSelectionOnly";e[e.OpenDropdown=1]="OpenDropdown"}(KeyAction=exports.KeyAction||(exports.KeyAction={}));!function(e){e[e.CloseAndKeepFocus=0]="CloseAndKeepFocus";e[e.CloseAndMoveFocus=1]="CloseAndMoveFocus"}(TabKeyAction=exports.TabKeyAction||(exports.TabKeyAction={}));var PopupTrigger,_Edges,DropDown=function(e){__extends(DropDown,e);function DropDown(t,i){var o=e.call(this,t)||this;o._clickAction=ClickAction.Select;o._showBtn=!0;o._autoExpand=!0;o._animate=!1;o._internalSettingText=!1;o._oldText="";o._keyActionDownArrow=KeyAction.ChangeSelectionOnly;o._keyActionUpArrow=KeyAction.ChangeSelectionOnly;o._keyActionTab=TabKeyAction.CloseAndMoveFocus;o._touchMove=!1;o._isDropdownOpened=!1;o.textChanged=new wijmo_1.Event;o.isDroppedDownChanging=new wijmo_1.Event;o.isDroppedDownChanged=new wijmo_1.Event;var n,s=o.getTemplate();o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.DropDownClsNames.hostElement,s,{_tbx:"input",_btn:"btn",_dropDown:"dropdown"},"input");o.hostElement&&o.hostElement.id&&(n=o.hostElement.id);n&&o._dropDown&&o._dropDown.setAttribute("dropdown-id",n);o._dropDown.style.display="none";var r=wijmo_1.culture.DropDown.ariaLabels;wijmo_1.setAriaLabel(o._btn.querySelector("button"),r.tgl);o._elRef=o._tbx;var a=o._tbx;wijmo_1.disableAutoComplete(a);o._createDropDown();o._updateTbxAriaHaspopup();o._updateBtn();o._updateTbx();var l=o.hostElement;wijmo_1.addClass(l,wijmo_1.ControlStateClsNames.collapsed);o.addEventListener(window,"resize",(function(){o.isDroppedDown&&o.invalidate()}));var h=o.dropDown,u=o.addEventListener.bind(o),c=o._updateFocusState.bind(o);u(h,"blur",c,!0);u(h,"focus",c);var p=o._keydown.bind(o);u(l,"keydown",p);u(h,"keydown",p);var d=o._keypress.bind(o);u(l,"keypress",d,!0);u(h,"keypress",d,!0);var _=o._input.bind(o);u(a,"input",_);u(a,"beforeinput",(function(e){"historyUndo"!==e.inputType&&"historyRedo"!==e.inputType||e.preventDefault()}));u(a,"blur",(function(){o._commitText(!0,!1)}),!0);u(a,"click",(function(){o._autoExpand&&o._expandSelection()}));u(a,"touchstart",(function(){o.isTouching&&"none"===a.getAttribute("inputmode")&&a.removeAttribute("inputmode")}));u(a,"mousedown",(function(e){if(o._isTouchMoved())e.preventDefault();else switch(o._clickAction){case ClickAction.Open:if(!o.isDroppedDown){e.preventDefault();o.focus();o.isDroppedDown=!0}break;case ClickAction.Toggle:e.preventDefault();o.focus();o.isDroppedDown=!o.isDroppedDown}}));u(o._btn,"mousedown",(function(e){o._isTouchMoved()||o._btnclick(e)}));wijmo_1.removeChild(h);wijmo_1.isIE()&&o._elRef==o._tbx&&u(l,"mouseup",(function(e){if(!e.defaultPrevented&&0==e.button&&wijmo_1.hasClass(e.target,wijmo_1.InputFormElementsClsNames.btn)){var t=wijmo_1.getActiveElement();t&&t!=e.target&&setTimeout((function(){t.focus()}))}}));wijmo_1.isIE9()&&u(a,"keyup",(function(){o._setText(o.text,!1)}));u(h,"click",o._dropDownClick.bind(o));return o}Object.defineProperty(DropDown,"controlTemplate",{get:function(){DropDown._ctrlTemplate||(DropDown._ctrlTemplate='<div class="'+wijmo_1.ControlClsNames.template+'"><div class="'+exports.InputClsNames.input+'"><div class="'+exports.InputClsNames.inputGroup+" "+exports.InputClsNames.inputBtnVisible+'"><input wj-part="input" type="text" class="'+wijmo_1.InputFormElementsClsNames.formControl+'"><span wj-part="btn" class="'+exports.InputClsNames.inputGroupBtn+'"><button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1"><span class='+wijmo_1.GlyphClsNames.down+'></span></button></span></div></div><div wj-part="dropdown" class="'+wijmo_1.ControlClsNames.content+" "+exports.DropDownClsNames.dropDownPanel+'"></div></div>');return DropDown._ctrlTemplate},set:function(e){DropDown._ctrlTemplate=e},enumerable:!0,configurable:!0});DropDown.prototype._isTouchMoved=function(){var e=getDragDropTouch();return e&&e.isDragging};Object.defineProperty(DropDown.prototype,"text",{get:function(){return this._tbx.value},set:function(e){if(e!=this.text){this._setText(e,!0);this._commitText()}},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"inputElement",{get:function(){return this._tbx},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"inputType",{get:function(){return this._tbx.type},set:function(e){this._tbx.type=wijmo_1.asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"isReadOnly",{get:function(){return this._tbx.readOnly},set:function(e){this._tbx.readOnly=wijmo_1.asBoolean(e);wijmo_1.toggleClass(this.hostElement,wijmo_1.ControlStateClsNames.readOnly,this.isReadOnly);this.isReadOnly&&this._toggleDropDown(!1)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"isRequired",{get:function(){return this._tbx.required},set:function(e){this._tbx.required=wijmo_1.asBoolean("boolean"==typeof e?e:this.isRequired)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"placeholder",{get:function(){return this._tbx.placeholder},set:function(e){this._tbx.placeholder=e},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"clickAction",{get:function(){return this._clickAction},set:function(e){this._clickAction=wijmo_1.asEnum(e,ClickAction)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"isDroppedDown",{get:function(){var e=this._dropDown;return e&&"none"!=e.style.display},set:function(e){var t=this.hostElement,i=this._dropDown,o=this.containsFocus(),n=new Set(["InputDateTime","WjInputDateTime"]);if(t&&i){var s=!this.isReadOnly;this.isTouching&&(s=!0);e=wijmo_1.asBoolean(e)&&!this.isDisabled&&s&&t.offsetWidth>0;this.isDroppedDown&&!e&&this.isDisabled&&(e=this.isDroppedDown);if(e||"INPUT"!=wijmo_1.getActiveElement().tagName||this.inputElement===wijmo_1.getActiveElement()||!this._isInvalidInputCancelled){if(e!=this.isDroppedDown&&(n.has(this.constructor.name)||!this._isInvalidInputCancelled||!this.isDroppedDown&&this._isInvalidInputCancelled)&&this.onIsDroppedDownChanging(new wijmo_1.CancelEventArgs)){this._toggleDropDown(e);o&&(this.isTouching&&this.showDropDownButton?t.focus():this.selectAll());this._updateFocusState();this._updateBtn();this._updateTbx();wijmo_1.toggleClass(t,wijmo_1.ControlStateClsNames.collapsed,!this.isDroppedDown);this.onIsDroppedDownChanged()}}else{this._isDropdownOpened=this.isDroppedDown;this._toggleDropDown(e)}}},enumerable:!0,configurable:!0});DropDown.prototype._toggleDropDown=function(e){var t=this,i=this.hostElement,o=this._dropDown;if(e){this._minWidthDropdown=o.style.minWidth;o.style.display="";this._updateDropDown();this.addEventListener(window,"touchstart",(function(e){for(var o=wijmo_1.Control._touching,n=e.target;n;){if(n==i)return;n=n[wijmo_1.Control._OWNR_KEY]||n.parentNode}wijmo_1.Control._touching=!0;t.isDroppedDown=!1;wijmo_1.Control._touching=o}))}else{this.removeEventListener(window,"touchstart");wijmo_1.hidePopup(o);o.style.minWidth=this._minWidthDropdown}};Object.defineProperty(DropDown.prototype,"dropDown",{get:function(){return this._dropDown},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"dropDownCssClass",{get:function(){return this._cssClass},set:function(e){if(e!=this._cssClass){wijmo_1.removeClass(this._dropDown,this._cssClass);this._cssClass=wijmo_1.asString(e);wijmo_1.addClass(this._dropDown,this._cssClass)}},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"showDropDownButton",{get:function(){return this._showBtn},set:function(e){this._showBtn=wijmo_1.asBoolean(e);this._updateBtn()},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"autoExpandSelection",{get:function(){return this._autoExpand},set:function(e){this._autoExpand=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"isAnimated",{get:function(){return this._animate},set:function(e){this._animate=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"keyActionDownArrow",{get:function(){return this._keyActionDownArrow},set:function(e){this._keyActionDownArrow=wijmo_1.asEnum(e,KeyAction)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"keyActionUpArrow",{get:function(){return this._keyActionUpArrow},set:function(e){this._keyActionUpArrow=wijmo_1.asEnum(e,KeyAction)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"keyActionTab",{get:function(){return this._keyActionTab},set:function(e){this._keyActionTab=wijmo_1.asEnum(e,TabKeyAction)},enumerable:!0,configurable:!0});DropDown.prototype.selectAll=function(){var e=this._tbx;this._elRef==e&&wijmo_1.setSelectionRange(e,0,this.text.length);this.containsFocus()||this.focus()};DropDown.prototype.onTextChanged=function(e){this.textChanged.raise(this,e);this._updateState()};DropDown.prototype.onIsDroppedDownChanging=function(e){this.isDroppedDownChanging.raise(this,e);return!e.cancel};DropDown.prototype.onIsDroppedDownChanged=function(e){this.isDroppedDownChanged.raise(this,e)};DropDown.prototype.onGotFocus=function(t){this.isTouching||wijmo_1.contains(this._dropDown,wijmo_1.getActiveElement())||this.selectAll();e.prototype.onGotFocus.call(this,t)};DropDown.prototype.onLostFocus=function(t){this._commitText();this.isDroppedDown=!1;e.prototype.onLostFocus.call(this,t)};DropDown.prototype._containsFocusImpl=function(t){return e.prototype._containsFocusImpl.call(this,t)||this.isDroppedDown&&wijmo_1.contains(this._dropDown,t)};DropDown.prototype.dispose=function(){this.isDroppedDown=!1;var t=this._dropDown;if(t){this._dropDown=null;wijmo_1.removeChild(t);var i=wijmo_1.Control.getControl(t);i&&i.dispose()}e.prototype.dispose.call(this)};DropDown.prototype.refresh=function(t){void 0===t&&(t=!0);e.prototype.refresh.call(this,t);var i=this.hostElement;if(i&&i.offsetHeight&&this.isDroppedDown){var o=wijmo_1.getActiveElement();this.isAnimated&&""!=this._dropDown.style.opacity||wijmo_1.showPopup(this._dropDown,i,!1,!1,null==this.dropDownCssClass);o instanceof HTMLElement&&o!=wijmo_1.getActiveElement()&&o.focus()}};DropDown.prototype._handleResize=function(){this.isDroppedDown&&this.refresh()};DropDown.prototype._dropDownClick=function(e){e.stopPropagation()};DropDown.prototype._expandSelection=function(){var e=this._tbx,t=e.value,i=e.selectionStart,o=e.selectionEnd;if(t&&i==o){var n=this._getCharType(t,i);if(n>-1){for(;o<t.length&&this._getCharType(t,o)==n;o++);for(;i>0&&this._getCharType(t,i-1)==n;i--);i!=o&&wijmo_1.setSelectionRange(e,i,o)}}};DropDown.prototype._getCharType=function(e,t){var i=e[t];return i>="0"&&i<="9"?0:i>="a"&&i<="z"||i>="A"&&i<="Z"?1:-1};DropDown.prototype._keydown=function(e){if(!e.defaultPrevented&&!this._isHiddenEditor()){switch(e.keyCode){case wijmo_1.Key.Escape:case wijmo_1.Key.Enter:if(this.isDroppedDown){this.isDroppedDown=!1;this.containsFocus()||this.focus();e.preventDefault()}break;case wijmo_1.Key.F4:this.toggleDropDown(e);break;case wijmo_1.Key.Up:this.handleUpArrowKey(e);break;case wijmo_1.Key.Down:this.handleDownArrowKey(e)}if(!e.defaultPrevented&&e.keyCode==wijmo_1.Key.Escape&&wijmo_1.isIE()){var t=this._tbx;if(e.target==t){var i=t.value;t.value=i+" ";t.value=i}}}};DropDown.prototype.toggleDropDown=function(e){if(this.isHostVisible()){this.isDroppedDown=!this.isDroppedDown;e.preventDefault()}};DropDown.prototype.handleUpArrowKey=function(e){e.altKey?this.toggleDropDown(e):this.keyActionUpArrow!==KeyAction.OpenDropdown||this.isDroppedDown||this.openDropDown(e)};DropDown.prototype.handleDownArrowKey=function(e){if(e.altKey)this.toggleDropDown(e);else if(this.keyActionDownArrow===KeyAction.OpenDropdown&&!this.isDroppedDown){this.openDropDown(e);this._afterOpenDropdownByDownArrow()}};DropDown.prototype._afterOpenDropdownByDownArrow=function(){};DropDown.prototype.openDropDown=function(e){if(this.isHostVisible()){this.isDroppedDown=!0;e.preventDefault()}};DropDown.prototype.isHostVisible=function(){var e=this.hostElement;return!(!e||!e.offsetHeight)};DropDown.prototype._isHiddenEditor=function(){return wijmo_1.hasClass(this._tbx,"wj-grid-ime")};DropDown.prototype._keypress=function(e){"AltLeft"!=e.code&&"AltRight"!=e.code||e.preventDefault()};DropDown.prototype._input=function(e){this._setText(this.text,!1)};DropDown.prototype._btnclick=function(e){if(!e.defaultPrevented&&0==e.button){this._isInvalidInputCancelled=!1;e.preventDefault();if(this.isTouching){this._tbx.getAttribute("inputmode");this._tbx.setAttribute("inputmode","none");this.isDroppedDown=!this.isDroppedDown;this.selectAll()}else{this.focus();this.isDroppedDown=!this.isDroppedDown}}};DropDown.prototype._setText=function(e,t,i,o){var n=!1;if((e=(e||"").toString())!=this._tbx.value){this._tbx.value=e;if(i||!e){this.onTextChanged();n=!0}}if(e!=this._oldText){this._oldText=e;this._internalSettingText||n||this.onTextChanged()}o&&(this._tbx.value=this._tbx.value.trim());this._updateState()};DropDown.prototype._updateBtn=function(){this._btn.style.display=this._showBtn?"":"none";this._updateBtnAria()};DropDown.prototype._updateBtnAria=function(){var e=this._btn.querySelector("button"),t=this.isDroppedDown,i=this.dropDown?this.dropDown.id:null;wijmo_1.setAttribute(e,"aria-expanded",!!t);wijmo_1.setAttribute(e,"aria-controls",t?i:null)};DropDown.prototype._updateTbx=function(){this._updateTbxAria()};DropDown.prototype._updateTbxAria=function(){var e=this._tbx,t=this.isDroppedDown,i=this.dropDown?this.dropDown.id:null;wijmo_1.setAttribute(e,"aria-controls",t?i:null);wijmo_1.setAttribute(e,"aria-expanded",t)};DropDown.prototype._updateTbxAriaHaspopup=function(){var e=this._tbx,t=this.dropDown&&this.dropDown.getAttribute("role");wijmo_1.setAttribute(e,"aria-haspopup",t)};DropDown.prototype._createDropDown=function(){};DropDown.prototype._commitText=function(e,t){};DropDown.prototype._updateDropDown=function(){if(this.isDroppedDown){this._commitText();var e=this.dropDown;wijmo_1.setAttribute(e,"dir",this.rightToLeft?"rtl":null);wijmo_1.showPopup(e,this.hostElement,!1,this._animate,null==this.dropDownCssClass)}};DropDown.prototype._shouldRaiseInvalidInput=function(e){return wijmo_1.isNullOrUndefined(e)?!this._containsFocus():e};DropDown._ctrlTemplate="";return DropDown}(wijmo_1.Control);exports.DropDown=DropDown;wijmo_1._addCultureInfo("Popup",{ariaLabels:{close:"close",backdrop:"backdrop",isDraggable:"draggable",isResizable:"resizable",popupVisible:"visible",popupHide:"hidden",popup:"popup"}});!function(e){e[e.None=0]="None";e[e.ClickOwner=1]="ClickOwner";e[e.ClickPopup=2]="ClickPopup";e[e.Click=3]="Click";e[e.BlurOwner=4]="BlurOwner";e[e.BlurPopup=8]="BlurPopup";e[e.Blur=12]="Blur";e[e.ClickOrBlur=15]="ClickOrBlur";e[e.DownOwner=16]="DownOwner";e[e.DownPopup=32]="DownPopup";e[e.Down=48]="Down";e[e.EnterOwner=64]="EnterOwner";e[e.EnterPopup=128]="EnterPopup";e[e.Enter=192]="Enter";e[e.LeaveOwner=256]="LeaveOwner";e[e.LeavePopup=512]="LeavePopup";e[e.Leave=768]="Leave"}(PopupTrigger=exports.PopupTrigger||(exports.PopupTrigger={}));!function(e){e[e.None=0]="None";e[e.Left=1]="Left";e[e.Top=2]="Top";e[e.Right=4]="Right";e[e.Bottom=8]="Bottom";e[e.LeftTop=3]="LeftTop";e[e.RightTop=6]="RightTop";e[e.RightBottom=12]="RightBottom";e[e.LeftBottom=9]="LeftBottom"}(_Edges||(_Edges={}));var Popup=function(e){__extends(Popup,e);function Popup(t,i){var o=e.call(this,t)||this;o._owner=null;o._ariaLabel=wijmo_1.culture.Popup.ariaLabels.popup;o._modal=!1;o._position=wijmo_1.PopupPosition.BelowLeft;o._showTrigger=PopupTrigger.ClickOwner;o._hideTrigger=PopupTrigger.Blur;o._hideAnim=[];o._fadeIn=!0;o._fadeOut=!0;o._removeOnHide=!0;o._draggable=!1;o._resizable=!1;o._result=null;o._resultEnter=null;o._resultSubmit=null;o._callback=null;o._visible=!1;o._ownerClickBnd=o._ownerClick.bind(o);o._ownerDownBnd=o._ownerDown.bind(o);o._ownerBlurBnd=o._ownerBlur.bind(o);o._ownerEnterBnd=o._ownerEnter.bind(o);o._ownerLeaveBnd=o._ownerLeave.bind(o);o._mousedownBnd=o._mousedown.bind(o);o._mousemoveBnd=o._mousemove.bind(o);o._mousedragBnd=o._mousedrag.bind(o);o._mouseupBnd=o._mouseup.bind(o);o._hideBnd=o.hide.bind(o);o._lastShow=0;o._initialOwner=null;o._activeEdge=_Edges.None;o.showing=new wijmo_1.Event;o.shown=new wijmo_1.Event;o.hiding=new wijmo_1.Event;o.hidden=new wijmo_1.Event;o.resizing=new wijmo_1.Event;o.resized=new wijmo_1.Event;o.dragging=new wijmo_1.Event;o.dragged=new wijmo_1.Event;o.sizeChanging=new wijmo_1.Event;o.sizeChanged=new wijmo_1.Event;o.positionChanging=new wijmo_1.Event;o.positionChanged=new wijmo_1.Event;var n=o.hostElement;Popup._PopupInstanceCount++;wijmo_1.addClass(n,wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.PopupClsNames.hostElement);if(o.hostElement){o._initialOwner=o.hostElement.parentElement;wijmo_1.setAttribute(o.hostElement,"role","dialog")}n.getAttribute("tabindex")||(n.tabIndex=0);wijmo_1.hidePopup(n,!1);var s=o.addEventListener.bind(o);s(n,"compositionstart",(function(){o._composing=!0}));s(n,"compositionend",(function(){o._composing=!1}));s(window,"resize",(function(){!o.isVisible||o._dragged||o.isTouching||o.invalidate()}));s(n,"keydown",(function(e){if(!e.defaultPrevented){var t=e.ctrlKey&&e.altKey&&!e.shiftKey,i=e.ctrlKey&&e.shiftKey&&!e.altKey;if(t||i){var s=o.hostElement.getBoundingClientRect(),r=wijmo_1.Rect.fromBoundingRect(s);if(t&&o.isDraggable){e.preventDefault();switch(e.keyCode){case wijmo_1.Key.Left:r.left=Math.max(0,r.left-10);break;case wijmo_1.Key.Right:r.left=Math.min(window.innerWidth-r.width,r.left+10);break;case wijmo_1.Key.Up:r.top=Math.max(0,r.top-10);break;case wijmo_1.Key.Down:r.top=Math.min(window.innerHeight-r.height,r.top+10)}var a=new PopupBoundsChangingEventArgs(r);if(o.onPositionChanging(a)){wijmo_1.setCss(o.hostElement,{left:r.left+window.scrollX,top:r.top+window.scrollY,transform:"none"});o.onPositionChanged()}}else if(i&&o.isResizable){e.preventDefault();var l=window.getComputedStyle(o.hostElement),h=Math.max(parseInt(l.minWidth)||0,Popup._SZ_MIN),u=Math.max(parseInt(l.minHeight)||0,Popup._SZ_MIN);if(o._activeEdge===_Edges.None)switch(e.keyCode){case wijmo_1.Key.Up:o._activeEdge=_Edges.Top;break;case wijmo_1.Key.Down:o._activeEdge=_Edges.Bottom;break;case wijmo_1.Key.Left:o._activeEdge=_Edges.Left;break;case wijmo_1.Key.Right:o._activeEdge=_Edges.Right}var c=o._activeEdge===_Edges.Top||o._activeEdge===_Edges.Bottom,p=o._activeEdge===_Edges.Left||o._activeEdge===_Edges.Right;if(c&&![wijmo_1.Key.Up,wijmo_1.Key.Down].includes(e.keyCode)||p&&![wijmo_1.Key.Left,wijmo_1.Key.Right].includes(e.keyCode))return;if(o._activeEdge!==_Edges.None){var d=0;switch(e.keyCode){case wijmo_1.Key.Up:case wijmo_1.Key.Left:d=-10;break;case wijmo_1.Key.Down:case wijmo_1.Key.Right:d=10}switch(o._activeEdge){case _Edges.Top:var _=Math.min(Math.max(r.top+d,0),r.bottom-u);r.height=r.bottom-_;r.top=_;break;case _Edges.Bottom:var m=Math.min(Math.max(r.bottom+d,r.top+u),window.innerHeight);r.height=m-r.top;break;case _Edges.Left:var f=Math.min(Math.max(r.left+d,0),r.right-h);r.width=r.right-f;r.left=f;break;case _Edges.Right:var b=Math.min(Math.max(r.right+d,r.left+h),window.innerWidth);r.width=b-r.left}r.left=Math.max(0,Math.min(r.left,window.innerWidth-r.width));r.top=Math.max(0,Math.min(r.top,window.innerHeight-r.height));var g=new PopupBoundsChangingEventArgs(r);if(o.onSizeChanging(g)){wijmo_1.setCss(o.hostElement,{left:r.left+window.scrollX,top:r.top+window.scrollY,width:r.width,height:r.height,transform:"none"});o.onSizeChanged()}}}}if(e.keyCode==wijmo_1.Key.Escape&&!o._composing){e.preventDefault();o.hide()}if(e.keyCode==wijmo_1.Key.Enter&&!o._composing){var w=o.dialogResultEnter;if(w){e.preventDefault();o._validateAndHide(w)}}if(e.keyCode==wijmo_1.Key.Tab&&o.modal){e.preventDefault();wijmo_1.moveFocus(n,e.shiftKey?-1:1)}}}));s(document,"keyup",(function(e){e.ctrlKey||e.shiftKey||o._activeEdge===_Edges.None||(o._activeEdge=_Edges.None)}));s(n,"click",(function(e){var t=e.target;if(t instanceof HTMLElement){if(t instanceof HTMLButtonElement&&"submit"==t.type){var i=o.hostElement,n=o.dialogResultSubmit;if(i instanceof HTMLFormElement&&n&&i.reportValidity()){e.preventDefault();o.hide(n)}}var s=t.className.match(/\bwj-hide[\S]*\b/);if(s&&s.length>0){e.preventDefault();e.stopPropagation();o.hide(s[0])}}}));var r=o._toggle.bind(o),a=PopupTrigger;o.addEventListener(n,"click",(function(e){o._ignoreClick||r(e,a.ClickPopup)}),!0);o.addEventListener(n,"mousedown",(function(e){o._ignoreClick=!1;r(e,a.DownPopup)}),!0);o.addEventListener(n,"mouseenter",(function(e){e.target==n&&r(e,a.EnterPopup)}),!0);o.addEventListener(n,"mouseleave",(function(e){e.target==n&&r(e,a.LeavePopup)}),!0);o.addEventListener(n,"blur",(function(e){o.containsFocus()||r(e,a.BlurPopup)}),!0);s(document,"wheel",(function(e){if(o.isVisible&&o._modal){for(var t=e.target;t&&t!=document.body;t=t.parentElement)if(t.scrollHeight>t.clientHeight)return;e.preventDefault()}}));o.initialize(i);o._updateAriaLabel();return o}Object.defineProperty(Popup.prototype,"ariaLabelledBy",{get:function(){return this.hostElement.getAttribute("aria-labelledby")},set:function(e){wijmo_1._setAriaLabelBy(this,this.hostElement,e,this._updateAriaLabel.bind(this))},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"owner",{get:function(){return this._owner},set:function(e){var t=this._owner;if(t){this.removeEventListener(t,"click");this.removeEventListener(t,"mousedown");this.removeEventListener(t,"mouseenter");this.removeEventListener(t,"mouseleave");this.removeEventListener(t,"blur")}if(t=this._owner=null!=e?wijmo_1.getElement(e):null){this.addEventListener(t,"click",this._ownerClickBnd,!0);this.addEventListener(t,"mousedown",this._ownerDownBnd,!0);this.addEventListener(t,"mouseenter",this._ownerEnterBnd,!0);this.addEventListener(t,"mouseleave",this._ownerLeaveBnd,!0);this.addEventListener(t,"blur",this._ownerBlurBnd,!0)}},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"position",{get:function(){return this._position},set:function(e){this._position=wijmo_1.asEnum(e,wijmo_1.PopupPosition)},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"content",{get:function(){return this.hostElement.firstElementChild},set:function(e){if(e!=this.content){this.hostElement.innerHTML="";e instanceof HTMLElement&&this.hostElement.appendChild(e)}},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"showTrigger",{get:function(){return this._showTrigger},set:function(e){this._showTrigger=wijmo_1.asEnum(e,PopupTrigger)},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"hideTrigger",{get:function(){return this._hideTrigger},set:function(e){this._hideTrigger=wijmo_1.asEnum(e,PopupTrigger)},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"fadeIn",{get:function(){return this._fadeIn},set:function(e){this._fadeIn=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"fadeOut",{get:function(){return this._fadeOut},set:function(e){this._fadeOut=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"removeOnHide",{get:function(){return this._removeOnHide},set:function(e){if((e=wijmo_1.asBoolean(e))!=this.removeOnHide){this._removeOnHide=e;if(!this.isVisible){var t=this.hostElement;if(e)wijmo_1.removeChild(t);else if(t&&document.body){t.style.display="none";document.body.appendChild(t)}}}},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"modal",{get:function(){return this._modal},set:function(e){this._modal=wijmo_1.asBoolean(e);wijmo_1.setAttribute(this.hostElement,"aria-modal",e?"true":null)},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"isDraggable",{get:function(){return this._draggable},set:function(e){this._draggable=wijmo_1.asBoolean(e);this._updateAriaLabel()},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"isResizable",{get:function(){return this._resizable},set:function(e){this._resizable=wijmo_1.asBoolean(e);this._updateAriaLabel()},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"dialogResult",{get:function(){return this._result},set:function(e){this._result=e},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"dialogResultEnter",{get:function(){return this._resultEnter},set:function(e){this._resultEnter=e},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"dialogResultSubmit",{get:function(){return this._resultSubmit},set:function(e){this._resultSubmit=wijmo_1.asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"isVisible",{get:function(){var e=this.hostElement;return this._visible&&null!=e&&e.offsetHeight>0},enumerable:!0,configurable:!0});Popup.prototype.show=function(e,t){var i=this;this._lastShow=Date.now();if(!this.isVisible){var o=this.hostElement;this.dialogResult=null;this._callback=null;this._oldFocus=null;this._myFocus=null;this._hideAnim.forEach((function(e){clearInterval(e)}));if(this._hideAnim.length>0){this._hideAnim.length=0;if(this._bkDrop){wijmo_1.hidePopup(this._bkDrop,this.removeOnHide);this._bkDrop.style.opacity=""}wijmo_1.hidePopup(o,this.removeOnHide);o.style.opacity=""}var n=new wijmo_1.CancelEventArgs;if(this.onShowing(n)){null!=e&&(this.modal=wijmo_1.asBoolean(e));null!=t&&(this._callback=wijmo_1.asFunction(t));this._oldFocus=wijmo_1.getActiveElement();wijmo_1.showPopup(o,this._owner,this._position,this._fadeIn,!1,this._hideBnd);this._modal&&this._showBackdrop();wijmo_1.setAttribute(this._oldFocus,"aria-expanded","true");this._composing=!1;this._visible=!0;this.onShown(n);this._updateAriaLabel();this._clearTimeouts();if(this.modal){this.addEventListener(window,"focus",(function(){if(!i.containsFocus()){var e=i._myFocus;e&&e.offsetHeight?e.focus():wijmo_1.moveFocus(o,0)}}));this.addEventListener(o,"focusin",(function(){var e=wijmo_1.getActiveElement();e&&wijmo_1.contains(o,e)&&(e.tabIndex>-1||!i._myFocus)&&(i._myFocus=e)}))}this._resized=this._dragged=this._ignoreClick=!1;this._handleDragResize(!0);this.addEventListener(window,"touchstart",(function(e){i._hideTrigger&PopupTrigger.Blur&&!wijmo_1.contains(o,e.target,!0)&&i.hide()}));this._toHidePopupTimer=setTimeout((function(){i.addEventListener(window,"click",(function(e){i._hideTrigger&PopupTrigger.BlurPopup&&i.isDisabled&&!wijmo_1.contains(o,e.target,!0)&&i.hide()}))}));this._toGetFocusTimer=setTimeout((function(){if(!i.isDisabled&&!i.containsFocus()&&!i.isTouching){var e=o.querySelector("[autofocus]");if(e&&e.clientHeight>0&&!e.disabled&&e.tabIndex>-1&&!wijmo_1.closest(e,"[disabled],."+wijmo_1.ControlStateClsNames.disabled)){e.focus();wijmo_1.isFunction(e.select)&&e.select()}else wijmo_1.moveFocus(o,0)}if(!i.isDisabled&&!i.containsFocus()){o.tabIndex=0;o.focus()}}),100)}}};Popup.prototype.hide=function(e){var t=this;this.removeEventListener(window,"touchstart");this.removeEventListener(window,"click");if(this.isVisible){wijmo_1.isUndefined(e)||(this.dialogResult=e);var i=new wijmo_1.CancelEventArgs,o=this.hostElement;if(this.onHiding(i)){this._handleDragResize(!1);for(var n=this.containsFocus()?this._oldFocus:null,s=o.querySelectorAll("."+wijmo_1.ControlClsNames.hostElement+"."+exports.DropDownClsNames.hostElement),r=0;r<s.length;r++){var a=wijmo_1.Control.getControl(s[r]);a instanceof DropDown&&(a.isDroppedDown=!1)}var l=this.removeOnHide,h=this.fadeOut;this._hideTimer=setTimeout((function(){t._updateState();t.onHidden(i);t._callback&&t._callback(t);if(t.hideTrigger&PopupTrigger.LeavePopup){var e=wijmo_1.Control.getControl(wijmo_1.closest(t.owner,"."+exports.PopupClsNames.hostElement));if(e instanceof Popup&&0!=(e.hideTrigger&PopupTrigger.Leave)){var o=Popup._evtHover,n=o?document.elementFromPoint(o.clientX,o.clientY):null,s=wijmo_1.Control.getControl(wijmo_1.closest(n,"."+exports.PopupClsNames.hostElement));s instanceof Popup&&!s.isVisible&&(n=null);n&&wijmo_1.contains(e.hostElement,n,!0)||e.hide()}}}),wijmo_1.Control._FOCUS_INTERVAL+50);this._bkDrop&&this._hideAnim.push(wijmo_1.hidePopup(this._bkDrop,l,h));this._hideAnim.push(wijmo_1.hidePopup(o,l,h));wijmo_1.setAttribute(this._oldFocus,"aria-expanded","false");this._visible=!1;this._oldFocus=null;this._myFocus=null;this._updateAriaLabel();this.removeEventListener(window,"focus");this.removeEventListener(o,"focusin");this.containsFocus()&&wijmo_1.getActiveElement().blur();this._clearTimeouts();!this.isVisible&&n&&n.offsetHeight&&n.focus()}}};Popup.prototype.onShowing=function(e){this.showing.raise(this,e);return!e.cancel};Popup.prototype.onShown=function(e){this.shown.raise(this,e)};Popup.prototype.onHiding=function(e){this.hiding.raise(this,e);return!e.cancel};Popup.prototype.onHidden=function(e){this._wasVisible=!1;this.hidden.raise(this,e)};Popup.prototype.onResizing=function(e){this.resizing.raise(this,e);return!e.cancel};Popup.prototype.onResized=function(e){this.resized.raise(this,e)};Popup.prototype.onDragging=function(e){this.dragging.raise(this,e);return!e.cancel};Popup.prototype.onDragged=function(e){this.dragged.raise(this,e)};Popup.prototype.onSizeChanging=function(e){this.sizeChanging.raise(this,e);return!e.cancel};Popup.prototype.onSizeChanged=function(e){this.sizeChanged.raise(this,e)};Popup.prototype.onPositionChanging=function(e){this.positionChanging.raise(this,e);return!e.cancel};Popup.prototype.onPositionChanged=function(e){this.positionChanged.raise(this,e)};Popup.prototype.onLostFocus=function(t){e.prototype.onLostFocus.call(this,t);if(this._hideTrigger&PopupTrigger.BlurPopup&&!this.containsFocus()){var i=document.createEvent("Event");i.initEvent("blur",!0,!0);this._toggle(i,PopupTrigger.BlurPopup)}};Popup.prototype.refresh=function(t){void 0===t&&(t=!0);var i=this.hostElement;e.prototype.refresh.call(this,t);if(this.isVisible&&!this._refreshing&&i){this._refreshing=!0;for(var o=wijmo_1.getActiveElement(),n=this._owner?this._owner.getBoundingClientRect():null,s=[],r=i.querySelectorAll("."+exports.DropDownClsNames.hostElement),a=0;a<r.length;a++){var l=wijmo_1.Control.getControl(r[a]);if(l instanceof DropDown&&l.isDroppedDown){s.push(l);l.dropDown.style.display="none"}}wijmo_1.showPopup(i,n,this._position);s.forEach((function(e){e.dropDown.style.display="";e._updateDropDown()}));this._modal&&o instanceof HTMLElement&&o!=wijmo_1.getActiveElement()&&o.focus();this._refreshing=!1}};Popup.prototype._clearTimeouts=function(){if(this._toShow){clearTimeout(this._toShow);this._toShow=null}if(this._toHideLeave){clearTimeout(this._toHideLeave);this._toHideLeave=null}if(this._toHideBlur){clearTimeout(this._toHideBlur);this._toHideBlur=null}};Popup.prototype._handleDragResize=function(e){var t=this.hostElement,i=this._draggable?this._getHeaderElement():null,o=this.addEventListener.bind(this),n=this.removeEventListener.bind(this),s=this._mousemoveBnd,r=this._mousedownBnd;if(e){o(t,"mousemove",s);o(t,"mousedown",r);o(t,"touchstart",r);i&&(i.style.touchAction="none")}else{this._mousedownEvt=null;this._rcBounds=null;n(t,"mousemove",s);n(t,"mousedown",r);n(t,"touchstart",r);n(document,"mousemove",this._mousedragBnd);n(document,"mouseup",this._mouseupBnd);i&&(i.style.touchAction="")}};Popup.prototype._mousemove=function(e){if(!this._mousedownEvt){var t=this.hostElement,i=this._getEdges(t,e),o="",n=_Edges;this._edges=i;this._resizable&&(i==n.LeftTop||i==n.RightBottom?o="nwse-resize":i==n.LeftBottom||i==n.RightTop?o="nesw-resize":i==n.Left||i==n.Right?o="ew-resize":i!=n.Top&&i!=n.Bottom||(o="ns-resize"));this._draggable&&!o&&this._getClosestHeader(e.target)&&(o="move");t.style.cursor=o}};Popup.prototype._mousedown=function(e){if(!e.defaultPrevented){var t=e.touches&&e.touches.length>0?e.touches[0]:e;this._edges=this._getEdges(this.hostElement,t);if(this._edges||this._draggable&&this._getClosestHeader(e.target)){var i=new wijmo_1.CancelEventArgs;if(this._edges?this.onResizing(i):this.onDragging(i)){this._mousedownEvt=t;this._rcBounds=this.hostElement.getBoundingClientRect();var o=this.addEventListener.bind(this),n=document,s=this._mousedragBnd,r=this._mouseupBnd;o(n,"mousemove",s);o(n,"touchmove",s);o(n,"mouseup",r);o(n,"touchend",r)}}this._ignoreClick=!1}};Popup.prototype._mouseup=function(){this._mousedownEvt=null;this._rcBounds=null;this._activeEdge=_Edges.None;var e=this.removeEventListener.bind(this),t=document,i=this._mousedragBnd,o=this._mouseupBnd;e(t,"mousemove",i);e(t,"touchmove",i);e(t,"mouseup",o);e(t,"touchend",o);this._resized?this.onResized():this._dragged&&this.onDragged();this._resized=this._dragged=this._ignoreClick=!1};Popup.prototype._mousedrag=function(e){if(!e.defaultPrevented){var t=this.hostElement,i=this._mousedownEvt,o=e.touches&&e.touches.length>0?e.touches[0]:e,n=o.clientX-i.clientX,s=o.clientY-i.clientY,r=this._rcBounds,a=this._edges,l=Popup._SZ_MIN,h=wijmo_1.Rect.fromBoundingRect(r);if(a){var u=window.getComputedStyle(t),c=parseInt(u.getPropertyValue("min-width"))||l,p=parseInt(u.getPropertyValue("min-height"))||l;if(a&_Edges.Left){var d=h.right-c;h.left=Math.min(h.left+n,d);h.width=Math.max(h.width-n,c)}else a&_Edges.Right&&(h.width=Math.max(h.width+n,c));if(a&_Edges.Top){var _=h.bottom-p;h.top=Math.min(h.top+s,_);h.height=Math.max(h.height-s,p)}else a&_Edges.Bottom&&(h.height=Math.max(h.height+s,p));if(this.onSizeChanging(new PopupBoundsChangingEventArgs(h))){wijmo_1.setCss(t,{left:h.left+window.scrollX,top:h.top+window.scrollY,width:h.width,height:h.height,transform:"none"});this._resized=this._dragged=this._ignoreClick=!0;this.onSizeChanged()}if(!window.ResizeObserver)for(var m=this.hostElement.children,f=0;f<m.length;f++)wijmo_1.Control.invalidateAll(m[f])}else if(this._draggable){"touchmove"===e.type&&wijmo_1.isiOS()&&e.preventDefault();if(this._dragged||Math.abs(n)+Math.abs(s)>Popup._DRAG_THRESHOLD){h.left=Math.max(r.left+n+(o.pageX-o.clientX),50-r.width);h.top=Math.max(r.top+s+(o.pageY-o.clientY),0);if(this.onPositionChanging(new PopupBoundsChangingEventArgs(h))){wijmo_1.setCss(t,{left:h.left,top:h.top,width:h.width,height:h.height,transform:"none"});this._dragged=this._ignoreClick=!0;this.onPositionChanged()}}}}};Popup.prototype._getEdges=function(e,t){var i=0;if(this._resizable){var o=e.getBoundingClientRect(),n=Popup._SZ_EDGE;t.clientX-o.left<n&&(i|=_Edges.Left);t.clientY-o.top<n&&(i|=_Edges.Top);o.right-t.clientX<n&&(i|=_Edges.Right);o.bottom-t.clientY<n&&(i|=_Edges.Bottom)}return i};Popup.prototype._ownerClick=function(e){this._toggle(e,PopupTrigger.ClickOwner)};Popup.prototype._ownerDown=function(e){this._wasVisible=this.isVisible;this._toggle(e,PopupTrigger.DownOwner)};Popup.prototype._ownerBlur=function(e){wijmo_1.contains(this._owner,wijmo_1.getActiveElement())||this._toggle(e,PopupTrigger.BlurOwner)};Popup.prototype._ownerEnter=function(e){e.target==this._owner&&this._toggle(e,PopupTrigger.EnterOwner)};Popup.prototype._ownerLeave=function(e){e.target==this._owner&&this._toggle(e,PopupTrigger.LeaveOwner)};Popup.prototype._toggle=function(e,t){var i=this;e instanceof MouseEvent&&(Popup._evtHover=e);if(!("mouseenter"==e.type&&Date.now()-this._lastShow<300||e.defaultPrevented)){var o=0!=(this._hideTrigger&t),n=0!=(this._showTrigger&t),s=PopupTrigger;(o||n)&&this._clearTimeouts();o&&this.isVisible&&(t&s.Leave?this._toHideLeave=setTimeout((function(){var e=Popup._evtHover,t=e?document.elementFromPoint(e.clientX,e.clientY):null;t&&wijmo_1.contains(i.hostElement,t,!0)||i.hide()}),wijmo_1.Control._LEAVE_DELAY):t&s.Blur?this._toHideBlur=setTimeout((function(){i.containsFocus()||wijmo_1.contains(i._owner,wijmo_1.getActiveElement())||i.hide()}),wijmo_1.Control._FOCUS_INTERVAL+50):this.hide());n&&t!=s.ClickPopup&&(this._wasVisible||(t&s.Enter?this._toShow=setTimeout((function(){i.show()}),wijmo_1.Control._HOVER_DELAY):this.show()))}};Popup.prototype._getHeaderElement=function(){var e=this.hostElement;return e.querySelector("."+exports.PopupClsNames.dialogHeader)||e.querySelector(".modal-header")};Popup.prototype._getClosestHeader=function(e){return wijmo_1.closest(e,"."+exports.PopupClsNames.dialogHeader)||wijmo_1.closest(e,".modal-header")};Popup.prototype._showBackdrop=function(){var e=this;if(!this._bkDrop){this._bkDrop=document.createElement("div");this._bkDrop.tabIndex=-1;wijmo_1.setAttribute(this._bkDrop,"role","presentation");wijmo_1.setAttribute(this._bkDrop,"aria-hidden","true");wijmo_1.setAttribute(this._bkDrop,"aria-label",wijmo_1.culture.Popup.ariaLabels.backdrop);wijmo_1.addClass(this._bkDrop,exports.PopupClsNames.popupBackDrop);this.addEventListener(this._bkDrop,"mousedown",(function(t){t.preventDefault();t.stopPropagation();e.hostElement.focus();e.hideTrigger&PopupTrigger.Blur&&e.hide()}))}wijmo_1.setCss(this._bkDrop,{zIndex:wijmo_1.Control._POPUP_ZINDEX,display:""});var t=this.hostElement;t.parentElement.insertBefore(this._bkDrop,t)};Popup.prototype._validateAndHide=function(e){var t=this.hostElement;if(t instanceof HTMLFormElement)t.reportValidity()&&this.hide(e);else{var i=this.hostElement.querySelector(":invalid");i?i.focus():this.hide(e)}};Popup.prototype._updateAriaLabel=function(){this.hostElement&&(this.ariaLabelledBy?this._updateAriaLabelImp(""):this._updateAriaLabelImp(this._ariaLabel))};Popup.prototype._updateAriaLabelImp=function(e){var t=[];this.isDraggable&&t.push(wijmo_1.culture.Popup.ariaLabels.isDraggable);this.isResizable&&t.push(wijmo_1.culture.Popup.ariaLabels.isResizable);this.isVisible?t.push(wijmo_1.culture.Popup.ariaLabels.popupVisible):t.push(wijmo_1.culture.Popup.ariaLabels.popupHide);var i=t.join(",");wijmo_1.setAttribute(this.hostElement,"aria-label",e?e+" "+i:i)};Popup.prototype.dispose=function(){Popup._PopupInstanceCount--;0===Popup._PopupInstanceCount&&Popup._evtHover&&(Popup._evtHover=null);this._clearTimeouts();if(this._toHidePopupTimer){clearTimeout(this._toHidePopupTimer);this._toHidePopupTimer=null}if(this._toGetFocusTimer){clearTimeout(this._toGetFocusTimer);this._toGetFocusTimer=null}if(this._hideTimer){clearTimeout(this._hideTimer);this._hideTimer=null}this._hideAnim.forEach((function(e){clearInterval(e)}));this._hideAnim=[];var t=this.hostElement;if(t)for(var i=t.querySelectorAll("."+exports.DropDownClsNames.hostElement),o=0;o<i.length;o++){var n=wijmo_1.Control.getControl(i[o]);n&&n instanceof DropDown&&n.dispose()}if(this._initialOwner){this._initialOwner.appendChild(this.hostElement);this._initialOwner=null}this.owner=null;if(this._bkDrop){this._bkDrop.remove();this._bkDrop=null}this._callback=null;e.prototype.dispose.call(this)};Popup._DRAG_THRESHOLD=6;Popup._SZ_EDGE=10;Popup._SZ_MIN=40;Popup._PopupInstanceCount=0;return Popup}(wijmo_1.Control);exports.Popup=Popup;var PopupBoundsChangingEventArgs=function(e){__extends(PopupBoundsChangingEventArgs,e);function PopupBoundsChangingEventArgs(t){var i=e.call(this)||this;i._rc=t;return i}Object.defineProperty(PopupBoundsChangingEventArgs.prototype,"bounds",{get:function(){return this._rc},enumerable:!0,configurable:!0});return PopupBoundsChangingEventArgs}(wijmo_1.CancelEventArgs);exports.PopupBoundsChangingEventArgs=PopupBoundsChangingEventArgs;wijmo_1._addCultureInfo("InputDate",{ariaLabels:{inputDateInput:"InputDate Input",inputDate:"Input Date",button:"Choose Date",dialog:"Calendar"}});var InputDateEventArgs=function(e){__extends(InputDateEventArgs,e);function InputDateEventArgs(t){var i=e.call(this)||this;i._isUserInput=t;return i}Object.defineProperty(InputDateEventArgs.prototype,"isUserInput",{get:function(){return this._isUserInput},enumerable:!0,configurable:!0});return InputDateEventArgs}(wijmo_1.CancelEventArgs);exports.InputDateEventArgs=InputDateEventArgs;var InputDate=function(e){__extends(InputDate,e);function InputDate(t,i){var o=e.call(this,t)||this;o._fmt=wijmo_1.Globalize.DefaultDateFormat;o._sep=" - ";o._rngs=null;o._showCal=!1;o._clsOnSel=!0;o._handleWheel=!0;o._preserveCalendarNavigation=!0;o._isTriggered=!1;o._rangeChanged=!1;o._textInitialized=!1;o._previousText="";o._keepInvalidText=!1;o._inputAriaLabel=wijmo_1.culture.InputDate.ariaLabels.inputDateInput;o._currentInput="";o._ariaLabelledby=null;o.valueChanged=new wijmo_1.Event;o.rangeEndChanged=new wijmo_1.Event;o.rangeChanged=new wijmo_1.Event;wijmo_1.addClass(o.hostElement,exports.InputDateClsNames.hostElement);var n=wijmo_1.culture.InputDate.ariaLabels;wijmo_1.setAttribute(o._btn.querySelector("button"),"aria-haspopup","dialog");wijmo_1.setAttribute(o._dropDown,"role","dialog");wijmo_1.setAriaLabel(o._dropDown,n.dialog);wijmo_1.setAttribute(o._dropDown,"aria-modal",!0);wijmo_1.setAttribute(o._tbx,"role","combobox");wijmo_1.setAttribute(o._tbx,"aria-haspopup","dialog");wijmo_1.setAriaLabel(o._btn.querySelector("button"),n.button);o.dropDown.id=wijmo_1.getUniqueId(o.hostElement.id+"_dropdown");o._msk=new wijmo_1._MaskProvider(o._tbx);var s=o.addEventListener.bind(o);wijmo_1.isIE9()||(o.inputType="tel");o._tbx.type.match(/^(tel|text|)$/i)||(o.inputType="text");var r=o._mouseWheel.bind(o);s(o.hostElement,"wheel",r);o._lbx=new ListBox(document.createElement("div"),{displayMemberPath:"name",selectedIndexChanged:function(e){var t=e.selectedItem,i=wijmo_1.DateTime.fromDateTime,n=wijmo_1.DateTime.sameDate;if(t&&t.from&&t.to){if(!n(t.from,o.value)||!n(t.to,o.rangeEnd)){var s=o.value;o.value=i(t.from,s);o.rangeEnd=i(t.to,s)}o._selectAll()}else o._cal.hostElement.style.display=""}});var a=o._lbx;o._cal=new Calendar(document.createElement("div"));var l=o._cal,h=o._dropDown;wijmo_1.addClass(h,exports.InputDateClsNames.inputDateDropDown);var u=document.createElement("div");wijmo_1.addClass(u,exports.InputDateClsNames.inputDateDropDownContainer);u.appendChild(a.hostElement);u.appendChild(l.hostElement);h.appendChild(u);o.addEventListener(h,"click",(function(){o._isTriggered=!0;setTimeout((function(){o._isTriggered=!1}),50)}),!0);o.addEventListener(h,"keydown",(function(e){if("Enter"===e.key){o._isTriggered=!0;setTimeout((function(){o._isTriggered=!1}),50)}}),!0);if("INPUT"==o._orgTag){var c=o._tbx.getAttribute("value");c&&(l.value=l.rangeEnd=wijmo_1.Globalize.parseDate(c,"yyyy-MM-dd"))}o.isRequired=!0;o._tbx.value=o._oldText=o._getText();o.initialize(i);var p=wijmo_1.isNullOrUndefined(o.tabOrder)?0:o.tabOrder;l.tabOrder=-1!==p&&o.showConfirmationButtons?p:-1;a.tabOrder=p;if(o._textInitialized||o._tbx.value!==o._oldText){o._oldText=o._tbx.value;o._currentInput="text";o._textInitialized=!0;o._commitText();o.onTextChanged()}o._updateState();l.valueChanged.addHandler((function(e,t){o._refreshText();o.onValueChanged(t)}));l.rangeEndChanged.addHandler((function(e,t){if(l._rngMode()){o.onRangeEndChanged(t);o._closeOnChange();l._clearingRangeEnd||o._refreshText()}}));l.cancelButtonClicked.addHandler((function(e,t){o.isDroppedDown=!1}));l.OKButtonClicked.addHandler((function(e,t){o._closeOnChange();o._refreshText()}));l._enterKeyDownToSetValue.addHandler((function(e,t){o._closeOnChange()}));l.addEventListener(l.hostElement,"click",(function(e){if(l.selectionMode&&!l._rngMode()){var t=e.target,i=l.hitTest(t);if(wijmo_1.DateTime.sameDate(o.value,i)||wijmo_1.closest(t,"[wj-part=btn-today]")){o._closeOnChange();o._refreshText()}}}));o._updateInputAriaLabel();return o}Object.defineProperty(InputDate,"controlTemplate",{get:function(){InputDate._ctrlTemplate||(InputDate._ctrlTemplate=DropDown.controlTemplate);return InputDate._ctrlTemplate},set:function(e){InputDate._ctrlTemplate=e},enumerable:!0,configurable:!0});InputDate.prototype._mouseWheel=function(e){if(this.handleWheel&&!e.defaultPrevented&&!this.isDroppedDown&&this.containsFocus()&&null!=this.value&&this._canChangeValue()){var t=this._tbx,i=t.selectionStart,o=t.selectionEnd,n=wijmo_1.clamp(-e.deltaY,-1,1),s=this.value,r=wijmo_1.Globalize.getFullFormat(this.format||wijmo_1.Globalize.DefaultDateFormat);null==r&&(r=this.format);var a=r.match(wijmo_1.getSpecialCharsRegex());if(o-i===t.value.length&&null!=a||this.selectionMode==DateSelectionMode.Range){for(var l=1;;l++){s=this.selectionMode==DateSelectionMode.Month?wijmo_1.DateTime.addMonths(this.value,l*n):wijmo_1.DateTime.addDays(this.value,l*n);if(this._isValidDate(s)||!(null===this.max||s<this.max)||!(null===this.min||s>this.min))break}this.value=s;var h=this._getText();wijmo_1.setSelectionRange(t,0,h.length)}else this._updateDateTimeValue(n,a,r);e.preventDefault()}};Object.defineProperty(InputDate.prototype,"value",{get:function(){return this._cal.value},set:function(e){this._cal.value=e;(this.text||this.isRequired)&&this._refreshText()},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"rangeEnd",{get:function(){return this._cal.rangeEnd},set:function(e){this._cal.rangeEnd=e;(this.text||this.isRequired)&&this._refreshText()},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"rangeMin",{get:function(){return this._cal.rangeMin},set:function(e){this._cal.rangeMin=e},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"rangeMax",{get:function(){return this._cal.rangeMax},set:function(e){this._cal.rangeMax=e},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"keepInvalidText",{get:function(){return this._keepInvalidText},set:function(e){if(new Set(["InputDateTime","WjInputDateTime"]).has(this.constructor.name)){this._keepInvalidText=!1;throw"keepInvalidText property cannot be used with InputDateTime control"}this._keepInvalidText=e},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"text",{get:function(){return this._tbx.value},set:function(e){var t=(e||"").toString();if(t!=this.text){t!=this._tbx.value&&(this._tbx.value=t);if(t!=this._oldText){this._oldText=t;this._previousText=t}if(wijmo_1.isEmpty(this._currentInput)){this._textInitialized=!0;this._currentInput="text";this._commitText()}this.onTextChanged();this._currentInput=""}},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"format",{get:function(){return this._fmt},set:function(e){if(e!=this.format){this._fmt=wijmo_1.asString(e);this._refreshText()}},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"separator",{get:function(){return this._sep},set:function(e){if(e!=this._sep){this._sep=wijmo_1.asString(e,!1);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"mask",{get:function(){return this._msk.mask},set:function(e){this._msk.mask=wijmo_1.asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"closeOnSelection",{get:function(){return this._clsOnSel},set:function(e){this._clsOnSel=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"handleWheel",{get:function(){return this._handleWheel},set:function(e){e=wijmo_1.asBoolean(e);this._handleWheel=e;e||(this.calendar.handleWheel=e)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"predefinedRanges",{get:function(){return this._rngs},set:function(e){if(this._rngs!=e){wijmo_1.assert(null==e||wijmo_1.isObject(e),"Object expected");this._rngs=e;this._lbx.itemsSource=this._getRanges(e);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"alwaysShowCalendar",{get:function(){return this._showCal},set:function(e){this._showCal=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"min",{get:function(){return this._cal.min},set:function(e){this._cal.min=wijmo_1.asDate(e,!0)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"max",{get:function(){return this._cal.max},set:function(e){this._cal.max=wijmo_1.asDate(e,!0)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"repeatButtons",{get:function(){return this._cal.repeatButtons},set:function(e){this._cal.repeatButtons=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"showYearPicker",{get:function(){return this._cal.showYearPicker},set:function(e){this._cal.showYearPicker=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"showMonthPicker",{get:function(){return this._cal.showMonthPicker},set:function(e){this._cal.showMonthPicker=e},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"showHeader",{get:function(){return this._cal.showHeader},set:function(e){this._cal.showHeader=e},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"weeksBefore",{get:function(){return this._cal.weeksBefore},set:function(e){this._cal.weeksBefore=e},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"weeksAfter",{get:function(){return this._cal.weeksAfter},set:function(e){this._cal.weeksAfter=e},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"selectionMode",{get:function(){return this._cal.selectionMode},set:function(e){if(e!=this.selectionMode){this._cal.selectionMode=e;this._refreshText()}},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"monthCount",{get:function(){return this._cal.monthCount},set:function(e){this._cal.monthCount=e},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"calendar",{get:function(){return this._cal},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"inputElement",{get:function(){return this._tbx},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"inputType",{get:function(){return this._tbx.type},set:function(e){e.match(/^(tel|text|)$/i)?this._tbx.type=wijmo_1.asString(e):console.warn("invalid input type '"+e+"', don't use any input types other than 'tel' or 'text'")},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"preserveCalendarNavigation",{get:function(){return this._preserveCalendarNavigation},set:function(e){this._preserveCalendarNavigation=e},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"itemValidator",{get:function(){return this._cal.itemValidator},set:function(e){if(e!=this.itemValidator){this._cal.itemValidator=wijmo_1.asFunction(e);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"itemFormatter",{get:function(){return this._cal.itemFormatter},set:function(e){this._cal.itemFormatter=wijmo_1.asFunction(e)},enumerable:!0,configurable:!0});InputDate.prototype.onValueChanged=function(e){this.valueChanged.raise(this,e)};InputDate.prototype.onRangeEndChanged=function(e){this.rangeEndChanged.raise(this,e);this.rangeEnd&&(this.isDroppedDown?this._rangeChanged=!0:this.onRangeChanged(e))};InputDate.prototype.onRangeChanged=function(e){this._rangeChanged=!1;this.rangeChanged.raise(this,e)};InputDate.prototype._getParsedValue=function(){var e=this._tbx.value,t=this._fmt,i=(0,wijmo_1.Globalize.parseDate)(e,t,this.value);if(i&&wijmo_1.DateTime.sameDate(i,this._clamp(i)))return this._fromDateTime(i)};InputDate.prototype.refresh=function(t){void 0===t&&(t=!0);e.prototype.refresh.call(this,t);if(this.hostElement){this._msk&&this._msk.refresh();this._cal&&this._cal.refresh();this._refreshText()}};InputDate.prototype.onIsDroppedDownChanging=function(t){if(this.isDroppedDown);else{var i=this._lbx,o=this._cal,n=i.collectionView,s=i.hostElement.style,r=o.hostElement.style;if(o._rngMode()&&wijmo_1.hasItems(n)){var a=this._updateRangeSelection();s.display="";r.display=!this._showCal&&a&&a.from&&n.items.some((function(e){return!e.to}))?"none":""}else{s.display="none";r.display=""}o._mthMode()||(o.monthView=!0);o.value&&!this.preserveCalendarNavigation&&(o.displayMonth=o.value);this.showConfirmationButtons&&(o.focusValue=o.value)}return e.prototype.onIsDroppedDownChanging.call(this,t)};InputDate.prototype.onIsDroppedDownChanged=function(t){e.prototype.onIsDroppedDownChanged.call(this,t);var i=this.containsFocus();if(this.isDroppedDown){i&&(this._tryFocus(this._cal)||this._tryFocus(this._lbx)||this.dropDown.focus());this._lbx.showSelection();this._cal.refresh()}else{this._commitText();this._rangeChanged&&this.onRangeChanged()}};InputDate.prototype._updateDropDown=function(){this._commitText();var t=getComputedStyle(this.hostElement);this._dropDown.style.minWidth=18*parseFloat(t.fontSize)+"px";this._cal.refresh();e.prototype._updateDropDown.call(this)};InputDate.prototype.onGotFocus=function(e){var t=this._tbx;this._elRef==t&&(this.isDroppedDown?this.dropDown.focus():this.selectAll());this.containsFocus()||this.focus();this.gotFocus.raise(this,e)};InputDate.prototype._keydown=function(t){if(!(t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey)){this._isInvalidInputCancelled=!1;if(this._isHiddenEditor())return;var i=wijmo_1.getActiveElement();switch(t.keyCode){case wijmo_1.Key.Enter:if(this.showConfirmationButtons&&i!==this._tbx)return;this._currentInput="user";this._textInitialized=!1;this._commitText(!1,!0);break;case wijmo_1.Key.Escape:this.text=this._getText();this.selectAll();break;case wijmo_1.Key.Tab:if(this.showConfirmationButtons&&i!==this._tbx){var o=wijmo_1._getFocusableElements(this._dropDown).filter((function(e){return!(e.classList.contains("wj-control")&&e.classList.contains("wj-calendar"))})),n=o[0],s=o[o.length-1],r=o.indexOf(t.target),a=o[t.shiftKey?(r-1+o.length)%o.length:(r+1)%o.length],l=!1;a&&(l=this.calendar.isCalendarDateCell(a));if(l){t.preventDefault();this.calendar.focus();this.calendar.setFocusValueToFirstOrLastCalendar(!t.shiftKey)}else if(t.shiftKey){if(i===n){t.preventDefault();s.focus()}}else if(i===s){t.preventDefault();n.focus()}}else if(this.isDroppedDown){this.isDroppedDown=!1;this.containsFocus()||this.focus();this.keyActionTab===TabKeyAction.CloseAndKeepFocus&&t.preventDefault()}this._currentInput="user";this._textInitialized=!1;this._commitText(!0);break;case wijmo_1.Key.Up:case wijmo_1.Key.Down:if(t.keyCode===wijmo_1.Key.Up&&this.keyActionUpArrow===KeyAction.OpenDropdown||t.keyCode===wijmo_1.Key.Down&&this.keyActionDownArrow===KeyAction.OpenDropdown)break;if(!this.isDroppedDown&&this.value&&this._canChangeValue()){this._currentInput="user";this._textInitialized=!1;var h=this._tbx,u=h.selectionStart,c=h.selectionEnd,p=(h.value,t.keyCode==wijmo_1.Key.Up?1:-1),d=this.value,_=wijmo_1.Globalize.getFullFormat(this.format||wijmo_1.Globalize.DefaultDateFormat);if("g"==this.format&&_.includes("г")){_=_.replace(/"г." /,"")}null==_&&(_=this.format);var m=_.match(wijmo_1.getSpecialCharsRegex());if(c-u===h.value.length&&null!=m||this.selectionMode==DateSelectionMode.Range){for(var f=1;;f++){d=this.selectionMode==DateSelectionMode.Month?wijmo_1.DateTime.addMonths(this.value,f*p):wijmo_1.DateTime.addDays(this.value,f*p);if(this._isValidDate(d)||!(null===this.max||d<this.max)||!(null===this.min||d>this.min))break}this.value=d;var b=this._getText();wijmo_1.setSelectionRange(h,0,b.length)}else this._updateDateTimeValue(p,m,_);t.preventDefault()}}}e.prototype._keydown.call(this,t)};InputDate.prototype._expandSelection=function(){if(this._cal._rngMode()){var t=this._tbx,i=t.value,o=t.selectionStart,n=t.selectionEnd,s=this._sep,r=i.indexOf(s);r>-1&&o==n&&(n<=r?wijmo_1.setSelectionRange(t,0,r):o>=r+s.length&&wijmo_1.setSelectionRange(t,r+s.length,t.value.length))}else e.prototype._expandSelection.call(this)};InputDate.prototype._updateDateTimeValue=function(e,t,i){var o=this._tbx,n=o.selectionStart,s=o.value,r=this.value,a={},l={},h=0,u=0,c=0,p=[],d=[],_=o.value.match(wijmo_1.getSpecialCharsRegex());if(null==t||null==_){p=[this.format];d=["0"];t=[""]}else{t.forEach((function(e,o){var n=e.replaceAll('"',""),r=i.substring(h),c=s.substring(u),p=r.indexOf(e),d=c.indexOf(n);if(-1==d){var m=_[o];d=c.indexOf(m)}var f=r.substring(0,p);if(""!=f){a[f]=h;l[f]=u}h=h+p+e.length;u=u+d+n.length;if(o==t.length-1){f=i.substring(h);a[f]=h;l[f]=u}}));p=Object.keys(a);d=Object.values(l)}var m=d.filter((function(e){return n>=parseInt(e.toString())}));m.length>0&&(c=m.length-1);for(var f=p[c],b=1;;b++){-1!=f.indexOf("d")?r=wijmo_1.DateTime.addDays(this.value,b*e):-1!=f.indexOf("M")?r=wijmo_1.DateTime.addMonths(this.value,b*e):-1!=f.indexOf("y")&&(r=wijmo_1.DateTime.addYears(this.value,b*e));if(this._isValidDate(r)||!(null===this.max||r<this.max)||!(null===this.min||r>this.min))break}this.value=r;this._reselectText(t,c)};InputDate.prototype._reselectText=function(e,t){var i=this._getText(),o=this._tbx,n=0,s=-1,r=-1;if(1==e.length&&""==e[0]){s=0;r=i.length}else{var a=o.value.match(wijmo_1.getSpecialCharsRegex());e.forEach((function(e,o){var l=e.replaceAll('"',""),h=i.substring(n);if(h.startsWith("г.")){h=h.replace("г. ","");n+="г. ".length}var u=h.indexOf(l);0==u&&t++;if(-1==u){var c=a[o];u=h.indexOf(c)}var p=-1===u?h:h.substring(0,u);o==t&&-1==s&&(r=(s=n)+p.length);n=n+u+l.length}))}if(-1==s){s=n;r=o.value.length}wijmo_1.setSelectionRange(o,s,r)};InputDate.prototype._refreshText=function(){var e=this._getText();if(e!=this.text||e!==this._oldText){this._tbx.value=this._oldText=this._previousText=e;this.onTextChanged()}};InputDate.prototype._selectAll=function(){this.isDroppedDown||!this.containsFocus()||this.isTouching||this.selectAll()};InputDate.prototype._closeOnChange=function(){var e=this;if(this._clsOnSel&&this._isTriggered){var t=this._cal;(!t._rngMode()||t.value&&t.rangeEnd)&&setTimeout((function(){e._isInvalidInputCancelled=!1;e.isDroppedDown=!1}))}};InputDate.prototype._tryFocus=function(e){var t=e.hostElement;if(t&&t.offsetHeight){t.focus();return!0}return!1};InputDate.prototype._clamp=function(e){return this._cal._clamp(e)};InputDate.prototype._getText=function(){var e=wijmo_1.Globalize.format,t=this._fmt,i=e(this.value,t);this._cal._rngMode()&&i&&(this.rightToLeft?i=e(this.rangeEnd,t)+this._sep+i:i+=this._sep+e(this.rangeEnd,t));return i};InputDate.prototype._commitText=function(e,t){var i=this._tbx.value;this._isInvalidInputCancelled=!1;if(wijmo_1.isEmpty(this._currentInput)){this._textInitialized=!1;this._currentInput="user"}var o=!1,n=this._fmt,s=this._cal,r=wijmo_1.Globalize.parseDate,a=new InputDateEventArgs(!this._textInitialized);if(i)if(s._rngMode()){var l=i.split(this._sep),h=this.rightToLeft?l[1]:l[0];if(2==l.length&&h){if(c=r(h,n,this.value)){var u=r(this.rightToLeft?l[0]:l[1],n,this.value);if(wijmo_1.DateTime.sameDate(c,this._clamp(c)))o=!0;else if(this._shouldRaiseInvalidInput(t)&&this.onInvalidInput(a))this._textInitialized&&this._keepInvalidText||(o=!0);else{this._selectAll();o=!1}if(o)if(u){s.value=this._fromDateTime(c);if(wijmo_1.DateTime.sameDate(u,this._clamp(u))){s.rangeEnd=u&&u>=c?this._fromDateTime(u):c;this.text=this._getText()}else this._triggerInvalidInputEvent(a,c,u,t)}else if(this._shouldRaiseInvalidInput(t)&&this.onInvalidInput(a)){if(!this._textInitialized||!this._keepInvalidText){s.value=this._fromDateTime(c);s.rangeEnd=c;this.text=this._getText()}}else{this._isInvalidInputCancelled=!0;this._selectAll()}}else this._nullValueInvalidInput(a,t)}else this._nullValueInvalidInput(a,t)}else{(c=r(i,n,this.value))?wijmo_1.DateTime.sameDate(c,this._clamp(c))?this.value=this._fromDateTime(c):this._triggerInvalidInputEvent(a,c,null,t):this._nullValueInvalidInput(a,t)}else if(this.isRequired){var c;(c=r(i,n,this.value))?this.value=this._fromDateTime(c):this.containsFocus()||(this.text=this._getText())}else this.value=this.rangeEnd=null;this._currentInput="";e||this._selectAll()};InputDate.prototype._triggerInvalidInputEvent=function(e,t,i,o){if(this._shouldRaiseInvalidInput(o)&&this.onInvalidInput(e)){if(!this._textInitialized||!this._keepInvalidText){this.value=this._fromDateTime(t);this.calendar._rngMode()&&(this.calendar.rangeEnd=i&&i>=t?this._fromDateTime(i):t)}}else{this.isDroppedDown||!this.containsFocus()||this.isTouching||this.focus();this._isInvalidInputCancelled=!0;this._selectAll()}};InputDate.prototype._nullValueInvalidInput=function(e,t){if(this._shouldRaiseInvalidInput(t)&&this.onInvalidInput(e))this._textInitialized&&this._keepInvalidText||(this.text=this._getText());else{this.isDroppedDown||!this.containsFocus()||this.isTouching||this.focus();this._isInvalidInputCancelled=!0;this._selectAll()}};InputDate.prototype._fromDateTime=function(e){return wijmo_1.DateTime.fromDateTime(e,this.value)};InputDate.prototype._canChangeValue=function(){return!this.isReadOnly&&!this.isDisabled&&this.selectionMode!=DateSelectionMode.None};InputDate.prototype._isValidDate=function(e){if(e){if(this._clamp(e)!=e)return!1;if(this.itemValidator&&!this.itemValidator(e))return!1}return!0};InputDate.prototype._getRanges=function(e){var t=[];if(wijmo_1.isObject(e))for(var i in e){var o=e[i];t.push({name:i,from:o?o[0]:null,to:o?o[1]:null})}return new wijmo_1.CollectionView(t,{currentItem:null})};InputDate.prototype._updateRangeSelection=function(){var e=this._lbx,t=-1;if(wijmo_1.hasItems(e.collectionView))for(var i=this._lbx.collectionView.items,o=wijmo_1.DateTime.sameDate,n=0;n<i.length;n++){var s=i[n];if(s.from){if(o(s.from,this.value)&&o(s.to,this.rangeEnd)){t=n;break}}else t=n}e.selectedIndex=t;return e.selectedItem};InputDate.prototype._copy=function(e,t){if("text"===e){var i=(t||"").toString();if(i!==this.text){this._tbx.value=i;this._textInitialized=!0}return!0}return!1};Object.defineProperty(InputDate.prototype,"showConfirmationButtons",{get:function(){return this._showConfirmationButtons},set:function(e){this._showConfirmationButtons=e;this._cal.focusMode=e;this._cal.showConfirmationButtons=e;this._cal.updateConfirmationButtons(this.dropDown);var t=wijmo_1.isNullOrUndefined(this.tabOrder)?0:this.tabOrder;this._cal.tabOrder=e?t:-1;this._cal.keyActionTab=e?CalendarTabKeyAction.All:CalendarTabKeyAction.None},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"ariaLabelledBy",{get:function(){return this._ariaLabelledby},set:function(e){wijmo_1._setAriaLabelBy(this,this._tbx,e,this._updateInputAriaLabel.bind(this))},enumerable:!0,configurable:!0});InputDate.prototype._updateInputAriaLabel=function(){this._tbx&&(this._tbx.id||this.ariaLabelledBy?wijmo_1.setAriaLabel(this._tbx,null):wijmo_1.setAriaLabel(this._tbx,this._inputAriaLabel))};InputDate.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.InputDate.ariaLabels.inputDate};InputDate._ctrlTemplate="";return InputDate}(DropDown);exports.InputDate=InputDate;wijmo_1._addCultureInfo("InputDateRange",{ariaLabels:{inputDateRangeInput:"InputDateRange Input"}});var InputDateRange=function(e){__extends(InputDateRange,e);function InputDateRange(t,i){var o=e.call(this,t,__assign({selectionMode:DateSelectionMode.Range,showMonthPicker:"Outside",monthCount:2},getInputDateOptions(i)))||this;o._inputAriaLabel=wijmo_1.culture.InputDateRange.ariaLabels.inputDateRangeInput;wijmo_1.addClass(o.hostElement,exports.InputDateRangeClsNames.hostElement);o._tbx.value=o._oldText=o._getText();o.initialize(i);if(o._tbx.value!==o._oldText){o._oldText=o._tbx.value;o._currentInput="text";o._commitText()}o._updateInputAriaLabel();return o}Object.defineProperty(InputDateRange,"controlTemplate",{get:function(){InputDateRange._ctrlTemplate||(InputDateRange._ctrlTemplate=InputDate.controlTemplate);return InputDateRange._ctrlTemplate},set:function(e){InputDateRange._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(InputDateRange.prototype,"selectionMode",{get:function(){return this.calendar.selectionMode},set:function(e){e=wijmo_1.asEnum(e,DateSelectionMode);wijmo_1.assert(e==DateSelectionMode.Range,'InputDateRange.selectionMode must be "Range"');this.calendar.selectionMode=e},enumerable:!0,configurable:!0});InputDateRange.prototype._mouseWheel=function(e){if(!e.defaultPrevented&&!this.isDroppedDown&&this.containsFocus()&&null!=this.value&&this._canChangeValue()){var t=wijmo_1.clamp(-e.deltaY,-1,1),i=this.value;this.value=this.selectionMode==DateSelectionMode.Month?wijmo_1.DateTime.addMonths(i,t):wijmo_1.DateTime.addDays(i,t);this.selectAll();e.preventDefault()}};InputDateRange.prototype.onGotFocus=function(e){var t=this._tbx;this._elRef!=t||this.isDroppedDown||this.selectAll();this.containsFocus()||this.focus();this.gotFocus.raise(this,e)};InputDateRange.prototype._keydown=function(t){if(!(t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey)){this._isInvalidInputCancelled=!1;if(this._isHiddenEditor())return;switch(t.keyCode){case wijmo_1.Key.Up:case wijmo_1.Key.Down:if(t.keyCode===wijmo_1.Key.Up&&this.keyActionUpArrow===KeyAction.OpenDropdown||t.keyCode===wijmo_1.Key.Down&&this.keyActionDownArrow===KeyAction.OpenDropdown)break;if(!this.isDroppedDown&&this.value&&this._canChangeValue()){var i=t.keyCode==wijmo_1.Key.Up?1:-1,o=this.selectionMode==DateSelectionMode.Month?wijmo_1.DateTime.addMonths(this.value,i):wijmo_1.DateTime.addDays(this.value,i);this.value=this._fromDateTime(o);this.selectAll();t.preventDefault()}}}e.prototype._keydown.call(this,t)};InputDateRange._ctrlTemplate="";return InputDateRange}(InputDate);exports.InputDateRange=InputDateRange;function getInputDateOptions(e){var t={};if(!wijmo_1.isNullOrUndefined(e)){wijmo_1.isNullOrUndefined(e.showConfirmationButtons)||(t.showConfirmationButtons=e.showConfirmationButtons);wijmo_1.isNullOrUndefined(e.tabOrder)||(t.tabOrder=e.tabOrder)}return t}wijmo_1._addCultureInfo("InputColor",{ariaLabels:{inputColor:"Input Color",inputColorInput:"InputColor Input",button:"Choose Color",dialog:"ColorPicker"}});var InputColor=function(e){__extends(InputColor,e);function InputColor(t,i){var o=e.call(this,t)||this;o._textInitialized=!1;o._ariaLabelledby=null;o._inputAriaLabel=wijmo_1.culture.InputColor.ariaLabels.inputColorInput;o.valueChanged=new wijmo_1.Event;wijmo_1.addClass(o.hostElement,exports.InputColorClsNames.hostElement);wijmo_1.setAttribute(o._dropDown,"role","dialog");wijmo_1.setAriaLabel(o._dropDown,wijmo_1.culture.InputColor.ariaLabels.dialog);wijmo_1.setAttribute(o._dropDown,"aria-modal",!0);wijmo_1.setAttribute(o._tbx,"role","combobox");wijmo_1.setAttribute(o._tbx,"aria-haspopup","dialog");wijmo_1.setAttribute(o._btn.querySelector("button"),"aria-haspopup","dialog");wijmo_1.setAriaLabel(o._btn.querySelector("button"),wijmo_1.culture.InputColor.ariaLabels.button);o.dropDown.id=wijmo_1.getUniqueId(o.hostElement.id+"_dropdown");var n='<div class="'+exports.InputColorClsNames.inputColorBox+'"></div>';o._ePreview=wijmo_1.createElement(n,o.hostElement.firstElementChild);if("INPUT"==o._orgTag){o._tbx.type="";o._commitText()}o.value="#ffffff";o.isRequired=!0;o._tbx.value=o._oldText=o.value;o.initialize(i);if(o._textInitialized&&o._tbx.value!==o._oldText){o._oldText=o._tbx.value;o.onTextChanged();o._commitText();o._textInitialized=!1}o.addEventListener(o._colorPicker.hostElement,"click",(function(e){var t=e.target;if(t&&"DIV"==t.tagName&&(wijmo_1.closest(t,'[wj-part="div-pal"]')||wijmo_1.closest(t,'[wj-part="div-pv"]'))){t.style.backgroundColor&&(o.isDroppedDown=!1)}}));var s=!i||-1!==i.tabOrder&&i.colorPickerKeyActionTab!==ColorPickerTabKeyAction.None?0:-1;o._colorPicker.tabOrder=s;o._updateInputAriaLabel();return o}Object.defineProperty(InputColor,"controlTemplate",{get:function(){InputColor._ctrlTemplate||(InputColor._ctrlTemplate=DropDown.controlTemplate);return InputColor._ctrlTemplate},set:function(e){InputColor._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"value",{get:function(){return this._value},set:function(e){this.text=e},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"text",{get:function(){return this._tbx.value},set:function(e){if((e=wijmo_1.asString(e))!=this.text&&(e||!this.isRequired)&&(!e||wijmo_1.Color.fromString(e.replace(/\s+/g,"")))){this._setText(e,!0);this._commitText()}},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"inputType",{get:function(){return this._tbx.type},set:function(e){e.match(/^(tel|text|)$/i)?this._tbx.type=wijmo_1.asString(e):console.warn("invalid input type '"+e+"', don't use any input types other than 'tel' or 'text'")},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"showAlphaChannel",{get:function(){return this._colorPicker.showAlphaChannel},set:function(e){this._colorPicker.showAlphaChannel=e},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"showColorString",{get:function(){return this._colorPicker.showColorString},set:function(e){this._colorPicker.showColorString=e},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"palette",{get:function(){return this._colorPicker.palette},set:function(e){this._colorPicker.palette=e},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"colorPicker",{get:function(){return this._colorPicker},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"ariaLabelledBy",{get:function(){return this._ariaLabelledby},set:function(e){wijmo_1._setAriaLabelBy(this,this._tbx,e,this._updateInputAriaLabel.bind(this))},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"colorPickerKeyActionTab",{get:function(){return this.colorPicker.keyActionTab},set:function(e){this.colorPicker.keyActionTab=e},enumerable:!0,configurable:!0});InputColor.prototype.onValueChanged=function(e){this.valueChanged.raise(this,e)};InputColor.prototype.onIsDroppedDownChanged=function(t){e.prototype.onIsDroppedDownChanged.call(this,t);if(this.isDroppedDown&&!this.isTouching){this.colorPicker._refreshSelection();var i=this._tbx;this._elRef==i&&wijmo_1.setSelectionRange(i,0,this.text.length,!1);this.containsFocus()||this.focus()}};InputColor.prototype._createDropDown=function(){var e=this;this._colorPicker=new ColorPicker(this._dropDown);wijmo_1.setCss(this._dropDown,{minWidth:420,minHeight:200});this._colorPicker.valueChanged.addHandler((function(){e.value=e._colorPicker.value}))};InputColor.prototype._keydown=function(t){if(!t.defaultPrevented)switch(t.keyCode){case wijmo_1.Key.Enter:this._commitText();this.selectAll();break;case wijmo_1.Key.Escape:this.text=this.value;this.selectAll();break;case wijmo_1.Key.Tab:var i=wijmo_1.getActiveElement();if(this.colorPicker.keyActionTab===ColorPickerTabKeyAction.All&&i!==this._tbx){var o=wijmo_1._getFocusableElements(this.colorPicker.hostElement),n=o[0],s=o[o.length-1];if(t.shiftKey){if(i===n){t.preventDefault();s.focus()}}else if(i===s){t.preventDefault();n.focus()}}else if(this.isDroppedDown){this.isDroppedDown=!1;this.containsFocus()||this.focus();this.keyActionTab===TabKeyAction.CloseAndKeepFocus&&t.preventDefault()}}e.prototype._keydown.call(this,t)};InputColor.prototype._commitText=function(){if(this._value!=this.text){var e=!this.text||!this.text.trim();if(!this.isRequired&&e){this._changeAllValue();this._ePreview.style.backgroundColor="";return}if(wijmo_1.Color.fromString(this.text.replace(/\s+/g,""))){if(this.text&&this.text!==this.text.replace(/\s+/g,"")){this.text=this.text.replace(/\s+/g,"");return}this._changeAllValue()}else this.onInvalidInput(new wijmo_1.CancelEventArgs)&&(this.text=this._value?this._value:"")}};InputColor.prototype._changeAllValue=function(){var e=this._colorPicker;e.value=this.text;this._value=e.value;this._ePreview.style.backgroundColor=this.value;this.onValueChanged()};InputColor.prototype._copy=function(e,t){if("text"===e){var i=(t||"").toString();if(i!==this.text){this._tbx.value=i;this._textInitialized=!0}return!0}return!1};InputColor.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.InputColor.ariaLabels.inputColor};InputColor.prototype._updateInputAriaLabel=function(){this._tbx&&(this._tbx.id||this.ariaLabelledBy?wijmo_1.setAriaLabel(this._tbx,null):wijmo_1.setAriaLabel(this._tbx,this._inputAriaLabel))};InputColor._ctrlTemplate="";return InputColor}(DropDown);exports.InputColor=InputColor;wijmo_1._addCultureInfo("ComboBox",{ariaLabels:{comboBoxInput:"ComboBox Input",comboBox:"Combo Box"}});var ComboBox=function(e){__extends(ComboBox,e);function ComboBox(t,i){var o=e.call(this,t)||this;o._editable=!1;o._trimText=!0;o._handleWheel=!0;o._delKey=0;o._draggingText=!1;o._textIsComposing="";o._pathHdr=new wijmo_1.Binding(null);o._bsCollapse=!0;o._fmtItemHandlers=0;o._emptyValueAction=!1;o._oldIndexToBeRestoredOnBlur=null;o._restoreComboboxTbxVal=!1;o._isWheel=!1;o._selItems=null;o._oldFilter=null;o._keyActionPrintCharacters=KeyAction.OpenDropdown;o._inputElementAriaLabel=wijmo_1.culture.ComboBox.ariaLabels.comboBoxInput;o._ariaLabelledby=null;o.itemsSourceChanged=new wijmo_1.Event;o.selectedIndexChanged=new wijmo_1.Event;var n=o.hostElement;wijmo_1.addClass(n,exports.ComboBoxClsNames.hostElement);o.dropDown.id=wijmo_1.getUniqueId(n.id+"_dropdown");o.autoExpandSelection=!1;var s=o._tbx;o.addEventListener(s,"compositionstart",(function(){o._composing=!0}));o.addEventListener(s,"compositionend",(function(){o._textIsComposing=o.text;o._composing=!1;o._setText(o._textIsComposing,!0);if(!o._textIsComposing&&o.isRequired){o._oldText="";o._oldIndexToBeRestoredOnBlur=null}setTimeout((function(){o._textIsComposing=""}))}));o.addEventListener(s,"drag",(function(){o._draggingText=!0}));o.addEventListener(n,"wheel",o._wheel.bind(o));"SELECT"==o._orgTag&&o._lbx._initFromSelect(n);var r=o._lbx;r.loadedItems.addHandler((function(e){o.selectedIndex>-1&&(o.selectedIndex=r.selectedIndex)}));r.tabOrder=-1;o.isRequired=!0;o.initialize(i);o._updateTbxAriaHaspopup();o._updateInputAriaLabel();return o}Object.defineProperty(ComboBox,"controlTemplate",{get:function(){ComboBox._ctrlTemplate||(ComboBox._ctrlTemplate=DropDown.controlTemplate);return ComboBox._ctrlTemplate},set:function(e){ComboBox._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"itemsSource",{get:function(){return this._lbx.itemsSource},set:function(e){if(this._lbx.itemsSource!=e){this._lbx.itemsSource=e;this.onItemsSourceChanged()}this._updateBtn()},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"collectionView",{get:function(){return this._lbx.collectionView},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"virtualizationThreshold",{get:function(){return this._lbx.virtualizationThreshold},set:function(e){this._lbx.virtualizationThreshold=e},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"showGroups",{get:function(){return this._lbx.showGroups},set:function(e){this._lbx.showGroups=e},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"displayMemberPath",{get:function(){return this._lbx.displayMemberPath},set:function(e){if(this.displayMemberPath!==e){this._lbx.displayMemberPath=e;var t=this._getDisplayText(void 0,void 0,!0);this.text!=t&&this._setText(t,!0)}},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"headerPath",{get:function(){return this._pathHdr.path},set:function(e){this._pathHdr.path=wijmo_1.asString(e);var t=this._getDisplayText(void 0,void 0,!0);this.text!=t&&this._setText(t,!0)},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"selectedValuePath",{get:function(){return this._lbx.selectedValuePath},set:function(e){this._lbx.selectedValuePath=e},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"isContentHtml",{get:function(){return this._lbx.isContentHtml},set:function(e){if(e!=this.isContentHtml){this._lbx.isContentHtml=wijmo_1.asBoolean(e);var t=this._getDisplayText(void 0,void 0,!0);this.text!=t&&this._setText(t,!0)}},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"caseSensitiveSearch",{get:function(){return this._lbx.caseSensitiveSearch},set:function(e){this._lbx.caseSensitiveSearch=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"trimText",{get:function(){return this._trimText},set:function(e){if(e!=this._trimText){this._trimText=wijmo_1.asBoolean(e);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"itemFormatter",{get:function(){return this._lbx.itemFormatter},set:function(e){this._lbx.itemFormatter=wijmo_1.asFunction(e);this.selectedIndex=this._lbx.selectedIndex},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"formatItem",{get:function(){return this._lbx.formatItem},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"selectedIndex",{get:function(){return this._lbx.selectedIndex},set:function(e){e!=this.selectedIndex&&wijmo_1.isNumber(e)&&(this._lbx.selectedIndex=e);var t=this._lbx._oldSelectedIndex!=this.selectedIndex;e=this.selectedIndex;var i=this._getDisplayText(e,void 0,!0);if(this.text!=i||t){var o=this._internalSettingText;this._internalSettingText=this._lbx._ignoredItemChangedEvents;this._setText(i,!0);""!=this.text&&(this._emptyValueAction=!1);this._internalSettingText=o}},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"selectedItem",{get:function(){return this._lbx.selectedItem},set:function(e){this._lbx.selectedItem=e},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"selectedValue",{get:function(){return this.collectionView?this._lbx.selectedValue:this.text},set:function(e){this.collectionView?this._lbx.selectedValue=e:null!=e&&(this.text=e.toString())},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"isEditable",{get:function(){return this._editable},set:function(e){this._editable=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"handleWheel",{get:function(){return this._handleWheel},set:function(e){this._handleWheel=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"maxDropDownHeight",{get:function(){return this._lbx.maxHeight},set:function(e){this._lbx.maxHeight=e},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"maxDropDownWidth",{get:function(){var e=this._dropDown,t=e?parseInt(e.style.maxWidth):null;return isNaN(t)?null:t},set:function(e){var t=this._dropDown.style;e=wijmo_1.asNumber(e,!0);t.maxWidth=null==e?"":e+"px";t.minWidth=""},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"keyActionPrintCharacters",{get:function(){return this._keyActionPrintCharacters},set:function(e){this._keyActionPrintCharacters=wijmo_1.asEnum(e,KeyAction)},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"ariaLabelledBy",{get:function(){return this._ariaLabelledby},set:function(e){wijmo_1._setAriaLabelBy(this,this._tbx,e,this._updateInputAndListBoxAriaLabel.bind(this))},enumerable:!0,configurable:!0});ComboBox.prototype._updateInputAndListBoxAriaLabel=function(){this._updateInputAriaLabel()};ComboBox.prototype.getDisplayText=function(e,t){void 0===e&&(e=this.selectedIndex);void 0===t&&(t=this._trimText);return this._getDisplayText(e,t)};ComboBox.prototype._getDisplayText=function(e,t,i){void 0===e&&(e=this.selectedIndex);void 0===t&&(t=this._trimText);var o,n=this.collectionView;if(this.headerPath&&e>-1&&wijmo_1.hasItems(n)){var s=n.items[e];o=null!=(o=s?this._pathHdr.getValue(s):null)?o.toString():"";this.isContentHtml&&(o=wijmo_1.toPlainText(o))}else o=this._lbx._getDisplayText(e,i&&void 0!==this.itemFormatter&&!this._hasCustomFormatItem());return t?o.trim():o};ComboBox.prototype._hasCustomFormatItem=function(){return this.formatItem.hasHandlers};ComboBox.prototype.indexOf=function(e,t,i){void 0===i&&(i=!1);var o=this.collectionView,n=this.caseSensitiveSearch;if(wijmo_1.hasItems(o)&&null!=e){e=e.toString();n||(e=e.toLowerCase());if(this._trimText&&!i){-1!==this.indexOf(e,!1,!0)||(e=e.trim())}var s=this.selectedIndex,r=this._getDisplayText(s,void 0,!0);if(t){n||(r=r.toLowerCase());if(e==r)return s}else if(!e&&""==r)return s;for(var a=0;a<o.items.length;a++)if(this._lbx.isItemEnabled(a)){r=this._getDisplayText(a,void 0,!0);this.trimText&&(r=r.trim());n||(r=r.toLowerCase());if(t){if(r==e&&!1===this._emptyValueAction)return a}else if(e&&0==r.indexOf(e)||!e&&""==r&&!1===this._emptyValueAction)return a}}return-1};Object.defineProperty(ComboBox.prototype,"listBox",{get:function(){return this._lbx},enumerable:!0,configurable:!0});ComboBox.prototype.onItemsSourceChanged=function(e){this.itemsSourceChanged.raise(this,e)};ComboBox.prototype.onSelectedIndexChanged=function(e){this._updateBtn();this.selectedIndexChanged.raise(this,e)};ComboBox.prototype.refresh=function(t){void 0===t&&(t=!0);e.prototype.refresh.call(this,t);if(this.hostElement&&wijmo_1.hasItems(this.collectionView)){this._lbx.refresh();this.selectedIndex>-1&&(this.selectedIndex=this._lbx.selectedIndex)}};ComboBox.prototype.onLostFocus=function(t,i,o){this._trimText&&(this.text=this.text.trim());if(this._composing){this._composing=!1;if(!this.text&&this.isRequired){this._oldText="";this._oldIndexToBeRestoredOnBlur=null}this._setText(this.text,!0)}if((!this.text&&this.isRequired&&!(Array.isArray(this._selItems)&&this._selItems.length>0)||o)&&wijmo_1.hasItems(this.collectionView)&&!(this.isRequired&&!this.isEditable&&this.text&&this.indexOf(this.text,!1)>-1&&this.indexOf(this.text,!0)<0)){void 0!==i&&(this.selectedIndex=-1!==i?i:0);null!==this._oldIndexToBeRestoredOnBlur?this.selectedIndex=-1!==this._oldIndexToBeRestoredOnBlur?this._oldIndexToBeRestoredOnBlur:0:null==this.collectionView.currentItem&&(this.selectedIndex=0)}var n=this.text,s=this.collectionView?this.collectionView.items.length:0,r=this.selectedIndex;e.prototype.onLostFocus.call(this,t);var a=this.collectionView?this.collectionView.items.length:0,l=this.selectedIndex,h=this.text,u=this._oldFilter;this._oldFilter=null;if(r===l&&n===h){u&&(this.collectionView.filter=u);this._trySelectionUpdateOnItemsSourceChanged(a!==s,n)}};ComboBox.prototype.onIsDroppedDownChanging=function(t){if(!this.isDroppedDown&&!this._hasItems()){t.cancel=!0;return!1}return e.prototype.onIsDroppedDownChanging.call(this,t)};ComboBox.prototype.onIsDroppedDownChanged=function(t){e.prototype.onIsDroppedDownChanged.call(this,t);if(this.isDroppedDown){this._fmtItemHandlers=this.formatItem.handlerCount;this._lbx.showSelection()}this._updateTbxAria()};ComboBox.prototype._trySelectionUpdateOnItemsSourceChanged=function(e,t){if(e&&t){var i=this.indexOf(t,!0);i<0&&(i=this.indexOf(t,!1));this.selectedIndex=i}};ComboBox.prototype._setIsDisabled=function(t){e.prototype._setIsDisabled.call(this,t);this._updateBtn()};ComboBox.prototype._updateBtn=function(){var t=this.collectionView,i=this._tbx,o=this._hasItems();e.prototype._updateBtn.call(this);this._btn.style.display=this._showBtn&&null!=t?"":"none";wijmo_1.enable(this._btn,o&&!this.isDisabled);wijmo_1.setAttribute(i,"role",o?"combobox":null);wijmo_1.setAttribute(i,"aria-autocomplete",o?"both":null);this._updateTbxAria()};ComboBox.prototype._hasItems=function(){return wijmo_1.hasItems(this.collectionView)};ComboBox.prototype._updateTbxAria=function(){e.prototype._updateTbxAria.call(this);var t=this._tbx,i=this.isDroppedDown,o=this.dropDown?this.dropDown.id:null,n=o&&wijmo_1.hasItems(this.collectionView),s=this._lbx,r=s.selectedIndex,a=s.hostElement?s.hostElement.children:null,l=s._getElementIndex(r),h=l>-1&&a&&l<a.length?a[l].id:null;wijmo_1.setAttribute(t,"aria-controls",n&&i?o:null);wijmo_1.setAttribute(t,"aria-expanded",n?i:null);wijmo_1.setAttribute(t,"aria-activedescendant",this.isDroppedDown&&h&&h.length?h:null)};ComboBox.prototype._updateInputAriaLabel=function(){var e=this._tbx;e&&(e.id||this._ariaLabelledby?wijmo_1.setAttribute(e,"aria-label",null):wijmo_1.setAttribute(e,"aria-label",this._inputElementAriaLabel))};ComboBox.prototype._createDropDown=function(){var e=this;if(!this._lbx){this._lbx=new ListBox(this._dropDown);this._lbx._container=this.hostElement}this._lbx.maxHeight=200;this._lbx.selectedIndexChanged.addHandler((function(){e._updateBtn();var t=e._lbx.selectedIndex;e.selectedIndex=t;e.onSelectedIndexChanged()}));this._lbx.itemsChanged.addHandler((function(){e._updateBtn()}))};ComboBox.prototype._wheel=function(e){this._isWheel=!0;if(this.handleWheel&&!e.defaultPrevented&&!this.isDroppedDown&&!this.isReadOnly&&this.containsFocus()&&this.selectedIndex>-1){var t=this._findNext("",e.deltaY>0?1:-1);t>-1&&(this.selectedIndex=t);e.preventDefault()}this._isWheel=!1};ComboBox.prototype._dropDownClick=function(t){t.defaultPrevented||t.target!=this._dropDown&&(this.isDroppedDown=!1);this._restoreComboboxTbxVal&&(this._tbx.value=this._getDisplayText(this.selectedIndex,void 0,!0));e.prototype._dropDownClick.call(this,t)};ComboBox.prototype._setText=function(t,i,o){void 0===o&&(o=!1);if(!this._composing&&!this._settingText){this._settingText=!0;if(this.containsFocus()){var n=this.formatItem.handlerCount;if(this._fmtItemHandlers!=n){this._fmtItemHandlers=n;this._lbx.loadList()}}t=[null,void 0,NaN].includes(t)?"":t.toString();var s=this.selectedIndex,r=this.collectionView,a=this._getSelStart(),l=-1,h=!0;if(this.isEditable&&(this._delKey||this._getSelEnd()<t.length||!this.containsFocus())){i=!0;h=!1}s=this.indexOf(t,i);if(h){s<0&&i&&(s=this.indexOf(t,!1));s<0&&a>0&&!o&&(s=this.indexOf(t.substr(0,a),!1));if(!i){var u=this.indexOf(t,!0);u>-1&&s>-1&&u!=s&&(s=u)}}s<0&&this._delKey&&(s=this.indexOf(t,i));if(s<0&&!this.isEditable&&wijmo_1.hasItems(r)&&(t&&this.isRequired||this.containsFocus()&&(t||this.isRequired))){var c=this._oldText||"";s=Math.max(0,this.indexOf(c,!1));a=0;for(var p=0;p<t.length&&p<c.length;p++)if(t[p]!=c[p]){a=p;break}}if((!this._delKey||!this.isEditable||this._delKey&&this.isEditable&&t==this._getDisplayText(s,void 0,!0))&&(!this._pristine||this._pristine&&!this.isEditable)||this._isWheel||this._delKey&&""==t&&s>-1){if(s>-1){l=a;t=this._getDisplayText(s,void 0,!0)}var d=this._tbx;t!=d.value&&(d.value=t);l>-1&&this.containsFocus()&&!this.isTouching&&this._updateInputSelection(l)}if(r){if(!t||this.trimText&&""==t.trim()&&!this.containsFocus()&&this.isEditable)if(s>-1)this._oldIndexToBeRestoredOnBlur=s;else{this._oldIndexToBeRestoredOnBlur=this.indexOf(this._oldText,!0);this._oldIndexToBeRestoredOnBlur=this._oldIndexToBeRestoredOnBlur<0?this.indexOf(this._oldText,!1):this._oldIndexToBeRestoredOnBlur}this._restoreComboboxTbxVal=t&&s>-1;r.moveCurrentToPosition(s)}this.containsFocus()||this.isEditable||this.isRequired||t!=t.trim()||!this.trimText||(this._tbx.value=this._getDisplayText(s,this.trimText,!0));!this.containsFocus()&&s>-1&&this.isEditable&&(t=this._getDisplayText(s,this.trimText,!0));!this.containsFocus()&&this._hasItems()&&s<0&&!this.isEditable&&!this.isRequired&&(t="");var _=!1;!t&&s<0&&this.isRequired&&!this.containsFocus()&&(_=!0);this.trimText&&!this.containsFocus()&&this.isEditable&&(this.isRequired&&""==t.trim()?_=!0:t=t.trim());if(_){this.selectedIndex=this._oldIndexToBeRestoredOnBlur;this.selectedIndex<0&&(this.selectedIndex=0)}var m=!this.containsFocus()&&!this.isEditable&&this.trimText;m&&(this._tbx.value=this._getDisplayText(s,!0,!0));this._delKey=0;this._settingText=!1;e.prototype._setText.call(this,_?this._getDisplayText(this.selectedIndex,void 0,!0):t,i,_,m)}};ComboBox.prototype._findNext=function(e,t,i){void 0===i&&(i=this.selectedIndex);var o=this.collectionView,n=o?o.items.length:0,s=this._lbx,r=this.caseSensitiveSearch;if(o&&n&&t){r||(e=e.toLowerCase());this.trimText&&(e=e.trim());for(var a=i+t;a>-1&&a<n;a+=t){var l=this._getDisplayText(a,void 0,!0);r||(l=l.toLowerCase());if(0==l.indexOf(e)){if(!this.dropDown.children[a]||s.isItemEnabled(a))return a}}}return i};ComboBox.prototype._findNextWhenIsEditableFalse=function(e,t,i){void 0===i&&(i=this.selectedIndex);var o=this._findNext(e,t,i);return o!==i?o:-1};ComboBox.prototype._keydown=function(t){e.prototype._keydown.call(this,t);if(!t.defaultPrevented&&!this.isReadOnly&&!t.altKey&&wijmo_1.hasItems(this.collectionView)&&this._elRef==this._tbx&&!this._isHiddenEditor()){this._delKey=0;var i=this._getSelStart(),o=this._getSelEnd();switch(t.keyCode){case wijmo_1.Key.Tab:if(this.isDroppedDown){this.isDroppedDown=!1;this.keyActionTab===TabKeyAction.CloseAndKeepFocus&&t.preventDefault()}break;case wijmo_1.Key.Back:case wijmo_1.Key.Delete:case 88:if(!t.ctrlKey&&!t.metaKey&&88==t.keyCode)break;if(this._bsCollapse&&!this.isEditable&&i>0&&o==this._tbx.value.length&&wijmo_1.hasItems(this.collectionView)){this._setSelRange(i-1,o);i-=1}this._delKey=t.keyCode;break;case wijmo_1.Key.Up:case wijmo_1.Key.Down:i==this.text.length&&(i=0);this.selectedIndex=this._findNext(this.text.substr(0,i),t.keyCode==wijmo_1.Key.Up?-1:1);this._setSelRange(i,this.text.length);t.preventDefault();break;case wijmo_1.Key.PageUp:this._lbx._selectPrevPage();this.selectAll();t.preventDefault();break;case wijmo_1.Key.PageDown:this._lbx._selectNextPage();this.selectAll();t.preventDefault();break;case wijmo_1.Key.Home:case wijmo_1.Key.End:var n=this._tbx;wijmo_1.setAttribute(n,"aria-activedescendant",null)}this.text.length>0&&["Backspace","Delete","x"].includes(t.key)&&0===i&&o===this.text.length||this._delKey&&1===this.text.length?this._emptyValueAction=!0:this._composing||(this._emptyValueAction=!1)}};ComboBox.prototype._afterOpenDropdownByDownArrow=function(){if(-1===this.selectedIndex){this.selectedIndex=0;this.selectAll()}};ComboBox.prototype._input=function(e){this._handleDragTextState();this._updateDropDownWhenInput();this._updateComponentText();this._updateEmptyValueFlag();this._resetDragState()};ComboBox.prototype._handleDragTextState=function(){this._draggingText&&(this._emptyValueAction=""===this.text)};ComboBox.prototype._shouldOpenDropdown=function(){return this.keyActionPrintCharacters===KeyAction.OpenDropdown};ComboBox.prototype._handleIsEditableFalseInput=function(){var e=this.text,t=this.text.length,i=this._findNextWhenIsEditableFalse(e,1,this.selectedIndex-1);if(-1===i&&-1===(i=this._findNextWhenIsEditableFalse(e,1,-1))){var o=e[e.length-1];t=1;-1===(i=this._findNextWhenIsEditableFalse(o,1))&&(i=this._findNextWhenIsEditableFalse(o,1,-1))}-1!==i?this._updateSelection(i,t):this._updateComponentText()};ComboBox.prototype._updateSelection=function(e,t){this._tbx.value=this._getDisplayText(e,void 0,!0);this._updateInputSelection(t);var i=this.collectionView;i&&i.moveCurrentToPosition(e)};ComboBox.prototype._updateComponentText=function(){var e=this._textIsComposing||this.text;this._setText(e,!1)};ComboBox.prototype._updateEmptyValueFlag=function(){this.text&&(this._emptyValueAction=!1)};ComboBox.prototype._controlDropdownVisibility=function(){this.text&&!this.isDroppedDown&&(this.isDroppedDown=!0)};ComboBox.prototype._resetDragState=function(){this._draggingText=!1};ComboBox.prototype._updateInputSelection=function(e){var t=this._tbx;this._elRef==t&&this._setSelRange(e,t.value.length)};ComboBox.prototype._getSelStart=function(){var e=this._tbx;return e&&e.value?e.selectionStart:0};ComboBox.prototype._getSelEnd=function(){var e=this._tbx;return e&&e.value?e.selectionEnd:0};ComboBox.prototype._setSelRange=function(e,t){var i=this._tbx;this._elRef!=i||i.readOnly||wijmo_1.setSelectionRange(i,e,t)};ComboBox.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.ComboBox.ariaLabels.comboBox};ComboBox.prototype._updateDropDownWhenInput=function(){if(this._shouldOpenDropdown()){var e=this._getSelStart(),t=this._getSelEnd(),i=this._delKey,o=this.text;this._controlDropdownVisibility();this._tbx.value=o;this._setSelRange(e,t);this._delKey=i}};ComboBox._ctrlTemplate="";return ComboBox}(DropDown);exports.ComboBox=ComboBox;wijmo_1._addCultureInfo("MultiSelect",{itemsSelected:"{count:n0} items selected",selectAll:"Select All",ariaLabels:{multiSelectInput:"MultiSelect Input",multiSelect:"Multi Select"}});var MultiSelect=function(e){__extends(MultiSelect,e);function MultiSelect(t,i){var o=e.call(this,t)||this;o._maxHdrItems=2;o._readOnly=!1;o._hdrFmt=null;o._inputElementAriaLabel=wijmo_1.culture.MultiSelect.ariaLabels.multiSelectInput;o.checkedItemsChanged=new wijmo_1.Event;wijmo_1.addClass(o.hostElement,exports.MultiSelectClsNames.hostElement);o._tbx.readOnly=!0;o.checkedMemberPath=null;o.removeEventListener(o.dropDown,"click");o._lbx.itemsChanged.addHandler((function(){o._updateHeader(!1)}));o._lbx.checkedItemsChanged.addHandler((function(){o._updateHeader(!1);o.onCheckedItemsChanged()}));o.clickAction=ClickAction.Toggle;o.initialize(i);o._updateInputAriaLabel();return o}Object.defineProperty(MultiSelect,"controlTemplate",{get:function(){MultiSelect._ctrlTemplate||(MultiSelect._ctrlTemplate=ComboBox.controlTemplate);return MultiSelect._ctrlTemplate},set:function(e){MultiSelect._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"showSelectAllCheckbox",{get:function(){return this._msLbx.showSelectAllCheckbox},set:function(e){this._msLbx.showSelectAllCheckbox=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"showFilterInput",{get:function(){return this._msLbx.showFilterInput},set:function(e){this._msLbx.showFilterInput=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"delay",{get:function(){return this._msLbx.delay},set:function(e){this._msLbx.delay=e},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"caseSensitiveSearch",{get:function(){return this._msLbx.caseSensitiveSearch},set:function(e){this._msLbx.caseSensitiveSearch=e},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"filterInputPlaceholder",{get:function(){return this._msLbx.filterInputPlaceholder},set:function(e){this._msLbx.filterInputPlaceholder=wijmo_1.asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"checkOnFilter",{get:function(){return this._msLbx.checkOnFilter},set:function(e){if(e!=this.checkOnFilter){this._msLbx.checkOnFilter=wijmo_1.asBoolean(e);this.checkedItems=[]}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"selectAllLabel",{get:function(){return this._msLbx.selectAllLabel},set:function(e){this._msLbx.selectAllLabel=wijmo_1.asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"checkedMemberPath",{get:function(){return this._msLbx.checkedMemberPath},set:function(e){this._msLbx.checkedMemberPath=wijmo_1.asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"maxHeaderItems",{get:function(){return this._maxHdrItems},set:function(e){if(this._maxHdrItems!=e){this._maxHdrItems=wijmo_1.asNumber(e);this._updateHeader()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"headerFormat",{get:function(){return this._hdrFmt},set:function(e){if(e!=this._hdrFmt){this._hdrFmt=wijmo_1.asString(e);this._updateHeader()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"headerFormatter",{get:function(){return this._hdrFormatter},set:function(e){if(e!=this._hdrFormatter){this._hdrFormatter=wijmo_1.asFunction(e);this._updateHeader()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"checkedItems",{get:function(){return this._msLbx.checkedItems},set:function(e){this._msLbx.checkedItems=null==e?[]:wijmo_1.asArray(e);this._updateHeader()},enumerable:!0,configurable:!0});MultiSelect.prototype.onCheckedItemsChanged=function(e){this.checkedItemsChanged.raise(this,e)};MultiSelect.prototype.dispose=function(){this._lbx.dispose();e.prototype.dispose.call(this)};MultiSelect.prototype.onIsDroppedDownChanged=function(t){var i=this;e.prototype.onIsDroppedDownChanged.call(this,t);setTimeout((function(){if(i.isDroppedDown&&i.containsFocus())if(i.showFilterInput&&!i.isTouching)i._msLbx._filter.focus();else{var e=i.listBox;if(e.selectedIndex<0){var t=0,o=e.checkedItems;o.length&&(t=e.collectionView.items.indexOf(o[0]));e.selectedIndex=Math.max(0,t)}e.showSelection(!0);e.focus()}}))};MultiSelect.prototype.onLostFocus=function(){this._msLbx.onLostFocus();this.isDroppedDown=!1;e.prototype.onLostFocus.call(this)};MultiSelect.prototype._createDropDown=function(){var t=this,i=wijmo_1.createElement("<div></div>",this._dropDown);this._msLbx=new MultiSelectListBox(i);this._lbx=this._msLbx.listBox;var o=this.hostElement;this._lbx.hostElement.id=wijmo_1.getUniqueId(o.id+"_listbox");this._lbx.itemsChanged.addHandler((function(){t.isDroppedDown&&t.refresh()}));e.prototype._createDropDown.call(this)};MultiSelect.prototype._updateBtnAria=function(){var e=this._btn.querySelector("button"),t=this.isDroppedDown,i=this._lbx?this._lbx.hostElement:null,o=i?i.id:null;wijmo_1.setAttribute(e,"aria-expanded",t);wijmo_1.setAttribute(e,"aria-controls",t?o:null)};MultiSelect.prototype._updateTbxAria=function(){var e=this._tbx,t=this.isDroppedDown,i=this._lbx?this._lbx.hostElement:null,o=i?i.id:null;wijmo_1.setAttribute(e,"aria-expanded",t);wijmo_1.setAttribute(e,"aria-controls",t?o:null)};Object.defineProperty(MultiSelect.prototype,"isReadOnly",{get:function(){return this._readOnly},set:function(e){this._readOnly=wijmo_1.asBoolean(e);wijmo_1.toggleClass(this.hostElement,wijmo_1.ControlStateClsNames.readOnly,this.isReadOnly)},enumerable:!0,configurable:!0});MultiSelect.prototype.refresh=function(t){void 0===t&&(t=!0);e.prototype.refresh.call(this,t);this.hostElement&&this._updateHeader()};MultiSelect.prototype._setText=function(e,t){};MultiSelect.prototype._keydown=function(t){var i=t.altKey&&(38===t.keyCode||40===t.keyCode);if(this.isDroppedDown&&i&&this.showFilterInput){this.isDroppedDown=!1;t.preventDefault()}else{e.prototype._keydown.call(this,t);wijmo_1.hasClass(this._tbx,"wj-grid-ime")||!t.defaultPrevented&&wijmo_1.hasItems(this.collectionView)&&t.keyCode>32&&123!==t.keyCode&&(this.isDroppedDown=!0)}};MultiSelect.prototype._hasItems=function(){var e=this.collectionView,t=e?e.sourceCollection:null;return wijmo_1.hasItems(e)||t&&t.length&&this.showFilterInput};MultiSelect.prototype._updateHeader=function(e,t){void 0===e&&(e=!0);void 0===t&&(t=!0);var i="";if(wijmo_1.isFunction(this._hdrFormatter))i=this._hdrFormatter(this);else{var o=this.checkedItems,n=[];if(this.displayMemberPath){var s=new wijmo_1.Binding(this.displayMemberPath);n=o.reduce((function(e,t){(t.binding?e.find((function(e){return e.binding===t.binding})):e.find((function(e){return s.getValue(e)===s.getValue(t)})))||e.push(t);return e}),[]);o=n}if(o.length>0)if(o.length<=this._maxHdrItems){if(this.headerPath){var r=new wijmo_1.Binding(this.headerPath);o=o.map((function(e){return r.getValue(e)}))}else if(this.displayMemberPath){var a=new wijmo_1.Binding(this.displayMemberPath);o=o.map((function(e){return a.getValue(e)}))}this.isContentHtml&&(o=o.map((function(e){return wijmo_1.toPlainText(e)})));this.trimText&&(o=o.map((function(e){return e?e.toString().trim():""})));i=o.join(", ")}else i=wijmo_1.format(this.headerFormat||wijmo_1.culture.MultiSelect.itemsSelected,{count:o.length})}var l=this.inputElement;if(i!=l.value){l.value=i;this.onTextChanged()}e&&this._lbx._updateCheckedList(this.checkedItems);this._updateState()};MultiSelect.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.MultiSelect.ariaLabels.multiSelect};MultiSelect._DEF_CHECKED_PATH="$checked";MultiSelect._ctrlTemplate="";return MultiSelect}(ComboBox);exports.MultiSelect=MultiSelect;wijmo_1._addCultureInfo("Menu",{ariaLabels:{menuButton:"Menu"}});var Menu=function(e){__extends(Menu,e);function Menu(t,i){var o=e.call(this,t)||this;o._closing=!1;o._cmd=null;o._cmdPath=null;o._cmdParamPath=null;o._subPath=null;o._owner=null;o._isButton=!1;o._keepOpen=!1;o._openOnHover=!1;o._closeOnLeave=!0;o._subMenu=null;o._hoverEnterBnd=o._hoverEnter.bind(o);o._hoverLeaveBnd=o._hoverLeave.bind(o);o._hoverOverBnd=o._hoverOver.bind(o);o._ariaLabel=wijmo_1.culture.Menu.ariaLabels.menuButton;o._aFEnabledItem=!1;o._parentMenu=null;o.itemClicked=new wijmo_1.Event;Menu._MenuInstanceCount++;var n=o.hostElement,s=o._tbx,r=o._lbx,a=o.dropDown;wijmo_1.addClass(n,exports.MenuClsNames.hostElement);s.style.display="none";var l='<div wj-part="header" class="'+wijmo_1.InputFormElementsClsNames.formControl+'"/>';o._hdr=o._elRef=wijmo_1.createElement(l);s.parentElement.insertBefore(o._hdr,s);wijmo_1.removeChild(s);o.isRequired=!1;if("SELECT"==o._orgTag){o.header=n.getAttribute("header");o._lbx.itemsSource&&(o.commandParameterPath="cmdParam")}o.isContentHtml=!0;o.maxDropDownHeight=500;o.addEventListener(o._hdr,"click",(function(e){if(!e.defaultPrevented){o._clearHover(e);if(o._isButton){o.isDroppedDown=!1;o._raiseCommand()}else o.isDroppedDown=!o.isDroppedDown}}));o.addEventListener(o._hdr,"mousedown",(function(e){e.defaultPrevented||o._clearHover(e)}));r.lostFocus.addHandler((function(){o.containsFocus()||(o.isDroppedDown=!1)}));wijmo_1.addClass(a,exports.MenuClsNames.menuItems);r.formatItem.addHandler(o._formatMenuItem.bind(o));o.initialize(i);wijmo_1.setAttribute(a,"role","menu");o._updateBtnAria();o._updateHdrAria();r.tabOrder=0;o._updateLbxAria();return o}Object.defineProperty(Menu,"controlTemplate",{get:function(){Menu._ctrlTemplate||(Menu._ctrlTemplate=ComboBox.controlTemplate);return Menu._ctrlTemplate},set:function(e){Menu._ctrlTemplate=e},enumerable:!0,configurable:!0});Menu.prototype._updateBtnAria=function(){var e=this._btn.querySelector("button"),t=this.dropDown;wijmo_1.setAttribute(e,"aria-expanded",this.isDroppedDown);wijmo_1.setAttribute(e,"aria-haspopup","menu");wijmo_1.setAttribute(e,"aria-owns",t.id);wijmo_1.setAttribute(e,"aria-controls",t.id)};Menu.prototype._updateHdrAria=function(){var e=this.dropDown,t=this.isDisabled?-1:this._orgTabIndex;wijmo_1.setAttribute(this._hdr,"role","button");wijmo_1.setAttribute(this._hdr,"tabindex",t);wijmo_1.setAttribute(this._hdr,"aria-label",this._ariaLabel);if(this.isButton){wijmo_1.setAttribute(this._hdr,"aria-expanded");wijmo_1.setAttribute(this._hdr,"aria-haspopup");wijmo_1.setAttribute(this._hdr,"aria-owns");wijmo_1.setAttribute(this._hdr,"aria-controls")}else{wijmo_1.setAttribute(this._hdr,"aria-expanded",this.isDroppedDown);wijmo_1.setAttribute(this._hdr,"aria-haspopup","menu");wijmo_1.setAttribute(this._hdr,"aria-owns",e.id);wijmo_1.setAttribute(this._hdr,"aria-controls",e.id)}};Menu.prototype._updateLbxAria=function(){var e=this._lbx,t=this.isDisabled?-1:e.tabOrder;e.itemRole="menuitem";e.tabOrder=t};Object.defineProperty(Menu.prototype,"ariaLabel",{get:function(){return this._ariaLabel},set:function(e){if(e!=this._ariaLabel){this._ariaLabel=e;wijmo_1.setAttribute(this._hdr,"aria-label",this._ariaLabel)}},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"autoSelectOnFocus",{get:function(){return this._aFEnabledItem},set:function(e){this._aFEnabledItem=e},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"header",{get:function(){return this._hdr.innerHTML},set:function(e){this._hdr.innerHTML=wijmo_1.asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"command",{get:function(){return this._cmd},set:function(e){this._cmd=e},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"commandPath",{get:function(){return this._cmdPath},set:function(e){this._cmdPath=wijmo_1.asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"commandParameterPath",{get:function(){return this._cmdParamPath},set:function(e){this._cmdParamPath=wijmo_1.asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"subItemsPath",{get:function(){return this._subPath},set:function(e){if(e!=this._subPath){this._subPath=e;this.refresh(!0)}},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"openOnHover",{get:function(){return this._openOnHover},set:function(e){this._openOnHover=wijmo_1.asBoolean(e);this._updateHoverEvents()},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"closeOnLeave",{get:function(){return this._closeOnLeave},set:function(e){this._closeOnLeave=wijmo_1.asBoolean(e);this._updateHoverEvents()},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"isButton",{get:function(){return this._isButton},set:function(e){this._isButton=wijmo_1.asBoolean(e);this._updateHdrAria()},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"keepOpen",{get:function(){return this._keepOpen},set:function(e){this._keepOpen=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"owner",{get:function(){return this._owner},set:function(e){this._owner=wijmo_1.asType(e,HTMLElement,!0);this._enableDisableItems()},enumerable:!0,configurable:!0});Menu.prototype.show=function(e){if(!this.isDroppedDown){var t=this._lbx._ignoredItemChangedEvents;this._lbx._ignoredItemChangedEvents=!0;this.selectedIndex=-1;this._lbx._ignoredItemChangedEvents=t;if(this.onIsDroppedDownChanging(new wijmo_1.CancelEventArgs)){var i=this.dropDown,o=this.owner;!o&&e instanceof MouseEvent&&(o=e.target);o instanceof HTMLElement&&(i[wijmo_1.Control._OWNR_KEY]=o);if(e instanceof MouseEvent&&this.openOnHover&&this.closeOnLeave){e=new wijmo_1.Point(e.pageX-pageXOffset-2,e.pageY-pageYOffset-2)}wijmo_1.showPopup(i,e,!1,this.isAnimated);this.onIsDroppedDownChanged()}}};Menu.prototype.hide=function(){if(this.isDroppedDown&&this.onIsDroppedDownChanging(new wijmo_1.CancelEventArgs)){wijmo_1.hidePopup(this.dropDown);this.onIsDroppedDownChanged()}};Menu.prototype.onItemClicked=function(e){this.itemClicked.raise(this,e)};Menu.prototype.refresh=function(t){void 0===t&&(t=!0);e.prototype.refresh.call(this,t);this.hostElement&&this._enableDisableItems()};Menu.prototype.onIsDroppedDownChanged=function(t){e.prototype.onIsDroppedDownChanged.call(this,t);this._updateBtnAria();this._updateHdrAria();if(this.isDroppedDown){this._closing=!0;var i=this._lbx._ignoredItemChangedEvents;this._lbx._ignoredItemChangedEvents=!0;this._defaultItem=this.selectedItem;this.isRequired=!1;this.selectedIndex=-1;this._enableDisableItems();this._closing=!1;this._lbx._ignoredItemChangedEvents=i;if(this._aFEnabledItem){for(var o=this.dropDown.children,n=0;n<o.length;n++)if(!o[n].classList.contains(wijmo_1.ControlStateClsNames.disabled)){this.selectedIndex=n;o[n].focus();break}}else this.dropDown.focus()}else{this._restoreSelectedItem();var s=this._subMenu;s&&(s.isDroppedDown=!1)}};Menu.prototype._restoreSelectedItem=function(){if(!this.selectedItem){var e=this._lbx._checking;this._lbx._checking=!0;this.selectedItem=this._defaultItem;this._lbx._checking=e}};Menu.prototype._updateHoverEvents=function(){var e=this.hostElement,t=this.dropDown,i=this.addEventListener.bind(this),o=this.removeEventListener.bind(this),n="mouseleave";o(e,"mouseenter",this._hoverEnterBnd);o(e,n,this._hoverLeaveBnd);o(t,"mouseover",this._hoverOverBnd);o(t,n,this._hoverLeaveBnd);if(this._openOnHover){i(e,"mouseenter",this._hoverEnterBnd);i(t,"mouseover",this._hoverOverBnd);if(this._closeOnLeave){i(e,n,this._hoverLeaveBnd);i(t,n,this._hoverLeaveBnd)}}};Menu.prototype._getSubItems=function(e){var t=this.subItemsPath,i=e&&t?e[t]:null;return wijmo_1.isArray(i)&&i.length?i:null};Menu.prototype._formatMenuItem=function(e,t){var i=t.item;if(this._getSubItems(t.data)){wijmo_1.addClass(i,exports.MenuClsNames.subItems);wijmo_1.setAttribute(i,"aria-expanded",!1)}else if("-"==i.innerHTML){i.innerHTML="";wijmo_1.addClass(i,wijmo_1.UtilitesClsNames.separator);wijmo_1.setAttribute(i,"role","separator");wijmo_1.setAttribute(i,"tabindex")}};Menu.prototype._keydown=function(t){if(!t.defaultPrevented){var i=this._getKeyCode(t);if(this.isDroppedDown)switch(i){case wijmo_1.Key.Tab:this.isDroppedDown=!1;this._parentMenu&&this._parentMenu.focus();this.keyActionTab===TabKeyAction.CloseAndKeepFocus&&t.preventDefault();break;case wijmo_1.Key.Enter:case wijmo_1.Key.Right:if(this._showSubMenu()){t.preventDefault();return}break;case wijmo_1.Key.Left:if(this._closeSubMenuAndFocusOwner()){t.preventDefault();return}break;case wijmo_1.Key.Escape:this.isDroppedDown=!1;this.focus();this._focusMenuOwner();if(this._parentMenu){this._parentMenu.focus();this._parentMenu.isDroppedDown=!1}t.preventDefault()}if(i==wijmo_1.Key.Enter){if(this._isButton){this._restoreSelectedItem();this._raiseCommand();t.preventDefault();return}if(this.isDroppedDown){if(this.selectedIndex>-1){this._raiseCommand();if(this.keepOpen){t.preventDefault();return}}if(this.keepOpen&&this._closeSubMenuAndFocusOwner()){t.preventDefault();return}}else{this.isDroppedDown=!0;t.preventDefault()}}}e.prototype._keydown.call(this,t)};Menu.prototype._afterOpenDropdownByDownArrow=function(){};Menu.prototype._dropDownClick=function(t){if(!t.defaultPrevented&&t.target!=this.dropDown){this._clearHover(t);if(this._showSubMenu()){t.preventDefault();return}if(this.selectedIndex>-1){this._raiseCommand();if(this.keepOpen){t.preventDefault();return}}}e.prototype._dropDownClick.call(this,t)};Menu.prototype._closeSubMenuAndFocusOwner=function(){var e=wijmo_1.Control.getControl(this.owner);if(!(e instanceof Menu))return!1;var t=e.dropDown,i=e.selectedIndex,o=i>-1?t.children[i]:t;wijmo_1.setAttribute(o,"aria-expanded",!1);wijmo_1.setAttribute(o,"aria-owns");o.focus();return!0};Menu.prototype._showSubMenu=function(){var e=this,t=this._getSubItems(this.selectedItem);if(!t)return null;var i=this.dropDown.children[this.selectedIndex],o=i.getBoundingClientRect(),n=new wijmo_1.Point(o.right,o.top);if(0==o.height)return null;var s=this.rightToLeft||"rtl"==this.dropDown.getAttribute("dir");s&&(n.x=o.left);var r=this._subMenu;r&&(r.isDroppedDown=!1);(r=new Menu(document.createElement("div"),{owner:this.hostElement,itemsSource:t,autoSelectOnFocus:this._aFEnabledItem,keepOpen:this.keepOpen,itemClicked:function(t,i){e.itemClicked.raise(t,i)},formatItem:function(t,i){e.formatItem.raise(t,i)}}))._parentMenu=this._parentMenu||this;if(i){wijmo_1.setAttribute(i,"aria-expanded",!0);wijmo_1.setAttribute(i,"aria-owns",r.dropDown.id)}var a=this.collectionView,l=r.collectionView;a&&a.filter&&l&&!l.filter&&(l.filter=a.filter);"displayMemberPath,selectedValuePath,isContentHtml,command,commandPath,commandParameterPath,maxDropDownWidth,maxDropDownHeight,dropDownCssClass,isAnimated,subItemsPath,openOnHover,closeOnLeave".split(",").forEach((function(t){r[t]=e[t]}));var h=r.dropDown;wijmo_1.setAttribute(h,"dir",s?"rtl":null);r.show(n);r._rtlDir=s;h[wijmo_1.Control._OWNR_KEY]=this.dropDown;return r};Menu.prototype._raiseCommand=function(e){var t=this.selectedItem,i=this._getSubItems(t),o=this._getCommand(t);if(o&&!i){var n=this._getCommandParm(t);if(!this._canExecuteCommand(o,n))return;this._executeCommand(o,n)}var s=this.headerPath;if(s){var r=new wijmo_1.Binding(s).getValue(t);r=null==r?"":r.toString();this.header=this.isContentHtml?r:wijmo_1.escapeHtml(r)}this.onItemClicked(e);if(this.containsFocus()){for(var a=this;a&&a.owner;){var l=wijmo_1.Control.getControl(a.owner);if(!(l instanceof Menu))break;a=l}if(this.keepOpen){this._enableDisableItems();this._lbx.focus()}else{a.isDroppedDown=!1;a.focus();this._focusMenuOwner()}}};Menu.prototype._focusMenuOwner=function(){var e=this.owner;!e&&this.dropDown&&(e=this.dropDown[wijmo_1.Control._OWNR_KEY]);if(!this.containsFocus()&&e instanceof HTMLElement&&e.offsetHeight)if(wijmo_1.isIE){var t=document.documentElement,i=t.scrollLeft,o=t.scrollTop;e.focus();t.scrollLeft=i;t.scrollTop=o}else e.focus()};Menu.prototype._getCommand=function(e){var t=e&&this._cmdPath?e[this._cmdPath]:null;return t||this._cmd};Menu.prototype._getCommandParm=function(e){var t=this._cmdParamPath;return e&&t?e[t]:e};Menu.prototype._executeCommand=function(e,t){e&&!wijmo_1.isFunction(e)&&(e=e.executeCommand);wijmo_1.isFunction(e)&&e(t)};Menu.prototype._canExecuteCommand=function(e,t){if(e){var i=e.canExecuteCommand;if(wijmo_1.isFunction(i))return i(t)}return!0};Menu.prototype._enableDisableItems=function(){if(this.collectionView&&(this._cmd||this._cmdPath))for(var e=this.collectionView.items,t=0;t<e.length;t++){var i=e[t],o=this._getCommand(i);if(o){var n=this._lbx.hostElement.children[t],s=this._getCommandParm(i);wijmo_1.toggleClass(n,wijmo_1.ControlStateClsNames.disabled,!this._canExecuteCommand(o,s))}}};Menu.prototype._clearHover=function(e){this._toHover&&clearTimeout(this._toHover);this._toHover=null;Menu._evtHover=e};Menu.prototype._isTargetDisabled=function(e){return wijmo_1.hasClass(e.target,wijmo_1.ControlStateClsNames.disabled)};Menu.prototype._hoverEnter=function(e){var t=this;this._clearHover(e);this._toHover=setTimeout((function(){t._toHover=null;t.isDroppedDown=!0}),wijmo_1.Control._HOVER_DELAY)};Menu.prototype._hoverOver=function(e){var t=this;this._clearHover(e);this._toHover=setTimeout((function(){t._toHover=null;var i=t.listBox.indexOf(e.target);if(i>-1&&!wijmo_1.hasClass(e.target,wijmo_1.ControlStateClsNames.disabled)){t.selectedIndex=i;t._subMenu=t._showSubMenu()}}),wijmo_1.Control._HOVER_DELAY)};Menu.prototype._hoverLeave=function(e){var t=this;this._clearHover(e);this.isDroppedDown&&(this._toHover=setTimeout((function(){var i=(e=Menu._evtHover)?document.elementFromPoint(e.clientX,e.clientY):null,o=wijmo_1.closest(i,"."+exports.ListBoxClsNames.hostElement+"."+exports.MenuClsNames.menuItems),n=t._subMenu;if(!o&&!wijmo_1.contains(t.hostElement,i,!0)){t.isDroppedDown=!1;n&&(n.isDroppedDown=!1)}}),wijmo_1.Control._LEAVE_DELAY))};Menu.prototype._setIsDisabled=function(t){e.prototype._setIsDisabled.call(this,t);wijmo_1.setAttribute(this.hostElement,"tabindex",-1);this._updateHdrAria();this._updateLbxAria()};Menu.prototype._setTabOrder=function(t){e.prototype._setTabOrder.call(this,t);wijmo_1.setAttribute(this.hostElement,"tabindex",-1);this._updateHdrAria();this._updateLbxAria()};Menu.prototype._getRtlStates=function(){var t=this.hostElement;return t&&t.isConnected?e.prototype._getRtlStates.call(this):null!=this._rtlDir&&this._rtlDir};Menu.prototype.dispose=function(){var t=this;if(this._subMenu){this._subMenu.dispose();this._subMenu=null}Menu._MenuInstanceCount--;0===Menu._MenuInstanceCount&&Menu._evtHover&&(Menu._evtHover=null);var i=this._lbx;if(i){i.lostFocus.removeHandler((function(){t.containsFocus()||(t.isDroppedDown=!1)}));i.formatItem&&i.formatItem.removeHandler(this._formatMenuItem)}if(this._toHover){clearTimeout(this._toHover);this._toHover=null}this._cmd=null;this._owner=null;this._defaultItem=null;this._hoverEnterBnd=null;this._hoverLeaveBnd=null;this._hoverOverBnd=null;e.prototype.dispose.call(this)};Menu._MenuInstanceCount=0;Menu._ctrlTemplate="";return Menu}(ComboBox);exports.Menu=Menu;wijmo_1._addCultureInfo("InputTime",{ariaLabels:{inputTime:"Input Time",inputTimeInput:"InputTime Input"}});var InputTime=function(e){__extends(InputTime,e);function InputTime(t,i){var o=e.call(this,t)||this;o._format="t";o._inputElementAriaLabel=wijmo_1.culture.InputTime.ariaLabels.inputTimeInput;o.valueChanged=new wijmo_1.Event;wijmo_1.addClass(o.hostElement,exports.InputTimeClsNames.hostElement);o.isEditable=!0;o._value=wijmo_1.DateTime.newDate();o._min=o._max=null;o._msk=new wijmo_1._MaskProvider(o._tbx);wijmo_1.isIE9()||(o._tbx.type="tel");if("INPUT"==o._orgTag){var n=o._tbx.getAttribute("value");n&&(o.value=wijmo_1.Globalize.parseDate(n,"HH:mm:ss"))}o.step=15;o.autoExpandSelection=!0;o.initialize(i);o._commitText();o._updateInputAriaLabel();return o}Object.defineProperty(InputTime,"controlTemplate",{get:function(){InputTime._ctrlTemplate||(InputTime._ctrlTemplate=ComboBox.controlTemplate);return InputTime._ctrlTemplate},set:function(e){InputTime._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"inputElement",{get:function(){return this._tbx},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"inputType",{get:function(){return this._tbx.type},set:function(e){this._tbx.type=wijmo_1.asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"value",{get:function(){return this._value},set:function(e){(e=wijmo_1.asDate(e,!this.isRequired))&&(e=this._clamp(e));this._setText(e?wijmo_1.Globalize.format(e,this.format):"",!0,!0);this.selectedItem&&this.selectedItem.value&&(e=wijmo_1.DateTime.fromDateTime(e,this.selectedItem.value));if(e!=this._value&&!wijmo_1.DateTime.equals(e,this._value)){this._value=e;this.onValueChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"text",{get:function(){return this._tbx.value},set:function(e){if(e!=this.text&&(this.text||!this.isRequired)){this._setText(e,!0);this._commitText()}!this.text&&this.isRequired&&(this.selectedIndex=this._oldIndexToBeRestoredOnBlur<0?0:this._oldIndexToBeRestoredOnBlur)},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"min",{get:function(){return this._min},set:function(e){this._min=wijmo_1.asDate(e,!0);this.isDroppedDown=!1;this._updateItems()},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"max",{get:function(){return this._max},set:function(e){this._max=wijmo_1.asDate(e,!0);this.isDroppedDown=!1;this._updateItems()},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"step",{get:function(){return this._step},set:function(e){if(e!=this.step){this._step=wijmo_1.asNumber(e,!0);this.isDroppedDown=!1;this._updateItems()}},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"format",{get:function(){return this._format},set:function(e){if(e!=this.format){this._format=wijmo_1.asString(e);this._tbx.value=wijmo_1.Globalize.format(this.value,this.format);wijmo_1.hasItems(this.collectionView)&&this._updateItems()}},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"mask",{get:function(){return this._msk.mask},set:function(e){this._msk.mask=wijmo_1.asString(e)},enumerable:!0,configurable:!0});InputTime.prototype.onLostFocus=function(){e.prototype.onLostFocus.call(this)};InputTime.prototype.onValueChanged=function(e){this.valueChanged.raise(this,e)};InputTime.prototype.onItemsSourceChanged=function(t){e.prototype.onItemsSourceChanged.call(this,t);this._hasCustomItems=null!=this.itemsSource};InputTime.prototype.refresh=function(t){void 0===t&&(t=!0);e.prototype.refresh.call(this,t);if(this.hostElement){this._msk.refresh();this._tbx.value=wijmo_1.Globalize.format(this.value,this.format);this._updateItems()}};InputTime.prototype.onSelectedIndexChanged=function(t){if(this.selectedIndex>-1&&!this._settingText){var i=this.value?this.value:wijmo_1.DateTime.newDate(),o=null!=this.selectedItem.value?this.selectedItem.value:wijmo_1.Globalize.parseDate(this.text,this.format,this.value);this.value=wijmo_1.DateTime.fromDateTime(i,o)}e.prototype.onSelectedIndexChanged.call(this,t)};InputTime.prototype._clamp=function(e){null!=this._min&&this._getTime(e)<this._getTime(this._min)&&(e=wijmo_1.DateTime.fromDateTime(e,this._min));null!=this._max&&this._getTime(e)>this._getTime(this._max)&&(e=wijmo_1.DateTime.fromDateTime(e,this._max));return e};InputTime.prototype._wheel=function(t){if(this.handleWheel&&!t.defaultPrevented&&!this.isDroppedDown&&this.value&&this._canChangeValue()&&this.containsFocus()&&this.isEditable){var i=this._tbx,o=i.selectionStart,n=i.selectionEnd,s=wijmo_1.clamp(-t.deltaY,-1,1),r=(this.value,wijmo_1.culture.Globalize.calendar.patterns[this.format]);null==r&&(r=this.format);var a=r.match(wijmo_1.getSpecialCharsRegex());if(n-o===i.value.length&&wijmo_1.isNumber(this.step)&&this.step>0){var l=wijmo_1.DateTime.addMinutes(this.value,this.step*-s);l=this._clamp(l);this.value=l;this.selectAll()}else this._updateTimeValue(s,a,r);t.preventDefault()}e.prototype._wheel.call(this,t)};InputTime.prototype._updateInputSelection=function(t){if(this._delKey)e.prototype._updateInputSelection.call(this,t);else{for(var i=this._tbx.value;t<i.length&&!i[t].match(/[a-z0-9]/i);)t++;wijmo_1.setSelectionRange(this._tbx,t,this._tbx.value.length)}};InputTime.prototype._updateItems=function(){if(!this._hasCustomItems){var e=[],t=new Date,i=new Date(t.getFullYear(),t.getMonth(),t.getDate()),o=new Date(t.getFullYear(),t.getMonth(),t.getDate(),23,59,59),n=this.step;this.min&&i.setHours(this.min.getHours(),this.min.getMinutes(),this.min.getSeconds());this.max&&o.setHours(this.max.getHours(),this.max.getMinutes(),this.max.getSeconds());if(wijmo_1.isNumber(n)&&n>=1)for(var s=i;s<=o;s=wijmo_1.DateTime.addMinutes(s,n))e.push({value:s,text:wijmo_1.Globalize.format(s,this.format)});var r=this.value;this._settingText=!0;this.displayMemberPath="text";this.selectedValuePath="text";this.itemsSource=e;this._hasCustomItems=!1;this._settingText=!1;!r&&this.isRequired||(this.value=r)}};InputTime.prototype._getTime=function(e){return 3600*e.getHours()+60*e.getMinutes()+e.getSeconds()};InputTime.prototype._getText=function(){var e=wijmo_1.Globalize.format,t=this._format;return e(this.value,t)};InputTime.prototype._canChangeValue=function(){return!this.isReadOnly&&!this.isDisabled};InputTime.prototype.getSeconds=function(e){return 3600*e.getHours()+60*e.getMinutes()+e.getSeconds()};InputTime.prototype._keydown=function(t){if(!(t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey)){if(this._isHiddenEditor())return;switch(t.keyCode){case wijmo_1.Key.Enter:this._commitText(void 0,!0);this.selectAll();break;case wijmo_1.Key.Escape:this.text=wijmo_1.Globalize.format(this.value,this.format);this.selectAll();break;case wijmo_1.Key.Up:case wijmo_1.Key.Down:if(!this.isDroppedDown&&this.value&&this._canChangeValue()&&this.isEditable){var i=this._tbx,o=i.selectionStart,n=i.selectionEnd,s=t.keyCode==wijmo_1.Key.Up?1:-1,r=wijmo_1.culture.Globalize.calendar.patterns[this.format];null==r&&(r=this.format);var a=r.match(wijmo_1.getSpecialCharsRegex());if(n-o==i.value.length)e.prototype._keydown.call(this,t);else{if(!(1==s&&(null===this.max||this.getSeconds(this.value)<this.getSeconds(this.max))||-1==s&&(null===this.min||this.getSeconds(this.value)>this.getSeconds(this.min))))return;this._updateTimeValue(s,a,r)}t.preventDefault()}}}e.prototype._keydown.call(this,t)};InputTime.prototype._updateTimeValue=function(e,t,i){var o=this._tbx,n=o.selectionStart,s=o.value,r=this.value,a={},l={},h=0,u=0,c=0,p=[],d=[],_=o.value.match(wijmo_1.getSpecialCharsRegex());if(null==t||null==_){p=[this.format];d=["0"];t=[""]}else{t.forEach((function(e,o){var n=e.replaceAll('"',""),r=i.substring(h),c=s.substring(u),p=r.indexOf(e),d=c.indexOf(n),_=r.substring(0,p);a[_]=h;l[_]=u;h=h+p+e.length;u=u+d+n.length;if(o==t.length-1&&-1!=d){_=i.substring(h);a[_]=h;l[_]=u}}));p=Object.keys(a);d=Object.values(l)}var m=d.filter((function(e){return n>=parseInt(e.toString())}));m.length>0&&(c=m.length-1);var f=p[c];-1!=f.indexOf("h")||-1!=f.indexOf("H")?r=wijmo_1.DateTime.addHours(this.value,e):-1!=f.indexOf("m")?r=wijmo_1.DateTime.addMinutes(this.value,e):-1!=f.indexOf("s")?r=wijmo_1.DateTime.addSeconds(this.value,e):-1!=f.indexOf("t")&&(r=this.value.getHours()>=12?wijmo_1.DateTime.addHours(this.value,-12):wijmo_1.DateTime.addHours(this.value,12));r.getDate()!=(new Date).getDate()&&(r=wijmo_1.DateTime.fromDateTime(new Date,r));this.value=r;this._reselectText(t,c)};InputTime.prototype._reselectText=function(e,t){var i=this._getText(),o=this._tbx,n=0,s=-1,r=-1;e.forEach((function(e,o){var a=e.replaceAll('"',""),l=i.substring(n),h=l.indexOf(a),u=l.substring(0,h),c=""==u?l.length:u.length;o==t&&-1==s&&(r=(s=n)+c);n=n+h+a.length}));if(-1==s){s=n;r=o.value.length}wijmo_1.setSelectionRange(o,s,r)};InputTime.prototype._commitText=function(e,t){if(this.text||this.isRequired){var i=this.value?wijmo_1.Globalize.format(this.value,this.format):"";if(this.text!=i){var o=this.selectedItem&&this.selectedItem.value?this.selectedItem.value:wijmo_1.Globalize.parseDate(this.text,this.format,this.value),n=this._shouldRaiseInvalidInput(t);if(o){!wijmo_1.DateTime.sameTime(o,this._clamp(o))?n&&this.onInvalidInput(new wijmo_1.CancelEventArgs)&&(this.value=wijmo_1.DateTime.fromDateTime(this.value,o)):this.value=wijmo_1.DateTime.fromDateTime(this.value,o)}else n&&this.onInvalidInput(new wijmo_1.CancelEventArgs)&&(this.text=i)}}else this.value=null};InputTime.prototype._copy=function(e,t){if("text"===e){(t||"").toString()!==this.text&&this._setText(t,!0);return!0}return!1};InputTime.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.InputTime.ariaLabels.inputTime};InputTime.prototype._input=function(e){this._draggingText&&(""===this.text?this._emptyValueAction=!0:this._emptyValueAction=!1);this._updateDropDownWhenInput();this._setText(""!=this._textIsComposing?this._textIsComposing:this.text,!1);""!=this.text&&(this._emptyValueAction=!1);this._draggingText=!1};InputTime._ctrlTemplate="";return InputTime}(ComboBox);exports.InputTime=InputTime;wijmo_1._addCultureInfo("InputDateTime",{ariaLabels:{inputDateTimeInput:"InputDateTime Input",tglDate:"Toggle Calendar",tglTime:"Toggle Time List"}});var InputDateTime=function(e){__extends(InputDateTime,e);function InputDateTime(t,i){var o=e.call(this,t)||this;o._inputAriaLabel=wijmo_1.culture.InputDateTime.ariaLabels.inputDateTimeInput;wijmo_1.addClass(o.hostElement,exports.InputDateTimeClsNames.hostElement);var n=wijmo_1.culture.InputDateTime.ariaLabels;wijmo_1.setAriaLabel(o._btn,n.tglDate);wijmo_1.setAttribute(o._btn,"aria-haspopup","dialog");wijmo_1.setAttribute(o._btn,"aria-expanded",!1);o._updateInputAriaLabel();o.value=new Date;o.format="g";o.isDroppedDownChanged.addHandler(o.inputDateTimeIsDroppedDownChanged,o);o._inputTime=new InputTime(document.createElement("div"),{valueChanged:function(e){var t=o.rangeEnd;o.value=wijmo_1.DateTime.fromDateTime(o.value,e.value);o.calendar._rngMode()&&t&&(o.rangeEnd=wijmo_1.DateTime.fromDateTime(t,e.value))},isDroppedDownChanged:function(e){e.listBox.containsFocus()&&o.inputElement.focus();o._selectAll();o._updateTbxAria();o.inputDateTimeIsDroppedDownChanged()},keyActionPrintCharacters:0,keyActionTab:0});o._inputTime.dropDown.id=wijmo_1.getUniqueId(o.hostElement.id+"_dropdown");var s=o.addEventListener.bind(o);o._btnTm=o.hostElement.querySelector('[wj-part="btn-tm"]');s(o._btnTm,"mousedown",(function(e){o._isTouchMoved()||o._btnclick(e)}));wijmo_1.setAriaLabel(o._btnTm,n.tglTime);wijmo_1.setAttribute(o._btnTm,"aria-haspopup","listbox");wijmo_1.setAttribute(o._btnTm,"aria-expanded",!1);o._ddDate=o._dropDown;o._ddTime=o._inputTime.dropDown;var r=o._ddTime;s(r,"keydown",o._keydown.bind(o),!0);s(r,"blur",(function(){o._updateFocusState()}),!0);s(r,"click",(function(e){e.defaultPrevented||e.target!=r&&o.hostElement.focus()}),!0);o.initialize(i);o._tbx.value!==o._oldText&&o._commitText();return o}Object.defineProperty(InputDateTime,"controlTemplate",{get:function(){InputDateTime._ctrlTemplate||(InputDateTime._ctrlTemplate='<div class="'+wijmo_1.ControlClsNames.template+'"><div class="'+exports.InputClsNames.input+'"><div class="'+exports.InputClsNames.inputGroup+" "+exports.InputClsNames.inputBtnVisible+'"><input wj-part="input" type="text" class="'+wijmo_1.InputFormElementsClsNames.formControl+'"/><span class="'+exports.InputClsNames.inputGroupBtn+'"><button wj-part="btn" class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1"><span class='+wijmo_1.GlyphClsNames.calendar+'></span></button><button wj-part="btn-tm" class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1"><span class='+wijmo_1.GlyphClsNames.clock+'></span></button></span></div></div><div wj-part="dropdown" class="'+wijmo_1.ControlClsNames.content+" "+exports.DropDownClsNames.dropDownPanel+'"></div></div>');return InputDateTime._ctrlTemplate},set:function(e){InputDateTime._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(InputDateTime.prototype,"timeMin",{get:function(){return this._inputTime.min},set:function(e){this._inputTime.min=e},enumerable:!0,configurable:!0});Object.defineProperty(InputDateTime.prototype,"timeMax",{get:function(){return this._inputTime.max},set:function(e){this._inputTime.max=e},enumerable:!0,configurable:!0});Object.defineProperty(InputDateTime.prototype,"timeFormat",{get:function(){return this._inputTime.format},set:function(e){this._inputTime.format=e},enumerable:!0,configurable:!0});Object.defineProperty(InputDateTime.prototype,"timeStep",{get:function(){return this._inputTime.step},set:function(e){this._inputTime.step=e;this._btnTm.style.display=wijmo_1.isNumber(e)&&e>0?"":"none"},enumerable:!0,configurable:!0});Object.defineProperty(InputDateTime.prototype,"inputTime",{get:function(){return this._inputTime},enumerable:!0,configurable:!0});InputDateTime.prototype._fromDateTime=function(e){return e};InputDateTime.prototype._btnclick=function(t){this._setDropDownByEvent(t);e.prototype._btnclick.call(this,t)};InputDateTime.prototype.dispose=function(){this._setDropdown(this._ddDate);e.prototype.dispose.call(this);this._inputTime.dispose()};InputDateTime.prototype.refresh=function(t){void 0===t&&(t=!0);this._inputTime.refresh();e.prototype.refresh.call(this,t)};InputDateTime.prototype._updateBtn=function(){e.prototype._updateBtn.call(this);if(this._btnTm){this._btnTm.tabIndex=this._btn.tabIndex;this._btnTm.parentElement.style.display=this._btn.style.display}};InputDateTime.prototype._setDropdown=function(e){if(this._dropDown==e)return!1;this.isDroppedDown&&(this.isDroppedDown=!1);var t=this.dropDownCssClass;this.dropDownCssClass="";this._dropDown=e;this.dropDownCssClass=t;return!0};InputDateTime.prototype._updateDropDown=function(){var t=this._inputTime;if(this._dropDown==t.dropDown){this._commitText();e.prototype._updateDropDown.call(this);t.isRequired=this.isRequired&&null!=this.value;t.value=this.value;this.isDroppedDown&&t.listBox.showSelection()}else e.prototype._updateDropDown.call(this)};InputDateTime.prototype._mouseWheel=function(e){if(this.handleWheel&&!e.defaultPrevented&&!this.isDroppedDown&&this.containsFocus()&&null!=this.value&&this._canChangeValue()){var t=this._tbx,i=t.selectionStart,o=t.selectionEnd,n=wijmo_1.clamp(-e.deltaY,-1,1),s=this.value,r=wijmo_1.Globalize.getFullFormat(this.format||wijmo_1.Globalize.DefaultDateFormat);null==r&&(r=this.format);var a=r.match(wijmo_1.getSpecialCharsRegex());if(o-i===t.value.length&&null!=a||this.selectionMode==DateSelectionMode.Range){s=this.selectionMode==DateSelectionMode.Month?wijmo_1.DateTime.addMonths(this.value,n):wijmo_1.DateTime.addDays(this.value,n);this.value=s;var l=this._getText();wijmo_1.setSelectionRange(t,0,l.length)}else(1==n&&(null===this.max||this.value<this.max)||-1==n&&(null===this.min||this.value>this.min))&&this._updateDateTimeValue(n,a,r);e.preventDefault()}};InputDateTime.prototype._keydown=function(t){if(!(t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey)){if(this._isHiddenEditor())return;switch(t.keyCode){case wijmo_1.Key.Up:case wijmo_1.Key.Down:if(t.keyCode===wijmo_1.Key.Up&&this.keyActionUpArrow===KeyAction.OpenDropdown||t.keyCode===wijmo_1.Key.Down&&this.keyActionDownArrow===KeyAction.OpenDropdown)break;if(!this.isDroppedDown&&this.value&&this._canChangeValue()){var i=this._tbx,o=i.selectionStart,n=i.selectionEnd,s=(i.value,t.keyCode==wijmo_1.Key.Up?1:-1),r=this.value,a=wijmo_1.Globalize.getFullFormat(this.format||wijmo_1.Globalize.DefaultDateFormat);if("g"==this.format&&a.includes("г")){a=a.replace(/"г." /,"")}null==a&&(a=this.format);var l=a.match(wijmo_1.getSpecialCharsRegex());if(n-o===i.value.length&&null!=l||this.selectionMode==DateSelectionMode.Range){r=this.selectionMode==DateSelectionMode.Month?wijmo_1.DateTime.addMonths(this.value,s):wijmo_1.DateTime.addDays(this.value,s);this.value=r;var h=this._getText();wijmo_1.setSelectionRange(i,0,h.length)}else(1==s&&(null===this.max||this.value<this.max)||-1==s&&(null===this.min||this.value>this.min))&&this._updateDateTimeValue(s,l,a);t.preventDefault()}break;case wijmo_1.Key.Enter:case wijmo_1.Key.Space:var u=t.target;if(u===this._btn||u===this._btnTm){this._setDropDownByEvent(t);this.isDroppedDown=!0;t.preventDefault()}}}if(!t.defaultPrevented&&t.altKey&&this.isDroppedDown&&("ArrowUp"===t.key||"ArrowDown"===t.key)){var c=this.dropDown===this._ddDate?this._ddTime:this._ddDate;this._setDropdown(c);this.isDroppedDown=!0;t.preventDefault()}e.prototype._keydown.call(this,t)};InputDateTime.prototype._updateDateTimeValue=function(e,t,i){var o=this._tbx,n=o.selectionStart,s=o.value,r=this.value,a={},l={},h=0,u=0,c=0,p=[],d=[],_=o.value.match(wijmo_1.getSpecialCharsRegex());if(null==t||null==_){p=[this.format];d=["0"];t=[""]}else{t.forEach((function(e,o){var n=e.replaceAll('"',""),r=i.substring(h),c=s.substring(u);if(c.startsWith("г.")){c=c.replace("г. ","");u+="г. ".length}var p=r.indexOf(e),d=c.indexOf(n);if(-1==d){var m=_[o];d=c.indexOf(m)}var f=r.substring(0,p);if(""!=f){a[f]=h;l[f]=u}h=h+p+e.length;u=u+d+n.length;if(o==t.length-1&&-1!==d){f=i.substring(h);a[f]=h;l[f]=u}}));p=Object.keys(a);d=Object.values(l)}var m=d.filter((function(e){return n>=parseInt(e.toString())}));m.length>0&&(c=m.length-1);var f=new Date,b=new Date;null!==this.timeMax&&(f=new Date(this.value.getFullYear(),this.value.getMonth(),this.value.getDate(),this.timeMax.getHours(),this.timeMax.getMinutes(),this.timeMax.getSeconds()));null!==this.timeMin&&(b=new Date(this.value.getFullYear(),this.value.getMonth(),this.value.getDate(),this.timeMin.getHours(),this.timeMin.getMinutes(),this.timeMin.getSeconds()));var g=p[c];if(-1!=g.indexOf("d"))r=wijmo_1.DateTime.addDays(this.value,e);else if(-1!=g.indexOf("M"))r=wijmo_1.DateTime.addMonths(this.value,e);else if(-1!=g.indexOf("y"))r=wijmo_1.DateTime.addYears(this.value,e);else if(1==e&&(null===this.timeMax||this.value<f)||-1==e&&(null===this.timeMin||this.value>b)){-1!=g.indexOf("h")||-1!=g.indexOf("H")?r=wijmo_1.DateTime.addHours(this.value,e):-1!=g.indexOf("m")?r=wijmo_1.DateTime.addMinutes(this.value,e):-1!=g.indexOf("s")?r=wijmo_1.DateTime.addSeconds(this.value,e):-1!=g.indexOf("t")&&(r=this.value.getHours()>=12?wijmo_1.DateTime.addHours(this.value,-12):wijmo_1.DateTime.addHours(this.value,12));(this.timeMax&&r>f||this.timeMin&&r<b)&&(r=this.value)}this.value=r;this._reselectText(t,c)};InputDateTime.prototype._commitText=function(t,i){var o=this._tbx.value,n=wijmo_1.Globalize.parseDate(o,this.format,this.value),s=new Date,r=new Date;if(n){null!==this.timeMax&&(s=new Date(n.getFullYear(),n.getMonth(),n.getDate(),this.timeMax.getHours(),this.timeMax.getMinutes(),this.timeMax.getSeconds()));null!==this.timeMin&&(r=new Date(n.getFullYear(),n.getMonth(),n.getDate(),this.timeMin.getHours(),this.timeMin.getMinutes(),this.timeMin.getSeconds()));(this.timeMax&&n>s||this.timeMin&&n<r)&&(this.value=wijmo_1.DateTime.fromDateTime(n,this.value));e.prototype._commitText.call(this,t,i)}else e.prototype._commitText.call(this,t,i)};InputDateTime.prototype._updateTbxAria=function(){e.prototype._updateTbxAria.call(this);if(this._inputTime){var t=this._tbx,i=this._inputTime._lbx,o=i.selectedIndex,n=i.hostElement?i.hostElement.children:null,s=o>-1&&o<n.length?n[o].id:null;wijmo_1.setAttribute(t,"aria-activedescendant",this.isDroppedDown&&this.dropDown===this._ddTime&&s&&s.length?s:null);wijmo_1.setAttribute(t,"aria-haspopup",this.inputTime.isDroppedDown?"listbox":"dialog")}};Object.defineProperty(InputDateTime.prototype,"keyActionTab",{get:function(){return this._keyActionTab},set:function(e){var t=wijmo_1.asEnum(e,TabKeyAction);this._keyActionTab=t;this.inputTime.keyActionTab=t},enumerable:!0,configurable:!0});InputDateTime.prototype._setDropDownByEvent=function(e){var t=wijmo_1.closest(e.target,"button")==this._btn?this._ddDate:this._ddTime;this._setDropdown(t)};InputDateTime.prototype._updateBtnAria=function(){var e=this._btn,t=this.isDroppedDown,i=this.dropDown?this.dropDown.id:null,o=this._btnTm,n=t&&this.dropDown===this._ddDate,s=t&&this.dropDown===this._ddTime;wijmo_1.setAttribute(e,"aria-expanded",!!n);wijmo_1.setAttribute(e,"aria-controls",n?i:null);wijmo_1.setAttribute(o,"aria-expanded",!!s);wijmo_1.setAttribute(o,"aria-controls",s?i:null)};InputDateTime.prototype.inputDateTimeIsDroppedDownChanged=function(){var e=this.dropDown===this._ddDate?this._btn:this._btnTm;wijmo_1.toggleClass(e,exports.InputDateTimeClsNames.showDropDownButton,this.isDroppedDown)};InputDateTime._ctrlTemplate="";return InputDateTime}(InputDate);exports.InputDateTime=InputDateTime;wijmo_1._addCultureInfo("AutoComplete",{ariaLabels:{autoCompleteInput:"AutoComplete Input",autoComplete:"Auto Complete"}});var AutoComplete=function(e){__extends(AutoComplete,e);function AutoComplete(t,i){var o=e.call(this,t)||this;o._cssMatch=exports.ComboBoxClsNames.stateMatch;o._minLength=2;o._maxItems=6;o._itemCount=0;o._beginsWith=!1;o._delay=wijmo_1.Control._SEARCH_DELAY;o._selItems=null;o._query="";o._inCallback=!1;o._srchProps=[];o._oldSelectedIndex=-1;o._inputElementAriaLabel=wijmo_1.culture.AutoComplete.ariaLabels.autoCompleteInput;o._isBlurInput=!1;wijmo_1.addClass(o.hostElement,exports.AutoCompleteClsNames.hostElement);o._bsCollapse=!1;o.isEditable=!0;o.isRequired=!1;o.listBox.formatItem.addHandler(o._formatListItem,o);o._itemsSourceFnCallbackBnd=o._itemSourceFunctionCallback.bind(o);o.initialize(i);o._updateInputAriaLabel();return o}Object.defineProperty(AutoComplete,"controlTemplate",{get:function(){AutoComplete._ctrlTemplate||(AutoComplete._ctrlTemplate=ComboBox.controlTemplate);return AutoComplete._ctrlTemplate},set:function(e){AutoComplete._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(AutoComplete.prototype,"minLength",{get:function(){return this._minLength},set:function(e){this._minLength=wijmo_1.asNumber(e,!1,!0)},enumerable:!0,configurable:!0});Object.defineProperty(AutoComplete.prototype,"beginsWithSearch",{get:function(){return this._beginsWith},set:function(e){this._beginsWith=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(AutoComplete.prototype,"maxItems",{get:function(){return this._maxItems},set:function(e){this._maxItems=wijmo_1.asNumber(e,!1,!0)},enumerable:!0,configurable:!0});Object.defineProperty(AutoComplete.prototype,"delay",{get:function(){return this._delay},set:function(e){this._delay=wijmo_1.asNumber(e,!1,!0)},enumerable:!0,configurable:!0});Object.defineProperty(AutoComplete.prototype,"searchMemberPath",{get:function(){return this._srchProp},set:function(e){this._srchProp=wijmo_1.asString(e);this._srchProps=e?e.trim().split(/\s*,\s*/):[]},enumerable:!0,configurable:!0});Object.defineProperty(AutoComplete.prototype,"itemsSourceFunction",{get:function(){return this._itemsSourceFn},set:function(e){if(this._itemsSourceFn!==e){this._itemsSourceFn=wijmo_1.asFunction(e);wijmo_1.isFunction(this._itemsSourceFn)&&this.itemsSourceFunction(this.text,this.maxItems,this._itemsSourceFnCallbackBnd)}},enumerable:!0,configurable:!0});Object.defineProperty(AutoComplete.prototype,"cssMatch",{get:function(){return this._cssMatch},set:function(e){this._cssMatch=wijmo_1.asString(e)},enumerable:!0,configurable:!0});AutoComplete.prototype.onSelectedIndexChanged=function(t){this._settingText||e.prototype.onSelectedIndexChanged.call(this,t)};AutoComplete.prototype._updateTbxAria=function(){e.prototype._updateTbxAria.call(this);var t=this._tbx;wijmo_1.setAttribute(t,"aria-autocomplete","list")};AutoComplete.prototype._keydown=function(t){if(!this._isHiddenEditor()){if(!t.defaultPrevented&&this.isDroppedDown)switch(t.keyCode){case wijmo_1.Key.Up:case wijmo_1.Key.Down:this.selectAll()}e.prototype._keydown.call(this,t)}};AutoComplete.prototype._input=function(e){this._handleDragTextState();this._updateComponentText();this._updateEmptyValueFlag();this._resetDragState()};AutoComplete.prototype._commitText=function(e){var t=this;if(e&&this._composing&&this.isDroppedDown&&!wijmo_1.isFirefox()&&!wijmo_1.isSafari()&&""==this._textIsComposing){this._isBlurInput=!0;this.isDroppedDown=!1;setTimeout((function(){t.onLostFocus()}),this.delay+1)}e&&!this._composing&&(wijmo_1.isFirefox()||wijmo_1.isSafari())&&wijmo_1.getActiveElement()==this.inputElement&&this.onLostFocus()};AutoComplete.prototype._setText=function(e){var t=this;if(this._isBlurInput&&0==this.text.length){this._tbx.value=e;this._isBlurInput=!1}this.trimText&&!this.containsFocus()&&"string"==typeof e&&(e=e.trim());if(this._composing&&e!=this._oldText){this._oldText=e;this.onTextChanged()}if(!(this._inCallback||this._settingText||(wijmo_1.isFirefox()||wijmo_1.isSafari())&&this._composing)){this._toSearch||(this._oldSelectedIndex=this.selectedIndex);if(this.selectedIndex>-1&&this._getDisplayText(void 0,void 0,!0)!=e){this._settingText=!0;this.selectedIndex=-1;this._settingText=!1}this._toSearch&&clearTimeout(this._toSearch);if(e!=this._oldText||e!=this.text){"string"!=typeof e&&(e="");var i=this._tbx,o=this._tbx.selectionStart;i.value!=e&&(i.value=e);this._isWheel&&this.containsFocus()&&this._updateInputSelection(o);this._oldText=e;this.onTextChanged();var n=this.collectionView;if(!e&&n){(this._query||this.selectedIndex<0)&&(this.isDroppedDown=!1);this._query=this._rxHighlight=null;n.filter=null;var s=this.itemsSourceFunction;if(wijmo_1.isFunction(s)){this.isDroppedDown=!1;s(this._query,this.maxItems,this._itemsSourceFnCallbackBnd)}if(this.isRequired&&!this.containsFocus()&&!Array.isArray(this._selItems)){var r=this._oldSelectedIndex>-1?this._oldSelectedIndex:0;this.selectedIndex=r}-1==this.selectedIndex&&-1!=this._oldSelectedIndex&&this.onSelectedIndexChanged();return}}if(e!=this._getDisplayText(void 0,void 0,!0)){if(!this.containsFocus()&&this.trimText)if(this.isRequired&&!this.text.trim().length){r=this._oldSelectedIndex>-1?this._oldSelectedIndex:0;this.selectedIndex=r}else this._tbx.value=this._tbx.value.trim();var a=!this.containsFocus()&&e.length<this.minLength;this.collectionView&&!this.containsFocus()&&(this.collectionView.filter=null);var l=this.indexOf(e,!0),h=this.indexOf(e,!1);if(a)return;if(!this.containsFocus()&&(!e||this.trimText&&!this.text.trim().length||null!=this.collectionView&&l<0&&h<0)&&this.isRequired&&!this.isEditable){(r=this._oldSelectedIndex>-1?this._oldSelectedIndex:wijmo_1.hasItems(this.collectionView)?0:-1)!=this.selectedIndex&&(this.selectedIndex=r)}else if((Array.isArray(this.itemsSource)||"function"==typeof this.itemsSourceFunction)&&!this.containsFocus()&&e&&l<0&&(h<0||h!=l)&&!this.isRequired&&!this.isEditable){this._tbx.value="";this.selectedIndex=-1;this.onSelectedIndexChanged()}else{var u=this._delay>0?setTimeout:function(e,t){return e()};this._pendingSearchFn=function(){t._toSearch=null;var i=t.text;if(!t._composing&&i.trim().length>=t._minLength&&i!=t._query){t._query=i.trim();i=wijmo_1.escapeRegExp(i);var o=wijmo_1.escapeHtml(i.trim()),n=t.caseSensitiveSearch?"":"i";t._beginsWith||(n+="g");t._rxSrch=t._beginsWith?new RegExp("^"+i+".*",n):new RegExp("(?=.*"+i.replace(/ /g,")(?=.*")+")",n);t._rxHighlight=t._beginsWith?new RegExp("^"+i,n):new RegExp("("+o.replace(/\s+/g,"|")+")",n);var s=t.itemsSourceFunction;wijmo_1.isFunction(s)?s(t._query,t.maxItems,t._itemsSourceFnCallbackBnd):t._updateItems()}!e.trim().length&&!t.isEditable&&t.indexOf(e,!0)<0&&(t.selectedIndex=-1);-1==t.selectedIndex&&-1!=t._oldSelectedIndex&&t.onSelectedIndexChanged()};this._toSearch=u(this._pendingSearchFn,this._delay)}}else""===this._tbx.value&&e&&(this._tbx.value=e)}};AutoComplete.prototype.onLostFocus=function(t){var i=!1;if(this.isRequired&&!this.isEditable&&this.text&&this.text.length>=this.minLength){i=!0;var o=this.indexOf(this.text,!0);o<0&&(o=this.indexOf(this.text,!1));o>-1&&(this._oldSelectedIndex=o);o<0&&(this._oldSelectedIndex=0)}if(this._toSearch){clearTimeout(this._toSearch);this.text!==this._getDisplayText(void 0,void 0,!0)&&this._pendingSearchFn&&this._pendingSearchFn();i=!1}var n=this.collectionView;if(n&&0===n.items.length){this._oldFilter=n.filter;n.filter=null}e.prototype.onLostFocus.call(this,t,this._oldSelectedIndex,i)};AutoComplete.prototype.onGotFocus=function(t){this._toSearch||(this._oldSelectedIndex=this.selectedIndex);e.prototype.onGotFocus.call(this,t)};AutoComplete.prototype.reset=function(){this._oldSelectedIndex=-1};AutoComplete.prototype._itemSourceFunctionCallback=function(e){this._inCallback=!0;var t=wijmo_1.asCollectionView(e||[]);t.moveCurrentToPosition(-1);this.itemsSource=t;this._inCallback=!1;if(this.containsFocus()){var i=this._tbx,o=i.selectionStart,n=i.selectionEnd,s=this.collectionView;this.isDroppedDown=null!=s&&s.items.length>0;wijmo_1.setSelectionRange(i,o,n);this.refresh()}};AutoComplete.prototype.onIsDroppedDownChanged=function(t){e.prototype.onIsDroppedDownChanged.call(this,t);if(this.containsFocus()&&!this.isTouching){var i=this.collectionView;if(this.selectedIndex<0&&i){var o=i.items,n=this.text;1==o.length&&o[0]==n?this.selectedIndex=0:wijmo_1.setSelectionRange(this._tbx,n.length)}}this._query=""};AutoComplete.prototype._updateItems=function(){var e=this.collectionView;if(e){this._inCallback=!0;e.beginUpdate();this._itemCount=0;e.filter=this._filter.bind(this);e.moveCurrentToPosition(-1);e.endUpdate();this._inCallback=!1;var t=e.items.length,i=this._tbx,o=i.selectionStart,n=i.selectionEnd;this.text.trim()||(t=0);this.isDroppedDown=t>0&&this.containsFocus();t||this.isEditable||(this.selectedIndex=-1);if(1==t&&this.selectedIndex<0){var s=this._getItemText(e.items[0],!1),r=i.value;if(!this.caseSensitiveSearch){s=s.toLowerCase();r=r.toLowerCase()}(s==r||this.trimText&&s.trim()==r)&&(this.selectedIndex=0)}this.isDroppedDown&&wijmo_1.setSelectionRange(i,o,n);this.refresh()}};AutoComplete.prototype._filter=function(e){if(this._itemCount>=this._maxItems&&this._query)return!1;var t=[this._getItemText(e,!1)];this._srchProps&&this._srchProps.forEach((function(i){var o=e[i];null!=o&&t.push(o)}));this.isContentHtml&&(t=t.map((function(e){return e.replace(/(<[^>]*>|&[^;]*;)/g,"")})));for(var i=0;i<t.length;i++)if(this._rxSrch.test(t[i])){this._itemCount++;return!0}return!1};AutoComplete.prototype._getItemText=function(e,t){var i=e?e.toString():"",o=t&&this.headerPath?this._pathHdr:this._lbx._pathDisplay;o&&(i=null!=(i=o.getValue(e))?i.toString():"");return i};AutoComplete.prototype._formatListItem=function(e,t){var i=this;this._cssMatch&&this._rxHighlight&&this._query&&(t.item.innerHTML=t.item.innerHTML.replace(this._rxHighlight,(function(e,t,o,n){return i._enclosed(n,o,"<",">")||i._enclosed(n,o,"&",";")?e:'<spanclass="'+i._cssMatch+'">'+e+"</span>"})))};AutoComplete.prototype._enclosed=function(e,t,i,o){for(var n=t;n>=0&&e[n]!=o;n--)if(e[n]==i)for(var s=t;s<e.length&&e[s]!=i;s++)if(e[s]==o)return!0;return!1};AutoComplete.prototype._wheel=function(t){e.prototype._wheel.call(this,t)};AutoComplete.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.AutoComplete.ariaLabels.autoComplete};AutoComplete.prototype._hasCustomFormatItem=function(){return this.formatItem.getHandler.length>1};AutoComplete._ctrlTemplate="";return AutoComplete}(ComboBox);exports.AutoComplete=AutoComplete;wijmo_1._addCultureInfo("MultiAutoComplete",{ariaLabels:{multiAutoCompleteInput:"MultiAutoComplete Input",multiAutoComplete:"MultiAutoComplete",multiAutoCompleteHelperInput:"MultiAutoComplete Helper Input",remove:"Remove"}});var MultiAutoComplete=function(e){__extends(MultiAutoComplete,e);function MultiAutoComplete(t,i){var o=e.call(this,t)||this;o._maxSelItems=null;o._lastInputValue="";o._selPath=new wijmo_1.Binding(null);o._notAddItm=!1;o._inputElementAriaLabel=wijmo_1.culture.MultiAutoComplete.ariaLabels.multiAutoCompleteInput;o._helperInputElementAriaLabel=wijmo_1.culture.MultiAutoComplete.ariaLabels.multiAutoCompleteHelperInput;o._ariaLabelledby=null;o.selectedItemsChanged=new wijmo_1.Event;wijmo_1.addClass(o.hostElement,exports.MultiAutoCompleteClsNames.hostElement);o._wjTpl=o.hostElement.querySelector("."+wijmo_1.ControlClsNames.template);o._wjInput=o.hostElement.querySelector("."+exports.InputClsNames.input);o.showDropDownButton=!1;o._selItems=[];o.initialize(i);o.addEventListener(o.hostElement,"keyup",o._keyup.bind(o),!0);o.addEventListener(window,"resize",o._adjustInputWidth.bind(o));o.addEventListener(o._tbx,"focus",(function(){o._itemOff()}));o._addHelperInput();o._addScreenReaderHelper();o._initSeltems();o.listBox.itemsChanged.addHandler((function(){if(-1!==o.selectedIndex){var e=o.collectionView;(e&&("CollectionView"==e.constructor.name||"ODataVirtualCollectionView"==e.constructor.name)||e.virtualization)&&(o.selectedIndex=-1)}}));o._refreshHeader();o._updateTabIndex();o._updateInputAriaLabel();return o}Object.defineProperty(MultiAutoComplete,"controlTemplate",{get:function(){MultiAutoComplete._ctrlTemplate||(MultiAutoComplete._ctrlTemplate=AutoComplete.controlTemplate);return MultiAutoComplete._ctrlTemplate},set:function(e){MultiAutoComplete._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(MultiAutoComplete.prototype,"showDropDownButton",{set:function(e){this._showBtn=!1},enumerable:!0,configurable:!0});Object.defineProperty(MultiAutoComplete.prototype,"maxSelectedItems",{get:function(){return this._maxSelItems},set:function(e){if(this._maxSelItems!=e){this._maxSelItems=wijmo_1.asNumber(e,!0);this._updateMaxItems();this._refreshHeader();this._clearSelIndex()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiAutoComplete.prototype,"selectedMemberPath",{get:function(){return this._selPath.path},set:function(e){if((e=wijmo_1.asString(e))!==this.selectedMemberPath){this._selPath.path=e;this._initSeltems();this._refreshHeader();this.onSelectedItemsChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiAutoComplete.prototype,"selectedItems",{get:function(){return this._selItems},set:function(e){e=Array.from(new Set(e));var t=this._selItems===e;t||null==this._selItems||null==e||this._selItems.length!==e.length||(t=this._selItems.every((function(t,i){return t===e[i]})));this._selItems=wijmo_1.asArray(e);if(!t){if(this.selectedMemberPath&&""!==this.selectedMemberPath&&this._selItems)for(var i=0;i<this._selItems.length;i++){var o=this._selItems[i];this._setSelItem(o,!1)}this._updateMaxItems();this.onSelectedItemsChanged();this._refreshHeader();this._clearSelIndex()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiAutoComplete.prototype,"ariaLabelledBy",{get:function(){return this._ariaLabelledby},set:function(e){wijmo_1._setAriaLabelBy(this,this._tbx,e,this._updateInputAndListBoxAriaLabel.bind(this))},enumerable:!0,configurable:!0});MultiAutoComplete.prototype.onSelectedItemsChanged=function(e){this.selectedItemsChanged.raise(this,e)};MultiAutoComplete.prototype.onIsDroppedDownChanged=function(t){!this.isDroppedDown&&this.selectedIndex>-1&&!this._notAddItm&&this._addItem(!0);this._notAddItm=!1;e.prototype.onIsDroppedDownChanged.call(this,t)};MultiAutoComplete.prototype.refresh=function(t){void 0===t&&(t=!0);e.prototype.refresh.call(this,t);if(this.hostElement){this._initSeltems();this.isDroppedDown||this._refreshHeader()}};MultiAutoComplete.prototype._keydown=function(t){if(!this.isReadOnly){if(!t.defaultPrevented)switch(t.keyCode){case wijmo_1.Key.Back:this._lastInputValue=this._tbx.value;break;case wijmo_1.Key.Enter:this._itemOff();this._addItem(!0);wijmo_1.isIE()&&wijmo_1.setSelectionRange(this._tbx,this._tbx.textContent.length,this._tbx.textContent.length);break;case wijmo_1.Key.Tab:if(this.isDroppedDown){this._addItem(!1);this._tbx.value="";this._lbx.selectedIndex=-1;this.isDroppedDown=!1;this.containsFocus()||this.focus();t.preventDefault()}else this._updateFocus();break;case wijmo_1.Key.Space:if(""!==this._tbx.value)return;if(!this.isDroppedDown&&!this._tbx.disabled){this.isDroppedDown=!0;this._clearSelIndex()}break;case wijmo_1.Key.Escape:this.isDroppedDown&&(this._notAddItm=!0);break;case wijmo_1.Key.Left:this._itemOn(!this.rightToLeft);break;case wijmo_1.Key.Right:this._itemOn(!!this.rightToLeft);break;case wijmo_1.Key.Up:case wijmo_1.Key.Down:var i=wijmo_1.getActiveElement();if(t.altKey){if(this._tbx==i){this.isDroppedDown=!this.isDroppedDown;this.isDroppedDown||this._tbx.focus();t.preventDefault();return}}else if(this._tbx!==i)return;default:if(t.keyCode===wijmo_1.Key.Back||t.keyCode===wijmo_1.Key.Delete)return;this._itemOff();null!=this._maxSelItems&&this._selItems.length>=this._maxSelItems&&t.preventDefault()}this._tbx.disabled||e.prototype._keydown.call(this,t)}};MultiAutoComplete.prototype._updateState=function(){e.prototype._updateState.call(this);this._wjTpl&&(wijmo_1.hasClass(this.hostElement,wijmo_1.ControlStateClsNames.focused)||this._itemOff())};MultiAutoComplete.prototype._keyup=function(e){if(!this.isReadOnly&&!e.defaultPrevented)switch(e.keyCode){case wijmo_1.Key.Back:0===this._tbx.value.length&&0===this._lastInputValue.length&&this._delItem(!1);break;case wijmo_1.Key.Delete:this._delItem(!0)}};MultiAutoComplete.prototype._addHelperInput=function(){var e=document.createElement("input");e.type="text";e.tabIndex=-1;e.className=exports.MultiAutoCompleteClsNames.tokenHelper;e.readOnly=!0;wijmo_1.setAttribute(e,"aria-label",this._helperInputElementAriaLabel);wijmo_1.setAttribute(e,"role","textbox");this._wjTpl.insertBefore(e,this._wjInput);this._helperInput=e};MultiAutoComplete.prototype._addScreenReaderHelper=function(){var e=document.createElement("div");e.tabIndex=-1;e.className=exports.MultiAutoCompleteClsNames.screenReaderOnly;wijmo_1.setAttribute(e,"aria-live","polite");this._wjTpl.insertBefore(e,this._wjInput);this._screenReaderHelper=e};MultiAutoComplete.prototype._refreshHeader=function(){for(var e=this.hostElement.querySelectorAll("."+exports.MultiAutoCompleteClsNames.token),t=0;t<e.length;t++)this._wjTpl.removeChild(e[t]);var i=this.selectedItems;if(i&&0!==i.length){for(t=0;t<i.length;t++)this._insertToken(i[t]);this._wjInput.style.cssFloat=this.rightToLeft?"right":"left";this._adjustInputWidth()}else{this._wjInput.style.cssFloat=this.rightToLeft?"right":"left";this._adjustInputWidth()}};MultiAutoComplete.prototype._insertToken=function(e){var t=this._getItemText(e,!0);this.isContentHtml||(t=wijmo_1.escapeHtml(t));this._wjTpl.insertBefore(this._createItem(t),this._wjInput)};MultiAutoComplete.prototype._updateMaxItems=function(){null!=this._maxSelItems&&this._selItems&&this._selItems.length>this._maxSelItems&&(this._selItems=this._selItems.slice(0,this._maxSelItems))};MultiAutoComplete.prototype._updateFocus=function(){var e=this,t=this._wjTpl.querySelector("."+MultiAutoComplete._clsActive);if(t){wijmo_1.removeClass(t,MultiAutoComplete._clsActive);setTimeout((function(){e._tbx.focus()}))}else this._clearSelIndex()};MultiAutoComplete.prototype._addItem=function(e){if(this.selectedItems.indexOf(this.selectedItem)>-1)this._clearSelIndex();else if(this.selectedIndex>-1){this._updateSelItems(this.selectedItem,!0);this._refreshHeader();e&&this._clearSelIndex();this._disableInput(!0)}};MultiAutoComplete.prototype._delItem=function(e){var t,i,o=this._wjTpl.querySelector("."+MultiAutoComplete._clsActive),n=!1;if(!e||o){if(o){if((i=this._getItemIndex(o))>-1){t=this._selItems[i];n=!0}}else if(this._selItems.length>0){t=this._selItems[this._selItems.length-1];n=!0}var s=this._getItemText(t,!0),r=wijmo_1.culture.MultiAutoComplete.ariaLabels.remove;this._screenReaderHelper.textContent=r+" "+s;if(n){this._updateSelItems(t,!1);this._refreshHeader();this._clearSelIndex();this._disableInput(!1)}this._tbx.focus()}};MultiAutoComplete.prototype._updateSelItems=function(e,t){if(t){this._selItems&&0!==this._selItems.length||(this._selItems=[]);if(null!=this._maxSelItems&&this._selItems.length>=this._maxSelItems)return;this._selItems.push(e)}else{var i=this._selItems.indexOf(e);this._selItems.splice(i,1)}this._hasSelectedMemeberPath()&&this._setSelItem(e,t);this.onSelectedItemsChanged()};MultiAutoComplete.prototype._createItem=function(e){var t=this,i=document.createElement("div"),o=document.createElement("span"),n=document.createElement("span");i.appendChild(o);i.appendChild(n);i.id=wijmo_1.getSafeUniqueId(e);wijmo_1.setAttribute(i,"aria-label",e);wijmo_1.setAttribute(i,"role","button");i.className=exports.MultiAutoCompleteClsNames.token;o.className=exports.MultiAutoCompleteClsNames.tokenLabel;o.innerHTML=e;n.className=exports.MultiAutoCompleteClsNames.tokenClose;n.tabIndex=-1;n.innerHTML="×";i.style.cssFloat=this.rightToLeft?"right":"left";this.addEventListener(i,"click",(function(e){t._helperInput.focus();wijmo_1.setAttribute(t._helperInput,"aria-activedescendant",i.id);var o=t._wjTpl.querySelector("."+MultiAutoComplete._clsActive);o&&wijmo_1.removeClass(o,MultiAutoComplete._clsActive);wijmo_1.addClass(i,MultiAutoComplete._clsActive);e.stopPropagation();e.preventDefault()}));this.addEventListener(n,"click",(function(e){if(!t.isReadOnly){var o=t._getItemIndex(i);if(o>-1){var n=t._selItems[o];t._updateSelItems(n,!1)}t._wjTpl.removeChild(i);t._adjustInputWidth();t._disableInput(!1);t._tbx.focus();e.stopPropagation()}}));return i};MultiAutoComplete.prototype._itemOn=function(e){var t,i,o,n=wijmo_1.getActiveElement();if((this._tbx!=n||0===this._tbx.value.length)&&0!==(t=this._wjTpl.querySelectorAll("."+exports.MultiAutoCompleteClsNames.token)).length){i=this._wjTpl.querySelector("."+MultiAutoComplete._clsActive);o=this._getItemIndex(i);if(e){if(0===o)return;if(-1===o){wijmo_1.addClass(t[t.length-1],MultiAutoComplete._clsActive);this._helperInput.focus();wijmo_1.setAttribute(this._helperInput,"aria-activedescendant",t[t.length-1].id)}else{wijmo_1.removeClass(i,MultiAutoComplete._clsActive);wijmo_1.addClass(t[o-1],MultiAutoComplete._clsActive);this._helperInput.focus();wijmo_1.setAttribute(this._helperInput,"aria-activedescendant",t[o-1].id)}}else if(!e){if(-1===o)return;if(o!==t.length-1){wijmo_1.removeClass(i,MultiAutoComplete._clsActive);wijmo_1.addClass(t[o+1],MultiAutoComplete._clsActive);this._helperInput.focus();wijmo_1.setAttribute(this._helperInput,"aria-activedescendant",t[o+1].id)}else{wijmo_1.removeClass(i,MultiAutoComplete._clsActive);this._tbx.focus();wijmo_1.setAttribute(this._helperInput,"aria-activedescendant")}}}};MultiAutoComplete.prototype._itemOff=function(){var e=this._wjTpl.querySelector("."+MultiAutoComplete._clsActive);e&&wijmo_1.removeClass(e,MultiAutoComplete._clsActive)};MultiAutoComplete.prototype._initSeltems=function(){if(this.selectedMemberPath){this._selItems.splice(0,this._selItems.length);var e=this.collectionView;if(e)for(var t=0;t<e.sourceCollection.length;t++)this._getSelItem(t)&&this._selItems.push(e.sourceCollection[t])}};MultiAutoComplete.prototype._getSelItem=function(e){var t=this.collectionView,i=t?t.sourceCollection[e]:null;return!(!wijmo_1.isObject(i)||!this.selectedMemberPath)&&this._selPath.getValue(i)};MultiAutoComplete.prototype._setSelItem=function(e,t){this.itemsSource;wijmo_1.isObject(e)&&this._selPath.getValue(e)!=t&&this._selPath.setValue(e,t)};MultiAutoComplete.prototype._clearSelIndex=function(){this.selectedIndex=-1};MultiAutoComplete.prototype._hasSelectedMemeberPath=function(){return this.selectedMemberPath&&""!==this.selectedMemberPath};MultiAutoComplete.prototype._disableInput=function(e){if(null!=this._maxSelItems)if(this._selItems.length<this._maxSelItems){this._tbx.disabled=!1;this._tbx.focus()}else{this._tbx.disabled=!0;this.hostElement.focus()}};MultiAutoComplete.prototype._adjustInputWidth=function(){this._tbx.style.width="60px";var e,t=wijmo_1.getElementRect(this.hostElement),i=wijmo_1.getElementRect(this._tbx),o=getComputedStyle(this._tbx),n=parseInt(o.paddingLeft,10),s=parseInt(o.paddingRight,10);e=this.rightToLeft?i.left+i.width-t.left-n-s-8:t.left+t.width-i.left-n-s-8;this._tbx.style.width=e+"px";this._tbx.placeholder?this._tbx.style.minWidth="max-content":this._tbx.style.minWidth=""};MultiAutoComplete.prototype._getItemIndex=function(e){for(var t=this.hostElement.querySelectorAll("."+exports.MultiAutoCompleteClsNames.token),i=0;i<t.length;i++)if(e===t[i])return i;return-1};MultiAutoComplete.prototype._setIsDisabled=function(t){e.prototype._setIsDisabled.call(this,t);this._updateTabIndex()};MultiAutoComplete.prototype._setTabOrder=function(e){this._orgTabIndex=e;this._updateTabIndex()};MultiAutoComplete.prototype._updateTabIndex=function(){var e=this.hostElement;this._tbx.tabIndex=this.isDisabled?-1:this._orgTabIndex;e.tabIndex=-1};MultiAutoComplete._clsActive=exports.MultiAutoCompleteClsNames.tokenActive;MultiAutoComplete._ctrlTemplate="";return MultiAutoComplete}(AutoComplete);exports.MultiAutoComplete=MultiAutoComplete;wijmo_1._registerModule("wijmo.input",selfModule);
|
|
14
|
+
"use strict";var __extends=this&&this.__extends||function(){var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};return function(e,t){extendStatics(e,t);function __(){this.constructor=e}e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}}(),__assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++){t=arguments[i];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)},__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.hasOwnProperty.call(e,i)&&(t[i]=e[i]);t.default=e;return t};Object.defineProperty(exports,"__esModule",{value:!0});var wijmo_1=require("@mescius/wijmo"),selfModule=__importStar(require("@mescius/wijmo.input"));exports.AutoCompleteClsNames={hostElement:"wj-autocomplete"};exports.CalendarClsNames={buttonsOutside:"wj-btns-outside",calendarHeader:"wj-calendar-header",calendarMonth:"wj-calendar-month",calendarMultiMonth:"wj-calendar-multimonth",calendarOuter:"wj-calendar-outer",calendarYear:"wj-calendar-year",dayOtherMonth:"wj-day-othermonth",dayToday:"wj-day-today",dayWeekend:"wj-day-weekend",header:"wj-header",hostElement:"wj-calendar",monthSelect:"wj-month-select",weekAfter:"wj-week-after",weekBefore:"wj-week-before",yearPicker:"wj-yearpicker",focused:"wj-state-focus",selectedYear:"wj-select-year",confirmationButtonContainer:"wj-calendar-confirmation-button-container",button:"wj-calendar-button"};exports.CollectionViewNavigatorClsNames={hostElement:"wj-collectionview-navigator",pager:"wj-pager"};exports.ColorPickerClsNames={colorBox:"wj-colorbox",hostElement:"wj-colorpicker"};exports.ComboBoxClsNames={hostElement:"wj-combobox",stateMatch:"wj-state-match"};exports.DropDownClsNames={dropDownPanel:"wj-dropdown-panel",hostElement:"wj-dropdown"};exports.InputClsNames={input:"wj-input",inputBtnVisible:"wj-input-btn-visible",inputGroup:"wj-input-group",inputGroupBtn:"wj-input-group-btn"};exports.InputColorClsNames={hostElement:"wj-inputcolor",inputColorBox:"wj-inputcolorbox"};exports.InputDateClsNames={hostElement:"wj-inputdate",inputDateDropDown:"wj-inputdate-dropdown",inputDateDropDownContainer:"wj-inputdate-dropdown-container"};exports.InputDateRangeClsNames={hostElement:"wj-inputdaterange"};exports.InputDateTimeClsNames={hostElement:"wj-inputdatetime",showDropDownButton:"wj-show-dropdown-button"};exports.InputMaskClsNames={hostElement:"wj-inputmask"};exports.InputNumberClsNames={hostElement:"wj-inputnumber",numeric:"wj-numeric",showSpinner:"wj-input-show-spinner"};exports.InputTimeClsNames={hostElement:"wj-inputtime"};exports.ListBoxClsNames={header:"wj-header",hostElement:"wj-listbox",listBoxItem:"wj-listbox-item"};exports.MenuClsNames={hostElement:"wj-menu",menuItems:"wj-menu-items",subItems:"wj-subitems"};exports.MultiAutoCompleteClsNames={hostElement:"wj-multi-autocomplete",token:"wj-token",tokenActive:"wj-token-active",tokenClose:"wj-token-close",tokenHelper:"wj-token-helper",tokenLabel:"wj-token-label",screenReaderOnly:"wj-sr-only"};exports.MultiSelectClsNames={hostElement:"wj-multiselect"};exports.MultiSelectListBoxClsNames={header:"wj-header",hostElement:"wj-multiselectlistbox",selectAll:"wj-select-all"};exports.PopupClsNames={dialogHeader:"wj-dialog-header",hostElement:"wj-popup",popupBackDrop:"wj-popup-backdrop",dialogBody:"wj-dialog-body",dialogFooter:"wj-dialog-footer"};wijmo_1._addCultureInfo("InputNumber",{ariaLabels:{incVal:"Increase Value",decVal:"Decrease Value",inputNumberInput:"InputNumber Input",inputNumber:"Input Number"}});var InputNumber=function(e){__extends(InputNumber,e);function InputNumber(t,i){var o=e.call(this,t)||this;o._value=null;o._min=null;o._max=null;o._format="";o._step=null;o._showBtn=!0;o._readOnly=!1;o._handleWheel=!0;o._oldText="";o._fromKb=!0;o._inputElementAriaLabel=wijmo_1.culture.InputNumber.ariaLabels.inputNumberInput;o._ariaLabelledby=null;o.textChanged=new wijmo_1.Event;o.valueChanged=new wijmo_1.Event;var n=o.getTemplate();o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.InputNumberClsNames.hostElement,n,{_tbx:"input",_btnUp:"btn-inc",_btnDn:"btn-dec"},"input");var s=o.inputElement;o.hostElement;wijmo_1.setAttribute(s,"role","spinbutton",!0);o._updateInputAriaLabel();var r=wijmo_1.culture.InputNumber.ariaLabels;wijmo_1.setAriaLabel(o._btnUp.querySelector("button"),r.incVal);wijmo_1.setAriaLabel(o._btnDn.querySelector("button"),r.decVal);o._tbx.type.match(/number/i)&&(o.inputType="");var a=o._tbx;a.autocomplete="off";a.spellcheck=!1;o._updateSymbols();var l=o.addEventListener.bind(o);l(a,"keypress",o._keypress.bind(o));l(a,"keydown",o._keydown.bind(o));l(a,"input",o._input.bind(o));wijmo_1.isMobile()&&l(a,"beforeinput",o._beforeinput.bind(o));l(a,"blur",(function(){o.text!=o._oldText&&o._setText(o.text)}));l(a,"paste",(function(){o._fromKb=!1}));l(a,"compositionstart",(function(){o._composing=!0}));l(a,"compositionend",(function(){o._composing=!1;setTimeout((function(){var e=o.text,t=o._oldText,i=o._chrPct;t&&t.indexOf(i)>-1&&e.indexOf(i)<0&&(e+=i);o._setText(e)}))}));var h=o._clickSpinner.bind(o);l(o._btnUp,"click",h);l(o._btnDn,"click",h);o._rptUp=new wijmo_1._ClickRepeater(o._btnUp.querySelector("button"));o._rptDn=new wijmo_1._ClickRepeater(o._btnDn.querySelector("button"));l(a,"wheel",(function(e){if(o.handleWheel&&!e.defaultPrevented&&!e.ctrlKey&&o._isEditable()&&o.containsFocus()){var t=wijmo_1.clamp(-e.deltaY,-1,1);o._increment((o.step||1)*t);setTimeout((function(){return o.selectAll()}));e.preventDefault()}}));o.value=0;o.isRequired=!0;o.initialize(i);return o}Object.defineProperty(InputNumber,"controlTemplate",{get:function(){InputNumber._ctrlTemplate||(InputNumber._ctrlTemplate='<div class="'+wijmo_1.ControlClsNames.template+'"><div class="'+exports.InputClsNames.input+'"><div class="'+exports.InputClsNames.inputGroup+'"><span wj-part="btn-dec" class="'+exports.InputClsNames.inputGroupBtn+'" tabindex="-1"><button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1">-</button></span><input type="tel" wj-part="input" class="'+wijmo_1.InputFormElementsClsNames.formControl+" "+exports.InputNumberClsNames.numeric+'"/><span wj-part="btn-inc" class="'+exports.InputClsNames.inputGroupBtn+'" tabindex="-1"><button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1">+</button></span></div></div></div>');return InputNumber._ctrlTemplate},set:function(e){InputNumber._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"inputElement",{get:function(){return this._tbx},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"inputType",{get:function(){return this._tbx.type},set:function(e){this._tbx.type=wijmo_1.asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"value",{get:function(){return this._value},set:function(e){if(e!=this._value)if(null==(e=wijmo_1.asNumber(e,!this.isRequired||null==e&&null==this._value)))this._setText("");else if(!isNaN(e)){var t=wijmo_1.Globalize.format(e,this.format);this._setText(t)}},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"isRequired",{get:function(){return this._tbx.required},set:function(e){this._tbx.required=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"isReadOnly",{get:function(){return this._readOnly},set:function(e){this._readOnly=wijmo_1.asBoolean(e);this.inputElement.readOnly=this._readOnly;wijmo_1.toggleClass(this.hostElement,wijmo_1.ControlStateClsNames.readOnly,this.isReadOnly)},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"handleWheel",{get:function(){return this._handleWheel},set:function(e){this._handleWheel=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"min",{get:function(){return this._min},set:function(e){if(e!=this._min){this._min=wijmo_1.asNumber(e,!0);this._updateAria()}},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"max",{get:function(){return this._max},set:function(e){if(e!=this._max){this._max=wijmo_1.asNumber(e,!0);this._updateAria()}},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"step",{get:function(){return this._step},set:function(e){this._step=wijmo_1.asNumber(e,!0);this._updateBtn()},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"format",{get:function(){return this._format},set:function(e){if(e!=this.format){this._format=wijmo_1.asString(e);this.refresh()}},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"text",{get:function(){return this._tbx.value},set:function(e){if(e!=this.text){this._oldText=this.text;this._setText(e)}},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"placeholder",{get:function(){return this._tbx.placeholder},set:function(e){this._tbx.placeholder=e},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"showSpinner",{get:function(){return this._showBtn},set:function(e){this._showBtn=wijmo_1.asBoolean(e);this._updateBtn()},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"repeatButtons",{get:function(){return!this._rptUp.disabled},set:function(e){this._rptUp.disabled=this._rptDn.disabled=!wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"ariaLabelledBy",{get:function(){return this._ariaLabelledby},set:function(e){wijmo_1._setAriaLabelBy(this,this._tbx,e,this._updateInputAriaLabel.bind(this))},enumerable:!0,configurable:!0});InputNumber.prototype.selectAll=function(){var e=this._tbx;wijmo_1.setSelectionRange(e,0,e.value.length)};InputNumber.prototype.clamp=function(e){return wijmo_1.clamp(e,this.min,this.max)};InputNumber.prototype.onTextChanged=function(e){this.textChanged.raise(this,e);this._updateState()};InputNumber.prototype.onValueChanged=function(e){this._updateAria();this.valueChanged.raise(this,e)};InputNumber.prototype.dispose=function(){this._rptUp.element=null;this._rptDn.element=null;e.prototype.dispose.call(this)};InputNumber.prototype.onGotFocus=function(t){this._oldValue=this.value;if(!this.isTouching){this._tbx.focus();this.selectAll()}e.prototype.onGotFocus.call(this,t)};InputNumber.prototype.onLostFocus=function(t){if(this._composing){this._composing=!1;this._setText(this.text)}if(this._isEditable()){var i=this.clamp(this.value);if(i==this.value||this.onInvalidInput(new wijmo_1.CancelEventArgs)){var o=wijmo_1.Globalize.format(i,this.format);this._setText(o)}}e.prototype.onLostFocus.call(this,t)};InputNumber.prototype.refresh=function(t){void 0===t&&(t=!0);e.prototype.refresh.call(this,t);if(this.hostElement){this._updateSymbols();var i=wijmo_1.Globalize.format(this.value,this.format);this._setText(i)}};InputNumber.prototype._isEditable=function(){return!this.isReadOnly&&!this.isDisabled};InputNumber.prototype._updateSymbols=function(){var e=wijmo_1.culture.Globalize.numberFormat,t=wijmo_1.Globalize._parseNumericFormat(this.format);this._chrDec=e["."]||".";this._chrTho=e[","]||",";this._chrNeg=e["-"]||"-";this._chrPls=e["+"]||"+";this._chrPct=e["%"]||"%";this._chrCur=t.curr||e.currency.symbol||"$";this._fmtSpc=t.spec;this._fmtPrc=t.prec;this._rxSym=new RegExp("^[%+\\-() \\"+this._chrDec+"\\"+this._chrCur+"\\"+this._chrNeg+"\\"+this._chrPls+"\\"+this._chrPct+"]*$");this._rxNeg=new RegExp("^\\s*(\\-|\\"+this._chrNeg+")|([^e](\\-|\\"+this._chrNeg+")|\\()")};InputNumber.prototype._isNumeric=function(e,t){var i=e==this._chrDec||e>="0"&&e<="9",o="x"==this._fmtSpc;!i&&o&&(i=e>="a"&&e<="f"||e>="A"&&e<="F");i||t||o||(i=e==this._chrPls||e==this._chrNeg||"("==e||")"==e);return i};InputNumber.prototype._getInputRange=function(e){for(var t=[0,0],i=this.text,o=!1,n=0;n<i.length;n++)if(this._isNumeric(i[n],e)){if(!o){t[0]=n;o=!0}t[1]=n+1}return t};InputNumber.prototype._flipSign=function(){var e=this._getSelStartDigits();this.value*=-1;this._setSelStartDigits(e)};InputNumber.prototype._getSelStartDigits=function(){for(var e=0,t=this._tbx.selectionStart,i=this._tbx.value,o=0;o<i.length&&o<t;o++)this._isNumeric(i[o],!0)&&e++;return e};InputNumber.prototype._setSelStartDigits=function(e){for(var t=this._tbx.value,i=0;i<t.length&&e>=0;i++)if(this._isNumeric(t[i],!0)){if(!e){wijmo_1.setSelectionRange(this._tbx,i);break}e--}else if(!e){wijmo_1.setSelectionRange(this._tbx,i);break}};InputNumber.prototype._increment=function(e){if(e){var t=this.clamp(wijmo_1.isNumber(this.value)?this.value+e:0),i=wijmo_1.Globalize.format(t,this.format,!1,!1);this._setText(i)}};InputNumber.prototype._updateBtn=function(){var e=this.showSpinner&&!!this.step,t=e;wijmo_1.setCss([this._btnUp,this._btnDn],{display:e?"":"none"});wijmo_1.toggleClass(this.hostElement,exports.InputNumberClsNames.showSpinner,e);wijmo_1.enable(this._btnUp,t);wijmo_1.enable(this._btnDn,t);this._updateAria()};InputNumber.prototype._setText=function(e,t,i){void 0===t&&(t=!1);void 0===i&&(i=!1);if(!this._composing){var o=this._tbx,n=this._chrDec,s=this._rxNeg.test(e),r=this._delKey,a=this.containsFocus();e&&this._rxSym.test(e)&&a&&(e=this.isRequired||!r?(s?"-0":"0")+(e.indexOf(n)>-1?n:""):"");this._delKey=!1;r&&0==this.value&&!this.isRequired&&(e="");if(!e){if(!this.isRequired||i){o.value="";if(this._oldText){this._oldText=e;this.onTextChanged()}if(null!=this._value){this._value=null;this.onValueChanged()}this._updateBtn();return}e="0"}var l=e.indexOf(n),h=this._format||(l>-1?"n2":"n0"),u=wijmo_1.Globalize.parseFloat(e,h);isFinite(u)||(u=this.clamp(u));if(isNaN(u))if(this.onInvalidInput(new wijmo_1.CancelEventArgs))o.value=this._oldText;else{o.value=e;this.focus()}else{var c=a&&l>-1?2:null,p=wijmo_1.Globalize.format(u,h,!1,t,c);s&&u>=0&&!r&&(p=this._chrNeg+p);a&&l>-1&&"g"==this._fmtSpc&&0!=this._fmtPrc&&(p=e).indexOf(n)<0&&(p+=n);if(o.value!=p){o.value=p;u=wijmo_1.Globalize.parseFloat(p,h)}if(this.text!=this._oldText){this._oldText=this.text;this.onTextChanged()}if(u!=this._value){this._value=u;this.onValueChanged()}this._updateBtn();this._updateState()}}};InputNumber.prototype._handleDecimalInput=function(e){if(0===this._fmtPrc){e.preventDefault();return!0}var t=this._tbx,i=t.value.indexOf(this._chrDec);if(i>-1){e.preventDefault();var o=t.selectionStart<=i?i+1:i;wijmo_1.setSelectionRange(t,o);return!0}return!1};InputNumber.prototype._beforeinput=function(e){if(!e.defaultPrevented&&!this._composing&&this._isEditable()){switch(e.data){case".":case this._chrDec:this._handleDecimalInput(e);return;case"+":case this._chrPls:this._handlePlusSign();e.preventDefault();return;case"-":case this._chrNeg:this._handleMinusSign();e.preventDefault();return}}};InputNumber.prototype._keypress=function(e){if(!e.defaultPrevented&&!this._composing&&this._isEditable()&&e.charCode&&!e.ctrlKey&&!e.metaKey&&e.keyCode!=wijmo_1.Key.Enter){var t=this._tbx,i=String.fromCharCode(e.charCode);if(this._isNumeric(i,!1)){var o=t.maxLength;if(o>-1&&t.value.length>=o&&t.selectionEnd==t.selectionStart){e.preventDefault();return}var n=this._getInputRange(!0),s=t.selectionStart,r=t.selectionEnd;if(s<n[0]&&r<t.value.length){r=Math.max(r,n[0]);wijmo_1.setSelectionRange(t,n[0],r)}if(s>=n[1]){var a=null!=this._fmtPrc?this._fmtPrc:2,l=t.value.indexOf(this._chrDec);l>-1&&s-l>a&&e.preventDefault()}}else e.preventDefault();switch(i){case"-":case this._chrNeg:this._handleMinusSign();e.preventDefault();break;case"+":case this._chrPls:this._handlePlusSign();e.preventDefault();break;case".":case this._chrDec:this._handleDecimalInput(e)}if(!e.defaultPrevented&&wijmo_1.isIE()){var h=t.value;if((s=t.selectionStart)==(r=t.selectionEnd)){t.value=h.substr(0,s)+i+h.substr(r);wijmo_1.setSelectionRange(t,s+1);e.preventDefault();this._input()}}}};InputNumber.prototype._handlePlusSign=function(){var e=this._tbx;(this.value<0||this._rxNeg.test(e.value))&&this._flipSign()};InputNumber.prototype._handleMinusSign=function(){var e=this._tbx;if(this.clamp(-1)>=0)this.value<0&&this._flipSign();else if(this.value&&e.selectionStart===e.selectionEnd)this._flipSign();else if(this.clamp(-1)<0){e.value=this._chrNeg;wijmo_1.setSelectionRange(e,1)}};InputNumber.prototype._keydown=function(e){var t=this;this._delKey=!1;if(!e.defaultPrevented&&!this._composing){var i=wijmo_1.hasClass(this._tbx,"wj-grid-ime");if(!i||e.keyCode==wijmo_1.Key.Back||e.keyCode==wijmo_1.Key.Delete){var o=this._tbx,n=o.value,s=o.selectionStart,r=o.selectionEnd;switch(e.keyCode){case 65:if(e.ctrlKey){setTimeout((function(){t.selectAll()}));e.preventDefault()}break;case wijmo_1.Key.Up:case wijmo_1.Key.Down:if(this.step&&this._isEditable()){this._increment(this.step*(e.keyCode==wijmo_1.Key.Up?1:-1));setTimeout((function(){t.selectAll()}));e.preventDefault()}break;case wijmo_1.Key.Back:this._delKey=!0;if(r-s<2&&this._isEditable()){var a=n[r-1];if(a==this._chrDec||a==this._chrPct||a==this._chrTho||")"==a){setTimeout((function(){r=a==t._chrPct?t._getInputRange(!0)[1]:r-1;wijmo_1.setSelectionRange(o,r)}));e.preventDefault()}}break;case wijmo_1.Key.Delete:this._delKey=!0;if(r-s<2&&this._isEditable())if("0"==n&&1==s)wijmo_1.setSelectionRange(o,0);else{var l=n[s];if(l==this._chrDec||l==this._chrPct){setTimeout((function(){wijmo_1.setSelectionRange(o,s+1)}));e.preventDefault()}}break;case wijmo_1.Key.Escape:this.value=this._oldValue;this.selectAll()}i&&this._delKey&&this._isEditable()&&this._setText(null,!1,!0)}}};InputNumber.prototype._input=function(){var e=this;this._composing?this._fromKb=!0:setTimeout((function(){var t=e._tbx,i=t.value,o=i.indexOf(e._chrDec),n=t.selectionStart,s=e._getSelStartDigits();"p"==e._fmtSpc&&i.length&&i.indexOf(e._chrPct)<0&&(i+=e._chrPct);e._setText(i,e._fromKb);e._fromKb=!0;if(e.containsFocus()){var r=t.value,a=r.indexOf(e._chrDec),l=e._getInputRange(!0);if(i==e._chrNeg+e._chrDec&&a>-1){wijmo_1.setSelectionRange(t,a+1);return}if(i[0]==e._chrNeg&&r[0]!=e._chrNeg){if(1==r.length)wijmo_1.setSelectionRange(t,1);else{"c"===e._fmtSpc&&e._isNegativeCurrencyByParenthesis(i)&&(s-=1);e._setSelStartDigits(s)}return}i?i==e._chrDec&&a>-1?n=a+1:n<=o&&a>-1||o<0&&a<0?n+=r.length-i.length:o<0&&a>-1&&(n=a):n=a>-1?a:l[1];n=wijmo_1.clamp(n,l[0],l[1]);wijmo_1.setSelectionRange(t,n)}}))};InputNumber.prototype._isNegativeCurrencyByParenthesis=function(e){return e.length>1&&e[1]===this._chrCur};InputNumber.prototype._clickSpinner=function(e){var t=this;if(!e.defaultPrevented&&this._isEditable()&&this.step){this._increment(this.step*(wijmo_1.contains(this._btnUp,e.target)?1:-1));if(!this.isTouching){wijmo_1.Control.sharedState.InvalidScroll=wijmo_1.isEdge();setTimeout((function(){return t.selectAll()}))}}};InputNumber.prototype._updateAria=function(){var e=this.inputElement;if(this.hostElement){wijmo_1.setAttribute(e,"aria-valuemin",this.min);wijmo_1.setAttribute(e,"aria-valuemax",this.max);wijmo_1.setAttribute(e,"aria-valuenow",this.value);wijmo_1.setAttribute(e,"aria-valuetext",this.text);wijmo_1.setAttribute(e,"step",this.step);wijmo_1.enable(this._btnDn,null==this.min||this.value>this.min);wijmo_1.enable(this._btnUp,null==this.max||this.value<this.max)}};InputNumber.prototype._updateInputAriaLabel=function(){var e=this.inputElement;this._ariaLabelledby?wijmo_1.setAttribute(e,"aria-label",null):wijmo_1.setAttribute(e,"aria-label",this._inputElementAriaLabel)};InputNumber.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.InputNumber.ariaLabels.inputNumber};InputNumber._ctrlTemplate="";return InputNumber}(wijmo_1.Control);exports.InputNumber=InputNumber;wijmo_1._addCultureInfo("InputMask",{ariaLabels:{inputMaskInput:"InputMask Input",inputMask:"Input Mask"}});var ColorPickerTabKeyAction,InputMask=function(e){__extends(InputMask,e);function InputMask(t,i){var o=e.call(this,t)||this;o._fullEdit=!1;o._inputElementAriaLabel=wijmo_1.culture.InputMask.ariaLabels.inputMaskInput;o._ariaLabelledby=null;o.valueChanged=new wijmo_1.Event;var n=o.getTemplate();o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.InputMaskClsNames.hostElement,n,{_tbx:"input"},"input");if("INPUT"==o._orgTag){var s=o._tbx.getAttribute("value");s&&(o.value=s)}o._msk=new wijmo_1._MaskProvider(o._tbx);o.isRequired=!0;o.initialize(i);o.addEventListener(o._tbx,"input",(function(){o.onValueChanged()}));o.addEventListener(o._tbx,"blur",o._commitText.bind(o));o.addEventListener(o._tbx,"keydown",(function(e){e.keyCode==wijmo_1.Key.Enter&&o._commitText()}));o._updateInputAriaLabel();return o}Object.defineProperty(InputMask,"controlTemplate",{get:function(){InputMask._ctrlTemplate||(InputMask._ctrlTemplate='<div class="'+exports.InputClsNames.input+'"><div class="'+exports.InputClsNames.inputGroup+'"><input wj-part="input" class="'+wijmo_1.InputFormElementsClsNames.formControl+'"/></div></div>');return InputMask._ctrlTemplate},set:function(e){InputMask._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"inputElement",{get:function(){return this._tbx},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"inputType",{get:function(){return this._tbx.type},set:function(e){this._tbx.type=wijmo_1.asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"value",{get:function(){return this._tbx.value},set:function(e){if(e!=this.value){this._tbx.value=wijmo_1.asString(e);e=this._msk._applyMask();this._tbx.value=e;this.onValueChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"rawValue",{get:function(){return this._msk.getRawValue()},set:function(e){e!=this.rawValue&&(this.value=wijmo_1.asString(e))},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"mask",{get:function(){return this._msk.mask||""},set:function(e){var t=this.value;this._msk.mask=wijmo_1.asString(e);this.value!=t&&this.onValueChanged()},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"promptChar",{get:function(){return this._msk.promptChar},set:function(e){var t=this.value;this._msk.promptChar=e;this.value!=t&&this.onValueChanged()},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"overwriteMode",{get:function(){return this._msk.overwriteMode},set:function(e){this._msk.overwriteMode=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"placeholder",{get:function(){return this._tbx.placeholder},set:function(e){this._tbx.placeholder=e},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"maskFull",{get:function(){return this._msk.maskFull},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"isRequired",{get:function(){return this._tbx.required},set:function(e){this._tbx.required=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"isReadOnly",{get:function(){return this._tbx.readOnly},set:function(e){this._tbx.readOnly=wijmo_1.asBoolean(e);wijmo_1.toggleClass(this.hostElement,wijmo_1.ControlStateClsNames.readOnly,this.isReadOnly)},enumerable:!0,configurable:!0});InputMask.prototype.selectAll=function(){var e=this._msk.getMaskRange();wijmo_1.setSelectionRange(this._tbx,e[0],e[1]+1)};InputMask.prototype.onValueChanged=function(e){if(this.value!=this._oldValue){this._oldValue=this.value;this.valueChanged.raise(this,e)}this._updateState()};InputMask.prototype._commitText=function(){(this.rawValue||this.isRequired)&&(this.maskFull||this.onInvalidInput(new wijmo_1.CancelEventArgs));this._updateState()};InputMask.prototype.dispose=function(){this._msk.input=null;e.prototype.dispose.call(this)};InputMask.prototype.refresh=function(t){void 0===t&&(t=!0);e.prototype.refresh.call(this,t);this.hostElement&&this._msk.refresh()};InputMask.prototype.onGotFocus=function(t){this.selectAll();e.prototype.onGotFocus.call(this,t)};Object.defineProperty(InputMask.prototype,"ariaLabelledBy",{get:function(){return this._ariaLabelledby},set:function(e){wijmo_1._setAriaLabelBy(this,this._tbx,e,this._updateInputAriaLabel.bind(this))},enumerable:!0,configurable:!0});InputMask.prototype._updateInputAriaLabel=function(){var e=this.inputElement;!e||e.id||this._ariaLabelledby?wijmo_1.setAttribute(e,"aria-label",null):wijmo_1.setAttribute(e,"aria-label",this._inputElementAriaLabel)};InputMask.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.InputMask.ariaLabels.inputMask};InputMask._ctrlTemplate="";return InputMask}(wijmo_1.Control);exports.InputMask=InputMask;wijmo_1._addCultureInfo("ColorPicker",{ariaLabels:{colorPicker:"Color Picker",satAndBrightnessPanel:"Color saturation and brightness panel",huePanel:"Color hue panel",opacityPanel:"Color opacity panel",palettePanel:"Color palette panel",saturation:"Saturation:",hue:"Hue:",opacity:"Opacity:",degrees:"degrees",brightness:"Brightness:",baseColor:"Base color:",shadeColor:"Shade color:"}});!function(e){e[e.None=0]="None";e[e.All=1]="All"}(ColorPickerTabKeyAction=exports.ColorPickerTabKeyAction||(exports.ColorPickerTabKeyAction={}));var ColorPicker=function(e){__extends(ColorPicker,e);function ColorPicker(t,i){var o=e.call(this,t)||this;o._hsb=[.5,1,1];o._alpha=1;o._ariaLabel=wijmo_1.culture.ColorPicker.ariaLabels.colorPicker;o.valueChanged=new wijmo_1.Event;o.hostElement.setAttribute("role","application");o.hostElement.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.colorPicker);var n=o.getTemplate();o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.ColorPickerClsNames.hostElement,n,{_eSB:"div-sb",_eHue:"div-hue",_eAlpha:"div-alpha",_ePreview:"div-pv",_ePal:"div-pal",_eText:"div-text"});o._palette="#FFF,#000,#F00,#FFC000,#FFFF00,#92D050,#00B050,#00B0F0,#0070C0,#7030A0".split(",");o._updatePalette();o._eHue.style.backgroundImage="url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAD4CAIAAACi6hsPAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuM4zml1AAAAGvSURBVDhPXdBPaM9xHMfxz4pWaxcmtoOhpdXSVpiyHWxqmVpDjaU5rK34XfypjTJ/p+ZPay6jhsOsRrKwaJElf9IQq03WIkv4FeMwMq221tfje1ByeFzfvd7PEKWGEKWTQRZLySWfVRRTQjmVbKWGOhLsZT+HaeY0bbTTQSfdXOcWffTzmAFeMcwoYyT5ygS/mA5hNgphip98J8kHRnnNSwZ4yH1uc4OrdHGR87RximYO0cgedlLLdqqoYAPrWMtKVrCcJSxiPmnMJUQp/Bsyk2xyyKOAQooopYwKtlDNDur5G7SBJo7RQiv/B+2hl3s84CkvGGKEOOYnxolj/mYmhBmDJ5ngCx95xxsGecYj4pB3iENeoZMO2mmlhaMcpIE4ZII6aqhmM3HMMkooopB88sghm0wySCeVlCjMCVFIYx4LWUwOeRSwhmLWU84mqqihll3sppEmjnOSs5zjEl1c4yZ99POE5wwxwns+840fTDFLFKaZZIJxkozxlmEGGSC+GF++Sy89dHOZC8Rr4lVnOMERDrCPBPXEX22jko2UEn+/mnxyWUYWC0gnNUQh/AEc0HJs6cex0gAAAABJRU5ErkJggg==)";o._eHue.style.backgroundSize="contain";if(navigator.appVersion.indexOf("MSIE 9")>-1){o._eSB.children[0].style.filter="progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffffff,endColorstr=#00ffffff,GradientType=1)";o._eSB.children[1].style.filter="progid:DXImageTransform.Microsoft.gradient(startColorstr=#00000000,endColorstr=#ff000000,GradientType=0)"}n=ColorPicker._tplCursor;o._cSB=wijmo_1.createElement(n);o._cHue=wijmo_1.createElement(n);o._cHue.style.width="100%";o._cAlpha=wijmo_1.createElement(n);o._cAlpha.style.height="100%";o._eSB.appendChild(o._cSB);o._eHue.appendChild(o._cHue);o._eAlpha.appendChild(o._cAlpha);o._keyActionTab=ColorPickerTabKeyAction.None;var s=o.addEventListener.bind(o),r=o.removeEventListener.bind(o),a=document;s(o.hostElement,"mousedown",(function(e){s(a,"mousemove",mouseMove);s(a,"mouseup",mouseUp);o._mouseDown(e)}));s(o.hostElement,"touchstart",(function(e){s(a,"touchmove",mouseMove);s(a,"touchend",mouseUp);o._mouseDown(e)}));var mouseMove=function(e){o._mouseMove(e)},mouseUp=function(e){r(a,"mousemove",mouseMove);r(a,"mouseup",mouseUp);r(a,"touchmove",mouseMove);r(a,"touchend",mouseUp);o._mouseUp(e)};s(o.hostElement,"click",(function(e){if(!o.isDisabled){var t=e.target;if(t&&"DIV"==t.tagName&&wijmo_1.contains(o._ePal,t)){var i=t.style.backgroundColor;i&&(o.value=new wijmo_1.Color(i).toString());t.focus()}}}));s(o.hostElement,"keydown",(function(e){o.isDisabled||o._keydown(e)}));o.value="#ffffff";o.initialize(i);o._updatePanels();o._eSB.setAttribute("role","slider");o._eSB.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.satAndBrightnessPanel);o._eSB.setAttribute("aria-valuemin","0");o._eSB.setAttribute("aria-valuemax","100");o._eHue.setAttribute("role","slider");o._eHue.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.huePanel);o._eHue.setAttribute("aria-valuemin","0");o._eHue.setAttribute("aria-valuemax","360");o._eAlpha.setAttribute("role","slider");o._eAlpha.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.opacityPanel);o._eAlpha.setAttribute("aria-valuemin","0");o._eAlpha.setAttribute("aria-valuemax","100");o._ePal.setAttribute("role","grid");o._ePal.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.palettePanel);o._updateTabIndex();return o}Object.defineProperty(ColorPicker,"controlTemplate",{get:function(){ColorPicker._ctrlTemplate||(ColorPicker._ctrlTemplate='<div style="position:relative;width:100%;height:100%"><div style="float:left;width:50%;height:100%;box-sizing:border-box;padding:2px"><div wj-part="div-pal"><div style="float:left;width:10%;box-sizing:border-box;padding:2px"><div style="background-color:black;width:100%"></div><div style="height:6px"></div></div></div><div wj-part="div-text" style="position:absolute;bottom:0px;display:none"></div></div><div style="float:left;width:50%;height:100%;box-sizing:border-box;padding:2px"><div wj-part="div-sb" class="'+exports.ColorPickerClsNames.colorBox+'" style="float:left;width:89%;height:89%"><div style="position:absolute;width:100%;height:100%;background:linear-gradient(to right, white 0%,transparent 100%)"></div><div style="position:absolute;width:100%;height:100%;background:linear-gradient(to top, black 0%,transparent 100%)"></div></div><div style="float:left;width:1%;height:89%"></div><div style="float:left;width:10%;height:89%"><div wj-part="div-hue" class="'+exports.ColorPickerClsNames.colorBox+'"></div></div><div style="float:left;width:89%;height:1%"></div><div style="float:left;width:89%;height:10%"><div style="width:100%;height:100%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuM4zml1AAAAAcSURBVBhXY/iPBBYgAWpKQGkwgMqDAdUk/v8HAM7Mm6GatDUYAAAAAElFTkSuQmCC)"><div wj-part="div-alpha" class="'+exports.ColorPickerClsNames.colorBox+'"></div></div></div><div style="float:left;width:1%;height:10%"></div><div style="float:left;width:10%;height:10%"><div wj-part="div-pv" class="'+exports.ColorPickerClsNames.colorBox+'" style="position:static"></div></div></div></div>');return ColorPicker._ctrlTemplate},set:function(e){ColorPicker._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(ColorPicker.prototype,"showAlphaChannel",{get:function(){return"none"!=this._eAlpha.parentElement.style.display},set:function(e){this._eAlpha.parentElement.style.display=wijmo_1.asBoolean(e)?"":"none"},enumerable:!0,configurable:!0});Object.defineProperty(ColorPicker.prototype,"showColorString",{get:function(){return"none"!=this._eText.style.display},set:function(e){this._eText.style.display=wijmo_1.asBoolean(e)?"":"none";if(wijmo_1.asBoolean(e)){this._eText.setAttribute("role","status");this._eText.setAttribute("aria-live","polite")}},enumerable:!0,configurable:!0});Object.defineProperty(ColorPicker.prototype,"value",{get:function(){return this._value},set:function(e){if(e!=this.value){var t=this.value,i=(e=wijmo_1.asString(e)).trim(),o=wijmo_1.Color.fromString(i);if(o){var n=o.getHsb();this._value=i;this._eText.innerText=i;if(this._hsb[0]!=n[0]||this._hsb[1]!=n[1]||this._hsb[2]!=n[2]||this._alpha!=o.a){if(0==n[2]){n[0]=this._hsb[0];n[1]=this._hsb[1]}else 0==n[1]&&(n[0]=this._hsb[0]);this._hsb=n;this._alpha=o.a;this.onValueChanged()}else""===t&&this.onValueChanged()}else if(""===i){var s=new wijmo_1.Color(e);this._hsb=s.getHsb();this._alpha=s.a;this._value=e;this._eText.innerText=i;this.onValueChanged()}}},enumerable:!0,configurable:!0});Object.defineProperty(ColorPicker.prototype,"palette",{get:function(){return this._palette},set:function(e){if((e=(e=wijmo_1.asArray(e)).slice(0,10)).every((function(e){return null!=wijmo_1.Color.fromString(e)}))){this._palette=e;this._updatePalette()}},enumerable:!0,configurable:!0});Object.defineProperty(ColorPicker.prototype,"ariaLabel",{get:function(){return this._ariaLabel},set:function(e){if(e!=this._ariaLabel){this._ariaLabel=e;wijmo_1.setAttribute(this.hostElement,"aria-label",this._ariaLabel)}},enumerable:!0,configurable:!0});Object.defineProperty(ColorPicker.prototype,"keyActionTab",{get:function(){return this._keyActionTab},set:function(e){this._keyActionTab=e;if(e==ColorPickerTabKeyAction.All){this.tabOrder=0;this.hostElement.setAttribute("tabindex","-1")}this._updateTabIndex()},enumerable:!0,configurable:!0});ColorPicker.prototype._setTabOrder=function(t){e.prototype._setTabOrder.call(this,t);this.isDisabled||this._updateTabIndex()};ColorPicker.prototype.onValueChanged=function(e){this._refreshSelection();this.valueChanged.raise(this,e)};ColorPicker.prototype._mouseDown=function(e){this._htDown=this._getTargetPanel(e);if(this._htDown){e.preventDefault();this._htDown.focus();this._mouseMove(e)}};ColorPicker.prototype._mouseMove=function(e){if(!this.isDisabled){var t=e.touches?e.touches[0]:e,i=this._htDown;if(i){var o=i.getBoundingClientRect(),n=this._hsb.slice(),s=this._alpha;if(i==this._eHue)n[0]=wijmo_1.clamp((t.clientY-o.top)/o.height,0,.99);else if(i==this._eSB){n[1]=wijmo_1.clamp((t.clientX-o.left)/o.width,0,1);n[2]=wijmo_1.clamp(1-(t.clientY-o.top)/o.height,0,1)}else i==this._eAlpha&&(s=wijmo_1.clamp((t.clientX-o.left)/o.width,0,1));this._updateColor(n,s)}}};ColorPicker.prototype._mouseUp=function(e){this._htDown=null};ColorPicker.prototype._updateColor=function(e,t){void 0===e&&(e=this._hsb);void 0===t&&(t=this._alpha);var i=this._hsb[0]!==e[0]||this._hsb[1]!==e[1]||this._hsb[2]!==e[2],o=this._alpha!==t;if(i||o){this._hsb=e;this._alpha=t;var n=wijmo_1.Color.fromHsb(e[0],e[1],e[2],t);this._value=n.toString();this._eText.innerText=this._value;this.onValueChanged()}};ColorPicker.prototype._updatePalette=function(){var e=this,t=new wijmo_1.Color("#fff"),i=new wijmo_1.Color("#000");this._ePal.innerHTML="";this._ePal.className="palette-grid";for(var o=Array.from({length:6},(function(){var e=document.createElement("div");e.className="palette-row";e.setAttribute("role","row");return e})),n=this.getActualTabIndex(),s=0;s<this._palette.length;s++){var r=new wijmo_1.Color(this._palette[s]),a=r.getHsb(),l=this._makePalEntry(r);l.innerHTML="​";l.setAttribute("role","columnheader");l.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.baseColor+" "+r.toString());if(0===s){this._ePalMainFirst=l;this._ePalMainFirst.setAttribute("tabindex",n)}else l.setAttribute("tabindex","-1");o[0].appendChild(l);for(var h=0;h<5;h++){var u=0===a[1]?wijmo_1.Color.interpolate(t,i,.1*h+(a[2]>.5?.05:.55)):wijmo_1.Color.fromHsb(a[0],.1+.2*h,1-.1*h),c=this._makePalEntry(u);c.setAttribute("role","gridcell");c.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.shadeColor+" "+u.toString());if(0===s&&0===h){this._ePalShadeFirst=c;this._ePalShadeFirst.setAttribute("tabindex",n)}else wijmo_1.setAttribute(c,"tabindex","-1");o[h+1].appendChild(c)}}o.forEach((function(t){e._ePal.appendChild(t)}))};ColorPicker.prototype._makePalEntry=function(e){var t=document.createElement("div");t.className="palette-gridcell";wijmo_1.setCss(t,{backgroundColor:e.toString()});return t};ColorPicker.prototype._updatePanels=function(){var e=wijmo_1.Color.fromHsb(this._hsb[0],1,1,1),t=wijmo_1.Color.fromHsb(this._hsb[0],this._hsb[1],this._hsb[2],1);this._eSB.style.backgroundColor=e.toString();this._eAlpha.style.background="linear-gradient(to right, transparent 0%, "+t.toString()+" 100%)";navigator.appVersion.indexOf("MSIE 9")>-1&&(this._eAlpha.style.filter="progid:DXImageTransform.Microsoft.gradient(startColorstr=#00000000,endColorstr="+t.toString()+", GradientType = 1)");var i=this.value.trim();this._ePreview.style.backgroundColor=i;this._cHue.style.top=(100*this._hsb[0]).toFixed(0)+"%";this._cSB.style.left=(100*this._hsb[1]).toFixed(0)+"%";this._cSB.style.top=(100-100*this._hsb[2]).toFixed(0)+"%";this._cAlpha.style.left=(100*this._alpha).toFixed(0)+"%";var o=this.getColorsDiv(),n=wijmo_1.getActiveElement();if(this.keyActionTab===ColorPickerTabKeyAction.All&&!this.hostElement.contains(n)){if(this.isDisabled)return;for(var s=!1,r=0;r<o.length;r++){var a=o[r].style.backgroundColor;if(wijmo_1.Color.fromString(i).equals(wijmo_1.Color.fromString(a))){o[r].focus();s=!0;break}}s||o[0].focus()}};ColorPicker.prototype.getColorsDiv=function(){var e=Array.from(this._ePal.querySelectorAll('[role="columnheader"]')),t=Array.from(this._ePal.querySelectorAll('[role="gridcell"]'));return e.concat(t)};ColorPicker.prototype._getTargetPanel=function(e){var t=e.target;return wijmo_1.contains(this._eSB,t)?this._eSB:wijmo_1.contains(this._eHue,t)?this._eHue:wijmo_1.contains(this._eAlpha,t)?this._eAlpha:null};ColorPicker.prototype.getActualTabIndex=function(){var e=this.tabOrder.toString();return this.keyActionTab===ColorPickerTabKeyAction.All&&!0!==this.isDisabled?e:"-1"};ColorPicker.prototype._updateTabIndex=function(){var e=this.getActualTabIndex();this._eSB.setAttribute("tabindex",e);this._eHue.setAttribute("tabindex",e);this._eAlpha.setAttribute("tabindex",e);this._ePalMainFirst.setAttribute("tabindex",e);this._ePalShadeFirst.setAttribute("tabindex",e)};ColorPicker.prototype._setIsDisabled=function(t){e.prototype._setIsDisabled.call(this,t);this._updateTabIndex()};ColorPicker.prototype._updateAriaValues=function(){var e=this._hsb;this._eSB.setAttribute("aria-valuenow",(100*e[1]).toString());this._eSB.setAttribute("aria-valuetext",wijmo_1.culture.ColorPicker.ariaLabels.saturation+" "+Math.round(100*e[1])+"%, "+wijmo_1.culture.ColorPicker.ariaLabels.brightness+" "+Math.round(100*e[2])+"%");this._eHue.setAttribute("aria-valuenow",(360*e[0]).toString());this._eHue.setAttribute("aria-valuetext",wijmo_1.culture.ColorPicker.ariaLabels.hue+" "+Math.round(360*e[0])+" "+wijmo_1.culture.ColorPicker.ariaLabels.degrees);this._eAlpha.setAttribute("aria-valuenow",(100*this._alpha).toString());this._eAlpha.setAttribute("aria-valuetext",wijmo_1.culture.ColorPicker.ariaLabels.opacity+" "+Math.round(100*this._alpha)+"%")};ColorPicker.prototype._keydown=function(e){var t=e.target;this._isInColorPalette(t)?this._handleColorNavigation(e,t):t!==this._eSB?t!==this._eHue?t!==this._eAlpha||this._handleAlphaNavigation(e):this._handleHSBNavigation(e,"hue"):this._handleHSBNavigation(e,"sb")};ColorPicker.prototype._isInColorPalette=function(e){return e&&"DIV"===e.tagName&&wijmo_1.contains(this._ePal,e)};ColorPicker.prototype._handleColorNavigation=function(e,t){var i=this.getColorsDiv(),o=this.palette.length,n=i.findIndex((function(e){return e===t})),s=null;switch(e.key){case"ArrowDown":n<i.length-1&&(s=i[n+o]);break;case"ArrowUp":n>0&&(s=i[n-o]);break;case"ArrowRight":var r=n+1;r<i.length&&(s=i[r]);break;case"ArrowLeft":var a=n-1;a>=0&&(s=i[a])}if(s){var l=s.style.backgroundColor;l&&(this.value=new wijmo_1.Color(l).toString());s.focus();e.preventDefault()}};ColorPicker.prototype._handleHSBNavigation=function(e,t){var i=this._hsb.slice();i=i.map((function(e){return wijmo_1.roundTo(e,2)}));var adjust=function(e,t,o){var n=Math.round(100*i[e]);i[e]=wijmo_1.clamp((n+t)/100,0,o)};switch(e.key){case"ArrowLeft":"sb"===t&&adjust(1,-1,1);break;case"ArrowRight":"sb"===t&&adjust(1,1,1);break;case"ArrowUp":"sb"===t?adjust(2,1,1):adjust(0,-1,.99);break;case"ArrowDown":"sb"===t?adjust(2,-1,1):adjust(0,1,.99)}if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(e.key)){this._updateColor(i,void 0);e.preventDefault()}};ColorPicker.prototype._refreshSelection=function(){this._updatePanels();this._updateAriaValues()};ColorPicker.prototype._handleAlphaNavigation=function(e){var t=this._alpha;switch(e.key){case"ArrowLeft":t=wijmo_1.clamp(t-.01,0,1);break;case"ArrowRight":t=wijmo_1.clamp(t+.01,0,1);break;default:return}this._updateColor(void 0,t);e.preventDefault()};ColorPicker._ctrlTemplate="";ColorPicker._tplCursor='<div class="wj-colorpicker-cursor"></div>';return ColorPicker}(wijmo_1.Control);exports.ColorPicker=ColorPicker;wijmo_1._addCultureInfo("CollectionViewNavigator",{ariaLabels:{byPage:{btnFirst:"Navigate to first page",btnPrev:"Navigate to previous page",btnNext:"Navigate to next page",btnLast:"Navigate to last page"},byItem:{btnFirst:"Navigate to first item",btnPrev:"Navigate to previous item",btnNext:"Navigate to next item",btnLast:"Navigate to last item"}}});var CollectionViewNavigator=function(e){__extends(CollectionViewNavigator,e);function CollectionViewNavigator(t,i){var o=e.call(this,t)||this;o._view=null;o._byPage=!1;o._fmt="{current:n0} / {count:n0}";o._liveRegionON=!1;o._ariaLabel="";var n=o.getTemplate();o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.CollectionViewNavigatorClsNames.pager+" "+exports.CollectionViewNavigatorClsNames.hostElement,n,{_btnFirst:"btn-first",_btnPrev:"btn-prev",_txtCurr:"txt-curr",_btnNext:"btn-next",_btnLast:"btn-last"},"input");o.hostElement.tabIndex=-1;o._updateAriaLabels();var s=wijmo_1.uidGenerator();o._txtCurr.id=s;[o._btnFirst,o._btnPrev,o._btnNext,o._btnLast].forEach((function(e){wijmo_1.setAttribute(e.firstElementChild,"aria-controls",o._txtCurr.id)}));wijmo_1.setAttribute(o.hostElement.firstElementChild,"role","group");wijmo_1.setAttribute(o._txtCurr,"role","status");o._rptNext=new wijmo_1._ClickRepeater(o._btnNext.querySelector("button"));o._rptPrev=new wijmo_1._ClickRepeater(o._btnPrev.querySelector("button"));o.addEventListener(o.hostElement,"click",o._click.bind(o));o.addEventListener(o.hostElement,"keydown",o._keydown.bind(o));wijmo_1.setAttribute(o.hostElement,"role","navigation");o._addA11yRelatedHandlers();o.initialize(i);o._update();return o}Object.defineProperty(CollectionViewNavigator,"controlTemplate",{get:function(){CollectionViewNavigator._ctrlTemplate||(CollectionViewNavigator._ctrlTemplate='<div class="'+exports.InputClsNames.inputGroup+'"><span wj-part="btn-first" class="'+exports.InputClsNames.inputGroupBtn+'"><button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'"><span class="'+wijmo_1.GlyphClsNames.stepBackward+'"></span></button></span><span wj-part="btn-prev" class="'+exports.InputClsNames.inputGroupBtn+'"> <button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'"><span class="'+wijmo_1.GlyphClsNames.left+'"></span> </button></span><span wj-part="txt-curr" tabIndex="0"></span><span wj-part="btn-next" class="'+exports.InputClsNames.inputGroupBtn+'"><button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'"><span class="'+wijmo_1.GlyphClsNames.right+'"></span></button></span><span wj-part="btn-last" class="'+exports.InputClsNames.inputGroupBtn+'"><button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'"><span class="'+wijmo_1.GlyphClsNames.stepForward+'"></span></button></span></div>');return CollectionViewNavigator._ctrlTemplate},set:function(e){CollectionViewNavigator._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewNavigator.prototype,"cv",{get:function(){return this._view},set:function(e){if(e!=this._view){var t=this._view;if(t){t.collectionChanged.removeHandler(this._collectionChanged);t.currentChanged.removeHandler(this._currentChanged)}t=this._view=wijmo_1.asType(e,"ICollectionView",!0);this._update();if(t){t.collectionChanged.addHandler(this._collectionChanged,this);t.currentChanged.addHandler(this._currentChanged,this)}}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewNavigator.prototype,"byPage",{get:function(){return this._byPage},set:function(e){if(e!=this._byPage){this._byPage=wijmo_1.asBoolean(e);this._update();this._updateAriaLabels()}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewNavigator.prototype,"headerFormat",{get:function(){return this._fmt},set:function(e){if(e!=this._fmt){this._fmt=wijmo_1.asString(e);this._update()}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewNavigator.prototype,"repeatButtons",{get:function(){return!this._rptNext.disabled},set:function(e){this._rptNext.disabled=this._rptPrev.disabled=!wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewNavigator.prototype,"ariaLabel",{get:function(){if(this.hostElement){var e=this.hostElement.getAttribute("aria-label");if(e)return e}return this._ariaLabel},set:function(e){if(this.ariaLabel!==e){this._ariaLabel=e;this.hostElement&&wijmo_1.setAttribute(this.hostElement,"aria-label",e)}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewNavigator.prototype,"isDisabled",{get:function(){return this._isDisabled},set:function(e){this._setIsDisabled(e)},enumerable:!0,configurable:!0});CollectionViewNavigator.prototype.focus=function(){var e=this._e;e&&e.offsetHeight&&(this.isDisabled||wijmo_1.moveFocus(e,0)||this._txtCurr.tabIndex>=0&&this._txtCurr.focus())};CollectionViewNavigator.prototype._update=function(){var e=this._view,t=this._byPage,i=e?t?e.pageIndex:e.currentPosition:0,o=e?t?e.pageCount:e.itemCount:0;if(this.isDisabled)[this._btnFirst,this._btnPrev,this._btnNext,this._btnLast].forEach((function(e){wijmo_1.enable(e,!1)}));else{wijmo_1.enable(this._btnFirst,e&&i>0);wijmo_1.enable(this._btnPrev,e&&i>0);wijmo_1.enable(this._txtCurr,null!=e);wijmo_1.enable(this._btnNext,e&&i<o-1);wijmo_1.enable(this._btnLast,e&&i<o-1)}this._updateTabIndex();this._txtCurr.textContent=wijmo_1.format(this._fmt,{current:e?i+1:0,count:e?o:0,currentItem:e?e.currentPosition+1:0,itemCount:e?e.itemCount:0,currentPage:e?e.pageIndex+1:0,pageCount:e?e.pageCount:0})};CollectionViewNavigator.prototype._currentChanged=function(){this._update()};CollectionViewNavigator.prototype._collectionChanged=function(){this._update()};CollectionViewNavigator.prototype._click=function(e){var t=e.target,i=this._view,o=this._byPage;if(i){wijmo_1.contains(this._btnFirst,t)?o?i.moveToFirstPage():i.moveCurrentToFirst():wijmo_1.contains(this._btnPrev,t)?o?i.moveToPreviousPage():i.moveCurrentToPrevious():wijmo_1.contains(this._btnNext,t)?o?i.moveToNextPage():i.moveCurrentToNext():wijmo_1.contains(this._btnLast,t)&&(o?i.moveToLastPage():i.moveCurrentToLast());(this.byPage?i.pageIndex>=i.pageCount-1||i.pageIndex<=0:i.currentPosition>=i.itemCount-1||i.currentPosition<=0)&&!this.isDisabled&&this._txtCurr.tabIndex>=0&&this._txtCurr.focus();e.preventDefault()}};CollectionViewNavigator.prototype._updateAriaLabels=function(){var e=wijmo_1.culture.CollectionViewNavigator.ariaLabels[this._byPage?"byPage":"byItem"];wijmo_1.setAttribute(this._btnFirst.firstElementChild,"aria-label",e.btnFirst);wijmo_1.setAttribute(this._btnPrev.firstElementChild,"aria-label",e.btnPrev);wijmo_1.setAttribute(this._btnNext.firstElementChild,"aria-label",e.btnNext);wijmo_1.setAttribute(this._btnLast.firstElementChild,"aria-label",e.btnLast)};CollectionViewNavigator.prototype._addA11yRelatedHandlers=function(){var e=this;this.addEventListener(this._txtCurr,"focus",(function(t){if(e._txtCurr===document.activeElement){wijmo_1.setAttribute(e._txtCurr,"aria-live","off");wijmo_1.setAttribute(e._txtCurr,"aria-label",e._txtCurr.textContent);e._liveRegionON=!1}}));this.addEventListener(this._txtCurr,"blur",(function(t){e._txtCurr!==document.activeElement&&e._txtCurr.removeAttribute("aria-label")}));[this._btnFirst.firstElementChild,this._btnPrev.firstElementChild,this._btnNext.firstElementChild,this._btnLast.firstElementChild].forEach((function(t){e.addEventListener(t,"focus",(function(t){setTimeout((function(){if(!e._liveRegionON){var t=wijmo_1._isMacOS()?"polite":"assertive";wijmo_1.setAttribute(e._txtCurr,"aria-live",t);e._liveRegionON=!0}}))}))}))};CollectionViewNavigator.prototype._setTabOrder=function(e){var t=this._e,i=null!=this._txtCurr.getAttribute("disabled");this._orgTabIndex=e;if(this.isDisabled||i){t.tabIndex=-1;this._txtCurr.tabIndex=-1}else i||(this._txtCurr.tabIndex=this._orgTabIndex)};CollectionViewNavigator.prototype._keydown=function(e){if(wijmo_1.contains(this._txtCurr,e.target)&&(e.ctrlKey||e.metaKey)&&("A"===e.key||"a"===e.key)){e.preventDefault();var t=document.createRange();t.selectNodeContents(this._txtCurr);var i=window.getSelection();i.removeAllRanges();i.addRange(t)}};CollectionViewNavigator.prototype._setIsDisabled=function(e){if((e=!!wijmo_1.asBoolean(e,!0))!=this.isDisabled){var t=this._e;if(t){this._isDisabled=e;wijmo_1.toggleClass(t,wijmo_1.ControlStateClsNames.disabled,e);this._update();this._txtCurr.tabIndex=e?-1:this._orgTabIndex}}};CollectionViewNavigator.prototype._updateTabIndex=function(){var e=this;[this._btnFirst,this._btnPrev,this._btnNext,this._btnLast].forEach((function(t){if(e._isDisabled)t.firstElementChild.setAttribute("tabindex","-1");else{t.firstElementChild.disabled?t.firstElementChild.setAttribute("tabindex","-1"):t.firstElementChild.setAttribute("tabindex",e._orgTabIndex.toString())}}))};CollectionViewNavigator._ctrlTemplate="";return CollectionViewNavigator}(wijmo_1.Control);exports.CollectionViewNavigator=CollectionViewNavigator;wijmo_1._addCultureInfo("Listbox",{ariaLabels:{listBox:"list box"}});var ListBox=function(e){__extends(ListBox,e);function ListBox(t,i){var o=e.call(this,t,null,!0)||this;o._cv=null;o._itemFormatter=null;o._pathDisplay=new wijmo_1.Binding("");o._pathValue=new wijmo_1.Binding("");o._pathChecked=new wijmo_1.Binding("");o._html=!1;o._shGroups=!1;o._checkedItems=[];o._itemRole="option";o._caseSensitive=!1;o._addMode=!1;o._isShiftDown=!1;o._shouldClearOnShift=!0;o._vThreshold=ListBox._VTHRESH;o._isVirtual=!1;o._children=[];o._ignoreItemFormatterTextArray=[];o._itemFormatterHelper=document.createElement("div");o._clientHeight=-1;o._itemHeight=30;o._itemsAbove=-1;o._itemsBelow=-1;o._eSizer=document.createElement("div");o._ePadTop=document.createElement("div");o._ePadBot=document.createElement("div");o._checking=!1;o._ignoredItemChangedEvents=!1;o._search="";o._fmtItemHandlers=0;o._itemCount=0;o._oldSel=null;o._container=null;o._oldSelectedIndex=-1;o._ariaLabel=wijmo_1.culture.Listbox.ariaLabels.listBox;o._isNeedUpdateBnd=!0;o.selectedIndexChanged=new wijmo_1.Event;o.itemsChanged=new wijmo_1.Event;o.loadingItems=new wijmo_1.Event;o.loadedItems=new wijmo_1.Event;o.itemChecked=new wijmo_1.Event;o.checkedItemsChanged=new wijmo_1.Event;o.formatItem=new wijmo_1.Event((function(){o.invalidate()}));o._handleKeyUp=function(e){if("Shift"===e.key){o._isShiftDown=!1;o._shouldClearOnShift=!0}};o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.ListBoxClsNames.hostElement,null,null);var n=o.hostElement;wijmo_1.setAttribute(n,"role","listbox",!0);o._updateAriaLabel();"SELECT"==o._orgTag&&o._initFromSelect(o.hostElement);o.addEventListener(n,"click",o._click.bind(o));o.addEventListener(n,"keydown",o._keydown.bind(o));o.addEventListener(n,"keypress",o._keypress.bind(o));o.addEventListener(n,"keyup",o._handleKeyUp.bind(o));o.addEventListener(n,"wheel",(function(e){if(n.scrollHeight>n.offsetHeight&&(e.deltaY<0&&0==n.scrollTop||e.deltaY>0&&n.scrollTop+n.offsetHeight>=n.scrollHeight)){e.preventDefault();e.stopPropagation();e.stopImmediatePropagation()}}));[o._eSizer,o._ePadTop,o._ePadBot].forEach((function(e){e.tabIndex=-1;wijmo_1.setAttribute(e,"aria-hidden",!0);wijmo_1.setCss(e,{pointerEvents:"none",opacity:"0"})}));o.initialize(i);o._updateViewRange();o.addEventListener(o.hostElement,"scroll",(function(e){o._updateViewRange()}));return o}Object.defineProperty(ListBox.prototype,"ariaLabelledBy",{get:function(){return this.hostElement.getAttribute("aria-labelledby")},set:function(e){wijmo_1._setAriaLabelBy(this,this.hostElement,e,this._updateAriaLabel.bind(this))},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"itemsSource",{get:function(){return this._items},set:function(e){if(this._items!=e){if(this._cv){this._cv.currentChanged.removeHandler(this._cvCurrentChanged,this);this._cv.collectionChanged.removeHandler(this._cvCollectionChanged,this);this._cv=null}this._items=e;this._cv=wijmo_1.asCollectionView(e);if(null!=this._cv){this._cv.currentChanged.addHandler(this._cvCurrentChanged,this);this._cv.collectionChanged.addHandler(this._cvCollectionChanged,this)}this._populateList();this.onItemsChanged();this.onSelectedIndexChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"collectionView",{get:function(){return this._cv},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"virtualizationThreshold",{get:function(){return this._vThreshold},set:function(e){if(e!=this._vThreshold){var t=this._getVirtual();this._vThreshold=wijmo_1.asNumber(e,!1,!0);t!=this._getVirtual()&&this._populateList()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"showGroups",{get:function(){return this._shGroups},set:function(e){if(e!=this._shGroups){this._shGroups=wijmo_1.asBoolean(e);this._populateList()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"isContentHtml",{get:function(){return this._html},set:function(e){if(e!=this._html){this._html=wijmo_1.asBoolean(e);this._populateList()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"itemFormatter",{get:function(){return this._itemFormatter},set:function(e){if(e!=this._itemFormatter){this._itemFormatter=wijmo_1.asFunction(e);this._populateList()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"displayMemberPath",{get:function(){return this._pathDisplay.path},set:function(e){if(e!=this.displayMemberPath){this._pathDisplay.path=wijmo_1.asString(e);this._populateList()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"selectedValuePath",{get:function(){return this._pathValue.path},set:function(e){this._pathValue.path=wijmo_1.asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"checkedMemberPath",{get:function(){return this._pathChecked.path},set:function(e){if(e!=this.checkedMemberPath){this._pathChecked.path=wijmo_1.asString(e);wijmo_1.setAttribute(this.hostElement,"aria-multiselectable",""!==this.checkedMemberPath?"true":"false");this._populateList()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"caseSensitiveSearch",{get:function(){return this._caseSensitive},set:function(e){this._caseSensitive=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"itemRole",{get:function(){return this._itemRole},set:function(e){if(e!=this.itemRole){this._itemRole=wijmo_1.asString(e);this._populateList()}},enumerable:!0,configurable:!0});ListBox.prototype.getDisplayValue=function(e,t){var i=null;if(e>-1&&wijmo_1.hasItems(this._cv)){i=this._cv.items[e];this.displayMemberPath&&(i=this._pathDisplay.getValue(i))}var o=null!=i?i.toString():"";this._itemFormatter&&!t&&(o=this._itemFormatter(e,o));return o};ListBox.prototype.getDisplayText=function(e){return this._getDisplayText(e)};ListBox.prototype._getDisplayText=function(e,t){if(t&&this._ignoreItemFormatterTextArray[e])return this._ignoreItemFormatterTextArray[e];var i=this._getChild(e);return null!=i?i.textContent:""};ListBox.prototype.isItemEnabled=function(e){var t=this._getChild(e);return null!=t&&!t.hasAttribute("disabled")&&!wijmo_1.hasClass(t,wijmo_1.ControlStateClsNames.disabled)&&!wijmo_1.hasClass(t,wijmo_1.UtilitesClsNames.separator)};Object.defineProperty(ListBox.prototype,"selectedIndex",{get:function(){return this._cv?this._cv.currentPosition:-1},set:function(e){if(this._cv){this._oldSelectedIndex=this._cv.currentPosition;this._cv.moveCurrentToPosition(wijmo_1.asNumber(e))}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"selectedItem",{get:function(){return this._cv?this._cv.currentItem:null},set:function(e){this._cv&&this._cv.moveCurrentTo(e)},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"selectedValue",{get:function(){var e=this.selectedItem;e&&this.selectedValuePath&&(e=this._pathValue.getValue(e));return e},set:function(e){var t=this._cv,i=t?t.items:null,o=this.selectedValuePath,n=-1;if(i){for(var s=0;s<i.length;s++){var r=i[s],a=o?this._pathValue.getValue(r):r;if(a===e||wijmo_1.DateTime.equals(a,e)){n=s;break}if(this.isContentHtml&&wijmo_1.isString(a)&&a.indexOf("<")>-1&&wijmo_1.toPlainText(a)===e){n=s;break}}this.selectedIndex=n}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"maxHeight",{get:function(){var e=this.hostElement,t=e?parseFloat(e.style.maxHeight):null;return isNaN(t)?null:t},set:function(e){var t=this.hostElement;if(t){e=wijmo_1.asNumber(e,!0);t.style.maxHeight=null==e?"":e+"px"}},enumerable:!0,configurable:!0});ListBox.prototype.showSelection=function(e){void 0===e&&(e=this.containsFocus());var t=this.hostElement,i=this._children,o=this._getSelectedElement(!1),n=new wijmo_1.Rect(0,0,0,0);if(o!=this._oldSel){this._updateItemAttributes(o,!0);this._updateItemAttributes(this._oldSel,!1);this._oldSel=o}o instanceof HTMLElement?n=this._getBoundingClientRect(o):this._children.length>0&&(n=this._getBoundingClientRect(this._getChild(0)));var s=this._getBoundingClientRect(t),r=0;if(this._shGroups){r=this._itemHeight;if(!this._isVirtual){var a=i[0];a&&a.offsetHeight&&wijmo_1.hasClass(a,exports.ListBoxClsNames.header)&&(r=a.offsetHeight)}}n.bottom>s.bottom?t.scrollTop+=n.bottom-s.bottom:n.top<s.top+r&&(t.scrollTop-=s.top+r-n.top);this._updateViewRange();o=this._getSelectedElement(!0);wijmo_1.setAttribute(t,"aria-activedescendant",o?o.id:null);if(e){(o&&!wijmo_1.contains(o,wijmo_1.getActiveElement())?o:t).focus()}t.tabIndex=o?-1:this._orgTabIndex};ListBox.prototype.loadList=function(){this._populateList()};ListBox.prototype.getItemChecked=function(e){var t=this._cv.items[e],i=this._pathChecked;return wijmo_1.isObject(t)&&i.path?i.getValue(t):this._getCheckboxState(e)};ListBox.prototype.setItemChecked=function(e,t){this._setItemChecked(e,t,!0)};ListBox.prototype.toggleItemChecked=function(e){this.setItemChecked(e,!this.getItemChecked(e))};Object.defineProperty(ListBox.prototype,"checkedItems",{get:function(){return this._checkedItems},set:function(e){e=Array.from(new Set(e));var t=wijmo_1.asArray(e,!1);if(!this._arrayEquals(t,this._checkedItems)){this._updateCheckedList(t);if(!this._arrayEquals(t,this._checkedItems)){this._checkedItems=t;this.onCheckedItemsChanged()}}},enumerable:!0,configurable:!0});ListBox.prototype.indexOf=function(e){return(e=wijmo_1.closest(e,"."+exports.ListBoxClsNames.listBoxItem))?e[ListBox._DIDX_KEY]:-1};ListBox.prototype.onSelectedIndexChanged=function(e){this.selectedIndexChanged.raise(this,e)};ListBox.prototype.onItemsChanged=function(e){this.itemsChanged.raise(this,e)};ListBox.prototype.onLoadingItems=function(e){this.loadingItems.raise(this,e)};ListBox.prototype.onLoadedItems=function(e){this.loadedItems.raise(this,e)};ListBox.prototype.onItemChecked=function(e){this.itemChecked.raise(this,e)};ListBox.prototype.onCheckedItemsChanged=function(e){this.checkedItemsChanged.raise(this,e)};ListBox.prototype.onFormatItem=function(e){this.formatItem.raise(this,e)};ListBox.prototype.refresh=function(t){void 0===t&&(t=!0);e.prototype.refresh.call(this,t);if(this.hostElement){var i=this._cv?this._cv.items.length:0,o=this.formatItem.handlerCount;if(i!=this._itemCount||o!=this._fmtItemHandlers){this._fmtItemHandlers=o;this._populateList()}else this._updateViewRange()}};ListBox.prototype._updateAriaLabel=function(){this.hostElement&&(this.ariaLabelledBy?wijmo_1.setAriaLabel(this.hostElement,null):wijmo_1.setAriaLabel(this.hostElement,this._ariaLabel))};ListBox.prototype._updateCheckedList=function(e){var t=this,i=this._cv,o=this._pathChecked,n=new Map;if(o&&i){var s=i.sourceCollection;if(s&&s.length){wijmo_1.isObject(s[0])||(o=null);e.forEach((function(e){n.set(e,!0)}));this._checking=!0;var r=[];s.forEach((function(e){var i=n.has(e);i&&r.push(e);o&&t._isNeedUpdateBnd&&o.setValue(e,i)}));this._checking=!1;e=r}i.items.forEach((function(e,i){t._setItemChecked(i,n.has(e),!1)}))}};ListBox.prototype._getBoundingClientRect=function(e){if(!e.offsetHeight){var t=this.indexOf(e),i=this.hostElement;if(t>-1&&i){t=this._getElementIndex(t);var o=i.getBoundingClientRect();return new wijmo_1.Rect(0,o.top-i.scrollTop+t*this._itemHeight,o.width,this._itemHeight)}}return wijmo_1.Rect.fromBoundingRect(e.getBoundingClientRect())};ListBox.prototype._updateItemAttributes=function(e,t){if(e){var i=this.checkedMemberPath?"true"===e.getAttribute("aria-selected"):null;wijmo_1.toggleClass(e,wijmo_1.ControlStateClsNames.selected,t);this._isMenuItem()||wijmo_1.setAttribute(e,"aria-selected",this._getAriaSelected(t,i));e.tabIndex=t?this._orgTabIndex:-1}};ListBox.prototype._getCheckedItems=function(){var e=this,t=this._cv,i=this._pathChecked,o=[];t&&i&&i.path&&(o=t.sourceCollection.filter((function(o,n){if(t.filter&&!t.filter(o))return!!e._addMode&&i.getValue(o);if(wijmo_1.isObject(o))return i.getValue(o);var s=t.items[n]==o?n:t.items.indexOf(o);return e.getItemChecked(s)})));return o};ListBox.prototype._arrayEquals=function(e,t){if(e==t)return!0;if(!e||!t||e.length!=t.length)return!1;for(var i=0;i<e.length;i++)if(!this._isEqual(e[i],t[i]))return!1;return!0};ListBox.prototype._getChild=function(e){e=this._getElementIndex(e);return this._children[e]};ListBox.prototype._getElementIndex=function(e){if(this._shGroups)for(var t=this._children,i=0;i<=e&&i<t.length;i++){var o=t[i];wijmo_1.hasClass(o,exports.ListBoxClsNames.header)&&e++}return e};ListBox.prototype._setItemChecked=function(e,t,i){void 0===i&&(i=!0);var o=this._cv.items[e],n=this._pathChecked,s=!1,r=this.selectedIndex,a=this._checking;if(wijmo_1.isObject(o)&&n.path){if(!!n.getValue(o)!=t){var l=wijmo_1.tryCast(this._cv,"IEditableCollectionView");s=!0;this._checking=!0;if(l){l.editItem(o);n.setValue(o,t);l.commitEdit()}else{n.setValue(o,t);l.refresh()}this._checking=a}}else if(i){var h=this._findArrayItem(this._checkedItems,o);(t&&h<0||!t&&h>=0)&&(s=!0)}this._setCheckboxState(e,t);if(i){if(s){this._checkedItems=this._checkedItemsUpdate(o,t);this.onItemChecked();this.onCheckedItemsChanged()}r!=this.selectedIndex&&this.onSelectedIndexChanged()}return s};ListBox.prototype._checkedItemsUpdate=function(e,t){var i=this._cv.sourceCollection,o=this._checkedItems,n=0;if(t){for(var s=0;s<i.length;s++){var r=i[s];if(n<o.length&&this._isEqual(r,o[n]))n++;else if(this._isEqual(r,e))return o.slice(0,n).concat([e]).concat(o.slice(n))}return o}var a=this._findArrayItem(o,e);return o.slice(0,a).concat(o.slice(a+1))};ListBox.prototype._isEqual=function(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)};ListBox.prototype._findArrayItem=function(e,t){if(!Number.isNaN(t))return e.indexOf(t);for(var i=0;i<e.length;i++)if(Number.isNaN(e[i]))return i;return-1};ListBox.prototype._cvCollectionChanged=function(){if(!this._checking){this._populateList();this.onItemsChanged()}};ListBox.prototype._cvCurrentChanged=function(){if(!this._checking){this.showSelection();this._ignoredItemChangedEvents||this.onSelectedIndexChanged()}};ListBox.prototype._populateList=function(){var e=this.hostElement,t=this._cv;this._itemCount=t?t.items.length:0;this._isVirtual=this._getVirtual();this._oldSel=null;this._itemsAbove=-1;this._itemsBelow=-1;if(e){var i=this.containsFocus(),o=void 0;this.onLoadingItems();this._children=[];var n=this._children;e.textContent="";if(t){var s=0,r=void 0,a=[];this._ignoreItemFormatterTextArray=[];if(this._shGroups&&t.groups&&t.groups.length){o={};for(var l=0;l<t.groups.length;l++){var h=t.groups[l];o[s]=h;r=this._createHeaderItem(h,l);a.push(r);for(var u=0;u<h.items.length;u++,s++){r=this._createItem(s,l);a.push(r)}}}else for(u=0;u<t.items.length;u++,s++){r=this._createItem(s);a.push(r)}var c=this._isVirtual?document.createElement("div"):e,p=0;wijmo_1.setInnerHTMLSafe(c,a.join(""));for(u=0;u<c.children.length;u++){var d=c.children[u];p==t.currentPosition&&(this._oldSel=d);d[ListBox._DIDX_KEY]=d.className.indexOf(exports.ListBoxClsNames.header)<0?p++:-1;n.push(d)}}if(this.formatItem.hasHandlers&&t){s=0;var _=t.items;for(d=new FormatItemEventArgs(0,null,null),u=0;u<n.length;u++){d._item=n[u];if(this._shGroups&&wijmo_1.hasClass(d._item,exports.ListBoxClsNames.header)){d._index=-1;d._data=o[s]}else{d._index=s;d._data=_[s++]}this.onFormatItem(d)}}if(this._isVirtual){var m=this._getCanvasContext(),f=null,b=0;for(u=0;u<n.length;u++){r=n[u];var g=m.measureText(r.textContent);if(g.width>b){f=r;b=g.width}}if(f){var w=!1,y=e.style.display,v=e.style.position;if(!e.parentElement){w=!0;(this._container||document.body).appendChild(e);wijmo_1.setCss(e,{display:"",position:"absolute"})}e.appendChild(f);var x=f.style.whiteSpace;f.style.whiteSpace="nowrap";this._ePadTop.style.width=f.offsetWidth+"px";this._itemHeight=f.offsetHeight||this._itemHeight;f.style.whiteSpace=x;this._eSizer.style.height=n.length*this._itemHeight+"px";e.appendChild(this._eSizer);this._clientHeight=e.clientHeight;wijmo_1.removeChild(this._eSizer);if(w){wijmo_1.removeChild(e);wijmo_1.setCss(e,{display:y,position:v})}wijmo_1.removeChild(f)}else this._ePadTop.style.width="";this._updateViewRange()}this.checkedItems=this._getCheckedItems();var C=this._getSelectedElement(!0);if(i){(C||e).focus()}else C&&this.showSelection();e.tabIndex=C?-1:this._orgTabIndex;this.onLoadedItems()}};ListBox.prototype._getCanvasContext=function(){var e=document.createElement("canvas").getContext("2d"),t=getComputedStyle(this.hostElement);t.fontSize&&t.fontFamily&&(e.font=t.fontSize+" "+t.fontFamily.split(",")[0]);return e};ListBox.prototype._getVirtual=function(){if(this._itemCount<=this._vThreshold)return!1;var e=this.hostElement;if(e){var t=getComputedStyle(e);if(parseInt(t.columnCount)>1||t.display.indexOf("flex")>-1||t.display.indexOf("grid")>-1)return!1}return!0};ListBox.prototype._getMaxSupportedCssHeight=function(){var e=265e5;wijmo_1.isIE()?e=15e5:wijmo_1.isFirefox()&&(e=175e5);return e};ListBox.prototype._updateViewRange=function(){var e=this.hostElement,t=this._itemHeight,i=this._children;if(!(e&&e.parentElement&&this._isVirtual&&i))return!1;var o=e.scrollTop;wijmo_1.assert(t*i.length<this._getMaxSupportedCssHeight(),"The number of items ("+i.length+") exceeds the maximum number of items ("+Math.floor(this._getMaxSupportedCssHeight()/t)+") allowed for this browser.");var n=Math.max(e.clientHeight,this._clientHeight),s=Math.floor(o/t),r=Math.min(i.length,Math.ceil((o+n)/t)-s),a=Math.max(0,i.length-s-r);if(s==this._itemsAbove&&a==this._itemsBelow)return!1;this._itemsAbove=s;this._itemsBelow=a;var l=document.createDocumentFragment(),h=this.containsFocus();this._ePadTop.style.height=s*t+"px";l.appendChild(this._ePadTop);if(this.showGroups&&!wijmo_1.hasClass(i[s],exports.ListBoxClsNames.header))for(var u=s;u>=0;u--)if(wijmo_1.hasClass(i[u],exports.ListBoxClsNames.header)){l.appendChild(i[u]);break}for(u=s;u<=s+r&&u<i.length;u++)l.appendChild(i[u]);this._ePadBot.style.height=a*t+"px";l.appendChild(this._ePadBot);e.textContent="";e.appendChild(l);var c=(s+r+a)*t-e.scrollHeight;this._ePadBot.style.height=this._ePadBot.offsetHeight-c+"px";var p=this._getSelectedElement(!0);if(h){(p||e).focus({preventScroll:!0})}e.tabIndex=p?-1:this._orgTabIndex;return!0};ListBox.prototype._getSelectedElement=function(e){var t=this.selectedIndex,i=this._getElementIndex(t),o=i>-1?this._children[i]:null;e&&o&&!o.offsetHeight&&(o=null);return o};ListBox.prototype._handleResize=function(){this._updateViewRange()};ListBox.prototype._createItem=function(e,t){var i=this._cv.items[e],o=e==this._cv.currentPosition,n=this.getDisplayValue(e),s=this.getDisplayValue(e,void 0!==this.itemFormatter);if(1!=this._html){n=wijmo_1.escapeHtml(n);s=wijmo_1.escapeHtml(s)}s=s.replace(/\bstyle\s*=/gi,"data-style=");this._itemFormatterHelper.innerHTML=s;s=this._itemFormatterHelper.textContent;this._ignoreItemFormatterTextArray.push(s);var r=null;if(this.checkedMemberPath){r=!1;wijmo_1.isObject(i)?r=!!this._pathChecked.getValue(i):this._checkedItems&&(r=this._checkedItems.indexOf(i)>-1);n='<label class="wj-checklist-item"><span class="wj-checklist-base" role="checkbox" aria-hidden="true"><span class="wj-checklist-mark"></span></span><span class="wj-checklist-caption">'+n+"</span></label>"}var a=exports.ListBoxClsNames.listBoxItem;o&&(a+=" "+wijmo_1.ControlStateClsNames.selected);r&&(a+=" "+wijmo_1.ControlStateClsNames.checked);if(this._html){var l=[wijmo_1.UtilitesClsNames.separator,wijmo_1.ControlStateClsNames.disabled];if(n.indexOf(l[0])>-1||n.indexOf(l[1])>-1){var h=wijmo_1.createElement(n);l.forEach((function(e){wijmo_1.hasClass(h,e)&&(a+=" "+e)}))}}var u="aria-describedby = listGroup-"+t;return'<div id="'+("listitem-"+e)+'" class="'+a+'" \n role="'+this.itemRole+'" \n '+(void 0!==t?u:"")+"\n "+(this._getAriaSelected(o,r)&&!this._isMenuItem()?'aria-selected="true"':"")+' \n tabindex="'+(o&&!this.isDisabled?this._orgTabIndex:-1)+'">'+n+"</div>"};ListBox.prototype._getAriaSelected=function(e,t){return!!(null!=t?t:e)||null};ListBox.prototype._createHeaderItem=function(e,t){var i=wijmo_1.escapeHtml(e.name);return'<div id="listGroup-'+t+'" class="'+exports.ListBoxClsNames.listBoxItem+" "+exports.ListBoxClsNames.header+" "+wijmo_1.ControlStateClsNames.disabled+'" role="group" tabindex="-1">'+i+"</div>"};ListBox.prototype._click=function(e){if(0==e.button&&!e.defaultPrevented){var t=this.indexOf(e.target);if(t>-1){this.selectedIndex=t;if(this.checkedMemberPath){var i=this._getCheckbox(t);if(i){var o=wijmo_1.closest(i,".wj-listbox-item");if(e.target==i||e.target==o){o.focus({preventScroll:!0});this.setItemChecked(t,i.checked)}}else{var n=this._children[this._getElementIndex(t)];if(n){n.focus({preventScroll:!0});this.setItemChecked(t,"true"!==n.getAttribute("aria-selected"))}}}else{(o=wijmo_1.closest(e.target,"."+exports.ListBoxClsNames.listBoxItem)).focus({preventScroll:!0})}}}};ListBox.prototype._keydown=function(e){var t=this.selectedIndex;if(!e.defaultPrevented){if(65==e.keyCode&&(e.ctrlKey||e.metaKey)){var i=this.collectionView;if(this.checkedMemberPath&&wijmo_1.hasItems(i)){for(var o=this._children,n=[],s=!0,r=0;r<o.length;r++)if(!wijmo_1.hasClass(o[r],wijmo_1._CLS_STATE_DISABLED)){var a=i.items[r];n.push(a);s&&!this.checkedItems.includes(a)&&(s=!1)}n.length!==i.items.length?this.checkedItems=s?this.checkedItems.filter((function(e){return!n.includes(e)})):this.checkedItems.concat(n):this.checkedItems=this.checkedItems.length!=i.items.length?i.items:[];e.preventDefault();return}}if(!e.altKey&&!e.metaKey){e.shiftKey&&(this._isShiftDown=!0);switch(e.keyCode){case wijmo_1.Key.Down:e.preventDefault();this._selectNext(e.shiftKey);break;case wijmo_1.Key.Up:e.preventDefault();this._selectPrev(e.shiftKey);break;case wijmo_1.Key.Home:e.preventDefault();e.ctrlKey&&e.shiftKey?this._selectRange(0):this._selectFirst();break;case wijmo_1.Key.End:e.preventDefault();e.ctrlKey&&e.shiftKey?this._selectRange(this._children.length-1):this._selectLast();break;case wijmo_1.Key.PageDown:e.preventDefault();this._selectNextPage();break;case wijmo_1.Key.PageUp:e.preventDefault();this._selectPrevPage();break;case wijmo_1.Key.Space:if(this.checkedMemberPath&&t>-1){var l=this._children[this._getElementIndex(t)];if(l&&this.isItemEnabled(t)&&!l.hasAttribute("disabled")){var h="true"===l.getAttribute("aria-selected");this.setItemChecked(t,!h);e.preventDefault()}}}}}};ListBox.prototype._getCheckboxState=function(e){var t=this._children[this._getElementIndex(e)];if(t)return"true"===t.getAttribute("aria-selected")};ListBox.prototype._setCheckboxState=function(e,t){var i=this._getElementIndex(e),o=this._children[i];if(o){if(o.querySelector(".wj-checklist-mark")){o.setAttribute("aria-selected",t.toString());wijmo_1.toggleClass(o,wijmo_1.ControlStateClsNames.checked,t)}else{var n=this._getCheckbox(i);if(n){n.checked=t;var s=wijmo_1.closest(n,"."+exports.ListBoxClsNames.listBoxItem);if(s){wijmo_1.toggleClass(s,wijmo_1.ControlStateClsNames.checked,t);wijmo_1.setAttribute(s,"aria-selected",!!t||null)}}}}};ListBox.prototype._getCheckbox=function(e){var t=this._children;return this.hostElement&&e>-1&&e<t.length?t[e].querySelector("input[type=checkbox]"):null};ListBox.prototype._keypress=function(e){var t=this;if(!e.defaultPrevented&&!(e.target instanceof HTMLInputElement)&&(e.charCode>32||32==e.charCode&&this._search)){e.preventDefault();this._search+=String.fromCharCode(e.charCode);this._toSearch&&clearTimeout(this._toSearch);this._toSearch=setTimeout((function(){t._toSearch=null;t._search=""}),wijmo_1.Control._SEARCH_DELAY);var i=this._findNext();if(i<0&&this._search.length>1){this._search=this._search[this._search.length-1];i=this._findNext()}i>-1&&(this.selectedIndex=i)}};ListBox.prototype._selectNext=function(e){void 0===e&&(e=!1);var t=this.selectedIndex,i=this._findNextEnabled(t+1);if(i>-1){e&&this._selectRange(i);this.selectedIndex=i}return i>-1};ListBox.prototype._selectPrev=function(e){void 0===e&&(e=!1);var t=this.selectedIndex,i=this._findPrevEnabled(t-1);if(i>-1){e&&this._selectRange(i);this.selectedIndex=i}return i>-1};ListBox.prototype._findNextEnabled=function(e){for(var t=e;t<this._children.length;t++)if(this.isItemEnabled(t))return t;return-1};ListBox.prototype._findPrevEnabled=function(e){for(var t=e;t>=0;t--)if(this.isItemEnabled(t))return t;return-1};ListBox.prototype._selectFirst=function(){for(var e=0;e<this._children.length;e++)if(this.isItemEnabled(e)){this.selectedIndex=e;return!0}return!1};ListBox.prototype._selectLast=function(){for(var e=this._children.length-1;e>=0;e--)if(this.isItemEnabled(e)){this.selectedIndex=e;return!0}return!1};ListBox.prototype._selectNextPage=function(){var e=this.hostElement.offsetHeight,t=this._children,i=this._cv?this._cv.items.length:0,o=0;if(e>0)for(var n=this.selectedIndex+1;n<i;n++){var s=t[n].scrollHeight||this._itemHeight;if(o+s>e&&this.isItemEnabled(n)){this.selectedIndex=n;return!0}o+=s}return this._selectLast()};ListBox.prototype._selectPrevPage=function(){var e=this.hostElement.offsetHeight,t=this._children,i=0;if(e>0)for(var o=this.selectedIndex-1;o>0;o--){var n=t[o].scrollHeight||this._itemHeight;if(i+n>e&&this.isItemEnabled(o)){this.selectedIndex=o;return!0}i+=n}return this._selectFirst()};ListBox.prototype._findNext=function(){if(this.hostElement){var e=this._children.length,t=this.selectedIndex;(t<0||1==this._search.length)&&t++;var i=this._search,o=this.caseSensitiveSearch;o||(i=i.toLowerCase());for(var n=0;n<e;n++){var s=(t+n)%e;if(this.isItemEnabled(s)){var r=this.getDisplayText(s).trim();o||(r=r.toLowerCase());if(0==r.indexOf(i))return s}}}return-1};ListBox.prototype._initFromSelect=function(e){for(var t=e.children,i=[],o=-1,n=0;n<t.length;n++){var s=t[n];if("OPTION"==s.tagName){s.hasAttribute("selected")&&(o=i.length);s.innerHTML?i.push({hdr:s.innerHTML,val:s.getAttribute("value"),cmdParam:s.getAttribute("cmd-param")}):i.push({hdr:'<div class="'+wijmo_1.UtilitesClsNames.separator+'"></div>'});e.removeChild(s);n--}}if(i){this.displayMemberPath="hdr";this.selectedValuePath="val";this.itemsSource=i;this.selectedIndex=o}};ListBox.prototype._setIsDisabled=function(t){e.prototype._setIsDisabled.call(this,t);this._updateTabIndex()};ListBox.prototype._setTabOrder=function(t){e.prototype._setTabOrder.call(this,t);this.isDisabled||this._updateTabIndex()};ListBox.prototype._isMenuItem=function(){return"menuitem"===this.itemRole||"menuitemcheckbox"===this.itemRole||"menuitemradio"===this.itemRole};ListBox.prototype._updateTabIndex=function(){var e=this.hostElement,t=this._getSelectedElement(!0);if(t){t.tabIndex=this.isDisabled?-1:this._orgTabIndex;e.tabIndex=-1}else e.tabIndex=this.isDisabled?-1:this._orgTabIndex};ListBox.prototype._selectRange=function(e){if(-1!==this.selectedIndex){if(this._shouldClearOnShift&&this._isShiftDown){this.checkedItems=[];this._shouldClearOnShift=!1}var t=Math.min(this.selectedIndex,e),i=Math.max(this.selectedIndex,e),o=this.collectionView.items.slice(t,i+1);this.checkedItems=Array.from(new Set(this.checkedItems.concat(o)))}};ListBox.prototype.dispose=function(){if(this._cv){this._cv.collectionChanged.removeHandler(this._cvCollectionChanged,this);this._cv.currentChanged.removeHandler(this._cvCurrentChanged,this);this._cv=null}this._items=null;if(this._toSearch){clearTimeout(this._toSearch);this._toSearch=null}this._children=null;this._eSizer=null;this._ePadTop=null;this._ePadBot=null;this._itemFormatterHelper=null;this._ignoreItemFormatterTextArray=null;this._checkedItems=null;e.prototype.dispose.call(this)};ListBox._DIDX_KEY="$WJ-DIDX";ListBox._VTHRESH=Number.MAX_VALUE/2;return ListBox}(wijmo_1.Control);exports.ListBox=ListBox;var FormatItemEventArgs=function(e){__extends(FormatItemEventArgs,e);function FormatItemEventArgs(t,i,o){var n=e.call(this)||this;n._index=wijmo_1.asNumber(t);n._data=i;n._item=wijmo_1.asType(o,HTMLElement,!0);return n}Object.defineProperty(FormatItemEventArgs.prototype,"index",{get:function(){return this._index},enumerable:!0,configurable:!0});Object.defineProperty(FormatItemEventArgs.prototype,"data",{get:function(){return this._data},enumerable:!0,configurable:!0});Object.defineProperty(FormatItemEventArgs.prototype,"item",{get:function(){return this._item},enumerable:!0,configurable:!0});return FormatItemEventArgs}(wijmo_1.EventArgs);exports.FormatItemEventArgs=FormatItemEventArgs;wijmo_1._addCultureInfo("MultiSelectListBox",{filterPlaceholder:"Filter",selectAll:"Select All",ariaLabels:{multiSelectListBox:"Multi select list box"}});var DateSelectionMode,ShowMonthPicker,CalendarTabKeyAction,MultiSelectListBox=function(e){__extends(MultiSelectListBox,e);function MultiSelectListBox(t,i){var o=e.call(this,t)||this;o._ariaLabel=wijmo_1.culture.MultiSelectListBox.ariaLabels.multiSelectListBox;o._selectAllLabel=null;o._filterPlaceholder=null;o._filterText="";o._checkOnFilter=!0;o._delay=wijmo_1.Control._SEARCH_DELAY;o.checkedItemsChanged=new wijmo_1.Event;o.selectedIndexChanged=new wijmo_1.Event;var n=o.getTemplate();o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.MultiSelectListBoxClsNames.hostElement,n,{_selectAll:"select-all",_filter:"filter",_lbHost:"list-box"});o._selectAll.style.display="none";o._filter.style.display="none";o._lbx=new ListBox(o._lbHost,{checkedMemberPath:MultiSelectListBox._DEF_CHECKED_PATH,loadedItems:function(){return o._updateCheckAllCheckbox()},checkedItemsChanged:function(e){return o.onCheckedItemsChanged(e)},selectedIndexChanged:function(){return o.onSelectedIndexChanged()}});o._cbSelectAll=o._selectAll.querySelector("input[type=checkbox]");o._spSelectAll=o._selectAll.querySelector("label>span");var s=wijmo_1.culture.MultiSelectListBox;wijmo_1.setText(o._spSelectAll,s.selectAll);o._filter.placeholder=s.filterPlaceholder;o.initialize(i);o.addEventListener(o._filter,"input",(function(){if(o._filter.value!=o._filterText){o._filterText=o._filter.value;o._toSearch&&clearTimeout(o._toSearch);o._toSearch=setTimeout((function(){o._toSearch=null;o._applyFilter()}),o.delay)}}));o.addEventListener(o._cbSelectAll,"click",(function(e){var t=o._lbx.collectionView;wijmo_1.hasItems(t)&&(o.checkedItems=e.target.checked?t.items:[])}));o.addEventListener(o.hostElement,"keydown",(function(e){var t=o.showFilterInput?o._filter:null,i=o._lbx;if(t&&e.keyCode==wijmo_1.Key.F3){wijmo_1.setSelectionRange(t,0,t.value.length);e.preventDefault()}if(wijmo_1.getActiveElement()==t){var n=!e.altKey;switch(e.keyCode){case wijmo_1.Key.Escape:case wijmo_1.Key.F4:case wijmo_1.Key.Tab:n=!1}n&&e.stopPropagation()}if(!i.containsFocus())switch(e.keyCode){case wijmo_1.Key.Up:case wijmo_1.Key.Down:o._lbx.focus();if(!e.altKey){var s=i.selectedIndex+(e.keyCode==wijmo_1.Key.Up?-1:1);i.selectedIndex=Math.max(0,s)}e.preventDefault()}}),!0);o.hostElement.tabIndex=-1;o._lbx.tabOrder=o._orgTabIndex;o._updateAriaLabel();return o}Object.defineProperty(MultiSelectListBox,"controlTemplate",{get:function(){MultiSelectListBox._ctrlTemplate||(MultiSelectListBox._ctrlTemplate='<div class="'+wijmo_1.ControlClsNames.template+" "+exports.ListBoxClsNames.hostElement+'"><input wj-part="filter" class="'+wijmo_1.InputFormElementsClsNames.formControl+'" tabindex="-1"><div wj-part="select-all" class="'+exports.MultiSelectListBoxClsNames.header+" "+exports.MultiSelectListBoxClsNames.selectAll+" "+exports.ListBoxClsNames.listBoxItem+'"><label><input type="checkbox" tabindex="-1"> <span></span></label></div><div wj-part="list-box"/></div>');return MultiSelectListBox._ctrlTemplate},set:function(e){MultiSelectListBox._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"itemsSource",{get:function(){return this._lbx.itemsSource},set:function(e){this._lbx.itemsSource=e},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"collectionView",{get:function(){return this._lbx.collectionView},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"virtualizationThreshold",{get:function(){return this._lbx.virtualizationThreshold},set:function(e){this._lbx.virtualizationThreshold=e},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"displayMemberPath",{get:function(){return this._lbx.displayMemberPath},set:function(e){this._lbx.displayMemberPath=e},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"isContentHtml",{get:function(){return this._lbx.isContentHtml},set:function(e){this._lbx.isContentHtml=e},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"caseSensitiveSearch",{get:function(){return this._lbx.caseSensitiveSearch},set:function(e){this._lbx.caseSensitiveSearch=e},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"delay",{get:function(){return this._delay},set:function(e){this._delay=wijmo_1.asNumber(e,!1,!0)},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"showGroups",{get:function(){return this._lbx.showGroups},set:function(e){this._lbx.showGroups=e},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"checkOnFilter",{get:function(){return this._checkOnFilter},set:function(e){if(e!=this.checkOnFilter){this._checkOnFilter=wijmo_1.asBoolean(e);this.checkedItems=[]}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"selectedIndex",{get:function(){return this._lbx.selectedIndex},set:function(e){this._lbx.selectedIndex=e},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"listBox",{get:function(){return this._lbx},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"showFilterInput",{get:function(){return""==this._filter.style.display},set:function(e){if(e!=this.showFilterInput){this._filter.style.display=wijmo_1.asBoolean(e)?"":"none";if(!this.showFilterInput){this._filter.value="";this._applyFilter()}}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"filterInputPlaceholder",{get:function(){return this._filterPlaceholder},set:function(e){if(e!=this._filterPlaceholder){this._filterPlaceholder=wijmo_1.asString(e);this.refresh()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"showSelectAllCheckbox",{get:function(){return""==this._selectAll.style.display},set:function(e){this._selectAll.style.display=wijmo_1.asBoolean(e)?"":"none"},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"selectAllLabel",{get:function(){return this._selectAllLabel},set:function(e){if(e!=this._selectAllLabel){this._selectAllLabel=wijmo_1.asString(e);this.refresh()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"checkedMemberPath",{get:function(){var e=this.listBox.checkedMemberPath;return e!=MultiSelectListBox._DEF_CHECKED_PATH?e:null},set:function(e){e=wijmo_1.asString(e);this.listBox.checkedMemberPath=e||MultiSelectListBox._DEF_CHECKED_PATH},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"checkedItems",{get:function(){return this.listBox.checkedItems},set:function(e){this.listBox.checkedItems=wijmo_1.asArray(e)},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"ariaLabelledBy",{get:function(){return this.hostElement.getAttribute("aria-labelledby")},set:function(e){wijmo_1._setAriaLabelBy(this,this.hostElement,e,this._updateAriaLabel.bind(this))},enumerable:!0,configurable:!0});MultiSelectListBox.prototype._updateAriaLabel=function(){var e=wijmo_1.culture.MultiSelectListBox;wijmo_1.setAriaLabel(this._selectAll,e.selectAll);wijmo_1.setAriaLabel(this._filter,e.filterPlaceholder);this.hostElement&&(this.ariaLabelledBy?wijmo_1.setAriaLabel(this.hostElement,null):wijmo_1.setAriaLabel(this.hostElement,this._ariaLabel))};MultiSelectListBox.prototype.onCheckedItemsChanged=function(e){var t=this;this._updateCheckAllCheckbox();this.checkedItemsChanged.raise(this,e);e._items&&"object"==typeof e._items[0]&&(this.checkedMemberPath||MultiSelectListBox._DEF_CHECKED_PATH)in e._items[0]&&setTimeout((function(){t._lbx._updateCheckedList(t.checkedItems)}),0)};MultiSelectListBox.prototype.onSelectedIndexChanged=function(e){this.selectedIndexChanged.raise(this,e)};MultiSelectListBox.prototype.refresh=function(t){void 0===t&&(t=!0);e.prototype.refresh.call(this,t);if(this.hostElement){var i=wijmo_1.culture.MultiSelectListBox;this._filter.placeholder=null!=this._filterPlaceholder?this._filterPlaceholder:i.filterPlaceholder;this._spSelectAll&&wijmo_1.setText(this._spSelectAll,null!=this._selectAllLabel?this._selectAllLabel:i.selectAll);this._updateCheckAllCheckbox()}};MultiSelectListBox.prototype.dispose=function(){this.listBox.dispose();e.prototype.dispose.call(this)};MultiSelectListBox.prototype._applyFilter=function(){var e=this,t=this._lbx,i=t.collectionView,o=this._filter.value,n=o?new RegExp(wijmo_1.escapeRegExp(o),t.caseSensitiveSearch?"":"i"):null,s=this.displayMemberPath,r=s?new wijmo_1.Binding(s):null,a=this.checkOnFilter?null:this.checkedItems;i.filter=function(t){if(null!=n){if(a&&a.indexOf(t)>-1)return!0;r&&(t=r.getValue(t));e.isContentHtml&&(t=wijmo_1.toPlainText(t));return null!=t&&n.test(t.toString())}return!0};t.selectedIndex=Math.max(0,t.selectedIndex);this._checkOnFilter&&(this.checkedItems=n?i.items:[])};MultiSelectListBox.prototype._updateCheckAllCheckbox=function(){var e=this._lbx.collectionView,t=this._cbSelectAll;if(wijmo_1.hasItems(e)){var i=e.items.length,o=this.checkedItems.length;wijmo_1.setChecked(t,o==i||0!=o&&null);t.disabled=!1}else{wijmo_1.setChecked(t,!1);t.checked=!1;t.disabled=!0}};MultiSelectListBox.prototype._setIsDisabled=function(t){e.prototype._setIsDisabled.call(this,t);this.hostElement.tabIndex=-1;this.isDisabled?this._lbx.tabOrder=-1:this._lbx.tabOrder=this._orgTabIndex};MultiSelectListBox.prototype._setTabOrder=function(e){this._orgTabIndex=e;this._lbx.tabOrder=e};MultiSelectListBox.prototype.tryForceClearDelayAndFilter=function(){var e=this;if(this._toSearch){var t=this._delay;this._filterText=this._filter.value;this._toSearch&&clearTimeout(this._toSearch);this._toSearch=setTimeout((function(){e._toSearch=null;e._applyFilter()}),0);this._delay=t}};MultiSelectListBox.prototype.onLostFocus=function(){this.tryForceClearDelayAndFilter();e.prototype.onLostFocus.call(this)};MultiSelectListBox._DEF_CHECKED_PATH="$checked";MultiSelectListBox._ctrlTemplate="";return MultiSelectListBox}(wijmo_1.Control);exports.MultiSelectListBox=MultiSelectListBox;wijmo_1._addCultureInfo("Calendar",{ariaLabels:{calendar:"Calendar",chooseDate:"Choose Date",chooseMonth:"Choose Month",monthView:"Month View",yearView:"Year View",selectYear:"Select Year",prvMo:"Previous Month",today:"Select Today",nxtMo:"Next Month",prvYr:"Previous Year",currMo:"Current Month",nxtYr:"Next Year"},buttons:{ok:"OK",cancel:"Cancel"}});!function(e){e[e.None=0]="None";e[e.Day=1]="Day";e[e.Month=2]="Month";e[e.Range=3]="Range"}(DateSelectionMode=exports.DateSelectionMode||(exports.DateSelectionMode={}));!function(e){e[e.None=0]="None";e[e.FirstMonth=1]="FirstMonth";e[e.LastMonth=2]="LastMonth";e[e.FirstAndLastMonths=3]="FirstAndLastMonths";e[e.AllMonths=4]="AllMonths";e[e.Outside=5]="Outside"}(ShowMonthPicker=exports.ShowMonthPicker||(exports.ShowMonthPicker={}));!function(e){e[e.None=0]="None";e[e.All=1]="All"}(CalendarTabKeyAction=exports.CalendarTabKeyAction||(exports.CalendarTabKeyAction={}));var ClickAction,KeyAction,TabKeyAction,Calendar=function(e){__extends(Calendar,e);function Calendar(t,i){var o=e.call(this,t)||this;o._yrPicker=!0;o._mtPicker=ShowMonthPicker.FirstMonth;o._wksBefore=0;o._wksAfter=0;o._rngMin=0;o._rngMax=0;o._min=null;o._max=null;o._readOnly=!1;o._handleWheel=!0;o._fdw=null;o._selMode=DateSelectionMode.Day;o._ariaLabel=wijmo_1.culture.Calendar.ariaLabels.calendar;o._tmYrHidden=0;o._fmtYrMo="y";o._fmtYr="yyyy";o._fmtDayHdr="ddd";o._fmtDay="d ";o._fmtMonths="MMM";o._fmtDayTitle="dddd";o.valueChanged=new wijmo_1.Event;o.rangeEndChanged=new wijmo_1.Event;o.rangeChanged=new wijmo_1.Event;o.displayMonthChanged=new wijmo_1.Event;o.formatItem=new wijmo_1.Event((function(){o.invalidate()}));o._updateCellFocus=function(e,t){wijmo_1.toggleClass(e,exports.CalendarClsNames.focused,t);wijmo_1.setAttribute(e,"tabIndex",t?"0":"-1");t&&o.containsFocus()&&!o._isButtonFocused()&&e.focus()};o.cancelButtonClicked=new wijmo_1.Event;o.OKButtonClicked=new wijmo_1.Event;o._enterKeyDownToSetValue=new wijmo_1.Event;o._value=o._rngEnd=wijmo_1.DateTime.newDate();o._month=o._getMonth(o._value);o._cals=[o];o._createChildren();o._createYearPicker();var n=o.hostElement,s=o.addEventListener.bind(o);s(n,"keydown",o._keydown.bind(o));s(n,"click",o._click.bind(o));o._focusValue=wijmo_1.DateTime.newDate();wijmo_1.setAttribute(n,"role","application");wijmo_1.setAttribute(o.hostElement,"aria-label",o._ariaLabel);o._keyActionTab=CalendarTabKeyAction.None;o._rptUp=new wijmo_1._ClickRepeater(o._btnPrv);o._rptDn=new wijmo_1._ClickRepeater(o._btnNxt);o.addEventListener(n,"wheel",(function(e){if(o.handleWheel&&!e.defaultPrevented&&!o.isReadOnly&&o.containsFocus()){e.deltaY<0?o._btnPrv.click():o._btnNxt.click();e.preventDefault()}}));o.initialize(i);o.refresh(!0);return o}Object.defineProperty(Calendar,"controlTemplate",{get:function(){Calendar._ctrlTemplate||(Calendar._ctrlTemplate='<div class="'+wijmo_1.ControlClsNames.content+" "+exports.CalendarClsNames.calendarOuter+'"><div wj-part="tbl-header" class='+exports.CalendarClsNames.calendarHeader+'><div wj-part="btn-month" class='+exports.CalendarClsNames.monthSelect+' role="button" aria-live="polite"><span wj-part="span-month"></span> <span class='+wijmo_1.GlyphClsNames.down+'></span></div><div class="'+wijmo_1.InputFormElementsClsNames.btnGroup+'"><button wj-part="btn-prev" class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1"><span class='+wijmo_1.GlyphClsNames.left+'></span></button><button wj-part="btn-today" class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1"><span class='+wijmo_1.GlyphClsNames.circle+'></span></button><button wj-part="btn-next" class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1"><span class='+wijmo_1.GlyphClsNames.right+'></span></button></div></div><table wj-part="tbl-month" class='+exports.CalendarClsNames.calendarMonth+' role="grid"></table><table wj-part="tbl-year" class='+exports.CalendarClsNames.calendarYear+' role="grid"></table></div>');return Calendar._ctrlTemplate},set:function(e){Calendar._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"value",{get:function(){return this._value},set:function(e){if((!wijmo_1.DateTime.sameDate(e,this._value)||!wijmo_1.DateTime.sameTime(e,this._value))&&(!(this.showConfirmationButtons&&wijmo_1.DateTime.sameDate(e,this.rangeEnd)&&wijmo_1.DateTime.sameTime(e,this.rangeEnd))||this._isSpaceDownForSetValue)){this._clearingRangeEnd=!wijmo_1.DateTime.equals(this._value,e);this.rangeEnd=null;this._clearingRangeEnd=!1;e=wijmo_1.asDate(e,!0);e=this._clamp(e);if(this._valid(e)||null==e){this.ensureVisible(e||new Date);if(!wijmo_1.DateTime.equals(this._value,e)){this._value=e;this.focusMode&&(this._focusValue=e);this.invalidate(!1);this.onValueChanged()}}if(!this.value){var t=this.min,i=this.max,o=this.displayMonth;i&&i<o?this.ensureVisible(i):t&&t>o&&this.ensureVisible(t)}}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"focusValue",{get:function(){return this._focusValue},set:function(e){e=wijmo_1.asDate(e,!0);e=this._clamp(e);if(this._valid(e)||null==e){this.ensureVisible(e||new Date);this._focusValue=e;this._getCalendars().forEach((function(t){t._focusValue=e}));this.invalidate(!1)}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"rangeEnd",{get:function(){return this._rngEnd},set:function(e){e=wijmo_1.asDate(e,!0);if((e=this._clamp(e))&&this._value&&this._rngMode()){e<this._value&&(e=this._value);var t=this._rngMin,i=this._rngMax;if(t&&t>0||i&&i>0){var o=this._value,n=Math.ceil((e.getTime()-o.getTime())/864e5)+1;t&&t>0&&n<t&&(e=wijmo_1.DateTime.addDays(o,t-1));i&&i>0&&n>i&&(e=wijmo_1.DateTime.addDays(o,i-1))}}if((this._valid(e)||null==e)&&!wijmo_1.DateTime.equals(this._rngEnd,e)){this._rngEnd=e;this.ensureVisible(e);this.invalidate(!1);this._clearingRangeEnd||this.onRangeEndChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"rangeMin",{get:function(){return this._rngMin},set:function(e){if((e=wijmo_1.asNumber(e,!0,!0))!=this._rngMin){this._rngMin=e;this._syncProp(this,"rangeMin");this._rngMode()&&this._rngEnd&&(this.rangeEnd=this._rngEnd)}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"rangeMax",{get:function(){return this._rngMax},set:function(e){if((e=wijmo_1.asNumber(e,!0,!0))!=this._rngMax){this._rngMax=e;this._syncProp(this,"rangeMax");this._rngMode()&&this._rngEnd&&(this.rangeEnd=this._rngEnd)}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"min",{get:function(){return this._min},set:function(e){if((e=wijmo_1.asDate(e,!0))!=this.min){this._min=e;this._syncProp(this,"min");this.refresh();!this.value&&e&&e>this.displayMonth&&this.ensureVisible(e)}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"max",{get:function(){return this._max},set:function(e){if((e=wijmo_1.asDate(e,!0))!=this.max){this._max=e;this._syncProp(this,"max");this.refresh();!this.value&&e&&e<this.displayMonth&&this.ensureVisible(e)}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"selectionMode",{get:function(){return this._selMode},set:function(e){var t=DateSelectionMode;if((e=wijmo_1.asEnum(e,t))!=this._selMode){this._selMode=e;this._mthMode()&&(this.monthView=!1);e!=t.Range||this._rngEnd||(this._rngEnd=this._value);this.refresh();this._syncProp(this,"selectionMode")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"isReadOnly",{get:function(){return this._readOnly},set:function(e){this._readOnly=wijmo_1.asBoolean(e);wijmo_1.toggleClass(this.hostElement,wijmo_1.ControlStateClsNames.readOnly,this.isReadOnly);this._syncProp(this,"isReadOnly")},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"handleWheel",{get:function(){return this._handleWheel},set:function(e){if(this._handleWheel!=e){this._handleWheel=wijmo_1.asBoolean(e);this._syncProp(this,"handleWheel")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"repeatButtons",{get:function(){return!this._rptUp.disabled},set:function(e){this._rptUp.disabled=this._rptDn.disabled=!wijmo_1.asBoolean(e);this._syncProp(this,"repeatButtons")},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"showYearPicker",{get:function(){return this._yrPicker},set:function(e){if(e!=this._yrPicker){this._yrPicker=wijmo_1.asBoolean(e);this._syncProp(this,"showYearPicker")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"showMonthPicker",{get:function(){return this._mtPicker},set:function(e){if(e!=this._mtPicker){var t=ShowMonthPicker;wijmo_1.isBoolean(e)&&(e=e?t.FirstMonth:t.None);this._mtPicker=wijmo_1.asEnum(e,t);wijmo_1.toggleClass(this.hostElement,wijmo_1.InputFormElementsClsNames.btnsOutside,this._getShowMonthPicker()==t.Outside);this.refresh();this._syncProp(this,"showMonthPicker")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"firstDayOfWeek",{get:function(){return this._fdw},set:function(e){if(e!=this._fdw){if((e=wijmo_1.asNumber(e,!0))&&(e>6||e<0))throw"firstDayOfWeek must be between 0 and 6 (Sunday to Saturday).";this._fdw=e;this.refresh();this._syncProp(this,"firstDayOfWeek")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"displayMonth",{get:function(){return this._month},set:function(e){e=wijmo_1.asDate(e);e=this._getMonth(e);var t=this._getDisplayMonthRange();t.to&&e>t.to&&(e=t.to);t.from&&e<t.from&&(e=t.from);if(!wijmo_1.DateTime.equals(this.displayMonth,e)){this._month=e;this.invalidate(!0);this.onDisplayMonthChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"monthCount",{get:function(){var e=this.hostElement;return e?e.querySelectorAll("."+exports.CalendarClsNames.hostElement).length+1:0},set:function(e){var t=this,i=this.hostElement;if(e!=this.monthCount&&i){var o=i.querySelectorAll("."+exports.CalendarClsNames.hostElement);e=wijmo_1.asInt(e,!1);wijmo_1.assert(e>0,"monthCount must be >= 1.");wijmo_1.assert(1==e||!wijmo_1.closest(i.parentElement,"."+exports.CalendarClsNames.hostElement),"Only top-level calendars can set monthCount.");for(var n=0;n<o.length;n++){var s=o[n];wijmo_1.removeChild(s);this._getCalendar(s).dispose()}this._cals=[this];for(n=1;n<e;n++){(s=new Calendar(document.createElement("div"),{itemFormatter:this.itemFormatter,itemValidator:this.itemValidator,formatItem:function(e,i){return t.onFormatItem(i)}}))._selMode=this._selMode;s._value=this._value;s._rngEnd=this._rngEnd;for(var r in this)if(!/^(_.*|constructor|displayMonth|monthCount|hostElement|rightToLeft|isUpdating|isTouching|keyActionTab)$/.test(r)){var a=this[r];wijmo_1.isFunction(a)||a instanceof wijmo_1.Event||(s[r]=a)}this._cals.push(s);i.appendChild(s.hostElement)}this.updateCalendarsTabindex();wijmo_1.toggleClass(i,exports.CalendarClsNames.calendarMultiMonth,e>1);this._syncProp(this,"displayMonth")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"formatYearMonth",{get:function(){return this._fmtYrMo},set:function(e){if(e!=this._fmtYrMo){this._fmtYrMo=wijmo_1.asString(e);this._syncProp(this,"formatYearMonth");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"formatDayHeaders",{get:function(){return this._fmtDayHdr},set:function(e){if(e!=this._fmtDayHdr){this._fmtDayHdr=wijmo_1.asString(e);this._syncProp(this,"formatDayHeaders");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"formatDays",{get:function(){return this._fmtDay},set:function(e){if(e!=this._fmtDay){this._fmtDay=wijmo_1.asString(e);this._syncProp(this,"formatDays");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"formatYear",{get:function(){return this._fmtYr},set:function(e){if(e!=this._fmtYr){this._fmtYr=wijmo_1.asString(e);this._syncProp(this,"formatYear");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"formatMonths",{get:function(){return this._fmtMonths},set:function(e){if(e!=this._fmtMonths){this._fmtMonths=wijmo_1.asString(e);this._syncProp(this,"formatMonths");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"showHeader",{get:function(){return"none"!=this._tbHdr.style.display},set:function(e){if(e!=this.showHeader){this._tbHdr.style.display=wijmo_1.asBoolean(e)?"":"none";this._syncProp(this,"showHeader")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"monthView",{get:function(){return"none"!=this._tbMth.style.display},set:function(e){if(e!=this.monthView){this._tbMth.style.display=e?"":"none";this._tbYr.style.display=e?"none":"";if(!e&&this.isThisMainCalendar()){var t=this.focusValue.getDate(),i=wijmo_1.DateTime.clone(this.displayMonth);i.setDate(t);this.focusValue=i}this.refresh();var o=wijmo_1.culture.Calendar.ariaLabels;wijmo_1.setAriaLabel(this._btnPrv,e?o.prvMo:o.prvYr);wijmo_1.setAriaLabel(this._btnTdy,e?o.today:o.currMo);wijmo_1.setAriaLabel(this._btnNxt,e?o.nxtMo:o.nxtYr);wijmo_1.setAriaLabel(this._btnMth,e?o.monthView:o.yearView);this._updateMonthButtonAria();this._syncProp(this,"monthView")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"weeksBefore",{get:function(){return this._wksBefore},set:function(e){if(e!=this._wksBefore){this._wksBefore=Math.floor(wijmo_1.asNumber(e,!1,!0));this._syncProp(this,"weeksBefore");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"weeksAfter",{get:function(){return this._wksAfter},set:function(e){if(e!=this._wksAfter){this._wksAfter=Math.floor(wijmo_1.asNumber(e,!1,!0));this._syncProp(this,"weeksAfter");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"itemFormatter",{get:function(){return this._itemFormatter},set:function(e){if(e!=this._itemFormatter){this._itemFormatter=wijmo_1.asFunction(e);this._syncProp(this,"itemFormatter");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"itemValidator",{get:function(){return this._itemValidator},set:function(e){if(e!=this._itemValidator){this._itemValidator=wijmo_1.asFunction(e);this._syncProp(this,"itemValidator");this.invalidate()}},enumerable:!0,configurable:!0});Calendar.prototype.hitTest=function(e){var t=e instanceof MouseEvent?e.target:e instanceof Element?e:null;wijmo_1.assert(null!=t,"MouseEvent or Element expected");return t?t[Calendar._DATE_KEY]:null};Calendar.prototype.ensureVisible=function(e){if(null!=e){var t=this._getCalendars(),i=t.indexOf(this),o=t[0],n=t[t.length-1];e<o.displayMonth||!this.monthView&&this.focusMode?this.displayMonth=wijmo_1.DateTime.addMonths(this._getMonth(e),i):e>n.displayMonth&&(this.displayMonth=wijmo_1.DateTime.addMonths(this._getMonth(e),i-t.length+1))}};Calendar.prototype.onValueChanged=function(e){this.valueChanged.raise(this,e);this._syncProp(this,"value")};Calendar.prototype.onRangeEndChanged=function(e){this.rangeEndChanged.raise(this,e);this._syncProp(this,"rangeEnd");this._value&&this._rngEnd&&this.onRangeChanged(e)};Calendar.prototype.onRangeChanged=function(e){this.rangeChanged.raise(this,e)};Calendar.prototype.onDisplayMonthChanged=function(e){this.displayMonthChanged.raise(this,e);this._syncProp(this,"displayMonth")};Calendar.prototype.onFormatItem=function(e){this.formatItem.raise(this,e)};Calendar.prototype._containsFocusImpl=function(t){return e.prototype._containsFocusImpl.call(this,t)||this._lbYears._containsFocusImpl(t)};Calendar.prototype.dispose=function(){this._rptUp.element=null;this._rptDn.element=null;this._lbYears.dispose();e.prototype.dispose.call(this)};Calendar.prototype.refresh=function(t){void 0===t&&(t=!0);var i=this.hostElement,o=this.containsFocus();if(i){e.prototype.refresh.call(this,t);t&&this._updateContent();this._updateSelection();var n=this._getDisplayMonthRange(),s=this.displayMonth,r=null==n.from||s>n.from,a=null==n.to||s<n.to;wijmo_1.enable(this._btnPrv,r);wijmo_1.enable(this._btnNxt,a);r&&a||this.containsFocus()||this.focus();var l=!0,h=wijmo_1.DateTime.newDate(),u=this._min&&this._min>h,c=this._max&&this._max<h;(u||c)&&(l=!1);wijmo_1.enable(this._btnTdy,l);if(o&&!this._isButtonFocused()){var p=(this.monthView?this._tbMth:this._tbYr).querySelector("td."+wijmo_1.ControlStateClsNames.selected)||i;p&&!this.focusMode&&p.focus()}var d=this._getCalendars();d.length>1&&this.isThisMainCalendar()&&d.forEach((function(e,i){i>0&&e.refresh(t)}))}};Calendar.prototype._getShowMonthPicker=function(){var e=ShowMonthPicker,t=this._getCalendars(),i=t.indexOf(this),o=this.showMonthPicker;switch(o){case e.FirstMonth:case e.Outside:return 0==i?o:0;case e.LastMonth:return i==t.length-1?o:0;case e.FirstAndLastMonths:return 0==i||i==t.length-1?o:0;case e.AllMonths:return o}return 0};Calendar.prototype._getDisplayMonthRange=function(){var e={from:null,to:null};if(this.min||this.max){var t=this._getCalendars(),i=t.indexOf(this),o=this._mthMode()?wijmo_1.DateTime.addYears:wijmo_1.DateTime.addMonths;this.min&&(e.from=o(this._getMonth(this.min),i));this.max&&(e.to=o(this._getMonth(this.max),i-t.length+1))}return e};Calendar.prototype._getCalendar=function(e){return wijmo_1.Control.getControl(e)};Calendar.prototype._getCalendars=function(){var e=wijmo_1.closest(this.hostElement,"."+exports.CalendarClsNames.calendarMultiMonth);return(e?this._getCalendar(e):this)._cals};Calendar.prototype._syncProp=function(e,t){var i=this;if(!this._syncing){var o=this._getCalendars();if(o&&o.length>1){var n=e[t],s=this._mthMode()?wijmo_1.DateTime.addYears:wijmo_1.DateTime.addMonths;"displayMonth"==t&&(n=s(n,-o.indexOf(e)));o[0].deferUpdate((function(){i._syncing=!0;o.forEach((function(o,r){if(o!=e){var a=o.displayMonth;o[t]="displayMonth"==t?s(n,r):n;if("value"==t){o.displayMonth=a;i._rngMode()&&(o.rangeEnd=null)}}}));i._syncing=!1}))}}};Calendar.prototype._updateContent=function(){var e=this.displayMonth,t=wijmo_1.Globalize.format,i=wijmo_1.DateTime,o=this._getShowMonthPicker();wijmo_1.setText(this._spMth,t(e,this._fmtYrMo));var n=this._btnMth.querySelector("."+wijmo_1.GlyphClsNames.down);n&&(n.style.display=this._mthMode()||!o?"none":"");var s=wijmo_1.closest(this._btnTdy,"."+wijmo_1.InputFormElementsClsNames.btnGroup);s&&(s.style.display=o?"":"none");var r=null!=this._fdw?this._fdw:wijmo_1.Globalize.getFirstDayOfWeek(),a=i.addDays(e,-(e.getDay()-r+7)%7),l=i.monthLast(e),h=this._tbMth.querySelectorAll("th");this._updateMonthButtonAria();for(var u=0;u<7&&u<h.length;u++){var c=i.addDays(a,u);wijmo_1.setText(h[u],t(c,this._fmtDayHdr));wijmo_1.setAttribute(h[u],"tabIndex","-1");wijmo_1.setAttribute(h[u],"abbr",t(c,this._fmtDayTitle))}var p=!1;this._dateViewContainsFocus()&&(p=!0);var d=this._tbMth.querySelectorAll("tr");for(u=1;u<d.length;u++)wijmo_1.removeChild(d[u]);p&&this.focus();var _=i.addDays(a,-7*this._wksBefore);for(u=0;u<this._wksBefore;u++)_=this._addWeek(_,exports.CalendarClsNames.weekBefore);for(;_<=l;)_=this._addWeek(_);for(u=0;u<this._wksAfter;u++)_=this._addWeek(_,exports.CalendarClsNames.weekAfter);h=this._tbYr.querySelectorAll("td");var m=this._tbYr.querySelectorAll("th");m.length&&wijmo_1.setText(m[0],t(e,this._fmtYr));for(u=0;u<h.length;u++){_=i.newDate(e.getFullYear(),u,1);var f=h[u],b=!this._monthInValidRange(_);f[Calendar._DATE_KEY]=_;var g=wijmo_1.Globalize.format(_,"MMMM yyyy");wijmo_1.setText(f,t(_,this._fmtMonths));wijmo_1.toggleClass(f,wijmo_1.ControlStateClsNames.disabled,b);wijmo_1.setAriaLabel(f,g);wijmo_1.setAttribute(f,"tabIndex","-1");wijmo_1.setAttribute(f,"abbr",g)}this._confirmationButtonContainer&&(this._confirmationButtonContainer.style.display=this.showConfirmationButtons?"":"none");this._updateButtonTabIndex()};Calendar.prototype._updateSelection=function(){for(var e=Calendar._DATE_KEY,t=wijmo_1.DateTime,i=this._tbMth.querySelectorAll("td"),o=0;o<i.length;o++){var n=this.rangeEnd;this._rngMode()||(n=null);var s=(u=i[o])[e],r=this.value,a=this._selMode&&null!=r&&t.sameDate(s,r),l=this._selMode&&null!=r&&t.sameDate(s,n),h=this._selMode&&null!=r&&s>r&&null!=n&&s<=n;wijmo_1.toggleClass(u,wijmo_1.ControlStateClsNames.selected,a);wijmo_1.toggleClass(u,wijmo_1.ControlStateClsNames.multiSelected,h);wijmo_1.toggleClass(u,wijmo_1.ControlStateClsNames.lastSelected,l);wijmo_1.setAttribute(u,"aria-selected",!!a||null);this._customizeCell(o,s,u)}i=this._tbYr.querySelectorAll("td");for(o=0;o<i.length;o++){var u;s=(u=i[o])[e],a=this._sameMonth(s,this.value);wijmo_1.toggleClass(u,wijmo_1.ControlStateClsNames.selected,a);wijmo_1.setAttribute(u,"aria-selected",!!a||null)}this.focusMode&&!0!==this.isDisabled&&-1!==this.tabOrder&&this._updateFocusInAccessibilityMode()};Calendar.prototype._updateFocusInAccessibilityMode=function(){for(var e=Calendar._DATE_KEY,t=wijmo_1.DateTime,i=this._getCalendars(),o=0;o<i.length;o++)for(var n=i[o]._tbMth.querySelectorAll("td"),s=0;s<n.length;s++){var r=(h=n[s])[e],a=this._selMode&&null!=this.focusValue&&t.sameDate(r,this.focusValue)&&!wijmo_1.hasClass(h,exports.CalendarClsNames.dayOtherMonth);this._updateCellFocus(h,a)}var l=i[0]._tbYr.querySelectorAll("td");for(s=0;s<l.length;s++){var h;r=(h=l[s])[e],a=null!=this.focusValue&&this._sameMonth(r,this.focusValue);this._updateCellFocus(h,a)}};Calendar.prototype._addWeek=function(e,t){for(var i=this._createElement("tr",this._tbMth,t),o=wijmo_1.DateTime,n=0;n<7;n++){var s=this._createElement("td",i),r=o.addDays(e,n);s[Calendar._DATE_KEY]=r;wijmo_1.setText(s,wijmo_1.Globalize.format(r,this._fmtDay));wijmo_1.setAriaLabel(s,wijmo_1.Globalize.format(r,"D"));var a=!this._valid(r),l=r.getDay(),h=r.getMonth()!=this.displayMonth.getMonth();wijmo_1.toggleClass(s,exports.CalendarClsNames.dayToday,o.sameDate(r,o.newDate()));wijmo_1.toggleClass(s,exports.CalendarClsNames.dayWeekend,0==l||6==l);wijmo_1.toggleClass(s,exports.CalendarClsNames.dayOtherMonth,h);wijmo_1.toggleClass(s,wijmo_1.ControlStateClsNames.invalid,a||!this._inValidRange(r));wijmo_1.setAttribute(s,"aria-disabled",a||!this._inValidRange(r))}return o.addDays(e,7)};Calendar.prototype._customizeCell=function(e,t,i){wijmo_1.isFunction(this.itemFormatter)&&this.itemFormatter(t,i);if(this.formatItem.hasHandlers){var o=new FormatItemEventArgs(e,t,i);this.onFormatItem(o)}};Calendar.prototype._canChangeValue=function(){return!this._readOnly&&this._selMode!=DateSelectionMode.None};Calendar.prototype._valid=function(e){return!(!wijmo_1.isDate(e)||!wijmo_1.DateTime.sameDate(e,this._clamp(e)))&&(!wijmo_1.isFunction(this.itemValidator)||this.itemValidator(e))};Calendar.prototype._inValidRange=function(e){var t=wijmo_1.DateTime.fromDateTime;return!(this.min&&e<t(this.min,e))&&!(this.max&&e>t(this.max,e))};Calendar.prototype._monthInValidRange=function(e){if(this.min||this.max){var t=e.getFullYear(),i=e.getMonth(),o=wijmo_1.DateTime,n=o.newDate(t,i,1),s=o.newDate(t,i+1,0);if(this.min&&this.min>s)return!1;if(this.max&&this.max<n)return!1}return!0};Calendar.prototype._sameMonth=function(e,t){return wijmo_1.isDate(e)&&wijmo_1.isDate(t)&&e.getMonth()==t.getMonth()&&e.getFullYear()==t.getFullYear()};Calendar.prototype._getValidDate=function(e,t){if(wijmo_1.isDate(e))for(var i=e.getFullYear(),o=e.getMonth()+(t?0:1),n=t?1:0,s=wijmo_1.DateTime,r=s.newDate(i,o,n),a=t?1:-1,l=0;l<31;l++){if(this._valid(r))return r;r=s.addDays(r,a)}return null};Calendar.prototype._clamp=function(e){if(e){var t=wijmo_1.DateTime.fromDateTime;if(this.min){var i=t(this.min,e);e<i&&(e=i)}if(this.max){var o=t(this.max,e);e>o&&(e=o)}}return e};Calendar.prototype._createChildren=function(){var e=this.getTemplate();this.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+exports.CalendarClsNames.hostElement,e,{_tbHdr:"tbl-header",_btnMth:"btn-month",_spMth:"span-month",_btnPrv:"btn-prev",_btnTdy:"btn-today",_btnNxt:"btn-next",_tbMth:"tbl-month",_tbYr:"tbl-year"});this._tbYr.style.display="none";var t=wijmo_1.culture.Calendar.ariaLabels;wijmo_1.setAriaLabel(this._tbMth,t.chooseDate);wijmo_1.setAriaLabel(this._tbYr,t.chooseMonth);wijmo_1.setAriaLabel(this._btnPrv,t.calendar);wijmo_1.setAriaLabel(this._btnMth,t.monthView);wijmo_1.setAriaLabel(this._btnPrv,t.prvMo);wijmo_1.setAriaLabel(this._btnTdy,t.today);wijmo_1.setAriaLabel(this._btnNxt,t.nxtMo);for(var i=this._createElement("tr",this._tbMth,exports.CalendarClsNames.header),o=0;o<7;o++){this._createElement("th",i).setAttribute("scope","col")}i=this._createElement("tr",this._tbYr,exports.CalendarClsNames.header);this._showYearListBoxButton=this._createElement("th",i);this._showYearListBoxButton.setAttribute("colspan","4");this._showYearListBoxButton.setAttribute("scope","col");wijmo_1.setAriaLabel(this._showYearListBoxButton,t.selectYear);wijmo_1.toggleClass(this._showYearListBoxButton,exports.CalendarClsNames.selectedYear);this._showYearListBoxButton.setAttribute("role","button");this._showYearListBoxButton.setAttribute("tabIndex","-1");for(var n=0;n<3;n++){i=this._createElement("tr",this._tbYr);for(var s=0;s<4;s++)this._createElement("td",i)}};Calendar.prototype._createYearPicker=function(){var e=this,t=this.hostElement,i=this._createElement("div",null,exports.DropDownClsNames.dropDownPanel+" "+exports.CalendarClsNames.yearPicker);i.tabIndex=this._orgTabIndex;this._lbYears=new ListBox(i,{lostFocus:function(t){wijmo_1.hidePopup(i);e._tmYrHidden=Date.now();e.removeEventListener(window,"touchstart");if(t.selectedIndex>-1){var o=wijmo_1.DateTime.clone(e.displayMonth);o.setFullYear(t.selectedIndex+t.itemsSource[0]);e.displayMonth=o;e.focusMode&&(e.focusValue=o)}e.keyActionTab===CalendarTabKeyAction.All&&e._showYearListBoxButton.focus()}});wijmo_1.setAriaLabel(this._lbYears.hostElement,wijmo_1.culture.Calendar.ariaLabels.selectYear);this.addEventListener(i,"keydown",(function(i){switch(i.keyCode){case wijmo_1.Key.Enter:t.focus();break;case wijmo_1.Key.Space:t.focus();i.preventDefault();break;case wijmo_1.Key.Escape:e._lbYears.selectedIndex=-1;t.focus()}i.defaultPrevented&&i.stopPropagation()}));this.addEventListener(i,"click",(function(e){t.focus()}))};Calendar.prototype._createElement=function(e,t,i){var o=document.createElement(e);i&&wijmo_1.addClass(o,i);t&&t.appendChild(o);return o};Calendar.prototype._click=function(e){if(!e.defaultPrevented&&0==e.button){var t=!1,i=e.target;if(wijmo_1.contains(this._btnMth,i)&&!this._mthMode()&&this._getShowMonthPicker()){this.monthView=!this.monthView;t=!0}else if(wijmo_1.contains(this._btnPrv,i)){this._navigate(-1);if(this.focusMode){var o=wijmo_1.DateTime.addMonths(this.focusValue,-1);this.focusValue=o}t=!0}else if(wijmo_1.contains(this._btnNxt,i)){this._navigate(1);if(this.focusMode){o=wijmo_1.DateTime.addMonths(this.focusValue,1);this.focusValue=o}t=!0}else if(wijmo_1.contains(this._btnTdy,i)){this._navigate(0);this.focusMode&&(this.focusValue=this.value);t=!0}if(i&&!t&&this._yrPicker&&wijmo_1.contains(this._tbYr,i)&&wijmo_1.closest(i,"."+exports.CalendarClsNames.header)){this._showYearPickerAction(e);return}if(i&&!t){var n=wijmo_1.closest(i,"td");if(n){var s=this.hitTest(n),r=wijmo_1.DateTime.fromDateTime;if(this.monthView){if(s&&this._canChangeValue()){var a=r(s,this._value);this._inValidRange(a)&&this._valid(a)&&(this._rngMode()&&this.value&&!this.rangeEnd&&a>=this.value?this.rangeEnd=a:this.value=a);t=!0}}else if(s){this.displayMonth=s;if(this._mthMode()){if(this._canChangeValue()){a=r(this.displayMonth,this.value);this._inValidRange(a)&&(this.value=a)}}else this.monthView=!0;t=!0}}}if(t){e.preventDefault();this.focusMode||0===e.detail||this.focus()}}};Calendar.prototype._keydown=function(e){this._isSpaceDownForSetValue=!1;if(!e.defaultPrevented){if(e.altKey)switch(e.keyCode){case wijmo_1.Key.Up:case wijmo_1.Key.Down:return;case wijmo_1.Key.End:this._navigate(0);e.preventDefault();return}var t=e.target;if(("Enter"===e.key||"Space"===e.code)&&t&&this.keyActionTab===CalendarTabKeyAction.All){if(wijmo_1.contains(this._btnMth,t)&&!this._mthMode()&&this._getShowMonthPicker()){this.monthView=!this.monthView;"Space"===e.code&&e.preventDefault();return}if(this._yrPicker&&wijmo_1.contains(this._tbYr,t)&&wijmo_1.closest(t,"."+exports.CalendarClsNames.header)){this._showYearPickerAction(e);return}}if(this.focusMode){if(("Enter"===e.key||"Space"===e.code)&&t.classList.contains(exports.CalendarClsNames.focused)){var i=wijmo_1.closest(t,"td");if(i){var o=this.hitTest(i);this._isSpaceDownForSetValue="Space"===e.code;this.setFocusModeValue(o,e)}"Space"===e.code&&e.preventDefault();return}if(!wijmo_1.contains(this._tbMth,e.target)&&(!wijmo_1.contains(this._tbYr,e.target)||wijmo_1.contains(this._tbYr.firstElementChild,e.target)))return;if("Tab"===e.key&&this.monthView){var n=this._getCalendars();if(this!==n[e.shiftKey?0:n.length-1]){var s=wijmo_1.DateTime.addMonths(this.focusValue,e.shiftKey?-1:1);this.focusValue=s;e.preventDefault()}}}if(!(e.ctrlKey||e.metaKey||e.shiftKey&&!this._rngMode())){var r=this._getKeyCode(e),a=0,l=0,h=!0;if(this.monthView)switch(r){case wijmo_1.Key.Left:a=-1;break;case wijmo_1.Key.Right:a=1;break;case wijmo_1.Key.Up:a=-7;break;case wijmo_1.Key.Down:a=7;break;case wijmo_1.Key.PageDown:l=e.altKey?12:1;break;case wijmo_1.Key.PageUp:l=e.altKey?-12:-1;break;case wijmo_1.Key.Home:case wijmo_1.Key.End:if(this._canChangeValue()&&!e.shiftKey){var u=this.value||this.displayMonth;if(p=this._getValidDate(u,r==wijmo_1.Key.Home)){this.value=wijmo_1.DateTime.fromDateTime(p,this.value);this._rngEnd=null}}break;default:h=!1}else switch(r){case wijmo_1.Key.Left:l=-1;break;case wijmo_1.Key.Right:l=1;break;case wijmo_1.Key.Up:l=-4;break;case wijmo_1.Key.Down:l=4;break;case wijmo_1.Key.PageDown:l=e.altKey?120:12;break;case wijmo_1.Key.PageUp:l=e.altKey?-120:-12;break;case wijmo_1.Key.Home:l=this.value?-this.value.getMonth():0;break;case wijmo_1.Key.End:l=this.value?11-this.value.getMonth():0;break;case wijmo_1.Key.Enter:this._mthMode()?h=!1:this.monthView=!0;break;default:h=!1}if(this._canChangeValue()&&(a||l)){var c=e.shiftKey&&null!=this.rangeEnd?this.rangeEnd:this.focusMode?this.focusValue:this.value,p=wijmo_1.DateTime;if(c){c=p.addDays(c,a);c=p.addMonths(c,l)}else c=this._getValidDate(new Date,!0);if(l&&!this._valid(c)){u=c.getMonth();for(var d=1;d<31&&!this._valid(c);d++){var _=p.addDays(c,+d),m=p.addDays(c,-d);this._valid(_)&&_.getMonth()==u?c=_:this._valid(m)&&m.getMonth()==u&&(c=m)}}for(d=0;d<31&&!this._valid(c);d++)c=p.addDays(c,a>0||l>0?1:-1);e.shiftKey&&this._rngMode()&&c>this.value?this.rangeEnd=c:this.focusMode?this.focusValue=c:this.value=c}h&&e.preventDefault()}}};Calendar.prototype._getMonth=function(e){var t=wijmo_1.DateTime;e=e||t.newDate();return t.newDate(e.getFullYear(),e.getMonth(),1)};Calendar.prototype._mthMode=function(){return this.selectionMode==DateSelectionMode.Month};Calendar.prototype._rngMode=function(){return this.selectionMode==DateSelectionMode.Range};Calendar.prototype._navigate=function(e){var t=this.monthView,i=this.displayMonth,o=wijmo_1.DateTime;switch(e){case 0:var n=o.newDate();this._canChangeValue()&&(this.value=t?o.fromDateTime(n,this.value):this._getMonth(n));i=this._getMonth(n);break;case 1:i=o.addMonths(i,t?1:12);break;case-1:i=o.addMonths(i,t?-1:-12)}this.displayMonth=i};Calendar.prototype._setTabOrder=function(t){e.prototype._setTabOrder.call(this,t);this._lbYears.tabOrder=this._orgTabIndex;this._getCalendars().forEach((function(e){e.tabOrder!=t&&(e.tabOrder=t)}));this.updateCalendarsTabindex()};Calendar.prototype._showYearPickerAction=function(e){var t=this,i=e.target;if(Date.now()-this._tmYrHidden<600)e.preventDefault();else{for(var o=this.displayMonth.getFullYear(),n=this.min?this.min.getFullYear():o-100,s=this.max?this.max.getFullYear():o+100,r=[],a=n;a<=s;a++)r.push(a);var l=this._lbYears,h=l.hostElement,u=wijmo_1.closest(i,"."+exports.CalendarClsNames.header),c=this.hostElement,p=wijmo_1.closest(c,"."+exports.InputDateClsNames.inputDateDropDown)||c;l.itemsSource=r;l.selectedIndex=o-r[0];wijmo_1.setAttribute(h,"dir",this.rightToLeft?"rtl":null);wijmo_1.setCss(h,{minWidth:"",width:u.offsetWidth});wijmo_1.showPopup(h,u,!1,!1,p);requestAnimationFrame((function(){l.showSelection(!0)}));this.addEventListener(window,"touchstart",(function(e){if(!wijmo_1.contains(h,e.target)){wijmo_1.hidePopup(h);t._tmYrHidden=Date.now();t.removeEventListener(window,"touchstart")}}));e.preventDefault()}};Object.defineProperty(Calendar.prototype,"focusMode",{get:function(){return this._focusMode},set:function(e){this._focusMode=e;this._getCalendars().forEach((function(t){t.focusMode!==e&&(t.focusMode=e)}));this.updateCalendarsTabindex();this.invalidate()},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"keyActionTab",{get:function(){return this._keyActionTab},set:function(e){this._keyActionTab=e;this._updateButtonTabIndex()},enumerable:!0,configurable:!0});Calendar.prototype._isButtonFocused=function(){var e=wijmo_1.getActiveElement();if(!e)return!1;var t=e.getAttribute("role"),i=e.type;return t&&"button"===t.toLowerCase()||i&&"button"===i.toLowerCase()};Calendar.prototype._isSameMonth=function(e,t){return e.getMonth()===t.getMonth()};Calendar.prototype._dateViewContainsFocus=function(){var e=this._tbYr.querySelectorAll("td"),t=Array.from(e).find((function(e){return e===wijmo_1.getActiveElement()}));return this._tbMth.contains(wijmo_1.getActiveElement())||void 0!==t};Calendar.prototype._updateMonthButtonAria=function(){var e=wijmo_1.culture.Calendar.ariaLabels,t=this.monthView?e.monthView:e.yearView;wijmo_1.setAriaLabel(this._btnMth,t+", "+wijmo_1.Globalize.format(this.displayMonth,this._fmtYrMo))};Calendar.prototype._isDayValid=function(e){return this._valid(e)&&this._inValidRange(e)};Calendar.prototype.cancelButtonClick=function(e){this.cancelButtonClicked.raise(this,e)};Calendar.prototype.oneCancelButtonClick=function(e){this.cancelButtonClick(e)};Calendar.prototype.OKButtonClick=function(e){this.OKButtonClicked.raise(this,e)};Calendar.prototype.onOkButtonClick=function(e){this.OKButtonClick(e);this.setFocusModeValue(this.focusValue)};Object.defineProperty(Calendar.prototype,"ariaLabel",{get:function(){return this._ariaLabel},set:function(e){if(this.ariaLabel!==e&&this.hostElement){this._ariaLabel=e;wijmo_1.setAttribute(this.hostElement,"aria-label",e)}},enumerable:!0,configurable:!0});Calendar.prototype._updateButtonTabIndex=function(){var e=this.tabOrder.toString();if(this.keyActionTab===CalendarTabKeyAction.All&&!0!==this.isDisabled){wijmo_1.setAttribute(this._btnMth,"tabindex",e);wijmo_1.setAttribute(this._btnPrv,"tabindex",e);wijmo_1.setAttribute(this._btnTdy,"tabindex",e);wijmo_1.setAttribute(this._btnNxt,"tabindex",e);wijmo_1.setAttribute(this._showYearListBoxButton,"tabindex",e)}else{wijmo_1.setAttribute(this._btnMth,"tabindex","-1");wijmo_1.setAttribute(this._btnPrv,"tabindex","-1");wijmo_1.setAttribute(this._btnTdy,"tabindex","-1");wijmo_1.setAttribute(this._btnNxt,"tabindex","-1");wijmo_1.setAttribute(this._showYearListBoxButton,"tabindex","-1")}wijmo_1.setAttribute(this._btnOK,"tabindex",e);wijmo_1.setAttribute(this._btnCancel,"tabindex",e)};Calendar.prototype._onEnterKeyDownToSetValue=function(e){this._enterKeyDownToSetValue.raise(this,e)};Object.defineProperty(Calendar.prototype,"showConfirmationButtons",{get:function(){return this._showConfirmationButtons},set:function(e){this._showConfirmationButtons=e;this._getCalendars().forEach((function(t){t._showConfirmationButtons=e}))},enumerable:!0,configurable:!0});Calendar.prototype._setIsDisabled=function(t){e.prototype._setIsDisabled.call(this,t);this._updateButtonTabIndex()};Calendar.prototype.updateCalendarsTabindex=function(){var e=this.focusMode||-1===this.tabOrder?-1:0;this._getCalendarsHostElements().forEach((function(t){t.tabIndex=e}))};Calendar.prototype.setFocusModeValue=function(e,t){var i=wijmo_1.DateTime.fromDateTime;if(this.monthView){if(e&&this._canChangeValue()){var o=i(e,this._value);if(this._inValidRange(o)&&this._valid(o))if(this._rngMode()&&this.value&&!this.rangeEnd&&o>=this.value)this.rangeEnd=o;else{t&&this._enterKeyDownToSetValue.raise(this,t);this.value=o}}}else if(e){this.displayMonth=e;if(this._mthMode()){if(this._canChangeValue()){o=i(this.displayMonth,this.value);this._inValidRange(o)&&(this.value=o)}}else this.monthView=!0}};Calendar.prototype._getCalendarsHostElements=function(){return this._getCalendars().filter((function(e,t){return t>0})).map((function(e){return e.hostElement}))};Calendar.prototype.updateConfirmationButtons=function(e){if(!this._confirmationButtonContainer){var t='<div class="'+exports.CalendarClsNames.confirmationButtonContainer+'"></div>';this._confirmationButtonContainer=wijmo_1.createElement(t);this._btnOK=wijmo_1.createElement('<button wj-part="btn-ok" class="'+wijmo_1.InputFormElementsClsNames.btn+" "+exports.CalendarClsNames.button+'"></button>');this._btnCancel=wijmo_1.createElement('<button wj-part="btn-cancel" class="'+wijmo_1.InputFormElementsClsNames.btn+" "+exports.CalendarClsNames.button+'"></button>');var i=wijmo_1.culture.Calendar.buttons;wijmo_1.setText(this._btnOK,i.ok);wijmo_1.setText(this._btnCancel,i.cancel);var o=this.addEventListener.bind(this);o(this._btnCancel,"click",this.oneCancelButtonClick.bind(this));o(this._btnOK,"click",this.onOkButtonClick.bind(this));this._confirmationButtonContainer.appendChild(this._btnOK);this._confirmationButtonContainer.appendChild(this._btnCancel);e.appendChild(this._confirmationButtonContainer)}};Calendar.prototype.setFocusValueToFirstOrLastCalendar=function(e){var t,i=this._getCalendars();t=this.monthView?e?i[0].displayMonth:i[i.length-1].displayMonth:i[0].displayMonth;var o=this.focusValue.getDate(),n=new Date(t.getFullYear(),t.getMonth()+1,0).getDate(),s=new Date(t.getFullYear(),t.getMonth(),Math.min(o,n));this.focusValue=s};Calendar.prototype.isCalendarDateCell=function(e){return!wijmo_1.isNullOrUndefined(e[Calendar._DATE_KEY])&&"td"===e.tagName.toLowerCase()};Calendar.prototype.isThisMainCalendar=function(){return this==this._getCalendars()[0]};Calendar._DATE_KEY="$WJ-DATE";Calendar._ctrlTemplate="";return Calendar}(wijmo_1.Control);exports.Calendar=Calendar;function softTouch(){return wijmo_1._getModule("wijmo.touch")}exports.softTouch=softTouch;function getDragDropTouch(){var e=softTouch();return e&&e.DragDropTouch&&e.DragDropTouch.getInstance?e.DragDropTouch.getInstance():null}exports.getDragDropTouch=getDragDropTouch;wijmo_1._addCultureInfo("DropDown",{ariaLabels:{tgl:"Toggle Dropdown"}});!function(e){e[e.Select=0]="Select";e[e.Open=1]="Open";e[e.Toggle=2]="Toggle"}(ClickAction=exports.ClickAction||(exports.ClickAction={}));!function(e){e[e.ChangeSelectionOnly=0]="ChangeSelectionOnly";e[e.OpenDropdown=1]="OpenDropdown"}(KeyAction=exports.KeyAction||(exports.KeyAction={}));!function(e){e[e.CloseAndKeepFocus=0]="CloseAndKeepFocus";e[e.CloseAndMoveFocus=1]="CloseAndMoveFocus"}(TabKeyAction=exports.TabKeyAction||(exports.TabKeyAction={}));var PopupTrigger,_Edges,DropDown=function(e){__extends(DropDown,e);function DropDown(t,i){var o=e.call(this,t)||this;o._clickAction=ClickAction.Select;o._showBtn=!0;o._autoExpand=!0;o._animate=!1;o._internalSettingText=!1;o._oldText="";o._keyActionDownArrow=KeyAction.ChangeSelectionOnly;o._keyActionUpArrow=KeyAction.ChangeSelectionOnly;o._keyActionTab=TabKeyAction.CloseAndMoveFocus;o._touchMove=!1;o._isDropdownOpened=!1;o.textChanged=new wijmo_1.Event;o.isDroppedDownChanging=new wijmo_1.Event;o.isDroppedDownChanged=new wijmo_1.Event;var n,s=o.getTemplate();o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.DropDownClsNames.hostElement,s,{_tbx:"input",_btn:"btn",_dropDown:"dropdown"},"input");o.hostElement&&o.hostElement.id&&(n=o.hostElement.id);n&&o._dropDown&&o._dropDown.setAttribute("dropdown-id",n);o._dropDown.style.display="none";var r=wijmo_1.culture.DropDown.ariaLabels;wijmo_1.setAriaLabel(o._btn.querySelector("button"),r.tgl);o._elRef=o._tbx;var a=o._tbx;wijmo_1.disableAutoComplete(a);o._createDropDown();o._updateTbxAriaHaspopup();o._updateBtn();o._updateTbx();var l=o.hostElement;wijmo_1.addClass(l,wijmo_1.ControlStateClsNames.collapsed);o.addEventListener(window,"resize",(function(){o.isDroppedDown&&o.invalidate()}));var h=o.dropDown,u=o.addEventListener.bind(o),c=o._updateFocusState.bind(o);u(h,"blur",c,!0);u(h,"focus",c);var p=o._keydown.bind(o);u(l,"keydown",p);u(h,"keydown",p);var d=o._keypress.bind(o);u(l,"keypress",d,!0);u(h,"keypress",d,!0);var _=o._input.bind(o);u(a,"input",_);u(a,"beforeinput",(function(e){"historyUndo"!==e.inputType&&"historyRedo"!==e.inputType||e.preventDefault()}));u(a,"blur",(function(){o._commitText(!0,!1)}),!0);u(a,"click",(function(){o._autoExpand&&o._expandSelection()}));u(a,"touchstart",(function(){o.isTouching&&"none"===a.getAttribute("inputmode")&&a.removeAttribute("inputmode")}));u(a,"mousedown",(function(e){if(o._isTouchMoved())e.preventDefault();else switch(o._clickAction){case ClickAction.Open:if(!o.isDroppedDown){e.preventDefault();o.focus();o.isDroppedDown=!0}break;case ClickAction.Toggle:e.preventDefault();o.focus();o.isDroppedDown=!o.isDroppedDown}}));u(o._btn,"mousedown",(function(e){o._isTouchMoved()||o._btnclick(e)}));wijmo_1.removeChild(h);wijmo_1.isIE()&&o._elRef==o._tbx&&u(l,"mouseup",(function(e){if(!e.defaultPrevented&&0==e.button&&wijmo_1.hasClass(e.target,wijmo_1.InputFormElementsClsNames.btn)){var t=wijmo_1.getActiveElement();t&&t!=e.target&&setTimeout((function(){t.focus()}))}}));wijmo_1.isIE9()&&u(a,"keyup",(function(){o._setText(o.text,!1)}));u(h,"click",o._dropDownClick.bind(o));return o}Object.defineProperty(DropDown,"controlTemplate",{get:function(){DropDown._ctrlTemplate||(DropDown._ctrlTemplate='<div class="'+wijmo_1.ControlClsNames.template+'"><div class="'+exports.InputClsNames.input+'"><div class="'+exports.InputClsNames.inputGroup+" "+exports.InputClsNames.inputBtnVisible+'"><input wj-part="input" type="text" class="'+wijmo_1.InputFormElementsClsNames.formControl+'"><span wj-part="btn" class="'+exports.InputClsNames.inputGroupBtn+'"><button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1"><span class='+wijmo_1.GlyphClsNames.down+'></span></button></span></div></div><div wj-part="dropdown" class="'+wijmo_1.ControlClsNames.content+" "+exports.DropDownClsNames.dropDownPanel+'"></div></div>');return DropDown._ctrlTemplate},set:function(e){DropDown._ctrlTemplate=e},enumerable:!0,configurable:!0});DropDown.prototype._isTouchMoved=function(){var e=getDragDropTouch();return e&&e.isDragging};Object.defineProperty(DropDown.prototype,"text",{get:function(){return this._tbx.value},set:function(e){if(e!=this.text){this._setText(e,!0);this._commitText()}},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"inputElement",{get:function(){return this._tbx},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"inputType",{get:function(){return this._tbx.type},set:function(e){this._tbx.type=wijmo_1.asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"isReadOnly",{get:function(){return this._tbx.readOnly},set:function(e){this._tbx.readOnly=wijmo_1.asBoolean(e);wijmo_1.toggleClass(this.hostElement,wijmo_1.ControlStateClsNames.readOnly,this.isReadOnly);this.isReadOnly&&this._toggleDropDown(!1)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"isRequired",{get:function(){return this._tbx.required},set:function(e){this._tbx.required=wijmo_1.asBoolean("boolean"==typeof e?e:this.isRequired)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"placeholder",{get:function(){return this._tbx.placeholder},set:function(e){this._tbx.placeholder=e},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"clickAction",{get:function(){return this._clickAction},set:function(e){this._clickAction=wijmo_1.asEnum(e,ClickAction)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"isDroppedDown",{get:function(){var e=this._dropDown;return e&&"none"!=e.style.display},set:function(e){var t=this.hostElement,i=this._dropDown,o=this.containsFocus(),n=new Set(["InputDateTime","WjInputDateTime"]);if(t&&i){var s=!this.isReadOnly;this.isTouching&&(s=!0);e=wijmo_1.asBoolean(e)&&!this.isDisabled&&s&&t.offsetWidth>0;this.isDroppedDown&&!e&&this.isDisabled&&(e=this.isDroppedDown);if(e||"INPUT"!=wijmo_1.getActiveElement().tagName||this.inputElement===wijmo_1.getActiveElement()||!this._isInvalidInputCancelled){if(e!=this.isDroppedDown&&(n.has(this.constructor.name)||!this._isInvalidInputCancelled||!this.isDroppedDown&&this._isInvalidInputCancelled)&&this.onIsDroppedDownChanging(new wijmo_1.CancelEventArgs)){this._toggleDropDown(e);o&&(this.isTouching&&this.showDropDownButton?t.focus():this.selectAll());this._updateFocusState();this._updateBtn();this._updateTbx();wijmo_1.toggleClass(t,wijmo_1.ControlStateClsNames.collapsed,!this.isDroppedDown);this.onIsDroppedDownChanged()}}else{this._isDropdownOpened=this.isDroppedDown;this._toggleDropDown(e)}}},enumerable:!0,configurable:!0});DropDown.prototype._toggleDropDown=function(e){var t=this,i=this.hostElement,o=this._dropDown;if(e){this._minWidthDropdown=o.style.minWidth;o.style.display="";this._updateDropDown();this.addEventListener(window,"touchstart",(function(e){for(var o=wijmo_1.Control._touching,n=e.target;n;){if(n==i)return;n=n[wijmo_1.Control._OWNR_KEY]||n.parentNode}wijmo_1.Control._touching=!0;t.isDroppedDown=!1;wijmo_1.Control._touching=o}))}else{this.removeEventListener(window,"touchstart");wijmo_1.hidePopup(o);o.style.minWidth=this._minWidthDropdown}};Object.defineProperty(DropDown.prototype,"dropDown",{get:function(){return this._dropDown},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"dropDownCssClass",{get:function(){return this._cssClass},set:function(e){if(e!=this._cssClass){wijmo_1.removeClass(this._dropDown,this._cssClass);this._cssClass=wijmo_1.asString(e);wijmo_1.addClass(this._dropDown,this._cssClass)}},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"showDropDownButton",{get:function(){return this._showBtn},set:function(e){this._showBtn=wijmo_1.asBoolean(e);this._updateBtn()},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"autoExpandSelection",{get:function(){return this._autoExpand},set:function(e){this._autoExpand=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"isAnimated",{get:function(){return this._animate},set:function(e){this._animate=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"keyActionDownArrow",{get:function(){return this._keyActionDownArrow},set:function(e){this._keyActionDownArrow=wijmo_1.asEnum(e,KeyAction)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"keyActionUpArrow",{get:function(){return this._keyActionUpArrow},set:function(e){this._keyActionUpArrow=wijmo_1.asEnum(e,KeyAction)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"keyActionTab",{get:function(){return this._keyActionTab},set:function(e){this._keyActionTab=wijmo_1.asEnum(e,TabKeyAction)},enumerable:!0,configurable:!0});DropDown.prototype.selectAll=function(){var e=this._tbx;this._elRef==e&&wijmo_1.setSelectionRange(e,0,this.text.length);this.containsFocus()||this.focus()};DropDown.prototype.onTextChanged=function(e){this.textChanged.raise(this,e);this._updateState()};DropDown.prototype.onIsDroppedDownChanging=function(e){this.isDroppedDownChanging.raise(this,e);return!e.cancel};DropDown.prototype.onIsDroppedDownChanged=function(e){this.isDroppedDownChanged.raise(this,e)};DropDown.prototype.onGotFocus=function(t){this.isTouching||wijmo_1.contains(this._dropDown,wijmo_1.getActiveElement())||this.selectAll();e.prototype.onGotFocus.call(this,t)};DropDown.prototype.onLostFocus=function(t){this._commitText();this.isDroppedDown=!1;e.prototype.onLostFocus.call(this,t)};DropDown.prototype._containsFocusImpl=function(t){return e.prototype._containsFocusImpl.call(this,t)||this.isDroppedDown&&wijmo_1.contains(this._dropDown,t)};DropDown.prototype.dispose=function(){this.isDroppedDown=!1;var t=this._dropDown;if(t){this._dropDown=null;wijmo_1.removeChild(t);var i=wijmo_1.Control.getControl(t);i&&i.dispose()}e.prototype.dispose.call(this)};DropDown.prototype.refresh=function(t){void 0===t&&(t=!0);e.prototype.refresh.call(this,t);var i=this.hostElement;if(i&&i.offsetHeight&&this.isDroppedDown){var o=wijmo_1.getActiveElement();this.isAnimated&&""!=this._dropDown.style.opacity||wijmo_1.showPopup(this._dropDown,i,!1,!1,null==this.dropDownCssClass);o instanceof HTMLElement&&o!=wijmo_1.getActiveElement()&&o.focus()}};DropDown.prototype._handleResize=function(){this.isDroppedDown&&this.refresh()};DropDown.prototype._dropDownClick=function(e){e.stopPropagation()};DropDown.prototype._expandSelection=function(){var e=this._tbx,t=e.value,i=e.selectionStart,o=e.selectionEnd;if(t&&i==o){var n=this._getCharType(t,i);if(n>-1){for(;o<t.length&&this._getCharType(t,o)==n;o++);for(;i>0&&this._getCharType(t,i-1)==n;i--);i!=o&&wijmo_1.setSelectionRange(e,i,o)}}};DropDown.prototype._getCharType=function(e,t){var i=e[t];return i>="0"&&i<="9"?0:i>="a"&&i<="z"||i>="A"&&i<="Z"?1:-1};DropDown.prototype._keydown=function(e){if(!e.defaultPrevented&&!this._isHiddenEditor()){switch(e.keyCode){case wijmo_1.Key.Escape:case wijmo_1.Key.Enter:if(this.isDroppedDown){this.isDroppedDown=!1;this.containsFocus()||this.focus();e.preventDefault()}break;case wijmo_1.Key.F4:this.toggleDropDown(e);break;case wijmo_1.Key.Up:this.handleUpArrowKey(e);break;case wijmo_1.Key.Down:this.handleDownArrowKey(e)}if(!e.defaultPrevented&&e.keyCode==wijmo_1.Key.Escape&&wijmo_1.isIE()){var t=this._tbx;if(e.target==t){var i=t.value;t.value=i+" ";t.value=i}}}};DropDown.prototype.toggleDropDown=function(e){if(this.isHostVisible()){this.isDroppedDown=!this.isDroppedDown;e.preventDefault()}};DropDown.prototype.handleUpArrowKey=function(e){e.altKey?this.toggleDropDown(e):this.keyActionUpArrow!==KeyAction.OpenDropdown||this.isDroppedDown||this.openDropDown(e)};DropDown.prototype.handleDownArrowKey=function(e){if(e.altKey)this.toggleDropDown(e);else if(this.keyActionDownArrow===KeyAction.OpenDropdown&&!this.isDroppedDown){this.openDropDown(e);this._afterOpenDropdownByDownArrow()}};DropDown.prototype._afterOpenDropdownByDownArrow=function(){};DropDown.prototype.openDropDown=function(e){if(this.isHostVisible()){this.isDroppedDown=!0;e.preventDefault()}};DropDown.prototype.isHostVisible=function(){var e=this.hostElement;return!(!e||!e.offsetHeight)};DropDown.prototype._isHiddenEditor=function(){return wijmo_1.hasClass(this._tbx,"wj-grid-ime")};DropDown.prototype._keypress=function(e){"AltLeft"!=e.code&&"AltRight"!=e.code||e.preventDefault()};DropDown.prototype._input=function(e){this._setText(this.text,!1)};DropDown.prototype._btnclick=function(e){if(!e.defaultPrevented&&0==e.button){this._isInvalidInputCancelled=!1;e.preventDefault();if(this.isTouching){this._tbx.getAttribute("inputmode");this._tbx.setAttribute("inputmode","none");this.isDroppedDown=!this.isDroppedDown;this.selectAll()}else{this.focus();this.isDroppedDown=!this.isDroppedDown}}};DropDown.prototype._setText=function(e,t,i,o){var n=!1;if((e=(e||"").toString())!=this._tbx.value){this._tbx.value=e;if(i||!e){this.onTextChanged();n=!0}}if(e!=this._oldText){this._oldText=e;this._internalSettingText||n||this.onTextChanged()}o&&(this._tbx.value=this._tbx.value.trim());this._updateState()};DropDown.prototype._updateBtn=function(){this._btn.style.display=this._showBtn?"":"none";this._updateBtnAria()};DropDown.prototype._updateBtnAria=function(){var e=this._btn.querySelector("button"),t=this.isDroppedDown,i=this.dropDown?this.dropDown.id:null;wijmo_1.setAttribute(e,"aria-expanded",!!t);wijmo_1.setAttribute(e,"aria-controls",t?i:null)};DropDown.prototype._updateTbx=function(){this._updateTbxAria()};DropDown.prototype._updateTbxAria=function(){var e=this._tbx,t=this.isDroppedDown,i=this.dropDown?this.dropDown.id:null;wijmo_1.setAttribute(e,"aria-controls",t?i:null);wijmo_1.setAttribute(e,"aria-expanded",t)};DropDown.prototype._updateTbxAriaHaspopup=function(){var e=this._tbx,t=this.dropDown&&this.dropDown.getAttribute("role");wijmo_1.setAttribute(e,"aria-haspopup",t)};DropDown.prototype._createDropDown=function(){};DropDown.prototype._commitText=function(e,t){};DropDown.prototype._updateDropDown=function(){if(this.isDroppedDown){this._commitText();var e=this.dropDown;wijmo_1.setAttribute(e,"dir",this.rightToLeft?"rtl":null);wijmo_1.showPopup(e,this.hostElement,!1,this._animate,null==this.dropDownCssClass)}};DropDown.prototype._shouldRaiseInvalidInput=function(e){return wijmo_1.isNullOrUndefined(e)?!this._containsFocus():e};DropDown._ctrlTemplate="";return DropDown}(wijmo_1.Control);exports.DropDown=DropDown;wijmo_1._addCultureInfo("Popup",{ariaLabels:{close:"close",backdrop:"backdrop",isDraggable:"draggable",isResizable:"resizable",popupVisible:"visible",popupHide:"hidden",popup:"popup"}});!function(e){e[e.None=0]="None";e[e.ClickOwner=1]="ClickOwner";e[e.ClickPopup=2]="ClickPopup";e[e.Click=3]="Click";e[e.BlurOwner=4]="BlurOwner";e[e.BlurPopup=8]="BlurPopup";e[e.Blur=12]="Blur";e[e.ClickOrBlur=15]="ClickOrBlur";e[e.DownOwner=16]="DownOwner";e[e.DownPopup=32]="DownPopup";e[e.Down=48]="Down";e[e.EnterOwner=64]="EnterOwner";e[e.EnterPopup=128]="EnterPopup";e[e.Enter=192]="Enter";e[e.LeaveOwner=256]="LeaveOwner";e[e.LeavePopup=512]="LeavePopup";e[e.Leave=768]="Leave"}(PopupTrigger=exports.PopupTrigger||(exports.PopupTrigger={}));!function(e){e[e.None=0]="None";e[e.Left=1]="Left";e[e.Top=2]="Top";e[e.Right=4]="Right";e[e.Bottom=8]="Bottom";e[e.LeftTop=3]="LeftTop";e[e.RightTop=6]="RightTop";e[e.RightBottom=12]="RightBottom";e[e.LeftBottom=9]="LeftBottom"}(_Edges||(_Edges={}));var Popup=function(e){__extends(Popup,e);function Popup(t,i){var o=e.call(this,t)||this;o._owner=null;o._ariaLabel=wijmo_1.culture.Popup.ariaLabels.popup;o._modal=!1;o._position=wijmo_1.PopupPosition.BelowLeft;o._showTrigger=PopupTrigger.ClickOwner;o._hideTrigger=PopupTrigger.Blur;o._hideAnim=[];o._fadeIn=!0;o._fadeOut=!0;o._removeOnHide=!0;o._draggable=!1;o._resizable=!1;o._result=null;o._resultEnter=null;o._resultSubmit=null;o._callback=null;o._visible=!1;o._ownerClickBnd=o._ownerClick.bind(o);o._ownerDownBnd=o._ownerDown.bind(o);o._ownerBlurBnd=o._ownerBlur.bind(o);o._ownerEnterBnd=o._ownerEnter.bind(o);o._ownerLeaveBnd=o._ownerLeave.bind(o);o._mousedownBnd=o._mousedown.bind(o);o._mousemoveBnd=o._mousemove.bind(o);o._mousedragBnd=o._mousedrag.bind(o);o._mouseupBnd=o._mouseup.bind(o);o._hideBnd=o.hide.bind(o);o._lastShow=0;o._initialOwner=null;o._activeEdge=_Edges.None;o.showing=new wijmo_1.Event;o.shown=new wijmo_1.Event;o.hiding=new wijmo_1.Event;o.hidden=new wijmo_1.Event;o.resizing=new wijmo_1.Event;o.resized=new wijmo_1.Event;o.dragging=new wijmo_1.Event;o.dragged=new wijmo_1.Event;o.sizeChanging=new wijmo_1.Event;o.sizeChanged=new wijmo_1.Event;o.positionChanging=new wijmo_1.Event;o.positionChanged=new wijmo_1.Event;var n=o.hostElement;Popup._PopupInstanceCount++;wijmo_1.addClass(n,wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.PopupClsNames.hostElement);if(o.hostElement){o._initialOwner=o.hostElement.parentElement;wijmo_1.setAttribute(o.hostElement,"role","dialog")}n.getAttribute("tabindex")||(n.tabIndex=0);wijmo_1.hidePopup(n,!1);var s=o.addEventListener.bind(o);s(n,"compositionstart",(function(){o._composing=!0}));s(n,"compositionend",(function(){o._composing=!1}));s(window,"resize",(function(){!o.isVisible||o._dragged||o.isTouching||o.invalidate()}));s(n,"keydown",(function(e){if(!e.defaultPrevented){var t=e.ctrlKey&&e.altKey&&!e.shiftKey,i=e.ctrlKey&&e.shiftKey&&!e.altKey;if(t||i){var s=o.hostElement.getBoundingClientRect(),r=wijmo_1.Rect.fromBoundingRect(s);if(t&&o.isDraggable){e.preventDefault();switch(e.keyCode){case wijmo_1.Key.Left:r.left=Math.max(0,r.left-10);break;case wijmo_1.Key.Right:r.left=Math.min(window.innerWidth-r.width,r.left+10);break;case wijmo_1.Key.Up:r.top=Math.max(0,r.top-10);break;case wijmo_1.Key.Down:r.top=Math.min(window.innerHeight-r.height,r.top+10)}var a=new PopupBoundsChangingEventArgs(r);if(o.onPositionChanging(a)){wijmo_1.setCss(o.hostElement,{left:r.left+window.scrollX,top:r.top+window.scrollY,transform:"none"});o.onPositionChanged()}}else if(i&&o.isResizable){e.preventDefault();var l=window.getComputedStyle(o.hostElement),h=Math.max(parseInt(l.minWidth)||0,Popup._SZ_MIN),u=Math.max(parseInt(l.minHeight)||0,Popup._SZ_MIN);if(o._activeEdge===_Edges.None)switch(e.keyCode){case wijmo_1.Key.Up:o._activeEdge=_Edges.Top;break;case wijmo_1.Key.Down:o._activeEdge=_Edges.Bottom;break;case wijmo_1.Key.Left:o._activeEdge=_Edges.Left;break;case wijmo_1.Key.Right:o._activeEdge=_Edges.Right}var c=o._activeEdge===_Edges.Top||o._activeEdge===_Edges.Bottom,p=o._activeEdge===_Edges.Left||o._activeEdge===_Edges.Right;if(c&&![wijmo_1.Key.Up,wijmo_1.Key.Down].includes(e.keyCode)||p&&![wijmo_1.Key.Left,wijmo_1.Key.Right].includes(e.keyCode))return;if(o._activeEdge!==_Edges.None){var d=0;switch(e.keyCode){case wijmo_1.Key.Up:case wijmo_1.Key.Left:d=-10;break;case wijmo_1.Key.Down:case wijmo_1.Key.Right:d=10}switch(o._activeEdge){case _Edges.Top:var _=Math.min(Math.max(r.top+d,0),r.bottom-u);r.height=r.bottom-_;r.top=_;break;case _Edges.Bottom:var m=Math.min(Math.max(r.bottom+d,r.top+u),window.innerHeight);r.height=m-r.top;break;case _Edges.Left:var f=Math.min(Math.max(r.left+d,0),r.right-h);r.width=r.right-f;r.left=f;break;case _Edges.Right:var b=Math.min(Math.max(r.right+d,r.left+h),window.innerWidth);r.width=b-r.left}r.left=Math.max(0,Math.min(r.left,window.innerWidth-r.width));r.top=Math.max(0,Math.min(r.top,window.innerHeight-r.height));var g=new PopupBoundsChangingEventArgs(r);if(o.onSizeChanging(g)){wijmo_1.setCss(o.hostElement,{left:r.left+window.scrollX,top:r.top+window.scrollY,width:r.width,height:r.height,transform:"none"});o.onSizeChanged()}}}}if(e.keyCode==wijmo_1.Key.Escape&&!o._composing){e.preventDefault();o.hide()}if(e.keyCode==wijmo_1.Key.Enter&&!o._composing){var w=o.dialogResultEnter;if(w){e.preventDefault();o._validateAndHide(w)}}if(e.keyCode==wijmo_1.Key.Tab&&o.modal){e.preventDefault();wijmo_1.moveFocus(n,e.shiftKey?-1:1)}}}));s(document,"keyup",(function(e){e.ctrlKey||e.shiftKey||o._activeEdge===_Edges.None||(o._activeEdge=_Edges.None)}));s(n,"click",(function(e){var t=e.target;if(t instanceof HTMLElement){if(t instanceof HTMLButtonElement&&"submit"==t.type){var i=o.hostElement,n=o.dialogResultSubmit;if(i instanceof HTMLFormElement&&n&&i.reportValidity()){e.preventDefault();o.hide(n)}}var s=t.className.match(/\bwj-hide[\S]*\b/);if(s&&s.length>0){e.preventDefault();e.stopPropagation();o.hide(s[0])}}}));var r=o._toggle.bind(o),a=PopupTrigger;o.addEventListener(n,"click",(function(e){o._ignoreClick||r(e,a.ClickPopup)}),!0);o.addEventListener(n,"mousedown",(function(e){o._ignoreClick=!1;r(e,a.DownPopup)}),!0);o.addEventListener(n,"mouseenter",(function(e){e.target==n&&r(e,a.EnterPopup)}),!0);o.addEventListener(n,"mouseleave",(function(e){e.target==n&&r(e,a.LeavePopup)}),!0);o.addEventListener(n,"blur",(function(e){o.containsFocus()||r(e,a.BlurPopup)}),!0);s(document,"wheel",(function(e){if(o.isVisible&&o._modal){for(var t=e.target;t&&t!=document.body;t=t.parentElement)if(t.scrollHeight>t.clientHeight)return;e.preventDefault()}}));o.initialize(i);o._updateAriaLabel();return o}Object.defineProperty(Popup.prototype,"ariaLabelledBy",{get:function(){return this.hostElement.getAttribute("aria-labelledby")},set:function(e){wijmo_1._setAriaLabelBy(this,this.hostElement,e,this._updateAriaLabel.bind(this))},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"owner",{get:function(){return this._owner},set:function(e){var t=this._owner;if(t){this.removeEventListener(t,"click");this.removeEventListener(t,"mousedown");this.removeEventListener(t,"mouseenter");this.removeEventListener(t,"mouseleave");this.removeEventListener(t,"blur")}if(t=this._owner=null!=e?wijmo_1.getElement(e):null){this.addEventListener(t,"click",this._ownerClickBnd,!0);this.addEventListener(t,"mousedown",this._ownerDownBnd,!0);this.addEventListener(t,"mouseenter",this._ownerEnterBnd,!0);this.addEventListener(t,"mouseleave",this._ownerLeaveBnd,!0);this.addEventListener(t,"blur",this._ownerBlurBnd,!0)}},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"position",{get:function(){return this._position},set:function(e){this._position=wijmo_1.asEnum(e,wijmo_1.PopupPosition)},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"content",{get:function(){return this.hostElement.firstElementChild},set:function(e){if(e!=this.content){this.hostElement.innerHTML="";e instanceof HTMLElement&&this.hostElement.appendChild(e)}},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"showTrigger",{get:function(){return this._showTrigger},set:function(e){this._showTrigger=wijmo_1.asEnum(e,PopupTrigger)},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"hideTrigger",{get:function(){return this._hideTrigger},set:function(e){this._hideTrigger=wijmo_1.asEnum(e,PopupTrigger)},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"fadeIn",{get:function(){return this._fadeIn},set:function(e){this._fadeIn=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"fadeOut",{get:function(){return this._fadeOut},set:function(e){this._fadeOut=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"removeOnHide",{get:function(){return this._removeOnHide},set:function(e){if((e=wijmo_1.asBoolean(e))!=this.removeOnHide){this._removeOnHide=e;if(!this.isVisible){var t=this.hostElement;if(e)wijmo_1.removeChild(t);else if(t&&document.body){t.style.display="none";document.body.appendChild(t)}}}},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"modal",{get:function(){return this._modal},set:function(e){this._modal=wijmo_1.asBoolean(e);wijmo_1.setAttribute(this.hostElement,"aria-modal",e?"true":null)},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"isDraggable",{get:function(){return this._draggable},set:function(e){this._draggable=wijmo_1.asBoolean(e);this._updateAriaLabel()},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"isResizable",{get:function(){return this._resizable},set:function(e){this._resizable=wijmo_1.asBoolean(e);this._updateAriaLabel()},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"dialogResult",{get:function(){return this._result},set:function(e){this._result=e},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"dialogResultEnter",{get:function(){return this._resultEnter},set:function(e){this._resultEnter=e},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"dialogResultSubmit",{get:function(){return this._resultSubmit},set:function(e){this._resultSubmit=wijmo_1.asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"isVisible",{get:function(){var e=this.hostElement;return this._visible&&null!=e&&e.offsetHeight>0},enumerable:!0,configurable:!0});Popup.prototype.show=function(e,t){var i=this;this._lastShow=Date.now();if(!this.isVisible){var o=this.hostElement;this.dialogResult=null;this._callback=null;this._oldFocus=null;this._myFocus=null;this._hideAnim.forEach((function(e){clearInterval(e)}));if(this._hideAnim.length>0){this._hideAnim.length=0;if(this._bkDrop){wijmo_1.hidePopup(this._bkDrop,this.removeOnHide);this._bkDrop.style.opacity=""}wijmo_1.hidePopup(o,this.removeOnHide);o.style.opacity=""}var n=new wijmo_1.CancelEventArgs;if(this.onShowing(n)){null!=e&&(this.modal=wijmo_1.asBoolean(e));null!=t&&(this._callback=wijmo_1.asFunction(t));this._oldFocus=wijmo_1.getActiveElement();wijmo_1.showPopup(o,this._owner,this._position,this._fadeIn,!1,this._hideBnd);this._modal&&this._showBackdrop();wijmo_1.setAttribute(this._oldFocus,"aria-expanded","true");this._composing=!1;this._visible=!0;this.onShown(n);this._updateAriaLabel();this._clearTimeouts();if(this.modal){this.addEventListener(window,"focus",(function(){if(!i.containsFocus()){var e=i._myFocus;e&&e.offsetHeight?e.focus():wijmo_1.moveFocus(o,0)}}));this.addEventListener(o,"focusin",(function(){var e=wijmo_1.getActiveElement();e&&wijmo_1.contains(o,e)&&(e.tabIndex>-1||!i._myFocus)&&(i._myFocus=e)}))}this._resized=this._dragged=this._ignoreClick=!1;this._handleDragResize(!0);this.addEventListener(window,"touchstart",(function(e){i._hideTrigger&PopupTrigger.Blur&&!wijmo_1.contains(o,e.target,!0)&&i.hide()}));this._toHidePopupTimer=setTimeout((function(){i.addEventListener(window,"click",(function(e){i._hideTrigger&PopupTrigger.BlurPopup&&i.isDisabled&&!wijmo_1.contains(o,e.target,!0)&&i.hide()}))}));this._toGetFocusTimer=setTimeout((function(){if(!i.isDisabled&&!i.containsFocus()&&!i.isTouching){var e=o.querySelector("[autofocus]");if(e&&e.clientHeight>0&&!e.disabled&&e.tabIndex>-1&&!wijmo_1.closest(e,"[disabled],."+wijmo_1.ControlStateClsNames.disabled)){e.focus();wijmo_1.isFunction(e.select)&&e.select()}else wijmo_1.moveFocus(o,0)}if(!i.isDisabled&&!i.containsFocus()){o.tabIndex=0;o.focus()}}),100)}}};Popup.prototype.hide=function(e){var t=this;this.removeEventListener(window,"touchstart");this.removeEventListener(window,"click");if(this.isVisible){wijmo_1.isUndefined(e)||(this.dialogResult=e);var i=new wijmo_1.CancelEventArgs,o=this.hostElement;if(this.onHiding(i)){this._handleDragResize(!1);for(var n=this.containsFocus()?this._oldFocus:null,s=o.querySelectorAll("."+wijmo_1.ControlClsNames.hostElement+"."+exports.DropDownClsNames.hostElement),r=0;r<s.length;r++){var a=wijmo_1.Control.getControl(s[r]);a instanceof DropDown&&(a.isDroppedDown=!1)}var l=this.removeOnHide,h=this.fadeOut;this._hideTimer=setTimeout((function(){t._updateState();t.onHidden(i);t._callback&&t._callback(t);if(t.hideTrigger&PopupTrigger.LeavePopup){var e=wijmo_1.Control.getControl(wijmo_1.closest(t.owner,"."+exports.PopupClsNames.hostElement));if(e instanceof Popup&&0!=(e.hideTrigger&PopupTrigger.Leave)){var o=Popup._evtHover,n=o?document.elementFromPoint(o.clientX,o.clientY):null,s=wijmo_1.Control.getControl(wijmo_1.closest(n,"."+exports.PopupClsNames.hostElement));s instanceof Popup&&!s.isVisible&&(n=null);n&&wijmo_1.contains(e.hostElement,n,!0)||e.hide()}}}),wijmo_1.Control._FOCUS_INTERVAL+50);this._bkDrop&&this._hideAnim.push(wijmo_1.hidePopup(this._bkDrop,l,h));this._hideAnim.push(wijmo_1.hidePopup(o,l,h));wijmo_1.setAttribute(this._oldFocus,"aria-expanded","false");this._visible=!1;this._oldFocus=null;this._myFocus=null;this._updateAriaLabel();this.removeEventListener(window,"focus");this.removeEventListener(o,"focusin");this.containsFocus()&&wijmo_1.getActiveElement().blur();this._clearTimeouts();!this.isVisible&&n&&n.offsetHeight&&n.focus()}}};Popup.prototype.onShowing=function(e){this.showing.raise(this,e);return!e.cancel};Popup.prototype.onShown=function(e){this.shown.raise(this,e)};Popup.prototype.onHiding=function(e){this.hiding.raise(this,e);return!e.cancel};Popup.prototype.onHidden=function(e){this._wasVisible=!1;this.hidden.raise(this,e)};Popup.prototype.onResizing=function(e){this.resizing.raise(this,e);return!e.cancel};Popup.prototype.onResized=function(e){this.resized.raise(this,e)};Popup.prototype.onDragging=function(e){this.dragging.raise(this,e);return!e.cancel};Popup.prototype.onDragged=function(e){this.dragged.raise(this,e)};Popup.prototype.onSizeChanging=function(e){this.sizeChanging.raise(this,e);return!e.cancel};Popup.prototype.onSizeChanged=function(e){this.sizeChanged.raise(this,e)};Popup.prototype.onPositionChanging=function(e){this.positionChanging.raise(this,e);return!e.cancel};Popup.prototype.onPositionChanged=function(e){this.positionChanged.raise(this,e)};Popup.prototype.onLostFocus=function(t){e.prototype.onLostFocus.call(this,t);if(this._hideTrigger&PopupTrigger.BlurPopup&&!this.containsFocus()){var i=document.createEvent("Event");i.initEvent("blur",!0,!0);this._toggle(i,PopupTrigger.BlurPopup)}};Popup.prototype.refresh=function(t){void 0===t&&(t=!0);var i=this.hostElement;e.prototype.refresh.call(this,t);if(this.isVisible&&!this._refreshing&&i){this._refreshing=!0;for(var o=wijmo_1.getActiveElement(),n=this._owner?this._owner.getBoundingClientRect():null,s=[],r=i.querySelectorAll("."+exports.DropDownClsNames.hostElement),a=0;a<r.length;a++){var l=wijmo_1.Control.getControl(r[a]);if(l instanceof DropDown&&l.isDroppedDown){s.push(l);l.dropDown.style.display="none"}}wijmo_1.showPopup(i,n,this._position);s.forEach((function(e){e.dropDown.style.display="";e._updateDropDown()}));this._modal&&o instanceof HTMLElement&&o!=wijmo_1.getActiveElement()&&o.focus();this._refreshing=!1}};Popup.prototype._clearTimeouts=function(){if(this._toShow){clearTimeout(this._toShow);this._toShow=null}if(this._toHideLeave){clearTimeout(this._toHideLeave);this._toHideLeave=null}if(this._toHideBlur){clearTimeout(this._toHideBlur);this._toHideBlur=null}};Popup.prototype._handleDragResize=function(e){var t=this.hostElement,i=this._draggable?this._getHeaderElement():null,o=this.addEventListener.bind(this),n=this.removeEventListener.bind(this),s=this._mousemoveBnd,r=this._mousedownBnd;if(e){o(t,"mousemove",s);o(t,"mousedown",r);o(t,"touchstart",r);i&&(i.style.touchAction="none")}else{this._mousedownEvt=null;this._rcBounds=null;n(t,"mousemove",s);n(t,"mousedown",r);n(t,"touchstart",r);n(document,"mousemove",this._mousedragBnd);n(document,"mouseup",this._mouseupBnd);i&&(i.style.touchAction="")}};Popup.prototype._mousemove=function(e){if(!this._mousedownEvt){var t=this.hostElement,i=this._getEdges(t,e),o="",n=_Edges;this._edges=i;this._resizable&&(i==n.LeftTop||i==n.RightBottom?o="nwse-resize":i==n.LeftBottom||i==n.RightTop?o="nesw-resize":i==n.Left||i==n.Right?o="ew-resize":i!=n.Top&&i!=n.Bottom||(o="ns-resize"));this._draggable&&!o&&this._getClosestHeader(e.target)&&(o="move");t.style.cursor=o}};Popup.prototype._mousedown=function(e){if(!e.defaultPrevented){var t=e.touches&&e.touches.length>0?e.touches[0]:e;this._edges=this._getEdges(this.hostElement,t);if(this._edges||this._draggable&&this._getClosestHeader(e.target)){var i=new wijmo_1.CancelEventArgs;if(this._edges?this.onResizing(i):this.onDragging(i)){this._mousedownEvt=t;this._rcBounds=this.hostElement.getBoundingClientRect();var o=this.addEventListener.bind(this),n=document,s=this._mousedragBnd,r=this._mouseupBnd;o(n,"mousemove",s);o(n,"touchmove",s);o(n,"mouseup",r);o(n,"touchend",r)}}this._ignoreClick=!1}};Popup.prototype._mouseup=function(){this._mousedownEvt=null;this._rcBounds=null;this._activeEdge=_Edges.None;var e=this.removeEventListener.bind(this),t=document,i=this._mousedragBnd,o=this._mouseupBnd;e(t,"mousemove",i);e(t,"touchmove",i);e(t,"mouseup",o);e(t,"touchend",o);this._resized?this.onResized():this._dragged&&this.onDragged();this._resized=this._dragged=this._ignoreClick=!1};Popup.prototype._mousedrag=function(e){if(!e.defaultPrevented){var t=this.hostElement,i=this._mousedownEvt,o=e.touches&&e.touches.length>0?e.touches[0]:e,n=o.clientX-i.clientX,s=o.clientY-i.clientY,r=this._rcBounds,a=this._edges,l=Popup._SZ_MIN,h=wijmo_1.Rect.fromBoundingRect(r);if(a){var u=window.getComputedStyle(t),c=parseInt(u.getPropertyValue("min-width"))||l,p=parseInt(u.getPropertyValue("min-height"))||l;if(a&_Edges.Left){var d=h.right-c;h.left=Math.min(h.left+n,d);h.width=Math.max(h.width-n,c)}else a&_Edges.Right&&(h.width=Math.max(h.width+n,c));if(a&_Edges.Top){var _=h.bottom-p;h.top=Math.min(h.top+s,_);h.height=Math.max(h.height-s,p)}else a&_Edges.Bottom&&(h.height=Math.max(h.height+s,p));if(this.onSizeChanging(new PopupBoundsChangingEventArgs(h))){wijmo_1.setCss(t,{left:h.left+window.scrollX,top:h.top+window.scrollY,width:h.width,height:h.height,transform:"none"});this._resized=this._dragged=this._ignoreClick=!0;this.onSizeChanged()}if(!window.ResizeObserver)for(var m=this.hostElement.children,f=0;f<m.length;f++)wijmo_1.Control.invalidateAll(m[f])}else if(this._draggable){"touchmove"===e.type&&wijmo_1.isiOS()&&e.preventDefault();if(this._dragged||Math.abs(n)+Math.abs(s)>Popup._DRAG_THRESHOLD){h.left=Math.max(r.left+n+(o.pageX-o.clientX),50-r.width);h.top=Math.max(r.top+s+(o.pageY-o.clientY),0);if(this.onPositionChanging(new PopupBoundsChangingEventArgs(h))){wijmo_1.setCss(t,{left:h.left,top:h.top,width:h.width,height:h.height,transform:"none"});this._dragged=this._ignoreClick=!0;this.onPositionChanged()}}}}};Popup.prototype._getEdges=function(e,t){var i=0;if(this._resizable){var o=e.getBoundingClientRect(),n=Popup._SZ_EDGE;t.clientX-o.left<n&&(i|=_Edges.Left);t.clientY-o.top<n&&(i|=_Edges.Top);o.right-t.clientX<n&&(i|=_Edges.Right);o.bottom-t.clientY<n&&(i|=_Edges.Bottom)}return i};Popup.prototype._ownerClick=function(e){this._toggle(e,PopupTrigger.ClickOwner)};Popup.prototype._ownerDown=function(e){this._wasVisible=this.isVisible;this._toggle(e,PopupTrigger.DownOwner)};Popup.prototype._ownerBlur=function(e){wijmo_1.contains(this._owner,wijmo_1.getActiveElement())||this._toggle(e,PopupTrigger.BlurOwner)};Popup.prototype._ownerEnter=function(e){e.target==this._owner&&this._toggle(e,PopupTrigger.EnterOwner)};Popup.prototype._ownerLeave=function(e){e.target==this._owner&&this._toggle(e,PopupTrigger.LeaveOwner)};Popup.prototype._toggle=function(e,t){var i=this;e instanceof MouseEvent&&(Popup._evtHover=e);if(!("mouseenter"==e.type&&Date.now()-this._lastShow<300||e.defaultPrevented)){var o=0!=(this._hideTrigger&t),n=0!=(this._showTrigger&t),s=PopupTrigger;(o||n)&&this._clearTimeouts();o&&this.isVisible&&(t&s.Leave?this._toHideLeave=setTimeout((function(){var e=Popup._evtHover,t=e?document.elementFromPoint(e.clientX,e.clientY):null;t&&wijmo_1.contains(i.hostElement,t,!0)||i.hide()}),wijmo_1.Control._LEAVE_DELAY):t&s.Blur?this._toHideBlur=setTimeout((function(){i.containsFocus()||wijmo_1.contains(i._owner,wijmo_1.getActiveElement())||i.hide()}),wijmo_1.Control._FOCUS_INTERVAL+50):this.hide());n&&t!=s.ClickPopup&&(this._wasVisible||(t&s.Enter?this._toShow=setTimeout((function(){i.show()}),wijmo_1.Control._HOVER_DELAY):this.show()))}};Popup.prototype._getHeaderElement=function(){var e=this.hostElement;return e.querySelector("."+exports.PopupClsNames.dialogHeader)||e.querySelector(".modal-header")};Popup.prototype._getClosestHeader=function(e){return wijmo_1.closest(e,"."+exports.PopupClsNames.dialogHeader)||wijmo_1.closest(e,".modal-header")};Popup.prototype._showBackdrop=function(){var e=this;if(!this._bkDrop){this._bkDrop=document.createElement("div");this._bkDrop.tabIndex=-1;wijmo_1.setAttribute(this._bkDrop,"role","presentation");wijmo_1.setAttribute(this._bkDrop,"aria-hidden","true");wijmo_1.setAttribute(this._bkDrop,"aria-label",wijmo_1.culture.Popup.ariaLabels.backdrop);wijmo_1.addClass(this._bkDrop,exports.PopupClsNames.popupBackDrop);this.addEventListener(this._bkDrop,"mousedown",(function(t){t.preventDefault();t.stopPropagation();e.hostElement.focus();e.hideTrigger&PopupTrigger.Blur&&e.hide()}))}wijmo_1.setCss(this._bkDrop,{zIndex:wijmo_1.Control._POPUP_ZINDEX,display:""});var t=this.hostElement;t.parentElement.insertBefore(this._bkDrop,t)};Popup.prototype._validateAndHide=function(e){var t=this.hostElement;if(t instanceof HTMLFormElement)t.reportValidity()&&this.hide(e);else{var i=this.hostElement.querySelector(":invalid");i?i.focus():this.hide(e)}};Popup.prototype._updateAriaLabel=function(){this.hostElement&&(this.ariaLabelledBy?this._updateAriaLabelImp(""):this._updateAriaLabelImp(this._ariaLabel))};Popup.prototype._updateAriaLabelImp=function(e){var t=[];this.isDraggable&&t.push(wijmo_1.culture.Popup.ariaLabels.isDraggable);this.isResizable&&t.push(wijmo_1.culture.Popup.ariaLabels.isResizable);this.isVisible?t.push(wijmo_1.culture.Popup.ariaLabels.popupVisible):t.push(wijmo_1.culture.Popup.ariaLabels.popupHide);var i=t.join(",");wijmo_1.setAttribute(this.hostElement,"aria-label",e?e+" "+i:i)};Popup.prototype.dispose=function(){Popup._PopupInstanceCount--;0===Popup._PopupInstanceCount&&Popup._evtHover&&(Popup._evtHover=null);this._clearTimeouts();if(this._toHidePopupTimer){clearTimeout(this._toHidePopupTimer);this._toHidePopupTimer=null}if(this._toGetFocusTimer){clearTimeout(this._toGetFocusTimer);this._toGetFocusTimer=null}if(this._hideTimer){clearTimeout(this._hideTimer);this._hideTimer=null}this._hideAnim.forEach((function(e){clearInterval(e)}));this._hideAnim=[];var t=this.hostElement;if(t)for(var i=t.querySelectorAll("."+exports.DropDownClsNames.hostElement),o=0;o<i.length;o++){var n=wijmo_1.Control.getControl(i[o]);n&&n instanceof DropDown&&n.dispose()}if(this._initialOwner){this._initialOwner.appendChild(this.hostElement);this._initialOwner=null}this.owner=null;if(this._bkDrop){this._bkDrop.remove();this._bkDrop=null}this._callback=null;e.prototype.dispose.call(this)};Popup._DRAG_THRESHOLD=6;Popup._SZ_EDGE=10;Popup._SZ_MIN=40;Popup._PopupInstanceCount=0;return Popup}(wijmo_1.Control);exports.Popup=Popup;var PopupBoundsChangingEventArgs=function(e){__extends(PopupBoundsChangingEventArgs,e);function PopupBoundsChangingEventArgs(t){var i=e.call(this)||this;i._rc=t;return i}Object.defineProperty(PopupBoundsChangingEventArgs.prototype,"bounds",{get:function(){return this._rc},enumerable:!0,configurable:!0});return PopupBoundsChangingEventArgs}(wijmo_1.CancelEventArgs);exports.PopupBoundsChangingEventArgs=PopupBoundsChangingEventArgs;wijmo_1._addCultureInfo("InputDate",{ariaLabels:{inputDateInput:"InputDate Input",inputDate:"Input Date",button:"Choose Date",dialog:"Calendar"}});var InputDateEventArgs=function(e){__extends(InputDateEventArgs,e);function InputDateEventArgs(t){var i=e.call(this)||this;i._isUserInput=t;return i}Object.defineProperty(InputDateEventArgs.prototype,"isUserInput",{get:function(){return this._isUserInput},enumerable:!0,configurable:!0});return InputDateEventArgs}(wijmo_1.CancelEventArgs);exports.InputDateEventArgs=InputDateEventArgs;var InputDate=function(e){__extends(InputDate,e);function InputDate(t,i){var o=e.call(this,t)||this;o._fmt=wijmo_1.Globalize.DefaultDateFormat;o._sep=" - ";o._rngs=null;o._showCal=!1;o._clsOnSel=!0;o._handleWheel=!0;o._preserveCalendarNavigation=!0;o._isTriggered=!1;o._rangeChanged=!1;o._textInitialized=!1;o._previousText="";o._keepInvalidText=!1;o._inputAriaLabel=wijmo_1.culture.InputDate.ariaLabels.inputDateInput;o._currentInput="";o._ariaLabelledby=null;o.valueChanged=new wijmo_1.Event;o.rangeEndChanged=new wijmo_1.Event;o.rangeChanged=new wijmo_1.Event;wijmo_1.addClass(o.hostElement,exports.InputDateClsNames.hostElement);var n=wijmo_1.culture.InputDate.ariaLabels;wijmo_1.setAttribute(o._btn.querySelector("button"),"aria-haspopup","dialog");wijmo_1.setAttribute(o._dropDown,"role","dialog");wijmo_1.setAriaLabel(o._dropDown,n.dialog);wijmo_1.setAttribute(o._dropDown,"aria-modal",!0);wijmo_1.setAttribute(o._tbx,"role","combobox");wijmo_1.setAttribute(o._tbx,"aria-haspopup","dialog");wijmo_1.setAriaLabel(o._btn.querySelector("button"),n.button);o.dropDown.id=wijmo_1.getUniqueId(o.hostElement.id+"_dropdown");o._msk=new wijmo_1._MaskProvider(o._tbx);var s=o.addEventListener.bind(o);wijmo_1.isIE9()||(o.inputType="tel");o._tbx.type.match(/^(tel|text|)$/i)||(o.inputType="text");var r=o._mouseWheel.bind(o);s(o.hostElement,"wheel",r);o._lbx=new ListBox(document.createElement("div"),{displayMemberPath:"name",selectedIndexChanged:function(e){var t=e.selectedItem,i=wijmo_1.DateTime.fromDateTime,n=wijmo_1.DateTime.sameDate;if(t&&t.from&&t.to){if(!n(t.from,o.value)||!n(t.to,o.rangeEnd)){var s=o.value;o.value=i(t.from,s);o.rangeEnd=i(t.to,s)}o._selectAll()}else o._cal.hostElement.style.display=""}});var a=o._lbx;o._cal=new Calendar(document.createElement("div"));var l=o._cal,h=o._dropDown;wijmo_1.addClass(h,exports.InputDateClsNames.inputDateDropDown);var u=document.createElement("div");wijmo_1.addClass(u,exports.InputDateClsNames.inputDateDropDownContainer);u.appendChild(a.hostElement);u.appendChild(l.hostElement);h.appendChild(u);o.addEventListener(h,"click",(function(){o._isTriggered=!0;setTimeout((function(){o._isTriggered=!1}),50)}),!0);o.addEventListener(h,"keydown",(function(e){if("Enter"===e.key){o._isTriggered=!0;setTimeout((function(){o._isTriggered=!1}),50)}}),!0);if("INPUT"==o._orgTag){var c=o._tbx.getAttribute("value");c&&(l.value=l.rangeEnd=wijmo_1.Globalize.parseDate(c,"yyyy-MM-dd"))}o.isRequired=!0;o._tbx.value=o._oldText=o._getText();o.initialize(i);var p=wijmo_1.isNullOrUndefined(o.tabOrder)?0:o.tabOrder;l.tabOrder=-1!==p&&o.showConfirmationButtons?p:-1;a.tabOrder=p;if(o._textInitialized||o._tbx.value!==o._oldText){o._oldText=o._tbx.value;o._currentInput="text";o._textInitialized=!0;o._commitText();o.onTextChanged()}o._updateState();l.valueChanged.addHandler((function(e,t){o._refreshText();o.onValueChanged(t)}));l.rangeEndChanged.addHandler((function(e,t){if(l._rngMode()){o.onRangeEndChanged(t);o._closeOnChange();l._clearingRangeEnd||o._refreshText()}}));l.cancelButtonClicked.addHandler((function(e,t){o.isDroppedDown=!1}));l.OKButtonClicked.addHandler((function(e,t){o._closeOnChange();o._refreshText()}));l._enterKeyDownToSetValue.addHandler((function(e,t){o._closeOnChange()}));l.addEventListener(l.hostElement,"click",(function(e){if(l.selectionMode&&!l._rngMode()){var t=e.target,i=l.hitTest(t);if(wijmo_1.DateTime.sameDate(o.value,i)||wijmo_1.closest(t,"[wj-part=btn-today]")){o._closeOnChange();o._refreshText()}}}));o._updateInputAriaLabel();return o}Object.defineProperty(InputDate,"controlTemplate",{get:function(){InputDate._ctrlTemplate||(InputDate._ctrlTemplate=DropDown.controlTemplate);return InputDate._ctrlTemplate},set:function(e){InputDate._ctrlTemplate=e},enumerable:!0,configurable:!0});InputDate.prototype._mouseWheel=function(e){if(this.handleWheel&&!e.defaultPrevented&&!this.isDroppedDown&&this.containsFocus()&&null!=this.value&&this._canChangeValue()){var t=this._tbx,i=t.selectionStart,o=t.selectionEnd,n=wijmo_1.clamp(-e.deltaY,-1,1),s=this.value,r=wijmo_1.Globalize.getFullFormat(this.format||wijmo_1.Globalize.DefaultDateFormat);null==r&&(r=this.format);var a=r.match(wijmo_1.getSpecialCharsRegex());if(o-i===t.value.length&&null!=a||this.selectionMode==DateSelectionMode.Range){for(var l=1;;l++){s=this.selectionMode==DateSelectionMode.Month?wijmo_1.DateTime.addMonths(this.value,l*n):wijmo_1.DateTime.addDays(this.value,l*n);if(this._isValidDate(s)||!(null===this.max||s<this.max)||!(null===this.min||s>this.min))break}this.value=s;var h=this._getText();wijmo_1.setSelectionRange(t,0,h.length)}else this._updateDateTimeValue(n,a,r);e.preventDefault()}};Object.defineProperty(InputDate.prototype,"value",{get:function(){return this._cal.value},set:function(e){this._cal.value=e;(this.text||this.isRequired)&&this._refreshText()},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"rangeEnd",{get:function(){return this._cal.rangeEnd},set:function(e){this._cal.rangeEnd=e;(this.text||this.isRequired)&&this._refreshText()},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"rangeMin",{get:function(){return this._cal.rangeMin},set:function(e){this._cal.rangeMin=e},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"rangeMax",{get:function(){return this._cal.rangeMax},set:function(e){this._cal.rangeMax=e},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"keepInvalidText",{get:function(){return this._keepInvalidText},set:function(e){if(new Set(["InputDateTime","WjInputDateTime"]).has(this.constructor.name)){this._keepInvalidText=!1;throw"keepInvalidText property cannot be used with InputDateTime control"}this._keepInvalidText=e},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"text",{get:function(){return this._tbx.value},set:function(e){var t=(e||"").toString();if(t!=this.text){t!=this._tbx.value&&(this._tbx.value=t);if(t!=this._oldText){this._oldText=t;this._previousText=t}if(wijmo_1.isEmpty(this._currentInput)){this._textInitialized=!0;this._currentInput="text";this._commitText()}this.onTextChanged();this._currentInput=""}},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"format",{get:function(){return this._fmt},set:function(e){if(e!=this.format){this._fmt=wijmo_1.asString(e);this._refreshText()}},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"separator",{get:function(){return this._sep},set:function(e){if(e!=this._sep){this._sep=wijmo_1.asString(e,!1);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"mask",{get:function(){return this._msk.mask},set:function(e){this._msk.mask=wijmo_1.asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"closeOnSelection",{get:function(){return this._clsOnSel},set:function(e){this._clsOnSel=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"handleWheel",{get:function(){return this._handleWheel},set:function(e){e=wijmo_1.asBoolean(e);this._handleWheel=e;e||(this.calendar.handleWheel=e)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"predefinedRanges",{get:function(){return this._rngs},set:function(e){if(this._rngs!=e){wijmo_1.assert(null==e||wijmo_1.isObject(e),"Object expected");this._rngs=e;this._lbx.itemsSource=this._getRanges(e);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"alwaysShowCalendar",{get:function(){return this._showCal},set:function(e){this._showCal=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"min",{get:function(){return this._cal.min},set:function(e){this._cal.min=wijmo_1.asDate(e,!0)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"max",{get:function(){return this._cal.max},set:function(e){this._cal.max=wijmo_1.asDate(e,!0)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"repeatButtons",{get:function(){return this._cal.repeatButtons},set:function(e){this._cal.repeatButtons=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"showYearPicker",{get:function(){return this._cal.showYearPicker},set:function(e){this._cal.showYearPicker=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"showMonthPicker",{get:function(){return this._cal.showMonthPicker},set:function(e){this._cal.showMonthPicker=e},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"showHeader",{get:function(){return this._cal.showHeader},set:function(e){this._cal.showHeader=e},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"weeksBefore",{get:function(){return this._cal.weeksBefore},set:function(e){this._cal.weeksBefore=e},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"weeksAfter",{get:function(){return this._cal.weeksAfter},set:function(e){this._cal.weeksAfter=e},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"selectionMode",{get:function(){return this._cal.selectionMode},set:function(e){if(e!=this.selectionMode){this._cal.selectionMode=e;this._refreshText()}},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"monthCount",{get:function(){return this._cal.monthCount},set:function(e){this._cal.monthCount=e},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"calendar",{get:function(){return this._cal},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"inputElement",{get:function(){return this._tbx},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"inputType",{get:function(){return this._tbx.type},set:function(e){e.match(/^(tel|text|)$/i)?this._tbx.type=wijmo_1.asString(e):console.warn("invalid input type '"+e+"', don't use any input types other than 'tel' or 'text'")},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"preserveCalendarNavigation",{get:function(){return this._preserveCalendarNavigation},set:function(e){this._preserveCalendarNavigation=e},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"itemValidator",{get:function(){return this._cal.itemValidator},set:function(e){if(e!=this.itemValidator){this._cal.itemValidator=wijmo_1.asFunction(e);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"itemFormatter",{get:function(){return this._cal.itemFormatter},set:function(e){this._cal.itemFormatter=wijmo_1.asFunction(e)},enumerable:!0,configurable:!0});InputDate.prototype.onValueChanged=function(e){this.valueChanged.raise(this,e)};InputDate.prototype.onRangeEndChanged=function(e){this.rangeEndChanged.raise(this,e);this.rangeEnd&&(this.isDroppedDown?this._rangeChanged=!0:this.onRangeChanged(e))};InputDate.prototype.onRangeChanged=function(e){this._rangeChanged=!1;this.rangeChanged.raise(this,e)};InputDate.prototype._getParsedValue=function(){var e=this._tbx.value,t=this._fmt,i=(0,wijmo_1.Globalize.parseDate)(e,t,this.value);if(i&&wijmo_1.DateTime.sameDate(i,this._clamp(i)))return this._fromDateTime(i)};InputDate.prototype.refresh=function(t){void 0===t&&(t=!0);e.prototype.refresh.call(this,t);if(this.hostElement){this._msk&&this._msk.refresh();this._cal&&this._cal.refresh();this._refreshText()}};InputDate.prototype.onIsDroppedDownChanging=function(t){if(this.isDroppedDown);else{var i=this._lbx,o=this._cal,n=i.collectionView,s=i.hostElement.style,r=o.hostElement.style;if(o._rngMode()&&wijmo_1.hasItems(n)){var a=this._updateRangeSelection();s.display="";r.display=!this._showCal&&a&&a.from&&n.items.some((function(e){return!e.to}))?"none":""}else{s.display="none";r.display=""}o._mthMode()||(o.monthView=!0);o.value&&!this.preserveCalendarNavigation&&(o.displayMonth=o.value);this.showConfirmationButtons&&(o.focusValue=o.value)}return e.prototype.onIsDroppedDownChanging.call(this,t)};InputDate.prototype.onIsDroppedDownChanged=function(t){e.prototype.onIsDroppedDownChanged.call(this,t);var i=this.containsFocus();if(this.isDroppedDown){i&&(this._tryFocus(this._cal)||this._tryFocus(this._lbx)||this.dropDown.focus());this._lbx.showSelection();this._cal.refresh()}else{this._commitText();this._rangeChanged&&this.onRangeChanged()}};InputDate.prototype._updateDropDown=function(){this._commitText();var t=getComputedStyle(this.hostElement);this._dropDown.style.minWidth=18*parseFloat(t.fontSize)+"px";this._cal.refresh();e.prototype._updateDropDown.call(this)};InputDate.prototype.onGotFocus=function(e){var t=this._tbx;this._elRef==t&&(this.isDroppedDown?this.dropDown.focus():this.selectAll());this.containsFocus()||this.focus();this.gotFocus.raise(this,e)};InputDate.prototype._keydown=function(t){if(!(t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey)){this._isInvalidInputCancelled=!1;if(this._isHiddenEditor())return;var i=wijmo_1.getActiveElement();switch(t.keyCode){case wijmo_1.Key.Enter:if(this.showConfirmationButtons&&i!==this._tbx)return;this._currentInput="user";this._textInitialized=!1;this._commitText(!1,!0);break;case wijmo_1.Key.Escape:this.text=this._getText();this.selectAll();break;case wijmo_1.Key.Tab:if(this.showConfirmationButtons&&i!==this._tbx){var o=wijmo_1._getFocusableElements(this._dropDown).filter((function(e){return!(e.classList.contains("wj-control")&&e.classList.contains("wj-calendar"))})),n=o[0],s=o[o.length-1],r=o.indexOf(t.target),a=o[t.shiftKey?(r-1+o.length)%o.length:(r+1)%o.length],l=!1;a&&(l=this.calendar.isCalendarDateCell(a));if(l){t.preventDefault();this.calendar.focus();this.calendar.setFocusValueToFirstOrLastCalendar(!t.shiftKey)}else if(t.shiftKey){if(i===n){t.preventDefault();s.focus()}}else if(i===s){t.preventDefault();n.focus()}}else if(this.isDroppedDown){this.isDroppedDown=!1;this.containsFocus()||this.focus();this.keyActionTab===TabKeyAction.CloseAndKeepFocus&&t.preventDefault()}this._currentInput="user";this._textInitialized=!1;this._commitText(!0);break;case wijmo_1.Key.Up:case wijmo_1.Key.Down:if(t.keyCode===wijmo_1.Key.Up&&this.keyActionUpArrow===KeyAction.OpenDropdown||t.keyCode===wijmo_1.Key.Down&&this.keyActionDownArrow===KeyAction.OpenDropdown)break;if(!this.isDroppedDown&&this.value&&this._canChangeValue()){this._currentInput="user";this._textInitialized=!1;var h=this._tbx,u=h.selectionStart,c=h.selectionEnd,p=(h.value,t.keyCode==wijmo_1.Key.Up?1:-1),d=this.value,_=wijmo_1.Globalize.getFullFormat(this.format||wijmo_1.Globalize.DefaultDateFormat);if("g"==this.format&&_.includes("г")){_=_.replace(/"г." /,"")}null==_&&(_=this.format);var m=_.match(wijmo_1.getSpecialCharsRegex());if(c-u===h.value.length&&null!=m||this.selectionMode==DateSelectionMode.Range){for(var f=1;;f++){d=this.selectionMode==DateSelectionMode.Month?wijmo_1.DateTime.addMonths(this.value,f*p):wijmo_1.DateTime.addDays(this.value,f*p);if(this._isValidDate(d)||!(null===this.max||d<this.max)||!(null===this.min||d>this.min))break}this.value=d;var b=this._getText();wijmo_1.setSelectionRange(h,0,b.length)}else this._updateDateTimeValue(p,m,_);t.preventDefault()}}}e.prototype._keydown.call(this,t)};InputDate.prototype._expandSelection=function(){if(this._cal._rngMode()){var t=this._tbx,i=t.value,o=t.selectionStart,n=t.selectionEnd,s=this._sep,r=i.indexOf(s);r>-1&&o==n&&(n<=r?wijmo_1.setSelectionRange(t,0,r):o>=r+s.length&&wijmo_1.setSelectionRange(t,r+s.length,t.value.length))}else e.prototype._expandSelection.call(this)};InputDate.prototype._updateDateTimeValue=function(e,t,i){var o=this._tbx,n=o.selectionStart,s=o.value,r=this.value,a={},l={},h=0,u=0,c=0,p=[],d=[],_=o.value.match(wijmo_1.getSpecialCharsRegex());if(null==t||null==_){p=[this.format];d=["0"];t=[""]}else{t.forEach((function(e,o){var n=e.replaceAll('"',""),r=i.substring(h),c=s.substring(u),p=r.indexOf(e),d=c.indexOf(n);if(-1==d){var m=_[o];d=c.indexOf(m)}var f=r.substring(0,p);if(""!=f){a[f]=h;l[f]=u}h=h+p+e.length;u=u+d+n.length;if(o==t.length-1){f=i.substring(h);a[f]=h;l[f]=u}}));p=Object.keys(a);d=Object.values(l)}var m=d.filter((function(e){return n>=parseInt(e.toString())}));m.length>0&&(c=m.length-1);for(var f=p[c],b=1;;b++){-1!=f.indexOf("d")?r=wijmo_1.DateTime.addDays(this.value,b*e):-1!=f.indexOf("M")?r=wijmo_1.DateTime.addMonths(this.value,b*e):-1!=f.indexOf("y")&&(r=wijmo_1.DateTime.addYears(this.value,b*e));if(this._isValidDate(r)||!(null===this.max||r<this.max)||!(null===this.min||r>this.min))break}this.value=r;this._reselectText(t,c)};InputDate.prototype._reselectText=function(e,t){var i=this._getText(),o=this._tbx,n=0,s=-1,r=-1;if(1==e.length&&""==e[0]){s=0;r=i.length}else{var a=o.value.match(wijmo_1.getSpecialCharsRegex());e.forEach((function(e,o){var l=e.replaceAll('"',""),h=i.substring(n);if(h.startsWith("г.")){h=h.replace("г. ","");n+="г. ".length}var u=h.indexOf(l);0==u&&t++;if(-1==u){var c=a[o];u=h.indexOf(c)}var p=-1===u?h:h.substring(0,u);o==t&&-1==s&&(r=(s=n)+p.length);n=n+u+l.length}))}if(-1==s){s=n;r=o.value.length}wijmo_1.setSelectionRange(o,s,r)};InputDate.prototype._refreshText=function(){var e=this._getText();if(e!=this.text||e!==this._oldText){this._tbx.value=this._oldText=this._previousText=e;this.onTextChanged()}};InputDate.prototype._selectAll=function(){this.isDroppedDown||!this.containsFocus()||this.isTouching||this.selectAll()};InputDate.prototype._closeOnChange=function(){var e=this;if(this._clsOnSel&&this._isTriggered){var t=this._cal;(!t._rngMode()||t.value&&t.rangeEnd)&&setTimeout((function(){e._isInvalidInputCancelled=!1;e.isDroppedDown=!1}))}};InputDate.prototype._tryFocus=function(e){var t=e.hostElement;if(t&&t.offsetHeight){t.focus();return!0}return!1};InputDate.prototype._clamp=function(e){return this._cal._clamp(e)};InputDate.prototype._getText=function(){var e=wijmo_1.Globalize.format,t=this._fmt,i=e(this.value,t);this._cal._rngMode()&&i&&(this.rightToLeft?i=e(this.rangeEnd,t)+this._sep+i:i+=this._sep+e(this.rangeEnd,t));return i};InputDate.prototype._commitText=function(e,t){var i=this._tbx.value;this._isInvalidInputCancelled=!1;if(wijmo_1.isEmpty(this._currentInput)){this._textInitialized=!1;this._currentInput="user"}var o=!1,n=this._fmt,s=this._cal,r=wijmo_1.Globalize.parseDate,a=new InputDateEventArgs(!this._textInitialized);if(i)if(s._rngMode()){var l=i.split(this._sep),h=this.rightToLeft?l[1]:l[0];if(2==l.length&&h){if(c=r(h,n,this.value)){var u=r(this.rightToLeft?l[0]:l[1],n,this.value);if(wijmo_1.DateTime.sameDate(c,this._clamp(c)))o=!0;else if(this._shouldRaiseInvalidInput(t)&&this.onInvalidInput(a))this._textInitialized&&this._keepInvalidText||(o=!0);else{this._selectAll();o=!1}if(o)if(u){s.value=this._fromDateTime(c);if(wijmo_1.DateTime.sameDate(u,this._clamp(u))){s.rangeEnd=u&&u>=c?this._fromDateTime(u):c;this.text=this._getText()}else this._triggerInvalidInputEvent(a,c,u,t)}else if(this._shouldRaiseInvalidInput(t)&&this.onInvalidInput(a)){if(!this._textInitialized||!this._keepInvalidText){s.value=this._fromDateTime(c);s.rangeEnd=c;this.text=this._getText()}}else{this._isInvalidInputCancelled=!0;this._selectAll()}}else this._nullValueInvalidInput(a,t)}else this._nullValueInvalidInput(a,t)}else{(c=r(i,n,this.value))?wijmo_1.DateTime.sameDate(c,this._clamp(c))?this.value=this._fromDateTime(c):this._triggerInvalidInputEvent(a,c,null,t):this._nullValueInvalidInput(a,t)}else if(this.isRequired){var c;(c=r(i,n,this.value))?this.value=this._fromDateTime(c):this.containsFocus()||(this.text=this._getText())}else this.value=this.rangeEnd=null;this._currentInput="";e||this._selectAll()};InputDate.prototype._triggerInvalidInputEvent=function(e,t,i,o){if(this._shouldRaiseInvalidInput(o)&&this.onInvalidInput(e)){if(!this._textInitialized||!this._keepInvalidText){this.value=this._fromDateTime(t);this.calendar._rngMode()&&(this.calendar.rangeEnd=i&&i>=t?this._fromDateTime(i):t)}}else{this.isDroppedDown||!this.containsFocus()||this.isTouching||this.focus();this._isInvalidInputCancelled=!0;this._selectAll()}};InputDate.prototype._nullValueInvalidInput=function(e,t){if(this._shouldRaiseInvalidInput(t)&&this.onInvalidInput(e))this._textInitialized&&this._keepInvalidText||(this.text=this._getText());else{this.isDroppedDown||!this.containsFocus()||this.isTouching||this.focus();this._isInvalidInputCancelled=!0;this._selectAll()}};InputDate.prototype._fromDateTime=function(e){return wijmo_1.DateTime.fromDateTime(e,this.value)};InputDate.prototype._canChangeValue=function(){return!this.isReadOnly&&!this.isDisabled&&this.selectionMode!=DateSelectionMode.None};InputDate.prototype._isValidDate=function(e){if(e){if(this._clamp(e)!=e)return!1;if(this.itemValidator&&!this.itemValidator(e))return!1}return!0};InputDate.prototype._getRanges=function(e){var t=[];if(wijmo_1.isObject(e))for(var i in e){var o=e[i];t.push({name:i,from:o?o[0]:null,to:o?o[1]:null})}return new wijmo_1.CollectionView(t,{currentItem:null})};InputDate.prototype._updateRangeSelection=function(){var e=this._lbx,t=-1;if(wijmo_1.hasItems(e.collectionView))for(var i=this._lbx.collectionView.items,o=wijmo_1.DateTime.sameDate,n=0;n<i.length;n++){var s=i[n];if(s.from){if(o(s.from,this.value)&&o(s.to,this.rangeEnd)){t=n;break}}else t=n}e.selectedIndex=t;return e.selectedItem};InputDate.prototype._copy=function(e,t){if("text"===e){var i=(t||"").toString();if(i!==this.text){this._tbx.value=i;this._textInitialized=!0}return!0}return!1};Object.defineProperty(InputDate.prototype,"showConfirmationButtons",{get:function(){return this._showConfirmationButtons},set:function(e){this._showConfirmationButtons=e;this._cal.focusMode=e;this._cal.showConfirmationButtons=e;this._cal.updateConfirmationButtons(this.dropDown);var t=wijmo_1.isNullOrUndefined(this.tabOrder)?0:this.tabOrder;this._cal.tabOrder=e?t:-1;this._cal.keyActionTab=e?CalendarTabKeyAction.All:CalendarTabKeyAction.None},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"ariaLabelledBy",{get:function(){return this._ariaLabelledby},set:function(e){wijmo_1._setAriaLabelBy(this,this._tbx,e,this._updateInputAriaLabel.bind(this))},enumerable:!0,configurable:!0});InputDate.prototype._updateInputAriaLabel=function(){this._tbx&&(this._tbx.id||this.ariaLabelledBy?wijmo_1.setAriaLabel(this._tbx,null):wijmo_1.setAriaLabel(this._tbx,this._inputAriaLabel))};InputDate.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.InputDate.ariaLabels.inputDate};InputDate._ctrlTemplate="";return InputDate}(DropDown);exports.InputDate=InputDate;wijmo_1._addCultureInfo("InputDateRange",{ariaLabels:{inputDateRangeInput:"InputDateRange Input"}});var InputDateRange=function(e){__extends(InputDateRange,e);function InputDateRange(t,i){var o=e.call(this,t,__assign({selectionMode:DateSelectionMode.Range,showMonthPicker:"Outside",monthCount:2},getInputDateOptions(i)))||this;o._inputAriaLabel=wijmo_1.culture.InputDateRange.ariaLabels.inputDateRangeInput;wijmo_1.addClass(o.hostElement,exports.InputDateRangeClsNames.hostElement);o._tbx.value=o._oldText=o._getText();o.initialize(i);if(o._tbx.value!==o._oldText){o._oldText=o._tbx.value;o._currentInput="text";o._commitText()}o._updateInputAriaLabel();return o}Object.defineProperty(InputDateRange,"controlTemplate",{get:function(){InputDateRange._ctrlTemplate||(InputDateRange._ctrlTemplate=InputDate.controlTemplate);return InputDateRange._ctrlTemplate},set:function(e){InputDateRange._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(InputDateRange.prototype,"selectionMode",{get:function(){return this.calendar.selectionMode},set:function(e){e=wijmo_1.asEnum(e,DateSelectionMode);wijmo_1.assert(e==DateSelectionMode.Range,'InputDateRange.selectionMode must be "Range"');this.calendar.selectionMode=e},enumerable:!0,configurable:!0});InputDateRange.prototype._mouseWheel=function(e){if(!e.defaultPrevented&&!this.isDroppedDown&&this.containsFocus()&&null!=this.value&&this._canChangeValue()){var t=wijmo_1.clamp(-e.deltaY,-1,1),i=this.value;this.value=this.selectionMode==DateSelectionMode.Month?wijmo_1.DateTime.addMonths(i,t):wijmo_1.DateTime.addDays(i,t);this.selectAll();e.preventDefault()}};InputDateRange.prototype.onGotFocus=function(e){var t=this._tbx;this._elRef!=t||this.isDroppedDown||this.selectAll();this.containsFocus()||this.focus();this.gotFocus.raise(this,e)};InputDateRange.prototype._keydown=function(t){if(!(t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey)){this._isInvalidInputCancelled=!1;if(this._isHiddenEditor())return;switch(t.keyCode){case wijmo_1.Key.Up:case wijmo_1.Key.Down:if(t.keyCode===wijmo_1.Key.Up&&this.keyActionUpArrow===KeyAction.OpenDropdown||t.keyCode===wijmo_1.Key.Down&&this.keyActionDownArrow===KeyAction.OpenDropdown)break;if(!this.isDroppedDown&&this.value&&this._canChangeValue()){var i=t.keyCode==wijmo_1.Key.Up?1:-1,o=this.selectionMode==DateSelectionMode.Month?wijmo_1.DateTime.addMonths(this.value,i):wijmo_1.DateTime.addDays(this.value,i);this.value=this._fromDateTime(o);this.selectAll();t.preventDefault()}}}e.prototype._keydown.call(this,t)};InputDateRange._ctrlTemplate="";return InputDateRange}(InputDate);exports.InputDateRange=InputDateRange;function getInputDateOptions(e){var t={};if(!wijmo_1.isNullOrUndefined(e)){wijmo_1.isNullOrUndefined(e.showConfirmationButtons)||(t.showConfirmationButtons=e.showConfirmationButtons);wijmo_1.isNullOrUndefined(e.tabOrder)||(t.tabOrder=e.tabOrder)}return t}wijmo_1._addCultureInfo("InputColor",{ariaLabels:{inputColor:"Input Color",inputColorInput:"InputColor Input",button:"Choose Color",dialog:"ColorPicker"}});var InputColor=function(e){__extends(InputColor,e);function InputColor(t,i){var o=e.call(this,t)||this;o._textInitialized=!1;o._ariaLabelledby=null;o._inputAriaLabel=wijmo_1.culture.InputColor.ariaLabels.inputColorInput;o.valueChanged=new wijmo_1.Event;wijmo_1.addClass(o.hostElement,exports.InputColorClsNames.hostElement);wijmo_1.setAttribute(o._dropDown,"role","dialog");wijmo_1.setAriaLabel(o._dropDown,wijmo_1.culture.InputColor.ariaLabels.dialog);wijmo_1.setAttribute(o._dropDown,"aria-modal",!0);wijmo_1.setAttribute(o._tbx,"role","combobox");wijmo_1.setAttribute(o._tbx,"aria-haspopup","dialog");wijmo_1.setAttribute(o._btn.querySelector("button"),"aria-haspopup","dialog");wijmo_1.setAriaLabel(o._btn.querySelector("button"),wijmo_1.culture.InputColor.ariaLabels.button);o.dropDown.id=wijmo_1.getUniqueId(o.hostElement.id+"_dropdown");var n='<div class="'+exports.InputColorClsNames.inputColorBox+'"></div>';o._ePreview=wijmo_1.createElement(n,o.hostElement.firstElementChild);if("INPUT"==o._orgTag){o._tbx.type="";o._commitText()}o.value="#ffffff";o.isRequired=!0;o._tbx.value=o._oldText=o.value;o.initialize(i);if(o._textInitialized&&o._tbx.value!==o._oldText){o._oldText=o._tbx.value;o.onTextChanged();o._commitText();o._textInitialized=!1}o.addEventListener(o._colorPicker.hostElement,"click",(function(e){var t=e.target;if(t&&"DIV"==t.tagName&&(wijmo_1.closest(t,'[wj-part="div-pal"]')||wijmo_1.closest(t,'[wj-part="div-pv"]'))){t.style.backgroundColor&&(o.isDroppedDown=!1)}}));var s=!i||-1!==i.tabOrder&&i.colorPickerKeyActionTab!==ColorPickerTabKeyAction.None?0:-1;o._colorPicker.tabOrder=s;o._updateInputAriaLabel();return o}Object.defineProperty(InputColor,"controlTemplate",{get:function(){InputColor._ctrlTemplate||(InputColor._ctrlTemplate=DropDown.controlTemplate);return InputColor._ctrlTemplate},set:function(e){InputColor._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"value",{get:function(){return this._value},set:function(e){this.text=e},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"text",{get:function(){return this._tbx.value},set:function(e){if((e=wijmo_1.asString(e))!=this.text&&(e||!this.isRequired)&&(!e||wijmo_1.Color.fromString(e.replace(/\s+/g,"")))){this._setText(e,!0);this._commitText()}},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"inputType",{get:function(){return this._tbx.type},set:function(e){e.match(/^(tel|text|)$/i)?this._tbx.type=wijmo_1.asString(e):console.warn("invalid input type '"+e+"', don't use any input types other than 'tel' or 'text'")},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"showAlphaChannel",{get:function(){return this._colorPicker.showAlphaChannel},set:function(e){this._colorPicker.showAlphaChannel=e},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"showColorString",{get:function(){return this._colorPicker.showColorString},set:function(e){this._colorPicker.showColorString=e},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"palette",{get:function(){return this._colorPicker.palette},set:function(e){this._colorPicker.palette=e},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"colorPicker",{get:function(){return this._colorPicker},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"ariaLabelledBy",{get:function(){return this._ariaLabelledby},set:function(e){wijmo_1._setAriaLabelBy(this,this._tbx,e,this._updateInputAriaLabel.bind(this))},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"colorPickerKeyActionTab",{get:function(){return this.colorPicker.keyActionTab},set:function(e){this.colorPicker.keyActionTab=e},enumerable:!0,configurable:!0});InputColor.prototype.onValueChanged=function(e){this.valueChanged.raise(this,e)};InputColor.prototype.onIsDroppedDownChanged=function(t){e.prototype.onIsDroppedDownChanged.call(this,t);if(this.isDroppedDown&&!this.isTouching){this.colorPicker._refreshSelection();var i=this._tbx;this._elRef==i&&wijmo_1.setSelectionRange(i,0,this.text.length,!1);this.containsFocus()||this.focus()}};InputColor.prototype._createDropDown=function(){var e=this;this._colorPicker=new ColorPicker(this._dropDown);wijmo_1.setCss(this._dropDown,{minWidth:420,minHeight:200});this._colorPicker.valueChanged.addHandler((function(){e.value=e._colorPicker.value}))};InputColor.prototype._keydown=function(t){if(!t.defaultPrevented)switch(t.keyCode){case wijmo_1.Key.Enter:this._commitText();this.selectAll();break;case wijmo_1.Key.Escape:this.text=this.value;this.selectAll();break;case wijmo_1.Key.Tab:var i=wijmo_1.getActiveElement();if(this.colorPicker.keyActionTab===ColorPickerTabKeyAction.All&&i!==this._tbx){var o=wijmo_1._getFocusableElements(this.colorPicker.hostElement),n=o[0],s=o[o.length-1];if(t.shiftKey){if(i===n){t.preventDefault();s.focus()}}else if(i===s){t.preventDefault();n.focus()}}else if(this.isDroppedDown){this.isDroppedDown=!1;this.containsFocus()||this.focus();this.keyActionTab===TabKeyAction.CloseAndKeepFocus&&t.preventDefault()}}e.prototype._keydown.call(this,t)};InputColor.prototype._commitText=function(){if(this._value!=this.text){var e=!this.text||!this.text.trim();if(!this.isRequired&&e){this._changeAllValue();this._ePreview.style.backgroundColor="";return}if(wijmo_1.Color.fromString(this.text.replace(/\s+/g,""))){if(this.text&&this.text!==this.text.replace(/\s+/g,"")){this.text=this.text.replace(/\s+/g,"");return}this._changeAllValue()}else this.onInvalidInput(new wijmo_1.CancelEventArgs)&&(this.text=this._value?this._value:"")}};InputColor.prototype._changeAllValue=function(){var e=this._colorPicker;e.value=this.text;this._value=e.value;this._ePreview.style.backgroundColor=this.value;this.onValueChanged()};InputColor.prototype._copy=function(e,t){if("text"===e){var i=(t||"").toString();if(i!==this.text){this._tbx.value=i;this._textInitialized=!0}return!0}return!1};InputColor.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.InputColor.ariaLabels.inputColor};InputColor.prototype._updateInputAriaLabel=function(){this._tbx&&(this._tbx.id||this.ariaLabelledBy?wijmo_1.setAriaLabel(this._tbx,null):wijmo_1.setAriaLabel(this._tbx,this._inputAriaLabel))};InputColor._ctrlTemplate="";return InputColor}(DropDown);exports.InputColor=InputColor;wijmo_1._addCultureInfo("ComboBox",{ariaLabels:{comboBoxInput:"ComboBox Input",comboBox:"Combo Box"}});var ComboBox=function(e){__extends(ComboBox,e);function ComboBox(t,i){var o=e.call(this,t)||this;o._editable=!1;o._trimText=!0;o._handleWheel=!0;o._delKey=0;o._draggingText=!1;o._textIsComposing="";o._pathHdr=new wijmo_1.Binding(null);o._bsCollapse=!0;o._fmtItemHandlers=0;o._emptyValueAction=!1;o._oldIndexToBeRestoredOnBlur=null;o._restoreComboboxTbxVal=!1;o._isWheel=!1;o._selItems=null;o._oldFilter=null;o._keyActionPrintCharacters=KeyAction.OpenDropdown;o._inputElementAriaLabel=wijmo_1.culture.ComboBox.ariaLabels.comboBoxInput;o._ariaLabelledby=null;o.itemsSourceChanged=new wijmo_1.Event;o.selectedIndexChanged=new wijmo_1.Event;var n=o.hostElement;wijmo_1.addClass(n,exports.ComboBoxClsNames.hostElement);o.dropDown.id=wijmo_1.getUniqueId(n.id+"_dropdown");o.autoExpandSelection=!1;var s=o._tbx;o.addEventListener(s,"compositionstart",(function(){o._composing=!0}));o.addEventListener(s,"compositionend",(function(){o._textIsComposing=o.text;o._composing=!1;o._setText(o._textIsComposing,!0);if(!o._textIsComposing&&o.isRequired){o._oldText="";o._oldIndexToBeRestoredOnBlur=null}setTimeout((function(){o._textIsComposing=""}))}));o.addEventListener(s,"drag",(function(){o._draggingText=!0}));o.addEventListener(n,"wheel",o._wheel.bind(o));"SELECT"==o._orgTag&&o._lbx._initFromSelect(n);var r=o._lbx;r.loadedItems.addHandler((function(e){o.selectedIndex>-1&&(o.selectedIndex=r.selectedIndex)}));r.tabOrder=-1;o.isRequired=!0;o.initialize(i);o._updateTbxAriaHaspopup();o._updateInputAriaLabel();return o}Object.defineProperty(ComboBox,"controlTemplate",{get:function(){ComboBox._ctrlTemplate||(ComboBox._ctrlTemplate=DropDown.controlTemplate);return ComboBox._ctrlTemplate},set:function(e){ComboBox._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"itemsSource",{get:function(){return this._lbx.itemsSource},set:function(e){if(this._lbx.itemsSource!=e){this._lbx.itemsSource=e;this.onItemsSourceChanged()}this._updateBtn()},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"collectionView",{get:function(){return this._lbx.collectionView},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"virtualizationThreshold",{get:function(){return this._lbx.virtualizationThreshold},set:function(e){this._lbx.virtualizationThreshold=e},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"showGroups",{get:function(){return this._lbx.showGroups},set:function(e){this._lbx.showGroups=e},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"displayMemberPath",{get:function(){return this._lbx.displayMemberPath},set:function(e){if(this.displayMemberPath!==e){this._lbx.displayMemberPath=e;var t=this._getDisplayText(void 0,void 0,!0);this.text!=t&&this._setText(t,!0)}},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"headerPath",{get:function(){return this._pathHdr.path},set:function(e){this._pathHdr.path=wijmo_1.asString(e);var t=this._getDisplayText(void 0,void 0,!0);this.text!=t&&this._setText(t,!0)},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"selectedValuePath",{get:function(){return this._lbx.selectedValuePath},set:function(e){this._lbx.selectedValuePath=e},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"isContentHtml",{get:function(){return this._lbx.isContentHtml},set:function(e){if(e!=this.isContentHtml){this._lbx.isContentHtml=wijmo_1.asBoolean(e);var t=this._getDisplayText(void 0,void 0,!0);this.text!=t&&this._setText(t,!0)}},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"caseSensitiveSearch",{get:function(){return this._lbx.caseSensitiveSearch},set:function(e){this._lbx.caseSensitiveSearch=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"trimText",{get:function(){return this._trimText},set:function(e){if(e!=this._trimText){this._trimText=wijmo_1.asBoolean(e);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"itemFormatter",{get:function(){return this._lbx.itemFormatter},set:function(e){this._lbx.itemFormatter=wijmo_1.asFunction(e);this.selectedIndex=this._lbx.selectedIndex},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"formatItem",{get:function(){return this._lbx.formatItem},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"selectedIndex",{get:function(){return this._lbx.selectedIndex},set:function(e){e!=this.selectedIndex&&wijmo_1.isNumber(e)&&(this._lbx.selectedIndex=e);var t=this._lbx._oldSelectedIndex!=this.selectedIndex;e=this.selectedIndex;var i=this._getDisplayText(e,void 0,!0);if(this.text!=i||t){var o=this._internalSettingText;this._internalSettingText=this._lbx._ignoredItemChangedEvents;this._setText(i,!0);""!=this.text&&(this._emptyValueAction=!1);this._internalSettingText=o}},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"selectedItem",{get:function(){return this._lbx.selectedItem},set:function(e){this._lbx.selectedItem=e},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"selectedValue",{get:function(){return this.collectionView?this._lbx.selectedValue:this.text},set:function(e){this.collectionView?this._lbx.selectedValue=e:null!=e&&(this.text=e.toString())},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"isEditable",{get:function(){return this._editable},set:function(e){this._editable=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"handleWheel",{get:function(){return this._handleWheel},set:function(e){this._handleWheel=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"maxDropDownHeight",{get:function(){return this._lbx.maxHeight},set:function(e){this._lbx.maxHeight=e},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"maxDropDownWidth",{get:function(){var e=this._dropDown,t=e?parseInt(e.style.maxWidth):null;return isNaN(t)?null:t},set:function(e){var t=this._dropDown.style;e=wijmo_1.asNumber(e,!0);t.maxWidth=null==e?"":e+"px";t.minWidth=""},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"keyActionPrintCharacters",{get:function(){return this._keyActionPrintCharacters},set:function(e){this._keyActionPrintCharacters=wijmo_1.asEnum(e,KeyAction)},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"ariaLabelledBy",{get:function(){return this._ariaLabelledby},set:function(e){wijmo_1._setAriaLabelBy(this,this._tbx,e,this._updateInputAndListBoxAriaLabel.bind(this))},enumerable:!0,configurable:!0});ComboBox.prototype._updateInputAndListBoxAriaLabel=function(){this._updateInputAriaLabel()};ComboBox.prototype.getDisplayText=function(e,t){void 0===e&&(e=this.selectedIndex);void 0===t&&(t=this._trimText);return this._getDisplayText(e,t)};ComboBox.prototype._getDisplayText=function(e,t,i){void 0===e&&(e=this.selectedIndex);void 0===t&&(t=this._trimText);var o,n=this.collectionView;if(this.headerPath&&e>-1&&wijmo_1.hasItems(n)){var s=n.items[e];o=null!=(o=s?this._pathHdr.getValue(s):null)?o.toString():"";this.isContentHtml&&(o=wijmo_1.toPlainText(o))}else o=this._lbx._getDisplayText(e,i&&void 0!==this.itemFormatter&&!this._hasCustomFormatItem());return t?o.trim():o};ComboBox.prototype._hasCustomFormatItem=function(){return this.formatItem.hasHandlers};ComboBox.prototype.indexOf=function(e,t,i){void 0===i&&(i=!1);var o=this.collectionView,n=this.caseSensitiveSearch;if(wijmo_1.hasItems(o)&&null!=e){e=e.toString();n||(e=e.toLowerCase());if(this._trimText&&!i){-1!==this.indexOf(e,!1,!0)||(e=e.trim())}var s=this.selectedIndex,r=this._getDisplayText(s,void 0,!0);if(t){n||(r=r.toLowerCase());if(e==r)return s}else if(!e&&""==r)return s;for(var a=0;a<o.items.length;a++)if(this._lbx.isItemEnabled(a)){r=this._getDisplayText(a,void 0,!0);this.trimText&&(r=r.trim());n||(r=r.toLowerCase());if(t){if(r==e&&!1===this._emptyValueAction)return a}else if(e&&0==r.indexOf(e)||!e&&""==r&&!1===this._emptyValueAction)return a}}return-1};Object.defineProperty(ComboBox.prototype,"listBox",{get:function(){return this._lbx},enumerable:!0,configurable:!0});ComboBox.prototype.onItemsSourceChanged=function(e){this.itemsSourceChanged.raise(this,e)};ComboBox.prototype.onSelectedIndexChanged=function(e){this._updateBtn();this.selectedIndexChanged.raise(this,e)};ComboBox.prototype.refresh=function(t){void 0===t&&(t=!0);e.prototype.refresh.call(this,t);if(this.hostElement&&wijmo_1.hasItems(this.collectionView)){this._lbx.refresh();this.selectedIndex>-1&&(this.selectedIndex=this._lbx.selectedIndex)}};ComboBox.prototype.onLostFocus=function(t,i,o){this._trimText&&(this.text=this.text.trim());if(this._composing){this._composing=!1;if(!this.text&&this.isRequired){this._oldText="";this._oldIndexToBeRestoredOnBlur=null}this._setText(this.text,!0)}if((!this.text&&this.isRequired&&!(Array.isArray(this._selItems)&&this._selItems.length>0)||o)&&wijmo_1.hasItems(this.collectionView)&&!(this.isRequired&&!this.isEditable&&this.text&&this.indexOf(this.text,!1)>-1&&this.indexOf(this.text,!0)<0)){void 0!==i&&(this.selectedIndex=-1!==i?i:0);null!==this._oldIndexToBeRestoredOnBlur?this.selectedIndex=-1!==this._oldIndexToBeRestoredOnBlur?this._oldIndexToBeRestoredOnBlur:0:null==this.collectionView.currentItem&&(this.selectedIndex=0)}var n=this.text,s=this.collectionView?this.collectionView.items.length:0,r=this.selectedIndex;e.prototype.onLostFocus.call(this,t);var a=this.collectionView?this.collectionView.items.length:0,l=this.selectedIndex,h=this.text,u=this._oldFilter;this._oldFilter=null;if(r===l&&n===h){u&&(this.collectionView.filter=u);this._trySelectionUpdateOnItemsSourceChanged(a!==s,n)}};ComboBox.prototype.onIsDroppedDownChanging=function(t){if(!this.isDroppedDown&&!this._hasItems()){t.cancel=!0;return!1}return e.prototype.onIsDroppedDownChanging.call(this,t)};ComboBox.prototype.onIsDroppedDownChanged=function(t){e.prototype.onIsDroppedDownChanged.call(this,t);if(this.isDroppedDown){this._fmtItemHandlers=this.formatItem.handlerCount;this._lbx.showSelection()}this._updateTbxAria()};ComboBox.prototype._trySelectionUpdateOnItemsSourceChanged=function(e,t){if(e&&t){var i=this.indexOf(t,!0);i<0&&(i=this.indexOf(t,!1));this.selectedIndex=i}};ComboBox.prototype._setIsDisabled=function(t){e.prototype._setIsDisabled.call(this,t);this._updateBtn()};ComboBox.prototype._updateBtn=function(){var t=this.collectionView,i=this._tbx,o=this._hasItems();e.prototype._updateBtn.call(this);this._btn.style.display=this._showBtn&&null!=t?"":"none";wijmo_1.enable(this._btn,o&&!this.isDisabled);wijmo_1.setAttribute(i,"role",o?"combobox":null);wijmo_1.setAttribute(i,"aria-autocomplete",o?"both":null);this._updateTbxAria()};ComboBox.prototype._hasItems=function(){return wijmo_1.hasItems(this.collectionView)};ComboBox.prototype._updateTbxAria=function(){e.prototype._updateTbxAria.call(this);var t=this._tbx,i=this.isDroppedDown,o=this.dropDown?this.dropDown.id:null,n=o&&wijmo_1.hasItems(this.collectionView),s=this._lbx,r=s.selectedIndex,a=s.hostElement?s.hostElement.children:null,l=s._getElementIndex(r),h=l>-1&&a&&l<a.length?a[l].id:null;wijmo_1.setAttribute(t,"aria-controls",n&&i?o:null);wijmo_1.setAttribute(t,"aria-expanded",n?i:null);wijmo_1.setAttribute(t,"aria-activedescendant",this.isDroppedDown&&h&&h.length?h:null)};ComboBox.prototype._updateInputAriaLabel=function(){var e=this._tbx;e&&(e.id||this._ariaLabelledby?wijmo_1.setAttribute(e,"aria-label",null):wijmo_1.setAttribute(e,"aria-label",this._inputElementAriaLabel))};ComboBox.prototype._createDropDown=function(){var e=this;if(!this._lbx){this._lbx=new ListBox(this._dropDown);this._lbx._container=this.hostElement}this._lbx.maxHeight=200;this._lbx.selectedIndexChanged.addHandler((function(){e._updateBtn();var t=e._lbx.selectedIndex;e.selectedIndex=t;e.onSelectedIndexChanged()}));this._lbx.itemsChanged.addHandler((function(){e._updateBtn()}))};ComboBox.prototype._wheel=function(e){this._isWheel=!0;if(this.handleWheel&&!e.defaultPrevented&&!this.isDroppedDown&&!this.isReadOnly&&this.containsFocus()&&this.selectedIndex>-1){var t=this._findNext("",e.deltaY>0?1:-1);t>-1&&(this.selectedIndex=t);e.preventDefault()}this._isWheel=!1};ComboBox.prototype._dropDownClick=function(t){t.defaultPrevented||t.target!=this._dropDown&&(this.isDroppedDown=!1);this._restoreComboboxTbxVal&&(this._tbx.value=this._getDisplayText(this.selectedIndex,void 0,!0));e.prototype._dropDownClick.call(this,t)};ComboBox.prototype._setText=function(t,i,o){void 0===o&&(o=!1);if(!this._composing&&!this._settingText){this._settingText=!0;if(this.containsFocus()){var n=this.formatItem.handlerCount;if(this._fmtItemHandlers!=n){this._fmtItemHandlers=n;this._lbx.loadList()}}t=[null,void 0,NaN].includes(t)?"":t.toString();var s=this.selectedIndex,r=this.collectionView,a=this._getSelStart(),l=-1,h=!0;if(this.isEditable&&(this._delKey||this._getSelEnd()<t.length||!this.containsFocus())){i=!0;h=!1}s=this.indexOf(t,i);if(h){s<0&&i&&(s=this.indexOf(t,!1));s<0&&a>0&&!o&&(s=this.indexOf(t.substr(0,a),!1));if(!i){var u=this.indexOf(t,!0);u>-1&&s>-1&&u!=s&&(s=u)}}s<0&&this._delKey&&(s=this.indexOf(t,i));if(s<0&&!this.isEditable&&wijmo_1.hasItems(r)&&(t&&this.isRequired||this.containsFocus()&&(t||this.isRequired))){var c=this._oldText||"";s=Math.max(0,this.indexOf(c,!1));a=0;for(var p=0;p<t.length&&p<c.length;p++)if(t[p]!=c[p]){a=p;break}}if((!this._delKey||!this.isEditable||this._delKey&&this.isEditable&&t==this._getDisplayText(s,void 0,!0))&&(!this._pristine||this._pristine&&!this.isEditable)||this._isWheel||this._delKey&&""==t&&s>-1){if(s>-1){l=a;t=this._getDisplayText(s,void 0,!0)}var d=this._tbx;t!=d.value&&(d.value=t);l>-1&&this.containsFocus()&&!this.isTouching&&this._updateInputSelection(l)}if(r){if(!t||this.trimText&&""==t.trim()&&!this.containsFocus()&&this.isEditable)if(s>-1)this._oldIndexToBeRestoredOnBlur=s;else{this._oldIndexToBeRestoredOnBlur=this.indexOf(this._oldText,!0);this._oldIndexToBeRestoredOnBlur=this._oldIndexToBeRestoredOnBlur<0?this.indexOf(this._oldText,!1):this._oldIndexToBeRestoredOnBlur}this._restoreComboboxTbxVal=t&&s>-1;r.moveCurrentToPosition(s)}this.containsFocus()||this.isEditable||this.isRequired||t!=t.trim()||!this.trimText||(this._tbx.value=this._getDisplayText(s,this.trimText,!0));!this.containsFocus()&&s>-1&&this.isEditable&&(t=this._getDisplayText(s,this.trimText,!0));!this.containsFocus()&&this._hasItems()&&s<0&&!this.isEditable&&!this.isRequired&&(t="");var _=!1;!t&&s<0&&this.isRequired&&!this.containsFocus()&&(_=!0);this.trimText&&!this.containsFocus()&&this.isEditable&&(this.isRequired&&""==t.trim()?_=!0:t=t.trim());if(_){this.selectedIndex=this._oldIndexToBeRestoredOnBlur;this.selectedIndex<0&&(this.selectedIndex=0)}var m=!this.containsFocus()&&!this.isEditable&&this.trimText;m&&(this._tbx.value=this._getDisplayText(s,!0,!0));this._delKey=0;this._settingText=!1;e.prototype._setText.call(this,_?this._getDisplayText(this.selectedIndex,void 0,!0):t,i,_,m)}};ComboBox.prototype._findNext=function(e,t,i){void 0===i&&(i=this.selectedIndex);var o=this.collectionView,n=o?o.items.length:0,s=this._lbx,r=this.caseSensitiveSearch;if(o&&n&&t){r||(e=e.toLowerCase());this.trimText&&(e=e.trim());for(var a=i+t;a>-1&&a<n;a+=t){var l=this._getDisplayText(a,void 0,!0);r||(l=l.toLowerCase());if(0==l.indexOf(e)){if(!this.dropDown.children[a]||s.isItemEnabled(a))return a}}}return i};ComboBox.prototype._findNextWhenIsEditableFalse=function(e,t,i){void 0===i&&(i=this.selectedIndex);var o=this._findNext(e,t,i);return o!==i?o:-1};ComboBox.prototype._keydown=function(t){e.prototype._keydown.call(this,t);if(!t.defaultPrevented&&!this.isReadOnly&&!t.altKey&&wijmo_1.hasItems(this.collectionView)&&this._elRef==this._tbx&&!this._isHiddenEditor()){this._delKey=0;var i=this._getSelStart(),o=this._getSelEnd();switch(t.keyCode){case wijmo_1.Key.Tab:if(this.isDroppedDown){this.isDroppedDown=!1;this.keyActionTab===TabKeyAction.CloseAndKeepFocus&&t.preventDefault()}break;case wijmo_1.Key.Back:case wijmo_1.Key.Delete:case 88:if(!t.ctrlKey&&!t.metaKey&&88==t.keyCode)break;if(this._bsCollapse&&!this.isEditable&&i>0&&o==this._tbx.value.length&&wijmo_1.hasItems(this.collectionView)){this._setSelRange(i-1,o);i-=1}this._delKey=t.keyCode;break;case wijmo_1.Key.Up:case wijmo_1.Key.Down:i==this.text.length&&(i=0);this.selectedIndex=this._findNext(this.text.substr(0,i),t.keyCode==wijmo_1.Key.Up?-1:1);this._setSelRange(i,this.text.length);t.preventDefault();break;case wijmo_1.Key.PageUp:this._lbx._selectPrevPage();this.selectAll();t.preventDefault();break;case wijmo_1.Key.PageDown:this._lbx._selectNextPage();this.selectAll();t.preventDefault();break;case wijmo_1.Key.Home:case wijmo_1.Key.End:var n=this._tbx;wijmo_1.setAttribute(n,"aria-activedescendant",null)}this.text.length>0&&["Backspace","Delete","x"].includes(t.key)&&0===i&&o===this.text.length||this._delKey&&1===this.text.length?this._emptyValueAction=!0:this._composing||(this._emptyValueAction=!1)}};ComboBox.prototype._afterOpenDropdownByDownArrow=function(){if(-1===this.selectedIndex){this.selectedIndex=0;this.selectAll()}};ComboBox.prototype._input=function(e){this._handleDragTextState();this._updateDropDownWhenInput();this._updateComponentText();this._updateEmptyValueFlag();this._resetDragState()};ComboBox.prototype._handleDragTextState=function(){this._draggingText&&(this._emptyValueAction=""===this.text)};ComboBox.prototype._shouldOpenDropdown=function(){return this.keyActionPrintCharacters===KeyAction.OpenDropdown};ComboBox.prototype._handleIsEditableFalseInput=function(){var e=this.text,t=this.text.length,i=this._findNextWhenIsEditableFalse(e,1,this.selectedIndex-1);if(-1===i&&-1===(i=this._findNextWhenIsEditableFalse(e,1,-1))){var o=e[e.length-1];t=1;-1===(i=this._findNextWhenIsEditableFalse(o,1))&&(i=this._findNextWhenIsEditableFalse(o,1,-1))}-1!==i?this._updateSelection(i,t):this._updateComponentText()};ComboBox.prototype._updateSelection=function(e,t){this._tbx.value=this._getDisplayText(e,void 0,!0);this._updateInputSelection(t);var i=this.collectionView;i&&i.moveCurrentToPosition(e)};ComboBox.prototype._updateComponentText=function(){var e=this._textIsComposing||this.text;this._setText(e,!1)};ComboBox.prototype._updateEmptyValueFlag=function(){this.text&&(this._emptyValueAction=!1)};ComboBox.prototype._controlDropdownVisibility=function(){this.text&&!this.isDroppedDown&&(this.isDroppedDown=!0)};ComboBox.prototype._resetDragState=function(){this._draggingText=!1};ComboBox.prototype._updateInputSelection=function(e){var t=this._tbx;this._elRef==t&&this._setSelRange(e,t.value.length)};ComboBox.prototype._getSelStart=function(){var e=this._tbx;return e&&e.value?e.selectionStart:0};ComboBox.prototype._getSelEnd=function(){var e=this._tbx;return e&&e.value?e.selectionEnd:0};ComboBox.prototype._setSelRange=function(e,t){var i=this._tbx;this._elRef!=i||i.readOnly||wijmo_1.setSelectionRange(i,e,t)};ComboBox.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.ComboBox.ariaLabels.comboBox};ComboBox.prototype._updateDropDownWhenInput=function(){if(this._shouldOpenDropdown()){var e=this._getSelStart(),t=this._getSelEnd(),i=this._delKey,o=this.text;this._controlDropdownVisibility();this._tbx.value=o;this._setSelRange(e,t);this._delKey=i}};ComboBox._ctrlTemplate="";return ComboBox}(DropDown);exports.ComboBox=ComboBox;wijmo_1._addCultureInfo("MultiSelect",{itemsSelected:"{count:n0} items selected",selectAll:"Select All",ariaLabels:{multiSelectInput:"MultiSelect Input",multiSelect:"Multi Select"}});var MultiSelect=function(e){__extends(MultiSelect,e);function MultiSelect(t,i){var o=e.call(this,t)||this;o._maxHdrItems=2;o._readOnly=!1;o._hdrFmt=null;o._inputElementAriaLabel=wijmo_1.culture.MultiSelect.ariaLabels.multiSelectInput;o.checkedItemsChanged=new wijmo_1.Event;wijmo_1.addClass(o.hostElement,exports.MultiSelectClsNames.hostElement);o._tbx.readOnly=!0;o.checkedMemberPath=null;o.removeEventListener(o.dropDown,"click");o._lbx.itemsChanged.addHandler((function(){o._updateHeader(!1)}));o._lbx.checkedItemsChanged.addHandler((function(){o._updateHeader(!1);o.onCheckedItemsChanged()}));o.clickAction=ClickAction.Toggle;o.initialize(i);o._updateInputAriaLabel();return o}Object.defineProperty(MultiSelect,"controlTemplate",{get:function(){MultiSelect._ctrlTemplate||(MultiSelect._ctrlTemplate=ComboBox.controlTemplate);return MultiSelect._ctrlTemplate},set:function(e){MultiSelect._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"showSelectAllCheckbox",{get:function(){return this._msLbx.showSelectAllCheckbox},set:function(e){this._msLbx.showSelectAllCheckbox=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"showFilterInput",{get:function(){return this._msLbx.showFilterInput},set:function(e){this._msLbx.showFilterInput=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"delay",{get:function(){return this._msLbx.delay},set:function(e){this._msLbx.delay=e},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"caseSensitiveSearch",{get:function(){return this._msLbx.caseSensitiveSearch},set:function(e){this._msLbx.caseSensitiveSearch=e},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"filterInputPlaceholder",{get:function(){return this._msLbx.filterInputPlaceholder},set:function(e){this._msLbx.filterInputPlaceholder=wijmo_1.asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"checkOnFilter",{get:function(){return this._msLbx.checkOnFilter},set:function(e){if(e!=this.checkOnFilter){this._msLbx.checkOnFilter=wijmo_1.asBoolean(e);this.checkedItems=[]}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"selectAllLabel",{get:function(){return this._msLbx.selectAllLabel},set:function(e){this._msLbx.selectAllLabel=wijmo_1.asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"checkedMemberPath",{get:function(){return this._msLbx.checkedMemberPath},set:function(e){this._msLbx.checkedMemberPath=wijmo_1.asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"maxHeaderItems",{get:function(){return this._maxHdrItems},set:function(e){if(this._maxHdrItems!=e){this._maxHdrItems=wijmo_1.asNumber(e);this._updateHeader()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"headerFormat",{get:function(){return this._hdrFmt},set:function(e){if(e!=this._hdrFmt){this._hdrFmt=wijmo_1.asString(e);this._updateHeader()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"headerFormatter",{get:function(){return this._hdrFormatter},set:function(e){if(e!=this._hdrFormatter){this._hdrFormatter=wijmo_1.asFunction(e);this._updateHeader()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"checkedItems",{get:function(){return this._msLbx.checkedItems},set:function(e){this._msLbx.checkedItems=null==e?[]:wijmo_1.asArray(e);this._updateHeader()},enumerable:!0,configurable:!0});MultiSelect.prototype.onCheckedItemsChanged=function(e){this.checkedItemsChanged.raise(this,e)};MultiSelect.prototype.dispose=function(){this._lbx.dispose();e.prototype.dispose.call(this)};MultiSelect.prototype.onIsDroppedDownChanged=function(t){var i=this;e.prototype.onIsDroppedDownChanged.call(this,t);setTimeout((function(){if(i.isDroppedDown&&i.containsFocus())if(i.showFilterInput&&!i.isTouching)i._msLbx._filter.focus();else{var e=i.listBox;if(e.selectedIndex<0){var t=0,o=e.checkedItems;o.length&&(t=e.collectionView.items.indexOf(o[0]));e.selectedIndex=Math.max(0,t)}e.showSelection(!0);e.focus()}}))};MultiSelect.prototype.onLostFocus=function(){this._msLbx.onLostFocus();this.isDroppedDown=!1;e.prototype.onLostFocus.call(this)};MultiSelect.prototype._createDropDown=function(){var t=this,i=wijmo_1.createElement("<div></div>",this._dropDown);this._msLbx=new MultiSelectListBox(i);this._lbx=this._msLbx.listBox;var o=this.hostElement;this._lbx.hostElement.id=wijmo_1.getUniqueId(o.id+"_listbox");this._lbx.itemsChanged.addHandler((function(){t.isDroppedDown&&t.refresh()}));e.prototype._createDropDown.call(this)};MultiSelect.prototype._updateBtnAria=function(){var e=this._btn.querySelector("button"),t=this.isDroppedDown,i=this._lbx?this._lbx.hostElement:null,o=i?i.id:null;wijmo_1.setAttribute(e,"aria-expanded",t);wijmo_1.setAttribute(e,"aria-controls",t?o:null)};MultiSelect.prototype._updateTbxAria=function(){var e=this._tbx,t=this.isDroppedDown,i=this._lbx?this._lbx.hostElement:null,o=i?i.id:null;wijmo_1.setAttribute(e,"aria-expanded",t);wijmo_1.setAttribute(e,"aria-controls",t?o:null)};Object.defineProperty(MultiSelect.prototype,"isReadOnly",{get:function(){return this._readOnly},set:function(e){this._readOnly=wijmo_1.asBoolean(e);wijmo_1.toggleClass(this.hostElement,wijmo_1.ControlStateClsNames.readOnly,this.isReadOnly)},enumerable:!0,configurable:!0});MultiSelect.prototype.refresh=function(t){void 0===t&&(t=!0);e.prototype.refresh.call(this,t);this.hostElement&&this._updateHeader()};MultiSelect.prototype._setText=function(e,t){};MultiSelect.prototype._keydown=function(t){var i=t.altKey&&(38===t.keyCode||40===t.keyCode);if(this.isDroppedDown&&i&&this.showFilterInput){this.isDroppedDown=!1;t.preventDefault()}else{e.prototype._keydown.call(this,t);wijmo_1.hasClass(this._tbx,"wj-grid-ime")||!t.defaultPrevented&&wijmo_1.hasItems(this.collectionView)&&t.keyCode>32&&123!==t.keyCode&&(this.isDroppedDown=!0)}};MultiSelect.prototype._hasItems=function(){var e=this.collectionView,t=e?e.sourceCollection:null;return wijmo_1.hasItems(e)||t&&t.length&&this.showFilterInput};MultiSelect.prototype._updateHeader=function(e,t){void 0===e&&(e=!0);void 0===t&&(t=!0);var i="";if(wijmo_1.isFunction(this._hdrFormatter))i=this._hdrFormatter(this);else{var o=this.checkedItems,n=[];if(this.displayMemberPath){var s=new wijmo_1.Binding(this.displayMemberPath);n=o.reduce((function(e,t){(t.binding?e.find((function(e){return e.binding===t.binding})):e.find((function(e){return s.getValue(e)===s.getValue(t)})))||e.push(t);return e}),[]);o=n}if(o.length>0)if(o.length<=this._maxHdrItems){if(this.headerPath){var r=new wijmo_1.Binding(this.headerPath);o=o.map((function(e){return r.getValue(e)}))}else if(this.displayMemberPath){var a=new wijmo_1.Binding(this.displayMemberPath);o=o.map((function(e){return a.getValue(e)}))}this.isContentHtml&&(o=o.map((function(e){return wijmo_1.toPlainText(e)})));this.trimText&&(o=o.map((function(e){return e?e.toString().trim():""})));i=o.join(", ")}else i=wijmo_1.format(this.headerFormat||wijmo_1.culture.MultiSelect.itemsSelected,{count:o.length})}var l=this.inputElement;if(i!=l.value){l.value=i;this.onTextChanged()}e&&this._lbx._updateCheckedList(this.checkedItems);this._updateState()};MultiSelect.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.MultiSelect.ariaLabels.multiSelect};MultiSelect._DEF_CHECKED_PATH="$checked";MultiSelect._ctrlTemplate="";return MultiSelect}(ComboBox);exports.MultiSelect=MultiSelect;wijmo_1._addCultureInfo("Menu",{ariaLabels:{menuButton:"Menu"}});var Menu=function(e){__extends(Menu,e);function Menu(t,i){var o=e.call(this,t)||this;o._closing=!1;o._cmd=null;o._cmdPath=null;o._cmdParamPath=null;o._subPath=null;o._owner=null;o._isButton=!1;o._keepOpen=!1;o._openOnHover=!1;o._closeOnLeave=!0;o._subMenu=null;o._hoverEnterBnd=o._hoverEnter.bind(o);o._hoverLeaveBnd=o._hoverLeave.bind(o);o._hoverOverBnd=o._hoverOver.bind(o);o._ariaLabel=wijmo_1.culture.Menu.ariaLabels.menuButton;o._aFEnabledItem=!1;o._parentMenu=null;o.itemClicked=new wijmo_1.Event;Menu._MenuInstanceCount++;var n=o.hostElement,s=o._tbx,r=o._lbx,a=o.dropDown;wijmo_1.addClass(n,exports.MenuClsNames.hostElement);s.style.display="none";var l='<div wj-part="header" class="'+wijmo_1.InputFormElementsClsNames.formControl+'"/>';o._hdr=o._elRef=wijmo_1.createElement(l);s.parentElement.insertBefore(o._hdr,s);wijmo_1.removeChild(s);o.isRequired=!1;if("SELECT"==o._orgTag){o.header=n.getAttribute("header");o._lbx.itemsSource&&(o.commandParameterPath="cmdParam")}o.isContentHtml=!0;o.maxDropDownHeight=500;o.addEventListener(o._hdr,"click",(function(e){if(!e.defaultPrevented){o._clearHover(e);if(o._isButton){o.isDroppedDown=!1;o._raiseCommand()}else o.isDroppedDown=!o.isDroppedDown}}));o.addEventListener(o._hdr,"mousedown",(function(e){e.defaultPrevented||o._clearHover(e)}));r.lostFocus.addHandler((function(){o.containsFocus()||(o.isDroppedDown=!1)}));wijmo_1.addClass(a,exports.MenuClsNames.menuItems);r.formatItem.addHandler(o._formatMenuItem.bind(o));o.initialize(i);wijmo_1.setAttribute(a,"role","menu");o._updateBtnAria();o._updateHdrAria();r.tabOrder=0;o._updateLbxAria();return o}Object.defineProperty(Menu,"controlTemplate",{get:function(){Menu._ctrlTemplate||(Menu._ctrlTemplate=ComboBox.controlTemplate);return Menu._ctrlTemplate},set:function(e){Menu._ctrlTemplate=e},enumerable:!0,configurable:!0});Menu.prototype._updateBtnAria=function(){var e=this._btn.querySelector("button"),t=this.dropDown;wijmo_1.setAttribute(e,"aria-expanded",this.isDroppedDown);wijmo_1.setAttribute(e,"aria-haspopup","menu");wijmo_1.setAttribute(e,"aria-owns",t.id);wijmo_1.setAttribute(e,"aria-controls",t.id)};Menu.prototype._updateHdrAria=function(){var e=this.dropDown,t=this.isDisabled?-1:this._orgTabIndex;wijmo_1.setAttribute(this._hdr,"role","button");wijmo_1.setAttribute(this._hdr,"tabindex",t);wijmo_1.setAttribute(this._hdr,"aria-label",this._ariaLabel);if(this.isButton){wijmo_1.setAttribute(this._hdr,"aria-expanded");wijmo_1.setAttribute(this._hdr,"aria-haspopup");wijmo_1.setAttribute(this._hdr,"aria-owns");wijmo_1.setAttribute(this._hdr,"aria-controls")}else{wijmo_1.setAttribute(this._hdr,"aria-expanded",this.isDroppedDown);wijmo_1.setAttribute(this._hdr,"aria-haspopup","menu");wijmo_1.setAttribute(this._hdr,"aria-owns",e.id);wijmo_1.setAttribute(this._hdr,"aria-controls",e.id)}};Menu.prototype._updateLbxAria=function(){var e=this._lbx,t=this.isDisabled?-1:e.tabOrder;e.itemRole="menuitem";e.tabOrder=t};Object.defineProperty(Menu.prototype,"ariaLabel",{get:function(){return this._ariaLabel},set:function(e){if(e!=this._ariaLabel){this._ariaLabel=e;wijmo_1.setAttribute(this._hdr,"aria-label",this._ariaLabel)}},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"autoSelectOnFocus",{get:function(){return this._aFEnabledItem},set:function(e){this._aFEnabledItem=e},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"header",{get:function(){return this._hdr.innerHTML},set:function(e){this._hdr.innerHTML=wijmo_1.asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"command",{get:function(){return this._cmd},set:function(e){this._cmd=e},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"commandPath",{get:function(){return this._cmdPath},set:function(e){this._cmdPath=wijmo_1.asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"commandParameterPath",{get:function(){return this._cmdParamPath},set:function(e){this._cmdParamPath=wijmo_1.asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"subItemsPath",{get:function(){return this._subPath},set:function(e){if(e!=this._subPath){this._subPath=e;this.refresh(!0)}},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"openOnHover",{get:function(){return this._openOnHover},set:function(e){this._openOnHover=wijmo_1.asBoolean(e);this._updateHoverEvents()},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"closeOnLeave",{get:function(){return this._closeOnLeave},set:function(e){this._closeOnLeave=wijmo_1.asBoolean(e);this._updateHoverEvents()},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"isButton",{get:function(){return this._isButton},set:function(e){this._isButton=wijmo_1.asBoolean(e);this._updateHdrAria()},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"keepOpen",{get:function(){return this._keepOpen},set:function(e){this._keepOpen=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"owner",{get:function(){return this._owner},set:function(e){this._owner=wijmo_1.asType(e,HTMLElement,!0);this._enableDisableItems()},enumerable:!0,configurable:!0});Menu.prototype.show=function(e){if(!this.isDroppedDown){var t=this._lbx._ignoredItemChangedEvents;this._lbx._ignoredItemChangedEvents=!0;this.selectedIndex=-1;this._lbx._ignoredItemChangedEvents=t;if(this.onIsDroppedDownChanging(new wijmo_1.CancelEventArgs)){var i=this.dropDown,o=this.owner;!o&&e instanceof MouseEvent&&(o=e.target);o instanceof HTMLElement&&(i[wijmo_1.Control._OWNR_KEY]=o);if(e instanceof MouseEvent&&this.openOnHover&&this.closeOnLeave){e=new wijmo_1.Point(e.pageX-pageXOffset-2,e.pageY-pageYOffset-2)}wijmo_1.showPopup(i,e,!1,this.isAnimated);this.onIsDroppedDownChanged()}}};Menu.prototype.hide=function(){if(this.isDroppedDown&&this.onIsDroppedDownChanging(new wijmo_1.CancelEventArgs)){wijmo_1.hidePopup(this.dropDown);this.onIsDroppedDownChanged()}};Menu.prototype.onItemClicked=function(e){this.itemClicked.raise(this,e)};Menu.prototype.refresh=function(t){void 0===t&&(t=!0);e.prototype.refresh.call(this,t);this.hostElement&&this._enableDisableItems()};Menu.prototype.onIsDroppedDownChanged=function(t){e.prototype.onIsDroppedDownChanged.call(this,t);this._updateBtnAria();this._updateHdrAria();if(this.isDroppedDown){this._closing=!0;var i=this._lbx._ignoredItemChangedEvents;this._lbx._ignoredItemChangedEvents=!0;this._defaultItem=this.selectedItem;this.isRequired=!1;this.selectedIndex=-1;this._enableDisableItems();this._closing=!1;this._lbx._ignoredItemChangedEvents=i;if(this._aFEnabledItem){for(var o=this.dropDown.children,n=0;n<o.length;n++)if(!o[n].classList.contains(wijmo_1.ControlStateClsNames.disabled)){this.selectedIndex=n;o[n].focus();break}}else this.dropDown.focus()}else{this._restoreSelectedItem();var s=this._subMenu;s&&(s.isDroppedDown=!1)}};Menu.prototype._restoreSelectedItem=function(){if(!this.selectedItem){var e=this._lbx._checking;this._lbx._checking=!0;this.selectedItem=this._defaultItem;this._lbx._checking=e}};Menu.prototype._updateHoverEvents=function(){var e=this.hostElement,t=this.dropDown,i=this.addEventListener.bind(this),o=this.removeEventListener.bind(this),n="mouseleave";o(e,"mouseenter",this._hoverEnterBnd);o(e,n,this._hoverLeaveBnd);o(t,"mouseover",this._hoverOverBnd);o(t,n,this._hoverLeaveBnd);if(this._openOnHover){i(e,"mouseenter",this._hoverEnterBnd);i(t,"mouseover",this._hoverOverBnd);if(this._closeOnLeave){i(e,n,this._hoverLeaveBnd);i(t,n,this._hoverLeaveBnd)}}};Menu.prototype._getSubItems=function(e){var t=this.subItemsPath,i=e&&t?e[t]:null;return wijmo_1.isArray(i)&&i.length?i:null};Menu.prototype._formatMenuItem=function(e,t){var i=t.item;if(this._getSubItems(t.data)){wijmo_1.addClass(i,exports.MenuClsNames.subItems);wijmo_1.setAttribute(i,"aria-expanded",!1)}else if("-"==i.innerHTML){i.innerHTML="";wijmo_1.addClass(i,wijmo_1.UtilitesClsNames.separator);wijmo_1.setAttribute(i,"role","separator");wijmo_1.setAttribute(i,"tabindex")}};Menu.prototype._keydown=function(t){if(!t.defaultPrevented){var i=this._getKeyCode(t);if(this.isDroppedDown)switch(i){case wijmo_1.Key.Tab:this.isDroppedDown=!1;this._parentMenu&&this._parentMenu.focus();this.keyActionTab===TabKeyAction.CloseAndKeepFocus&&t.preventDefault();break;case wijmo_1.Key.Enter:case wijmo_1.Key.Right:if(this._showSubMenu()){t.preventDefault();return}break;case wijmo_1.Key.Left:if(this._closeSubMenuAndFocusOwner()){t.preventDefault();return}break;case wijmo_1.Key.Escape:this.isDroppedDown=!1;this.focus();this._focusMenuOwner();if(this._parentMenu){this._parentMenu.focus();this._parentMenu.isDroppedDown=!1}t.preventDefault()}if(i==wijmo_1.Key.Enter){if(this._isButton){this._restoreSelectedItem();this._raiseCommand();t.preventDefault();return}if(this.isDroppedDown){if(this.selectedIndex>-1){this._raiseCommand();if(this.keepOpen){t.preventDefault();return}}if(this.keepOpen&&this._closeSubMenuAndFocusOwner()){t.preventDefault();return}}else{this.isDroppedDown=!0;t.preventDefault()}}}e.prototype._keydown.call(this,t)};Menu.prototype._afterOpenDropdownByDownArrow=function(){};Menu.prototype._dropDownClick=function(t){if(!t.defaultPrevented&&t.target!=this.dropDown){this._clearHover(t);if(this._showSubMenu()){t.preventDefault();return}if(this.selectedIndex>-1){this._raiseCommand();if(this.keepOpen){t.preventDefault();return}}}e.prototype._dropDownClick.call(this,t)};Menu.prototype._closeSubMenuAndFocusOwner=function(){var e=wijmo_1.Control.getControl(this.owner);if(!(e instanceof Menu))return!1;var t=e.dropDown,i=e.selectedIndex,o=i>-1?t.children[i]:t;wijmo_1.setAttribute(o,"aria-expanded",!1);wijmo_1.setAttribute(o,"aria-owns");o.focus();return!0};Menu.prototype._showSubMenu=function(){var e=this,t=this._getSubItems(this.selectedItem);if(!t)return null;var i=this.dropDown.children[this.selectedIndex],o=i.getBoundingClientRect(),n=new wijmo_1.Point(o.right,o.top);if(0==o.height)return null;var s=this.rightToLeft||"rtl"==this.dropDown.getAttribute("dir");s&&(n.x=o.left);var r=this._subMenu;r&&(r.isDroppedDown=!1);(r=new Menu(document.createElement("div"),{owner:this.hostElement,itemsSource:t,autoSelectOnFocus:this._aFEnabledItem,keepOpen:this.keepOpen,itemClicked:function(t,i){e.itemClicked.raise(t,i)},formatItem:function(t,i){e.formatItem.raise(t,i)}}))._parentMenu=this._parentMenu||this;if(i){wijmo_1.setAttribute(i,"aria-expanded",!0);wijmo_1.setAttribute(i,"aria-owns",r.dropDown.id)}var a=this.collectionView,l=r.collectionView;a&&a.filter&&l&&!l.filter&&(l.filter=a.filter);"displayMemberPath,selectedValuePath,isContentHtml,command,commandPath,commandParameterPath,maxDropDownWidth,maxDropDownHeight,dropDownCssClass,isAnimated,subItemsPath,openOnHover,closeOnLeave".split(",").forEach((function(t){r[t]=e[t]}));var h=r.dropDown;wijmo_1.setAttribute(h,"dir",s?"rtl":null);r.show(n);r._rtlDir=s;h[wijmo_1.Control._OWNR_KEY]=this.dropDown;return r};Menu.prototype._raiseCommand=function(e){var t=this.selectedItem,i=this._getSubItems(t),o=this._getCommand(t);if(o&&!i){var n=this._getCommandParm(t);if(!this._canExecuteCommand(o,n))return;this._executeCommand(o,n)}var s=this.headerPath;if(s){var r=new wijmo_1.Binding(s).getValue(t);r=null==r?"":r.toString();this.header=this.isContentHtml?r:wijmo_1.escapeHtml(r)}this.onItemClicked(e);if(this.containsFocus()){for(var a=this;a&&a.owner;){var l=wijmo_1.Control.getControl(a.owner);if(!(l instanceof Menu))break;a=l}if(this.keepOpen){this._enableDisableItems();this._lbx.focus()}else{a.isDroppedDown=!1;a.focus();this._focusMenuOwner()}}};Menu.prototype._focusMenuOwner=function(){var e=this.owner;!e&&this.dropDown&&(e=this.dropDown[wijmo_1.Control._OWNR_KEY]);if(!this.containsFocus()&&e instanceof HTMLElement&&e.offsetHeight)if(wijmo_1.isIE){var t=document.documentElement,i=t.scrollLeft,o=t.scrollTop;e.focus();t.scrollLeft=i;t.scrollTop=o}else e.focus()};Menu.prototype._getCommand=function(e){var t=e&&this._cmdPath?e[this._cmdPath]:null;return t||this._cmd};Menu.prototype._getCommandParm=function(e){var t=this._cmdParamPath;return e&&t?e[t]:e};Menu.prototype._executeCommand=function(e,t){e&&!wijmo_1.isFunction(e)&&(e=e.executeCommand);wijmo_1.isFunction(e)&&e(t)};Menu.prototype._canExecuteCommand=function(e,t){if(e){var i=e.canExecuteCommand;if(wijmo_1.isFunction(i))return i(t)}return!0};Menu.prototype._enableDisableItems=function(){if(this.collectionView&&(this._cmd||this._cmdPath))for(var e=this.collectionView.items,t=0;t<e.length;t++){var i=e[t],o=this._getCommand(i);if(o){var n=this._lbx.hostElement.children[t],s=this._getCommandParm(i);wijmo_1.toggleClass(n,wijmo_1.ControlStateClsNames.disabled,!this._canExecuteCommand(o,s))}}};Menu.prototype._clearHover=function(e){this._toHover&&clearTimeout(this._toHover);this._toHover=null;Menu._evtHover=e};Menu.prototype._isTargetDisabled=function(e){return wijmo_1.hasClass(e.target,wijmo_1.ControlStateClsNames.disabled)};Menu.prototype._hoverEnter=function(e){var t=this;this._clearHover(e);this._toHover=setTimeout((function(){t._toHover=null;t.isDroppedDown=!0}),wijmo_1.Control._HOVER_DELAY)};Menu.prototype._hoverOver=function(e){var t=this;this._clearHover(e);this._toHover=setTimeout((function(){t._toHover=null;var i=t.listBox.indexOf(e.target);if(i>-1&&!wijmo_1.hasClass(e.target,wijmo_1.ControlStateClsNames.disabled)){t.selectedIndex=i;t._subMenu=t._showSubMenu()}}),wijmo_1.Control._HOVER_DELAY)};Menu.prototype._hoverLeave=function(e){var t=this;this._clearHover(e);this.isDroppedDown&&(this._toHover=setTimeout((function(){var i=(e=Menu._evtHover)?document.elementFromPoint(e.clientX,e.clientY):null,o=wijmo_1.closest(i,"."+exports.ListBoxClsNames.hostElement+"."+exports.MenuClsNames.menuItems),n=t._subMenu;if(!o&&!wijmo_1.contains(t.hostElement,i,!0)){t.isDroppedDown=!1;n&&(n.isDroppedDown=!1)}}),wijmo_1.Control._LEAVE_DELAY))};Menu.prototype._setIsDisabled=function(t){e.prototype._setIsDisabled.call(this,t);wijmo_1.setAttribute(this.hostElement,"tabindex",-1);this._updateHdrAria();this._updateLbxAria()};Menu.prototype._setTabOrder=function(t){e.prototype._setTabOrder.call(this,t);wijmo_1.setAttribute(this.hostElement,"tabindex",-1);this._updateHdrAria();this._updateLbxAria()};Menu.prototype._getRtlStates=function(){var t=this.hostElement;return t&&t.isConnected?e.prototype._getRtlStates.call(this):null!=this._rtlDir&&this._rtlDir};Menu.prototype.dispose=function(){var t=this;if(this._subMenu){this._subMenu.dispose();this._subMenu=null}Menu._MenuInstanceCount--;0===Menu._MenuInstanceCount&&Menu._evtHover&&(Menu._evtHover=null);var i=this._lbx;if(i){i.lostFocus.removeHandler((function(){t.containsFocus()||(t.isDroppedDown=!1)}));i.formatItem&&i.formatItem.removeHandler(this._formatMenuItem)}if(this._toHover){clearTimeout(this._toHover);this._toHover=null}this._cmd=null;this._owner=null;this._defaultItem=null;this._hoverEnterBnd=null;this._hoverLeaveBnd=null;this._hoverOverBnd=null;e.prototype.dispose.call(this)};Menu._MenuInstanceCount=0;Menu._ctrlTemplate="";return Menu}(ComboBox);exports.Menu=Menu;wijmo_1._addCultureInfo("InputTime",{ariaLabels:{inputTime:"Input Time",inputTimeInput:"InputTime Input"}});var InputTime=function(e){__extends(InputTime,e);function InputTime(t,i){var o=e.call(this,t)||this;o._format="t";o._inputElementAriaLabel=wijmo_1.culture.InputTime.ariaLabels.inputTimeInput;o.valueChanged=new wijmo_1.Event;wijmo_1.addClass(o.hostElement,exports.InputTimeClsNames.hostElement);o.isEditable=!0;o._value=wijmo_1.DateTime.newDate();o._min=o._max=null;o._msk=new wijmo_1._MaskProvider(o._tbx);wijmo_1.isIE9()||(o._tbx.type="tel");if("INPUT"==o._orgTag){var n=o._tbx.getAttribute("value");n&&(o.value=wijmo_1.Globalize.parseDate(n,"HH:mm:ss"))}o.step=15;o.autoExpandSelection=!0;o.initialize(i);o._commitText();o._updateInputAriaLabel();return o}Object.defineProperty(InputTime,"controlTemplate",{get:function(){InputTime._ctrlTemplate||(InputTime._ctrlTemplate=ComboBox.controlTemplate);return InputTime._ctrlTemplate},set:function(e){InputTime._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"inputElement",{get:function(){return this._tbx},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"inputType",{get:function(){return this._tbx.type},set:function(e){this._tbx.type=wijmo_1.asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"value",{get:function(){return this._value},set:function(e){(e=wijmo_1.asDate(e,!this.isRequired))&&(e=this._clamp(e));this._setText(e?wijmo_1.Globalize.format(e,this.format):"",!0,!0);this.selectedItem&&this.selectedItem.value&&(e=wijmo_1.DateTime.fromDateTime(e,this.selectedItem.value));if(e!=this._value&&!wijmo_1.DateTime.equals(e,this._value)){this._value=e;this.onValueChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"text",{get:function(){return this._tbx.value},set:function(e){if(e!=this.text&&(this.text||!this.isRequired)){this._setText(e,!0);this._commitText()}!this.text&&this.isRequired&&(this.selectedIndex=this._oldIndexToBeRestoredOnBlur<0?0:this._oldIndexToBeRestoredOnBlur)},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"min",{get:function(){return this._min},set:function(e){this._min=wijmo_1.asDate(e,!0);this.isDroppedDown=!1;this._updateItems()},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"max",{get:function(){return this._max},set:function(e){this._max=wijmo_1.asDate(e,!0);this.isDroppedDown=!1;this._updateItems()},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"step",{get:function(){return this._step},set:function(e){if(e!=this.step){this._step=wijmo_1.asNumber(e,!0);this.isDroppedDown=!1;this._updateItems()}},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"format",{get:function(){return this._format},set:function(e){if(e!=this.format){this._format=wijmo_1.asString(e);this._tbx.value=wijmo_1.Globalize.format(this.value,this.format);wijmo_1.hasItems(this.collectionView)&&this._updateItems()}},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"mask",{get:function(){return this._msk.mask},set:function(e){this._msk.mask=wijmo_1.asString(e)},enumerable:!0,configurable:!0});InputTime.prototype.onLostFocus=function(){e.prototype.onLostFocus.call(this)};InputTime.prototype.onValueChanged=function(e){this.valueChanged.raise(this,e)};InputTime.prototype.onItemsSourceChanged=function(t){e.prototype.onItemsSourceChanged.call(this,t);this._hasCustomItems=null!=this.itemsSource};InputTime.prototype.refresh=function(t){void 0===t&&(t=!0);e.prototype.refresh.call(this,t);if(this.hostElement){this._msk.refresh();this._tbx.value=wijmo_1.Globalize.format(this.value,this.format);this._updateItems()}};InputTime.prototype.onSelectedIndexChanged=function(t){if(this.selectedIndex>-1&&!this._settingText){var i=this.value?this.value:wijmo_1.DateTime.newDate(),o=null!=this.selectedItem.value?this.selectedItem.value:wijmo_1.Globalize.parseDate(this.text,this.format,this.value);this.value=wijmo_1.DateTime.fromDateTime(i,o)}e.prototype.onSelectedIndexChanged.call(this,t)};InputTime.prototype._clamp=function(e){null!=this._min&&this._getTime(e)<this._getTime(this._min)&&(e=wijmo_1.DateTime.fromDateTime(e,this._min));null!=this._max&&this._getTime(e)>this._getTime(this._max)&&(e=wijmo_1.DateTime.fromDateTime(e,this._max));return e};InputTime.prototype._wheel=function(t){if(this.handleWheel&&!t.defaultPrevented&&!this.isDroppedDown&&this.value&&this._canChangeValue()&&this.containsFocus()&&this.isEditable){var i=this._tbx,o=i.selectionStart,n=i.selectionEnd,s=wijmo_1.clamp(-t.deltaY,-1,1),r=(this.value,wijmo_1.culture.Globalize.calendar.patterns[this.format]);null==r&&(r=this.format);var a=r.match(wijmo_1.getSpecialCharsRegex());if(n-o===i.value.length&&wijmo_1.isNumber(this.step)&&this.step>0){var l=wijmo_1.DateTime.addMinutes(this.value,this.step*-s);l=this._clamp(l);this.value=l;this.selectAll()}else this._updateTimeValue(s,a,r);t.preventDefault()}e.prototype._wheel.call(this,t)};InputTime.prototype._updateInputSelection=function(t){if(this._delKey)e.prototype._updateInputSelection.call(this,t);else{for(var i=this._tbx.value;t<i.length&&!i[t].match(/[a-z0-9]/i);)t++;wijmo_1.setSelectionRange(this._tbx,t,this._tbx.value.length)}};InputTime.prototype._updateItems=function(){if(!this._hasCustomItems){var e=[],t=new Date,i=new Date(t.getFullYear(),t.getMonth(),t.getDate()),o=new Date(t.getFullYear(),t.getMonth(),t.getDate(),23,59,59),n=this.step;this.min&&i.setHours(this.min.getHours(),this.min.getMinutes(),this.min.getSeconds());this.max&&o.setHours(this.max.getHours(),this.max.getMinutes(),this.max.getSeconds());if(wijmo_1.isNumber(n)&&n>=1)for(var s=i;s<=o;s=wijmo_1.DateTime.addMinutes(s,n))e.push({value:s,text:wijmo_1.Globalize.format(s,this.format)});var r=this.value;this._settingText=!0;this.displayMemberPath="text";this.selectedValuePath="text";this.itemsSource=e;this._hasCustomItems=!1;this._settingText=!1;!r&&this.isRequired||(this.value=r)}};InputTime.prototype._getTime=function(e){return 3600*e.getHours()+60*e.getMinutes()+e.getSeconds()};InputTime.prototype._getText=function(){var e=wijmo_1.Globalize.format,t=this._format;return e(this.value,t)};InputTime.prototype._canChangeValue=function(){return!this.isReadOnly&&!this.isDisabled};InputTime.prototype.getSeconds=function(e){return 3600*e.getHours()+60*e.getMinutes()+e.getSeconds()};InputTime.prototype._keydown=function(t){if(!(t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey)){if(this._isHiddenEditor())return;switch(t.keyCode){case wijmo_1.Key.Enter:this._commitText(void 0,!0);this.selectAll();break;case wijmo_1.Key.Escape:this.text=wijmo_1.Globalize.format(this.value,this.format);this.selectAll();break;case wijmo_1.Key.Up:case wijmo_1.Key.Down:if(!this.isDroppedDown&&this.value&&this._canChangeValue()&&this.isEditable){var i=this._tbx,o=i.selectionStart,n=i.selectionEnd,s=t.keyCode==wijmo_1.Key.Up?1:-1,r=wijmo_1.culture.Globalize.calendar.patterns[this.format];null==r&&(r=this.format);var a=r.match(wijmo_1.getSpecialCharsRegex());if(n-o==i.value.length)e.prototype._keydown.call(this,t);else{if(!(1==s&&(null===this.max||this.getSeconds(this.value)<this.getSeconds(this.max))||-1==s&&(null===this.min||this.getSeconds(this.value)>this.getSeconds(this.min))))return;this._updateTimeValue(s,a,r)}t.preventDefault()}}}e.prototype._keydown.call(this,t)};InputTime.prototype._updateTimeValue=function(e,t,i){var o=this._tbx,n=o.selectionStart,s=o.value,r=this.value,a={},l={},h=0,u=0,c=0,p=[],d=[],_=o.value.match(wijmo_1.getSpecialCharsRegex());if(null==t||null==_){p=[this.format];d=["0"];t=[""]}else{t.forEach((function(e,o){var n=e.replaceAll('"',""),r=i.substring(h),c=s.substring(u),p=r.indexOf(e),d=c.indexOf(n),_=r.substring(0,p);a[_]=h;l[_]=u;h=h+p+e.length;u=u+d+n.length;if(o==t.length-1&&-1!=d){_=i.substring(h);a[_]=h;l[_]=u}}));p=Object.keys(a);d=Object.values(l)}var m=d.filter((function(e){return n>=parseInt(e.toString())}));m.length>0&&(c=m.length-1);var f=p[c];-1!=f.indexOf("h")||-1!=f.indexOf("H")?r=wijmo_1.DateTime.addHours(this.value,e):-1!=f.indexOf("m")?r=wijmo_1.DateTime.addMinutes(this.value,e):-1!=f.indexOf("s")?r=wijmo_1.DateTime.addSeconds(this.value,e):-1!=f.indexOf("t")&&(r=this.value.getHours()>=12?wijmo_1.DateTime.addHours(this.value,-12):wijmo_1.DateTime.addHours(this.value,12));r.getDate()!=(new Date).getDate()&&(r=wijmo_1.DateTime.fromDateTime(new Date,r));this.value=r;this._reselectText(t,c)};InputTime.prototype._reselectText=function(e,t){var i=this._getText(),o=this._tbx,n=0,s=-1,r=-1;e.forEach((function(e,o){var a=e.replaceAll('"',""),l=i.substring(n),h=l.indexOf(a),u=l.substring(0,h),c=""==u?l.length:u.length;o==t&&-1==s&&(r=(s=n)+c);n=n+h+a.length}));if(-1==s){s=n;r=o.value.length}wijmo_1.setSelectionRange(o,s,r)};InputTime.prototype._commitText=function(e,t){if(this.text||this.isRequired){var i=this.value?wijmo_1.Globalize.format(this.value,this.format):"";if(this.text!=i){var o=this.selectedItem&&this.selectedItem.value?this.selectedItem.value:wijmo_1.Globalize.parseDate(this.text,this.format,this.value),n=this._shouldRaiseInvalidInput(t);if(o){!wijmo_1.DateTime.sameTime(o,this._clamp(o))?n&&this.onInvalidInput(new wijmo_1.CancelEventArgs)&&(this.value=wijmo_1.DateTime.fromDateTime(this.value,o)):this.value=wijmo_1.DateTime.fromDateTime(this.value,o)}else n&&this.onInvalidInput(new wijmo_1.CancelEventArgs)&&(this.text=i)}}else this.value=null};InputTime.prototype._copy=function(e,t){if("text"===e){(t||"").toString()!==this.text&&this._setText(t,!0);return!0}return!1};InputTime.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.InputTime.ariaLabels.inputTime};InputTime.prototype._input=function(e){this._draggingText&&(""===this.text?this._emptyValueAction=!0:this._emptyValueAction=!1);this._updateDropDownWhenInput();this._setText(""!=this._textIsComposing?this._textIsComposing:this.text,!1);""!=this.text&&(this._emptyValueAction=!1);this._draggingText=!1};InputTime._ctrlTemplate="";return InputTime}(ComboBox);exports.InputTime=InputTime;wijmo_1._addCultureInfo("InputDateTime",{ariaLabels:{inputDateTimeInput:"InputDateTime Input",tglDate:"Toggle Calendar",tglTime:"Toggle Time List"}});var InputDateTime=function(e){__extends(InputDateTime,e);function InputDateTime(t,i){var o=e.call(this,t)||this;o._inputAriaLabel=wijmo_1.culture.InputDateTime.ariaLabels.inputDateTimeInput;wijmo_1.addClass(o.hostElement,exports.InputDateTimeClsNames.hostElement);var n=wijmo_1.culture.InputDateTime.ariaLabels;wijmo_1.setAriaLabel(o._btn,n.tglDate);wijmo_1.setAttribute(o._btn,"aria-haspopup","dialog");wijmo_1.setAttribute(o._btn,"aria-expanded",!1);o._updateInputAriaLabel();o.value=new Date;o.format="g";o.isDroppedDownChanged.addHandler(o.inputDateTimeIsDroppedDownChanged,o);o._inputTime=new InputTime(document.createElement("div"),{valueChanged:function(e){var t=o.rangeEnd;o.value=wijmo_1.DateTime.fromDateTime(o.value,e.value);o.calendar._rngMode()&&t&&(o.rangeEnd=wijmo_1.DateTime.fromDateTime(t,e.value))},isDroppedDownChanged:function(e){e.listBox.containsFocus()&&o.inputElement.focus();o._selectAll();o._updateTbxAria();o.inputDateTimeIsDroppedDownChanged()},keyActionPrintCharacters:0,keyActionTab:0});o._inputTime.dropDown.id=wijmo_1.getUniqueId(o.hostElement.id+"_dropdown");var s=o.addEventListener.bind(o);o._btnTm=o.hostElement.querySelector('[wj-part="btn-tm"]');s(o._btnTm,"mousedown",(function(e){o._isTouchMoved()||o._btnclick(e)}));wijmo_1.setAriaLabel(o._btnTm,n.tglTime);wijmo_1.setAttribute(o._btnTm,"aria-haspopup","listbox");wijmo_1.setAttribute(o._btnTm,"aria-expanded",!1);o._ddDate=o._dropDown;o._ddTime=o._inputTime.dropDown;var r=o._ddTime;s(r,"keydown",o._keydown.bind(o),!0);s(r,"blur",(function(){o._updateFocusState()}),!0);s(r,"click",(function(e){e.defaultPrevented||e.target!=r&&o.hostElement.focus()}),!0);o.initialize(i);o._tbx.value!==o._oldText&&o._commitText();return o}Object.defineProperty(InputDateTime,"controlTemplate",{get:function(){InputDateTime._ctrlTemplate||(InputDateTime._ctrlTemplate='<div class="'+wijmo_1.ControlClsNames.template+'"><div class="'+exports.InputClsNames.input+'"><div class="'+exports.InputClsNames.inputGroup+" "+exports.InputClsNames.inputBtnVisible+'"><input wj-part="input" type="text" class="'+wijmo_1.InputFormElementsClsNames.formControl+'"/><span class="'+exports.InputClsNames.inputGroupBtn+'"><button wj-part="btn" class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1"><span class='+wijmo_1.GlyphClsNames.calendar+'></span></button><button wj-part="btn-tm" class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1"><span class='+wijmo_1.GlyphClsNames.clock+'></span></button></span></div></div><div wj-part="dropdown" class="'+wijmo_1.ControlClsNames.content+" "+exports.DropDownClsNames.dropDownPanel+'"></div></div>');return InputDateTime._ctrlTemplate},set:function(e){InputDateTime._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(InputDateTime.prototype,"timeMin",{get:function(){return this._inputTime.min},set:function(e){this._inputTime.min=e},enumerable:!0,configurable:!0});Object.defineProperty(InputDateTime.prototype,"timeMax",{get:function(){return this._inputTime.max},set:function(e){this._inputTime.max=e},enumerable:!0,configurable:!0});Object.defineProperty(InputDateTime.prototype,"timeFormat",{get:function(){return this._inputTime.format},set:function(e){this._inputTime.format=e},enumerable:!0,configurable:!0});Object.defineProperty(InputDateTime.prototype,"timeStep",{get:function(){return this._inputTime.step},set:function(e){this._inputTime.step=e;this._btnTm.style.display=wijmo_1.isNumber(e)&&e>0?"":"none"},enumerable:!0,configurable:!0});Object.defineProperty(InputDateTime.prototype,"inputTime",{get:function(){return this._inputTime},enumerable:!0,configurable:!0});InputDateTime.prototype._fromDateTime=function(e){return e};InputDateTime.prototype._btnclick=function(t){this._setDropDownByEvent(t);e.prototype._btnclick.call(this,t)};InputDateTime.prototype.dispose=function(){this._setDropdown(this._ddDate);e.prototype.dispose.call(this);this._inputTime.dispose()};InputDateTime.prototype.refresh=function(t){void 0===t&&(t=!0);this._inputTime.refresh();e.prototype.refresh.call(this,t)};InputDateTime.prototype._updateBtn=function(){e.prototype._updateBtn.call(this);if(this._btnTm){this._btnTm.tabIndex=this._btn.tabIndex;this._btnTm.parentElement.style.display=this._btn.style.display}};InputDateTime.prototype._setDropdown=function(e){if(this._dropDown==e)return!1;this.isDroppedDown&&(this.isDroppedDown=!1);var t=this.dropDownCssClass;this.dropDownCssClass="";this._dropDown=e;this.dropDownCssClass=t;return!0};InputDateTime.prototype._updateDropDown=function(){var t=this._inputTime;if(this._dropDown==t.dropDown){this._commitText();e.prototype._updateDropDown.call(this);t.isRequired=this.isRequired&&null!=this.value;t.value=this.value;this.isDroppedDown&&t.listBox.showSelection()}else e.prototype._updateDropDown.call(this)};InputDateTime.prototype._mouseWheel=function(e){if(this.handleWheel&&!e.defaultPrevented&&!this.isDroppedDown&&this.containsFocus()&&null!=this.value&&this._canChangeValue()){var t=this._tbx,i=t.selectionStart,o=t.selectionEnd,n=wijmo_1.clamp(-e.deltaY,-1,1),s=this.value,r=wijmo_1.Globalize.getFullFormat(this.format||wijmo_1.Globalize.DefaultDateFormat);null==r&&(r=this.format);var a=r.match(wijmo_1.getSpecialCharsRegex());if(o-i===t.value.length&&null!=a||this.selectionMode==DateSelectionMode.Range){s=this.selectionMode==DateSelectionMode.Month?wijmo_1.DateTime.addMonths(this.value,n):wijmo_1.DateTime.addDays(this.value,n);this.value=s;var l=this._getText();wijmo_1.setSelectionRange(t,0,l.length)}else(1==n&&(null===this.max||this.value<this.max)||-1==n&&(null===this.min||this.value>this.min))&&this._updateDateTimeValue(n,a,r);e.preventDefault()}};InputDateTime.prototype._keydown=function(t){if(!(t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey)){if(this._isHiddenEditor())return;switch(t.keyCode){case wijmo_1.Key.Up:case wijmo_1.Key.Down:if(t.keyCode===wijmo_1.Key.Up&&this.keyActionUpArrow===KeyAction.OpenDropdown||t.keyCode===wijmo_1.Key.Down&&this.keyActionDownArrow===KeyAction.OpenDropdown)break;if(!this.isDroppedDown&&this.value&&this._canChangeValue()){var i=this._tbx,o=i.selectionStart,n=i.selectionEnd,s=(i.value,t.keyCode==wijmo_1.Key.Up?1:-1),r=this.value,a=wijmo_1.Globalize.getFullFormat(this.format||wijmo_1.Globalize.DefaultDateFormat);if("g"==this.format&&a.includes("г")){a=a.replace(/"г." /,"")}null==a&&(a=this.format);var l=a.match(wijmo_1.getSpecialCharsRegex());if(n-o===i.value.length&&null!=l||this.selectionMode==DateSelectionMode.Range){r=this.selectionMode==DateSelectionMode.Month?wijmo_1.DateTime.addMonths(this.value,s):wijmo_1.DateTime.addDays(this.value,s);this.value=r;var h=this._getText();wijmo_1.setSelectionRange(i,0,h.length)}else(1==s&&(null===this.max||this.value<this.max)||-1==s&&(null===this.min||this.value>this.min))&&this._updateDateTimeValue(s,l,a);t.preventDefault()}break;case wijmo_1.Key.Enter:case wijmo_1.Key.Space:var u=t.target;if(u===this._btn||u===this._btnTm){this._setDropDownByEvent(t);this.isDroppedDown=!0;t.preventDefault()}}}if(!t.defaultPrevented&&t.altKey&&this.isDroppedDown&&("ArrowUp"===t.key||"ArrowDown"===t.key)){var c=this.dropDown===this._ddDate?this._ddTime:this._ddDate;this._setDropdown(c);this.isDroppedDown=!0;t.preventDefault()}e.prototype._keydown.call(this,t)};InputDateTime.prototype._updateDateTimeValue=function(e,t,i){var o=this._tbx,n=o.selectionStart,s=o.value,r=this.value,a={},l={},h=0,u=0,c=0,p=[],d=[],_=o.value.match(wijmo_1.getSpecialCharsRegex());if(null==t||null==_){p=[this.format];d=["0"];t=[""]}else{t.forEach((function(e,o){var n=e.replaceAll('"',""),r=i.substring(h),c=s.substring(u);if(c.startsWith("г.")){c=c.replace("г. ","");u+="г. ".length}var p=r.indexOf(e),d=c.indexOf(n);if(-1==d){var m=_[o];d=c.indexOf(m)}var f=r.substring(0,p);if(""!=f){a[f]=h;l[f]=u}h=h+p+e.length;u=u+d+n.length;if(o==t.length-1&&-1!==d){f=i.substring(h);a[f]=h;l[f]=u}}));p=Object.keys(a);d=Object.values(l)}var m=d.filter((function(e){return n>=parseInt(e.toString())}));m.length>0&&(c=m.length-1);var f=new Date,b=new Date;null!==this.timeMax&&(f=new Date(this.value.getFullYear(),this.value.getMonth(),this.value.getDate(),this.timeMax.getHours(),this.timeMax.getMinutes(),this.timeMax.getSeconds()));null!==this.timeMin&&(b=new Date(this.value.getFullYear(),this.value.getMonth(),this.value.getDate(),this.timeMin.getHours(),this.timeMin.getMinutes(),this.timeMin.getSeconds()));var g=p[c];if(-1!=g.indexOf("d"))r=wijmo_1.DateTime.addDays(this.value,e);else if(-1!=g.indexOf("M"))r=wijmo_1.DateTime.addMonths(this.value,e);else if(-1!=g.indexOf("y"))r=wijmo_1.DateTime.addYears(this.value,e);else if(1==e&&(null===this.timeMax||this.value<f)||-1==e&&(null===this.timeMin||this.value>b)){-1!=g.indexOf("h")||-1!=g.indexOf("H")?r=wijmo_1.DateTime.addHours(this.value,e):-1!=g.indexOf("m")?r=wijmo_1.DateTime.addMinutes(this.value,e):-1!=g.indexOf("s")?r=wijmo_1.DateTime.addSeconds(this.value,e):-1!=g.indexOf("t")&&(r=this.value.getHours()>=12?wijmo_1.DateTime.addHours(this.value,-12):wijmo_1.DateTime.addHours(this.value,12));(this.timeMax&&r>f||this.timeMin&&r<b)&&(r=this.value)}this.value=r;this._reselectText(t,c)};InputDateTime.prototype._commitText=function(t,i){var o=this._tbx.value,n=wijmo_1.Globalize.parseDate(o,this.format,this.value),s=new Date,r=new Date;if(n){null!==this.timeMax&&(s=new Date(n.getFullYear(),n.getMonth(),n.getDate(),this.timeMax.getHours(),this.timeMax.getMinutes(),this.timeMax.getSeconds()));null!==this.timeMin&&(r=new Date(n.getFullYear(),n.getMonth(),n.getDate(),this.timeMin.getHours(),this.timeMin.getMinutes(),this.timeMin.getSeconds()));(this.timeMax&&n>s||this.timeMin&&n<r)&&(this.value=wijmo_1.DateTime.fromDateTime(n,this.value));e.prototype._commitText.call(this,t,i)}else e.prototype._commitText.call(this,t,i)};InputDateTime.prototype._updateTbxAria=function(){e.prototype._updateTbxAria.call(this);if(this._inputTime){var t=this._tbx,i=this._inputTime._lbx,o=i.selectedIndex,n=i.hostElement?i.hostElement.children:null,s=o>-1&&o<n.length?n[o].id:null;wijmo_1.setAttribute(t,"aria-activedescendant",this.isDroppedDown&&this.dropDown===this._ddTime&&s&&s.length?s:null);wijmo_1.setAttribute(t,"aria-haspopup",this.inputTime.isDroppedDown?"listbox":"dialog")}};Object.defineProperty(InputDateTime.prototype,"keyActionTab",{get:function(){return this._keyActionTab},set:function(e){var t=wijmo_1.asEnum(e,TabKeyAction);this._keyActionTab=t;this.inputTime.keyActionTab=t},enumerable:!0,configurable:!0});InputDateTime.prototype._setDropDownByEvent=function(e){var t=wijmo_1.closest(e.target,"button")==this._btn?this._ddDate:this._ddTime;this._setDropdown(t)};InputDateTime.prototype._updateBtnAria=function(){var e=this._btn,t=this.isDroppedDown,i=this.dropDown?this.dropDown.id:null,o=this._btnTm,n=t&&this.dropDown===this._ddDate,s=t&&this.dropDown===this._ddTime;wijmo_1.setAttribute(e,"aria-expanded",!!n);wijmo_1.setAttribute(e,"aria-controls",n?i:null);wijmo_1.setAttribute(o,"aria-expanded",!!s);wijmo_1.setAttribute(o,"aria-controls",s?i:null)};InputDateTime.prototype.inputDateTimeIsDroppedDownChanged=function(){var e=this.dropDown===this._ddDate?this._btn:this._btnTm;wijmo_1.toggleClass(e,exports.InputDateTimeClsNames.showDropDownButton,this.isDroppedDown)};InputDateTime._ctrlTemplate="";return InputDateTime}(InputDate);exports.InputDateTime=InputDateTime;wijmo_1._addCultureInfo("AutoComplete",{ariaLabels:{autoCompleteInput:"AutoComplete Input",autoComplete:"Auto Complete"}});var AutoComplete=function(e){__extends(AutoComplete,e);function AutoComplete(t,i){var o=e.call(this,t)||this;o._cssMatch=exports.ComboBoxClsNames.stateMatch;o._minLength=2;o._maxItems=6;o._itemCount=0;o._beginsWith=!1;o._delay=wijmo_1.Control._SEARCH_DELAY;o._selItems=null;o._query="";o._inCallback=!1;o._srchProps=[];o._oldSelectedIndex=-1;o._inputElementAriaLabel=wijmo_1.culture.AutoComplete.ariaLabels.autoCompleteInput;o._isBlurInput=!1;wijmo_1.addClass(o.hostElement,exports.AutoCompleteClsNames.hostElement);o._bsCollapse=!1;o.isEditable=!0;o.isRequired=!1;o.listBox.formatItem.addHandler(o._formatListItem,o);o._itemsSourceFnCallbackBnd=o._itemSourceFunctionCallback.bind(o);o.initialize(i);o._updateInputAriaLabel();return o}Object.defineProperty(AutoComplete,"controlTemplate",{get:function(){AutoComplete._ctrlTemplate||(AutoComplete._ctrlTemplate=ComboBox.controlTemplate);return AutoComplete._ctrlTemplate},set:function(e){AutoComplete._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(AutoComplete.prototype,"minLength",{get:function(){return this._minLength},set:function(e){this._minLength=wijmo_1.asNumber(e,!1,!0)},enumerable:!0,configurable:!0});Object.defineProperty(AutoComplete.prototype,"beginsWithSearch",{get:function(){return this._beginsWith},set:function(e){this._beginsWith=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(AutoComplete.prototype,"maxItems",{get:function(){return this._maxItems},set:function(e){this._maxItems=wijmo_1.asNumber(e,!1,!0)},enumerable:!0,configurable:!0});Object.defineProperty(AutoComplete.prototype,"delay",{get:function(){return this._delay},set:function(e){this._delay=wijmo_1.asNumber(e,!1,!0)},enumerable:!0,configurable:!0});Object.defineProperty(AutoComplete.prototype,"searchMemberPath",{get:function(){return this._srchProp},set:function(e){this._srchProp=wijmo_1.asString(e);this._srchProps=e?e.trim().split(/\s*,\s*/):[]},enumerable:!0,configurable:!0});Object.defineProperty(AutoComplete.prototype,"itemsSourceFunction",{get:function(){return this._itemsSourceFn},set:function(e){if(this._itemsSourceFn!==e){this._itemsSourceFn=wijmo_1.asFunction(e);wijmo_1.isFunction(this._itemsSourceFn)&&this.itemsSourceFunction(this.text,this.maxItems,this._itemsSourceFnCallbackBnd)}},enumerable:!0,configurable:!0});Object.defineProperty(AutoComplete.prototype,"cssMatch",{get:function(){return this._cssMatch},set:function(e){this._cssMatch=wijmo_1.asString(e)},enumerable:!0,configurable:!0});AutoComplete.prototype.onSelectedIndexChanged=function(t){this._settingText||e.prototype.onSelectedIndexChanged.call(this,t)};AutoComplete.prototype._updateTbxAria=function(){e.prototype._updateTbxAria.call(this);var t=this._tbx;wijmo_1.setAttribute(t,"aria-autocomplete","list")};AutoComplete.prototype._keydown=function(t){if(!this._isHiddenEditor()){if(!t.defaultPrevented&&this.isDroppedDown)switch(t.keyCode){case wijmo_1.Key.Up:case wijmo_1.Key.Down:this.selectAll()}e.prototype._keydown.call(this,t)}};AutoComplete.prototype._input=function(e){this._handleDragTextState();this._updateComponentText();this._updateEmptyValueFlag();this._resetDragState()};AutoComplete.prototype._commitText=function(e){var t=this;if(e&&this._composing&&this.isDroppedDown&&!wijmo_1.isFirefox()&&!wijmo_1.isSafari()&&""==this._textIsComposing){this._isBlurInput=!0;this.isDroppedDown=!1;setTimeout((function(){t.onLostFocus()}),this.delay+1)}e&&!this._composing&&(wijmo_1.isFirefox()||wijmo_1.isSafari())&&wijmo_1.getActiveElement()==this.inputElement&&this.onLostFocus()};AutoComplete.prototype._setText=function(e){var t=this;if(this._isBlurInput&&0==this.text.length){this._tbx.value=e;this._isBlurInput=!1}this.trimText&&!this.containsFocus()&&"string"==typeof e&&(e=e.trim());if(this._composing&&e!=this._oldText){this._oldText=e;this.onTextChanged()}if(!(this._inCallback||this._settingText||(wijmo_1.isFirefox()||wijmo_1.isSafari())&&this._composing)){this._toSearch||(this._oldSelectedIndex=this.selectedIndex);if(this.selectedIndex>-1&&this._getDisplayText(void 0,void 0,!0)!=e){this._settingText=!0;this.selectedIndex=-1;this._settingText=!1}this._toSearch&&clearTimeout(this._toSearch);if(e!=this._oldText||e!=this.text){"string"!=typeof e&&(e="");var i=this._tbx,o=this._tbx.selectionStart;i.value!=e&&(i.value=e);this._isWheel&&this.containsFocus()&&this._updateInputSelection(o);this._oldText=e;this.onTextChanged();var n=this.collectionView;if(!e&&n){(this._query||this.selectedIndex<0)&&(this.isDroppedDown=!1);this._query=this._rxHighlight=null;n.filter=null;var s=this.itemsSourceFunction;if(wijmo_1.isFunction(s)){this.isDroppedDown=!1;s(this._query,this.maxItems,this._itemsSourceFnCallbackBnd)}if(this.isRequired&&!this.containsFocus()&&!Array.isArray(this._selItems)){var r=this._oldSelectedIndex>-1?this._oldSelectedIndex:0;this.selectedIndex=r}-1==this.selectedIndex&&-1!=this._oldSelectedIndex&&this.onSelectedIndexChanged();return}}if(e!=this._getDisplayText(void 0,void 0,!0)){if(!this.containsFocus()&&this.trimText)if(this.isRequired&&!this.text.trim().length){r=this._oldSelectedIndex>-1?this._oldSelectedIndex:0;this.selectedIndex=r}else this._tbx.value=this._tbx.value.trim();var a=!this.containsFocus()&&e.length<this.minLength;this.collectionView&&!this.containsFocus()&&(this.collectionView.filter=null);var l=this.indexOf(e,!0),h=this.indexOf(e,!1);if(a)return;if(!this.containsFocus()&&(!e||this.trimText&&!this.text.trim().length||null!=this.collectionView&&l<0&&h<0)&&this.isRequired&&!this.isEditable){(r=this._oldSelectedIndex>-1?this._oldSelectedIndex:wijmo_1.hasItems(this.collectionView)?0:-1)!=this.selectedIndex&&(this.selectedIndex=r)}else if((Array.isArray(this.itemsSource)||"function"==typeof this.itemsSourceFunction)&&!this.containsFocus()&&e&&l<0&&(h<0||h!=l)&&!this.isRequired&&!this.isEditable){this._tbx.value="";this.selectedIndex=-1;this.onSelectedIndexChanged()}else{var u=this._delay>0?setTimeout:function(e,t){return e()};this._pendingSearchFn=function(){t._toSearch=null;var i=t.text;if(!t._composing&&i.trim().length>=t._minLength&&i!=t._query){t._query=i.trim();i=wijmo_1.escapeRegExp(i);var o=wijmo_1.escapeHtml(i.trim()),n=t.caseSensitiveSearch?"":"i";t._beginsWith||(n+="g");t._rxSrch=t._beginsWith?new RegExp("^"+i+".*",n):new RegExp("(?=.*"+i.replace(/ /g,")(?=.*")+")",n);t._rxHighlight=t._beginsWith?new RegExp("^"+i,n):new RegExp("("+o.replace(/\s+/g,"|")+")",n);var s=t.itemsSourceFunction;wijmo_1.isFunction(s)?s(t._query,t.maxItems,t._itemsSourceFnCallbackBnd):t._updateItems()}!e.trim().length&&!t.isEditable&&t.indexOf(e,!0)<0&&(t.selectedIndex=-1);-1==t.selectedIndex&&-1!=t._oldSelectedIndex&&t.onSelectedIndexChanged()};this._toSearch=u(this._pendingSearchFn,this._delay)}}else""===this._tbx.value&&e&&(this._tbx.value=e)}};AutoComplete.prototype.onLostFocus=function(t){var i=!1;if(this.isRequired&&!this.isEditable&&this.text&&this.text.length>=this.minLength){i=!0;var o=this.indexOf(this.text,!0);o<0&&(o=this.indexOf(this.text,!1));o>-1&&(this._oldSelectedIndex=o);o<0&&(this._oldSelectedIndex=0)}if(this._toSearch){clearTimeout(this._toSearch);this.text!==this._getDisplayText(void 0,void 0,!0)&&this._pendingSearchFn&&this._pendingSearchFn();i=!1}var n=this.collectionView;if(n&&0===n.items.length){this._oldFilter=n.filter;n.filter=null}e.prototype.onLostFocus.call(this,t,this._oldSelectedIndex,i)};AutoComplete.prototype.onGotFocus=function(t){this._toSearch||(this._oldSelectedIndex=this.selectedIndex);e.prototype.onGotFocus.call(this,t)};AutoComplete.prototype.reset=function(){this._oldSelectedIndex=-1};AutoComplete.prototype._itemSourceFunctionCallback=function(e){this._inCallback=!0;var t=wijmo_1.asCollectionView(e||[]);t.moveCurrentToPosition(-1);this.itemsSource=t;this._inCallback=!1;if(this.containsFocus()){var i=this._tbx,o=i.selectionStart,n=i.selectionEnd,s=this.collectionView;this.isDroppedDown=null!=s&&s.items.length>0;wijmo_1.setSelectionRange(i,o,n);this.refresh()}};AutoComplete.prototype.onIsDroppedDownChanged=function(t){e.prototype.onIsDroppedDownChanged.call(this,t);if(this.containsFocus()&&!this.isTouching){var i=this.collectionView;if(this.selectedIndex<0&&i){var o=i.items,n=this.text;1==o.length&&o[0]==n?this.selectedIndex=0:wijmo_1.setSelectionRange(this._tbx,n.length)}}this._query=""};AutoComplete.prototype._updateItems=function(){var e=this.collectionView;if(e){this._inCallback=!0;e.beginUpdate();this._itemCount=0;e.filter=this._filter.bind(this);e.moveCurrentToPosition(-1);e.endUpdate();this._inCallback=!1;var t=e.items.length,i=this._tbx,o=i.selectionStart,n=i.selectionEnd;this.text.trim()||(t=0);this.isDroppedDown=t>0&&this.containsFocus();t||this.isEditable||(this.selectedIndex=-1);if(1==t&&this.selectedIndex<0){var s=this._getItemText(e.items[0],!1),r=i.value;if(!this.caseSensitiveSearch){s=s.toLowerCase();r=r.toLowerCase()}(s==r||this.trimText&&s.trim()==r)&&(this.selectedIndex=0)}this.isDroppedDown&&wijmo_1.setSelectionRange(i,o,n);this.refresh()}};AutoComplete.prototype._filter=function(e){if(this._itemCount>=this._maxItems&&this._query)return!1;var t=[this._getItemText(e,!1)];this._srchProps&&this._srchProps.forEach((function(i){var o=e[i];null!=o&&t.push(o)}));this.isContentHtml&&(t=t.map((function(e){return e.replace(/(<[^>]*>|&[^;]*;)/g,"")})));for(var i=0;i<t.length;i++)if(this._rxSrch.test(t[i])){this._itemCount++;return!0}return!1};AutoComplete.prototype._getItemText=function(e,t){var i=e?e.toString():"",o=t&&this.headerPath?this._pathHdr:this._lbx._pathDisplay;o&&(i=null!=(i=o.getValue(e))?i.toString():"");return i};AutoComplete.prototype._formatListItem=function(e,t){var i=this;this._cssMatch&&this._rxHighlight&&this._query&&(t.item.innerHTML=t.item.innerHTML.replace(this._rxHighlight,(function(e,t,o,n){return i._enclosed(n,o,"<",">")||i._enclosed(n,o,"&",";")?e:'<span class="'+i._cssMatch+'">'+e+"</span>"})))};AutoComplete.prototype._enclosed=function(e,t,i,o){for(var n=t;n>=0&&e[n]!=o;n--)if(e[n]==i)for(var s=t;s<e.length&&e[s]!=i;s++)if(e[s]==o)return!0;return!1};AutoComplete.prototype._wheel=function(t){e.prototype._wheel.call(this,t)};AutoComplete.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.AutoComplete.ariaLabels.autoComplete};AutoComplete.prototype._hasCustomFormatItem=function(){return this.formatItem.getHandler.length>1};AutoComplete._ctrlTemplate="";return AutoComplete}(ComboBox);exports.AutoComplete=AutoComplete;wijmo_1._addCultureInfo("MultiAutoComplete",{ariaLabels:{multiAutoCompleteInput:"MultiAutoComplete Input",multiAutoComplete:"MultiAutoComplete",multiAutoCompleteHelperInput:"MultiAutoComplete Helper Input",remove:"Remove"}});var MultiAutoComplete=function(e){__extends(MultiAutoComplete,e);function MultiAutoComplete(t,i){var o=e.call(this,t)||this;o._maxSelItems=null;o._lastInputValue="";o._selPath=new wijmo_1.Binding(null);o._notAddItm=!1;o._inputElementAriaLabel=wijmo_1.culture.MultiAutoComplete.ariaLabels.multiAutoCompleteInput;o._helperInputElementAriaLabel=wijmo_1.culture.MultiAutoComplete.ariaLabels.multiAutoCompleteHelperInput;o._ariaLabelledby=null;o.selectedItemsChanged=new wijmo_1.Event;wijmo_1.addClass(o.hostElement,exports.MultiAutoCompleteClsNames.hostElement);o._wjTpl=o.hostElement.querySelector("."+wijmo_1.ControlClsNames.template);o._wjInput=o.hostElement.querySelector("."+exports.InputClsNames.input);o.showDropDownButton=!1;o._selItems=[];o.initialize(i);o.addEventListener(o.hostElement,"keyup",o._keyup.bind(o),!0);o.addEventListener(window,"resize",o._adjustInputWidth.bind(o));o.addEventListener(o._tbx,"focus",(function(){o._itemOff()}));o._addHelperInput();o._addScreenReaderHelper();o._initSeltems();o.listBox.itemsChanged.addHandler((function(){if(-1!==o.selectedIndex){var e=o.collectionView;(e&&("CollectionView"==e.constructor.name||"ODataVirtualCollectionView"==e.constructor.name)||e.virtualization)&&(o.selectedIndex=-1)}}));o._refreshHeader();o._updateTabIndex();o._updateInputAriaLabel();return o}Object.defineProperty(MultiAutoComplete,"controlTemplate",{get:function(){MultiAutoComplete._ctrlTemplate||(MultiAutoComplete._ctrlTemplate=AutoComplete.controlTemplate);return MultiAutoComplete._ctrlTemplate},set:function(e){MultiAutoComplete._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(MultiAutoComplete.prototype,"showDropDownButton",{set:function(e){this._showBtn=!1},enumerable:!0,configurable:!0});Object.defineProperty(MultiAutoComplete.prototype,"maxSelectedItems",{get:function(){return this._maxSelItems},set:function(e){if(this._maxSelItems!=e){this._maxSelItems=wijmo_1.asNumber(e,!0);this._updateMaxItems();this._refreshHeader();this._clearSelIndex()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiAutoComplete.prototype,"selectedMemberPath",{get:function(){return this._selPath.path},set:function(e){if((e=wijmo_1.asString(e))!==this.selectedMemberPath){this._selPath.path=e;this._initSeltems();this._refreshHeader();this.onSelectedItemsChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiAutoComplete.prototype,"selectedItems",{get:function(){return this._selItems},set:function(e){e=Array.from(new Set(e));var t=this._selItems===e;t||null==this._selItems||null==e||this._selItems.length!==e.length||(t=this._selItems.every((function(t,i){return t===e[i]})));this._selItems=wijmo_1.asArray(e);if(!t){if(this.selectedMemberPath&&""!==this.selectedMemberPath&&this._selItems)for(var i=0;i<this._selItems.length;i++){var o=this._selItems[i];this._setSelItem(o,!1)}this._updateMaxItems();this.onSelectedItemsChanged();this._refreshHeader();this._clearSelIndex()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiAutoComplete.prototype,"ariaLabelledBy",{get:function(){return this._ariaLabelledby},set:function(e){wijmo_1._setAriaLabelBy(this,this._tbx,e,this._updateInputAndListBoxAriaLabel.bind(this))},enumerable:!0,configurable:!0});MultiAutoComplete.prototype.onSelectedItemsChanged=function(e){this.selectedItemsChanged.raise(this,e)};MultiAutoComplete.prototype.onIsDroppedDownChanged=function(t){!this.isDroppedDown&&this.selectedIndex>-1&&!this._notAddItm&&this._addItem(!0);this._notAddItm=!1;e.prototype.onIsDroppedDownChanged.call(this,t)};MultiAutoComplete.prototype.refresh=function(t){void 0===t&&(t=!0);e.prototype.refresh.call(this,t);if(this.hostElement){this._initSeltems();this.isDroppedDown||this._refreshHeader()}};MultiAutoComplete.prototype._keydown=function(t){if(!this.isReadOnly){if(!t.defaultPrevented)switch(t.keyCode){case wijmo_1.Key.Back:this._lastInputValue=this._tbx.value;break;case wijmo_1.Key.Enter:this._itemOff();this._addItem(!0);wijmo_1.isIE()&&wijmo_1.setSelectionRange(this._tbx,this._tbx.textContent.length,this._tbx.textContent.length);break;case wijmo_1.Key.Tab:if(this.isDroppedDown){this._addItem(!1);this._tbx.value="";this._lbx.selectedIndex=-1;this.isDroppedDown=!1;this.containsFocus()||this.focus();t.preventDefault()}else this._updateFocus();break;case wijmo_1.Key.Space:if(""!==this._tbx.value)return;if(!this.isDroppedDown&&!this._tbx.disabled){this.isDroppedDown=!0;this._clearSelIndex()}break;case wijmo_1.Key.Escape:this.isDroppedDown&&(this._notAddItm=!0);break;case wijmo_1.Key.Left:this._itemOn(!this.rightToLeft);break;case wijmo_1.Key.Right:this._itemOn(!!this.rightToLeft);break;case wijmo_1.Key.Up:case wijmo_1.Key.Down:var i=wijmo_1.getActiveElement();if(t.altKey){if(this._tbx==i){this.isDroppedDown=!this.isDroppedDown;this.isDroppedDown||this._tbx.focus();t.preventDefault();return}}else if(this._tbx!==i)return;default:if(t.keyCode===wijmo_1.Key.Back||t.keyCode===wijmo_1.Key.Delete)return;this._itemOff();null!=this._maxSelItems&&this._selItems.length>=this._maxSelItems&&t.preventDefault()}this._tbx.disabled||e.prototype._keydown.call(this,t)}};MultiAutoComplete.prototype._updateState=function(){e.prototype._updateState.call(this);this._wjTpl&&(wijmo_1.hasClass(this.hostElement,wijmo_1.ControlStateClsNames.focused)||this._itemOff())};MultiAutoComplete.prototype._keyup=function(e){if(!this.isReadOnly&&!e.defaultPrevented)switch(e.keyCode){case wijmo_1.Key.Back:0===this._tbx.value.length&&0===this._lastInputValue.length&&this._delItem(!1);break;case wijmo_1.Key.Delete:this._delItem(!0)}};MultiAutoComplete.prototype._addHelperInput=function(){var e=document.createElement("input");e.type="text";e.tabIndex=-1;e.className=exports.MultiAutoCompleteClsNames.tokenHelper;e.readOnly=!0;wijmo_1.setAttribute(e,"aria-label",this._helperInputElementAriaLabel);wijmo_1.setAttribute(e,"role","textbox");this._wjTpl.insertBefore(e,this._wjInput);this._helperInput=e};MultiAutoComplete.prototype._addScreenReaderHelper=function(){var e=document.createElement("div");e.tabIndex=-1;e.className=exports.MultiAutoCompleteClsNames.screenReaderOnly;wijmo_1.setAttribute(e,"aria-live","polite");this._wjTpl.insertBefore(e,this._wjInput);this._screenReaderHelper=e};MultiAutoComplete.prototype._refreshHeader=function(){for(var e=this.hostElement.querySelectorAll("."+exports.MultiAutoCompleteClsNames.token),t=0;t<e.length;t++)this._wjTpl.removeChild(e[t]);var i=this.selectedItems;if(i&&0!==i.length){for(t=0;t<i.length;t++)this._insertToken(i[t]);this._wjInput.style.cssFloat=this.rightToLeft?"right":"left";this._adjustInputWidth()}else{this._wjInput.style.cssFloat=this.rightToLeft?"right":"left";this._adjustInputWidth()}};MultiAutoComplete.prototype._insertToken=function(e){var t=this._getItemText(e,!0);this.isContentHtml||(t=wijmo_1.escapeHtml(t));this._wjTpl.insertBefore(this._createItem(t),this._wjInput)};MultiAutoComplete.prototype._updateMaxItems=function(){null!=this._maxSelItems&&this._selItems&&this._selItems.length>this._maxSelItems&&(this._selItems=this._selItems.slice(0,this._maxSelItems))};MultiAutoComplete.prototype._updateFocus=function(){var e=this,t=this._wjTpl.querySelector("."+MultiAutoComplete._clsActive);if(t){wijmo_1.removeClass(t,MultiAutoComplete._clsActive);setTimeout((function(){e._tbx.focus()}))}else this._clearSelIndex()};MultiAutoComplete.prototype._addItem=function(e){if(this.selectedItems.indexOf(this.selectedItem)>-1)this._clearSelIndex();else if(this.selectedIndex>-1){this._updateSelItems(this.selectedItem,!0);this._refreshHeader();e&&this._clearSelIndex();this._disableInput(!0)}};MultiAutoComplete.prototype._delItem=function(e){var t,i,o=this._wjTpl.querySelector("."+MultiAutoComplete._clsActive),n=!1;if(!e||o){if(o){if((i=this._getItemIndex(o))>-1){t=this._selItems[i];n=!0}}else if(this._selItems.length>0){t=this._selItems[this._selItems.length-1];n=!0}var s=this._getItemText(t,!0),r=wijmo_1.culture.MultiAutoComplete.ariaLabels.remove;this._screenReaderHelper.textContent=r+" "+s;if(n){this._updateSelItems(t,!1);this._refreshHeader();this._clearSelIndex();this._disableInput(!1)}this._tbx.focus()}};MultiAutoComplete.prototype._updateSelItems=function(e,t){if(t){this._selItems&&0!==this._selItems.length||(this._selItems=[]);if(null!=this._maxSelItems&&this._selItems.length>=this._maxSelItems)return;this._selItems.push(e)}else{var i=this._selItems.indexOf(e);this._selItems.splice(i,1)}this._hasSelectedMemeberPath()&&this._setSelItem(e,t);this.onSelectedItemsChanged()};MultiAutoComplete.prototype._createItem=function(e){var t=this,i=document.createElement("div"),o=document.createElement("span"),n=document.createElement("span");i.appendChild(o);i.appendChild(n);i.id=wijmo_1.getSafeUniqueId(e);wijmo_1.setAttribute(i,"aria-label",e);wijmo_1.setAttribute(i,"role","button");i.className=exports.MultiAutoCompleteClsNames.token;o.className=exports.MultiAutoCompleteClsNames.tokenLabel;o.innerHTML=e;n.className=exports.MultiAutoCompleteClsNames.tokenClose;n.tabIndex=-1;n.innerHTML="×";i.style.cssFloat=this.rightToLeft?"right":"left";this.addEventListener(i,"click",(function(e){t._helperInput.focus();wijmo_1.setAttribute(t._helperInput,"aria-activedescendant",i.id);var o=t._wjTpl.querySelector("."+MultiAutoComplete._clsActive);o&&wijmo_1.removeClass(o,MultiAutoComplete._clsActive);wijmo_1.addClass(i,MultiAutoComplete._clsActive);e.stopPropagation();e.preventDefault()}));this.addEventListener(n,"click",(function(e){if(!t.isReadOnly){var o=t._getItemIndex(i);if(o>-1){var n=t._selItems[o];t._updateSelItems(n,!1)}t._wjTpl.removeChild(i);t._adjustInputWidth();t._disableInput(!1);t._tbx.focus();e.stopPropagation()}}));return i};MultiAutoComplete.prototype._itemOn=function(e){var t,i,o,n=wijmo_1.getActiveElement();if((this._tbx!=n||0===this._tbx.value.length)&&0!==(t=this._wjTpl.querySelectorAll("."+exports.MultiAutoCompleteClsNames.token)).length){i=this._wjTpl.querySelector("."+MultiAutoComplete._clsActive);o=this._getItemIndex(i);if(e){if(0===o)return;if(-1===o){wijmo_1.addClass(t[t.length-1],MultiAutoComplete._clsActive);this._helperInput.focus();wijmo_1.setAttribute(this._helperInput,"aria-activedescendant",t[t.length-1].id)}else{wijmo_1.removeClass(i,MultiAutoComplete._clsActive);wijmo_1.addClass(t[o-1],MultiAutoComplete._clsActive);this._helperInput.focus();wijmo_1.setAttribute(this._helperInput,"aria-activedescendant",t[o-1].id)}}else if(!e){if(-1===o)return;if(o!==t.length-1){wijmo_1.removeClass(i,MultiAutoComplete._clsActive);wijmo_1.addClass(t[o+1],MultiAutoComplete._clsActive);this._helperInput.focus();wijmo_1.setAttribute(this._helperInput,"aria-activedescendant",t[o+1].id)}else{wijmo_1.removeClass(i,MultiAutoComplete._clsActive);this._tbx.focus();wijmo_1.setAttribute(this._helperInput,"aria-activedescendant")}}}};MultiAutoComplete.prototype._itemOff=function(){var e=this._wjTpl.querySelector("."+MultiAutoComplete._clsActive);e&&wijmo_1.removeClass(e,MultiAutoComplete._clsActive)};MultiAutoComplete.prototype._initSeltems=function(){if(this.selectedMemberPath){this._selItems.splice(0,this._selItems.length);var e=this.collectionView;if(e)for(var t=0;t<e.sourceCollection.length;t++)this._getSelItem(t)&&this._selItems.push(e.sourceCollection[t])}};MultiAutoComplete.prototype._getSelItem=function(e){var t=this.collectionView,i=t?t.sourceCollection[e]:null;return!(!wijmo_1.isObject(i)||!this.selectedMemberPath)&&this._selPath.getValue(i)};MultiAutoComplete.prototype._setSelItem=function(e,t){this.itemsSource;wijmo_1.isObject(e)&&this._selPath.getValue(e)!=t&&this._selPath.setValue(e,t)};MultiAutoComplete.prototype._clearSelIndex=function(){this.selectedIndex=-1};MultiAutoComplete.prototype._hasSelectedMemeberPath=function(){return this.selectedMemberPath&&""!==this.selectedMemberPath};MultiAutoComplete.prototype._disableInput=function(e){if(null!=this._maxSelItems)if(this._selItems.length<this._maxSelItems){this._tbx.disabled=!1;this._tbx.focus()}else{this._tbx.disabled=!0;this.hostElement.focus()}};MultiAutoComplete.prototype._adjustInputWidth=function(){this._tbx.style.width="60px";var e,t=wijmo_1.getElementRect(this.hostElement),i=wijmo_1.getElementRect(this._tbx),o=getComputedStyle(this._tbx),n=parseInt(o.paddingLeft,10),s=parseInt(o.paddingRight,10);e=this.rightToLeft?i.left+i.width-t.left-n-s-8:t.left+t.width-i.left-n-s-8;this._tbx.style.width=e+"px";this._tbx.placeholder?this._tbx.style.minWidth="max-content":this._tbx.style.minWidth=""};MultiAutoComplete.prototype._getItemIndex=function(e){for(var t=this.hostElement.querySelectorAll("."+exports.MultiAutoCompleteClsNames.token),i=0;i<t.length;i++)if(e===t[i])return i;return-1};MultiAutoComplete.prototype._setIsDisabled=function(t){e.prototype._setIsDisabled.call(this,t);this._updateTabIndex()};MultiAutoComplete.prototype._setTabOrder=function(e){this._orgTabIndex=e;this._updateTabIndex()};MultiAutoComplete.prototype._updateTabIndex=function(){var e=this.hostElement;this._tbx.tabIndex=this.isDisabled?-1:this._orgTabIndex;e.tabIndex=-1};MultiAutoComplete._clsActive=exports.MultiAutoCompleteClsNames.tokenActive;MultiAutoComplete._ctrlTemplate="";return MultiAutoComplete}(AutoComplete);exports.MultiAutoComplete=MultiAutoComplete;wijmo_1._registerModule("wijmo.input",selfModule);
|