@syncfusion/ej2-dropdowns 31.2.3 → 31.2.4
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/README.md +11 -3
- package/dist/ej2-dropdowns.min.js +2 -2
- package/dist/ej2-dropdowns.umd.min.js +2 -2
- package/dist/ej2-dropdowns.umd.min.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es2015.js +102 -6
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +117 -20
- package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
- package/dist/global/ej2-dropdowns.min.js +2 -2
- package/dist/global/ej2-dropdowns.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +3 -3
- package/src/combo-box/combo-box.js +3 -1
- package/src/drop-down-base/drop-down-base.js +10 -0
- package/src/drop-down-list/drop-down-list.d.ts +2 -0
- package/src/drop-down-list/drop-down-list.js +27 -1
- package/src/mention/mention.js +1 -1
- package/src/multi-select/multi-select.d.ts +3 -0
- package/src/multi-select/multi-select.js +76 -17
- package/styles/bds-lite.css +4 -0
- package/styles/bds.css +4 -0
- package/styles/bootstrap-dark-lite.css +4 -0
- package/styles/bootstrap-dark.css +4 -0
- package/styles/bootstrap-lite.css +4 -0
- package/styles/bootstrap.css +4 -0
- package/styles/bootstrap4-lite.css +4 -0
- package/styles/bootstrap4.css +4 -0
- package/styles/bootstrap5-dark-lite.css +4 -0
- package/styles/bootstrap5-dark.css +4 -0
- package/styles/bootstrap5-lite.css +4 -0
- package/styles/bootstrap5.3-lite.css +4 -0
- package/styles/bootstrap5.3.css +4 -0
- package/styles/bootstrap5.css +4 -0
- package/styles/drop-down-list/_layout.scss +4 -0
- package/styles/drop-down-list/bds.css +4 -0
- package/styles/drop-down-list/bootstrap-dark.css +4 -0
- package/styles/drop-down-list/bootstrap.css +4 -0
- package/styles/drop-down-list/bootstrap4.css +4 -0
- package/styles/drop-down-list/bootstrap5-dark.css +4 -0
- package/styles/drop-down-list/bootstrap5.3.css +4 -0
- package/styles/drop-down-list/bootstrap5.css +4 -0
- package/styles/drop-down-list/fabric-dark.css +4 -0
- package/styles/drop-down-list/fabric.css +4 -0
- package/styles/drop-down-list/fluent-dark.css +4 -0
- package/styles/drop-down-list/fluent.css +4 -0
- package/styles/drop-down-list/fluent2.css +4 -0
- package/styles/drop-down-list/highcontrast-light.css +4 -0
- package/styles/drop-down-list/highcontrast.css +4 -0
- package/styles/drop-down-list/material-dark.css +4 -0
- package/styles/drop-down-list/material.css +4 -0
- package/styles/drop-down-list/material3-dark.css +4 -0
- package/styles/drop-down-list/material3.css +4 -0
- package/styles/drop-down-list/tailwind-dark.css +4 -0
- package/styles/drop-down-list/tailwind.css +4 -0
- package/styles/drop-down-list/tailwind3.css +4 -0
- package/styles/fabric-dark-lite.css +4 -0
- package/styles/fabric-dark.css +4 -0
- package/styles/fabric-lite.css +4 -0
- package/styles/fabric.css +4 -0
- package/styles/fluent-dark-lite.css +4 -0
- package/styles/fluent-dark.css +4 -0
- package/styles/fluent-lite.css +4 -0
- package/styles/fluent.css +4 -0
- package/styles/fluent2-lite.css +4 -0
- package/styles/fluent2.css +4 -0
- package/styles/highcontrast-light-lite.css +4 -0
- package/styles/highcontrast-light.css +4 -0
- package/styles/highcontrast-lite.css +4 -0
- package/styles/highcontrast.css +4 -0
- package/styles/material-dark-lite.css +4 -0
- package/styles/material-dark.css +4 -0
- package/styles/material-lite.css +4 -0
- package/styles/material.css +4 -0
- package/styles/material3-dark-lite.css +4 -0
- package/styles/material3-dark.css +4 -0
- package/styles/material3-lite.css +4 -0
- package/styles/material3.css +4 -0
- package/styles/tailwind-dark-lite.css +4 -0
- package/styles/tailwind-dark.css +4 -0
- package/styles/tailwind-lite.css +4 -0
- package/styles/tailwind.css +4 -0
- package/styles/tailwind3-lite.css +4 -0
- package/styles/tailwind3.css +4 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: ej2-dropdowns.min.js
|
|
3
|
-
* version : 31.2.
|
|
3
|
+
* version : 31.2.4
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
7
|
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
8
|
* applicable laws.
|
|
9
9
|
*/
|
|
10
|
-
this.ej=this.ej||{},this.ej.dropdowns=function(e,t,i,s,l,n,a,r,o){"use strict";function h(e,t,i,s,l,n,a,r,o){n&&""!==x?x===I&&(w=String.fromCharCode(e)):""!==w?(x=w+String.fromCharCode(e),w=""):x+=String.fromCharCode(e),r?(setTimeout(function(){w=""},700),setTimeout(function(){x=""},3e3)):setTimeout(function(){x=""},1e3);var h;if(x=s?x.toLowerCase():x,D!==l||I!==x||o){var u=t,p=x.length,d=void 0,c=i=i?i+1:0;O=[];do{c===u.length&&(c=-1),d=u[h=-1===c?0:c],(s?d.innerText.toLowerCase():d.innerText).substr(0,p)===x&&O.push(u[h]),c++}while(c!==i);if(I=x,D=l,r){for(var m=!1,f=0;f<O.length;f++)if(a&&O[f].textContent.toLowerCase()===a.toLowerCase()){h=f,m=!0;break}return a&&m&&(h+=1),O[h]?O[h]:O[0]}return O[0]}for(c=0;c<O.length;c++){if(O[c].classList.contains(A)){h=c;break}if(a&&O[c].textContent.toLowerCase()===a.toLowerCase()){h=c;break}}return h+=1,r?O[h]&&O.length-1!==h?O[h]:O[O.length]:O[h]?O[h]:O[0]}function u(e,t,i,s,l,n,a,r){var o=t;s=void 0===s||null===s||s;var h={item:null,index:null};if(e&&e.length&&t){var u=e.length,d=s?e.toLocaleLowerCase():e;d=p(d);for(var c=0,m=o;c<m.length;c++){var f=function(e,o){var p,c=o[e];if(t&&l){var m=c,f=n.text.split(".");l.filter(function(e){Array.prototype.slice.call(f).forEach(function(t){("object"===a&&!e.isHeader&&-1!==m.textContent.toString().indexOf(e[t])&&null!=e[n.value]&&m.getAttribute("data-value")===e[n.value].toString()||"string"===a&&-1!==m.textContent.toString().indexOf(e))&&(p="object"===a?e[t]:e)})})}var v=l&&p?(s?p.toString().toLocaleLowerCase():p).replace(/^\s+|\s+$/g,""):(s?c.textContent.toLocaleLowerCase():c.textContent).replace(/^\s+|\s+$/g,"");if(r&&v&&d&&(v=v.normalize("NFD").replace(/[\u0300-\u036f]/g,""),d=d.normalize("NFD").replace(/[\u0300-\u036f]/g,"")),"Equal"===i&&v===d||"StartsWith"===i&&v.substr(0,u)===d||"EndsWith"===i&&v.substr(v.length-d.length)===d||"Contains"===i&&new RegExp(d,"g").test(v))return h.item=c,h.index=e,{value:{item:c,index:e}}}(c,m);if("object"==typeof f)return f.value}return h}return h}function p(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function d(e){D===e&&(D="",I="",x="",O=[])}function c(e,t,i,s){if(/<[^>]*>/g.test(e.innerText)&&(e.innerText=e.innerText.replace(/[\u00A0-\u9999<>&]/g,function(e){return"&#"+e.charCodeAt(0)+";"})),""!==t){var l=i?"gim":"gm";t=/^[a-zA-Z0-9- ]*$/.test(t)?t:t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var n="StartsWith"===s?"^("+t+")":"EndsWith"===s?"("+t+")$":"("+t+")";m(e,new RegExp(n,l))}}function m(e,t){for(var i=0;e.childNodes&&i<e.childNodes.length;i++){if(3===e.childNodes[i].nodeType&&""!==e.childNodes[i].textContent.trim()){var s=e.childNodes[i].nodeValue.trim().replace(t,'<span class="e-highlight">$1</span>');e.childNodes[i].nodeValue="",e.innerHTML=e.innerHTML.trim()+s;break}m(e.childNodes[i],t)}}function f(e){for(var t=e.querySelectorAll(".e-highlight"),i=t.length-1;i>=0;i--){var s=t[i].parentNode,l=document.createTextNode(t[i].textContent);s.replaceChild(l,t[i])}}function v(e,i,s,l,n,a,r){var o=t.createElement("span",{className:ue}),h=t.createElement("label",{className:pe}),u=s.getAttribute("id")?s.getAttribute("id"):t.getUniqueID("ej2_multiselect");s.id=u,t.isNullOrUndefined(s.id)||""===s.id||(h.id="label_"+s.id.replace(/ /g,"_"),h.setAttribute("for",s.id),t.attributes(l,{"aria-labelledby":h.id})),t.isNullOrUndefined(l.placeholder)||""===l.placeholder||(h.innerText=E(l.placeholder),l.removeAttribute("placeholder")),h.innerText=E(r),i.appendChild(o),i.appendChild(h),e.classList.add("e-float-input"),g(n,h),"Always"===a&&(h.classList.contains(ce)&&t.removeClass([h],ce),t.addClass([h],de))}function g(e,i){e&&e.length>0?(t.addClass([i],de),t.removeClass([i],ce)):(t.removeClass([i],de),t.addClass([i],ce))}function y(e,i,s,l,n,a,r){var o,h=i.querySelector("."+pe),u=i.querySelector("."+ue);t.isNullOrUndefined(h)?C(n,l,o=null!==r?r:""):(o=h.innerText,t.detach(s.querySelector("."+pe)),C(n,l,o),t.isNullOrUndefined(u)||t.detach(s.querySelector("."+ue))),e.classList.remove("e-float-input")}function C(e,t,i){e&&e.length?t.placeholder="":t.placeholder=i}function b(e,i){e.classList.add("e-input-focus");var s=i.querySelector("."+pe);t.isNullOrUndefined(s)||(t.addClass([s],de),s.classList.contains(ce)&&t.removeClass([s],ce))}function S(e,i,s,l,n){e.classList.remove("e-input-focus");var a=i.querySelector("."+pe);s&&s.length<=0&&"Auto"===l&&!t.isNullOrUndefined(a)&&(a.classList.contains(de)&&t.removeClass([a],de),t.addClass([a],ce))}function E(e){var i="";if(!t.isNullOrUndefined(e)&&""!==e){var s=document.createElement("span");s.innerHTML='<input placeholder="'+e+'"/>',i=s.children[0].placeholder}return i}var x="",I="",w="",O=[],A="e-active",D="",k=function(){return(k=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++){t=arguments[i];for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l])}return e}).apply(this,arguments)},N=function(e,t,i,s){return new(i||(i=Promise))(function(l,n){function a(e){try{o(s.next(e))}catch(e){n(e)}}function r(e){try{o(s.throw(e))}catch(e){n(e)}}function o(e){e.done?l(e.value):new i(function(t){t(e.value)}).then(a,r)}o((s=s.apply(e,t||[])).next())})},L=function(e,t){function i(e){return function(t){return s([e,t])}}function s(i){if(l)throw new TypeError("Generator is already executing.");for(;o;)try{if(l=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(a=o.trys,!(a=a.length>0&&a[a.length-1])&&(6===i[0]||2===i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],n=0}finally{l=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}var l,n,a,r,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return r={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r},T=function(){function e(e){var t=this;this.sentinelInfo={up:{check:function(e,i){var s=e.top-t.containerElementRect.top;return i.entered=s>=0,s+t.parent.listItemHeight*t.parent.virtualItemCount/2>=0},axis:"Y"},down:{check:function(e,i){var s=e.bottom;return i.entered=e.bottom<=t.containerElementRect.bottom,s-t.parent.listItemHeight*t.parent.virtualItemCount/2<=t.parent.listItemHeight*t.parent.virtualItemCount/2},axis:"Y"}},this.parent=e,this.removeEventListener(),this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("observe",this.observe,this),this.parent.on("setGeneratedData",this.setGeneratedData,this),this.parent.on("dataProcessAsync",this.dataProcessAsync,this),this.parent.on("setCurrentViewDataAsync",this.setCurrentViewDataAsync,this),this.parent.on("bindScrollEvent",this.bindScrollEvent,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("observe",this.observe),this.parent.off("setGeneratedData",this.setGeneratedData),this.parent.off("dataProcessAsync",this.dataProcessAsync),this.parent.off("setCurrentViewDataAsync",this.setCurrentViewDataAsync),this.parent.off("bindScrollEvent",this.bindScrollEvent))},e.prototype.bindScrollEvent=function(e){var t=this;this.component=e.component,this.observe(function(e){return t.scrollListener(e)})},e.prototype.observe=function(e){this.containerElementRect=this.parent.popupContentElement.getBoundingClientRect(),t.EventHandler.add(this.parent.popupContentElement,"wheel mousedown",this.popupScrollHandler,this),this.touchModule=new t.Touch(this.parent.popupContentElement,{scroll:this.popupScrollHandler.bind(this)}),t.EventHandler.add(this.parent.popupContentElement,"scroll",this.virtualScrollHandler(e),this)},e.prototype.getModuleName=function(){return"VirtualScroll"},e.prototype.popupScrollHandler=function(){this.parent.isMouseScrollAction=!0,this.parent.isPreventScrollAction=!1},e.prototype.getPageQuery=function(e,t,i){return 0===i||this.parent.allowFiltering||"autocomplete"===this.component||(e=e.skip(t)),e},e.prototype.setGeneratedData=function(e,t){for(var i=0,s=this.parent.listData.length+this.parent.virtualItemStartIndex,l=this.parent.virtualItemStartIndex;l<s;l++){if(!this.parent.generatedDataObject[l]&&null!==t&&this.parent.listData.slice(i,i+1).length>0){var n=this.parent.listData.slice(i,i+1);n.length>0&&(this.parent.generatedDataObject[l]=n)}i++}},e.prototype.generateAndExecuteQueryAsync=function(e,s,l,n){void 0===s&&(s=0),void 0===l&&(l=0),void 0===n&&(n=!1);var a=this.parent.dataSource;if(!n)if(t.isNullOrUndefined(this.parent.query))e=this.getPageQuery(e,s,l);else{var r=this.removeSkipAndTakeEvents(this.parent.query.clone());e=this.getPageQuery(r,s,l)}var o=this.parent.isCustomFilter;if("combobox"===this.component){var h=0;this.parent.dataSource instanceof i.DataManager?h=this.parent.remoteDataCount:this.parent.dataSource&&this.parent.dataSource.length>0&&(h=this.parent.dataSource.length),h>0&&(this.parent.isCustomFilter=h===this.parent.totalItemCount&&this.parent.queryString!==this.parent.typedString||this.parent.isCustomFilter)}this.parent.resetList(a,this.parent.fields,e),this.parent.isCustomFilter=o},e.prototype.removeSkipAndTakeEvents=function(e){return e.queries=e.queries.filter(function(e){return"onSkip"!==e.fn&&"onTake"!==e.fn}),e},e.prototype.setCurrentViewDataAsync=function(e){var s=[],l=!1,n=!0;t.isNullOrUndefined(this.component)&&(this.component=e.component);var a=this.parent.viewPortInfo.endIndex;if("multiselect"===this.component&&"CheckBox"===this.parent.mode&&this.parent.value&&Array.isArray(this.parent.value)&&this.parent.value.length>0&&this.parent.enableSelectionOrder&&""===this.parent.targetElement().trim()){if(this.parent.viewPortInfo.startIndex<this.parent.value.length){if(a=this.parent.viewPortInfo.endIndex-this.parent.value.length,0===this.parent.viewPortInfo.startIndex){if((m=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(m),this.parent.updateVirtualReOrderList(!0),this.parent.value.length<this.parent.itemCount&&this.parent.value.length!==this.parent.totalItemCount){var r=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)");r&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(r),u=(u=this.parent.getForQuery(this.parent.value).clone()).skip(0).take(this.parent.itemCount-(this.parent.value.length-this.parent.viewPortInfo.startIndex)),this.parent.appendUncheckList=!0,this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,u),n=!1,this.parent.appendUncheckList=this.parent.dataSource instanceof i.DataManager&&this.parent.appendUncheckList,n=!1}else{var o=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)");o&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(o)}n=!1}else 0!==this.parent.viewPortInfo.startIndex&&(this.parent.dataSource instanceof i.DataManager&&(this.parent.setCurrentView=!1),this.parent.updateVirtualReOrderList(!0),(m=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(m),n=!1);0!==this.parent.viewPortInfo.startIndex&&this.parent.viewPortInfo.startIndex-this.parent.value.length!==this.parent.itemCount&&this.parent.viewPortInfo.startIndex+this.parent.itemCount>this.parent.value.length&&(u=(u=this.parent.getForQuery(this.parent.value).clone()).skip(0).take(this.parent.itemCount-(this.parent.value.length-this.parent.viewPortInfo.startIndex)),this.parent.appendUncheckList=!0,this.parent.setCurrentView=!1,(m=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(m),this.parent.resetList(this.parent.dataSource,this.parent.fields,u),n=!1,this.parent.appendUncheckList=this.parent.dataSource instanceof i.DataManager&&this.parent.appendUncheckList)}else{var h=this.parent.list.querySelectorAll(".e-reorder")[0];this.parent.list.querySelector(".e-virtual-ddl-content")&&h&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(h);var u=this.parent.getForQuery(this.parent.value).clone(),p=this.parent.viewPortInfo.startIndex-this.parent.value.length>=0?this.parent.viewPortInfo.startIndex-this.parent.value.length:0;u=u.skip(p),this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,u),n=!1}this.parent.totalItemsCount()}if(n)for(var d=this.parent.viewPortInfo.startIndex;d<a;d++){var c=d;if("multiselect"===this.component&&"CheckBox"===this.parent.mode){var m=this.parent.list.querySelector(".e-list-parent.e-reorder");m&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(m)}var f=this.parent.generatedDataObject[c];if("multiselect"===this.component&&this.parent.hideSelectedItem){if(f){var v=t.getValue(this.parent.fields.value,f[0]);if(this.parent.value&&null!==v&&Array.isArray(this.parent.value)&&this.parent.value.length>0&&this.parent.value.indexOf(v)<0){u=this.parent.getForQuery(this.parent.value).clone();u=this.parent.viewPortInfo.endIndex===this.parent.totalItemCount+this.parent.value.length&&this.parent.hideSelectedItem?u.skip(this.parent.totalItemCount-this.parent.itemCount):u.skip(this.parent.viewPortInfo.startIndex),this.parent.setCurrentView=!1,this.parent.isPreventScrollAction=!0,this.parent.resetList(this.parent.dataSource,this.parent.fields,u),l=!0;break}(null===this.parent.value||this.parent.value&&0===this.parent.value.length)&&s.push(f[0])}if(c===a-1&&s.length!==this.parent.itemCount&&this.parent.hideSelectedItem){u=this.parent.value&&this.parent.value.length>0?this.parent.getForQuery(this.parent.value).clone():new i.Query;u=this.parent.value&&this.parent.viewPortInfo.endIndex===this.parent.totalItemCount+this.parent.value.length&&this.parent.hideSelectedItem?u.skip(this.parent.totalItemCount-this.parent.itemCount):u.skip(this.parent.viewPortInfo.startIndex),this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,u),l=!0}}else f&&s.push(f[0]);this.parent.setCurrentView=!1}if(!l&&n){"multiselect"===this.component&&this.parent.allowCustomValue&&0===this.parent.viewPortInfo.startIndex&&this.parent.virtualCustomData&&s.splice(0,0,this.parent.virtualCustomData);"multiselect"===this.component&&this.parent.allowCustomValue&&this.parent.viewPortInfo.endIndex===this.parent.totalItemCount&&this.parent.virtualCustomSelectData&&this.parent.virtualCustomSelectData.length>0&&(s=s.concat(this.parent.virtualCustomSelectData)),this.parent.renderItems(s,this.parent.fields,"multiselect"===this.component&&"CheckBox"===this.parent.mode),this.parent.updateSelectionList()}"multiselect"===this.component&&(this.parent.updatevirtualizationList(),this.parent.checkMaxSelection()),this.parent.getSkeletonCount(),this.parent.skeletonCount=0!==this.parent.totalItemCount&&this.parent.totalItemCount<2*this.parent.itemCount&&(!(this.parent.dataSource instanceof i.DataManager)||this.parent.dataSource instanceof i.DataManager&&this.parent.totalItemCount<=this.parent.itemCount)?0:this.parent.skeletonCount;var g=this.parent.list.getElementsByClassName("e-virtual-ddl")[0],y="multiselect"!==this.component||"multiselect"===this.component&&!(this.parent.dataSource instanceof i.DataManager)||this.parent.dataSource instanceof i.DataManager&&!l;if(g&&y)g.style=this.parent.GetVirtualTrackHeight();else if(!g&&this.parent.skeletonCount>0&&this.parent.popupWrapper){var C=this.parent.createElement("div",{id:this.parent.element.id+"_popup",className:"e-virtual-ddl",styles:this.parent.GetVirtualTrackHeight()});this.parent.popupWrapper.querySelector(".e-dropdownbase").appendChild(C)}("multiselect"!==this.component||"multiselect"===this.component&&!(this.parent.dataSource instanceof i.DataManager)||this.parent.dataSource instanceof i.DataManager&&(!l||0===this.parent.viewPortInfo.startIndex))&&this.parent.UpdateSkeleton(),this.parent.liCollections=this.parent.list.querySelectorAll(".e-list-item");var b=this.parent.list.getElementsByClassName("e-virtual-ddl-content")[0];if(b&&y&&(b.style=this.parent.getTransformValues()),this.parent.fields.groupBy&&this.parent.scrollStop(),40===this.parent.keyCode&&this.parent.isScrollChanged&&this.parent.hideSelectedItem&&!t.isNullOrUndefined(this.parent.currentFocuedListElement)){var S=this.parent.getElementByValue(this.parent.currentFocuedListElement.getAttribute("data-value"));this.parent.addListFocus(S),this.parent.isScrollChanged=!1}},e.prototype.generateQueryAndSetQueryIndexAsync=function(e,t){var s=!1,l=0,n=0,a=this.parent.viewPortInfo.endIndex;if(!t&&0!==a)for(var r=this.parent.viewPortInfo.startIndex;r<=a;r++)r in this.parent.generatedDataObject||(s?n=r===a?r:r+1:(s=!0,l=n=r));!s||this.parent.totalItemCount===l&&this.parent.totalItemCount===n||(this.parent.virtualItemStartIndex=l,this.parent.virtualItemEndIndex=n,this.parent.setCurrentView=!0,this.generateAndExecuteQueryAsync(e,l,n),"multiselect"===this.component&&this.parent.hideSelectedItem&&this.parent.value&&Array.isArray(this.parent.value)&&this.parent.value.length>0&&this.parent.totalItemsCount(),"multiselect"===this.component&&this.parent.virtualItemStartIndex===this.parent.virtualItemEndIndex&&(this.parent.virtualItemStartIndex=this.parent.viewPortInfo.startIndex,this.parent.virtualItemEndIndex=this.parent.viewPortInfo.endIndex)),(!(this.parent.dataSource instanceof i.DataManager)||this.parent.dataSource instanceof i.DataManager&&!this.parent.isRequesting)&&this.setCurrentViewDataAsync()},e.prototype.dataProcessAsync=function(e){this.parent.selectedValueInfo=null,this.parent.virtualItemStartIndex=this.parent.viewPortInfo.startIndex,this.parent.virtualItemEndIndex=this.parent.viewPortInfo.endIndex,this.generateQueryAndSetQueryIndexAsync(new i.Query,e)},e.prototype.virtualScrollRefreshAsync=function(){return N(this,void 0,void 0,function(){return L(this,function(e){switch(e.label){case 0:return this.parent.isCustomFilter=!(this.parent.isTyped||"combobox"===this.component&&this.parent.allowFiltering&&this.parent.queryString!==this.parent.typedString||!t.isNullOrUndefined(this.parent.filterInput)&&!t.isNullOrUndefined(this.parent.filterInput.value)&&""!==this.parent.filterInput.value&&"combobox"!==this.component)&&!("autocomplete"===this.component&&null!=this.parent.value)||this.parent.isCustomFilter,(this.parent.allowFiltering||"autocomplete"===this.component)&&(t.isNullOrUndefined(this.parent.typedString)||"combobox"===this.component&&!t.isNullOrUndefined(this.parent.typedString)&&this.parent.allowFiltering?(this.parent.getSkeletonCount(!0),"combobox"===this.component&&(this.parent.skeletonCount=0!==this.parent.totalItemCount&&this.parent.totalItemCount<2*this.parent.itemCount&&(!(this.parent.dataSource instanceof i.DataManager)||this.parent.dataSource instanceof i.DataManager&&this.parent.totalItemCount<=this.parent.itemCount)?0:this.parent.skeletonCount)):(this.parent.viewPortInfo.endIndex>=this.parent.dataCount&&(this.parent.viewPortInfo.endIndex=this.parent.dataCount),this.parent.viewPortInfo.startIndex>=this.parent.dataCount&&(this.parent.viewPortInfo.startIndex=this.parent.dataCount-this.parent.itemCount))),[4,this.dataProcessAsync()];case 1:return e.sent(),null==this.parent.keyboardEvent||this.parent.dataSource instanceof i.DataManager&&(!(this.parent.dataSource instanceof i.DataManager)||this.parent.isRequesting)||this.parent.handleVirtualKeyboardActions(this.parent.keyboardEvent,this.parent.pageCount),this.parent.customFilterQuery||(this.parent.isCustomFilter=!1),[2]}})})},e.prototype.scrollListener=function(e){var i=this;if(!this.parent.isPreventScrollAction&&!this.parent.isVirtualTrackHeight){this.parent.preventSetCurrentData=!1;var s=e.sentinel,l=this.parent.previousStartIndex;this.parent.viewPortInfo=this.getInfoFromView(e.direction,s,e.offset,!1),this.parent.isUpwardScrolling=!1,this.parent.previousStartIndex===l||this.parent.isKeyBoardAction?this.parent.isScrollActionTriggered&&(this.parent.isPreventKeyAction=!1,this.parent.isScrollActionTriggered=!1,this.parent.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.parent.getTransformValues()):(this.parent.isScrollActionTriggered=!1,this.parent.currentPageNumber=this.parent.viewPortInfo.currentPageNumber,this.parent.virtualListInfo=k({},this.parent.viewPortInfo),this.parent.isPreventKeyAction=!0,this.parent.isVirtualScrolling=!0,setTimeout(function(){i.parent.pageCount=i.parent.getPageCount(),i.parent.isRequesting=!1,i.virtualScrollRefreshAsync().then(function(){i.parent.popupObj&&(i.parent.list=i.parent.popupObj.element.querySelector(".e-content")||t.select(".e-content"),i.parent.updateSelectionList(),i.parent.liCollections=i.parent.getItems()),i.parent.isKeyBoardAction=!1,i.parent.isVirtualScrolling=!1,i.parent.isPreventKeyAction=!1})},5)),this.parent.previousInfo=this.parent.viewPortInfo}},e.prototype.getInfoFromView=function(e,i,s,l){var n={direction:e,sentinelInfo:i,offsets:s,startIndex:this.parent.previousStartIndex,endIndex:this.parent.previousEndIndex},a=this.parent.popupContentElement?this.parent.popupContentElement.getBoundingClientRect().height:0,r=this.parent.listItemHeight,o=s.top/r,h=a/r,u=o+h,p=this.parent.virtualItemCount/4,d=this.parent.totalItemCount;if("down"===n.direction){f=Math.round(u)-Math.round(p);if(t.isNullOrUndefined(n.startIndex)||u>n.startIndex+Math.round(this.parent.virtualItemCount/2+p)&&n.endIndex!==d){n.startIndex=f>=0?Math.round(f):0,n.startIndex=n.startIndex>o?Math.floor(o):n.startIndex;m=n.startIndex+this.parent.virtualItemCount;n.startIndex=m<u?Math.ceil(u)-this.parent.virtualItemCount:n.startIndex,n.endIndex=m<d?m:d,n.startIndex=m>=d?n.endIndex-this.parent.virtualItemCount>0?n.endIndex-this.parent.virtualItemCount:0:n.startIndex,n.currentPageNumber=Math.ceil(n.endIndex/this.parent.virtualItemCount)}}else if("up"===n.direction&&(n.startIndex&&n.endIndex||Math.ceil(o)>this.parent.previousStartIndex)&&(o<Math.round((n.startIndex*r+p*r)/r)||Math.ceil(o)>this.parent.previousStartIndex)){var c=p>h?p:h+h/4,m=Math.round(o+c);n.endIndex=m<d?m:d;var f=n.endIndex-this.parent.virtualItemCount;n.startIndex=f>0?f:0,n.endIndex=f<0?this.parent.virtualItemCount:n.endIndex,n.currentPageNumber=Math.ceil(n.startIndex/this.parent.virtualItemCount)}return l?this.parent.scrollPreStartIndex=n.startIndex:(this.parent.previousStartIndex=n.startIndex,this.parent.startIndex=n.startIndex,this.parent.previousEndIndex=n.endIndex),n},e.prototype.virtualScrollHandler=function(e){var i=this,s="chrome"===t.Browser.info.name?200:100,l=0,n=t.debounce(e,s),a=t.debounce(e,50);return function(e){var t=e.target.scrollTop,s=e.target.scrollLeft,r=l<t&&!i.parent.isUpwardScrolling?"down":"up";l=t;var o=i.sentinelInfo[r],h=i.parent.scrollPreStartIndex,u={top:t,left:s};i.parent.list&&i.parent.list.querySelectorAll(".e-virtual-list").length>0&&(i.getInfoFromView(r,o,u,!0),i.parent.scrollPreStartIndex===h||i.parent.isPreventScrollAction||(i.parent.isScrollActionTriggered=!0,i.parent.list.querySelector(".e-virtual-ddl-content").style.transform="translate(0px,"+t+"px)"));var p=n;"X"===o.axis&&(p=a),p({direction:r,sentinel:o,offset:{top:t,left:s},focusElement:document.activeElement})}},e.prototype.destroy=function(){this.removeEventListener()},e}(),B=function(){var e=function(t,i){return(e=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])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),V=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(l=e[r])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},P=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return B(i,e),V([t.Property()],i.prototype,"text",void 0),V([t.Property()],i.prototype,"value",void 0),V([t.Property()],i.prototype,"iconCss",void 0),V([t.Property()],i.prototype,"groupBy",void 0),V([t.Property()],i.prototype,"htmlAttributes",void 0),V([t.Property()],i.prototype,"disabled",void 0),i}(t.ChildProperty),H={root:"e-dropdownbase",rtl:"e-rtl",content:"e-content",selected:"e-active",hover:"e-hover",noData:"e-nodata",fixedHead:"e-fixed-head",focus:"e-item-focus",li:"e-list-item",group:"e-list-group-item",disabled:"e-disabled",grouping:"e-dd-group",virtualList:"e-list-item e-virtual-list"},U=function(e){function n(t,i){var s=e.call(this,t,i)||this;return s.preventChange=!1,s.isPreventChange=!1,s.isDynamicDataChange=!1,s.addedNewItem=!1,s.isAddNewItemTemplate=!1,s.isRequesting=!1,s.isVirtualizationEnabled=!1,s.isCustomDataUpdated=!1,s.isAllowFiltering=!1,s.virtualizedItemsCount=0,s.isCheckBoxSelection=!1,s.totalItemCount=0,s.dataCount=0,s.remoteDataCount=-1,s.isRemoteDataUpdated=!1,s.isIncrementalRequest=!1,s.itemCount=30,s.virtualListHeight=0,s.isVirtualScrolling=!1,s.isPreventScrollAction=!1,s.scrollPreStartIndex=0,s.isScrollActionTriggered=!1,s.previousStartIndex=0,s.isMouseScrollAction=!1,s.isKeyBoardAction=!1,s.isScrollChanged=!1,s.isUpwardScrolling=!1,s.startIndex=0,s.currentPageNumber=0,s.pageCount=0,s.isPreventKeyAction=!1,s.generatedDataObject={},s.skeletonCount=32,s.isVirtualTrackHeight=!1,s.virtualSelectAll=!1,s.isVirtualReorder=!1,s.incrementalQueryString="",s.incrementalEndIndex=0,s.incrementalStartIndex=0,s.incrementalPreQueryString="",s.isObjectCustomValue=!1,s.appendUncheckList=!1,s.getInitialData=!1,s.preventPopupOpen=!0,s.virtualSelectAllState=!1,s.CurrentEvent=null,s.isDynamicData=!1,s.isPrimitiveData=!1,s.isCustomFiltering=!1,s.debounceTimer=null,s.virtualListInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:0},s.viewPortInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:0},s.selectedValueInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:0},s}return B(n,e),n.prototype.getPropObject=function(e,t,i){var s=new Object,l=new Object,n=function(e){return e};s[n(e)]=t[n(e)],l[n(e)]=i[n(e)];var a=new Object;return a.newProperty=s,a.oldProperty=l,a},n.prototype.getValueByText=function(e,i,s){var l=null;return t.isNullOrUndefined(this.listData)||(l=i?this.checkValueCase(e,!0,s):this.checkValueCase(e,!1,s)),l},n.prototype.checkValueCase=function(e,i,s,l){var n=this,a=null;if(l&&(a=e),!t.isNullOrUndefined(this.listData)){var r=this.listData,o=this.fields,h=this.typeOfData(r).typeof;if("string"===h||"number"===h||"boolean"===h)for(var u=0,p=r;u<p.length;u++){var d=p[u];t.isNullOrUndefined(d)||(s?i?this.checkIgnoreCase(String(d),e)&&(a=this.checkingAccent(String(d),e,i)):a=this.checkingAccent(String(d),e,i):i?this.checkIgnoreCase(String(d),e)&&(a=this.getItemValue(String(d),e,i)):this.checkNonIgnoreCase(String(d),e)&&(a=this.getItemValue(String(d),e,i,l)))}else if(i)r.filter(function(i){var s=t.getValue(o.value,i);!t.isNullOrUndefined(s)&&n.checkIgnoreCase(t.getValue(o.text,i).toString(),e)&&(a=t.getValue(o.value,i))});else if(l){var c=null;c=a,r.filter(function(e){var i=t.getValue(o.value,e);t.isNullOrUndefined(i)||t.isNullOrUndefined(a)||i.toString()!==c.toString()||(a=t.getValue(o.text,e))})}else r.filter(function(i){n.checkNonIgnoreCase(t.getValue(o.text,i),e)&&(a=t.getValue(o.value,i))})}return a},n.prototype.checkingAccent=function(e,t,s){var l=i.DataUtil.ignoreDiacritics(String(e)),n=i.DataUtil.ignoreDiacritics(t.toString()),a=null;return s?this.checkIgnoreCase(l,n)&&(a=this.getItemValue(String(e),t,s)):this.checkNonIgnoreCase(String(e),t)&&(a=this.getItemValue(String(e),t,s)),a},n.prototype.checkIgnoreCase=function(e,t){return String(e).toLowerCase()===t.toString().toLowerCase()},n.prototype.checkNonIgnoreCase=function(e,t){return String(e)===t.toString()},n.prototype.getItemValue=function(e,t,i,s){var l=this.listData,n=this.typeOfData(l).typeof;return s?e.toString():i?"string"===n?String(e):this.getFormattedValue(String(e)):"string"===n?t:this.getFormattedValue(t)},n.prototype.templateCompiler=function(e){var i=!1;if("function"!=typeof e&&e)try{i=!!t.selectAll(e,document).length}catch(e){i=!1}return i},n.prototype.l10nUpdate=function(e){var i="listbox"===this.getModuleName()?this.ulElement:this.list;if(!t.isNullOrUndefined(this.noRecordsTemplate)&&"No records found"!==this.noRecordsTemplate||"Request failed"!==this.actionFailureTemplate){var s=e?this.actionFailureTemplate:this.noRecordsTemplate,l=void 0,n=e?this.actionFailureTemplateId:this.noRecordsTemplateId;i.innerHTML="";var a=this.templateCompiler(s);l="function"!=typeof s&&a?t.compile(t.select(s,document).innerHTML.trim()):t.compile(s);var r=e?"actionFailureTemplate":"noRecordsTemplate",o=void 0;if((o=this.isReact&&"function"==typeof s?l({},this,r,n,this.isStringTemplate,null):l({},this,r,n,this.isStringTemplate,null,i))&&o.length>0)for(var h=0;h<o.length;h++)"listbox"===this.getModuleName()&&"noRecordsTemplate"===r?"#text"===o[h].nodeName?((c=this.createElement("li")).textContent=o[h].textContent,c.classList.add("e-list-nrt"),c.setAttribute("role","option"),i.appendChild(c)):(o[h].classList.add("e-list-nr-template"),i.appendChild(o[h])):(o[h]instanceof HTMLElement||o[h]instanceof Text&&""!==o[h].textContent)&&i.appendChild(o[h]);this.renderReactTemplates()}else{var u={noRecordsTemplate:"No records found",actionFailureTemplate:"Request failed"},p=new t.L10n(this.getLocaleName(),{},this.locale);""!==p.getConstant("actionFailureTemplate")||""!==p.getConstant("noRecordsTemplate")?this.l10n=p:this.l10n=new t.L10n("listbox"===this.getModuleName()?"listbox":"mention"===this.getModuleName()?"mention":"dropdowns",u,this.locale);var d=e?this.l10n.getConstant("actionFailureTemplate"):this.l10n.getConstant("noRecordsTemplate");if("listbox"===this.getModuleName()){var c=this.createElement("li");c.textContent=d,i.appendChild(c),c.classList.add("e-list-nrt"),c.setAttribute("role","option")}else t.isNullOrUndefined(i)||(i.innerHTML=d)}},n.prototype.checkAndResetCache=function(){this.isVirtualizationEnabled&&(this.generatedDataObject={},this.virtualItemStartIndex=this.virtualItemEndIndex=0,this.viewPortInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount},this.selectedValueInfo=null)},n.prototype.updateIncrementalInfo=function(e,t){this.viewPortInfo.startIndex=e,this.viewPortInfo.endIndex=t,this.updateVirtualItemIndex(),this.isIncrementalRequest=!0,this.resetList(this.dataSource,this.fields,this.query),this.isIncrementalRequest=!1},n.prototype.updateIncrementalView=function(e,t){this.viewPortInfo.startIndex=e,this.viewPortInfo.endIndex=t,this.updateVirtualItemIndex(),this.resetList(this.dataSource,this.fields,this.query),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+H.li),this.ulElement=this.list.querySelector("ul")},n.prototype.updateVirtualItemIndex=function(){this.virtualItemStartIndex=this.viewPortInfo.startIndex,this.virtualItemEndIndex=this.viewPortInfo.endIndex,this.virtualListInfo=this.viewPortInfo},n.prototype.getFilteringSkeletonCount=function(){var e=this.skeletonCount;this.getSkeletonCount(!0),this.skeletonCount=this.dataCount<2*this.itemCount&&(!(this.dataSource instanceof i.DataManager)||this.dataSource instanceof i.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount;var t=!0;if("autocomplete"!==this.getModuleName()&&"multiselect"!==this.getModuleName()||!(this.totalItemCount<2*this.itemCount)||this.dataSource instanceof i.DataManager&&!(this.dataSource instanceof i.DataManager&&this.totalItemCount<=this.itemCount)||(this.skeletonCount=0,t=!1),!this.list.classList.contains(H.noData)){if(e!==this.skeletonCount&&t?this.UpdateSkeleton(!0,Math.abs(e-this.skeletonCount)):this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll(".e-list-item"),this.list.getElementsByClassName("e-virtual-ddl").length>0)this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight();else if(!this.list.querySelector(".e-virtual-ddl")&&this.skeletonCount>0&&this.list.querySelector(".e-dropdownbase")){var s=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()});this.list.querySelector(".e-dropdownbase").appendChild(s)}this.list.getElementsByClassName("e-virtual-ddl-content").length>0&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues())}},n.prototype.getSkeletonCount=function(e){this.virtualListHeight=null!=this.listContainerHeight?parseInt(this.listContainerHeight,10):this.virtualListHeight;var t=this.virtualListHeight>0&&this.listItemHeight>0?Math.floor(this.virtualListHeight/this.listItemHeight):0;this.skeletonCount=4*t<this.itemCount?this.itemCount:4*t,this.itemCount=e?this.itemCount:this.skeletonCount,this.virtualItemCount=this.itemCount,this.skeletonCount=Math.floor(this.skeletonCount/2)},n.prototype.GetVirtualTrackHeight=function(){var e=this.totalItemCount===this.viewPortInfo.endIndex?this.totalItemCount*this.listItemHeight-this.itemCount*this.listItemHeight:this.totalItemCount*this.listItemHeight,t="height: "+((e=this.isVirtualTrackHeight?0:e)-this.itemCount*this.listItemHeight)+"px;";return"autocomplete"!==this.getModuleName()&&"multiselect"!==this.getModuleName()||0!==this.skeletonCount?t:"height: 0px;"},n.prototype.getTransformValues=function(){var e=this.viewPortInfo.startIndex*this.listItemHeight;return e-=this.skeletonCount*this.listItemHeight,"transform: translate(0px, "+(e=0===this.viewPortInfo.startIndex&&this.listData&&0===this.listData.length||0===this.skeletonCount?0:e)+"px);"},n.prototype.UpdateSkeleton=function(e,t){var i=this.list.querySelector(".e-virtual-ddl-content"),s=this.list.querySelector(".e-virtual-list");if(i&&(!s||e)&&this.isVirtualizationEnabled){for(var n=e?t:this.skeletonCount,a=0;a<n;a++){r=this.createElement("li",{className:H.virtualList,styles:"overflow: inherit"});this.isVirtualizationEnabled&&this.itemTemplate&&(r.style.height=this.listItemHeight-parseInt(window.getComputedStyle(this.getItems()[1]).marginBottom,10)+"px"),(o=new l.Skeleton({shape:"Text",height:"10px",width:"95%",cssClass:"e-skeleton-text"})).appendTo(this.createElement("div")),r.appendChild(o.element),i.firstChild&&i.firstChild.insertBefore(r,i.firstChild.children[0])}if("multiselect"===this.getModuleName()&&!this.isVirtualReorder&&!i.firstChild.classList.contains("e-reorder")){for(a=0;a<n&&this.totalItemCount!==this.viewPortInfo.endIndex;a++){var r=this.createElement("li",{className:H.virtualList+" e-virtual-list-end",styles:"overflow: inherit"});this.isVirtualizationEnabled&&this.itemTemplate&&(r.style.height=this.listItemHeight-parseInt(window.getComputedStyle(this.getItems()[1]).marginBottom,10)+"px");var o=new l.Skeleton({shape:"Text",height:"10px",width:"95%",cssClass:"e-skeleton-text-end"});o.appendTo(this.createElement("div")),r.appendChild(o.element),i.firstChild&&i.firstChild.appendChild(r)}this.totalItemCount===this.viewPortInfo.endIndex&&i.querySelectorAll(".e-virtual-list-end").forEach(function(e){return e.remove()})}}},n.prototype.getLocaleName=function(){return"drop-down-base"},n.prototype.getTextByValue=function(e){return this.checkValueCase(e,!1,!1,!0)},n.prototype.getFormattedValue=function(e){if(this.listData&&this.listData.length){var i=void 0;if(i=this.properties.allowCustomValue&&this.properties.value&&this.properties.value instanceof Array&&this.properties.value.length>0?this.typeOfData(this.properties.value):this.typeOfData(this.listData),!t.isNullOrUndefined(i.item)&&"number"==typeof t.getValue(this.fields.value?this.fields.value:"value",i.item)||"number"===i.typeof)return parseFloat(e);if(!t.isNullOrUndefined(i.item)&&"boolean"==typeof t.getValue(this.fields.value?this.fields.value:"value",i.item)||"boolean"===i.typeof)return"true"===e||""+e=="true"}return e},n.prototype.setEnableRtl=function(){t.isNullOrUndefined(this.enableRtlElements)||(this.list&&this.enableRtlElements.push(this.list),this.enableRtl?t.addClass(this.enableRtlElements,H.rtl):t.removeClass(this.enableRtlElements,H.rtl))},n.prototype.initialize=function(e){if(this.bindEvent=!0,this.preventPopupOpen=!0,this.actionFailureTemplateId=this.element.id+"ActionFailureTemplate","UL"===this.element.tagName){var i=s.ListBase.createJsonFromElement(this.element);this.setProperties({fields:{text:"text",value:"text"}},!0),this.resetList(i,this.fields)}else"SELECT"===this.element.tagName?(this.dataSource instanceof Array?this.dataSource.length>0:!t.isNullOrUndefined(this.dataSource))?this.isDynamicDataChange&&this.setListData(this.dataSource,this.fields,this.query):this.renderItemsBySelect():this.setListData(this.dataSource,this.fields,this.query,e)},n.prototype.getPersistData=function(){return this.addOnPersist([])},n.prototype.updateDataAttribute=function(e){for(var i=["class","style","id","type","aria-expanded","aria-autocomplete","aria-readonly"],s={},l=0;l<this.element.attributes.length;l++)-1!==i.indexOf(this.element.attributes[l].name)||"dropdownlist"===this.getModuleName()&&"readonly"===this.element.attributes[l].name||(s[this.element.attributes[l].name]=this.element.getAttribute(this.element.attributes[l].name));t.extend(s,e,s),this.setProperties({htmlAttributes:s},!0)},n.prototype.renderItemsBySelect=function(){var e,t=this.element,i=t.querySelectorAll("select>optgroup"),s="multiselect"===this.getModuleName()&&this.isGroupChecking&&i.length>0;e=s?{value:"value",text:"text",groupBy:"categeory"}:e={value:"value",text:"text"};var l=[],n=t.querySelectorAll("select>option");if(this.getJSONfromOption(l,n,e),i.length){for(var a=0;a<i.length;a++){var r=i[a],o={};o[e.text]=r.label,o.isHeader=!0;var h=r.querySelectorAll("option");s?this.getJSONfromOption(l,h,e,r.label):(l.push(o),this.getJSONfromOption(l,h,e))}t.querySelectorAll("select>option")}this.updateFields(e.text,e.value,s?e.groupBy:this.fields.groupBy,this.fields.htmlAttributes,this.fields.iconCss,this.fields.disabled),this.resetList(l,e)},n.prototype.updateFields=function(e,i,s,l,n,a){var r={fields:{text:e,value:i,groupBy:t.isNullOrUndefined(s)?this.fields&&this.fields.groupBy:s,htmlAttributes:t.isNullOrUndefined(l)?this.fields&&this.fields.htmlAttributes:l,iconCss:t.isNullOrUndefined(n)?this.fields&&this.fields.iconCss:n,disabled:t.isNullOrUndefined(a)?this.fields&&this.fields.disabled:a}};this.setProperties(r,!0)},n.prototype.getJSONfromOption=function(e,i,s,l){void 0===l&&(l=null);for(var n=0,a=i;n<a.length;n++){var r=a[n],o={};o[s.text]=r.text,o[s.value]=t.isNullOrUndefined(r.getAttribute(s.value))?r.value:r.getAttribute(s.value),t.isNullOrUndefined(l)||(o[s.groupBy]=l),e.push(o)}},n.prototype.preRender=function(){this.scrollTimer=-1,this.enableRtlElements=[],this.isRequested=!1,this.isDataFetched=!1,this.itemTemplateId=this.element.id+"ItemTemplate",this.displayTemplateId=this.element.id+"DisplayTemplate",this.spinnerTemplateId=this.element.id+"SpinnerTemplate",this.valueTemplateId=this.element.id+"ValueTemplate",this.groupTemplateId=this.element.id+"GroupTemplate",this.headerTemplateId=this.element.id+"HeaderTemplate",this.footerTemplateId=this.element.id+"FooterTemplate",this.noRecordsTemplateId=this.element.id+"NoRecordsTemplate"},n.prototype.setListData=function(e,t,s,l){var n=this;t=t||this.fields;var a;this.isActive=!0;var r={cancel:!1,data:e,query:s};this.isPreventChange=!(!this.isAngular||!this.preventChange)||this.isPreventChange,this.isRequesting||this.trigger("actionBegin",r,function(s){if(!s.cancel)if(n.isRequesting=!0,n.showSpinner(),e instanceof i.DataManager){n.isRequested=!0;var r=!1;if(n.isDataFetched)return void n.emptyDataRequest(t);var o=n.getQuery(s.query);s.data.executeQuery(o).then(function(e){n.isPreventChange=!(!n.isAngular||!n.preventChange)||n.isPreventChange;var s=!0;if(!n.virtualSelectAll){for(var l=o.clone(),h=0;h<l.queries.length;h++)"onWhere"===l.queries[h].fn&&(r=!0);if(n.isVirtualizationEnabled&&0!==e.count&&e.count<2*n.itemCount){if(l)for(h=0;h<l.queries.length;h++)"onTake"===l.queries[h].fn&&(l.queries[h].e.nos=e.count),"multiselect"!==n.getModuleName()||"or"!==l.queries[h].e.condition&&"equal"!==l.queries[h].e.operator||n.isCustomFiltering||(s=!1)}else if(n.isVirtualTrackHeight=!1,l)for(h=0;h<l.queries.length;h++)"multiselect"===n.getModuleName()&&(l.queries[h].e&&"or"===l.queries[h].e.condition||l.queries[h].e&&"equal"===l.queries[h].e.operator)&&(s=!1)}s&&(n.dataCount=n.totalItemCount=e.count),n.trigger("actionComplete",e,function(e){if(!e.cancel){n.isRequesting=!1,n.isCustomFiltering=!1;var s=e.result;if(n.isIncrementalRequest)return void(a=n.renderItems(s,t));if((!n.isVirtualizationEnabled&&0===s.length||n.isVirtualizationEnabled&&0===s.length&&!r)&&(n.isDataFetched=!0),r||(n.remoteDataCount=e.count),n.dataCount=n.virtualSelectAll?n.dataCount:e.count,n.totalItemCount=n.virtualSelectAll?n.totalItemCount:e.count,a=n.renderItems(s,t),n.appendUncheckList=!1,n.isUpdateGroupTemplate=!1,n.onActionComplete(a,s,e),n.groupTemplate&&(n.isAngular&&"multiselect"===n.getModuleName()&&n.updateGroupHeaderItems(a),n.renderGroupTemplate(a)),n.isUpdateGroupTemplate=!0,n.isRequested=!1,n.bindChildItems(s,a,t,e),n.getInitialData)return n.getInitialData=!1,void(n.preventPopupOpen=!1);var l=!1;n.isVirtualizationEnabled&&n.setCurrentView&&(l=!0,n.notify("setCurrentViewDataAsync",{module:"VirtualScroll"})),null!=n.keyboardEvent&&n.handleVirtualKeyboardActions(n.keyboardEvent,n.pageCount);var o="multiselect"!==n.getModuleName()||"multiselect"===n.getModuleName()&&(!(n.dataSource instanceof i.DataManager)||n.dataSource instanceof i.DataManager&&!l);n.isVirtualizationEnabled&&o&&(n.getFilteringSkeletonCount(),n.updatePopupPosition()),n.virtualSelectAll&&n.virtualSelectAllData&&(n.virtualSelectionAll(n.virtualSelectAllState,n.liCollections,n.CurrentEvent),n.virtualSelectAllState=!1,n.CurrentEvent=null,n.virtualSelectAll=!1)}})}).catch(function(e){n.isRequested=!1,n.isRequesting=!1,n.onActionFailure(e),n.hideSpinner()})}else{n.isRequesting=!1;var h=!0,u=void 0;if(n.isVirtualizationEnabled&&!n.virtualGroupDataSource&&n.fields.groupBy){var p=new i.DataManager(n.dataSource).executeLocal((new i.Query).group(n.fields.groupBy));n.virtualGroupDataSource=p.records}var d=n.isVirtualizationEnabled&&n.virtualGroupDataSource&&!n.isCustomDataUpdated?new i.DataManager(n.virtualGroupDataSource):new i.DataManager(s.data);if(u=n.getQuery(s.query).executeLocal(d),!n.virtualSelectAll){var c=n.getQuery(s.query);if(n.isVirtualizationEnabled&&0!==u.count&&u.count<2*n.itemCount&&!n.appendUncheckList){if(c){for(m=0;m<c.queries.length;m++)"onTake"===c.queries[m].fn&&(c.queries[m].e.nos=u.count,u=c.executeLocal(d)),"multiselect"!==n.getModuleName()||"or"!==c.queries[m].e.condition&&"equal"!==c.queries[m].e.operator||n.isCustomFiltering||(h=!1);h&&(u=c.executeLocal(d),n.isVirtualTrackHeight=!(n.dataSource instanceof i.DataManager||n.isCustomDataUpdated))}}else if(n.isVirtualTrackHeight=!1,c)for(var m=0;m<c.queries.length;m++)"multiselect"===n.getModuleName()&&(c.queries[m].e&&"or"===c.queries[m].e.condition||c.queries[m].e&&"equal"===c.queries[m].e.operator)&&(h=!1)}!h||n.dataSource instanceof i.DataManager||n.isCustomDataUpdated||n.virtualSelectAll||(n.dataCount=n.totalItemCount=n.virtualSelectAll?u.length:u.count);var f={cancel:!1,result:u=n.isVirtualizationEnabled?u.result:u};n.isPreventChange=!(!n.isAngular||!n.preventChange)||n.isPreventChange,n.trigger("actionComplete",f,function(e){if(n.isCustomFiltering=!1,n.isIncrementalRequest)return void(a=n.renderItems(e.result,t));if(!e.cancel){if(a=n.renderItems(e.result,t),n.isUpdateGroupTemplate=!1,n.onActionComplete(a,e.result,l),n.groupTemplate&&(n.isAngular&&"multiselect"===n.getModuleName()&&n.updateGroupHeaderItems(a),n.renderGroupTemplate(a)),n.isUpdateGroupTemplate=!0,n.bindChildItems(e.result,a,t),n.getInitialData)return n.getInitialData=!1,void(n.preventPopupOpen=!1);setTimeout(function(){"multiselect"===n.getModuleName()&&null!=n.itemTemplate&&a.childElementCount>0&&(a.children[0].childElementCount>0||n.fields.groupBy&&a.children[1]&&a.children[1].childElementCount>0)&&n.updateDataList()})}})}})},n.prototype.updateGroupHeaderItems=function(e){for(var t=e.querySelectorAll("."+H.group),i=[],s=0;s<t.length;s++)i.push(t[s].cloneNode?t[s].cloneNode(!0):t[s]);this.isFilterAction?this.fiteredGroupHeaderItems=i:this.groupHeaderItems=i},n.prototype.setCustomListData=function(e,t,s,l){var n=this;t=t||this.fields;var a;if(this.isActive=!0,this.isPreventChange=!(!this.isAngular||!this.preventChange)||this.isPreventChange,!this.isRequesting){this.isRequesting=!0,this.showSpinner(),this.isRequesting=!1;var r=!0,o=void 0;if(this.isVirtualizationEnabled&&!this.virtualGroupDataSource&&this.fields.groupBy){var h=new i.DataManager(this.dataSource).executeLocal((new i.Query).group(this.fields.groupBy));this.virtualGroupDataSource=h.records}var u=this.isVirtualizationEnabled&&this.virtualGroupDataSource&&!this.isCustomDataUpdated?new i.DataManager(this.virtualGroupDataSource):new i.DataManager(e);if(o=this.getQuery(s).executeLocal(u),!this.virtualSelectAll){var p=this.getQuery(s);if(this.isVirtualizationEnabled&&0!==o.count&&o.count<2*this.itemCount&&!this.appendUncheckList){if(p){for(d=0;d<p.queries.length;d++)"onTake"===p.queries[d].fn&&(p.queries[d].e.nos=o.count,o=p.executeLocal(u)),"multiselect"!==this.getModuleName()||"or"!==p.queries[d].e.condition&&"equal"!==p.queries[d].e.operator||this.isCustomFiltering||(r=!1);r&&(o=p.executeLocal(u),this.isVirtualTrackHeight=!(this.dataSource instanceof i.DataManager||this.isCustomDataUpdated))}}else if(this.isVirtualTrackHeight=!1,p)for(var d=0;d<p.queries.length;d++)"multiselect"===this.getModuleName()&&(p.queries[d].e&&"or"===p.queries[d].e.condition||p.queries[d].e&&"equal"===p.queries[d].e.operator)&&(r=!1)}if(!r||this.dataSource instanceof i.DataManager||this.isCustomDataUpdated||this.virtualSelectAll||(this.dataCount=this.totalItemCount=this.virtualSelectAll?o.length:o.count),o=this.isVirtualizationEnabled?o.result:o,this.isPreventChange=!(!this.isAngular||!this.preventChange)||this.isPreventChange,this.isCustomFiltering=!1,this.isIncrementalRequest)return void(a=this.renderItems(o,t));a=this.renderItems(o,t),this.onActionComplete(a,o,l),this.groupTemplate&&this.renderGroupTemplate(a),this.bindChildItems(o,a,t),setTimeout(function(){"multiselect"===n.getModuleName()&&null!=n.itemTemplate&&a.childElementCount>0&&(a.children[0].childElementCount>0||n.fields.groupBy&&a.children[1]&&a.children[1].childElementCount>0)&&n.updateDataList()})}},n.prototype.handleVirtualKeyboardActions=function(e,t){},n.prototype.updatePopupState=function(){},n.prototype.updatePopupPosition=function(){},n.prototype.virtualSelectionAll=function(e,t,i){},n.prototype.updateRemoteData=function(){this.setListData(this.dataSource,this.fields,this.query)},n.prototype.bindChildItems=function(e,i,s,l){var n=this;e.length>=100&&"autocomplete"===this.getModuleName()?setTimeout(function(){var a=n.remainingItems(n.sortedData,s);t.append(a,i),n.liCollections=n.list.querySelectorAll("."+H.li),n.updateListValues(),n.raiseDataBound(e,l)},0):this.raiseDataBound(e,l)},n.prototype.isObjectInArray=function(e,t){return t.some(function(t){return Object.keys(e).every(function(i){return Object.prototype.hasOwnProperty.call(t,i)&&t[i]===e[i]})})},n.prototype.updateListValues=function(){},n.prototype.findListElement=function(e,t,i,s){var l=null;if(e)for(var n=[].slice.call(e.querySelectorAll(t)),a=0;a<n.length;a++)if(n[a].getAttribute(i)===s+""){l=n[a];break}return l},n.prototype.raiseDataBound=function(e,t){this.hideSpinner();var i={items:e,e:t};this.trigger("dataBound",i)},n.prototype.remainingItems=function(e,t){var l=new i.DataManager(e).executeLocal((new i.Query).skip(100));if(this.itemTemplate){var n=this.templateListItem(l,t);return[].slice.call(n.childNodes)}var a=this.typeOfData(l).typeof;return"string"===a||"number"===a||"boolean"===a?s.ListBase.createListItemFromArray(this.createElement,l,!0,this.listOption(l,t),this):s.ListBase.createListItemFromJson(this.createElement,l,this.listOption(l,t),1,!0,this)},n.prototype.emptyDataRequest=function(e){var t=[];this.onActionComplete(this.renderItems(t,e),t),this.isRequested=!1,this.isRequesting=!1,this.hideSpinner()},n.prototype.showSpinner=function(){},n.prototype.hideSpinner=function(){},n.prototype.onActionFailure=function(e){this.liCollections=[],this.trigger("actionFailure",e),this.l10nUpdate(!0),t.isNullOrUndefined(this.list)||t.addClass([this.list],H.noData)},n.prototype.onActionComplete=function(e,i,s){var l=this;if(this.listData=i,!this.isVirtualizationEnabled||this.isCustomDataUpdated||this.virtualSelectAll||this.notify("setGeneratedData",{module:"VirtualScroll"}),"listbox"!==this.getModuleName()&&e.setAttribute("tabindex","0"),this.isReact&&this.clearTemplate(["itemTemplate","groupTemplate","actionFailureTemplate","noRecordsTemplate"]),this.isVirtualizationEnabled||(this.fixedHeaderElement=t.isNullOrUndefined(this.fixedHeaderElement)?this.fixedHeaderElement:null),"multiselect"===this.getModuleName()&&this.properties.allowCustomValue&&this.fields.groupBy)for(h=0;h<e.childElementCount;h++)e.children[h].classList.contains("e-list-group-item")&&(t.isNullOrUndefined(e.children[h].innerHTML)||""===e.children[h].innerHTML)&&t.addClass([e.children[h]],"e-hide-group-header"),e.children[0].classList.contains("e-hide-group-header")&&t.setStyleAttribute(e.children[1],{zIndex:11});if("multiselect"===this.getModuleName()&&this.isAngular&&this.ngEle){var n=this.list;if(n){var a=n.offsetHeight+"px";n.style.height=a}}if(!t.isNullOrUndefined(this.list)&&!this.isVirtualizationEnabled){if(this.list.innerHTML="",this.isUpdateGroupTemplate&&this.isAngular&&this.groupTemplate&&"multiselect"===this.getModuleName()){var r=e.querySelectorAll("."+H.group);if(r.length>0&&this.groupHeaderItems.length>0){for(var o={},h=0;h<this.groupHeaderItems.length;h++)o[this.groupHeaderItems[h].id]=this.groupHeaderItems[h].innerHTML;for(h=0;h<r.length;h++)Object.prototype.hasOwnProperty.call(o,r[h].id)&&(r[h].innerHTML=o[r[h].id])}this.renderGroupTemplate(e)}this.list.appendChild(e),this.liCollections=this.list.querySelectorAll("."+H.li),this.ulElement=this.list.querySelector("ul"),this.postRender(this.list,i,this.bindEvent)}if("multiselect"===this.getModuleName()&&this.isAngular&&this.ngEle){var u=this.list;u&&setTimeout(function(){u.style.height="",l.refreshPopup()},0)}},n.prototype.postRender=function(e,i,s){if(this.fields.disabled)for(var l=e.querySelectorAll("."+H.li),n=("None"!==this.sortOrder?t.isNullOrUndefined(this.fields.groupBy)?this.sortedData:this.sortedData.filter(function(e){return!("isHeader"in e)||!0!==e.isHeader}):this.listData),a=0;a<l.length;a++)if(n[a]&&JSON.parse(JSON.stringify(n[a]))[this.fields.disabled])if(t.isNullOrUndefined(this.fields.groupBy))this.disableListItem(l[a]);else{var r=n[a],o=t.getValue(this.fields.value?this.fields.value:"value",r),h=e.querySelector('li[data-value="'+o+'"]');t.isNullOrUndefined(h)||this.disableListItem(h)}var u=this.fields.disabled?e.querySelector("."+H.li+":not(.e-disabled"):e.querySelector("."+H.li),p=e.querySelector("."+H.selected);if(u&&!p){if(this.isVirtualizationEnabled&&0!==this.viewPortInfo.startIndex){var d=this.ulElement.querySelectorAll("li."+H.li+":not(.e-virtual-list):not(.e-hide-listitem)");u=d&&d.length>0?d[2]:u}u&&u.classList.add(H.focus)}i.length<=0?(this.l10nUpdate(),t.addClass([e],H.noData)):e.classList.remove(H.noData)},n.prototype.getQuery=function(e){return e||(this.query?this.query:new i.Query)},n.prototype.performFiltering=function(e){},n.prototype.debouncedFiltering=function(e,t){var i=this;null!==this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(function(){i.performFiltering(e)},t)},n.prototype.updateVirtualizationProperties=function(e,t,i){this.isVirtualizationEnabled=!0,this.virtualizedItemsCount=e,this.isAllowFiltering=t,this.isCheckBoxSelection=i},n.prototype.renderGroupTemplate=function(e){if(null!==this.fields.groupBy&&this.dataSource||this.element.querySelector("."+H.group)){var i=this.dataSource,l={groupTemplateID:this.groupTemplateId,isStringTemplate:this.isStringTemplate},n=this.isAngular&&"multiselect"===this.getModuleName()&&!t.isNullOrUndefined(e)&&e.classList.contains(H.fixedHead)?[e]:e.querySelectorAll("."+H.group),a=this.templateCompiler(this.groupTemplate);if("function"!=typeof this.groupTemplate&&a){var r=t.select(this.groupTemplate,document).innerHTML.trim(),o=s.ListBase.renderGroupTemplate(r,i,this.fields.properties,n,l,this);if(this.isGroupChecking)for(h=0;h<o.length;h++)this.notify("addItem",{module:"CheckBoxSelection",item:o[h]})}else{o=s.ListBase.renderGroupTemplate(this.groupTemplate,i,this.fields.properties,n,l,this);if(this.isGroupChecking)for(var h=0;h<o.length;h++)this.notify("addItem",{module:"CheckBoxSelection",item:o[h]})}this.renderReactTemplates()}},n.prototype.createListItems=function(e,l){if(e){if(l.groupBy||this.element.querySelector("optgroup")){if(l.groupBy){"None"!==this.sortOrder&&(e=this.getSortedDataSource(e));var n=l.properties||l;e=s.ListBase.groupDataSource(e,n,this.sortOrder)}t.addClass([this.list],H.grouping)}else("listbox"!==this.getModuleName()||"listbox"===this.getModuleName()&&!this.preventDefActionFilter)&&(e=this.getSortedDataSource(e));var a=this.listOption(e,l),r=e.length>100?new i.DataManager(e).executeLocal((new i.Query).take(100)):e;return this.sortedData=e,s.ListBase.createList(this.createElement,"autocomplete"===this.getModuleName()?r:e,a,!0,this)}return null},n.prototype.listOption=function(e,i){var s=!t.isNullOrUndefined(i.iconCss),l=t.isNullOrUndefined(i.properties)?i:i.properties,n=null!==i.text||null!==i.value?{fields:l,showIcon:s,ariaAttributes:{groupItemRole:"presentation"}}:{fields:{value:"text"}};return t.extend({},n,i,!0)},n.prototype.setFloatingHeader=function(e){t.isNullOrUndefined(this.list)||this.list.classList.contains(H.noData)||(t.isNullOrUndefined(this.fixedHeaderElement)&&(this.fixedHeaderElement=this.createElement("div",{className:H.fixedHead}),t.isNullOrUndefined(this.list)||this.list.querySelector("li").classList.contains(H.group)||(this.fixedHeaderElement.style.display="none"),t.isNullOrUndefined(this.fixedHeaderElement)||t.isNullOrUndefined(this.list)||t.prepend([this.fixedHeaderElement],this.list),this.setFixedHeader()),t.isNullOrUndefined(this.fixedHeaderElement)||"0"!==this.fixedHeaderElement.style.zIndex||this.setFixedHeader(),this.scrollStop(e))},n.prototype.scrollStop=function(e,i){for(var s=t.isNullOrUndefined(e)?this.list:e.target,l=getComputedStyle(this.getValidLi(),null).getPropertyValue("height"),n=getComputedStyle(this.getValidLi(),null).getPropertyValue("margin-bottom"),a=parseInt(n,10),r="multiselect"===this.getModuleName()?parseFloat(l):parseInt(l,10),o=Math.round(s.scrollTop/(r+a)),h=this.list.querySelectorAll("li:not(.e-hide-listitem)"),u=this.list.querySelectorAll(".e-virtual-list").length,p=o;p>-1;p--){var d=this.isVirtualizationEnabled?p+u:p;if(this.isVirtualizationEnabled){if(this.fixedHeaderElement&&this.updateGroupHeader(d,h,s))break;i&&(!t.isNullOrUndefined(h[d])&&h[d].classList.contains(H.selected)&&"autocomplete"!==this.getModuleName()||!t.isNullOrUndefined(h[d])&&h[d].classList.contains(H.focus)&&this.getModuleName())}else if(this.updateGroupHeader(d,h,s))break}},n.prototype.getPageCount=function(e){if(this.list){var t=this.list.classList.contains(H.noData)?null:getComputedStyle(this.getItems()[0],null).getPropertyValue("height"),i=Math.round(this.list.getBoundingClientRect().height/parseInt(t,10));return e?i:Math.round(i)}return 0},n.prototype.updateGroupHeader=function(e,i,s){return!t.isNullOrUndefined(i[e])&&i[e].classList.contains(H.group)?(this.updateGroupFixedHeader(i[e],s),!0):(this.fixedHeaderElement.style.display="none",this.fixedHeaderElement.style.top="none",!1)},n.prototype.updateFixedGroupTemplateHader=function(e){var t=e.cloneNode?e.cloneNode(!0):e,i=!1;if(this.groupHeaderItems&&this.groupHeaderItems.length>0)for(s=0;s<this.groupHeaderItems.length;s++)if(t.id===this.groupHeaderItems[s].id){t.innerHTML=this.groupHeaderItems[s].innerHTML,i=!0;break}if(!i&&this.fiteredGroupHeaderItems&&this.fiteredGroupHeaderItems.length>0)for(var s=0;s<this.fiteredGroupHeaderItems.length;s++)if(t.id===this.fiteredGroupHeaderItems[s].id){t.innerHTML=this.fiteredGroupHeaderItems[s].innerHTML;break}this.fixedHeaderElement.innerHTML=t.innerHTML,this.renderGroupTemplate(this.fixedHeaderElement)},n.prototype.updateGroupFixedHeader=function(e,i){this.fixedHeaderElement&&this.list&&this.list.parentElement&&(t.isNullOrUndefined(e.innerHTML)||(this.groupTemplate&&this.isAngular&&"multiselect"===this.getModuleName()?this.updateFixedGroupTemplateHader(e):this.fixedHeaderElement.innerHTML=e.innerHTML),this.fixedHeaderElement.style.position="fixed",this.fixedHeaderElement.style.top=this.list.parentElement.offsetTop+this.list.offsetTop-window.scrollY+"px",this.fixedHeaderElement.style.display="block")},n.prototype.getValidLi=function(){return this.isVirtualizationEnabled&&this.liCollections[0].classList.contains("e-virtual-list")?this.liCollections[this.skeletonCount]:this.liCollections[0]},n.prototype.renderItems=function(e,t,l,n){var a;if(this.itemTemplate&&e){"multiselect"===this.getModuleName()&&this.virtualSelectAll&&(this.virtualSelectAllData=e,e=e.slice(this.virtualItemStartIndex,this.virtualItemEndIndex));var r=e;r&&t.groupBy?("None"!==this.sortOrder&&(r=this.getSortedDataSource(r)),r=s.ListBase.groupDataSource(r,t.properties,this.sortOrder)):("listbox"!==this.getModuleName()||"listbox"===this.getModuleName()&&!this.preventDefActionFilter)&&(r=this.getSortedDataSource(r)),this.sortedData=r;var o=r.length>100?new i.DataManager(r).executeLocal((new i.Query).take(100)):r;if(a=this.templateListItem("autocomplete"===this.getModuleName()?o:r,t),this.isIncrementalRequest)return this.incrementalLiCollections=a.querySelectorAll("."+H.li),this.incrementalUlElement=a,this.incrementalListData=e,a;if(this.isVirtualizationEnabled){var h=this.list.querySelector(".e-list-parent"),u=this.list.querySelector(".e-virtual-ddl-content");if(e.length>=this.virtualizedItemsCount&&h&&u||h&&u&&this.isAllowFiltering||h&&u&&"autocomplete"===this.getModuleName()){"multiselect"===this.getModuleName()&&this.isCheckBoxSelection&&this.appendUncheckList&&this.list&&this.list.querySelector(".e-active")?(u.appendChild(a),l=!0):u.replaceChild(a,h);var p=this.list.querySelectorAll(".e-reorder");this.list.querySelector(".e-virtual-ddl-content")&&p&&p.length>0&&!l&&this.list.querySelector(".e-virtual-ddl-content").removeChild(p[0]),this.updateListElements(e)}else u||(this.list.innerHTML="",this.createVirtualContent(),this.list.querySelector(".e-virtual-ddl-content").appendChild(a),this.updateListElements(e))}}else{if("multiselect"===this.getModuleName()&&this.virtualSelectAll&&!n&&(this.virtualSelectAllData=e,e=e.slice(this.virtualItemStartIndex,this.virtualItemEndIndex)),a=this.createListItems(e,t),this.isIncrementalRequest)return this.incrementalLiCollections=a.querySelectorAll("."+H.li),this.incrementalUlElement=a,this.incrementalListData=e,a;if(this.isVirtualizationEnabled){var h=this.list.querySelector(".e-list-parent:not(.e-reorder)"),u=this.list.querySelector(".e-virtual-ddl-content");(!h&&this.list.querySelector(".e-list-parent.e-reorder")||h&&this.isVirtualReorder&&this.list.querySelector(".e-list-parent.e-reorder"))&&(h=this.list.querySelector(".e-list-parent.e-reorder")),e.length>=this.virtualizedItemsCount&&h&&u||h&&u&&this.isAllowFiltering||h&&u&&("autocomplete"===this.getModuleName()||"multiselect"===this.getModuleName())?(("multiselect"!==this.getModuleName()||"multiselect"===this.getModuleName()&&(!(this.dataSource instanceof i.DataManager)||this.dataSource instanceof i.DataManager&&!this.setCurrentView))&&(this.appendUncheckList?u.appendChild(a):u.replaceChild(a,h)),this.updateListElements(e)):u&&u.firstChild||(this.list.innerHTML="",this.createVirtualContent(),this.list.querySelector(".e-virtual-ddl-content").appendChild(a),this.updateListElements(e))}}return a},n.prototype.createVirtualContent=function(){this.list.querySelector(".e-virtual-ddl-content")||this.list.appendChild(this.createElement("div",{className:"e-virtual-ddl-content"}))},n.prototype.updateListElements=function(e){this.liCollections=this.list.querySelectorAll("."+H.li),this.ulElement=this.list.querySelector("ul"),this.listData=e,this.postRender(this.list,e,this.bindEvent)},n.prototype.templateListItem=function(e,i){var l=this.listOption(e,i);l.templateID=this.itemTemplateId,l.isStringTemplate=this.isStringTemplate;var n,a=this.templateCompiler(this.itemTemplate);if("function"!=typeof this.itemTemplate&&a){var r=t.select(this.itemTemplate,document).innerHTML.trim();return n=s.ListBase.renderContentTemplate(this.createElement,r,e,i.properties,l,this),this.isVirtualizationEnabled&&this.isReact&&this.renderReactTemplates(),n}return n=s.ListBase.renderContentTemplate(this.createElement,this.itemTemplate,e,i.properties,l,this),this.isVirtualizationEnabled&&this.isReact&&this.renderReactTemplates(),n},n.prototype.typeOfData=function(e){for(var i={typeof:null,item:null},s=0;!t.isNullOrUndefined(e)&&s<e.length;s++)if(!t.isNullOrUndefined(e[s])&&!("string"==typeof e[s]||"number"==typeof e[s]||"boolean"==typeof e[s]?t.isNullOrUndefined(e[s]):t.isNullOrUndefined(t.getValue(this.fields.value?this.fields.value:"value",e[s]))))return i={typeof:typeof e[s],item:e[s]};return i},n.prototype.setFixedHeader=function(){t.isNullOrUndefined(this.list)||(this.list.parentElement.style.display="block");var e=0;if(this.list&&this.list.parentElement&&(e=parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-width"),10),isNaN(e)&&(e=parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-top-width"),10)+parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-bottom-width"),10)+parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-left-width"),10)+parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-right-width"),10))),!t.isNullOrUndefined(this.liCollections)){var i=this.getValidLi().offsetWidth-e;this.fixedHeaderElement.style.width=i.toString()+"px"}t.setStyleAttribute(this.fixedHeaderElement,{zIndex:10});var s=this.ulElement.querySelector("."+H.group+":not(.e-hide-listitem)");t.isNullOrUndefined(s)||(this.groupTemplate&&this.isAngular&&"multiselect"===this.getModuleName()?this.updateFixedGroupTemplateHader(s):this.fixedHeaderElement.innerHTML=s.innerHTML)},n.prototype.getSortedDataSource=function(e){if(e&&"None"!==this.sortOrder){var t=this.fields.text?this.fields.text:"text";"string"!==this.typeOfData(e).typeof&&"number"!==this.typeOfData(e).typeof&&"boolean"!==this.typeOfData(e).typeof||(t=""),e=s.ListBase.getDataSource(e,s.ListBase.addSorting(this.sortOrder,t))}return e},n.prototype.getIndexByValue=function(e){var i,s=[];s=this.fields.disabled&&"multiselect"===this.getModuleName()&&this.liCollections?this.liCollections:this.getItems();for(var l=0;l<s.length;l++)if(!t.isNullOrUndefined(e)&&s[l].getAttribute("data-value")===e.toString()){i=l;break}return i},n.prototype.getIndexByValueFilter=function(e,i){var s;if(!i)return null;var l=i.querySelectorAll("li:not(.e-list-group-item)");if(l)for(var n=0;n<l.length;n++)if(!t.isNullOrUndefined(e)&&l[n].getAttribute("data-value")===e.toString()){s=n;break}return s},n.prototype.dispatchEvent=function(e,t){var i=document.createEvent("HTMLEvents");i.initEvent(t,!1,!0),e&&e.dispatchEvent(i)},n.prototype.setFields=function(){this.fields.value&&!this.fields.text?this.updateFields(this.fields.value,this.fields.value):!this.fields.value&&this.fields.text?this.updateFields(this.fields.text,this.fields.text):this.fields.value||this.fields.text||(this.isPrimitiveData=!0,this.updateFields("text","text"))},n.prototype.resetList=function(e,i,s,l){this.list&&(("SELECT"===this.element.tagName&&this.element.options.length>0||"UL"===this.element.tagName&&this.element.childNodes.length>0)&&!(e instanceof Array?e.length>0:!t.isNullOrUndefined(e))&&this.selectData&&this.selectData.length>0&&(e=this.selectData),e="combobox"===this.getModuleName()&&this.selectData&&e instanceof Array&&e.length<this.selectData.length&&this.addedNewItem?this.selectData:e,this.addedNewItem=!1,this.isCustomReset&&"multiselect"===this.getModuleName()?this.setCustomListData(e,i,s,l):this.setListData(e,i,s,l))},n.prototype.updateSelectElementData=function(e){(e||this.isVirtualizationEnabled)&&t.isNullOrUndefined(this.selectData)&&this.listData&&this.listData.length>0&&(this.selectData=this.listData)},n.prototype.updateSelection=function(){},n.prototype.renderList=function(){this.render()},n.prototype.updateDataSource=function(e,t){this.resetList(this.dataSource),this.totalItemCount=this.dataSource instanceof i.DataManager?this.dataSource.dataSource.json.length:0},n.prototype.setUpdateInitial=function(e,i,s){this.isDataFetched=!1,this.isPrimitiveData=!1;for(var l={},n=0;e.length>n;n++)i[e[n]]&&"fields"===e[n]?(this.setFields(),l[e[n]]=i[e[n]]):i[e[n]]&&(l[e[n]]=i[e[n]]);Object.keys(l).length>0&&(-1===Object.keys(l).indexOf("dataSource")&&(l.dataSource=this.dataSource),"listbox"===this.getModuleName()?this.isReact&&(!this.isReact||t.isNullOrUndefined(i.dataSource)&&t.isNullOrUndefined(i.sortOrder))||this.updateDataSource(l,s):(this.isDynamicData=!0,this.updateDataSource(l,s)))},n.prototype.onPropertyChanged=function(e,i){"dropdownbase"===this.getModuleName()&&this.setUpdateInitial(["fields","query","dataSource"],e),this.setUpdateInitial(["sortOrder","itemTemplate"],e);for(var s=0,l=Object.keys(e);s<l.length;s++)switch(l[s]){case"query":case"sortOrder":case"dataSource":case"itemTemplate":break;case"enableRtl":this.setEnableRtl();break;case"groupTemplate":if(this.renderGroupTemplate(this.list),this.ulElement&&this.fixedHeaderElement){var n=this.ulElement.querySelector("."+H.group);this.fixedHeaderElement.innerHTML=n.innerHTML}break;case"locale":this.list&&!t.isNullOrUndefined(this.liCollections)&&0===this.liCollections.length&&this.l10nUpdate();break;case"zIndex":this.setProperties({zIndex:e.zIndex},!0),this.setZIndex()}},n.prototype.render=function(e,i){"listbox"===this.getModuleName()?this.list=this.createElement("div",{className:H.content,attrs:{tabindex:"0"}}):this.list=this.createElement("div",{className:H.content}),this.list.classList.add(H.root),this.setFields();var s={duration:300,selector:"."+H.li};this.rippleFun=t.rippleEffect(this.list,s);var l=this.element.querySelector("select>optgroup");if((this.fields.groupBy||!t.isNullOrUndefined(l))&&!this.isGroupChecking){t.EventHandler.add(this.list,"scroll",this.setFloatingHeader,this);for(var n=this.getScrollableParent(),a=0;a<n.length;a++){var r=n[a];t.EventHandler.add(r,"scroll",this.updateGroupFixedHeader,this)}}if("dropdownbase"===this.getModuleName()){this.element.getAttribute("tabindex")&&this.list.setAttribute("tabindex",this.element.getAttribute("tabindex")),t.removeClass([this.element],H.root),this.element.style.display="none";var o=this.createElement("div");this.element.parentElement.insertBefore(o,this.element),o.appendChild(this.element),o.appendChild(this.list)}this.setEnableRtl(),i||this.initialize(e)},n.prototype.getScrollableParent=function(){for(var e=getComputedStyle(this.element),t=[],i=/(auto|scroll)/,s=this.element.parentElement;s&&"HTML"!==s.tagName;){var l=getComputedStyle(s);"absolute"===e.position&&"static"===l.position||!i.test(l.overflow+l.overflowY+l.overflowX)||t.push(s),s=s.parentElement}return t.push(document),t},n.prototype.removeScrollEvent=function(){this.list&&t.EventHandler.remove(this.list,"scroll",this.setFloatingHeader)},n.prototype.getModuleName=function(){return"dropdownbase"},n.prototype.getItems=function(){return this.ulElement.querySelectorAll("."+H.li)},n.prototype.addItem=function(e,i){if((!this.list||this.list.textContent===this.noRecordsTemplate&&"listbox"!==this.getModuleName())&&this.renderList(),"None"!==this.sortOrder&&t.isNullOrUndefined(i)){var l=[].slice.call(this.listData);l.push(e),l=this.getSortedDataSource(l),i=this.fields.groupBy?(l=s.ListBase.groupDataSource(l,this.fields.properties,this.sortOrder)).indexOf(e):l.indexOf(e)}var n=this.getItems().length,a=0===n,r=this.list.querySelector("."+H.selected);e=e instanceof Array?e:[e];var o;o=t.isNullOrUndefined(i)||i<0||i>n-1?n:i;var h=this.fields;e&&h.groupBy&&(e=s.ListBase.groupDataSource(e,h.properties));for(var u=[],p=0;p<e.length;p++){var d=e[p],c=d.isHeader,m=this.createElement("li",{className:c?H.group:H.li,id:"option-add-"+p}),f=d instanceof Object?t.getValue(h.text,d):d;if(c&&(m.innerText=f),this.itemTemplate&&!c){var v=this.templateCompiler(this.itemTemplate),g=("function"!=typeof this.itemTemplate&&v?t.compile(t.select(this.itemTemplate,document).innerHTML.trim()):t.compile(this.itemTemplate))(d,this,"itemTemplate",this.itemTemplateId,this.isStringTemplate,null,m);g&&t.append(g,m)}else c||m.appendChild(document.createTextNode(f));m.setAttribute("data-value",d instanceof Object?t.getValue(h.value,d):d),m.setAttribute("role","option"),this.notify("addItem",{module:"CheckBoxSelection",item:m}),u.push(m),"listbox"===this.getModuleName()?(this.listData.splice(a?this.listData.length:o,0,d),this.listData.length!==this.sortedData.length&&(this.sortedData=this.listData)):this.listData.push(d),"None"===this.sortOrder&&t.isNullOrUndefined(i)&&0===o&&(o=null),"listbox"===this.getModuleName()?this.updateActionCompleteData(m,d,a?null:o+p):this.updateActionCompleteData(m,d,o),this.trigger("beforeItemRender",{element:m,item:d})}if(0===n&&t.isNullOrUndefined(this.list.querySelector("ul")))t.isNullOrUndefined(this.list)||(this.list.innerHTML="",this.list.classList.remove(H.noData),this.isAddNewItemTemplate=!0,t.isNullOrUndefined(this.ulElement)||this.list.appendChild(this.ulElement)),this.liCollections=u,t.isNullOrUndefined(u)||t.isNullOrUndefined(this.ulElement)||t.append(u,this.ulElement),this.updateAddItemList(this.list,n);else{"listbox"===this.getModuleName()&&0===n&&(this.ulElement.innerHTML="");for(var y=[],p=0;p<e.length;p++){for(var C=this.ulElement.querySelectorAll(".e-list-group-item"),b=0;b<C.length;b++)y[b]=C[b].innerText;if(y.indexOf(u[p].innerText)>-1&&h.groupBy){for(b=0;b<C.length;b++)if(y[b]===u[p].innerText){"None"===this.sortOrder?this.ulElement.insertBefore(u[p+1],C[b+1]):this.ulElement.insertBefore(u[p+1],this.ulElement.childNodes[i]),p+=1;break}}else this.liCollections[o]&&this.liCollections[o].parentNode?this.liCollections[o].parentNode.insertBefore(u[p],this.liCollections[o]):i&&"listbox"===this.getModuleName()?this.ulElement.insertBefore(u[p],this.ulElement.childNodes[i+p]):this.ulElement.appendChild(u[p]);var S=[].slice.call(this.liCollections);S.splice(o,0,u[p]),this.liCollections=S,o+=1,"multiselect"===this.getModuleName()&&this.updateDataList()}}"listbox"===this.getModuleName()&&this.isReact&&this.renderReactTemplates(),(r||0===i)&&this.updateSelection(),this.addedNewItem=!0},n.prototype.isDisabledElement=function(e){return!(!e||!e.classList.contains("e-disabled"))},n.prototype.isDisabledItemByIndex=function(e){return!(!this.fields.disabled||!this.liCollections)&&this.isDisabledElement(this.liCollections[e])},n.prototype.disableListItem=function(e){e.classList.add("e-disabled"),e.setAttribute("aria-disabled","true"),e.setAttribute("aria-selected","false")},n.prototype.validationAttribute=function(e,t){var i=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");t.setAttribute("name",i),e.removeAttribute("name");for(var s=["required","aria-required","form"],l=0;l<s.length;l++)if(e.getAttribute(s[l])){var n=e.getAttribute(s[l]);t.setAttribute(s[l],n),e.removeAttribute(s[l])}},n.prototype.setZIndex=function(){},n.prototype.updateActionCompleteData=function(e,t,i){},n.prototype.updateAddItemList=function(e,t){},n.prototype.updateDataList=function(){},n.prototype.getDataByValue=function(e){if(!t.isNullOrUndefined(this.listData)){var i=this.typeOfData(this.listData).typeof;if("string"===i||"number"===i||"boolean"===i)for(var s=0,l=this.listData;s<l.length;s++){r=l[s];if(!t.isNullOrUndefined(r)&&r===e)return r}else for(var n=0,a=this.listData;n<a.length;n++){var r=a[n];if(!t.isNullOrUndefined(r)&&t.getValue(this.fields.value?this.fields.value:"value",r)===e)return r}}return null},n.prototype.destroy=function(){if(document){if(this.fields&&this.fields.groupBy)for(var i=this.getScrollableParent(),s=0;s<i.length;s++){var l=i[s];t.EventHandler.remove(l,"scroll",this.updateGroupFixedHeader)}document.body.contains(this.list)&&(t.EventHandler.remove(this.list,"scroll",this.setFloatingHeader),t.isNullOrUndefined(this.rippleFun)||this.rippleFun(),t.detach(this.list))}this.liCollections=null,this.ulElement=null,this.list=null,this.enableRtlElements=null,this.groupHeaderItems=null,this.fiteredGroupHeaderItems=null,this.rippleFun=null,e.prototype.destroy.call(this)},V([t.Complex({text:null,value:null,iconCss:null,groupBy:null,disabled:null},P)],n.prototype,"fields",void 0),V([t.Property(null)],n.prototype,"itemTemplate",void 0),V([t.Property(null)],n.prototype,"groupTemplate",void 0),V([t.Property("No records found")],n.prototype,"noRecordsTemplate",void 0),V([t.Property("Request failed")],n.prototype,"actionFailureTemplate",void 0),V([t.Property("None")],n.prototype,"sortOrder",void 0),V([t.Property([])],n.prototype,"dataSource",void 0),V([t.Property(null)],n.prototype,"query",void 0),V([t.Property("StartsWith")],n.prototype,"filterType",void 0),V([t.Property(!0)],n.prototype,"ignoreCase",void 0),V([t.Property(1e3)],n.prototype,"zIndex",void 0),V([t.Property(!1)],n.prototype,"ignoreAccent",void 0),V([t.Property()],n.prototype,"locale",void 0),V([t.Event()],n.prototype,"actionBegin",void 0),V([t.Event()],n.prototype,"actionComplete",void 0),V([t.Event()],n.prototype,"actionFailure",void 0),V([t.Event()],n.prototype,"select",void 0),V([t.Event()],n.prototype,"dataBound",void 0),V([t.Event()],n.prototype,"created",void 0),V([t.Event()],n.prototype,"destroyed",void 0),n=V([t.NotifyPropertyChanges],n)}(t.Component),F=function(){var e=function(t,i){return(e=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])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),W=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(l=e[r])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},q={root:"e-dropdownlist",hover:H.hover,selected:H.selected,rtl:H.rtl,li:H.li,disable:H.disabled,base:H.root,focus:H.focus,content:H.content,input:"e-input-group",inputFocus:"e-input-focus",icon:"e-input-group-icon e-ddl-icon",iconAnimation:"e-icon-anim",value:"e-input-value",device:"e-ddl-device",backIcon:"e-input-group-icon e-back-icon e-icons",filterBarClearIcon:"e-input-group-icon e-clear-icon e-icons",filterInput:"e-input-filter",resizeIcon:"e-resizer-right e-icons",filterParent:"e-filter-parent",mobileFilter:"e-ddl-device-filter",footer:"e-ddl-footer",header:"e-ddl-header",clearIcon:"e-clear-icon",clearIconHide:"e-clear-icon-hide",popupFullScreen:"e-popup-full-page",disableIcon:"e-ddl-disable-icon",hiddenElement:"e-ddl-hidden",virtualList:"e-list-item e-virtual-list"},M={container:null,buttons:[]},j=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.isListSearched=!1,s.preventChange=!1,s.isTouched=!1,s.isFocused=!1,s.autoFill=!1,s.isUpdateHeaderHeight=!1,s.isUpdateFooterHeight=!1,s.isReactTemplateUpdate=!1,s}return F(s,e),s.prototype.preRender=function(){this.valueTempElement=null,this.element.style.opacity="0",this.initializeData(),e.prototype.preRender.call(this),this.activeIndex=this.index,this.queryString=""},s.prototype.initializeData=function(){this.isPopupOpen=!1,this.isDocumentClick=!1,this.isPopupRender=!1,this.isInteracted=!1,this.isFilterFocus=!1,this.beforePopupOpen=!1,this.initial=!0,this.initialRemoteRender=!1,this.isNotSearchList=!1,this.isTyped=!1,this.isSelected=!1,this.preventFocus=!1,this.preventAutoFill=!1,this.isValidKey=!1,this.typedString="",this.isEscapeKey=!1,this.isPreventBlur=!1,this.isTabKey=!1,this.actionCompleteData={isUpdated:!1},this.actionData={isUpdated:!1},this.prevSelectPoints={},this.isSelectCustom=!1,this.isDropDownClick=!1,this.preventAltUp=!1,this.isCustomFilter=!1,this.isSecondClick=!1,this.previousValue=null,this.keyConfigure={tab:"tab",enter:"13",escape:"27",end:"35",home:"36",down:"40",up:"38",pageUp:"33",pageDown:"34",open:"alt+40",close:"shift+tab",hide:"alt+38",space:"32"},this.viewPortInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount}},s.prototype.setZIndex=function(){this.popupObj&&this.popupObj.setProperties({zIndex:this.zIndex})},s.prototype.requiredModules=function(){var e=[];return this.enableVirtualization&&e.push({args:[this],member:"VirtualScroll"}),e},s.prototype.renderList=function(t,s){e.prototype.render.call(this,t,s),this.dataSource instanceof i.DataManager||(this.totalItemCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0),this.enableVirtualization&&this.isFiltering()&&"combobox"===this.getModuleName()&&(this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+H.li),this.ulElement=this.list.querySelector("ul")),this.unWireListEvents(),this.wireListEvents()},s.prototype.floatLabelChange=function(){if("dropdownlist"===this.getModuleName()&&"Auto"===this.floatLabelType){var e=this.inputWrapper.container.querySelector(".e-float-text");e&&""!==this.inputElement.value||this.isInteracted?t.classList(e,["e-label-top"],["e-label-bottom"]):e&&t.classList(e,["e-label-bottom"],["e-label-top"])}},s.prototype.resetHandler=function(e){e.preventDefault(),this.clearAll(e),this.enableVirtualization&&(this.list.scrollTop=0,this.virtualListInfo=null,this.previousStartIndex=0,this.previousEndIndex=0)},s.prototype.resetFocusElement=function(){if(this.removeHover(),this.removeSelection(),this.removeFocus(),this.list.scrollTop=0,"autocomplete"!==this.getModuleName()&&!t.isNullOrUndefined(this.ulElement)){var e=this.fields.disabled?this.ulElement.querySelector("."+q.li+":not(.e-disabled)"):this.ulElement.querySelector("."+q.li);this.enableVirtualization&&(e=this.liCollections[this.skeletonCount]),e&&e.classList.add(q.focus)}},s.prototype.clearAll=function(e,s){this.previousItemData=t.isNullOrUndefined(this.itemData)?null:this.itemData,!t.isNullOrUndefined(s)&&(t.isNullOrUndefined(s)||!t.isNullOrUndefined(s.dataSource)&&(s.dataSource instanceof i.DataManager||0!==s.dataSource.length))||(this.isActive=!0,this.resetSelection(s));var l=this.getItemData();if(!this.allowObjectBinding&&this.previousValue===l.value||this.allowObjectBinding&&this.previousValue&&this.isObjectInArray(this.previousValue,[this.allowCustom?this.value?this.value:l:l.value?this.getDataByValue(l.value):l]))return this.checkAndResetCache(),void(this.enableVirtualization&&this.list&&this.updateInitialData());this.onChangeEvent(e),this.checkAndResetCache(),this.enableVirtualization&&this.updateInitialData()},s.prototype.resetSelection=function(e){this.list&&(t.isNullOrUndefined(e)||!t.isNullOrUndefined(e.dataSource)&&(e.dataSource instanceof i.DataManager||0!==e.dataSource.length)?(this.allowFiltering&&"autocomplete"!==this.getModuleName()&&!t.isNullOrUndefined(this.actionCompleteData.ulElement)&&!t.isNullOrUndefined(this.actionCompleteData.list)&&this.actionCompleteData.list.length>0&&this.onActionComplete(this.actionCompleteData.ulElement.cloneNode(!0),this.actionCompleteData.list),this.resetFocusElement()):(this.selectedLI=null,this.actionCompleteData.isUpdated=!1,this.actionCompleteData.ulElement=null,this.actionCompleteData.list=null,this.resetList(e.dataSource))),t.isNullOrUndefined(this.hiddenElement)||(this.hiddenElement.innerHTML=""),t.isNullOrUndefined(this.inputElement)||(this.inputElement.value=""),this.value=null,this.itemData=null,this.text=null,this.index=null,this.activeIndex=null,this.item=null,this.queryString="",this.valueTempElement&&(t.detach(this.valueTempElement),this.inputElement.style.display="block",this.valueTempElement=null),this.setSelection(null,null),this.isSelectCustom=!1,this.updateIconState(),this.cloneElements()},s.prototype.setHTMLAttributes=function(){if(Object.keys(this.htmlAttributes).length)for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if("class"===s){var l=this.htmlAttributes[""+s].replace(/\s+/g," ").trim();""!==l&&t.addClass([this.inputWrapper.container],l.split(" "))}else if("disabled"===s&&"disabled"===this.htmlAttributes[""+s])this.enabled=!1,this.setEnable();else if("readonly"!==s||t.isNullOrUndefined(this.htmlAttributes[""+s]))if("style"===s)this.inputWrapper.container.setAttribute("style",this.htmlAttributes[""+s]);else if("aria-label"===s)"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.readonly?"dropdownlist"===this.getModuleName()&&this.inputWrapper.container.setAttribute("aria-label",this.htmlAttributes[""+s]):this.inputElement.setAttribute("aria-label",this.htmlAttributes[""+s]);else{var n=["title","id","placeholder","role","autocomplete","autocapitalize","spellcheck","minlength","maxlength"],r=["name","required"];"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||n.push("tabindex"),r.indexOf(s)>-1||0===s.indexOf("data")?this.hiddenElement.setAttribute(s,this.htmlAttributes[""+s]):n.indexOf(s)>-1?"placeholder"===s&&this.element.getAttribute("placeholder")!==this.htmlAttributes[""+s]?a.Input.setPlaceholder(this.htmlAttributes[""+s],this.inputElement):"placeholder"!==s&&this.inputElement.setAttribute(s,this.htmlAttributes[""+s]):this.inputWrapper.container.setAttribute(s,this.htmlAttributes[""+s])}else this.readonly=!0,this.dataBind()}"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.inputWrapper.container.removeAttribute("tabindex")},s.prototype.getAriaAttributes=function(){return{"aria-disabled":"false",role:"combobox","aria-expanded":"false","aria-live":"polite","aria-labelledby":this.hiddenElement.id}},s.prototype.setEnableRtl=function(){t.isNullOrUndefined(this.inputElement)||t.isNullOrUndefined(this.inputElement.parentElement)||a.Input.setEnableRtl(this.enableRtl,[this.inputElement.parentElement]),this.popupObj&&(this.popupObj.enableRtl=this.enableRtl,this.popupObj.dataBind())},s.prototype.setEnable=function(){a.Input.setEnabled(this.enabled,this.inputElement),this.enabled?(t.removeClass([this.inputWrapper.container],q.disable),this.inputElement.setAttribute("aria-disabled","false"),this.targetElement().setAttribute("tabindex",this.tabIndex),this.inputWrapper&&this.inputWrapper.container&&(this.inputWrapper.container.setAttribute("aria-disabled","false"),this.inputWrapper.container.removeAttribute("disabled"))):(this.hidePopup(),t.addClass([this.inputWrapper.container],q.disable),this.inputElement.setAttribute("aria-disabled","true"),this.targetElement().tabIndex=-1,this.inputWrapper&&this.inputWrapper.container&&(this.inputWrapper.container.setAttribute("aria-disabled","true"),this.inputWrapper.container.setAttribute("disabled","")))},s.prototype.getPersistData=function(){return this.addOnPersist(["value"])},s.prototype.getLocaleName=function(){return"drop-down-list"},s.prototype.preventTabIndex=function(e){"dropdownlist"===this.getModuleName()&&(e.tabIndex=-1)},s.prototype.targetElement=function(){return t.isNullOrUndefined(this.inputWrapper)?null:this.inputWrapper.container},s.prototype.getNgDirective=function(){return"EJS-DROPDOWNLIST"},s.prototype.getElementByText=function(e){return this.getElementByValue(this.getValueByText(e))},s.prototype.getElementByValue=function(e){for(var t,i=0,s=this.getItems();i<s.length;i++){var l=s[i];if(this.getFormattedValue(l.getAttribute("data-value"))===e){t=l;break}}return t},s.prototype.initValue=function(){this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=this.itemCount,this.renderList(),this.dataSource instanceof i.DataManager?this.initialRemoteRender=!0:this.updateValues()},s.prototype.isDisableItemValue=function(e){if("object"==typeof e){var t=JSON.parse(JSON.stringify(e))[this.fields.value];return this.isDisabledItemByIndex(this.getIndexByValue(t))}return this.isDisabledItemByIndex(this.getIndexByValue(e))},s.prototype.updateValues=function(){if(this.fields.disabled&&(null!=this.value&&(this.value=this.isDisableItemValue(this.value)?null:this.value),null!=this.text&&(this.text=this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text)))?null:this.text),null!=this.index&&(this.index=this.isDisabledItemByIndex(this.index)?null:this.index,this.activeIndex=this.index)),this.selectedValueInfo=this.viewPortInfo,t.isNullOrUndefined(this.value))if(this.text&&t.isNullOrUndefined(this.value)){var e=this.getElementByText(this.text);if(t.isNullOrUndefined(e))return void this.setProperties({text:null});this.setSelection(e,null)}else this.setSelection(this.liCollections[this.activeIndex],null);else{var i=this.allowObjectBinding&&!t.isNullOrUndefined(this.value)?t.getValue(this.fields.value?this.fields.value:"",this.value):this.value;this.setSelection(this.getElementByValue(i),null)}this.setHiddenValue(),a.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton)},s.prototype.onBlurHandler=function(e){if(this.enabled){var i=e.relatedTarget,s=e.target,l=this.isPreventBlur;if(this.isPreventBlur=!1,l&&!this.isDocumentClick&&this.isPopupOpen&&(!t.isNullOrUndefined(s)||!this.isFilterLayout()&&t.isNullOrUndefined(i)))return void("dropdownlist"===this.getModuleName()&&this.allowFiltering&&this.isPopupOpen?this.filterInput.focus():this.targetElement().focus());if(this.isDocumentClick||!t.isNullOrUndefined(this.popupObj)&&document.body.contains(this.popupObj.element)&&this.popupObj.element.classList.contains(q.mobileFilter))return void(this.beforePopupOpen||(this.isDocumentClick=!1));("dropdownlist"===this.getModuleName()&&!this.isFilterFocus&&i!==this.inputElement&&(document.activeElement!==i||document.activeElement===i&&s.classList.contains(q.inputFocus))||t.isNullOrUndefined(i)&&"dropdownlist"===this.getModuleName()&&this.allowFiltering&&s!==this.inputWrapper.container||"dropdownlist"!==this.getModuleName()&&!this.inputWrapper.container.contains(i)||this.isTabKey)&&(this.isDocumentClick=!!this.isPopupOpen,this.focusOutAction(e),this.isTabKey=!1),!this.isRequested||this.isPopupOpen||this.isPreventBlur||(this.isActive=!1,this.beforePopupOpen=!1),this.isFocused=!1}},s.prototype.focusOutAction=function(e){this.isInteracted=!1,this.focusOut(e),this.onFocusOut(e)},s.prototype.onFocusOut=function(e){this.enabled&&(this.isSelected&&(this.isSelectCustom=!1,this.onChangeEvent(e)),this.floatLabelChange(),this.dispatchEvent(this.hiddenElement,"change"),"dropdownlist"===this.getModuleName()&&"INPUT"!==this.element.tagName&&this.dispatchEvent(this.inputElement,"blur"),this.inputWrapper.clearButton&&t.addClass([this.inputWrapper.clearButton],q.clearIconHide),this.trigger("blur"))},s.prototype.onFocus=function(e){if(!this.isInteracted){this.isInteracted=!0;var t={isInteracted:!!e,event:e};this.trigger("focus",t)}this.updateIconState(),this.isFocused=!0},s.prototype.resizingWireEvent=function(){t.EventHandler.add(document,"mousemove",this.resizePopup,this),t.EventHandler.add(document,"mouseup",this.stopResizing,this),t.EventHandler.add(document,"touchmove",this.resizePopup,this),t.EventHandler.add(document,"touchend",this.stopResizing,this)},s.prototype.resizingUnWireEvent=function(){t.EventHandler.remove(document,"mousemove",this.resizePopup),t.EventHandler.remove(document,"mouseup",this.stopResizing),t.EventHandler.remove(document,"touchmove",this.resizePopup),t.EventHandler.remove(document,"touchend",this.stopResizing)},s.prototype.resetValueHandler=function(e){var i=t.closest(this.inputElement,"form");if(i&&e.target===i){var s=this.element.tagName===this.getNgDirective()?null:this.inputElement.getAttribute("value");this.text=s}},s.prototype.wireEvent=function(){t.EventHandler.add(this.inputWrapper.container,"mousedown",this.dropDownClick,this),t.EventHandler.add(this.inputWrapper.container,"focus",this.focusIn,this),t.EventHandler.add(this.inputWrapper.container,"keypress",this.onSearch,this),t.EventHandler.add(window,"resize",this.windowResize,this),this.bindCommonEvent()},s.prototype.bindCommonEvent=function(){t.EventHandler.add(this.targetElement(),"blur",this.onBlurHandler,this);var e=t.closest(this.inputElement,"form");e&&t.EventHandler.add(e,"reset",this.resetValueHandler,this),t.Browser.isDevice?this.keyboardModule=new t.KeyboardEvents(this.targetElement(),{keyAction:this.mobileKeyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}):this.keyboardModule=new t.KeyboardEvents(this.targetElement(),{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}),this.bindClearEvent()},s.prototype.windowResize=function(){this.isPopupOpen&&this.popupObj.refreshPosition(this.inputWrapper.container)},s.prototype.bindClearEvent=function(){this.showClearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this)},s.prototype.unBindCommonEvent=function(){!t.isNullOrUndefined(this.inputWrapper)&&this.targetElement()&&t.EventHandler.remove(this.targetElement(),"blur",this.onBlurHandler);var e=this.inputElement&&t.closest(this.inputElement,"form");e&&t.EventHandler.remove(e,"reset",this.resetValueHandler),t.Browser.isDevice||this.keyboardModule.destroy(),this.showClearButton&&t.EventHandler.remove(this.inputWrapper.clearButton,"mousedown",this.resetHandler)},s.prototype.updateIconState=function(){this.showClearButton&&(""===this.inputElement.value||this.readonly?t.addClass([this.inputWrapper.clearButton],q.clearIconHide):t.removeClass([this.inputWrapper.clearButton],q.clearIconHide))},s.prototype.wireListEvents=function(){t.isNullOrUndefined(this.list)||(t.EventHandler.add(this.list,"click",this.onMouseClick,this),t.EventHandler.add(this.list,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.list,"mouseout",this.onMouseLeave,this))},s.prototype.onSearch=function(e){32!==e.charCode&&13!==e.charCode&&(void 0===this.list&&this.renderList(),this.searchKeyEvent=e,this.onServerIncrementalSearch(e))},s.prototype.onServerIncrementalSearch=function(e){this.isRequested||t.isNullOrUndefined(this.list)||t.isNullOrUndefined(this.list.querySelector("li"))||!this.enabled||this.readonly||this.incrementalSearch(e)},s.prototype.startResizing=function(e){this.isResizing=!0,this.trigger("resizeStart",e);var t=e instanceof MouseEvent?e.clientX:e.touches[0].clientX,i=e instanceof MouseEvent?e.clientY:e.touches[0].clientY;this.list&&this.list.parentElement&&(this.originalWidth=this.list.parentElement.offsetWidth,this.originalHeight=this.list.parentElement.offsetHeight,this.originalMouseX=t,this.originalMouseY=i),this.resizingWireEvent(),e&&e.preventDefault()},s.prototype.resizePopup=function(e){if(this.isResizing){this.trigger("resizing",e);var t=e instanceof MouseEvent?e.clientX:e.touches[0].clientX,i=e instanceof MouseEvent?e.clientY:e.touches[0].clientY,s=t-this.originalMouseX,l=i-this.originalMouseY;if(this.list&&this.list.parentElement){var n=parseInt(window.getComputedStyle(this.list.parentElement).minWidth,10),a=parseInt(window.getComputedStyle(this.list.parentElement).minHeight,10);n=n||100,a=a||120,this.resizeWidth=Math.max(this.originalWidth+s,n),this.resizeHeight=Math.max(this.originalHeight+l,a),this.list.parentElement.style.width=this.resizeWidth+"px",this.list.parentElement.style.height=this.resizeHeight+"px",this.list.parentElement.style.maxHeight=this.resizeHeight+"px",this.list.style.maxHeight=this.resizeHeight+"px",this.fixedHeaderElement&&this.ulElement&&(this.fixedHeaderElement.style.width=this.ulElement.offsetWidth+"px")}e&&e.preventDefault()}},s.prototype.stopResizing=function(e){this.isResizing&&(this.isResizing=!1,this.trigger("resizeStop",e),this.resizingUnWireEvent()),e&&e.preventDefault()},s.prototype.onMouseClick=function(e){var i=e.target;this.keyboardEvent=null;var s=t.closest(i,"."+H.li);if(this.isValidLI(s)&&!this.isDisabledElement(s))if(this.setSelection(s,e),t.Browser.isDevice&&this.isFilterLayout())history.back();else{this.closePopup(100,e)}},s.prototype.onMouseOver=function(e){var i=t.closest(e.target,"."+H.li);this.setHover(i)},s.prototype.setHover=function(e){this.enabled&&this.isValidLI(e)&&!e.classList.contains(H.hover)&&(this.removeHover(),t.addClass([e],H.hover))},s.prototype.onMouseLeave=function(){this.removeHover()},s.prototype.removeHover=function(){if(this.list){var e=this.list.querySelectorAll("."+H.hover);e&&e.length&&t.removeClass(e,H.hover)}},s.prototype.isValidLI=function(e){return e&&e.hasAttribute("role")&&"option"===e.getAttribute("role")},s.prototype.updateIncrementalItemIndex=function(e,t){this.incrementalStartIndex=e,this.incrementalEndIndex=t},s.prototype.incrementalSearch=function(e){if(this.liCollections.length>0)if(this.enableVirtualization){var i=!1,s=!1,l=this.ulElement.getElementsByClassName("e-active")[0],n=l?l.textContent:null;""===this.incrementalQueryString?(this.incrementalQueryString=String.fromCharCode(e.charCode),this.incrementalPreQueryString=this.incrementalQueryString):String.fromCharCode(e.charCode).toLocaleLowerCase()===this.incrementalPreQueryString.toLocaleLowerCase()?s=!0:this.incrementalQueryString=String.fromCharCode(e.charCode),(this.viewPortInfo.endIndex>=this.incrementalEndIndex&&this.incrementalEndIndex<=this.totalItemCount||0===this.incrementalEndIndex)&&(i=!0,this.incrementalStartIndex=this.incrementalEndIndex,0===this.incrementalEndIndex?this.incrementalEndIndex=100>this.totalItemCount?this.totalItemCount:100:this.incrementalEndIndex=this.incrementalEndIndex+100>this.totalItemCount?this.totalItemCount:this.incrementalEndIndex+100,this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),i=!0),(0!==this.viewPortInfo.startIndex||i)&&this.updateIncrementalView(0,this.itemCount);for(d=h(e.charCode,this.incrementalLiCollections,this.activeIndex,!0,this.element.id,s,n,!0);t.isNullOrUndefined(d)&&this.incrementalEndIndex<this.totalItemCount&&(this.updateIncrementalItemIndex(this.incrementalEndIndex,this.incrementalEndIndex+100>this.totalItemCount?this.totalItemCount:this.incrementalEndIndex+100),this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),i=!0,(0!==this.viewPortInfo.startIndex||i)&&this.updateIncrementalView(0,this.itemCount),d=h(e.charCode,this.incrementalLiCollections,0,!0,this.element.id,s,n,!0,!0),t.isNullOrUndefined(d));)if(t.isNullOrUndefined(d)&&this.incrementalEndIndex>=this.totalItemCount){this.updateIncrementalItemIndex(0,100>this.totalItemCount?this.totalItemCount:100);break}t.isNullOrUndefined(d)&&this.incrementalEndIndex>=this.totalItemCount&&(this.updateIncrementalItemIndex(0,100>this.totalItemCount?this.totalItemCount:100),this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),i=!0,(0!==this.viewPortInfo.startIndex||i)&&this.updateIncrementalView(0,this.itemCount),d=h(e.charCode,this.incrementalLiCollections,0,!0,this.element.id,s,n,!0,!0));var a=d&&this.getIndexByValue(d.getAttribute("data-value"));if(a)a-=this.skeletonCount;else for(var r=0;r<this.incrementalLiCollections.length;r++)if(!t.isNullOrUndefined(d)&&!t.isNullOrUndefined(d.getAttribute("data-value"))&&this.incrementalLiCollections[r].getAttribute("data-value")===d.getAttribute("data-value").toString()){a=r,a=this.incrementalStartIndex+a;break}if(a&&!(this.viewPortInfo.startIndex>=a&&a>=this.viewPortInfo.endIndex)){var o=a-(this.itemCount/2-2)>0?a-(this.itemCount/2-2):0,u=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount;this.updateIncrementalView(o,u)}if(t.isNullOrUndefined(d))this.updateIncrementalView(0,this.itemCount),this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.list.scrollTop=0;else{if(this.getIndexByValue(d.getAttribute("data-value"))-this.skeletonCount>this.itemCount/2){var o=this.viewPortInfo.startIndex+(this.itemCount/2-2)<this.totalItemCount?this.viewPortInfo.startIndex+(this.itemCount/2-2):this.totalItemCount,u=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount;this.updateIncrementalView(o,u)}if(d=this.getElementByValue(d.getAttribute("data-value")),this.setSelection(d,e),this.setScrollPosition(),this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.enableVirtualization&&!this.fields.groupBy){var p=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*this.selectedLI.offsetHeight:this.selectedLI.offsetTop;this.list.scrollTop=p-this.list.querySelectorAll(".e-virtual-list").length*this.selectedLI.offsetHeight}this.incrementalPreQueryString=this.incrementalQueryString}}else{var d=void 0;if(this.fields.disabled){var c=this.list.querySelectorAll("."+H.li+":not(.e-disabled)");d=h(e.charCode,c,this.activeIndex,!0,this.element.id)}else d=h(e.charCode,this.liCollections,this.activeIndex,!0,this.element.id);t.isNullOrUndefined(d)||(this.setSelection(d,e),this.setScrollPosition())}},s.prototype.hideSpinner=function(){t.isNullOrUndefined(this.spinnerElement)||(n.hideSpinner(this.spinnerElement),t.removeClass([this.spinnerElement],q.disableIcon),this.spinnerElement.innerHTML="",this.spinnerElement=null)},s.prototype.showSpinner=function(){t.isNullOrUndefined(this.spinnerElement)&&(this.spinnerElement=t.Browser.isDevice&&!t.isNullOrUndefined(this.filterInputObj)&&this.filterInputObj.buttons[1]||!t.isNullOrUndefined(this.filterInputObj)&&this.filterInputObj.buttons[0]||this.inputWrapper.buttons[0],t.addClass([this.spinnerElement],q.disableIcon),n.createSpinner({target:this.spinnerElement,width:t.Browser.isDevice?"16px":"14px"},this.createElement),n.showSpinner(this.spinnerElement))},s.prototype.keyActionHandler=function(e){if(this.enabled){this.keyboardEvent=e,this.isPreventKeyAction&&this.enableVirtualization&&e.preventDefault();var i="pageUp"===e.action||"pageDown"===e.action,s="dropdownlist"!==this.getModuleName()&&("home"===e.action||"end"===e.action);this.isEscapeKey="escape"===e.action,this.isTabKey=!this.isPopupOpen&&"tab"===e.action;var l="down"===e.action||"up"===e.action||"pageUp"===e.action||"pageDown"===e.action||"home"===e.action||"end"===e.action;if((!(this.isEditTextBox()||i||s)||this.isPopupOpen)&&!this.readonly){var n="tab"===e.action||"close"===e.action;if(!t.isNullOrUndefined(this.list)||this.isRequested||n||"escape"===e.action||(this.searchKeyEvent=e,this.enableVirtualization&&(!this.enableVirtualization||"autocomplete"===this.getModuleName()||"mousedown"===e.type||40!==e.keyCode&&38!==e.keyCode)||(this.renderList(e),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+H.li),this.ulElement=this.list.querySelector("ul"))),t.isNullOrUndefined(this.list)||!t.isNullOrUndefined(this.liCollections)&&l&&0===this.liCollections.length||this.isRequested)return;switch((n&&"autocomplete"!==this.getModuleName()&&this.isPopupOpen||"escape"===e.action)&&e.preventDefault(),this.isSelected="escape"!==e.action&&this.isSelected,this.isTyped=!l&&"escape"!==e.action&&this.isTyped,e.action){case"down":case"up":this.updateUpDownAction(e);break;case"pageUp":this.pageUpSelection(this.activeIndex-this.getPageCount(),e),e.preventDefault();break;case"pageDown":this.pageDownSelection(this.activeIndex+this.getPageCount(),e),e.preventDefault();break;case"home":case"end":this.isMouseScrollAction=!0,this.updateHomeEndAction(e);break;case"space":"dropdownlist"===this.getModuleName()&&(this.beforePopupOpen||(this.showPopup(),e.preventDefault()));break;case"open":this.showPopup(e);break;case"hide":this.preventAltUp=this.isPopupOpen,this.hidePopup(e),this.focusDropDown(e);break;case"enter":this.selectCurrentItem(e);break;case"tab":this.selectCurrentValueOnTab(e);break;case"escape":case"close":this.isPopupOpen&&(this.hidePopup(e),this.focusDropDown(e))}}}},s.prototype.updateUpDownAction=function(e,i){if(!this.fields.disabled||!this.list||0!==this.list.querySelectorAll(".e-list-item:not(.e-disabled)").length){if(this.allowFiltering&&!this.enableVirtualization&&"autocomplete"!==this.getModuleName()){o=this.getItemData().value;t.isNullOrUndefined(o)&&(o="null");d=this.getIndexByValue(o);t.isNullOrUndefined(d)||(this.activeIndex=d)}var s=this.list.querySelector("."+q.focus);if(this.isSelectFocusItem(s)&&!i){if(this.setSelection(s,e),this.enableVirtualization){p=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*this.selectedLI.offsetHeight:this.selectedLI.offsetTop;this.fields.groupBy&&(p=this.virtualListInfo&&0===this.virtualListInfo.startIndex?this.selectedLI.offsetHeight-p:p-this.selectedLI.offsetHeight),this.list.scrollTop=p-this.list.querySelectorAll(".e-virtual-list").length*this.selectedLI.offsetHeight}}else if(!t.isNullOrUndefined(this.liCollections)){var l=this.activeIndex,n="down"===e.action?this.activeIndex+1:this.activeIndex-1;n=i?l:n;var a=0;"autocomplete"===this.getModuleName()&&(a="down"===e.action&&t.isNullOrUndefined(this.activeIndex)?0:this.liCollections.length-1,n=n<0?this.liCollections.length-1:n===this.liCollections.length?0:n);var r=void 0;if("autocomplete"!==this.getModuleName()||"autocomplete"===this.getModuleName()&&this.isPopupOpen)if(this.enableVirtualization)if(i)if("autocomplete"===this.getModuleName()){o=this.getFormattedValue(this.selectedLI.getAttribute("data-value"));r=this.getElementByValue(o)}else r=this.getElementByValue(this.getItemData().value);else r=t.isNullOrUndefined(this.activeIndex)?this.liCollections[this.skeletonCount]:this.liCollections[n],r=t.isNullOrUndefined(r)||r.classList.contains("e-virtual-list")?null:r;else r=t.isNullOrUndefined(this.activeIndex)?this.liCollections[a]:this.liCollections[n];if(t.isNullOrUndefined(r)){if(this.enableVirtualization&&!this.isPopupOpen&&"autocomplete"!==this.getModuleName()&&(this.viewPortInfo.endIndex!==this.totalItemCount&&"down"===e.action||0!==this.viewPortInfo.startIndex&&"up"===e.action)){if("down"===e.action){this.viewPortInfo.startIndex=this.viewPortInfo.startIndex+this.itemCount<this.totalItemCount-this.itemCount?this.viewPortInfo.startIndex+this.itemCount:this.totalItemCount-this.itemCount,this.viewPortInfo.endIndex=this.viewPortInfo.startIndex+this.itemCount,this.updateVirtualItemIndex(),this.isCustomFilter="combobox"===this.getModuleName()||this.isCustomFilter,this.resetList(this.dataSource,this.fields,this.query),this.isCustomFilter="combobox"!==this.getModuleName()&&this.isCustomFilter;o="null"!==this.liCollections[0].getAttribute("data-value")?this.getFormattedValue(this.liCollections[0].getAttribute("data-value")):null;(h=this.getDataByValue(o))&&(this.itemData=h)}else if("up"===e.action){this.viewPortInfo.startIndex=this.viewPortInfo.startIndex-this.itemCount>0?this.viewPortInfo.startIndex-this.itemCount:0,this.viewPortInfo.endIndex=this.viewPortInfo.startIndex+this.itemCount,this.updateVirtualItemIndex(),this.isCustomFilter="combobox"===this.getModuleName()||this.isCustomFilter,this.resetList(this.dataSource,this.fields,this.query),this.isCustomFilter="combobox"!==this.getModuleName()&&this.isCustomFilter;var o="null"!==this.liCollections[this.liCollections.length-1].getAttribute("data-value")?this.getFormattedValue(this.liCollections[this.liCollections.length-1].getAttribute("data-value")):null,h=this.getDataByValue(o);h&&(this.itemData=h)}this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+H.li),this.ulElement=this.list.querySelector("ul"),this.handleVirtualKeyboardActions(e,this.pageCount)}}else{var u=this.liCollections[this.skeletonCount]&&this.liCollections[this.skeletonCount].classList.contains("e-item-focus");if(this.setSelection(r,e),u&&this.enableVirtualization&&"autocomplete"===this.getModuleName()&&!i){var p=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*this.selectedLI.offsetHeight:this.selectedLI.offsetTop;p=this.virtualListInfo&&0===this.virtualListInfo.startIndex&&this.fields.groupBy?this.selectedLI.offsetHeight-p:p-this.selectedLI.offsetHeight,this.list.scrollTop=p-this.list.querySelectorAll(".e-virtual-list").length*this.selectedLI.offsetHeight}}}if(this.allowFiltering&&!this.enableVirtualization&&"autocomplete"!==this.getModuleName()){var o=this.getItemData().value,d=this.getIndexByValueFilter(o,this.actionCompleteData.ulElement);t.isNullOrUndefined(d)||(this.activeIndex=d)}this.allowFiltering&&"dropdownlist"===this.getModuleName()&&this.filterInput&&(t.isNullOrUndefined(this.ulElement)||t.isNullOrUndefined(this.ulElement.getElementsByClassName("e-item-focus")[0])?t.isNullOrUndefined(this.ulElement)||t.isNullOrUndefined(this.ulElement.getElementsByClassName("e-active")[0])||t.attributes(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-active")[0].id}):t.attributes(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}));for(var c,n=0;n<this.liCollections.length;n++)if(this.liCollections[n].classList.contains(q.focus)||this.liCollections[n].classList.contains(q.selected)){c=n;break}null!=c&&this.isDisabledElement(this.liCollections[c])&&("autocomplete"!==this.getModuleName()&&(this.liCollections.length-1===c&&"down"===e.action&&(e.action="up"),0===c&&"up"===e.action&&(e.action="down")),this.updateUpDownAction(e)),e.preventDefault()}},s.prototype.updateHomeEndAction=function(e,t){if("dropdownlist"===this.getModuleName()){var i=0;if("home"===e.action?(i=0,this.enableVirtualization&&this.isPopupOpen?i=this.skeletonCount:this.enableVirtualization&&!this.isPopupOpen&&0!==this.viewPortInfo.startIndex&&(this.viewPortInfo.startIndex=0,this.viewPortInfo.endIndex=this.itemCount,this.updateVirtualItemIndex(),this.resetList(this.dataSource,this.fields,this.query))):(this.enableVirtualization&&!this.isPopupOpen&&this.viewPortInfo.endIndex!==this.totalItemCount&&(this.viewPortInfo.startIndex=this.totalItemCount-this.itemCount,this.viewPortInfo.endIndex=this.totalItemCount,this.updateVirtualItemIndex(),this.resetList(this.dataSource,this.fields,this.query)),i=this.getItems().length-1),e.preventDefault(),this.activeIndex===i)return void(t&&this.setSelection(this.liCollections[i],e));if(!this.enableVirtualization&&this.liCollections[i]&&this.liCollections[i].classList.contains("e-disabled"))return;this.setSelection(this.liCollections[i],e)}},s.prototype.selectCurrentValueOnTab=function(e){"autocomplete"===this.getModuleName()?this.selectCurrentItem(e):this.isPopupOpen&&(this.hidePopup(e),this.focusDropDown(e))},s.prototype.mobileKeyActionHandler=function(e){if(this.enabled&&(!this.isEditTextBox()||this.isPopupOpen)&&!this.readonly){if(void 0!==this.list||this.isRequested||(this.searchKeyEvent=e,this.renderList()),t.isNullOrUndefined(this.list)||!t.isNullOrUndefined(this.liCollections)&&0===this.liCollections.length||this.isRequested)return;"enter"===e.action&&this.selectCurrentItem(e)}},s.prototype.handleVirtualKeyboardActions=function(e,i){switch(e.action){case"down":case"up":null==this.itemData&&"autocomplete"!==this.getModuleName()||this.updateUpDownAction(e,!0);break;case"pageUp":this.activeIndex="autocomplete"===this.getModuleName()?this.getIndexByValue(this.selectedLI.getAttribute("data-value"))+this.getPageCount()-1:this.getIndexByValue(this.previousValue),this.pageUpSelection(this.activeIndex-this.getPageCount(),e,!0),e.preventDefault();break;case"pageDown":this.activeIndex="autocomplete"===this.getModuleName()?this.getIndexByValue(this.selectedLI.getAttribute("data-value"))-this.getPageCount():this.getIndexByValue(this.previousValue),this.pageDownSelection(t.isNullOrUndefined(this.activeIndex)?2*this.getPageCount():this.activeIndex+this.getPageCount(),e,!0),e.preventDefault();break;case"home":case"end":this.isMouseScrollAction=!0,this.updateHomeEndAction(e,!0)}this.keyboardEvent=null},s.prototype.selectCurrentItem=function(e){if(this.isPopupOpen){var t=this.list.querySelector("."+q.focus);if(this.isDisabledElement(t))return;t&&(this.setSelection(t,e),this.isTyped=!1),this.isSelected&&(this.isSelectCustom=!1,this.onChangeEvent(e)),this.hidePopup(e),this.focusDropDown(e)}else this.showPopup()},s.prototype.isSelectFocusItem=function(e){return!t.isNullOrUndefined(e)},s.prototype.pageUpSelection=function(e,i,s){var l=e>=0?this.liCollections[e+1]:this.liCollections[0];if(!this.enableVirtualization&&l&&l.classList.contains("e-disabled"))for(var n=e>=0?e+1:0;n<this.liCollections.length&&(!(l=this.liCollections[n])||l.classList.contains("e-disabled"));)if(--n<0)return;this.enableVirtualization&&null==this.activeIndex&&(l=this.liCollections.length>=e&&e>=0?this.liCollections[e+this.skeletonCount+1]:this.liCollections[0]),!t.isNullOrUndefined(l)&&l.classList.contains("e-virtual-list")&&(l=this.liCollections[this.skeletonCount]),this.PageUpDownSelection(l,i),this.allowFiltering&&"dropdownlist"===this.getModuleName()&&(t.isNullOrUndefined(this.ulElement)||t.isNullOrUndefined(this.ulElement.getElementsByClassName("e-item-focus")[0])?t.isNullOrUndefined(this.ulElement)||t.isNullOrUndefined(this.ulElement.getElementsByClassName("e-active")[0])||t.attributes(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-active")[0].id}):t.attributes(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}))},s.prototype.PageUpDownSelection=function(e,i){this.enableVirtualization?t.isNullOrUndefined(e)||("autocomplete"===this.getModuleName()||e.classList.contains("e-active"))&&("autocomplete"!==this.getModuleName()||e.classList.contains("e-item-focus"))||this.setSelection(e,i):this.setSelection(e,i)},s.prototype.pageDownSelection=function(e,i,s){var l=this.getItems(),n=e<=l.length?this.liCollections[e-1]:this.liCollections[l.length-1];if(!this.enableVirtualization&&n&&n.classList.contains("e-disabled"))for(;e>=0&&e<this.liCollections.length&&(!(n=e<=l.length?this.liCollections[e-1]:this.liCollections[l.length-1])||n.classList.contains("e-disabled"));)e++;this.enableVirtualization&&this.skeletonCount>0&&(n=(e="dropdownlist"===this.getModuleName()&&this.allowFiltering?e+1:e)<l.length?this.liCollections[e]:this.liCollections[l.length-1]),this.enableVirtualization&&null==this.activeIndex&&(n=e<=l.length?this.liCollections[e+this.skeletonCount-1]:this.liCollections[l.length-1]),this.PageUpDownSelection(n,i),this.allowFiltering&&"dropdownlist"===this.getModuleName()&&(t.isNullOrUndefined(this.ulElement)||t.isNullOrUndefined(this.ulElement.getElementsByClassName("e-item-focus")[0])?t.isNullOrUndefined(this.ulElement)||t.isNullOrUndefined(this.ulElement.getElementsByClassName("e-active")[0])||t.attributes(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-active")[0].id}):t.attributes(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}))},s.prototype.unWireEvent=function(){t.isNullOrUndefined(this.inputWrapper)||(t.EventHandler.remove(this.inputWrapper.container,"mousedown",this.dropDownClick),t.EventHandler.remove(this.inputWrapper.container,"keypress",this.onSearch),t.EventHandler.remove(this.inputWrapper.container,"focus",this.focusIn),t.EventHandler.remove(window,"resize",this.windowResize)),this.unBindCommonEvent()},s.prototype.unWireListEvents=function(){this.list&&(t.EventHandler.remove(this.list,"click",this.onMouseClick),t.EventHandler.remove(this.list,"mouseover",this.onMouseOver),t.EventHandler.remove(this.list,"mouseout",this.onMouseLeave))},s.prototype.checkSelector=function(e){return'[id="'+e.replace(/(:|\.|\[|\]|,|=|@|\\|\/|#)/g,"\\$1")+'"]'},s.prototype.onDocumentClick=function(e){var i=e.target;if(!t.isNullOrUndefined(this.popupObj)&&t.closest(i,this.checkSelector(this.popupObj.element.id))||t.isNullOrUndefined(this.inputWrapper)||this.inputWrapper.container.contains(e.target))i===this.inputElement||this.allowFiltering&&i===this.filterInput||"combobox"===this.getModuleName()&&!this.allowFiltering&&t.Browser.isDevice&&i===this.inputWrapper.buttons[0]||(this.isPreventBlur=(t.Browser.isIE||"edge"===t.Browser.info.name)&&(document.activeElement===this.targetElement()||document.activeElement===this.filterInput),e.preventDefault());else if(this.inputWrapper.container.classList.contains(q.inputFocus)||this.isPopupOpen){this.isDocumentClick=!0;var s=this.isRequested;"combobox"===this.getModuleName()&&this.isTyped&&(this.isInteracted=!1),this.hidePopup(e),this.isInteracted=!1,s||(this.onFocusOut(e),this.inputWrapper.container.classList.remove(q.inputFocus))}},s.prototype.activeStateChange=function(){this.isDocumentClick&&(this.hidePopup(),this.onFocusOut(),this.inputWrapper.container.classList.remove(q.inputFocus))},s.prototype.focusDropDown=function(e){!this.initial&&this.isFilterLayout()&&this.focusIn(e)},s.prototype.dropDownClick=function(e){if(3!==e.which&&2!==e.button&&(this.keyboardEvent=null,!this.targetElement().classList.contains(q.disable)&&this.inputWrapper.clearButton!==e.target)){var t=e.target;if(t===this.inputElement||this.allowFiltering&&t===this.filterInput||"combobox"===this.getModuleName()||e.preventDefault(),this.readonly)this.focusIn(e);else{this.isPopupOpen||this.popupObj&&document.body.contains(this.popupObj.element)&&this.beforePopupOpen&&this.isPopupRender?(this.hidePopup(e),this.isFilterLayout()&&this.focusDropDown(e)):(this.focusIn(e),this.floatLabelChange(),this.queryString=""===this.inputElement.value.trim()?null:this.inputElement.value,this.isDropDownClick=!0,this.showPopup(e));var s=this,l=this.dataSource instanceof i.DataManager&&this.groupTemplate?700:this.element.tagName===this.getNgDirective()&&this.itemTemplate?500:100;this.isSecondClick||setTimeout(function(){s.cloneElements(),s.isSecondClick=!0,s.isSecondClick=!(s.isReact&&s.isFiltering()&&s.dataSource instanceof i.DataManager&&!s.list.querySelector("ul"))},l)}}},s.prototype.cloneElements=function(){if(this.list){var e=this.list.querySelector("ul");e&&(e=e.cloneNode?e.cloneNode(!0):e,this.actionCompleteData.ulElement=e)}},s.prototype.updateSelectedItem=function(e,i,s,l){var n=this;this.removeSelection(),e.classList.add(H.selected),this.removeHover();var a=null!==e.getAttribute("data-value")?this.getFormattedValue(e.getAttribute("data-value")):null,r=this.getDataByValue(a);if(this.initial||s||t.isNullOrUndefined(i))this.selectEventCallback(e,i,s,r,a),l&&this.setSelectOptions(e,i);else{var o=this.detachChanges(r);this.isSelected=!0;var h={e:i,item:e,itemData:o,isInteracted:!!i,cancel:!1};this.trigger("select",h,function(t){t.cancel?e.classList.remove(H.selected):(n.selectEventCallback(e,i,s,r,a),l&&n.setSelectOptions(e,i))})}},s.prototype.selectEventCallback=function(e,s,l,n,a){this.previousItemData=t.isNullOrUndefined(this.itemData)?null:this.itemData,this.itemData!==n&&(this.previousValue=t.isNullOrUndefined(this.itemData)?null:"object"!=typeof this.itemData||this.allowObjectBinding?this.itemData:this.checkFieldValue(this.itemData,this.fields.value.split("."))),this.item=e,this.itemData=n;var r=this.list.querySelector("."+H.focus);if(r&&t.removeClass([r],H.focus),e.setAttribute("aria-selected","true"),t.isNullOrUndefined(a)&&(a="null"),this.allowFiltering&&!this.enableVirtualization&&"autocomplete"!==this.getModuleName()){var o=this.getIndexByValueFilter(a,this.actionCompleteData.ulElement);t.isNullOrUndefined(o)?this.activeIndex=this.getIndexByValue(a):this.activeIndex=o}else this.enableVirtualization&&null==this.activeIndex&&this.dataSource instanceof i.DataManager&&(this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+H.li),this.ulElement=this.list.querySelector("ul")),this.activeIndex=this.getIndexByValue(a)},s.prototype.activeItem=function(e){this.isValidLI(e)&&!e.classList.contains(H.selected)&&(this.removeSelection(),e.classList.add(H.selected),this.removeHover(),e.setAttribute("aria-selected","true"))},s.prototype.setValue=function(e){var i=this.getItemData();this.isTouched=!t.isNullOrUndefined(e),null===i.value?a.Input.setValue(null,this.inputElement,this.floatLabelType,this.showClearButton):a.Input.setValue(i.text,this.inputElement,this.floatLabelType,this.showClearButton),this.valueTemplate&&null!==this.itemData?this.setValueTemplate():t.isNullOrUndefined(this.valueTempElement)||this.inputElement.previousSibling!==this.valueTempElement||(t.detach(this.valueTempElement),this.inputElement.style.display="block"),t.isNullOrUndefined(i.value)||this.enableVirtualization||!this.allowFiltering||(this.activeIndex=this.getIndexByValueFilter(i.value,this.actionCompleteData.ulElement),t.isNullOrUndefined(this.activeIndex)&&(this.activeIndex=this.getIndexByValue(i.value)));var s=q.clearIcon,l=this.isFiltering()&&this.filterInput&&"combobox"===this.getModuleName()&&this.filterInput.parentElement.querySelector("."+s);return this.isFiltering()&&l&&l.style.removeProperty("visibility"),!this.allowObjectBinding&&this.previousValue===i.value||this.allowObjectBinding&&null!=this.previousValue&&this.isObjectInArray(this.previousValue,[this.allowCustom&&this.isObjectCustomValue?this.value?this.value:i:i.value?this.getDataByValue(i.value):i])?(this.isSelected=!1,!0):(this.isSelected=!this.initial,this.isSelectCustom=!1,"dropdownlist"===this.getModuleName()&&this.updateIconState(),!1)},s.prototype.setSelection=function(e,s){if(this.isValidLI(e)&&(!e.classList.contains(H.selected)||this.isPopupOpen&&this.isSelected&&e.classList.contains(H.selected)))this.updateSelectedItem(e,s,!1,!0);else if(this.setSelectOptions(e,s),this.enableVirtualization&&this.value){var l=this.isPrimitiveData?"":this.fields.value,n=this.allowObjectBinding&&!t.isNullOrUndefined(this.value)?t.getValue(this.fields.value?this.fields.value:"",this.value):this.value;if(this.dataSource instanceof i.DataManager){if((o=new i.DataManager(this.virtualGroupDataSource).executeLocal((new i.Query).where(new i.Predicate(l,"equal",n))))&&o.length>0){this.itemData=o[0];var a=this.getItemData(),r=this.allowObjectBinding?this.getDataByValue(a.value):a.value;(this.value===a.value&&this.text!==a.text||this.value!==a.value&&this.text===a.text)&&this.setProperties({text:a.text?a.text.toString():a.text,value:r})}}else{var o=new i.DataManager(this.dataSource).executeLocal((new i.Query).where(new i.Predicate(l,"equal",n)));if(o&&o.length>0){this.itemData=o[0];var a=this.getItemData(),r=this.allowObjectBinding?this.getDataByValue(a.value):a.value;(this.value===a.value&&this.text!==a.text||this.value!==a.value&&this.text===a.text)&&(this.setProperties({text:a.text?a.text.toString():a.text,value:r}),t.isNullOrUndefined(e)&&(this.previousValue=this.value))}}}},s.prototype.setSelectOptions=function(e,i){this.list&&this.removeHover(),this.previousSelectedLI=t.isNullOrUndefined(this.selectedLI)?null:this.selectedLI,this.selectedLI=e,this.setValue(i)||((!this.isPopupOpen&&!t.isNullOrUndefined(e)||this.isPopupOpen&&!t.isNullOrUndefined(i)&&("keydown"!==i.type||"keydown"===i.type&&"enter"===i.action))&&(this.isSelectCustom=!1,this.onChangeEvent(i)),!this.isPopupOpen||t.isNullOrUndefined(this.selectedLI)||null===this.itemData||i&&"click"===i.type||this.setScrollPosition(i),"mozilla"!==t.Browser.info.name&&this.targetElement()&&(t.attributes(this.targetElement(),{"aria-describedby":""!==this.inputElement.id?this.inputElement.id:this.element.id}),this.targetElement().removeAttribute("aria-live")),!this.isPopupOpen||t.isNullOrUndefined(this.ulElement)||t.isNullOrUndefined(this.ulElement.getElementsByClassName("e-item-focus")[0])?!this.isPopupOpen||t.isNullOrUndefined(this.ulElement)||t.isNullOrUndefined(this.ulElement.getElementsByClassName("e-active")[0])||t.attributes(this.targetElement(),{"aria-activedescendant":this.ulElement.getElementsByClassName("e-active")[0].id}):t.attributes(this.targetElement(),{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}))},s.prototype.dropdownCompiler=function(e){var t=!1;if("function"!=typeof e&&e)try{t=!!document.querySelectorAll(e).length}catch(e){t=!1}return t},s.prototype.setValueTemplate=function(){var e;this.isReact&&(this.clearTemplate(["valueTemplate"]),this.valueTempElement&&(t.detach(this.valueTempElement),this.inputElement.style.display="block",this.valueTempElement=null)),this.valueTempElement||(this.valueTempElement=this.createElement("span",{className:q.value}),this.inputElement.parentElement.insertBefore(this.valueTempElement,this.inputElement),this.inputElement.style.display="none"),this.isReact||(this.valueTempElement.innerHTML="");var i=this.dropdownCompiler(this.valueTemplate),s=(e="function"!=typeof this.valueTemplate&&i?t.compile(document.querySelector(this.valueTemplate).innerHTML.trim()):t.compile(this.valueTemplate))(this.itemData,this,"valueTemplate",this.valueTemplateId,this.isStringTemplate,null,this.valueTempElement);s&&s.length>0&&t.append(s,this.valueTempElement),this.renderReactTemplates()},s.prototype.removeSelection=function(){if(this.list){var e=this.list.querySelectorAll("."+H.selected);e.length&&(t.removeClass(e,H.selected),e[0].removeAttribute("aria-selected"))}},s.prototype.getItemData=function(){var e=this.fields,i=null;i=this.itemData;var s,l;return t.isNullOrUndefined(i)||(s=t.getValue(e.value,i),l=t.getValue(e.text,i)),{value:t.isNullOrUndefined(i)||t.isUndefined(s)?i:s,text:t.isNullOrUndefined(i)||t.isUndefined(s)?i:l}},s.prototype.onChangeEvent=function(e,s){var l=this,n=this.getItemData(),a=this.isSelectCustom?null:this.activeIndex;if(this.enableVirtualization){var r=this.dataSource instanceof i.DataManager?this.virtualGroupDataSource:this.dataSource;if(n.value&&r&&r.length>0){var o=r.findIndex(function(e){return!t.isNullOrUndefined(n.value)&&t.getValue(l.fields.value,e)===n.value});-1!==o&&(a=o)}}var h=this.allowObjectBinding?s?this.value:this.getDataByValue(n.value):n.value;this.setProperties({index:a,text:n.text?n.text.toString():n.text,value:h},!0),this.detachChangeEvent(e)},s.prototype.detachChanges=function(e){return"string"==typeof e||"boolean"==typeof e||"number"==typeof e?Object.defineProperties({},{value:{value:e,enumerable:!0},text:{value:e,enumerable:!0}}):e},s.prototype.detachChangeEvent=function(e){if(this.isSelected=!1,this.previousValue=this.value,this.activeIndex=this.enableVirtualization?this.getIndexByValue(this.value):this.index,this.typedString=t.isNullOrUndefined(this.text)?"":this.text,!this.initial){var i=this.detachChanges(this.itemData),s=void 0;s="string"==typeof this.previousItemData||"boolean"==typeof this.previousItemData||"number"==typeof this.previousItemData?Object.defineProperties({},{value:{value:this.previousItemData,enumerable:!0},text:{value:this.previousItemData,enumerable:!0}}):this.previousItemData,this.setHiddenValue();var l={e:e,item:this.item,itemData:i,previousItem:this.previousSelectedLI,previousItemData:s,isInteracted:!!e,value:this.value,element:this.element,event:e};this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",l)}!t.isNullOrUndefined(this.value)&&""!==this.value||"Always"===this.floatLabelType||t.removeClass([this.inputWrapper.container],"e-valid-input")},s.prototype.setHiddenValue=function(){if(t.isNullOrUndefined(this.value))this.hiddenElement.innerHTML="";else{var e=this.allowObjectBinding&&!t.isNullOrUndefined(this.value)?t.getValue(this.fields.value?this.fields.value:"",this.value):this.value;if(this.hiddenElement.querySelector("option"))(s=this.hiddenElement.querySelector("option")).textContent=this.text,s.setAttribute("value",e.toString());else if(!t.isNullOrUndefined(this.hiddenElement)){var i=document.createElement("option");i.text=this.text,i.setAttribute("selected",""),this.hiddenElement.appendChild(i);var s=this.hiddenElement.querySelector("option");s.setAttribute("value",e.toString())}}},s.prototype.onFilterUp=function(e){if(e.ctrlKey&&86===e.keyCode||!this.isValidKey&&40!==e.keyCode&&38!==e.keyCode)this.isValidKey=!1;else switch(this.isValidKey=!1,this.filterArgs=e,this.firstItem=this.dataSource&&this.dataSource.length>0?this.dataSource[0]:null,e.keyCode){case 38:case 40:"autocomplete"!==this.getModuleName()||this.isPopupOpen||this.preventAltUp||this.isRequested?this.preventAutoFill=!1:(this.preventAutoFill=!0,this.searchLists(e)),this.preventAltUp=!1,"autocomplete"!==this.getModuleName()||t.isNullOrUndefined(this.ulElement)||t.isNullOrUndefined(this.ulElement.getElementsByClassName("e-item-focus")[0])||t.attributes(this.targetElement(),{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}),e.preventDefault();break;case 46:case 8:this.typedString=this.filterInput.value,!this.isPopupOpen&&""!==this.typedString||this.isPopupOpen&&this.queryString.length>0?(this.preventAutoFill=!0,this.searchLists(e)):""===this.typedString&&""===this.queryString&&"autocomplete"!==this.getModuleName()?(this.preventAutoFill=!0,this.searchLists(e)):""===this.typedString&&(this.list&&this.resetFocusElement(),this.activeIndex=null,"dropdownlist"!==this.getModuleName()&&(this.preventAutoFill=!0,this.searchLists(e),"autocomplete"===this.getModuleName()&&this.hidePopup())),e.preventDefault();break;default:this.isFiltering()&&"combobox"===this.getModuleName()&&t.isNullOrUndefined(this.list)&&(this.getInitialData=!0,this.renderList(),this.isSecondClick||this.isDropDownClick||this.executeCloneElements()),this.typedString=this.filterInput.value,this.preventAutoFill=!1,this.getInitialData||this.searchLists(e),(this.enableVirtualization&&"autocomplete"!==this.getModuleName()||"autocomplete"===this.getModuleName()&&!(this.dataSource instanceof i.DataManager)||"autocomplete"===this.getModuleName()&&this.dataSource instanceof i.DataManager&&0!==this.totalItemCount)&&this.getFilteringSkeletonCount()}},s.prototype.onFilterDown=function(e){switch(e.keyCode){case 13:break;case 40:case 38:this.queryString=this.filterInput.value,e.preventDefault();break;case 9:this.isPopupOpen&&"autocomplete"!==this.getModuleName()&&e.preventDefault();break;default:this.prevSelectPoints=this.getSelectionPoints(),this.queryString=this.filterInput.value}},s.prototype.removeFillSelection=function(){if(this.isInteracted){var e=this.getSelectionPoints();this.inputElement.setSelectionRange(e.end,e.end)}},s.prototype.getQuery=function(e){var s;if(!this.isCustomFilter&&this.allowFiltering&&this.filterInput){s=e?e.clone():this.query?this.query.clone():new i.Query;var l=""===this.typedString?"contains":this.filterType,n=this.typeOfData(this.dataSource).typeof;if((this.dataSource instanceof i.DataManager||"string"!==n)&&"number"!==n){if("combobox"!==this.getModuleName()||this.isFiltering()&&"combobox"===this.getModuleName()&&""!==this.typedString){var a=this.fields.text?this.fields.text:"";s.where(a,l,this.typedString,this.ignoreCase,this.ignoreAccent)}}else s.where("",l,this.typedString,this.ignoreCase,this.ignoreAccent)}else s=this.enableVirtualization&&!t.isNullOrUndefined(this.customFilterQuery)?this.customFilterQuery.clone():e?e.clone():this.query?this.query.clone():new i.Query;if(this.enableVirtualization&&0!==this.viewPortInfo.endIndex){var r=this.getTakeValue(),o=!1;if(s)for(p=0;p<s.queries.length;p++)if("onSkip"===s.queries[p].fn){o=!0;break}var h=0,u=0;if(s&&s.queries.length>0)for(p=0;p<s.queries.length;p++)"onSkip"===s.queries[p].fn&&(u=s.queries[p].e.nos),"onTake"===s.queries[p].fn&&(h=r<=s.queries[p].e.nos?s.queries[p].e.nos:r);if(h<=0&&this.query&&this.query.queries.length>0)for(p=0;p<this.query.queries.length;p++)"onTake"===this.query.queries[p].fn&&(h=r<=this.query.queries[p].e.nos?this.query.queries[p].e.nos:r);if(s&&s.queries.length>0)for(var p=0;p<s.queries.length;p++)"onSkip"!==s.queries[p].fn?"onTake"===s.queries[p].fn&&(h=s.queries[p].e.nos<=h?h:s.queries[p].e.nos,s.queries.splice(p,1),--p):(u=s.queries[p].e.nos,s.queries.splice(p,1),o=!1,--p);!this.allowFiltering&&this.isPopupOpen&&o||(u>0?s.skip(u):s.skip(this.virtualItemStartIndex)),this.isIncrementalRequest?s.take(this.incrementalEndIndex):h>0?s.take(h):s.take(r),s.requiresCount()}return s},s.prototype.getSelectionPoints=function(){var e=this.inputElement;return{start:Math.abs(e.selectionStart),end:Math.abs(e.selectionEnd)}},s.prototype.performFiltering=function(e){var t=this;this.checkAndResetCache(),this.isRequesting=!1;var i={preventDefaultAction:!1,text:this.filterInput?this.filterInput.value:"",updateData:function(e,s,l){i.cancel||(t.isCustomFilter=!0,t.customFilterQuery=s?s.clone():s,t.filteringAction(e,s,l))},baseEventArgs:e,cancel:!1};this.trigger("filtering",i,function(e){e.cancel||t.isCustomFilter||e.preventDefaultAction||t.filteringAction(t.dataSource,null,t.fields)})},s.prototype.searchLists=function(e){this.isTyped=!0,this.activeIndex=null,this.isListSearched=!0,this.filterInput.parentElement.querySelector("."+q.clearIcon)&&(this.filterInput.parentElement.querySelector("."+q.clearIcon).style.visibility=""===this.filterInput.value?"hidden":"visible"),this.isDataFetched=!1,this.isFiltering()&&(""!==this.typedString&&this.debounceDelay>0?this.debouncedFiltering(e,this.debounceDelay):this.performFiltering(e))},s.prototype.filter=function(e,t,i){this.isCustomFilter=!0,this.filteringAction(e,t,i)},s.prototype.filteringAction=function(e,i,s){if(!t.isNullOrUndefined(this.filterInput)){this.beforePopupOpen=!(!this.isPopupOpen&&"combobox"===this.getModuleName()&&""===this.filterInput.value||this.getInitialData);var l=this.list.classList.contains(H.noData);if(""!==this.filterInput.value.trim()||this.itemTemplate){if(this.isNotSearchList=!1,i=""===this.filterInput.value.trim()?null:i,this.enableVirtualization&&this.isFiltering()&&this.isTyped&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null),this.resetList(e,s,i),"dropdownlist"===this.getModuleName()&&this.list.classList.contains(H.noData)&&(this.popupContentElement.setAttribute("role","status"),this.popupContentElement.setAttribute("id","no-record"),t.attributes(this.filterInputObj.container,{"aria-activedescendant":"no-record"})),this.enableVirtualization&&l&&!this.list.classList.contains(H.noData)){if(!this.list.querySelector(".e-virtual-ddl-content")){var n=this.createElement("div",{className:"e-virtual-ddl-content"});n.style.cssText=this.getTransformValues(),this.list.appendChild(n).appendChild(this.list.querySelector(".e-list-parent"))}if(!this.list.querySelector(".e-virtual-ddl")){var a=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"});a.style.cssText=this.GetVirtualTrackHeight(),this.list.parentElement.querySelector(".e-dropdownbase").appendChild(a)}}}else this.actionCompleteData.isUpdated=!1,this.isTyped=!1,t.isNullOrUndefined(this.actionCompleteData.ulElement)||t.isNullOrUndefined(this.actionCompleteData.list)||(this.enableVirtualization&&(this.isFiltering()&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null),this.totalItemCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.resetList(e,s,i),l&&!this.list.classList.contains(H.noData)&&(this.list.querySelector(".e-virtual-ddl-content")||((n=this.createElement("div",{className:"e-virtual-ddl-content"})).style.cssText=this.getTransformValues(),this.list.appendChild(n).appendChild(this.list.querySelector(".e-list-parent"))),this.list.querySelector(".e-virtual-ddl")||((a=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"})).style.cssText=this.GetVirtualTrackHeight(),this.list.parentElement.querySelector(".e-dropdownbase").appendChild(a)))),this.onActionComplete(this.actionCompleteData.ulElement,this.actionCompleteData.list)),this.isTyped=!0,t.isNullOrUndefined(this.itemData)||"dropdownlist"!==this.getModuleName()||(this.focusIndexItem(),this.setScrollPosition()),this.isNotSearchList=!0;this.enableVirtualization&&this.getFilteringSkeletonCount(),this.renderReactTemplates(),this.filterInput&&""===this.filterInput.value&&"combobox"===this.getModuleName()&&this.executeCloneElements()}},s.prototype.setSearchBox=function(e){if(this.isFiltering()){var i=e.querySelector("."+q.filterParent)?e.querySelector("."+q.filterParent):this.createElement("span",{className:q.filterParent});this.filterInput=this.createElement("input",{attrs:{type:"text"},className:q.filterInput}),this.element.parentNode.insertBefore(this.filterInput,this.element);var s=!1;return t.Browser.isDevice&&this.isDeviceFullScreen&&(s=!0),this.filterInputObj=a.Input.createInput({element:this.filterInput,buttons:s?[q.backIcon,q.filterBarClearIcon]:[q.filterBarClearIcon],properties:{placeholder:this.filterBarPlaceholder}},this.createElement),t.isNullOrUndefined(this.cssClass)||(-1!==this.cssClass.split(" ").indexOf("e-outline")?t.addClass([this.filterInputObj.container],"e-outline"):-1!==this.cssClass.split(" ").indexOf("e-filled")&&t.addClass([this.filterInputObj.container],"e-filled")),t.append([this.filterInputObj.container],i),t.prepend([i],e),t.attributes(this.filterInput,{"aria-disabled":"false",role:"combobox",autocomplete:"off",autocapitalize:"off",spellcheck:"false"}),this.clearIconElement=this.filterInput.parentElement.querySelector("."+q.clearIcon),!t.Browser.isDevice&&this.clearIconElement&&(t.EventHandler.add(this.clearIconElement,"click",this.clearText,this),this.clearIconElement.style.visibility="hidden"),t.Browser.isDevice?this.searchKeyModule=new t.KeyboardEvents(this.filterInput,{keyAction:this.mobileKeyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}):this.searchKeyModule=new t.KeyboardEvents(this.filterInput,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}),t.EventHandler.add(this.filterInput,"input",this.onInput,this),t.EventHandler.add(this.filterInput,"keyup",this.onFilterUp,this),t.EventHandler.add(this.filterInput,"keydown",this.onFilterDown,this),t.EventHandler.add(this.filterInput,"blur",this.onBlurHandler,this),t.EventHandler.add(this.filterInput,"paste",this.pasteHandler,this),this.filterInputObj}return M},s.prototype.onInput=function(e){!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(e.data)&&e.data.length>1&&this.autoFill&&("combobox"===this.getModuleName()||"autocomplete"===this.getModuleName())&&(this.inputElement.value=e.data),this.isValidKey=!0,"combobox"===this.getModuleName()&&this.updateIconState(),t.Browser.isDevice&&"mozilla"===t.Browser.info.name&&(this.typedString=this.filterInput.value,this.preventAutoFill=!0,this.searchLists(e))},s.prototype.pasteHandler=function(e){var i=this;setTimeout(function(){i.typedString=i.filterInput.value,"combobox"===i.getModuleName()&&i.isFiltering()&&t.isNullOrUndefined(i.list)&&i.renderList(),i.searchLists(e)})},s.prototype.onActionFailure=function(t){e.prototype.onActionFailure.call(this,t),this.beforePopupOpen&&this.renderPopup()},s.prototype.getTakeValue=function(){return this.allowFiltering&&"dropdownlist"===this.getModuleName()&&t.Browser.isDevice?Math.round(window.outerHeight/this.listItemHeight):this.itemCount},s.prototype.onActionComplete=function(s,l,n,a){var r=this;if(this.dataSource instanceof i.DataManager&&!t.isNullOrUndefined(n)&&!this.virtualGroupDataSource&&(this.totalItemCount=n.count),this.isNotSearchList&&!this.enableVirtualization)return void(this.isNotSearchList=!1);if(this.getInitialData)return this.itemTemplate&&"EJS-COMBOBOX"===this.element.tagName&&this.allowFiltering?setTimeout(function(){r.updateActionCompleteDataValues(s,l)},0):this.updateActionCompleteDataValues(s,l),this.enableVirtualization&&this.updateSelectElementData(this.allowFiltering),this.getInitialData=!1,this.isReactTemplateUpdate=!0,this.typedString=this.filterInput.value,void this.searchLists(this.filterArgs);var o=this.itemCount;if(this.isActive||!t.isNullOrUndefined(s)){var h=this.selectedLI?this.selectedLI.cloneNode(!0):null;if(e.prototype.onActionComplete.call(this,s,l,n),this.skeletonCount=0!==this.totalItemCount&&this.totalItemCount<2*this.itemCount&&(!(this.dataSource instanceof i.DataManager)||this.dataSource instanceof i.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,this.updateSelectElementData(this.allowFiltering),this.isRequested&&!t.isNullOrUndefined(this.searchKeyEvent)&&"keydown"===this.searchKeyEvent.type&&(this.isRequested=!1,this.keyActionHandler(this.searchKeyEvent),this.searchKeyEvent=null),this.isRequested&&!t.isNullOrUndefined(this.searchKeyEvent)&&(this.incrementalSearch(this.searchKeyEvent),this.searchKeyEvent=null),this.enableVirtualization||(this.list.scrollTop=0),t.isNullOrUndefined(s)||t.attributes(s,{id:this.element.id+"_options",role:"listbox","aria-hidden":"false","aria-label":"listbox"}),this.initialRemoteRender){if(this.initial=!0,this.activeIndex=this.index,this.initialRemoteRender=!1,this.value&&this.dataSource instanceof i.DataManager){var u=t.isNullOrUndefined(this.fields.value)?this.fields.text:this.fields.value,p=this.allowObjectBinding&&!t.isNullOrUndefined(this.value)?t.getValue(u,this.value):this.value,d=this.fields.value.split("."),c=l.some(function(e){return t.isNullOrUndefined(e[u])&&d.length>1?r.checkFieldValue(e,d)===p:e[u]===p});this.enableVirtualization&&this.virtualGroupDataSource&&(c=this.virtualGroupDataSource.some(function(e){return t.isNullOrUndefined(e[u])&&d.length>1?r.checkFieldValue(e,d)===p:e[u]===p})),c?this.updateValues():this.dataSource.executeQuery(this.getQuery(this.query).where(new i.Predicate(u,"equal",p))).then(function(e){e.result.length>0?(r.enableVirtualization||r.addItem(e.result,l.length),r.updateValues()):r.updateValues()})}else this.updateValues();this.initial=!1}else"autocomplete"===this.getModuleName()&&this.value&&this.setInputValue();if("autocomplete"!==this.getModuleName()&&this.isFiltering()&&!this.isTyped){if((!this.actionCompleteData.isUpdated||!this.isCustomFilter&&!this.isFilterFocus||t.isNullOrUndefined(this.itemData)&&this.allowFiltering&&(this.dataSource instanceof i.DataManager||!t.isNullOrUndefined(this.dataSource)&&!t.isNullOrUndefined(this.dataSource.length)&&0!==this.dataSource.length))&&(this.itemTemplate&&("EJS-COMBOBOX"===this.element.tagName||this.isReact)&&this.allowFiltering?setTimeout(function(){r.updateActionCompleteDataValues(s,l)},0):this.updateActionCompleteDataValues(s,l)),this.isDynamicData){var m=this.allowObjectBinding&&!t.isNullOrUndefined(this.value)?t.getValue(this.fields.value?this.fields.value:"",this.value):this.value;this.itemData=this.getDataByValue(m),this.selectedLI=this.getElementByValue(m),this.isDynamicData=!1}if((this.allowCustom||this.allowFiltering&&!this.isValueInList(l,this.value)&&this.dataSource instanceof i.DataManager)&&!this.enableVirtualization)this.addNewItem(l,h);else if((this.allowCustom||this.allowFiltering&&this.isValueInList(l,this.value))&&!this.enableVirtualization){f=this.allowObjectBinding&&!t.isNullOrUndefined(this.value)?t.getValue(this.fields.value?this.fields.value:"",this.value):this.value;!t.isNullOrUndefined(this.value)&&h&&h.getAttribute("data-value")===f.toString()&&this.addNewItem(l,h)}(!t.isNullOrUndefined(this.itemData)||t.isNullOrUndefined(this.itemData)&&this.enableVirtualization)&&(this.getSkeletonCount(),this.skeletonCount=0!==this.totalItemCount&&this.totalItemCount<2*this.itemCount&&(!(this.dataSource instanceof i.DataManager)||this.dataSource instanceof i.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,this.UpdateSkeleton(),this.focusIndexItem()),this.enableVirtualization&&this.updateActionCompleteDataValues(s,l)}else if(this.enableVirtualization&&"autocomplete"!==this.getModuleName()&&!this.isFiltering()){var f=this.getItemData().value;this.activeIndex=this.getIndexByValue(f);var v=this.findListElement(this.list,"li","data-value",f);this.selectedLI=v}else this.enableVirtualization&&"autocomplete"===this.getModuleName()&&(this.activeIndex=this.skeletonCount);this.beforePopupOpen&&(this.renderPopup(n),this.enableVirtualization&&(this.list.querySelector(".e-virtual-list")||(this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll(".e-list-item"))),this.enableVirtualization&&o!==this.itemCount&&this.resetList(this.dataSource,this.fields))}},s.prototype.isValueInList=function(e,t){if(Array.isArray(e)){for(var i=0;i<e.length;i++)if(e[i]===t)return!0}else if("object"==typeof e&&null!==e)for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&e[s]===t)return!0;return!1},s.prototype.checkFieldValue=function(e,t){var i=e;return t.forEach(function(e){i=i[e]}),i},s.prototype.updateActionCompleteDataValues=function(e,t){this.actionCompleteData={ulElement:e.cloneNode(!0),list:t,isUpdated:!0},this.actionData.list!==this.actionCompleteData.list&&this.actionCompleteData.ulElement&&this.actionCompleteData.list&&(this.actionData=this.actionCompleteData)},s.prototype.addNewItem=function(e,i){var s=this;if(!t.isNullOrUndefined(this.itemData)&&!t.isNullOrUndefined(i)){var l=this.getItemData().value;e.some(function(e){return("string"==typeof e||"number"==typeof e||"boolean"==typeof e)&&e===l||t.getValue(s.fields.value,e)===l})||this.addItem(this.itemData)}},s.prototype.updateActionCompleteData=function(e,t,i){var s=this;"autocomplete"!==this.getModuleName()&&this.actionCompleteData.ulElement&&(this.itemTemplate&&"EJS-COMBOBOX"===this.element.tagName&&this.allowFiltering?setTimeout(function(){s.actionCompleteDataUpdate(e,t,i)},0):this.actionCompleteDataUpdate(e,t,i))},s.prototype.actionCompleteDataUpdate=function(e,t,i){null!==i?this.actionCompleteData.ulElement.insertBefore(e.cloneNode(!0),this.actionCompleteData.ulElement.childNodes[i]):this.actionCompleteData.ulElement.appendChild(e.cloneNode(!0)),this.isFiltering()&&this.actionCompleteData.list&&this.actionCompleteData.list.indexOf(t)<0&&this.actionCompleteData.list.push(t)},s.prototype.focusIndexItem=function(){var e=this.getItemData().value;this.activeIndex=this.enableVirtualization&&!t.isNullOrUndefined(e)||!this.enableVirtualization?this.getIndexByValue(e):this.activeIndex;var i=this.findListElement(this.list,"li","data-value",e);this.selectedLI=i,this.activeItem(i),this.enableVirtualization&&t.isNullOrUndefined(i)||this.removeFocus()},s.prototype.updateSelection=function(){var e=this.list.querySelector("."+H.selected);if(e)this.setProperties({index:this.getIndexByValue(e.getAttribute("data-value"))}),this.activeIndex=this.index;else{if(this.removeFocus(),this.allowFiltering&&this.actionCompleteData&&this.actionCompleteData.ulElement&&this.dataSource instanceof i.DataManager){var s=this.actionCompleteData.ulElement.querySelectorAll("."+q.focus);s&&s.length&&t.removeClass(s,q.focus)}this.list.querySelector("."+H.li).classList.add(q.focus)}},s.prototype.updateSelectionList=function(){if(!(this.list&&this.list.querySelector(".e-active"))&&!t.isNullOrUndefined(this.value)&&"autocomplete"!==this.getModuleName()){var e=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",this.value):this.value,i=this.findListElement(this.list,"li","data-value",e);i&&i.classList.add("e-active")}},s.prototype.removeFocus=function(){var e=this.list.querySelectorAll("."+q.focus);e&&e.length&&t.removeClass(e,q.focus)},s.prototype.renderPopup=function(e){var s=this;if(this.popupObj&&document.body.contains(this.popupObj.element))return void this.refreshPopup();var l={cancel:!1};this.trigger("beforeOpen",l,function(l){var n;if(l.cancel)s.beforePopupOpen=!1;else{var a=s.createElement("div",{id:s.element.id+"_popup",className:"e-ddl e-popup "+(null!==s.cssClass?s.cssClass:"")});a.setAttribute("aria-label",s.element.id),a.setAttribute("role","dialog");var r=s.setSearchBox(a);if(s.listContainerHeight=s.allowFiltering&&"dropdownlist"===s.getModuleName()&&t.Browser.isDevice&&s.isDeviceFullScreen?t.formatUnit(Math.round(window.outerHeight).toString()+"px"):t.formatUnit(s.popupHeight),s.headerTemplate&&(s.setHeaderTemplate(a),s.isUpdateHeaderHeight=0!==s.header.offsetHeight),t.append([s.list],a),s.footerTemplate&&(s.setFooterTemplate(a),s.isUpdateFooterHeight=0!==s.footer.offsetHeight),document.body.appendChild(a),a.style.top="0px",n=a.clientHeight,s.enableVirtualization&&(s.itemTemplate||s.isAngular)){var o=a.querySelectorAll("li.e-list-item:not(.e-virtual-list)"),h=a.querySelectorAll("li.e-virtual-list"),u=o&&o.length>0?Math.ceil(o[0].getBoundingClientRect().height)+parseInt(window.getComputedStyle(o[0]).marginBottom,10):0;u!==(h&&h.length>0?Math.ceil(h[0].getBoundingClientRect().height)+parseInt(window.getComputedStyle(h[0]).marginBottom,10):0)&&h&&h.length>0&&h.forEach(function(e){e.parentNode.removeChild(e)}),s.listItemHeight=u}if(s.enableVirtualization&&!s.list.classList.contains(H.noData)){if(s.getSkeletonCount(),s.skeletonCount=s.totalItemCount<2*s.itemCount&&(!(s.dataSource instanceof i.DataManager)||s.dataSource instanceof i.DataManager&&s.totalItemCount<=s.itemCount)?0:s.skeletonCount,s.list.querySelector(".e-virtual-ddl-content"))s.list.getElementsByClassName("e-virtual-ddl-content")[0].style=s.getTransformValues();else{var p=s.createElement("div",{className:"e-virtual-ddl-content"});p.style.cssText=s.getTransformValues(),s.list.appendChild(p).appendChild(s.list.querySelector(".e-list-parent"))}if(s.UpdateSkeleton(),s.liCollections=s.list.querySelectorAll("."+H.li),s.virtualItemCount=s.itemCount,s.list.querySelector(".e-virtual-ddl"))s.list.getElementsByClassName("e-virtual-ddl")[0].style=s.GetVirtualTrackHeight();else{var d=s.createElement("div",{id:s.element.id+"_popup",className:"e-virtual-ddl"});d.style.cssText=s.GetVirtualTrackHeight(),a.querySelector(".e-dropdownbase").appendChild(d)}}if(a.style.visibility="hidden","auto"!==s.popupHeight){if(s.searchBoxHeight=0,t.isNullOrUndefined(r.container)||"combobox"===s.getModuleName()||"autocomplete"===s.getModuleName()||(s.searchBoxHeight=r.container.parentElement.getBoundingClientRect().height,s.listContainerHeight=(parseInt(s.listContainerHeight,10)-s.searchBoxHeight).toString()+"px"),s.headerTemplate){s.header=s.header?s.header:a.querySelector(".e-ddl-header");c=Math.round(s.header.getBoundingClientRect().height);s.listContainerHeight=(parseInt(s.listContainerHeight,10)-(c+s.searchBoxHeight)).toString()+"px"}if(s.footerTemplate){s.footer=s.footer?s.footer:a.querySelector(".e-ddl-footer");var c=Math.round(s.footer.getBoundingClientRect().height);s.listContainerHeight=(parseInt(s.listContainerHeight,10)-(c+s.searchBoxHeight)).toString()+"px"}s.list.style.maxHeight=(parseInt(s.listContainerHeight,10)-2).toString()+"px",a.style.maxHeight=t.formatUnit(s.popupHeight)}else a.style.height="auto";var m=0,f=void 0;if(s.isPreventScrollAction=!0,!t.isNullOrUndefined(s.selectedLI)&&!t.isNullOrUndefined(s.activeIndex)&&s.activeIndex>=0?s.setScrollPosition():s.enableVirtualization?s.setScrollPosition():s.list.scrollTop=0,t.Browser.isDevice&&s.isDeviceFullScreen&&!s.allowFiltering&&("dropdownlist"===s.getModuleName()||s.isDropDownClick&&"combobox"===s.getModuleName())){m=s.getOffsetValue(a);var v=s.isEmptyList()?s.list:s.liCollections[0];t.isNullOrUndefined(s.inputElement)||(f=-(parseInt(getComputedStyle(v).textIndent,10)-parseInt(getComputedStyle(s.inputElement).paddingLeft,10)+parseInt(getComputedStyle(s.inputElement.parentElement).borderLeftWidth,10)))}s.createPopup(a,m,f),s.popupContentElement=s.popupObj.element.querySelector(".e-content"),s.getFocusElement(),s.checkCollision(a),t.Browser.isDevice&&(parseInt(s.popupWidth.toString(),10)>window.outerWidth&&("dropdownlist"!==s.getModuleName()||!s.allowFiltering)&&s.popupObj.element.classList.add("e-wide-popup"),s.popupObj.element.classList.add(q.device),("dropdownlist"===s.getModuleName()||"combobox"===s.getModuleName()&&!s.allowFiltering&&s.isDropDownClick)&&(s.popupObj.collision={X:"fit",Y:"fit"}),s.isFilterLayout()&&s.isDeviceFullScreen&&(s.popupObj.element.classList.add(q.mobileFilter),s.popupObj.position={X:0,Y:0},s.popupObj.dataBind(),t.attributes(s.popupObj.element,{style:"left:0px;right:0px;top:0px;bottom:0px;"}),t.addClass([document.body,s.popupObj.element],q.popupFullScreen),s.setSearchBoxPosition(),s.backIconElement=r.container.querySelector(".e-back-icon"),s.clearIconElement=r.container.querySelector("."+q.clearIcon),t.EventHandler.add(s.backIconElement,"click",s.clickOnBackIcon,s),t.EventHandler.add(s.clearIconElement,"click",s.clearText,s))),a.style.visibility="visible",t.addClass([a],"e-popup-close");for(var g=0,y=s.popupObj.getScrollableParent(s.inputWrapper.container);g<y.length;g++){var C=y[g];t.EventHandler.add(C,"scroll",s.scrollHandler,s)}t.isNullOrUndefined(s.list)||(s.unWireListEvents(),s.wireListEvents()),s.selectedElementID=s.selectedLI?s.selectedLI.id:null,s.enableVirtualization&&(s.notify("bindScrollEvent",{module:"VirtualScroll",component:s.getModuleName(),enable:s.enableVirtualization}),setTimeout(function(){(s.value||s.list.querySelector(".e-active"))&&(s.updateSelectionList(),s.viewPortInfo&&s.viewPortInfo.offsets.top?s.list.scrollTop=s.viewPortInfo.offsets.top:s.scrollBottom(!0,!0))},5)),t.attributes(s.targetElement(),{"aria-expanded":"true","aria-owns":s.element.id+"_popup","aria-controls":s.element.id}),"dropdownlist"!==s.getModuleName()&&s.list.classList.contains("e-nodata")&&(t.attributes(s.targetElement(),{"aria-activedescendant":"no-record"}),s.popupContentElement.setAttribute("role","status"),s.popupContentElement.setAttribute("id","no-record")),s.inputElement.setAttribute("aria-expanded","true"),s.inputElement.setAttribute("aria-controls",s.element.id+"_popup");var b=s.isFiltering()?s.filterInput.parentElement:s.inputWrapper.container;t.addClass([b],[q.inputFocus]);var S={name:"FadeIn",duration:100};s.beforePopupOpen=!0;var E={popup:s.popupObj,event:e,cancel:!1,animation:S};if(s.trigger("open",E,function(e){e.cancel?(s.beforePopupOpen=!1,s.destroyPopup()):(t.isNullOrUndefined(s.inputWrapper)||t.addClass([s.inputWrapper.container],[q.iconAnimation]),s.renderReactTemplates(),s.isReact&&s.isFiltering()&&s.dataSource instanceof i.DataManager&&s.list.querySelector("ul")&&!s.isSecondClick&&s.executeCloneElements(),t.isNullOrUndefined(s.popupObj)||(s.popupObj.show(new t.Animation(e.animation),1e3===s.zIndex?s.element:null),s.isPopupRender=!0),s.isReact&&setTimeout(function(){if(s.popupHeight&&s.list&&"auto"!==s.popupHeight&&("dropdownlist"!==s.getModuleName()||!s.allowFiltering)){var e="string"==typeof s.popupHeight?parseInt(s.popupHeight,10):s.popupHeight;if(!s.isUpdateHeaderHeight&&s.headerTemplate&&s.header){t=""===s.list.style.maxHeight?e:parseInt(s.list.style.maxHeight,10);s.list.style.maxHeight=(t-s.header.offsetHeight).toString()+"px",s.isUpdateHeaderHeight=!0}if(!s.isUpdateFooterHeight&&s.footerTemplate&&s.footer){var t=""===s.list.style.maxHeight?e:parseInt(s.list.style.maxHeight,10);s.list.style.maxHeight=(t-s.footer.offsetHeight).toString()+"px",s.isUpdateFooterHeight=!0}}},15))}),s.allowResize&&("dropdownlist"!==s.getModuleName()||!(t.Browser.isDevice&&s.isDeviceFullScreen&&s.allowFiltering))){if(s.resizer=s.createElement("div",{id:s.element.id+"_resize-popup",className:q.resizeIcon}),s.list&&s.list.parentElement){if(s.list.parentElement.classList.add("e-resize"),"auto"!==s.popupHeight.toString().toLowerCase()&&n>=parseInt(s.popupHeight.toString(),10)-2&&(s.list.parentElement.style.height="100%"),s.list.parentElement.style.paddingBottom="dropdownlist"===s.getModuleName()&&s.allowFiltering&&s.searchBoxHeight?(s.searchBoxHeight+16).toString()+"px":16..toString()+"px",s.isReact&&s.footer){var x=s.list.style.maxHeight,I=s.list.parentElement.style.maxHeight,w=s.listContainerHeight;setTimeout(function(){s.footer=s.footer?s.footer:a.querySelector(".e-ddl-footer");var e=Math.round(s.footer.getBoundingClientRect().height);e>0&&(w=(parseInt(w,10)-e).toString()+"px",x=(parseInt(w,10)-2).toString()+"px",s.list.parentElement.style.paddingBottom=(parseInt(I,10)-parseInt(x,10)+16).toString()+"px")},1)}else(s.header||s.footer||s.itemTemplate)&&(s.list.parentElement.style.paddingBottom=(parseInt(s.list.parentElement.style.maxHeight,10)-parseInt(s.list.style.maxHeight,10)+16).toString()+"px");s.list.parentElement.appendChild(s.resizer),s.list.parentElement.style.width=s.resizeWidth+"px",s.list.parentElement.style.height=s.resizeHeight+"px",s.list.parentElement.style.maxHeight=s.resizeHeight+"px",s.list.style.maxHeight=s.resizeHeight+"px"}t.EventHandler.add(s.resizer,"mousedown",s.startResizing,s),t.EventHandler.add(s.resizer,"touchstart",s.startResizing,s)}}})},s.prototype.checkCollision=function(e){(!t.Browser.isDevice||t.Browser.isDevice&&"dropdownlist"!==this.getModuleName()&&!this.isDropDownClick)&&(n.isCollide(e).length>0&&(e.style.marginTop=-parseInt(getComputedStyle(e).marginTop,10)+"px"),this.popupObj.resolveCollision())},s.prototype.getOffsetValue=function(e){var t=getComputedStyle(e),i=parseInt(t.borderTopWidth,10),s=parseInt(t.borderBottomWidth,10);return this.setPopupPosition(i+s)},s.prototype.createPopup=function(e,i,s){var l=this;this.popupObj=new n.Popup(e,{width:this.setWidth(),targetType:"relative",relateTo:this.inputWrapper.container,collision:this.enableRtl?{X:"fit",Y:"flip"}:{X:"flip",Y:"flip"},offsetY:i,enableRtl:this.enableRtl,offsetX:s,position:this.enableRtl?{X:"right",Y:"bottom"}:{X:"left",Y:"bottom"},zIndex:this.zIndex,close:function(){l.isDocumentClick||l.focusDropDown(),l.isReact&&l.clearTemplate(["headerTemplate","footerTemplate"]),l.isNotSearchList=!1,l.isDocumentClick=!1,l.destroyPopup(),l.isFiltering()&&l.actionCompleteData.list&&l.actionCompleteData.list.length>0?(l.isActive=!0,l.isReactTemplateUpdate&&l.isReact&&l.itemTemplate&&!l.enableVirtualization&&(l.actionCompleteData.ulElement=l.renderItems(l.actionCompleteData.list,l.fields),l.isReactTemplateUpdate=!1),l.enableVirtualization?l.onActionComplete(l.ulElement,l.listData,null,!0):l.onActionComplete(l.actionCompleteData.ulElement,l.actionCompleteData.list,null,!0)):l.enableVirtualization&&l.focusIndexItem()},open:function(){t.EventHandler.add(document,"mousedown",l.onDocumentClick,l),l.isPopupOpen=!0;var e=l.actionCompleteData&&l.actionCompleteData.ulElement&&l.actionCompleteData.ulElement.querySelector("li"),i=l.list.querySelector("ul li");t.isNullOrUndefined(l.ulElement)||t.isNullOrUndefined(l.ulElement.getElementsByClassName("e-item-focus")[0])?t.isNullOrUndefined(l.ulElement)||t.isNullOrUndefined(l.ulElement.getElementsByClassName("e-active")[0])||t.attributes(l.targetElement(),{"aria-activedescendant":l.ulElement.getElementsByClassName("e-active")[0].id}):t.attributes(l.targetElement(),{"aria-activedescendant":l.ulElement.getElementsByClassName("e-item-focus")[0].id}),l.isFiltering()&&l.itemTemplate&&l.element.tagName===l.getNgDirective()&&e&&i&&e.textContent!==i.textContent&&"EJS-COMBOBOX"!==l.element.tagName&&l.cloneElements(),l.isFilterLayout()&&(t.removeClass([l.inputWrapper.container],[q.inputFocus]),l.isFilterFocus=!0,l.filterInput.focus(),l.inputWrapper.clearButton&&t.addClass([l.inputWrapper.clearButton],q.clearIconHide)),l.activeStateChange()},targetExitViewport:function(){t.Browser.isDevice||l.hidePopup()}})},s.prototype.isEmptyList=function(){return!t.isNullOrUndefined(this.liCollections)&&0===this.liCollections.length},s.prototype.getFocusElement=function(){},s.prototype.isFilterLayout=function(){return"dropdownlist"===this.getModuleName()&&this.allowFiltering},s.prototype.scrollHandler=function(){t.Browser.isDevice&&("dropdownlist"===this.getModuleName()&&!this.isFilterLayout()||"combobox"===this.getModuleName()&&!this.allowFiltering&&this.isDropDownClick)&&this.element&&!this.isElementInViewport(this.element)&&this.hidePopup()},s.prototype.isElementInViewport=function(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth},s.prototype.setSearchBoxPosition=function(){var e=this.filterInput.parentElement.getBoundingClientRect().height;this.popupObj.element.style.maxHeight="100%",this.popupObj.element.style.width="100%",this.list.style.maxHeight=window.innerHeight-e+"px",this.list.style.height=window.innerHeight-e+"px";var i=this.filterInput.parentElement.querySelector("."+q.clearIcon);t.detach(this.filterInput),i.parentElement.insertBefore(this.filterInput,i)},s.prototype.setPopupPosition=function(e){var i,s=e,l=this.list.querySelector("."+q.focus)||this.selectedLI,n=this.isEmptyList()?this.list:this.liCollections[0],a=this.isEmptyList()?this.list:this.liCollections[this.getItems().length-1],r=n.getBoundingClientRect().height;this.listItemHeight=r+parseInt(window.getComputedStyle(n).marginBottom,10);var o=this.list.offsetHeight/2,h=t.isNullOrUndefined(l)?n.offsetTop:l.offsetTop;if(a.offsetTop-o<h&&!t.isNullOrUndefined(this.liCollections)&&this.liCollections.length>0&&!t.isNullOrUndefined(l)){var u=this.list.offsetHeight/r,p=parseInt(getComputedStyle(this.list).paddingBottom,10);i=(u-(this.liCollections.length-this.activeIndex))*r-s+p,this.list.scrollTop=l.offsetTop}else h>o&&!this.enableVirtualization?(i=o-r/2,this.list.scrollTop=h-o+r/2):i=h;return-(i=i+r+s-(r-this.inputWrapper.container.offsetHeight)/2)},s.prototype.setWidth=function(){var e=t.formatUnit(this.popupWidth);if(e.indexOf("%")>-1&&(e=(this.inputWrapper.container.offsetWidth*parseFloat(e)/100).toString()+"px"),t.Browser.isDevice&&e.indexOf("px")>-1&&!this.allowFiltering&&("dropdownlist"===this.getModuleName()||this.isDropDownClick&&"combobox"===this.getModuleName())){var i=this.isEmptyList()?this.list:this.liCollections[0];e=parseInt(e,10)+2*(parseInt(getComputedStyle(i).textIndent,10)-parseInt(getComputedStyle(this.inputElement).paddingLeft,10)+parseInt(getComputedStyle(this.inputElement.parentElement).borderLeftWidth,10))+"px"}return e},s.prototype.scrollBottom=function(e,i,s){var l=this;if(void 0===i&&(i=!1),void 0===s&&(s=null),t.isNullOrUndefined(this.selectedLI)&&this.enableVirtualization&&(this.selectedLI=this.list.querySelector("."+H.li),!t.isNullOrUndefined(this.selectedLI)&&this.selectedLI.classList.contains("e-virtual-list")&&(this.selectedLI=this.liCollections[this.skeletonCount])),!t.isNullOrUndefined(this.selectedLI)){var n=this.selectedLI&&!isNaN(parseInt(window.getComputedStyle(this.selectedLI).marginBottom,10))?parseInt(window.getComputedStyle(this.selectedLI).marginBottom,10):0;this.isUpwardScrolling=!1;var a=this.list.querySelectorAll(".e-virtual-list").length,r=this.list.querySelector("li:last-of-type")?this.list.querySelector("li:last-of-type").getAttribute("data-value"):null,o=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*(this.selectedLI.offsetHeight+n):this.selectedLI.offsetTop,h=this.list.offsetHeight,u=o-a*(this.selectedLI.offsetHeight+n)+(this.selectedLI.offsetHeight+n)-this.list.scrollTop,p=this.list.scrollTop+u-h,d=!1;p=e?p+2*parseInt(getComputedStyle(this.list).paddingTop,10):p+parseInt(getComputedStyle(this.list).paddingTop,10);var c=o-a*(this.selectedLI.offsetHeight+n)+(this.selectedLI.offsetHeight+n)-this.list.scrollTop;if(c=this.fields.groupBy&&!t.isNullOrUndefined(this.fixedHeaderElement)?c-this.fixedHeaderElement.offsetHeight:c,0!==this.activeIndex||this.enableVirtualization){if(u>h||!(c>0&&this.list.offsetHeight>c)){var m=this.selectedLI?this.selectedLI.getAttribute("data-value"):null,f="pageDown"===s?this.getPageCount()-2:1;!this.enableVirtualization||this.isKeyBoardAction||i?this.isKeyBoardAction&&this.enableVirtualization&&r&&m===r&&"end"!==s&&!this.isVirtualScrolling?(this.isPreventKeyAction=!0,this.enableVirtualization&&this.itemTemplate?this.list.scrollTop+=p:(this.enableVirtualization&&(f="pageDown"===s?this.getPageCount()+1:f),this.list.scrollTop+=(this.selectedLI.offsetHeight+n)*f),this.isPreventKeyAction=!this.IsScrollerAtEnd()&&this.isPreventKeyAction,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1):this.enableVirtualization&&"end"===s?(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1,this.list.scrollTop=this.list.scrollHeight):("pageDown"===s&&this.enableVirtualization&&!this.isVirtualScrolling&&(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1),this.list.scrollTop=p):this.list.scrollTop=this.virtualListInfo&&this.virtualListInfo.startIndex?e&&this.virtualListInfo.startIndex?this.virtualListInfo.startIndex*this.listItemHeight+2*this.listItemHeight:this.virtualListInfo.startIndex*this.listItemHeight:0,d=this.isKeyBoardAction}}else this.list.scrollTop=0,d=this.isKeyBoardAction;this.isKeyBoardAction=d,this.enableVirtualization&&this.fields.groupBy&&this.fixedHeaderElement&&"down"===s&&setTimeout(function(){l.scrollStop(null,!0)},100)}},s.prototype.scrollTop=function(e){if(void 0===e&&(e=null),!t.isNullOrUndefined(this.selectedLI)){var i=this.selectedLI&&!isNaN(parseInt(window.getComputedStyle(this.selectedLI).marginBottom,10))?parseInt(window.getComputedStyle(this.selectedLI).marginBottom,10):0,s=this.list.querySelectorAll(".e-virtual-list").length,l=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*(this.selectedLI.offsetHeight+i):this.selectedLI.offsetTop,n=l-s*(this.selectedLI.offsetHeight+i)-this.list.scrollTop,a=this.list.querySelector("li.e-list-item:not(.e-virtual-list)")?this.list.querySelector("li.e-list-item:not(.e-virtual-list)").getAttribute("data-value"):null;n=this.fields.groupBy&&!t.isNullOrUndefined(this.fixedHeaderElement)?n-this.fixedHeaderElement.offsetHeight:n;var r=l-s*(this.selectedLI.offsetHeight+i)+(this.selectedLI.offsetHeight+i)-this.list.scrollTop,o=this.enableVirtualization&&"autocomplete"===this.getModuleName()&&n<=0;if(0!==this.activeIndex||this.enableVirtualization)if(n<0||o){var h=this.selectedLI?this.selectedLI.getAttribute("data-value"):null,u="pageUp"===e?this.getPageCount()-2:1;this.enableVirtualization&&(u="pageUp"===e?this.getPageCount():u),this.enableVirtualization&&this.isKeyBoardAction&&a&&h===a&&"home"!==e&&!this.isVirtualScrolling?(this.isUpwardScrolling=!0,this.isPreventKeyAction=!0,this.list.scrollTop-=(this.selectedLI.offsetHeight+i)*u,this.isPreventKeyAction=0!==this.list.scrollTop&&this.isPreventKeyAction,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1):this.enableVirtualization&&"home"===e?(this.isPreventScrollAction=!1,this.isPreventKeyAction=!0,this.isKeyBoardAction=!1,this.list.scrollTo(0,0)):("pageUp"===e&&this.enableVirtualization&&!this.isVirtualScrolling&&(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1),this.list.scrollTop=this.list.scrollTop+n)}else r>0&&this.list.offsetHeight>r||(this.list.scrollTop=this.selectedLI.offsetTop-(this.fields.groupBy&&!t.isNullOrUndefined(this.fixedHeaderElement)?this.fixedHeaderElement.offsetHeight:0));else this.list.scrollTop=0}},s.prototype.IsScrollerAtEnd=function(){return this.list&&this.list.scrollTop+this.list.clientHeight>=this.list.scrollHeight},s.prototype.isEditTextBox=function(){return!1},s.prototype.isFiltering=function(){return this.allowFiltering},s.prototype.isPopupButton=function(){return!0},s.prototype.setScrollPosition=function(e){if(this.isPreventScrollAction=!0,t.isNullOrUndefined(e))this.scrollBottom(!0);else switch(e.action){case"pageDown":case"down":case"end":this.isKeyBoardAction=!0,this.scrollBottom(!1,!1,e.action);break;default:this.isKeyBoardAction="up"===e.action||"pageUp"===e.action||"open"===e.action,this.scrollTop(e.action)}this.isKeyBoardAction=!1},s.prototype.clearText=function(){this.filterInput.value=this.typedString="",this.searchLists(null),this.enableVirtualization&&(this.list.scrollTop=0,this.totalItemCount=this.dataCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.list.getElementsByClassName("e-virtual-ddl")[0]&&(this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight()),this.getSkeletonCount(),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll(".e-list-item"),this.list.getElementsByClassName("e-virtual-ddl-content")[0]&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()))},s.prototype.setEleWidth=function(e){t.isNullOrUndefined(e)||("number"==typeof e?this.inputWrapper.container.style.width=t.formatUnit(e):"string"==typeof e&&(this.inputWrapper.container.style.width=e.match(/px|%|em/)?e:t.formatUnit(e)))},s.prototype.closePopup=function(e,s){var l=this,n=!t.isNullOrUndefined(this.filterInput)&&!t.isNullOrUndefined(this.filterInput.value)&&""!==this.filterInput.value;"combobox"===this.getModuleName()&&this.typedString;if(this.isTyped=!1,this.isVirtualTrackHeight=!1,this.popupObj&&document.body.contains(this.popupObj.element)&&this.beforePopupOpen){this.keyboardEvent=null,t.EventHandler.remove(document,"mousedown",this.onDocumentClick),this.isActive=!1,this.isDropDownClick=!1,this.preventAutoFill=!1;for(var r=0,o=this.popupObj.getScrollableParent(this.inputWrapper.container);r<o.length;r++){var h=o[r];t.EventHandler.remove(h,"scroll",this.scrollHandler)}t.Browser.isDevice&&this.isFilterLayout()&&this.isDeviceFullScreen&&t.removeClass([document.body,this.popupObj.element],q.popupFullScreen),this.isFilterLayout()&&(t.Browser.isDevice||(this.searchKeyModule.destroy(),this.clearIconElement&&t.EventHandler.remove(this.clearIconElement,"click",this.clearText)),this.backIconElement&&(t.EventHandler.remove(this.backIconElement,"click",this.clickOnBackIcon),t.EventHandler.remove(this.clearIconElement,"click",this.clearText)),t.isNullOrUndefined(this.filterInput)||(t.EventHandler.remove(this.filterInput,"input",this.onInput),t.EventHandler.remove(this.filterInput,"keyup",this.onFilterUp),t.EventHandler.remove(this.filterInput,"keydown",this.onFilterDown),t.EventHandler.remove(this.filterInput,"blur",this.onBlurHandler),t.EventHandler.remove(this.filterInput,"paste",this.pasteHandler)),this.allowFiltering&&"dropdownlist"===this.getModuleName()&&(this.filterInput.removeAttribute("aria-activedescendant"),this.filterInput.removeAttribute("aria-disabled"),this.filterInput.removeAttribute("role"),this.filterInput.removeAttribute("autocomplete"),this.filterInput.removeAttribute("autocapitalize"),this.filterInput.removeAttribute("spellcheck")),this.filterInput=null),t.attributes(this.targetElement(),{"aria-expanded":"false"}),this.inputElement.setAttribute("aria-expanded","false"),this.targetElement().removeAttribute("aria-owns"),this.targetElement().removeAttribute("aria-activedescendant"),this.inputWrapper.container.classList.remove(q.iconAnimation),this.isFiltering()&&(this.actionCompleteData.isUpdated=!1),this.enableVirtualization&&(null==this.value||this.isTyped?(this.viewPortInfo.endIndex=this.viewPortInfo&&this.viewPortInfo.endIndex>0?this.viewPortInfo.endIndex:this.itemCount,("autocomplete"===this.getModuleName()||"dropdownlist"===this.getModuleName()&&!t.isNullOrUndefined(this.typedString)&&""!==this.typedString||"combobox"===this.getModuleName()&&this.allowFiltering&&!t.isNullOrUndefined(this.typedString)&&""!==this.typedString)&&this.checkAndResetCache()):"autocomplete"===this.getModuleName()&&this.checkAndResetCache(),"dropdownlist"!==this.getModuleName()&&"combobox"!==this.getModuleName()||0===this.skeletonCount||this.getSkeletonCount(!0)),this.beforePopupOpen=!1;var u={name:"FadeOut",duration:100,delay:e||0},p={popup:this.popupObj,cancel:!1,animation:u,event:s||null};this.trigger("close",p,function(e){if("dropdownlist"===l.getModuleName()&&a.Input.destroy({element:l.filterInput,floatLabelType:l.floatLabelType,properties:{placeholder:l.filterBarPlaceholder},buttons:l.clearIconElement},l.clearIconElement),l.filterInputObj=null,!t.isNullOrUndefined(l.popupObj)&&!t.isNullOrUndefined(l.popupObj.element.querySelector(".e-fixed-head"))){var i=l.popupObj.element.querySelector(".e-fixed-head");i.parentNode.removeChild(i),l.fixedHeaderElement=null}e.cancel||("autocomplete"===l.getModuleName()&&l.rippleFun(),l.isPopupOpen?(l.isPopupRender=!1,l.popupObj.hide(new t.Animation(e.animation))):l.destroyPopup())}),t.Browser.isDevice&&!p.cancel&&this.popupObj.element.classList.contains("e-wide-popup")&&this.popupObj.element.classList.remove("e-wide-popup");var d;d=this.dataSource instanceof i.DataManager?this.remoteDataCount:this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.customFilterQuery=null,this.enableVirtualization&&this.isFiltering()&&n&&this.totalItemCount!==d&&(this.updateInitialData(),this.checkAndResetCache())}},s.prototype.updateInitialData=function(){var e=this.selectData;if(!t.isNullOrUndefined(e)){var s=this.renderItems(e,this.fields);if(this.list.scrollTop=0,this.virtualListInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount},"combobox"===this.getModuleName()&&(this.typedString=""),this.previousStartIndex=0,this.previousEndIndex=0,this.dataSource instanceof i.DataManager?this.remoteDataCount>=0?this.totalItemCount=this.dataCount=this.remoteDataCount:this.resetList(this.dataSource):this.totalItemCount=this.dataCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.list.getElementsByClassName("e-virtual-ddl")[0])this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight();else if(!this.list.querySelector(".e-virtual-ddl")&&this.list.parentElement){var l=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"});l.style.cssText=this.GetVirtualTrackHeight(),this.list.parentElement.querySelector(".e-dropdownbase").appendChild(l)}"autocomplete"!==this.getModuleName()&&0!==this.totalItemCount&&this.totalItemCount>2*this.itemCount&&this.getSkeletonCount(),this.UpdateSkeleton(),this.listData=e,this.updateActionCompleteDataValues(s,e),this.liCollections=this.list.querySelectorAll(".e-list-item"),this.list.getElementsByClassName("e-virtual-ddl-content")[0]&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues())}},s.prototype.destroyPopup=function(){this.isPopupOpen=!1,this.isFilterFocus=!1,this.inputElement.removeAttribute("aria-controls"),this.popupObj&&(this.resizer&&(t.EventHandler.remove(this.resizer,"mousedown",this.startResizing),t.EventHandler.remove(this.resizer,"touchstart",this.startResizing)),this.popupObj.destroy(),t.detach(this.popupObj.element))},s.prototype.clickOnBackIcon=function(){this.hidePopup(),this.focusIn()},s.prototype.render=function(){this.preselectedIndex=t.isNullOrUndefined(this.index)?null:this.index,"INPUT"===this.element.tagName?(this.inputElement=this.element,t.isNullOrUndefined(this.inputElement.getAttribute("role"))&&this.inputElement.setAttribute("role","combobox"),t.isNullOrUndefined(this.inputElement.getAttribute("type"))&&this.inputElement.setAttribute("type","text"),this.inputElement.setAttribute("aria-expanded","false")):(this.inputElement=this.createElement("input",{attrs:{role:"combobox",type:"text"}}),this.element.tagName!==this.getNgDirective()&&(this.element.style.display="none"),this.element.parentElement.insertBefore(this.inputElement,this.element),this.preventTabIndex(this.inputElement));var e=this.cssClass;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),!t.isNullOrUndefined(t.closest(this.element,"fieldset"))&&t.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.inputWrapper=a.Input.createInput({element:this.inputElement,buttons:this.isPopupButton()?[q.icon]:null,floatLabelType:this.floatLabelType,properties:{readonly:"dropdownlist"===this.getModuleName()||this.readonly,placeholder:this.placeholder,cssClass:e,enabled:this.enabled,enableRtl:this.enableRtl,showClearButton:this.showClearButton}},this.createElement),this.element.tagName===this.getNgDirective()?this.element.appendChild(this.inputWrapper.container):this.inputElement.parentElement.insertBefore(this.element,this.inputElement),this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",tabindex:"-1",class:q.hiddenElement}}),t.prepend([this.hiddenElement],this.inputWrapper.container),this.hiddenElement.hasAttribute("aria-label")||this.hiddenElement.setAttribute("aria-label",this.getModuleName()),this.validationAttribute(this.element,this.hiddenElement),this.setReadOnly(),this.setFields(),this.inputWrapper.container.style.width=t.formatUnit(this.width),this.inputWrapper.container.classList.add("e-ddl"),"Never"!==this.floatLabelType&&a.Input.calculateWidth(this.inputElement,this.inputWrapper.container),!t.isNullOrUndefined(this.inputWrapper.buttons[0])&&this.inputWrapper.container.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType&&this.inputWrapper.container.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon"),this.wireEvent(),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex");var i=this.element.getAttribute("id")?this.element.getAttribute("id"):t.getUniqueID("ej2_dropdownlist");if(this.element.id=i,this.hiddenElement.id=i+"_hidden",this.targetElement().setAttribute("tabindex",this.tabIndex),"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.readonly?"dropdownlist"===this.getModuleName()&&(this.targetElement().hasAttribute("aria-label")||t.attributes(this.targetElement(),{"aria-label":this.getModuleName()}),this.inputElement.hasAttribute("aria-label")||this.inputElement.setAttribute("aria-label",this.getModuleName()),this.inputElement.setAttribute("aria-expanded","false")):this.inputElement.hasAttribute("aria-label")||this.inputElement.setAttribute("aria-label",this.getModuleName()),t.attributes(this.targetElement(),this.getAriaAttributes()),this.updateDataAttribute(this.htmlAttributes),this.setHTMLAttributes(),this.targetElement()===this.inputElement&&this.inputElement.removeAttribute("aria-labelledby"),null!==this.value||null!==this.activeIndex||null!==this.text)this.enableVirtualization&&(this.listItemHeight=this.getListHeight(),this.getSkeletonCount(),this.updateVirtualizationProperties(this.itemCount,this.allowFiltering),null!==this.index&&(this.activeIndex=this.index+this.skeletonCount)),this.initValue(),this.selectedValueInfo=this.viewPortInfo,this.enableVirtualization&&(this.activeIndex=this.activeIndex+this.skeletonCount);else if("SELECT"===this.element.tagName&&this.element.options[0]){var s=this.element;this.value=this.allowObjectBinding?this.getDataByValue(s.options[s.selectedIndex].value):s.options[s.selectedIndex].value,this.text=t.isNullOrUndefined(this.value)?null:s.options[s.selectedIndex].textContent,this.initValue()}this.setEnabled(),this.preventTabIndex(this.element),this.enabled||(this.targetElement().tabIndex=-1),this.initial=!1,this.element.style.opacity="",this.inputElement.onselect=function(e){e.stopImmediatePropagation()},this.inputElement.onchange=function(e){e.stopImmediatePropagation()},this.element.hasAttribute("autofocus")&&this.focusIn(),t.isNullOrUndefined(this.text)||this.inputElement.setAttribute("value",this.text),this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false");var l=this.inputWrapper.container.getElementsByClassName("e-float-text")[0];t.isNullOrUndefined(this.element.id)||""===this.element.id||t.isNullOrUndefined(l)||(l.id="label_"+this.element.id.replace(/ /g,"_"),t.attributes(this.inputElement,{"aria-labelledby":l.id})),this.renderComplete(),this.listItemHeight=this.getListHeight(),this.getSkeletonCount(),this.enableVirtualization&&this.updateVirtualizationProperties(this.itemCount,this.allowFiltering),this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=this.viewPortInfo.startIndex>0?this.viewPortInfo.endIndex:this.itemCount},s.prototype.getListHeight=function(){var e=this.createElement("div",{className:"e-dropdownbase"}),i=this.createElement("li",{className:"e-list-item"}),s=t.formatUnit(this.popupHeight);e.style.height=parseInt(s,10).toString()+"px",e.appendChild(i),document.body.appendChild(e),this.virtualListHeight=e.getBoundingClientRect().height;var l=Math.ceil(i.getBoundingClientRect().height)+parseInt(window.getComputedStyle(i).marginBottom,10);return e.remove(),l},s.prototype.setFooterTemplate=function(e){var i;this.footer?this.isReact&&"function"==typeof this.footerTemplate?this.clearTemplate(["footerTemplate"]):this.footer.innerHTML="":(this.footer=this.createElement("div"),t.addClass([this.footer],q.footer));var s=this.dropdownCompiler(this.footerTemplate),l=(i="function"!=typeof this.footerTemplate&&s?t.compile(t.select(this.footerTemplate,document).innerHTML.trim()):t.compile(this.footerTemplate))({},this,"footerTemplate",this.footerTemplateId,this.isStringTemplate,null,this.footer);l&&l.length>0&&t.append(l,this.footer),t.append([this.footer],e)},s.prototype.setHeaderTemplate=function(e){var i;this.header?this.header.innerHTML="":(this.header=this.createElement("div"),t.addClass([this.header],q.header));var s=this.dropdownCompiler(this.headerTemplate),l=(i="function"!=typeof this.headerTemplate&&s?t.compile(t.select(this.headerTemplate,document).innerHTML.trim()):t.compile(this.headerTemplate))({},this,"headerTemplate",this.headerTemplateId,this.isStringTemplate,null,this.header);l&&l.length&&t.append(l,this.header);var n=e.querySelector("div.e-content");e.insertBefore(this.header,n)},s.prototype.setEnabled=function(){this.element.setAttribute("aria-disabled",this.enabled?"false":"true")},s.prototype.setOldText=function(e){this.text=e},s.prototype.setOldValue=function(e){this.value=e},s.prototype.refreshPopup=function(){t.isNullOrUndefined(this.popupObj)||!document.body.contains(this.popupObj.element)||(!this.allowFiltering||t.Browser.isDevice&&this.isFilterLayout())&&"autocomplete"!==this.getModuleName()||(t.removeClass([this.popupObj.element],"e-popup-close"),this.popupObj.refreshPosition(this.inputWrapper.container),this.popupObj.resolveCollision())},s.prototype.checkData=function(e){!e.dataSource||t.isNullOrUndefined(Object.keys(e.dataSource))||!this.itemTemplate||!this.allowFiltering||this.isListSearched&&e.dataSource instanceof i.DataManager||(this.list&&!this.isReact?this.list.innerHTML="":this.list=null,this.actionCompleteData={ulElement:null,list:null,isUpdated:!1}),this.isListSearched=!1;var s=-1!==Object.keys(e).indexOf("value")&&t.isNullOrUndefined(e.value),l=-1!==Object.keys(e).indexOf("text")&&t.isNullOrUndefined(e.text);"autocomplete"!==this.getModuleName()&&this.allowFiltering&&(s||l)&&(this.itemData=null),this.allowFiltering&&e.dataSource&&!t.isNullOrUndefined(Object.keys(e.dataSource))?(this.actionCompleteData={ulElement:null,list:null,isUpdated:!1},this.actionData=this.actionCompleteData):this.allowFiltering&&e.query&&!t.isNullOrUndefined(Object.keys(e.query))&&(this.actionCompleteData="combobox"===this.getModuleName()?{ulElement:null,list:null,isUpdated:!1}:this.actionCompleteData,this.actionData=this.actionCompleteData)},s.prototype.updateDataSource=function(e,s){""===this.inputElement.value&&(t.isNullOrUndefined(e)||!t.isNullOrUndefined(e.dataSource)&&(e.dataSource instanceof i.DataManager||0!==e.dataSource.length))||this.clearAll(null,e),this.fields.groupBy&&e.fields&&!this.isGroupChecking&&this.list&&(t.EventHandler.remove(this.list,"scroll",this.setFloatingHeader),t.EventHandler.add(this.list,"scroll",this.setFloatingHeader,this)),(t.isNullOrUndefined(e)||!t.isNullOrUndefined(e.dataSource)&&(e.dataSource instanceof i.DataManager||0!==e.dataSource.length)||e.dataSource instanceof i.DataManager||!t.isNullOrUndefined(e)&&Array.isArray(e.dataSource)&&!t.isNullOrUndefined(s)&&Array.isArray(s.dataSource)&&e.dataSource.length!==s.dataSource.length)&&(this.typedString="",this.resetList(this.dataSource)),this.isCustomFilter||this.isFilterFocus||document.activeElement===this.filterInput||this.checkCustomValue()},s.prototype.checkCustomValue=function(){var e=this.allowObjectBinding&&!t.isNullOrUndefined(this.value)?t.getValue(this.fields.value?this.fields.value:"",this.value):this.value;this.itemData=this.getDataByValue(e);var i=this.getItemData(),s=this.allowObjectBinding?this.itemData:i.value,l=t.isNullOrUndefined(s)?null:this.index;t.isNullOrUndefined(l)&&e===s||this.isAngular?this.setProperties({text:i.text?i.text.toString():i.text,value:s}):this.setProperties({text:i.text?i.text.toString():i.text,index:l,value:s})},s.prototype.updateInputFields=function(){"dropdownlist"===this.getModuleName()&&a.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton)},s.prototype.onPropertyChanged=function(s,l){var n=this;t.isNullOrUndefined(s.dataSource)||this.isTouched||!t.isNullOrUndefined(s.value)||!t.isNullOrUndefined(s.index)||t.isNullOrUndefined(this.preselectedIndex)||t.isNullOrUndefined(this.index)||(s.index=this.index),t.isNullOrUndefined(s.value)&&t.isNullOrUndefined(s.index)||(this.isTouched=!0),"dropdownlist"===this.getModuleName()&&(this.checkData(s),this.setUpdateInitial(["fields","query","dataSource"],s));for(var r=this,o=0,h=Object.keys(s);o<h.length;o++){var u=function(o){switch(o){case"query":case"dataSource":r.getSkeletonCount(),r.checkAndResetCache();break;case"htmlAttributes":r.setHTMLAttributes();break;case"width":r.setEleWidth(s.width),a.Input.calculateWidth(r.inputElement,r.inputWrapper.container);break;case"placeholder":a.Input.setPlaceholder(s.placeholder,r.inputElement);break;case"filterBarPlaceholder":r.filterInput&&a.Input.setPlaceholder(s.filterBarPlaceholder,r.filterInput);break;case"readonly":"dropdownlist"!==r.getModuleName()&&a.Input.setReadonly(s.readonly,r.inputElement),r.setReadOnly();break;case"cssClass":r.setCssClass(s.cssClass,l.cssClass),a.Input.calculateWidth(r.inputElement,r.inputWrapper.container);break;case"enableRtl":r.setEnableRtl();break;case"enabled":r.setEnable();break;case"text":if(r.fields.disabled&&(s.text=s.text&&!r.isDisabledItemByIndex(r.getIndexByValue(r.getValueByText(s.text)))?s.text:null),null===s.text){r.clearAll();break}if(r.enableVirtualization){r.updateValues(),r.updateInputFields(),r.notify("setCurrentViewDataAsync",{module:"VirtualScroll"});break}if(r.list||(r.dataSource instanceof i.DataManager&&(r.initialRemoteRender=!0),r.renderList()),!r.initialRemoteRender){var h=r.getElementByText(s.text);if(!r.checkValidLi(h))if(r.liCollections&&100===r.liCollections.length&&"autocomplete"===r.getModuleName()&&r.listData.length>100)r.setSelectionData(s.text,l.text,"text");else if(s.text&&r.dataSource instanceof i.DataManager){var u=r.getItems().length,p=t.isNullOrUndefined(r.fields.text)?r.fields.value:r.fields.text;r.typedString="",r.dataSource.executeQuery(r.getQuery(r.query).where(new i.Predicate(p,"equal",s.text))).then(function(e){e.result.length>0?(n.addItem(e.result,u),n.updateValues()):n.setOldText(l.text)})}else"autocomplete"===r.getModuleName()?r.setInputValue(s,l):r.setOldText(l.text);r.updateInputFields()}break;case"value":if(r.fields.disabled&&(s.value=null==s.value||r.isDisableItemValue(s.value)?null:s.value),null===s.value){r.clearAll();break}if(r.allowObjectBinding&&!t.isNullOrUndefined(s.value)&&!t.isNullOrUndefined(l.value)&&r.isObjectInArray(s.value,[l.value]))return{value:void 0};if(r.enableVirtualization){r.updateValues(),r.updateInputFields(),r.notify("setCurrentViewDataAsync",{module:"VirtualScroll"}),r.preventChange=r.isAngular&&r.preventChange?!r.preventChange:r.preventChange;break}if(r.notify("beforeValueChange",{newProp:s}),r.list||(r.dataSource instanceof i.DataManager&&(r.initialRemoteRender=!0),r.renderList()),!r.initialRemoteRender){var d=r.allowObjectBinding&&!t.isNullOrUndefined(s.value)?t.getValue(r.fields.value?r.fields.value:"",s.value):s.value,c=r.getElementByValue(d);if(!r.checkValidLi(c))if(r.liCollections&&100===r.liCollections.length&&"autocomplete"===r.getModuleName()&&r.listData.length>100)r.setSelectionData(s.value,l.value,"value");else if(s.value&&r.dataSource instanceof i.DataManager){var m=r.getItems().length,p=t.isNullOrUndefined(r.fields.value)?r.fields.text:r.fields.value;r.typedString="";var f=r.allowObjectBinding&&!t.isNullOrUndefined(s.value)?t.getValue(p,s.value):s.value;r.dataSource.executeQuery(r.getQuery(r.query).where(new i.Predicate(p,"equal",f))).then(function(e){e.result.length>0?(n.addItem(e.result,m),n.updateValues()):n.setOldValue(l.value)})}else"autocomplete"===r.getModuleName()?r.setInputValue(s,l):r.setOldValue(l.value);r.updateInputFields(),r.preventChange=r.isAngular&&r.preventChange?!r.preventChange:r.preventChange}break;case"index":if(r.fields.disabled&&(s.index=null==s.index||r.isDisabledItemByIndex(s.index)?null:s.index),null===s.index){r.clearAll();break}if(r.list||(r.dataSource instanceof i.DataManager&&(r.initialRemoteRender=!0),r.renderList()),!r.initialRemoteRender&&r.liCollections){var v=r.liCollections[s.index];r.checkValidLi(v)||(r.liCollections&&100===r.liCollections.length&&"autocomplete"===r.getModuleName()&&r.listData.length>100?r.setSelectionData(s.index,l.index,"index"):r.index=l.index),r.updateInputFields()}break;case"footerTemplate":r.popupObj&&r.setFooterTemplate(r.popupObj.element);break;case"headerTemplate":r.popupObj&&r.setHeaderTemplate(r.popupObj.element);break;case"valueTemplate":t.isNullOrUndefined(r.itemData)||null===r.valueTemplate||r.setValueTemplate();break;case"allowFiltering":r.allowFiltering&&(r.actionCompleteData={ulElement:r.ulElement,list:r.listData,isUpdated:!0},r.actionData=r.actionCompleteData,r.updateSelectElementData(r.allowFiltering));break;case"floatLabelType":a.Input.removeFloating(r.inputWrapper),a.Input.addFloating(r.inputElement,s.floatLabelType,r.placeholder,r.createElement),!t.isNullOrUndefined(r.inputWrapper.buttons[0])&&r.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0]&&"Never"!==r.floatLabelType&&r.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon");break;case"showClearButton":r.inputWrapper.clearButton||(a.Input.setClearButton(s.showClearButton,r.inputElement,r.inputWrapper,null,r.createElement),r.bindClearEvent());break;default:var g=r.getPropObject(o,s,l);e.prototype.onPropertyChanged.call(r,g.newProperty,g.oldProperty)}}(h[o]);if("object"==typeof u)return u.value}},s.prototype.checkValidLi=function(e){return!!this.isValidLI(e)&&(this.setSelection(e,null),!0)},s.prototype.setSelectionData=function(e,i,s){var l,n=this;this.updateListValues=function(){if("text"===s)l=n.getElementByText(e),n.checkValidLi(l)||n.setOldText(i);else if("value"===s){var a=n.fields.value?n.fields.value:"";n.allowObjectBinding&&!t.isNullOrUndefined(e)&&t.getValue(a,e);l=n.getElementByValue(e),n.checkValidLi(l)||n.setOldValue(i)}else"index"===s&&(l=n.liCollections[e],n.checkValidLi(l)||(n.index=i))}},s.prototype.updatePopupState=function(){this.beforePopupOpen&&(this.beforePopupOpen=!1,this.showPopup())},s.prototype.setReadOnly=function(){this.readonly?t.addClass([this.inputWrapper.container],["e-readonly"]):t.removeClass([this.inputWrapper.container],["e-readonly"])},s.prototype.setInputValue=function(e,t){},s.prototype.setCssClass=function(e,i){t.isNullOrUndefined(i)||(i=i.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),a.Input.setCssClass(e,[this.inputWrapper.container],i),this.popupObj&&a.Input.setCssClass(e,[this.popupObj.element],i)},s.prototype.getModuleName=function(){return"dropdownlist"},s.prototype.showPopup=function(e){if(this.enabled){if("dropdownlist"===this.getModuleName()&&this.beforePopupOpen&&!this.isPopupOpen&&(this.beforePopupOpen=!1),this.firstItem=this.dataSource&&this.dataSource.length>0?this.dataSource[0]:null,this.isReact&&"combobox"===this.getModuleName()&&this.itemTemplate&&this.isCustomFilter&&this.isAddNewItemTemplate&&(this.renderList(),this.isAddNewItemTemplate=!1),this.isFiltering()&&this.dataSource instanceof i.DataManager&&this.actionData.list!==this.actionCompleteData.list&&this.actionData.list&&this.actionData.ulElement&&(this.actionCompleteData=this.actionData,this.onActionComplete(this.actionCompleteData.ulElement,this.actionCompleteData.list,null,!0)),this.beforePopupOpen)return void this.refreshPopup();this.beforePopupOpen=!0,this.isFiltering()&&!this.isActive&&this.actionCompleteData.list&&this.actionCompleteData.list[0]?(this.isActive=!0,this.onActionComplete(this.actionCompleteData.ulElement,this.actionCompleteData.list,null,!0)):(t.isNullOrUndefined(this.list)||!t.isUndefined(this.list)&&(this.list.classList.contains(H.noData)||this.list.querySelectorAll("."+H.li).length<=0))&&(this.isReact&&this.isFiltering()&&null!=this.itemTemplate&&(this.isSecondClick=!1),this.renderList(e)),this.enableVirtualization&&this.listData&&this.listData.length&&(t.isNullOrUndefined(this.value)||"dropdownlist"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.removeHover(),this.beforePopupOpen||this.notify("setCurrentViewDataAsync",{module:"VirtualScroll"})),this.beforePopupOpen&&this.invokeRenderPopup(e),this.enableVirtualization&&!this.allowFiltering&&null!=this.selectedValueInfo&&this.selectedValueInfo.startIndex>0&&null!=this.value&&this.notify("dataProcessAsync",{module:"VirtualScroll",isOpen:!0}),this.isSecondClick||this.isDropDownClick||this.executeCloneElements()}},s.prototype.executeCloneElements=function(){var e=this,t=this.element.tagName===this.getNgDirective()&&this.itemTemplate?500:100;this.isReact&&this.isFiltering()&&null!=this.itemTemplate&&setTimeout(function(){e.cloneElements(),e.isSecondClick=!(e.isReact&&e.isFiltering()&&e.dataSource instanceof i.DataManager&&!e.list.querySelector("ul"))},t)},s.prototype.invokeRenderPopup=function(e){if(t.Browser.isDevice&&this.isFilterLayout()){var i=this;window.onpopstate=function(){i.hidePopup()},history.pushState({},"")}t.isNullOrUndefined(this.list)||t.isNullOrUndefined(this.list.children[0])&&!this.list.classList.contains(H.noData)||this.renderPopup(e)},s.prototype.renderHightSearch=function(){},s.prototype.hidePopup=function(e){if(this.isEscapeKey&&"dropdownlist"===this.getModuleName())if(t.isNullOrUndefined(this.inputElement)||a.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton),this.isEscapeKey=!1,t.isNullOrUndefined(this.index))this.resetSelection();else{var i=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",this.value):this.value,s=this.findListElement(this.ulElement,"li","data-value",i);this.selectedLI=this.liCollections[this.index]||s,this.selectedLI&&(this.updateSelectedItem(this.selectedLI,null,!0),this.valueTemplate&&null!==this.itemData&&this.setValueTemplate())}this.isVirtualTrackHeight=!1,this.customFilterQuery=null,this.closePopup(0,e);var l=this.getItemData(),n=!t.isNullOrUndefined(this.selectedLI);n&&this.enableVirtualization&&this.selectedLI.classList&&(n=this.selectedLI.classList.contains("e-active")),this.inputElement&&""===this.inputElement.value&&!this.isInteracted&&(this.isSelectCustom||n&&this.inputElement.value!==l.text)&&(this.isSelectCustom=!1,this.clearAll(e))},s.prototype.focusIn=function(e){if(this.enabled&&!this.targetElement().classList.contains(q.disable)){var i=!1;this.preventFocus&&t.Browser.isDevice&&(this.inputWrapper.container.tabIndex=1,this.inputWrapper.container.focus(),this.preventFocus=!1,i=!0),i||this.targetElement().focus(),t.addClass([this.inputWrapper.container],[q.inputFocus]),this.onFocus(e),"Never"!==this.floatLabelType&&a.Input.calculateWidth(this.inputElement,this.inputWrapper.container)}},s.prototype.focusOut=function(e){this.enabled&&(this.enableVirtualization||"combobox"!==this.getModuleName()&&"autocomplete"!==this.getModuleName()||(this.isTyped=!0),this.hidePopup(e),this.targetElement()&&this.targetElement().blur(),t.removeClass([this.inputWrapper.container],[q.inputFocus]),"Never"!==this.floatLabelType&&a.Input.calculateWidth(this.inputElement,this.inputWrapper.container))},s.prototype.disableItem=function(e){if(this.fields.disabled){this.list||this.renderList();var t=-1;if(this.liCollections&&this.liCollections.length>0&&this.listData&&this.fields.disabled){if("string"==typeof e)t=this.getIndexByValue(e);else if("object"==typeof e){if(e instanceof HTMLLIElement){for(s=0;s<this.liCollections.length;s++)if(this.liCollections[s]===e){t=this.getIndexByValue(e.getAttribute("data-value"));break}}else for(var i=JSON.parse(JSON.stringify(e))[this.fields.value],s=0;s<this.listData.length;s++)if(JSON.parse(JSON.stringify(this.listData[s]))[this.fields.value]===i){t=this.getIndexByValue(i);break}}else t=e;if(t<this.liCollections.length&&t>-1&&!JSON.parse(JSON.stringify(this.listData[t]))[this.fields.disabled]){var l=this.liCollections[t];if(l){this.disableListItem(l);var n=JSON.parse(JSON.stringify(this.listData[t]));n[this.fields.disabled]=!0,this.listData[t]=n,this.dataSource=this.listData,l.classList.contains(q.focus)&&this.removeFocus(),l.classList.contains(q.selected)&&this.clear()}}}}},s.prototype.destroy=function(){if(this.isActive=!1,this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),d(this.element.id),this.isReact&&this.clearTemplate(),this.hidePopup(),this.popupObj&&(this.isPopupRender=!1,this.popupObj.hide()),this.unWireEvent(),this.list&&this.unWireListEvents(),!this.element||this.element.classList.contains("e-"+this.getModuleName())){if(this.inputElement){for(var i=["readonly","aria-disabled","placeholder","aria-labelledby","aria-expanded","autocomplete","aria-readonly","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-describedby","aria-label"],s=0;s<i.length;s++)this.inputElement.removeAttribute(i[s]);this.inputElement.setAttribute("tabindex",this.tabIndex),this.inputElement.classList.remove("e-input"),a.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton)}this.element.removeAttribute("tabindex"),this.element.style.display="block",this.inputWrapper.container&&this.inputWrapper.container.parentElement&&(this.inputWrapper.container.parentElement.tagName===this.getNgDirective()?t.detach(this.inputWrapper.container):(this.inputWrapper.container.parentElement.insertBefore(this.element,this.inputWrapper.container),t.detach(this.inputWrapper.container))),delete this.hiddenElement,this.filterInput=null,this.keyboardModule=null,this.ulElement=null,this.list=null,this.clearIconElement=null,this.popupObj=null,this.popupContentElement=null,this.rippleFun=null,this.selectedLI=null,this.liCollections=null,this.item=null,this.footer=null,this.header=null,this.previousSelectedLI=null,this.valueTempElement=null,this.actionData.ulElement=null,this.inputElement&&!t.isNullOrUndefined(this.inputElement.onchange)&&(this.inputElement.onchange=null),this.inputElement&&!t.isNullOrUndefined(this.inputElement.onselect)&&(this.inputElement.onselect=null),a.Input.destroy({element:this.inputElement,floatLabelType:this.floatLabelType,properties:this.properties,buttons:this.inputWrapper.container.querySelectorAll(".e-input-group-icon")[0]},this.clearButton),this.clearButton=null,this.inputElement=null,this.inputWrapper=null,e.prototype.destroy.call(this)}},s.prototype.getItems=function(){return this.list||(this.dataSource instanceof i.DataManager&&(this.initialRemoteRender=!0),this.renderList()),this.ulElement?e.prototype.getItems.call(this):[]},s.prototype.getDataByValue=function(t){return e.prototype.getDataByValue.call(this,t)},s.prototype.clear=function(){this.value=null},W([t.Property(null)],s.prototype,"cssClass",void 0),W([t.Property("100%")],s.prototype,"width",void 0),W([t.Property(!0)],s.prototype,"enabled",void 0),W([t.Property(!1)],s.prototype,"enablePersistence",void 0),W([t.Property("300px")],s.prototype,"popupHeight",void 0),W([t.Property("100%")],s.prototype,"popupWidth",void 0),W([t.Property(null)],s.prototype,"placeholder",void 0),W([t.Property(null)],s.prototype,"filterBarPlaceholder",void 0),W([t.Property({})],s.prototype,"htmlAttributes",void 0),W([t.Property(null)],s.prototype,"query",void 0),W([t.Property(null)],s.prototype,"valueTemplate",void 0),W([t.Property(null)],s.prototype,"headerTemplate",void 0),W([t.Property(null)],s.prototype,"footerTemplate",void 0),W([t.Property(!1)],s.prototype,"allowFiltering",void 0),W([t.Property(300)],s.prototype,"debounceDelay",void 0),W([t.Property(!0)],s.prototype,"isDeviceFullScreen",void 0),W([t.Property(!1)],s.prototype,"readonly",void 0),W([t.Property(!1)],s.prototype,"enableVirtualization",void 0),W([t.Property(!1)],s.prototype,"allowResize",void 0),W([t.Property(null)],s.prototype,"text",void 0),W([t.Property(null)],s.prototype,"value",void 0),W([t.Property(!1)],s.prototype,"allowObjectBinding",void 0),W([t.Property(null)],s.prototype,"index",void 0),W([t.Property("Never")],s.prototype,"floatLabelType",void 0),W([t.Property(!1)],s.prototype,"showClearButton",void 0),W([t.Event()],s.prototype,"filtering",void 0),W([t.Event()],s.prototype,"change",void 0),W([t.Event()],s.prototype,"beforeOpen",void 0),W([t.Event()],s.prototype,"open",void 0),W([t.Event()],s.prototype,"close",void 0),W([t.Event()],s.prototype,"blur",void 0),W([t.Event()],s.prototype,"focus",void 0),W([t.Event()],s.prototype,"resizeStop",void 0),W([t.Event()],s.prototype,"resizing",void 0),W([t.Event()],s.prototype,"resizeStart",void 0),s=W([t.NotifyPropertyChanges],s)}(U),R=function(){var e=function(t,i){return(e=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])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),z=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(l=e[r])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},K="e-input-group-icon e-ddt-icon e-icons",G="e-show-chip",_="e-show-clear",Q="e-chip-input",J="e-input-focus",X="e-icon-hide",Y="e-check",$="e-no-data",Z="e-show-text",ee=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return R(i,e),z([t.Property("child")],i.prototype,"child",void 0),z([t.Property([])],i.prototype,"dataSource",void 0),z([t.Property("expanded")],i.prototype,"expanded",void 0),z([t.Property("hasChildren")],i.prototype,"hasChildren",void 0),z([t.Property("htmlAttributes")],i.prototype,"htmlAttributes",void 0),z([t.Property("iconCss")],i.prototype,"iconCss",void 0),z([t.Property("imageUrl")],i.prototype,"imageUrl",void 0),z([t.Property("parentValue")],i.prototype,"parentValue",void 0),z([t.Property(null)],i.prototype,"query",void 0),z([t.Property("selectable")],i.prototype,"selectable",void 0),z([t.Property("selected")],i.prototype,"selected",void 0),z([t.Property(null)],i.prototype,"tableName",void 0),z([t.Property("text")],i.prototype,"text",void 0),z([t.Property("tooltip")],i.prototype,"tooltip",void 0),z([t.Property("value")],i.prototype,"value",void 0),i}(t.ChildProperty),te=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return R(i,e),z([t.Property(!1)],i.prototype,"autoCheck",void 0),z([t.Property(!0)],i.prototype,"checkDisabledChildren",void 0),z([t.Property("Auto")],i.prototype,"expandOn",void 0),z([t.Property(!1)],i.prototype,"loadOnDemand",void 0),i}(t.ChildProperty),ie=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.filterTimer=null,s.isFilteredData=!1,s.isFilterRestore=!1,s.selectedData=[],s.filterDelayTime=300,s.isClicked=!1,s.documentClickContext=s.onDocumentClick.bind(s),s.isCheckAllCalled=!1,s.isFromFilterChange=!1,s}return R(s,e),s.prototype.getPersistData=function(){var e=["value"];return this.addOnPersist(e)},s.prototype.getLocaleName=function(){return"drop-down-tree"},s.prototype.preRender=function(){this.inputFocus=!1,this.isPopupOpen=!1,this.isFirstRender=!0,this.isInitialized=!1,this.currentText=null,this.currentValue=null,this.oldValue=null,this.removeValue=!1,this.selectedText=[],this.treeItems=[],this.dataValue=null,this.isNodeSelected=!1,this.isDynamicChange=!1,this.clearIconWidth=0,this.headerTemplateId=this.element.id+"HeaderTemplate",this.footerTemplateId=this.element.id+"FooterTemplate",this.actionFailureTemplateId=this.element.id+"ActionFailureTemplate",this.noRecordsTemplateId=this.element.id+"NoRecordsTemplate",this.customTemplateId=this.element.id+"CustomTemplate",this.keyConfigs={escape:"escape",altUp:"alt+uparrow",altDown:"alt+downarrow",tab:"tab",shiftTab:"shift+tab",end:"end",enter:"enter",home:"home",moveDown:"downarrow",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",ctrlDown:"ctrl+downarrow",ctrlUp:"ctrl+uparrow",ctrlEnter:"ctrl+enter",ctrlHome:"ctrl+home",ctrlEnd:"ctrl+end",shiftDown:"shift+downarrow",shiftUp:"shift+uparrow",shiftEnter:"shift+enter",shiftHome:"shift+home",shiftEnd:"shift+end",csDown:"ctrl+shift+downarrow",csUp:"ctrl+shift+uparrow",csEnter:"ctrl+shift+enter",csHome:"ctrl+shift+home",csEnd:"ctrl+shift+end",space:"space",ctrlA:"ctrl+A"}},s.prototype.render=function(){var e=t.select("#"+this.element.id+"_tree",document);if(e){var s=t.select("#"+this.element.id+"_options",document);t.detach(s||e.parentElement)}"INPUT"===this.element.tagName?(this.inputEle=this.element,t.isNullOrUndefined(this.inputEle.getAttribute("role"))&&(this.inputEle.setAttribute("aria-expanded","false"),this.inputEle.setAttribute("role","combobox"),this.inputEle.setAttribute("aria-haspopup","tree"),this.inputEle.setAttribute("aria-controls",this.element.id+"_options")),t.isNullOrUndefined(this.inputEle.getAttribute("type"))&&this.inputEle.setAttribute("type","text")):(t.isNullOrUndefined(this.element.id)?this.inputEle=this.createElement("input",{attrs:{role:"textbox",type:"text"}}):this.inputEle=this.createElement("input",{attrs:{role:"textbox",type:"text",id:this.element.id+"_textbox"}}),this.element.parentElement.insertBefore(this.inputEle,this.element)),this.inputObj=a.Input.createInput({element:this.inputEle,floatLabelType:this.floatLabelType,buttons:this.showDropDownIcon?[K]:null,properties:{readonly:!0,placeholder:this.placeholder,enabled:this.enabled,cssClass:this.cssClass,enableRtl:this.enableRtl}},this.createElement),this.inputWrapper=this.inputObj.container,this.inputWrapper.classList.contains("e-input-group")||this.inputWrapper.classList.add("e-input-group"),this.showDropDownIcon&&this.inputWrapper.classList.add("e-show-dd-icon"),this.element.tagName===this.getDirective()&&this.element.appendChild(this.inputWrapper),this.createHiddenElement(),this.createClearIcon(),this.inputWrapper.classList.add("e-ddt"),this.setElementWidth(this.width),this.updateDataAttribute(),this.setHTMLAttributes(),this.setAttributes(),this.popupDiv=this.createElement("div",{className:"e-popup-content"}),this.popupDiv.classList.add("e-dropdown"),this.tree=this.createElement("div",{id:this.element.id+"_tree"}),this.popupDiv.appendChild(this.tree),this.destroyPopupOnHide||document.body.appendChild(this.popupDiv),this.wireTreeEvents(),t.addClass([this.popupDiv],"e-ddt-icon-hide"),this.renderTree(),this.isRemoteData=this.fields.dataSource instanceof i.DataManager,(this.allowMultiSelection||this.showCheckBox)&&("Delimiter"!==this.mode&&this.createChip(),this.wrapText||"Custom"===this.mode||(this.overFlowWrapper=this.createElement("span",{className:"e-overflow "+X}),this.inputWrapper.insertBefore(this.overFlowWrapper,this.hiddenElement),"Box"!==this.mode&&t.addClass([this.overFlowWrapper],Z))),this.isRemoteData||(this.setTreeValue(),this.setTreeText(),this.updateHiddenValue(),this.setSelectedValue(),this.wrapText||this.updateView()),this.wireEvents();var l=t.select(".e-list-parent",this.treeObj.element);l&&l.getAttribute("aria-multiselectable")&&l.removeAttribute("aria-multiselectable"),this.setOldValue(),this.isRemoteData||(this.isInitialized=!0),this.hasTemplate=this.itemTemplate||this.headerTemplate||this.footerTemplate||this.actionFailureTemplate||this.noRecordsTemplate||this.customTemplate||this.valueTemplate,this.renderComplete()},s.prototype.hideCheckAll=function(e){var i=t.isNullOrUndefined(this.popupEle)?null:this.popupEle.querySelector(".e-selectall-parent");t.isNullOrUndefined(i)||(e&&!i.classList.contains("e-hide-selectall")?t.addClass([i],"e-hide-selectall"):!e&&i.classList.contains("e-hide-selectall")&&t.removeClass([i],"e-hide-selectall"))},s.prototype.renderFilter=function(){this.filterContainer=this.createElement("div",{id:this.element.id+"_filter_wrap",className:"e-filter-wrap"});var e=this.createElement("input",{id:this.element.id+"_filter",attrs:{autocomplete:"off","aria-label":this.filterBarPlaceholder}});this.filterContainer.appendChild(e),t.prepend([this.filterContainer],this.popupEle),this.filterObj=new a.TextBox({value:"",showClearButton:!0,placeholder:this.filterBarPlaceholder,input:this.filterChangeHandler.bind(this)}),this.filterObj.appendTo("#"+this.element.id+"_filter"),this.keyboardModule=new t.KeyboardEvents(this.filterObj.element,{keyAction:this.filterKeyAction.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},s.prototype.filterKeyAction=function(e){var i,s=this,l={cancel:!1,event:e};this.trigger("keyPress",l,function(l){if(!l.cancel)switch(e.action){case"altUp":s.isPopupOpen&&s.hidePopup();break;case"shiftTab":t.addClass([s.inputWrapper],[J]);break;case"moveDown":e.preventDefault(),s.filterObj.element.blur(),(i=s.treeObj.element.querySelector("li"))&&i.focus()}})},s.prototype.filterChangeHandler=function(e){var i=this;t.isNullOrUndefined(e.value)||(window.clearTimeout(this.filterTimer),this.filterTimer=window.setTimeout(function(){i.filterHandler(e.value,e.event)},this.filterDelayTime))},s.prototype.isChildObject=function(){return"object"==typeof this.treeObj.fields.child},s.prototype.filterHandler=function(e,t){var s=this;this.isFromFilterChange=!0,this.isFilteredData||(this.isRemoteData&&(this.treeObj.expandedNodes=[]),this.treeData=this.treeObj.getTreeData());var l=this.cloneFields(this.fields),n={cancel:!1,preventDefaultAction:!1,event:t,text:e.trim(),fields:l};this.trigger("filtering",n,function(e){if(!e.cancel){var t=!1,l=void 0;if(s.isFilteredData=!0,""===e.text?(s.isFilteredData=!1,s.isFilterRestore=!0,l=s.cloneFields(s.fields),s.treeObj.element.classList.remove("e-filtering")):e.preventDefaultAction?(l=e.fields,s.treeObj.element.classList.add("e-filtering")):(1===s.treeDataType?l=s.selfReferencefilter(e.text,e.fields):s.fields.dataSource instanceof i.DataManager?((l=s.remoteDataFilter(e.text,e.fields)).child=s.fields.child,s.treeObj.fields=s.getTreeFields(e.fields),s.treeObj.dataBind(),t=!0):l=s.nestedFilter(e.text,e.fields),s.treeObj.element.classList.add("e-filtering")),s.hideCheckAll(s.isFilteredData),t)return;if(s.isRemoteData&&(s.isChildObject()?l.child=s.fields.child:l=e.fields),s.treeObj.fields=s.getTreeFields(l),(s.previousFilterText&&""!==s.previousFilterText&&""!==e.text&&-1!==s.previousFilterText.indexOf(e.text)||e.text&&""!==e.text&&""!==s.previousFilterText&&-1!==e.text.indexOf(s.previousFilterText))&&(s.isFilterRestore=!0),s.previousFilterText=e.text,s.treeObj.dataBind(),s.popupObj&&s.popupObj.refreshPosition(),s.hasTemplate&&s.portals&&s.treeObj.portals){for(var n=0;n<s.treeObj.portals.length;n++)-1===s.portals.indexOf(s.treeObj.portals[n])&&s.portals.push(s.treeObj.portals[n]);s.isReact&&s.renderReactTemplates()}}})},s.prototype.remoteDataFilter=function(e,i){var s=this;return i.dataSource=this.treeData.map(function(t){return s.remoteChildFilter(e,t)}).filter(function(e){return!t.isNullOrUndefined(e)}),i},s.prototype.remoteChildFilter=function(e,i,s,l){var n=this.isChildObject()?i.child:i[this.fields.child];if(t.isNullOrUndefined(n))return this.isMatchedNode(e,i,s,l)?i:null;for(var a=[],r=0;r<n.length;r++){var o=this.remoteChildFilter(e,n[r],!0,!0);t.isNullOrUndefined(o)||a.push(o)}var h=Object.assign({},i);return l=!1,0!==a.length?h.child=a:(h.child=null,h=this.isMatchedNode(e,h)?h:null),h},s.prototype.nestedFilter=function(e,i){for(var s=[],l=0;l<this.treeData.length;l++){var n=this.nestedChildFilter(e,this.treeData[parseInt(l.toString(),10)]);t.isNullOrUndefined(n)||s.push(n)}return i.dataSource=s,i},s.prototype.nestedChildFilter=function(e,i){var s=i[this.fields.child];if(t.isNullOrUndefined(s))return this.isMatchedNode(e,i)?i:null;for(var l=[],n=0;n<s.length;n++){var a=this.nestedChildFilter(e,s[parseInt(n.toString(),10)]);t.isNullOrUndefined(a)||l.push(a)}var r=Object.assign({},i);return 0!==l.length?(r[this.fields.child]=l,r):(r[this.fields.child]=null,this.isMatchedNode(e,r)?r:null)},s.prototype.selfReferencefilter=function(e,i){for(var s=[],l=[],n=0;n<this.treeData.length;n++)this.isMatchedNode(e,this.treeData[n])&&s.push(this.treeData[n]);for(n=0;n<s.length;n++)if(-1===l.indexOf(s[n])){l.push(s[n]);for(var a=s[parseInt(n.toString(),10)][this.fields.parentValue];!t.isNullOrUndefined(a);){for(var r=null,o=0;o<this.treeData.length;o++){var h=this.treeData[parseInt(o.toString(),10)][this.fields.value];if(!t.isNullOrUndefined(h)&&h===a){r=this.treeData[o];break}}if(t.isNullOrUndefined(r)||-1!==l.indexOf(r))break;l.push(r),a=r[this.fields.parentValue]}}return i.dataSource=l,i},s.prototype.isMatchedNode=function(e,s,l,n){var a;if(!(a=l&&n&&this.isChildObject()?s[this.fields.child.text]:s[this.fields.text])&&!t.isNullOrUndefined(this.fields.child.text)){for(var r=this.fields.child;!s[r.text];)r=r.child;a=s[r.text]}return this.ignoreCase&&(a=a.toLowerCase(),e=e.toLowerCase()),this.ignoreAccent&&(a=i.DataUtil.ignoreDiacritics(a),e=i.DataUtil.ignoreDiacritics(e)),"StartsWith"===this.filterType?a.slice(0,e.length)===e:"EndsWith"===this.filterType?a.slice(-e.length)===e:-1!==a.indexOf(e)},s.prototype.wireEvents=function(){t.Browser.isIos&&t.EventHandler.add(this.inputWrapper,"touchstart",this.handleIosTouch,this),t.EventHandler.add(this.inputWrapper,"mouseup",this.dropDownClick,this),t.EventHandler.add(this.inputWrapper,"focus",this.focusIn,this),t.EventHandler.add(this.inputWrapper,"blur",this.focusOut,this),t.EventHandler.add(this.inputWrapper,"mousemove",this.mouseIn,this),t.EventHandler.add(this.inputWrapper,"mouseout",this.onMouseLeave,this),t.EventHandler.add(this.overAllClear,"mousedown",this.clearAll,this),t.EventHandler.add(window,"resize",this.windowResize,this);var e=t.closest(this.inputWrapper,"form");e&&t.EventHandler.add(e,"reset",this.resetValueHandler,this),this.keyboardModule=new t.KeyboardEvents(this.inputWrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},s.prototype.wireTreeEvents=function(){this.keyboardModule=new t.KeyboardEvents(this.tree,{keyAction:this.treeAction.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},s.prototype.wireCheckAllWrapperEvents=function(){this.keyboardModule=new t.KeyboardEvents(this.checkAllParent,{keyAction:this.checkAllAction.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},s.prototype.unWireEvents=function(){t.Browser.isIos&&t.EventHandler.remove(this.inputWrapper,"touchstart",this.handleIosTouch),t.EventHandler.remove(this.inputWrapper,"mouseup",this.dropDownClick),t.EventHandler.remove(this.inputWrapper,"focus",this.focusIn),t.EventHandler.remove(this.inputWrapper,"blur",this.focusOut),t.EventHandler.remove(this.inputWrapper,"mousemove",this.mouseIn),t.EventHandler.remove(this.inputWrapper,"mouseout",this.onMouseLeave),t.EventHandler.remove(this.overAllClear,"mousedown",this.clearAll),t.EventHandler.remove(window,"resize",this.windowResize);var e=t.closest(this.inputWrapper,"form");e&&t.EventHandler.remove(e,"reset",this.resetValueHandler),this.keyboardModule.destroy(),this.showSelectAll&&this.checkAllParent&&t.EventHandler.remove(this.checkAllParent,"mouseup",this.clickHandler),document.removeEventListener("mousedown",this.documentClickContext)},s.prototype.handleIosTouch=function(e){var t=e.target;t&&t.classList.contains("e-clear-icon")||(e.preventDefault(),this.dropDownClick(e))},s.prototype.dropDownClick=function(e){if(this.enabled&&!this.readonly){if(this.isClearButtonClick)return void(this.isClearButtonClick=!1);this.isPopupOpen?this.hidePopup():("touchstart"===e.type||"button"in e&&2!==e.button)&&(this.focusIn(e),this.renderPopup()),this.showOverAllClear()}},s.prototype.mouseIn=function(){!this.enabled&&this.readonly||this.showOverAllClear()},s.prototype.onMouseLeave=function(){this.inputFocus||(t.addClass([this.overAllClear],X),t.removeClass([this.inputWrapper],_))},s.prototype.getDirective=function(){return"EJS-DROPDOWNTREE"},s.prototype.focusOut=function(e){if(this.enabled&&!this.readonly&&this.inputFocus&&(!t.Browser.isIE&&"edge"!==t.Browser.info.name||e.target!==this.inputWrapper)){var i=e.relatedTarget;i===this.inputEle||!t.isNullOrUndefined(i)||e.target===this.inputWrapper&&this.isPopupOpen||this.onFocusOut(e)}},s.prototype.onFocusOut=function(e){if(this.inputFocus=!1,this.isPopupOpen&&this.hidePopup(),this.isClearButtonClick&&(this.isClearButtonClick=!1),this.showClearButton&&(this.clearIconWidth=t.select(".e-clear-icon",this.inputWrapper).offsetWidth,t.addClass([this.overAllClear],X),t.removeClass([this.inputWrapper],_)),t.removeClass([this.inputWrapper],[J]),this.allowMultiSelection||this.showCheckBox){var i=!!this.value&&!!this.value.length;"Delimiter"!==this.mode&&"Custom"!==this.mode&&this.chipWrapper&&"Default"===this.mode&&(t.addClass([this.chipWrapper],X),t.removeClass([this.inputWrapper],G),t.removeClass([this.inputEle],Q)),i&&"Custom"!==this.mode&&this.showOrHideValueTemplate(!0),!this.wrapText&&i&&this.updateView()}this.changeOnBlur&&this.triggerChangeEvent(e),this.removeValue=!1,this.setOldValue(),this.trigger("blur")},s.prototype.updateView=function(){!this.showCheckBox&&!this.allowMultiSelection||"Custom"===this.mode||this.inputFocus||("Box"!==this.mode?t.addClass([this.inputWrapper,this.overFlowWrapper],Z):t.addClass([this.inputWrapper],G),this.value&&0!==this.value.length&&(this.inputWrapper.contains(this.chipWrapper)&&t.addClass([this.chipWrapper],X),t.addClass([this.inputEle],Q),this.updateOverFlowView()),this.ensurePlaceHolder())},s.prototype.triggerChangeEvent=function(e){if((!this.ddtCompareValues(this.oldValue,this.value)||this.isChipDelete)&&!this.removeValue){var t={e:e,oldValue:this.oldValue,value:this.value,isInteracted:!!e,element:this.element};this.trigger("change",t),this.setOldValue()}},s.prototype.ddtCompareValues=function(e,t){if(null===e||null===t)return null===e?t===e:0===e.length&&t===e;if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0},s.prototype.focusIn=function(e){if(this.enabled&&!this.readonly&&!this.inputFocus){this.showOverAllClear(),this.inputFocus=!0,t.addClass([this.inputWrapper],[J]),(this.allowMultiSelection||this.showCheckBox)&&("Delimiter"!==this.mode&&this.inputFocus&&(this.chipWrapper&&this.value&&0!==this.value.length&&(t.removeClass([this.chipWrapper],X),t.addClass([this.inputEle],Q),this.showOrHideValueTemplate(!1,!0)),t.addClass([this.inputWrapper],G),this.popupObj&&this.popupObj.refreshPosition()),this.wrapText||"Custom"===this.mode||(this.inputWrapper.contains(this.overFlowWrapper)&&t.addClass([this.overFlowWrapper],X),"Delimiter"===this.mode?(t.removeClass([this.inputWrapper],G),t.removeClass([this.inputEle],Q),this.showOrHideValueTemplate(!0)):t.addClass([this.inputWrapper],G),t.removeClass([this.inputWrapper],Z),this.ensurePlaceHolder()));var i={isInteracted:!!e,event:e};this.trigger("focus",i)}},s.prototype.treeAction=function(e){var t=this,i={cancel:!1,event:e};this.trigger("keyPress",i,function(i){if(i.cancel)e.stopImmediatePropagation();else switch(e.action){case"escape":case"altUp":t.inputWrapper.focus(),e.preventDefault(),t.isPopupOpen&&t.hidePopup();break;case"tab":t.isPopupOpen&&t.hidePopup();break;case"enter":case"ctrlEnter":case"shiftEnter":case"csEnter":t.showCheckBox||(t.isValueChange=!0,t.keyEventArgs=e);break;case"space":t.isValueChange=!0,t.keyEventArgs=e;break;case"ctrlA":t.allowMultiSelection&&t.selectAll(!0)}})},s.prototype.keyActionHandler=function(e){var t=this,i={cancel:!1,event:e};this.trigger("keyPress",i,function(i){if(!i.cancel)switch(e.action){case"escape":case"altUp":t.isPopupOpen&&t.hidePopup();break;case"shiftTab":t.isPopupOpen&&t.hidePopup(),t.inputFocus&&t.onFocusOut();break;case"altDown":t.isPopupOpen||(t.showPopup(),e.preventDefault());break;case"moveDown":t.showSelectAll&&t.showCheckBox&&t.checkAllParent.focus();break;case"tab":!t.isPopupOpen&&t.inputFocus&&t.onFocusOut()}})},s.prototype.checkAllAction=function(e){var i,s=this,l={cancel:!1,event:e};this.trigger("keyPress",l,function(l){if(!l.cancel)switch(e.action){case"space":s.clickHandler(e);break;case"moveDown":e.preventDefault(),(i=s.treeObj.element.querySelector('li[tabindex="0"]')||s.treeObj.element.querySelector("li")).focus(),t.addClass([i],["e-node-focus"])}})},s.prototype.windowResize=function(){this.popupObj&&(this.popupObj.setProperties({width:this.setWidth()}),this.popupObj.refreshPosition())},s.prototype.resetValueHandler=function(e){var i=t.closest(this.inputWrapper,"form");i&&e.target===i&&(this.isDynamicChange=!0,this.setProperties({value:null},!0),this.resetValue(!0),this.isDynamicChange=!1)},s.prototype.getAriaAttributes=function(){return{}},s.prototype.updateOverFlowView=function(){if(this.overFlowWrapper.classList.remove("e-total-count"),t.removeClass([this.overFlowWrapper],X),this.value&&this.value.length){var e="",i=void 0,s=void 0,l=void 0,n=1,a=void 0,r=void 0,o=0;this.overFlowWrapper.innerHTML="";var h={overflowCountTemplate:"+${count} more..",totalCountTemplate:"${count} selected"};this.l10n=new t.L10n(this.getLocaleName(),h,this.locale);var u=this.l10n.getConstant("overflowCountTemplate"),p=this.l10n.getConstant("totalCountTemplate"),d=this.createElement("span",{className:"e-remain"});this.overFlowWrapper.appendChild(d),d.innerText=u.replace("${count}",this.value.length.toString());var c=d.offsetWidth;if(t.remove(d),this.showDropDownIcon&&(o=t.select(".e-ddt-icon",this.inputWrapper).offsetWidth),!t.isNullOrUndefined(this.value))if("Box"!==this.mode){if(this.valueTemplate)return r=this.updateChipAndValueTemplate(!1,o,c),this.checkRemainingTemplate(r,d,u,p),void this.updateDelimMode();for(var m=0;!t.isNullOrUndefined(this.value[m]);m++){if(e+=0===m?"":this.delimiterChar+" ",s=this.getOverflowVal(m),e+=s,s=this.overFlowWrapper.innerHTML,this.enableHtmlSanitizer?this.overFlowWrapper.innerText=t.SanitizeHtmlHelper.sanitize(e):this.overFlowWrapper.innerHTML=e,a=this.overFlowWrapper.offsetWidth,i=this.inputWrapper.offsetWidth,a+o+this.clearIconWidth>i){for(void 0!==l&&""!==l&&(s=l,m=n+1),this.overFlowWrapper.innerHTML=s,r=this.value.length-m,a=this.overFlowWrapper.offsetWidth;a+c+o+this.clearIconWidth>=i&&0!==a&&""!==this.overFlowWrapper.innerHTML;){var f=this.overFlowWrapper.innerHTML.split(this.delimiterChar);f.pop(),this.overFlowWrapper.innerHTML=f.join(this.delimiterChar),r++,a=this.overFlowWrapper.offsetWidth}break}a+c+o+this.clearIconWidth<=i?(l=e,n=m):0===m&&(l="",n=-1)}}else r=this.updateChipAndValueTemplate(!0,o,c);this.checkRemainingTemplate(r,d,u,p)}else this.overFlowWrapper.innerHTML="",t.addClass([this.overFlowWrapper],X);this.updateDelimMode()},s.prototype.checkRemainingTemplate=function(e,i,s,l){e>0&&this.overFlowWrapper.appendChild(this.updateRemainTemplate(i,e,s,l)),"Box"!==this.mode||this.overFlowWrapper.classList.contains("e-total-count")||t.addClass([i],"e-wrap-count")},s.prototype.updateChipAndValueTemplate=function(e,i,s){void 0===i&&(i=0);var l,n,a,r,o,h="",u=1;t.addClass([e?this.chipWrapper:this.valueTemplateContainer],X);for(var p=(e?this.chipWrapper:this.valueTemplateContainer).cloneNode(!0),d=e?t.selectAll(".e-chips",p):Array.prototype.slice.call(p.children),c=0;c<d.length;c++){if(n=this.overFlowWrapper.innerHTML,this.overFlowWrapper.appendChild(d[c]),h=this.overFlowWrapper.innerHTML,r=this.overFlowWrapper.offsetWidth,l=this.inputWrapper.offsetWidth,r+i+this.clearIconWidth>l){for(void 0!==a&&""!==a&&(n=a,c=u+1),this.overFlowWrapper.innerHTML=n,o=this.value.length-c,r=this.overFlowWrapper.offsetWidth;r+s+i+this.clearIconWidth>=l&&0!==r&&""!==this.overFlowWrapper.innerHTML;)this.overFlowWrapper.removeChild(this.overFlowWrapper.lastChild),o++,r=this.overFlowWrapper.offsetWidth;break}r+s+i+this.clearIconWidth<=l?(a=h,u=c):0===c&&(a="",u=-1)}return o},s.prototype.updateRemainTemplate=function(e,i,s,l){return this.overFlowWrapper.firstChild&&3===this.overFlowWrapper.firstChild.nodeType&&""===this.overFlowWrapper.firstChild.nodeValue&&this.overFlowWrapper.removeChild(this.overFlowWrapper.firstChild),e.innerHTML="",e.innerText=this.overFlowWrapper.firstChild&&(3===this.overFlowWrapper.firstChild.nodeType||"Box"===this.mode||this.valueTemplateContainer)?s.replace("${count}",i.toString()):l.replace("${count}",i.toString()),!this.overFlowWrapper.firstChild||3!==this.overFlowWrapper.firstChild.nodeType&&"Box"!==this.mode?(t.addClass([this.overFlowWrapper],"e-total-count"),t.removeClass([this.overFlowWrapper],"e-wrap-count")):t.removeClass([this.overFlowWrapper],"e-total-count"),e},s.prototype.getOverflowVal=function(e){var i,s=this.getSelectedData(this.value[parseInt(e.toString(),10)]),l=this.treeObj.getNode(this.value[e]);return i=t.getValue(this.treeSettings.loadOnDemand?this.fields.text:"text",s),t.isNullOrUndefined(i)&&!t.isNullOrUndefined(l.text)&&(i=l.text.toString()),i},s.prototype.updateDelimMode=function(){"Box"!==this.mode?t.select(".e-remain",this.overFlowWrapper)&&!this.overFlowWrapper.classList.contains("e-total-count")?(t.addClass([this.overFlowWrapper],"e-wrap-count"),t.addClass([this.overFlowWrapper],Z)):(this.overFlowWrapper.classList.remove("e-wrap-count"),t.removeClass([this.overFlowWrapper],"e-wrap-count")):t.select(".e-remain",this.overFlowWrapper)&&this.overFlowWrapper.classList.remove("e-wrap-count")},s.prototype.createHiddenElement=function(){this.allowMultiSelection||this.showCheckBox?this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",class:"e-ddt-hidden",tabindex:"-1",multiple:"","aria-label":this.getModuleName()}}):this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",tabindex:"-1",class:"e-ddt-hidden","aria-label":this.getModuleName()}}),t.prepend([this.hiddenElement],this.inputWrapper),this.validationAttribute()},s.prototype.createClearIcon=function(){this.overAllClear=this.createElement("span",{className:"e-clear-icon e-icons"}),t.addClass([this.overAllClear],X),t.removeClass([this.inputWrapper],_),this.showClearButton&&this.inputWrapper.insertBefore(this.overAllClear,this.inputObj.buttons[0])},s.prototype.validationAttribute=function(){var e=this.inputEle.getAttribute("name")?this.inputEle.getAttribute("name"):this.inputEle.getAttribute("id");this.hiddenElement.setAttribute("name",e),this.inputEle.removeAttribute("name");for(var t=["required","aria-required","form"],i=0;i<t.length;i++){var s=this.inputEle.getAttribute(t[i]);s&&(this.hiddenElement.setAttribute(t[i],s),this.inputEle.removeAttribute(t[i]))}},s.prototype.createChip=function(){this.inputWrapper.contains(this.chipWrapper)||(this.chipWrapper=this.createElement("span",{className:"e-chips-wrapper"}),this.chipCollection=this.createElement("span",{className:"e-chips-collection"}),this.chipWrapper.appendChild(this.chipCollection),this.inputWrapper.insertBefore(this.chipWrapper,this.hiddenElement),t.addClass([this.inputWrapper],G),this.getValidMode()&&null!==this.value&&this.value&&0!==this.value.length?t.addClass([this.inputEle],Q):(null===this.value||this.value&&0===this.value.length||this.checkWrapper)&&t.addClass([this.chipWrapper],X))},s.prototype.getValidMode=function(){return!(!this.allowMultiSelection&&!this.showCheckBox)&&("Box"===this.mode||!("Default"!==this.mode||!this.inputFocus))},s.prototype.createSelectAllWrapper=function(){this.checkAllParent=this.createElement("div",{className:"e-selectall-parent",attrs:{tabindex:"0"}}),this.selectAllSpan=this.createElement("span",{className:"e-all-text"}),this.selectAllSpan.textContent="";var e=t.closest(this.element,".e-bigger"),i=t.isNullOrUndefined(e)?"":"e-small";this.checkBoxElement=r.createCheckBox(this.createElement,!0,{cssClass:i}),this.checkBoxElement.setAttribute("role","checkbox"),this.checkAllParent.appendChild(this.checkBoxElement),this.checkAllParent.appendChild(this.selectAllSpan),this.setLocale(),t.EventHandler.add(this.checkAllParent,"mouseup",this.clickHandler,this),this.wireCheckAllWrapperEvents()},s.prototype.clickHandler=function(e){var i;if(i=e.currentTarget&&e.currentTarget.classList.contains("e-selectall-parent")?e.currentTarget.firstElementChild.lastElementChild:e.target,this.checkWrapper=t.closest(i,".e-checkbox-wrapper"),!t.isNullOrUndefined(this.checkWrapper)){this.isClicked=!0;var s=t.select(".e-frame",this.checkWrapper);this.changeState(this.checkWrapper,s.classList.contains(Y)?"uncheck":"check",e),this.isClicked=!1}e.preventDefault()},s.prototype.changeState=function(e,i,s){var l,n=e.getElementsByClassName("e-frame")[0];"check"!==i||n.classList.contains(Y)?"uncheck"===i&&n.classList.contains(Y)&&(n.classList.remove(Y),l="false",this.isReverseUpdate||(this.treeObj.uncheckAll(),this.changeOnBlur||this.triggerChangeEvent(s)),this.setLocale(!1)):(n.classList.add(Y),l="true",this.isReverseUpdate||(this.setOldValue(),this.isCheckAllCalled=!0,this.treeObj.checkAll(),this.changeOnBlur||this.triggerChangeEvent(s)),this.setLocale(!0)),this.setMultiSelect(),this.ensurePlaceHolder(),l="check"===i?"true":"false",t.isNullOrUndefined(l)||e.parentElement.setAttribute("aria-checked",l)},s.prototype.setLocale=function(e){if(this.selectAllSpan)if("Select All"!==this.selectAllText||"Unselect All"!==this.unSelectAllText){var i=e?this.unSelectAllText:this.selectAllText;this.selectAllSpan.textContent="";for(var s=0,l=t.compile(i)({},this,e?"unSelectAllText":"selectAllText",null,!this.isStringTemplate);s<l.length;s++){var n=l[s];this.selectAllSpan.textContent=n.textContent}}else this.selectAllSpan.textContent=e?this.unSelectAllText:this.selectAllText},s.prototype.setAttributes=function(){this.inputEle.setAttribute("tabindex","-1"),this.inputEle.setAttribute("aria-label",this.getModuleName());var e=this.element.getAttribute("id");this.hiddenElement.id=e+"_hidden",this.inputWrapper.setAttribute("tabindex",this.inputWrapper.classList.contains("e-disabled")?"-1":"0"),this.inputWrapper.setAttribute("aria-label",this.getModuleName()),t.attributes(this.inputWrapper,this.getAriaAttributes())},s.prototype.setHTMLAttributes=function(){if(Object.keys(this.htmlAttributes).length)for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i=t[e];if("class"===i)this.inputWrapper.classList.add(this.htmlAttributes[""+i]);else if("disabled"===i)this.setProperties({enabled:!1},!0),this.setEnable();else if("readonly"===i)this.setProperties({readonly:!0},!0),this.dataBind();else if("style"===i)this.inputWrapper.style.cssText=this.htmlAttributes[""+i];else{var s=["title","id","placeholder","aria-placeholder","role","autocorrect","autocomplete","autocapitalize","spellcheck","minlength","maxlength"],l=["name","required"];0===i.indexOf("data")||l.indexOf(i)>-1?this.hiddenElement.setAttribute(i,this.htmlAttributes[""+i]):s.indexOf(i)>-1&&"placeholder"===i?a.Input.setPlaceholder(this.htmlAttributes[""+i],this.inputEle):this.inputEle.setAttribute(i,this.htmlAttributes[""+i])}}},s.prototype.updateDataAttribute=function(){for(var e=this.htmlAttributes,i=["class","style","id","type"],s={},l=0;l<this.element.attributes.length;l++)-1===i.indexOf(this.element.attributes[l].name)&&"readonly"!==this.element.attributes[l].name&&(s[this.element.attributes[l].name]=this.element.getAttribute(this.element.attributes[l].name));t.extend(s,e,s),this.setProperties({htmlAttributes:s},!0)},s.prototype.showOverAllClear=function(){this.enabled&&!this.readonly&&this.overAllClear&&(!!this.value&&!!this.value.length&&this.showClearButton?(t.removeClass([this.overAllClear],X),t.addClass([this.inputWrapper],_)):(t.addClass([this.overAllClear],X),t.removeClass([this.inputWrapper],_)))},s.prototype.setTreeValue=function(){if(null!==this.value&&0!==this.value.length){var e=void 0;if(this.showCheckBox||this.allowMultiSelection){for(var i=this.value.length-1;i>=0;i--)e=this.treeObj.getTreeData(this.value[i])[0],t.isNullOrUndefined(e)&&this.value.splice(i,1);0!==this.value.length&&this.setValidValue()}else e=this.treeObj.getTreeData(this.value[0])[0],t.isNullOrUndefined(e)?this.setProperties({value:this.currentValue},!0):(this.setProperties({text:e[this.fields.text]},!0),this.setValidValue())}},s.prototype.setTreeText=function(){if((null===this.value||this.isInitialized)&&null!==this.text){var e=void 0,i=[];if(this.showCheckBox||this.allowMultiSelection){for(var s=this.text.split(this.delimiterChar),l=0;l<s.length;l++)e=this.getItems(s[l]),t.isNullOrUndefined(e)||i.push(e[this.fields.value].toString());0!==i.length?(this.setOldValue(),this.setProperties({value:i},!0),this.setValidValue()):this.setProperties({text:this.currentText},!0)}else e=this.getItems(this.text),t.isNullOrUndefined(e)?this.setProperties({text:this.currentText},!0):(this.setOldValue(),this.setProperties({value:[e[this.fields.value].toString()]},!0),this.setValidValue())}},s.prototype.setSelectedValue=function(){null!==this.value&&0!==this.value.length||this.isInitialized||(this.setOldValue(),this.treeObj.selectedNodes.length>0&&!this.showCheckBox?(this.setProperties({value:this.treeObj.selectedNodes},!0),this.allowMultiSelection&&this.updateMode()):this.showCheckBox&&this.treeObj.checkedNodes&&this.treeObj.checkedNodes.length>0&&(this.setProperties({value:this.treeObj.checkedNodes},!0),t.setValue("selectedNodes",[],this.treeObj),this.treeObj.dataBind(),this.updateMode()),this.updateSelectedValues(),this.currentText=this.text,this.currentValue=this.value)},s.prototype.setValueTemplate=function(){var e=this;if(this.valueTemplate){var t=this.initializeValueTemplate();this.getValueTemplateElement(this.value[0],t),this.hasTemplate&&this.portals&&(this.treeObj.portals&&(this.portals=this.portals.concat(this.treeObj.portals.filter(function(t){return!e.portals.includes(t)}))),this.isReact&&this.renderReactTemplates(this.reactCallBack)),this.showOrHideValueTemplate(!0)}},s.prototype.getValueTemplateElement=function(e,i){var s=i(this.getNodeData(e,this.isFilteredData?this.treeData:this.treeItems),this,"valueTemplate",this.element.id+"valueTemplate",this.isStringTemplate,void 0,this.valueTemplateContainer);s&&(s=Array.prototype.slice.call(s),t.append(s,this.valueTemplateContainer))},s.prototype.setValidValue=function(){var e=this;if(this.showCheckBox||this.allowMultiSelection)this.showCheckBox?(this.value.length!==this.treeObj.checkedNodes.length||this.value.filter(function(t){return-1===e.treeObj.checkedNodes.indexOf(t)}).length>0||this.treeSettings.autoCheck)&&(this.treeObj.checkedNodes=this.value.slice(),this.treeObj.dataBind(),this.setMultiSelect()):(this.treeObj.selectedNodes=this.value.slice(),this.selectedText=[],this.updateSelectedValues()),this.treeObj.dataBind();else{a.Input.setValue(this.text,this.inputEle,this.floatLabelType),this.setValueTemplate();var s=this.value[0].toString();this.treeObj.selectedNodes[0]!==s&&(t.setValue("selectedNodes",[s],this.treeObj),this.fields.dataSource instanceof i.DataManager&&this.updateSelectedValues())}this.currentText=this.text,this.currentValue=this.value,!t.isNullOrUndefined(this.value)&&this.value.length>0&&!t.isNullOrUndefined(this.currentText)&&this.inputWrapper.setAttribute("aria-label",this.currentText.replace(/,/g,", ")),this.isInitialized&&this.triggerChangeEvent()},s.prototype.getItems=function(e){var i;if(1===this.treeDataType)for(var s=0;s<this.treeItems.length;s++){var l=t.getValue(this.fields.text,this.treeItems[parseInt(s.toString(),10)]);if(!t.isNullOrUndefined(this.treeItems[s])&&!t.isNullOrUndefined(l)&&l===e){i=this.treeItems[s];break}}else i=this.getNestedItems(this.treeItems,this.fields,e);return i},s.prototype.getNestedItems=function(e,s,l){for(var n,a=0,r=e.length;a<r;a++){var o=t.getValue(this.fields.text,e[parseInt(a.toString(),10)]);if(e[a]&&o&&o.toString()===l)return e[a];if("string"!=typeof s.child||t.isNullOrUndefined(t.getValue(s.child,e[a]))){if(this.fields.dataSource instanceof i.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[a]))){if(void 0!==(n=this.getNestedItems(t.getValue("child",e[parseInt(a.toString(),10)]),this.getChildType(s),l)))break}}else{var h=t.getValue(s.child,e[parseInt(a.toString(),10)]);if(void 0!==(n=this.getNestedItems(h,this.getChildType(s),l)))break}}return n},s.prototype.getChildType=function(e){return"string"==typeof e.child||t.isNullOrUndefined(e.child)?e:e.child},s.prototype.renderTree=function(){this.treeObj=new o.TreeView({fields:this.getTreeFields(this.fields),enableRtl:this.enableRtl,nodeSelected:this.onNodeSelected.bind(this),nodeChecked:this.onNodeChecked.bind(this),nodeChecking:this.beforeCheck.bind(this),nodeExpanded:this.onNodeExpanded.bind(this),actionFailure:this.onActionFailure.bind(this),nodeClicked:this.onNodeClicked.bind(this),dataBound:this.OnDataBound.bind(this),allowMultiSelection:this.allowMultiSelection,enableHtmlSanitizer:this.enableHtmlSanitizer,showCheckBox:this.showCheckBox,autoCheck:this.treeSettings.autoCheck,sortOrder:this.sortOrder,expandOn:this.treeSettings.expandOn,loadOnDemand:this.treeSettings.loadOnDemand,nodeSelecting:this.onBeforeSelect.bind(this),nodeTemplate:this.itemTemplate,checkDisabledChildren:this.treeSettings.checkDisabledChildren,checkOnClick:!0}),this.treeObj.root=this.root?this.root:this,this.treeObj.appendTo(this.tree)},s.prototype.renderPopup=function(){var e=this;this.isFilteredData&&(this.treeObj.element.classList.remove("e-filtering"),this.filterObj.value="",this.treeObj.fields=this.getTreeFields(this.fields),this.isFilterRestore=!0,this.isFilteredData=!1,this.hideCheckAll(!1));var i=!1,s={cancel:!1};this.trigger("beforeOpen",s,function(s){if(s.cancel?i=!0:(t.addClass([e.inputWrapper],["e-icon-anim"]),e.isReact&&e.isFilterRestore&&e.treeObj.refresh(),e.isFirstRender?(e.popupEle=e.createElement("div",{id:e.element.id+"_options",className:"e-ddt e-popup "+(null!=e.cssClass?e.cssClass:"")}),e.popupEle.setAttribute("role","region"),e.popupEle.setAttribute("aria-label",e.element.id),document.body.appendChild(e.popupEle),e.createPopup(e.popupEle)):(e.popupEle=e.popupObj.element,e.isReact&&e.isFilterRestore&&(e.isFilteredData=!0,e.popupEle.removeChild(e.filterContainer)))),(e.isFirstRender&&!i||e.isFilteredData)&&(e.isFilteredData=!1,t.prepend([e.popupDiv],e.popupEle),t.removeClass([e.popupDiv],"e-ddt-icon-hide"),e.allowFiltering&&e.renderFilter(),e.showCheckBox&&e.showSelectAll&&!e.popupDiv.classList.contains($)&&(e.createSelectAllWrapper(),e.popupEle.insertBefore(e.checkAllParent,e.popupDiv)),e.headerTemplate&&e.setHeaderTemplate(),e.footerTemplate&&e.setFooterTemplate(),e.isFirstRender=!1,e.hasTemplate&&e.portals&&(e.treeObj.portals&&(e.portals=e.portals.concat(e.treeObj.portals.filter(function(t){return!e.portals.includes(t)}))),e.isReact&&e.renderReactTemplates(e.reactCallBack))),!i){if(t.attributes(e.inputEle,{"aria-expanded":"true"}),e.popupObj.show(null,1e3===e.zIndex?e.inputEle:null),t.removeClass([e.popupEle],"e-ddt-icon-hide"),e.updatePopupHeight(),e.popupObj.refreshPosition(),e.checkCollision(e.popupEle),!e.showSelectAll&&!e.allowFiltering&&!e.popupDiv.classList.contains($)&&e.treeItems.length>0){if(r=null!=e.value&&null!=e.text?e.treeObj.element.querySelector('[data-uid="'+e.value[e.value.length-1]+'"]'):null)e.treeObj.element.querySelector("li").setAttribute("tabindex","-1"),r.setAttribute("tabindex","0");else{a=e.treeObj.element.querySelector(".e-node-focus");r=e.treeObj.element.querySelector('li[tabindex="0"]:not(.e-disable)')||e.treeObj.element.querySelector("li:not(.e-disable)"),e.removeFocus(r,a)}e.updateFocus(r)}if(e.treeObj.checkedNodes.length>0&&!e.isFilterRestore){var l=e.treeObj.element.querySelectorAll("li:not(.e-disable)");if(e.treeObj.element.querySelectorAll("li[aria-checked=true]").length===l.length&&e.checkBoxElement){var n=t.closest(e.checkBoxElement,".e-checkbox-wrapper");e.changeState(n,"check"),e.checkSelectAll=!1}}if(e.showSelectAll&&!e.allowFiltering){var a=e.treeObj.element.querySelector(".e-node-focus"),r=e.popupEle.querySelector(".e-selectall-parent");e.removeFocus(r,a),e.updateFocus(r)}if(e.allowFiltering){r=e.treeObj.element.querySelector("li.e-node-focus");t.isNullOrUndefined(r)||t.removeClass([r],"e-node-focus"),t.removeClass([e.inputWrapper],[J]),e.filterObj.element.focus()}var o={popup:e.popupObj};e.trigger("open",o)}})},s.prototype.checkCollision=function(e){n.isCollide(e).length>0&&(e.style.marginTop=-parseInt(getComputedStyle(e).marginTop,10)+"px"),this.popupObj.resolveCollision()},s.prototype.removeFocus=function(e,i){i&&i!==e&&(i.setAttribute("tabindex","-1"),t.removeClass([i],"e-node-focus"))},s.prototype.updateFocus=function(e){t.isNullOrUndefined(e)||(e.focus(),t.addClass([e],["e-node-focus"]))},s.prototype.reactCallBack=function(){t.isNullOrUndefined(this.popupObj)||(this.updatePopupHeight(),this.popupObj.refreshPosition())},s.prototype.updatePopupHeight=function(){if(!this.isFirstRender){var e=this.getHeight();if(this.popupEle.style.maxHeight=e,this.allowFiltering){i=Math.round(this.filterContainer.getBoundingClientRect().height);e=t.formatUnit(parseInt(e,10)-i+"px")}if(this.headerTemplate){i=Math.round(this.header.getBoundingClientRect().height);e=t.formatUnit(parseInt(e,10)-i+"px")}if(this.showCheckBox&&this.showSelectAll&&!this.popupDiv.classList.contains($)){i=Math.round(this.checkAllParent.getBoundingClientRect().height);e=t.formatUnit(parseInt(e,10)-i+"px")}if(this.footerTemplate){var i=Math.round(this.footer.getBoundingClientRect().height);e=t.formatUnit(parseInt(e,10)-i+"px")}var s=parseInt(window.getComputedStyle(this.popupEle).borderTopWidth,10);s+=parseInt(window.getComputedStyle(this.popupEle).borderBottomWidth,10),e=t.formatUnit(parseInt(e,10)-s+"px"),this.popupDiv.style.maxHeight=e}},s.prototype.createPopup=function(e){var i=this;this.isFirstRender&&(this.popupObj=new n.Popup(e,{width:this.setWidth(),targetType:"relative",collision:{X:"flip",Y:"flip"},relateTo:this.inputWrapper,zIndex:this.zIndex,enableRtl:this.enableRtl,position:{X:"left",Y:"bottom"},close:function(){i.isPopupOpen=!1},open:function(){document.addEventListener("mousedown",i.documentClickContext),i.isPopupOpen=!0},targetExitViewport:function(){t.Browser.isDevice||i.hidePopup()}}))},s.prototype.setElementWidth=function(e){var i=this.inputWrapper;t.isNullOrUndefined(e)||("number"==typeof e?i.style.width=t.formatUnit(e):"string"==typeof e&&(i.style.width=e.match(/px|%|em/)?e:t.formatUnit(e)))},s.prototype.setWidth=function(){var e=t.formatUnit(this.popupWidth);return e.indexOf("%")>-1?e=(this.inputWrapper.offsetWidth*parseFloat(e)/100).toString()+"px":"string"==typeof this.popupWidth&&(e=this.popupWidth.match(/px|em/)?this.popupWidth:e),e},s.prototype.getHeight=function(){var e=t.formatUnit(this.popupHeight);return e.indexOf("%")>-1?e=(document.documentElement.clientHeight*parseFloat(e)/100).toString()+"px":"string"==typeof this.popupHeight&&(e=this.popupHeight.match(/px|em/)?this.popupHeight:e),e},s.prototype.onDocumentClick=function(e){var i=e.target,s=t.closest(i,".e-list-parent"),l=t.closest(i,".e-filter-wrap"),n=t.closest(i,".e-ddt-header"),a=t.closest(i,".e-ddt-footer"),r=!!i.classList.contains("e-dropdown")||(t.matches(i,".e-ddt .e-popup")||t.matches(i,".e-ddt .e-treeview"));this.isPopupOpen&&(!t.isNullOrUndefined(this.inputWrapper)&&this.inputWrapper.contains(i)||s||r||n||a)||(this.allowMultiSelection||this.showCheckBox)&&(this.isPopupOpen&&i.classList.contains("e-chips-close")||this.isPopupOpen&&(i.classList.contains("e-selectall-parent")||i.classList.contains("e-all-text")||i.classList.contains("e-frame")))?(this.isDocumentClick=!1,e.preventDefault()):t.isNullOrUndefined(this.inputWrapper)||this.inputWrapper.contains(i)||!this.inputFocus||l||this.focusOut(e)},s.prototype.onActionFailure=function(e){this.trigger("actionFailure",e),this.l10nUpdate(!0),t.addClass([this.popupDiv],$)},s.prototype.OnDataBound=function(e){this.treeItems=e.data,this.treeItems.length<=0?(this.l10nUpdate(),t.addClass([this.popupDiv],$),this.hideCheckAll(!0)):this.popupDiv.classList.contains($)&&this.treeItems.length>=1&&(t.removeClass([this.popupDiv],$),this.hideCheckAll(!1)),this.isFilteredData||(this.treeDataType=this.getTreeDataType(this.treeItems,this.fields)),this.isFirstRender&&this.isRemoteData&&(this.setTreeValue(),this.setTreeText(),this.updateHiddenValue(),this.setSelectedValue(),this.wrapText||this.updateView(),this.treeObj.element.focus(),this.isInitialized=!0);var i={data:e.data};this.trigger("dataBound",i),null===this.filterObj&&(this.isFilteredData=!1),this.isFilteredData&&this.treeObj.expandAll(),this.isFilterRestore&&(this.restoreFilterSelection(),this.showSelectAll||(this.isFilterRestore=!1))},s.prototype.restoreFilterSelection=function(){this.treeObj.checkedNodes&&(this.treeObj.checkedNodes=[]);var e=Array.isArray(this.value)?this.value:[];this.showCheckBox?this.treeObj.checkedNodes=e:this.treeObj.selectedNodes=e},s.prototype.setCssClass=function(e,i){var s=this.popupObj?[this.inputWrapper,this.popupObj.element]:[this.inputWrapper];t.isNullOrUndefined(i)||""===i||t.removeClass(s,i.split(" ")),t.isNullOrUndefined(e)||""===e||t.addClass(s,e.split(" "))},s.prototype.setEnableRTL=function(e){e?this.inputWrapper.classList.add("e-rtl"):this.inputWrapper.classList.remove("e-rtl"),this.popupObj&&(this.popupObj.enableRtl=e,this.popupObj.dataBind()),this.treeObj&&(this.treeObj.enableRtl=e,this.treeObj.dataBind())},s.prototype.setEnable=function(){a.Input.setEnabled(this.enabled,this.inputEle),this.enabled?(t.removeClass([this.inputWrapper],"e-disabled"),this.inputEle.setAttribute("aria-disabled","false"),this.inputWrapper.setAttribute("aria-disabled","false")):(this.isPopupOpen&&this.hidePopup(),t.addClass([this.inputWrapper],"e-disabled"),this.inputWrapper&&this.inputWrapper.classList.contains(J)&&t.removeClass([this.inputWrapper],[J]),this.inputEle.setAttribute("aria-disabled","true"),this.inputWrapper.setAttribute("aria-disabled","true"))},s.prototype.cloneFields=function(e){return{dataSource:e.dataSource,value:e.value,text:e.text,parentValue:e.parentValue,child:this.cloneChildField(e.child),hasChildren:e.hasChildren,expanded:e.expanded,iconCss:e.iconCss,imageUrl:e.imageUrl,htmlAttributes:e.htmlAttributes,query:e.query,selected:e.selected,selectable:e.selectable,tableName:e.tableName,tooltip:e.tooltip}},s.prototype.cloneChildField=function(e){return"string"==typeof e?e:{dataSource:e.dataSource,value:e.value,text:e.text,parentValue:e.parentValue,child:e.child?this.cloneChildField(e.child):null,hasChildren:e.hasChildren,expanded:e.expanded,iconCss:e.iconCss,imageUrl:e.imageUrl,htmlAttributes:e.htmlAttributes,query:e.query,selected:e.selected,selectable:e.selectable,tableName:e.tableName,tooltip:e.tooltip}},s.prototype.getTreeFields=function(e){return{dataSource:e.dataSource,id:e.value,text:e.text,parentID:e.parentValue,child:this.getTreeChildren(e.child),hasChildren:e.hasChildren,expanded:e.expanded,iconCss:e.iconCss,imageUrl:e.imageUrl,isChecked:e.selected,htmlAttributes:e.htmlAttributes,query:e.query,selectable:e.selectable,selected:e.selected,tableName:e.tableName,tooltip:e.tooltip}},s.prototype.getTreeChildren=function(e){if("string"==typeof e)return e;if(!t.isNullOrUndefined(e)){var i=e=this.getActualProperties(e);return e.value&&(i.id=e.value),e.parentValue&&(i.parentID=e.parentValue),e.child&&(i.child=this.getTreeChildren(e.child)),e.selected&&this.showCheckBox&&(i.isChecked=e.selected),i}return null},s.prototype.getTreeDataType=function(e,s){if(this.fields.dataSource instanceof i.DataManager){for(l=0;l<e.length;l++)if("string"==typeof s.child&&t.isNullOrUndefined(t.getValue(s.child,e[l])))return 1;return 2}t.isNullOrUndefined(this.fields.dataSource)&&(this.fields.dataSource=[]);for(var l=0,n=this.fields.dataSource.length;l<n;l++){if("string"==typeof s.child&&!t.isNullOrUndefined(t.getValue(s.child,this.fields.dataSource[l])))return 2;if(!t.isNullOrUndefined(t.getValue(s.parentValue,this.fields.dataSource[l]))||!t.isNullOrUndefined(t.getValue(s.hasChildren,this.fields.dataSource[l])))return 1}return 1},s.prototype.setFields=function(){this.resetValue(),this.hasTemplate&&this.updateTemplate(),this.treeObj.fields=this.getTreeFields(this.fields),this.setProperties({value:this.oldValue},!0),this.treeObj.dataBind(),this.updateValue(this.value)},s.prototype.getEventArgs=function(e){var t,i=e.data,s=e.nodeData;return this.showCheckBox&&("check"===e.action?t="select":"uncheck"===e.action&&(t="un-select")),{action:this.showCheckBox?t:e.action,isInteracted:!!this.isClicked||e.isInteracted,item:e.node,itemData:this.showCheckBox?i[0]:s}},s.prototype.onBeforeSelect=function(e){e.isInteracted&&(this.setOldValue(),null===this.value&&this.setProperties({value:[]},!0))},s.prototype.updateHiddenValue=function(){this.allowMultiSelection||this.showCheckBox||(this.value&&this.value.length?this.hiddenElement.innerHTML='<option selected value ="'+this.value[0]+'">'+this.text+"</option>":this.hiddenElement.innerHTML="")},s.prototype.onNodeSelected=function(e){if(!this.showCheckBox){var i=this.getEventArgs(e);this.trigger("select",i);var s;if(e.isInteracted){var l=t.getValue("id",e.nodeData).toString();this.allowMultiSelection?this.allowMultiSelection&&this.setMultiSelect():(this.hiddenElement.innerHTML="",this.setProperties({value:[l]},!0),s=this.itemTemplate?t.getValue("text",this.treeObj.getNode(l)):t.getValue("text",e.nodeData).toString(),a.Input.setValue(s,this.inputEle,this.floatLabelType),this.setProperties({text:s},!0),this.currentText=this.text,this.currentValue=this.value,this.setValueTemplate(),!t.isNullOrUndefined(this.value)&&this.value.length>0&&this.inputWrapper.setAttribute("aria-label",e.nodeData.text.toString()),t.attributes(this.inputWrapper,{"aria-describedby":this.element.id}),t.attributes(this.inputWrapper,{"aria-activedescendant":l.toString()}),this.updateHiddenValue(),this.showOverAllClear(),this.hidePopup(),this.isNodeSelected=!0)}this.isValueChange&&!this.changeOnBlur&&(this.triggerChangeEvent(this.keyEventArgs),this.isValueChange=!1)}},s.prototype.onNodeClicked=function(e){!this.changeOnBlur&&this.isNodeSelected&&(this.triggerChangeEvent(e.event),this.isNodeSelected=!1);var t=e.event.target;(t.classList.contains("e-fullrow")||t.classList.contains("e-list-text"))&&this.showCheckBox&&(this.setMultiSelect(),this.ensurePlaceHolder()),this.changeOnBlur||!this.allowMultiSelection&&!this.showCheckBox||this.triggerChangeEvent(e.event)},s.prototype.onNodeChecked=function(e){var i=this.getEventArgs(e);if(this.trigger("select",i),this.isFilteredData&&"uncheck"===e.action){var s=t.getValue("id",e.data[0]).toString();this.removeSelectedData(s,!0)}if((!this.isChipDelete&&e.isInteracted||!this.isFilteredData&&"check"===e.action&&this.isFromFilterChange)&&(this.setMultiSelect(),this.ensurePlaceHolder()),this.showSelectAll&&this.checkBoxElement){var l=this.treeObj.element.querySelectorAll("li:not(.e-disable)"),n=this.treeObj.element.querySelectorAll("li[aria-checked=true]"),a=t.closest(this.checkBoxElement,".e-checkbox-wrapper");a&&"uncheck"===e.action&&(e.isInteracted||0===n.length||!t.isNullOrUndefined(e.data[0])&&"false"===e.data[0].isChecked)||!e.isInteracted&&this.isFilterRestore?(this.isFilterRestore=!1,this.isReverseUpdate=!0,this.changeState(a,"uncheck"),this.isReverseUpdate=!1):a&&"check"===e.action&&n.length===l.length&&(e.isInteracted||this.isCheckAllCalled||!t.isNullOrUndefined(e.data[0])&&"true"===e.data[0].isChecked)&&(this.isReverseUpdate=!0,this.isCheckAllCalled=!1,this.changeState(a,"check"),this.isReverseUpdate=!1)}this.isValueChange&&!this.changeOnBlur&&(this.triggerChangeEvent(this.keyEventArgs),this.isValueChange=!1)},s.prototype.beforeCheck=function(e){e.isInteracted&&this.setOldValue()},s.prototype.onNodeExpanded=function(){if(this.hasTemplate&&this.portals&&this.treeObj.portals){for(var e=0;e<this.treeObj.portals.length;e++)-1===this.portals.indexOf(this.treeObj.portals[e])&&this.portals.push(this.treeObj.portals[e]);this.renderReactTemplates()}},s.prototype.updateClearButton=function(e){if(e?this.inputWrapper.contains(this.overAllClear)?(t.removeClass([this.overAllClear],X),t.addClass([this.inputWrapper],_)):this.inputEle.parentElement.insertBefore(this.overAllClear,this.inputEle.nextSibling):(t.addClass([this.overAllClear],X),t.removeClass([this.inputWrapper],_)),(this.allowMultiSelection||this.showCheckBox)&&this.chipWrapper)for(var i=t.selectAll(".e-chips-close",this.chipWrapper),s=0;s<i.length;s++)e?t.removeClass([i[s]],X):t.addClass([i[s]],X)},s.prototype.updateDropDownIconState=function(e){var i=t.select(".e-ddt-icon",this.inputWrapper);e?(i?t.removeClass([i],X):a.Input.appendSpan(K,this.inputWrapper,this.createElement),t.addClass([this.inputWrapper],"e-show-dd-icon")):(t.addClass([i],X),t.removeClass([this.inputWrapper],"e-show-dd-icon"))},s.prototype.updateMode=function(){if("Custom"!==this.mode)if("Delimiter"!==this.mode){this.inputWrapper.contains(this.chipWrapper)||this.createChip();var e=this.getValidMode();this.chipWrapper.classList.contains(X)&&e?(t.removeClass([this.chipWrapper],X),this.showOrHideValueTemplate(!1,!0),t.addClass([this.inputWrapper],G)):e||(t.addClass([this.chipWrapper],X),t.removeClass([this.inputWrapper],G),this.showOrHideValueTemplate(!0));var i=null!==this.value&&0!==this.value.length;e&&i?t.addClass([this.inputEle],Q):t.removeClass([this.inputEle],Q)}else this.inputEle.classList.contains(Q)&&(t.removeClass([this.inputEle],Q),this.chipWrapper&&(t.addClass([this.chipWrapper],X),t.removeClass([this.inputWrapper],G),this.showOrHideValueTemplate(!0)))},s.prototype.ensurePlaceHolder=function(){(t.isNullOrUndefined(this.value)||null!==this.value&&0===this.value.length)&&(t.removeClass([this.inputEle],Q),this.chipWrapper&&(t.addClass([this.chipWrapper],X),this.showOrHideValueTemplate(!0)))},s.prototype.ensureClearIconPosition=function(e){"Never"!==e&&this.inputWrapper.insertBefore(this.overAllClear,this.inputObj.buttons[0])},s.prototype.setMultiSelectValue=function(e){var i=this;if(this.isFilteredData){var s=t.isNullOrUndefined(this.value)?[]:this.value;s=s.filter(function(e){var t=i.treeObj.getTreeData(e);return!Array.isArray(t)||t.every(function(e){return e.selected})});for(var l=0;l<e.length;l++)(t.isNullOrUndefined(this.value)||-1===this.value.indexOf(e[l]))&&s.push(e[l]);this.setProperties({value:s},!0)}else this.setProperties({value:this.isFromFilterChange&&e&&0===e.length?this.value:e},!0),this.isFromFilterChange=!1,!e||0===e.length||this.showCheckBox||this.ddtCompareValues(this.treeObj.selectedNodes,this.value.slice())||(this.treeObj.selectedNodes=this.value.slice(),this.treeObj.dataBind())},s.prototype.setMultiSelect=function(){if(this.showCheckBox&&!this.isDynamicChange)this.setMultiSelectValue(this.treeObj.checkedNodes.slice());else{var e=this.allowMultiSelection?this.showCheckBox?this.treeObj.checkedNodes:this.treeObj.selectedNodes:this.value?this.showCheckBox?this.value:[this.value[0]]:null;this.setMultiSelectValue(e),this.showCheckBox&&null!==this.value&&(this.treeObj.checkedNodes=this.value,this.treeObj.dataBind())}this.selectedText=[];var i=!!this.allowMultiSelection||!!this.showCheckBox;this.inputWrapper.contains(this.chipWrapper)&&!i&&(t.removeClass([this.inputEle],Q),t.detach(this.chipWrapper)),this.getValidMode()&&null!==this.value&&(t.addClass([this.inputEle],Q),this.chipWrapper&&(t.removeClass([this.chipWrapper],X),this.showOrHideValueTemplate(!1,!0)));var s=!!this.value&&!!this.value.length;this.chipWrapper&&"Box"===this.mode&&!s&&(t.addClass([this.chipWrapper],X),t.removeClass([this.inputEle],Q),this.showOrHideValueTemplate(!0)),this.updateSelectedValues()},s.prototype.getSelectedData=function(e){var i=null;if(this.isFilteredData)for(var s=0;s<this.selectedData.length;s++)if(t.getValue(this.treeSettings.loadOnDemand?this.fields.value:"id",this.selectedData[s]).toString()===e){i=this.selectedData[s];break}return t.isNullOrUndefined(i)&&(i=this.treeSettings.loadOnDemand?this.getNodeData(e,this.treeItems):this.treeObj.getNode(e),t.isNullOrUndefined(i)||this.selectedData.push(i)),i},s.prototype.getNodeData=function(e,i){if(!t.isNullOrUndefined(e)){if(1!==this.treeDataType)return this.getChildNodeData(i,this.fields,e);for(var s=0,l=i.length;s<l;s++){var n=t.getValue(this.fields.value,i[s]);if(!t.isNullOrUndefined(i[s])&&!t.isNullOrUndefined(n)&&n.toString()===e)return i[s]}}},s.prototype.getChildNodeData=function(e,s,l){var n;if(t.isNullOrUndefined(e))return n;for(var a=0,r=e.length;a<r;a++){var o=t.getValue(s.value,e[a]);if(e[a]&&o&&o.toString()===l)return e[a];if("string"!=typeof s.child||t.isNullOrUndefined(t.getValue(s.child,e[a]))){if(this.fields.dataSource instanceof i.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[a]))){if(void 0!==(n=this.getChildNodeData(t.getValue("child",e[a]),this.getChildMapperFields(s),l)))break}}else{var h=t.getValue(s.child,e[a]);if(void 0!==(n=this.getChildNodeData(h,this.getChildMapperFields(s),l)))break}}return n},s.prototype.getChildMapperFields=function(e){return"string"==typeof e.child||t.isNullOrUndefined(e.child)?e:e.child},s.prototype.removeSelectedData=function(e,i){var s=t.isNullOrUndefined(this.value)?[]:this.value.slice();s.splice(s.indexOf(e),1),this.setProperties({value:s},i);for(var l=0;l<this.selectedData.length;l++)if(t.getValue(this.treeSettings.loadOnDemand?this.fields.value:"id",this.selectedData[l]).toString()===e){this.selectedData.splice(l,1);break}},s.prototype.initializeValueTemplate=function(){if(!this.valueTemplate)return null;if(this.isReact&&!t.isNullOrUndefined(this.valueTemplateContainer))t.detach(this.valueTemplateContainer),this.valueTemplateContainer=null;else if(this.valueTemplateContainer)for(;this.valueTemplateContainer.firstChild;)this.valueTemplateContainer.removeChild(this.valueTemplateContainer.firstChild);return t.isNullOrUndefined(this.valueTemplateContainer)&&(this.valueTemplateContainer=this.createElement("span",{className:"e-overflow e-show-text e-input-value "+X})),this.inputWrapper.insertBefore(this.valueTemplateContainer,this.inputEle),this.templateComplier(this.valueTemplate)},s.prototype.showOrHideValueTemplate=function(e,i){void 0===i&&(i=!1),this.valueTemplateContainer&&"Box"!==this.mode&&(e?(t.removeClass([this.valueTemplateContainer],X),t.addClass([this.inputWrapper],G),t.addClass([this.inputEle],Q)):(t.addClass([this.valueTemplateContainer],X),i||(t.removeClass([this.inputWrapper],G),t.removeClass([this.inputEle],Q))))},s.prototype.updateSelectedValues=function(){var e=this;this.dataValue="";var i,s,l,n="";this.hiddenElement.innerHTML="";var r="";if(this.isChipDelete&&!this.treeSettings.autoCheck||!this.inputWrapper.contains(this.chipWrapper)||(this.chipCollection.innerHTML=""),this.isFilteredData||(this.selectedData=[]),!t.isNullOrUndefined(this.value)){for(var o=this.initializeValueTemplate(),h=0,u=this.value.length;h<u;h++){l=this.getSelectedData(this.value[h]);var p=this.treeObj.getNode(this.value[h]);s=t.getValue(this.treeSettings.loadOnDemand?this.fields.text:"text",l),t.isNullOrUndefined(s)&&!t.isNullOrUndefined(p.text)&&(s=p.text.toString()),this.selectedText.push(s),i=this.selectedText[this.selectedText.length-1],this.selectedText.length>1?(this.dataValue+=this.delimiterChar+" "+i,n+=","+i):(this.dataValue+=i,n+=i),"Custom"===this.mode||"Delimiter"===this.mode||this.isChipDelete&&!this.treeSettings.autoCheck||!this.allowMultiSelection&&!this.showCheckBox||this.setChipValues(i,this.value[h]),r+='<option selected value ="'+this.value[h]+'">'+this.selectedText[this.selectedText.length-1]+"</option>",this.valueTemplate&&this.getValueTemplateElement(this.value[h],o)}this.hasTemplate&&this.portals&&(this.treeObj.portals&&(this.portals=this.portals.concat(this.treeObj.portals.filter(function(t){return!e.portals.includes(t)}))),this.isReact&&this.renderReactTemplates(this.reactCallBack)),this.selectedText.length>=1&&this.setProperties({text:n},!0),this.hiddenElement.innerHTML=r,"Custom"===this.mode&&(this.allowMultiSelection||this.showCheckBox)&&this.setTagValues()}var d=this.getValidMode();"Custom"===this.mode||"Box"===this.mode||!this.allowMultiSelection&&!this.showCheckBox||d||(this.chipWrapper&&(t.addClass([this.chipWrapper],X),t.removeClass([this.inputWrapper],G)),this.showOrHideValueTemplate(!0)),a.Input.setValue(this.dataValue,this.inputEle,this.floatLabelType),""===n?this.setProperties({text:null},!0):this.setProperties({text:n},!0),this.showClearButton&&this.inputFocus&&this.showOverAllClear(),(this.allowMultiSelection||this.showCheckBox)&&this.popupObj&&this.popupObj.refreshPosition(),this.currentText=this.text,this.currentValue=this.value,!t.isNullOrUndefined(this.value)&&this.value.length>0&&!t.isNullOrUndefined(this.currentText)?this.inputWrapper.setAttribute("aria-label",this.currentText.replace(/,/g,", ")):this.inputWrapper.setAttribute("aria-label",this.getModuleName())},s.prototype.setChipValues=function(e,i){this.inputWrapper.contains(this.chipWrapper)||this.createChip();var s=this.createElement("span",{className:"e-chips",attrs:{"data-value":i}}),l=this.createElement("span",{className:"e-chipcontent"}),n=this.createElement("span",{className:"e-chips-close e-icons"});this.enableHtmlSanitizer?l.innerText=t.SanitizeHtmlHelper.sanitize(e):l.innerHTML=e,s.appendChild(l),this.chipCollection.appendChild(s),this.showClearButton&&(s.appendChild(n),t.EventHandler.add(n,"mouseup",this.removeChip,this))},s.prototype.setTagValues=function(){if(null===this.value||null==this.text||0===this.value.length)return void(this.inputWrapper.contains(this.chipWrapper)&&t.addClass([this.chipWrapper],X));this.inputWrapper.contains(this.chipWrapper)||this.createChip(),this.inputWrapper.classList.contains(G)||t.addClass([this.inputWrapper],G);var e=this.createElement("span",{className:"e-chips"});this.inputEle.classList.contains(Q)||t.addClass([this.inputEle],Q),this.chipWrapper.classList.contains(X)&&(t.removeClass([this.chipWrapper],X),this.showOrHideValueTemplate(!1,!0));var i=this.createElement("span",{className:"e-chipcontent"}),s=this.customTemplate,l=this.customTemplateId,n=this.templateComplier(s)({value:this.value,text:this.text},this,"customTemplate",l,this.isStringTemplate,void 0,i);n&&(n=Array.prototype.slice.call(n),t.append(n,i)),e.appendChild(i),this.chipCollection.appendChild(e),this.isReact&&this.renderReactTemplates()},s.prototype.setSelectAllWrapper=function(e){this.isFirstRender||(e&&!this.popupEle.contains(this.checkAllParent)&&this.showCheckBox?(this.createSelectAllWrapper(),this.popupEle.insertBefore(this.checkAllParent,this.popupDiv)):this.popupEle.contains(this.checkAllParent)&&(t.detach(this.checkAllParent),this.checkAllParent=null))},s.prototype.setHeaderTemplate=function(){this.header?this.header.innerHTML="":(this.header=this.createElement("div"),t.addClass([this.header],"e-ddt-header"));var e=this.templateComplier(this.headerTemplate)({},this,"headerTemplate",this.headerTemplateId,this.isStringTemplate,void 0,this.header);e&&(e=Array.prototype.slice.call(e),t.append(e,this.header)),this.popupEle.insertBefore(this.header,this.checkAllParent?this.checkAllParent:this.popupDiv)},s.prototype.templateComplier=function(e){if(e)try{return"function"!=typeof e&&document.querySelectorAll(e).length?t.compile(document.querySelector(e).innerHTML.trim()):t.compile(e)}catch(i){return t.compile(e)}return t.compile(e)},s.prototype.setFooterTemplate=function(){this.footer?this.isReact&&"function"==typeof this.footerTemplate?this.clearTemplate(["footerTemplate"]):this.footer.innerHTML="":(this.footer=this.createElement("div"),t.addClass([this.footer],"e-ddt-footer"));var e=this.templateComplier(this.footerTemplate)({},this,"footerTemplate",this.footerTemplateId,this.isStringTemplate,void 0,this.footer);e&&(e=Array.prototype.slice.call(e),t.append(e,this.footer)),t.append([this.footer],this.popupEle)},s.prototype.clearAll=function(e){this.enabled&&!this.readonly&&(this.resetValue(),this.showOverAllClear(),(this.allowMultiSelection||this.showCheckBox)&&(this.popupObj&&this.popupObj.refreshPosition(),this.wrapText||this.updateOverflowWrapper(!0)),e&&(this.isClearButtonClick=!0),this.changeOnBlur||this.triggerChangeEvent(e))},s.prototype.removeChip=function(e){if(this.enabled&&!this.readonly){e.target.classList.contains("e-chips-close")&&!this.isPopupOpen&&(e.stopPropagation(),e.preventDefault());var i=e.target.parentElement,s=i.getAttribute("data-value");this.chipCollection&&i&&t.remove(i),this.isChipDelete=!0,this.isClearButtonClick=!0,this.removeSelectedData(s,!0),this.selectedText=[],this.allowMultiSelection&&(this.treeObj.selectedNodes=this.value.slice(),this.updateSelectedValues()),this.showCheckBox&&(this.treeObj.uncheckAll([s]),this.clearCheckAll(),this.setMultiSelect()),this.triggerChangeEvent(e),this.isChipDelete=!1,this.ensurePlaceHolder()}},s.prototype.resetValue=function(e){Array.isArray(this.value)&&0===this.value.length&&null==this.text||(a.Input.setValue(null,this.inputEle,this.floatLabelType),e||(this.setOldValue(),this.setProperties({value:[]},!0),this.showOrHideValueTemplate(!1)),(t.isNullOrUndefined(this.value)||0===this.value.length)&&this.inputWrapper.setAttribute("aria-label",this.getModuleName()),this.dataValue=null,this.setProperties({text:null},!0),this.selectedData=[],t.setValue("selectedNodes",[],this.treeObj),this.hiddenElement.innerHTML="",this.showCheckBox&&(this.treeObj.uncheckAll(),this.setMultiSelect(),this.clearCheckAll()),null!==this.oldValue||e?e&&this.triggerChangeEvent():this.removeValue=!0,(this.allowMultiSelection||this.showCheckBox)&&this.chipWrapper&&(this.chipCollection.innerHTML="",this.wrapText||this.updateOverflowWrapper(!0),this.ensurePlaceHolder()))},s.prototype.clearCheckAll=function(){this.showSelectAll&&this.value&&0===this.value.length&&this.setLocale(!1)},s.prototype.setOldValue=function(){this.oldValue=Array.isArray(this.value)?this.value.slice():this.value},s.prototype.selectAllItems=function(e){if(this.showCheckBox)e?(this.isCheckAllCalled=!0,this.treeObj.checkAll()):this.treeObj.uncheckAll(),this.checkSelectAll=e;else if(this.allowMultiSelection)if(e){for(var i=t.selectAll("li",this.treeObj.element),s=void 0,l=[],n=0;n<i.length;n++)s=i[n].getAttribute("data-uid").toString(),l.push(s);this.treeObj.selectedNodes=l}else this.treeObj.selectedNodes=[];this.updateMode(),this.setMultiSelect(),this.wrapText||(e?this.updateView():this.updateOverflowWrapper(!0))},s.prototype.updateTreeSettings=function(e){if("autoCheck"===e)this.treeObj.autoCheck=this.treeSettings.autoCheck;else if("loadOnDemand"===e)this.treeObj.loadOnDemand=this.treeSettings.loadOnDemand;else{if("expandOn"===e)return this.treeObj.expandOn=this.treeSettings.expandOn,void this.treeObj.dataBind();"checkDisabledChildren"===e&&(this.treeObj.checkDisabledChildren=this.treeSettings.checkDisabledChildren)}this.treeObj.dataBind(),this.setMultiSelect(),this.updateValue(this.value)},s.prototype.updateCheckBoxState=function(e){this.hasTemplate&&this.updateTemplate(),this.wrapText||this.updateOverflowWrapper(!1),this.treeObj.showCheckBox=e,this.treeObj.dataBind(),this.isDynamicChange=!0,this.setSelectAllWrapper(this.showSelectAll),this.showSelectAll&&this.setLocale(),this.showCheckBox&&this.updateMode(),this.setMultiSelect(),this.isDynamicChange=!1},s.prototype.updateTemplate=function(){this.popupObj&&(this.clearTemplate(),this.portals=[],this.popupObj.destroy(),this.isPopupOpen?(this.hidePopup(),this.isFirstRender=!0,this.renderPopup()):this.isFirstRender=!0)},s.prototype.l10nUpdate=function(e){if(this.noRecord?this.noRecord.innerHTML="":this.noRecord=this.createElement("div"),"No Records Found"!==this.noRecordsTemplate||"The Request Failed"!==this.actionFailureTemplate){var i=e?this.actionFailureTemplate:this.noRecordsTemplate,s=e?this.actionFailureTemplateId:this.noRecordsTemplateId,l=e?"actionFailureTemplate":"noRecordsTemplate",n=this.templateComplier(i)({},this,l,s,this.isStringTemplate,void 0,this.noRecord);n&&(n=Array.prototype.slice.call(n),t.append(n,this.noRecord))}else{var a={noRecordsTemplate:"No Records Found",actionFailureTemplate:"The Request Failed"};this.l10n=new t.L10n(this.getLocaleName(),a,this.locale),this.noRecord.innerHTML=e?this.l10n.getConstant("actionFailureTemplate"):this.l10n.getConstant("noRecordsTemplate")}t.addClass([this.noRecord],"e-ddt-nodata"),t.prepend([this.noRecord],this.popupDiv),this.treeObj&&this.treeObj.element.removeAttribute("aria-activedescendant")},s.prototype.updateRecordTemplate=function(e){this.treeItems&&this.treeItems.length<=0&&(this.l10nUpdate(e),this.hasTemplate&&this.updateTemplate())},s.prototype.updateOverflowWrapper=function(e){e?this.inputWrapper.contains(this.overFlowWrapper)&&e&&(this.overFlowWrapper.innerHTML=""):this.inputWrapper.contains(this.overFlowWrapper)||(this.overFlowWrapper=this.createElement("span",{className:"e-overflow "+X}),this.inputWrapper.insertBefore(this.overFlowWrapper,this.hiddenElement))},s.prototype.updateMultiSelection=function(e){this.wrapText||this.updateOverflowWrapper(!1),this.treeObj.allowMultiSelection=e,this.treeObj.dataBind(),this.updateOption(),this.allowMultiSelection&&this.updateMode(),this.setMultiSelect()},s.prototype.updateAllowFiltering=function(e){this.isFirstRender||(e?this.renderFilter():this.destroyFilter())},s.prototype.updateFilterPlaceHolder=function(){this.filterObj&&(this.filterObj.placeholder=this.filterBarPlaceholder,this.filterObj.element.setAttribute("aria-label",this.filterBarPlaceholder))},s.prototype.updateValue=function(e){this.isDynamicChange=!0,t.isNullOrUndefined(e)||0===e.length?this.resetValue(!0):(this.setTreeValue(),!this.allowMultiSelection&&!this.showCheckBox||this.wrapText||(this.updateOverflowWrapper(!1),this.updateView())),this.updateHiddenValue(),this.isDynamicChange=!1},s.prototype.updateText=function(e){t.isNullOrUndefined(e)?this.resetValue():(this.setTreeText(),!this.allowMultiSelection&&!this.showCheckBox||this.wrapText||(this.updateOverflowWrapper(!1),this.updateView())),this.updateHiddenValue()},s.prototype.updateModelMode=function(){if(!!this.allowMultiSelection||!!this.showCheckBox){if(!this.wrapText){var e=t.select(".e-overflow:not(.e-input-value)",this.inputWrapper);e&&(e.innerHTML="")}this.updateMode(),this.setMultiSelect(),!this.wrapText&&this.value&&0!==this.value.length&&(this.updateOverFlowView(),t.addClass([this.inputEle],Q),"Box"===this.mode?t.removeClass([this.overFlowWrapper,this.inputWrapper],Z):t.addClass([this.overFlowWrapper,this.inputWrapper],Z))}},s.prototype.updateOption=function(){this.hiddenElement.hasAttribute("multiple")||!this.allowMultiSelection&&!this.showCheckBox?!this.hiddenElement.hasAttribute("multiple")||this.allowMultiSelection||this.showCheckBox||this.hiddenElement.removeAttribute("multiple"):this.hiddenElement.setAttribute("multiple","")},s.prototype.onPropertyChanged=function(e,i){for(var s=0,l=Object.keys(e);s<l.length;s++)switch(l[s]){case"width":this.setElementWidth(e.width),this.popupObj&&(this.popupObj.element.style.width=this.setWidth());break;case"placeholder":a.Input.setPlaceholder(e.placeholder,this.inputEle);break;case"cssClass":this.setCssClass(e.cssClass,i.cssClass);break;case"enableRtl":this.setEnableRTL(this.enableRtl);break;case"fields":this.setFields();break;case"readonly":a.Input.setReadonly(e.readonly,this.inputEle);break;case"enabled":this.setEnable();break;case"floatLabelType":a.Input.removeFloating(this.inputObj),a.Input.addFloating(this.inputEle,e.floatLabelType,this.placeholder,this.createElement),this.ensureClearIconPosition(e.floatLabelType);break;case"showClearButton":this.updateClearButton(e.showClearButton);break;case"allowFiltering":this.updateAllowFiltering(e.allowFiltering);break;case"filterBarPlaceholder":this.updateFilterPlaceHolder();break;case"value":JSON.stringify(i.value)!==JSON.stringify(e.value)&&(this.oldValue=i.value,this.updateValue(e.value));break;case"text":this.updateText(e.text);break;case"allowMultiSelection":this.updateMultiSelection(e.allowMultiSelection);break;case"mode":if(!this.showCheckBox&&!this.allowMultiSelection)return;"Custom"===this.mode?(this.overFlowWrapper&&t.detach(this.overFlowWrapper),this.chipWrapper&&t.detach(this.chipWrapper),this.setTagValues()):("Custom"===i.mode&&this.updateOverflowWrapper(this.wrapText),this.updateModelMode());break;case"delimiterChar":if("Box"===this.mode)return;(this.showCheckBox||this.allowMultiSelection)&&this.setMultiSelect();break;case"selectAllText":this.showCheckBox&&this.showSelectAll&&this.setLocale();break;case"unSelectAllText":this.showCheckBox&&this.showSelectAll&&this.setLocale(!1);break;case"showSelectAll":this.showCheckBox&&(this.setSelectAllWrapper(e.showSelectAll),this.updatePopupHeight());break;case"showCheckBox":this.updateCheckBoxState(e.showCheckBox),this.wrapText||this.updateOverflowWrapper(!0),this.updatePopupHeight(),this.updateOption();break;case"treeSettings":for(var n=0,r=Object.keys(e.treeSettings);n<r.length;n++){var o=r[n];this.updateTreeSettings(o)}break;case"customTemplate":if("Custom"!==this.mode)return;this.chipCollection.innerHTML="",this.setTagValues();break;case"sortOrder":this.hasTemplate&&this.updateTemplate(),this.treeObj.sortOrder=e.sortOrder,this.treeObj.dataBind(),this.updateValue(this.value);break;case"showDropDownIcon":this.updateDropDownIconState(e.showDropDownIcon);break;case"popupWidth":this.popupObj&&(this.popupObj.element.style.width=this.setWidth());break;case"popupHeight":this.popupObj&&this.updatePopupHeight();break;case"zIndex":this.popupObj&&(this.popupObj.zIndex=e.zIndex,this.popupObj.dataBind());break;case"headerTemplate":case"footerTemplate":this.updateTemplate();break;case"itemTemplate":this.updateTemplate(),this.treeObj.nodeTemplate=e.itemTemplate,this.treeObj.dataBind();break;case"noRecordsTemplate":this.updateRecordTemplate();break;case"actionFailureTemplate":this.updateRecordTemplate(!0);break;case"htmlAttributes":this.setHTMLAttributes();break;case"wrapText":this.updateOverflowWrapper(this.wrapText),!this.allowMultiSelection&&!this.showCheckBox||this.wrapText?(t.addClass([this.overFlowWrapper],X),this.chipWrapper&&"Box"===this.mode?t.removeClass([this.chipWrapper],X):(t.removeClass([this.inputWrapper],G),t.removeClass([this.inputEle],Q)),this.ensurePlaceHolder()):this.updateView()}},s.prototype.clear=function(){this.clearAll(),this.inputFocus?this.onFocusOut():(this.changeOnBlur&&this.triggerChangeEvent(),this.removeValue=!1)},s.prototype.destroy=function(){for(this.clearTemplate(),this.unWireEvents(),this.setCssClass(null,this.cssClass),this.setProperties({text:null},!0),this.treeObj.destroy(),this.destroyFilter(),this.popupObj&&(this.popupObj.destroy(),t.detach(this.popupObj.element)),this.element.tagName!==this.getDirective()&&this.inputWrapper.parentElement.insertBefore(this.element,this.inputWrapper),a.Input.setValue(null,this.inputEle,this.floatLabelType),t.detach(this.inputWrapper),t.detach(this.popupDiv),t.detach(this.hiddenElement),a.Input.setRipple(!1,[this.inputObj]),this.element.classList.remove("e-input"),(this.showCheckBox||this.allowMultiSelection||this.value&&this.valueTemplateContainer)&&this.element.classList.remove(Q),t.detach(this.inputObj.container),this.inputObj.buttons.length&&t.detach(this.inputObj.buttons[0]),this.inputObj=null;this.hiddenElement.options.length>0;)this.hiddenElement.remove(0);if(this.hiddenElement.innerHTML="",this.hiddenElement=null,this.inputWrapper.innerHTML="",this.inputWrapper=null,this.popupDiv=null,this.tree=null,this.popupObj=null,this.treeObj=null,this.overAllClear=null,this.chipCollection)for(var i=0,s=t.selectAll(".e-chips-close",this.chipCollection);i<s.length;i++){var l=s[i];t.EventHandler.remove(l,"mouseup",this.removeChip)}this.chipWrapper=null,this.chipCollection=null,this.checkAllParent=null,this.selectAllSpan=null,this.checkBoxElement=null,this.checkWrapper=null,this.popupEle=null,this.header=null,this.footer=null,this.overFlowWrapper=null,this.keyboardModule=null,e.prototype.destroy.call(this),this.setProperties({value:[]},!0)},s.prototype.destroyFilter=function(){this.filterObj&&(this.filterObj.destroy(),t.detach(this.filterObj.element),t.detach(this.filterContainer),this.filterObj=null)},s.prototype.destroyPopup=function(){this.isPopupOpen=!1,this.isReact&&this.clearTemplate(["headerTemplate","footerTemplate","itemTemplate","actionFailureTemplate","noRecordsTemplate"]),this.popupObj&&(this.popupObj.destroy(),t.detach(this.popupObj.element))},s.prototype.ensureVisible=function(e){this.treeObj.ensureVisible(e)},s.prototype.getData=function(e){return this.treeObj.getTreeData(e)},s.prototype.hidePopup=function(){var e={popup:this.popupObj,cancel:!1};this.trigger("close",e),e.cancel||(this.inputWrapper.classList.remove("e-icon-anim"),this.popupEle&&t.addClass([this.popupEle],"e-ddt-icon-hide"),t.attributes(this.inputEle,{"aria-expanded":"false"}),this.popupObj&&this.isPopupOpen&&(this.popupObj.hide(),this.inputFocus&&(this.inputWrapper.focus(),this.allowFiltering&&t.addClass([this.inputWrapper],[J])),this.isFilteredData&&(this.treeObj.treeData=this.treeData),this.destroyPopupOnHide&&(this.isFirstRender=!0,this.destroyPopup())))},s.prototype.selectAll=function(e){this.selectAllItems(e)},s.prototype.showPopup=function(){!this.enabled||this.readonly||this.isPopupOpen||(this.renderPopup(),this.focusIn())},s.prototype.getModuleName=function(){return"dropdowntree"},z([t.Property("The Request Failed")],s.prototype,"actionFailureTemplate",void 0),z([t.Property(!1)],s.prototype,"allowFiltering",void 0),z([t.Property(!1)],s.prototype,"allowMultiSelection",void 0),z([t.Property(!0)],s.prototype,"changeOnBlur",void 0),z([t.Property("")],s.prototype,"cssClass",void 0),z([t.Property("${value.length} item(s) selected")],s.prototype,"customTemplate",void 0),z([t.Property(",")],s.prototype,"delimiterChar",void 0),z([t.Property(!0)],s.prototype,"enabled",void 0),z([t.Complex({},ee)],s.prototype,"fields",void 0),z([t.Property(null)],s.prototype,"filterBarPlaceholder",void 0),z([t.Property("StartsWith")],s.prototype,"filterType",void 0),z([t.Property("Never")],s.prototype,"floatLabelType",void 0),z([t.Property(null)],s.prototype,"footerTemplate",void 0),z([t.Property(!1)],s.prototype,"ignoreAccent",void 0),z([t.Property(!0)],s.prototype,"ignoreCase",void 0),z([t.Property(null)],s.prototype,"headerTemplate",void 0),z([t.Property({})],s.prototype,"htmlAttributes",void 0),z([t.Property(null)],s.prototype,"itemTemplate",void 0),z([t.Property("Default")],s.prototype,"mode",void 0),z([t.Property("No Records Found")],s.prototype,"noRecordsTemplate",void 0),z([t.Property(null)],s.prototype,"placeholder",void 0),z([t.Property("300px")],s.prototype,"popupHeight",void 0),z([t.Property("100%")],s.prototype,"popupWidth",void 0),z([t.Property(!1)],s.prototype,"readonly",void 0),z([t.Property(!1)],s.prototype,"showSelectAll",void 0),z([t.Property("Select All")],s.prototype,"selectAllText",void 0),z([t.Property(!1)],s.prototype,"showCheckBox",void 0),z([t.Property(!0)],s.prototype,"destroyPopupOnHide",void 0),z([t.Property(!0)],s.prototype,"enableHtmlSanitizer",void 0),z([t.Property(!0)],s.prototype,"showClearButton",void 0),z([t.Property(!0)],s.prototype,"showDropDownIcon",void 0),z([t.Property("None")],s.prototype,"sortOrder",void 0),z([t.Property(null)],s.prototype,"text",void 0),z([t.Complex({},te)],s.prototype,"treeSettings",void 0),z([t.Property("Unselect All")],s.prototype,"unSelectAllText",void 0),z([t.Property(null)],s.prototype,"value",void 0),z([t.Property(null)],s.prototype,"valueTemplate",void 0),z([t.Property("100%")],s.prototype,"width",void 0),z([t.Property(1e3)],s.prototype,"zIndex",void 0),z([t.Property(!1)],s.prototype,"wrapText",void 0),z([t.Event()],s.prototype,"actionFailure",void 0),z([t.Event()],s.prototype,"beforeOpen",void 0),z([t.Event()],s.prototype,"change",void 0),z([t.Event()],s.prototype,"close",void 0),z([t.Event()],s.prototype,"blur",void 0),z([t.Event()],s.prototype,"created",void 0),z([t.Event()],s.prototype,"dataBound",void 0),z([t.Event()],s.prototype,"destroyed",void 0),z([t.Event()],s.prototype,"filtering",void 0),z([t.Event()],s.prototype,"focus",void 0),z([t.Event()],s.prototype,"keyPress",void 0),z([t.Event()],s.prototype,"open",void 0),z([t.Event()],s.prototype,"select",void 0),s=z([t.NotifyPropertyChanges],s)}(t.Component),se=function(){var e=function(t,i){return(e=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])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),le=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(l=e[r])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};q.root="e-combobox";var ne={container:null,buttons:[]},ae=function(e){function s(t,i){return e.call(this,t,i)||this}return se(s,e),s.prototype.preRender=function(){e.prototype.preRender.call(this)},s.prototype.getLocaleName=function(){return"combo-box"},s.prototype.wireEvent=function(){"combobox"===this.getModuleName()&&(t.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.preventBlur,this),t.EventHandler.add(this.inputWrapper.container,"blur",this.onBlurHandler,this)),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.dropDownClick,this),t.EventHandler.add(this.inputElement,"focus",this.targetFocus,this),this.readonly||(t.EventHandler.add(this.inputElement,"input",this.onInput,this),t.EventHandler.add(this.inputElement,"keyup",this.onFilterUp,this),t.EventHandler.add(this.inputElement,"keydown",this.onFilterDown,this),t.EventHandler.add(this.inputElement,"paste",this.pasteHandler,this),t.EventHandler.add(window,"resize",this.windowResize,this)),this.bindCommonEvent()},s.prototype.preventBlur=function(e){(this.allowFiltering||document.activeElement===this.inputElement||document.activeElement.classList.contains(q.input)||!t.Browser.isDevice)&&t.Browser.isDevice||e.preventDefault()},s.prototype.onBlurHandler=function(i){var s=this.inputElement&&""===this.inputElement.value?null:this.inputElement&&this.inputElement.value,l=t.isNullOrUndefined(this.text)?this.text:this.text.replace(/\r\n|\n|\r/g,"");t.isNullOrUndefined(this.listData)||t.isNullOrUndefined(s)||s===l||this.customValue(i),e.prototype.onBlurHandler.call(this,i)},s.prototype.targetElement=function(){return this.inputElement},s.prototype.setOldText=function(e){a.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton),this.customValue(),this.removeSelection()},s.prototype.setOldValue=function(e){this.allowCustom?(this.selectedLI=this.getElementByValue(this.value),this.valueMuteChange(this.value)):this.valueMuteChange(null),this.removeSelection(),this.setHiddenValue()},s.prototype.valueMuteChange=function(e){e=this.allowObjectBinding&&!t.isNullOrUndefined(e)?t.getValue(this.fields.value?this.fields.value:"",e):e;var i=t.isNullOrUndefined(e)?null:e.toString();a.Input.setValue(i,this.inputElement,this.floatLabelType,this.showClearButton);var s={};if(this.allowObjectBinding&&(e=this.getDataByValue(e),t.isNullOrUndefined(e))){var l=this.fields,n=!1,r=!1;if(this.allowObjectBinding){var o=Object.keys(this.value);o.forEach(function(e){if(e===l.value)return void(r=!0)}),o.forEach(function(e){if(e===l.text)return void(n=!0)})}s={text:r?n?t.getValue(l.text,this.value):t.getValue(l.value,this.value):null,value:r?this.value:null,index:null}}this.allowObjectBinding?this.setProperties(s,!0):this.setProperties({value:e,text:e?e.toString():e,index:null},!0),this.activeIndex=this.index;var h=this.fields,u={};u[h.text]=t.isNullOrUndefined(e)?null:e.toString(),u[h.value]=t.isNullOrUndefined(e)?null:e.toString(),this.itemData=u,this.item=null,(!this.allowObjectBinding&&this.previousValue!==this.value||this.allowObjectBinding&&this.previousValue&&this.value&&!this.isObjectInArray(this.previousValue,[this.value]))&&this.detachChangeEvent(null)},s.prototype.updateValues=function(){var e=this;if(this.fields.disabled&&(null!=this.value&&(this.value=this.isDisableItemValue(this.value)?null:this.value),null!=this.text&&(this.text=this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text)))?null:this.text),null!=this.index&&(this.index=this.isDisabledItemByIndex(this.index)?null:this.index,this.activeIndex=this.index)),t.isNullOrUndefined(this.value))this.text&&t.isNullOrUndefined(this.value)?(l=this.getElementByText(this.text))?this.setSelection(l,null):(a.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton),this.customValue()):t.isNullOrUndefined(this.activeIndex)||t.isNullOrUndefined(this.liCollections[this.activeIndex])||this.setSelection(this.liCollections[this.activeIndex],null);else{var s=this.allowObjectBinding&&!t.isNullOrUndefined(this.value)?t.getValue(this.fields.value?this.fields.value:"",this.value):this.value,l=this.getElementByValue(s),n=!t.isNullOrUndefined(l);if(this.enableVirtualization&&this.value){var r=this.fields.value?this.fields.value:"",o=this.allowObjectBinding&&!t.isNullOrUndefined(this.value)?t.getValue(this.fields.value?this.fields.value:"",this.value):this.value;if(this.dataSource instanceof i.DataManager)this.dataSource.executeQuery((new i.Query).where(new i.Predicate(r,"equal",o))).then(function(i){if(i&&i.result&&i.result.length>0){e.itemData=i.result[0];var s=e.getItemData(),l=e.allowObjectBinding?e.itemData:s.value,n=e.allowObjectBinding&&!t.isNullOrUndefined(e.value)?t.getValue(e.fields.value?e.fields.value:"",e.value):e.value;(n===s.value&&e.text!==s.text.toString()||n!==s.value&&e.text===s.text.toString())&&e.setProperties({text:s.text?s.text.toString():s.text,value:l})}else e.allowCustom?(e.valueMuteChange(e.value),e.setHiddenValue(),a.Input.setValue(e.text,e.inputElement,e.floatLabelType,e.showClearButton)):e.valueMuteChange(null)});else{var h=new i.DataManager(this.dataSource).executeLocal((new i.Query).where(new i.Predicate(r,"equal",o)));if(h&&h.length>0){this.itemData=h[0],n=!0;var u=this.getItemData(),p=this.allowObjectBinding?this.getDataByValue(u.value):u.value;(this.value===u.value&&this.text!==u.text||this.value!==u.value&&this.text===u.text)&&(this.setProperties({text:u.text?u.text.toString():u.text,value:p}),t.isNullOrUndefined(l)&&(this.previousValue=this.value))}}}l?this.setSelection(l,null):!this.enableVirtualization&&this.allowCustom||this.allowCustom&&this.enableVirtualization&&!n&&!(this.dataSource instanceof i.DataManager)?this.valueMuteChange(this.value):this.enableVirtualization&&(!this.enableVirtualization||this.dataSource instanceof i.DataManager||n)||this.valueMuteChange(null)}this.setHiddenValue(),a.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton)},s.prototype.updateIconState=function(){this.showClearButton&&(this.inputElement&&""!==this.inputElement.value&&!this.readonly?t.removeClass([this.inputWrapper.clearButton],q.clearIconHide):t.addClass([this.inputWrapper.clearButton],q.clearIconHide))},s.prototype.getAriaAttributes=function(){return{role:"combobox","aria-autocomplete":"both","aria-labelledby":this.hiddenElement.id,"aria-expanded":"false","aria-readonly":this.readonly?this.readonly.toString():"false",autocomplete:"off",autocapitalize:"off",spellcheck:"false"}},s.prototype.searchLists=function(t){this.isTyped=!0,this.isFiltering()?(e.prototype.searchLists.call(this,t),this.ulElement&&""===this.filterInput.value.trim()&&this.setHoverList(this.ulElement.querySelector("."+q.li))):(this.ulElement&&""===this.inputElement.value&&this.preventAutoFill&&this.setHoverList(this.ulElement.querySelector("."+q.li)),this.incrementalSearch(t))},s.prototype.getNgDirective=function(){return"EJS-COMBOBOX"},s.prototype.setSearchBox=function(){return this.filterInput=this.inputElement,this.isFiltering()||this.isReact&&"combobox"===this.getModuleName()?this.inputWrapper:ne},s.prototype.onActionComplete=function(t,i,s,l){var n=this;e.prototype.onActionComplete.call(this,t,i,s),this.isSelectCustom&&this.removeSelection(),this.preventAutoFill||"combobox"!==this.getModuleName()||!this.isTyped||this.enableVirtualization||setTimeout(function(){n.inlineSearch()})},s.prototype.getFocusElement=function(){var e=this.isSelectCustom?{text:""}:this.getItemData(),i=t.isNullOrUndefined(this.list)?this.list:this.list.querySelector("."+q.selected);if(e.text&&e.text.toString()===this.inputElement.value&&!t.isNullOrUndefined(i))return i;if((t.Browser.isDevice&&!this.isDropDownClick||!t.Browser.isDevice)&&!t.isNullOrUndefined(this.liCollections)&&this.liCollections.length>0){var s=this.inputElement.value,l=this.sortedData,n=this.typeOfData(l).typeof,a=u(s,this.liCollections,this.filterType,!0,l,this.fields,n,this.ignoreAccent);if(this.enableVirtualization&&""!==s&&"autocomplete"!==this.getModuleName()&&this.isTyped&&!this.allowFiltering){var r=!1,o=this.viewPortInfo.endIndex>=this.incrementalEndIndex&&this.incrementalEndIndex<=this.totalItemCount,h=0===this.incrementalEndIndex;for((o||h)&&(r=!0,this.incrementalStartIndex=this.incrementalEndIndex,this.incrementalEndIndex=h?Math.min(100,this.totalItemCount):Math.min(this.incrementalEndIndex+100,this.totalItemCount),this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),r=!0),(0!==this.viewPortInfo.startIndex||r)&&this.updateIncrementalView(0,this.itemCount),a=u(s,this.incrementalLiCollections,this.filterType,!0,l,this.fields,n);t.isNullOrUndefined(a.item)&&this.incrementalEndIndex<this.totalItemCount;){if(this.incrementalStartIndex=this.incrementalEndIndex,this.incrementalEndIndex=this.incrementalEndIndex+100>this.totalItemCount?this.totalItemCount:this.incrementalEndIndex+100,this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),r=!0,(0!==this.viewPortInfo.startIndex||r)&&this.updateIncrementalView(0,this.itemCount),a=u(s,this.incrementalLiCollections,this.filterType,!0,l,this.fields,n),!t.isNullOrUndefined(a)){a.index=a.index+this.incrementalStartIndex;break}if(t.isNullOrUndefined(a)&&this.incrementalEndIndex>=this.totalItemCount){this.incrementalStartIndex=0,this.incrementalEndIndex=100>this.totalItemCount?this.totalItemCount:100;break}}var p=a.index-(this.itemCount/2-2)>0?a.index-(this.itemCount/2-2):0,d=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount;if(p!==this.viewPortInfo.startIndex&&this.updateIncrementalView(p,d),t.isNullOrUndefined(a.item))this.updateIncrementalView(0,this.itemCount),this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.list.scrollTop=0;else{var c=this.viewPortInfo.startIndex+(this.itemCount/2-2)<this.totalItemCount?this.viewPortInfo.startIndex+(this.itemCount/2-2):this.totalItemCount,m=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount;this.updateIncrementalView(c,m),a.item=this.getElementByValue(a.item.getAttribute("data-value"))}a&&a.item&&(a.item=this.getElementByValue(a.item.getAttribute("data-value")))}var f=a.item,v=this.getItemData();if(!t.isNullOrUndefined(f)&&!this.enableVirtualization||this.enableVirtualization&&this.isTyped&&t.isNullOrUndefined(v)&&t.isNullOrUndefined(v.value)&&v.value.toString()===f.getAttribute("data-value").toString()){var g=this.getIndexByValue(f.getAttribute("data-value"))-1,y=parseInt(getComputedStyle(this.liCollections[0],null).getPropertyValue("height"),10);if(!isNaN(y)&&"autocomplete"!==this.getModuleName()){this.removeFocus();var C=this.fields.groupBy?this.liCollections[0].offsetHeight:0;if(this.enableVirtualization){if(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.enableVirtualization&&!this.fields.groupBy){var b=f.offsetTop,S=this.virtualListInfo&&this.virtualListInfo.startIndex?this.virtualListInfo.startIndex:0,E=f.offsetHeight,x=b+S*E,I=this.list.querySelectorAll(".e-virtual-list").length*E;this.list.scrollTop=x-I}}else this.list.scrollTop=g*y+C;t.addClass([f],q.focus)}}else this.isSelectCustom&&""!==this.inputElement.value.trim()&&(this.removeFocus(),this.enableVirtualization||(this.list.scrollTop=0));return f}return null},s.prototype.setValue=function(t){return(t&&"keydown"===t.type&&"enter"===t.action||t&&"click"===t.type)&&this.removeFillSelection(),this.autofill&&"combobox"===this.getModuleName()&&t&&"keydown"===t.type&&"enter"!==t.action?(this.preventAutoFill=!1,this.inlineSearch(t),!1):e.prototype.setValue.call(this,t)},s.prototype.checkCustomValue=function(){var e=this.allowObjectBinding&&!t.isNullOrUndefined(this.value)?t.getValue(this.fields.value?this.fields.value:"",this.value):this.value;this.itemData=this.getDataByValue(e);var i=this.getItemData(),s=this.allowObjectBinding?this.itemData:i.value;this.allowCustom&&t.isNullOrUndefined(i.value)&&t.isNullOrUndefined(i.text)||this.setProperties({value:s},!this.allowCustom)},s.prototype.showSpinner=function(){t.isNullOrUndefined(this.spinnerElement)&&(this.spinnerElement="autocomplete"===this.getModuleName()?this.inputWrapper.buttons[0]||this.inputWrapper.clearButton||a.Input.appendSpan("e-input-group-icon e-atc-spinner-icon",this.inputWrapper.container,this.createElement):this.inputWrapper.buttons[0]||this.inputWrapper.clearButton,t.addClass([this.spinnerElement],q.disableIcon),n.createSpinner({target:this.spinnerElement,width:t.Browser.isDevice?"16px":"14px"},this.createElement),n.showSpinner(this.spinnerElement))},s.prototype.hideSpinner=function(){t.isNullOrUndefined(this.spinnerElement)||(n.hideSpinner(this.spinnerElement),t.removeClass([this.spinnerElement],q.disableIcon),this.spinnerElement.classList.contains("e-atc-spinner-icon")?t.detach(this.spinnerElement):this.spinnerElement.innerHTML="",this.spinnerElement=null)},s.prototype.setAutoFill=function(e,t){if(t||this.setHoverList(e),this.autofill&&!this.preventAutoFill){var i=this.getTextByValue(e.getAttribute("data-value")).toString(),s=this.getFormattedValue(e.getAttribute("data-value"));"combobox"===this.getModuleName()&&(!this.isSelected&&!this.allowObjectBinding&&this.previousValue!==s||this.allowObjectBinding&&this.previousValue&&s&&!this.isObjectInArray(this.previousValue,[this.getDataByValue(s)])?(this.updateSelectedItem(e,null),this.isSelected=!0,this.previousValue=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(e.getAttribute("data-value"))):this.getFormattedValue(e.getAttribute("data-value"))):this.updateSelectedItem(e,null,!0)),this.isAndroidAutoFill(i)||this.setAutoFillSelection(i,t)}},s.prototype.isAndroidAutoFill=function(e){if(t.Browser.isAndroid){var i=this.getSelectionPoints(),s=this.prevSelectPoints.end,l=i.end,n=this.prevSelectPoints.start,a=i.start;return 0!==s&&(s===e.length&&n===e.length||n>a&&s>l||s===l&&n===a)}return!1},s.prototype.clearAll=function(i,s){(t.isNullOrUndefined(s)||!t.isNullOrUndefined(s)&&t.isNullOrUndefined(s.dataSource))&&e.prototype.clearAll.call(this,i),this.isFiltering()&&!t.isNullOrUndefined(i)&&i.target===this.inputWrapper.clearButton&&(this.typedString=this.filterInput.value,this.searchLists(i))},s.prototype.isSelectFocusItem=function(e){return!t.isNullOrUndefined(e)},s.prototype.inlineSearch=function(e){var i=e&&("down"===e.action||"up"===e.action||"home"===e.action||"end"===e.action||"pageUp"===e.action||"pageDown"===e.action),s=i?this.liCollections[this.activeIndex]:this.getFocusElement();if(t.isNullOrUndefined(s)){if(t.isNullOrUndefined(this.inputElement)||""!==this.inputElement.value)this.activeIndex=null,this.removeSelection(),this.liCollections&&this.liCollections.length>0&&!this.isCustomFilter&&this.removeFocus();else if(this.activeIndex=null,!t.isNullOrUndefined(this.list)){this.enableVirtualization||(this.list.scrollTop=0);var l=this.list.querySelector("."+q.li);this.setHoverList(l)}}else{if(!i){var n=this.getFormattedValue(s.getAttribute("data-value"));this.activeIndex=this.getIndexByValue(n),this.activeIndex=t.isNullOrUndefined(this.activeIndex)?null:this.activeIndex}this.preventAutoFill=""!==this.inputElement.value&&this.preventAutoFill,this.setAutoFill(s,i)}},s.prototype.incrementalSearch=function(e){this.showPopup(e),t.isNullOrUndefined(this.listData)||(this.inlineSearch(e),e.preventDefault())},s.prototype.setAutoFillSelection=function(e,t){void 0===t&&(t=!1);var i=this.getSelectionPoints(),s=this.inputElement.value.substr(0,i.start);if(s&&s.toLowerCase()===e.substr(0,i.start).toLowerCase()){var l=s+e.substr(s.length,e.length);a.Input.setValue(l,this.inputElement,this.floatLabelType,this.showClearButton),this.inputElement.setSelectionRange(i.start,this.inputElement.value.length)}else t&&(a.Input.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton),this.inputElement.setSelectionRange(0,this.inputElement.value.length))},s.prototype.getValueByText=function(t){return e.prototype.getValueByText.call(this,t,this.ignoreCase,this.ignoreAccent)},s.prototype.unWireEvent=function(){"combobox"===this.getModuleName()&&(t.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.preventBlur),t.EventHandler.remove(this.inputWrapper.container,"blur",this.onBlurHandler)),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.dropDownClick),this.inputElement&&(t.EventHandler.remove(this.inputElement,"focus",this.targetFocus),this.readonly||(t.EventHandler.remove(this.inputElement,"input",this.onInput),t.EventHandler.remove(this.inputElement,"keyup",this.onFilterUp),t.EventHandler.remove(this.inputElement,"keydown",this.onFilterDown),t.EventHandler.remove(this.inputElement,"paste",this.pasteHandler),t.EventHandler.remove(window,"resize",this.windowResize))),this.unBindCommonEvent()},s.prototype.setSelection=function(i,s){e.prototype.setSelection.call(this,i,s),t.isNullOrUndefined(i)||this.autofill||this.isDropDownClick||this.removeFocus()},s.prototype.selectCurrentItem=function(e){var i;if(this.isPopupOpen){if(i=this.isSelected?this.list.querySelector("."+q.selected):this.list.querySelector("."+q.focus),this.isDisabledElement(i))return;i&&(this.setSelection(i,e),this.isTyped=!1),this.isSelected&&(this.isSelectCustom=!1,this.onChangeEvent(e))}"enter"===e.action&&""===this.inputElement.value?this.clearAll(e):this.isTyped&&!this.isSelected&&t.isNullOrUndefined(i)&&this.customValue(e),this.hidePopup(e)},s.prototype.setHoverList=function(e){this.removeSelection(),this.isValidLI(e)&&!e.classList.contains(q.selected)&&(this.removeFocus(),e.classList.add(q.focus))},s.prototype.targetFocus=function(e){t.Browser.isDevice&&!this.allowFiltering&&(this.preventFocus=!1),this.onFocus(e),a.Input.calculateWidth(this.inputElement,this.inputWrapper.container)},s.prototype.dropDownClick=function(i){i.preventDefault(),t.Browser.isDevice&&!this.isFiltering()&&(this.preventFocus=!0),e.prototype.dropDownClick.call(this,i)},s.prototype.customValue=function(e){var i=this,s=this.getValueByText(this.inputElement.value);if(this.allowCustom||""===this.inputElement.value)if(""!==this.inputElement.value){var l=this.value;if(t.isNullOrUndefined(s)){var n=""===this.inputElement.value?null:this.inputElement.value,r={text:n,item:{}};this.isObjectCustomValue=!0,this.initial?this.updateCustomValueCallback(n,r,l):this.trigger("customValueSpecifier",r,function(t){i.updateCustomValueCallback(n,t,l,e)})}else this.isSelectCustom=!1,s=this.allowObjectBinding?this.getDataByValue(s):s,this.setProperties({value:s}),(!this.allowObjectBinding&&l!==this.value||this.allowObjectBinding&&l&&this.value&&!this.isObjectInArray(l,[this.value]))&&this.onChangeEvent(e)}else this.allowCustom&&this.isFocused&&(this.isSelectCustom=!0);else{var o=this.previousValue,h=this.value;s=this.allowObjectBinding?this.getDataByValue(s):s,this.setProperties({value:s}),t.isNullOrUndefined(this.value)&&a.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.autofill&&(!this.allowObjectBinding&&o===this.value||this.allowObjectBinding&&o&&this.isObjectInArray(o,[this.value]))&&(!this.allowObjectBinding&&h!==this.value||this.allowObjectBinding&&h&&!this.isObjectInArray(h,[this.value]))&&this.onChangeEvent(null)}},s.prototype.updateCustomValueCallback=function(e,i,s,l){var n=this,a=this.fields,r=i.item,o={};r&&t.getValue(a.text,r)&&t.getValue(a.value,r)?o=r:(t.setValue(a.text,e,o),t.setValue(a.value,e,o)),this.itemData=o;var h={};if(this.allowObjectBinding){var u=this.listData&&this.listData.length>0?Object.keys(this.listData[0]):Object.keys(this.itemData);this.listData&&this.listData.length>0||!("autocomplete"===this.getModuleName()||"combobox"===this.getModuleName()&&this.allowFiltering)||(u=this.firstItem?Object.keys(this.firstItem):Object.keys(this.itemData)),u.forEach(function(e){h[e]=e===a.value||e===a.text?t.getValue(a.value,n.itemData):null})}var p={text:t.getValue(a.text,this.itemData),value:this.allowObjectBinding?h:t.getValue(a.value,this.itemData),index:null};this.setProperties(p,!0),this.setSelection(null,null),this.isSelectCustom=!0,this.isObjectCustomValue=!1,(!this.allowObjectBinding&&s!==this.value||this.allowObjectBinding&&(null==s&&null!==this.value||s&&!this.isObjectInArray(s,[this.value])))&&this.onChangeEvent(l,!0)},s.prototype.onPropertyChanged=function(i,s){"combobox"===this.getModuleName()&&(this.checkData(i),this.setUpdateInitial(["fields","query","dataSource"],i,s));for(var l=0,n=Object.keys(i);l<n.length;l++){var r=n[l];switch(r){case"readonly":a.Input.setReadonly(this.readonly,this.inputElement),this.readonly?(t.EventHandler.remove(this.inputElement,"input",this.onInput),t.EventHandler.remove(this.inputElement,"keyup",this.onFilterUp),t.EventHandler.remove(this.inputElement,"keydown",this.onFilterDown)):(t.EventHandler.add(this.inputElement,"input",this.onInput,this),t.EventHandler.add(this.inputElement,"keyup",this.onFilterUp,this),t.EventHandler.add(this.inputElement,"keydown",this.onFilterDown,this)),this.setReadOnly();break;case"allowFiltering":this.setSearchBox(),this.isFiltering()&&"combobox"===this.getModuleName()&&t.isNullOrUndefined(this.list)&&e.prototype.renderList.call(this);break;case"allowCustom":break;default:var o=this.getPropObject(r,i,s);e.prototype.onPropertyChanged.call(this,o.newProperty,o.oldProperty),this.isFiltering()&&"dataSource"===r&&t.isNullOrUndefined(this.list)&&this.itemTemplate&&"combobox"===this.getModuleName()&&e.prototype.renderList.call(this)}}},s.prototype.render=function(){e.prototype.render.call(this),this.setSearchBox(),this.renderComplete(),this.autoFill=this.autofill},s.prototype.getModuleName=function(){return"combobox"},s.prototype.addItem=function(t,i){e.prototype.addItem.call(this,t,i)},s.prototype.filter=function(t,i,s){e.prototype.filter.call(this,t,i,s)},s.prototype.showPopup=function(t){e.prototype.showPopup.call(this,t)},s.prototype.hidePopup=function(i){var s=this.inputElement&&""===this.inputElement.value?null:this.inputElement&&this.inputElement.value;if(!t.isNullOrUndefined(this.listData)){var l=this.isEscapeKey;this.isEscapeKey&&(a.Input.setValue(this.typedString,this.inputElement,this.floatLabelType,this.showClearButton),this.isEscapeKey=!1),this.autofill&&this.removeFillSelection();var n=this.isSelectCustom?{text:""}:this.getItemData(),r=t.isNullOrUndefined(n.text)?n.text:n.text.toString().replace(/\r\n|\n|\r/g,""),o=t.isNullOrUndefined(this.list)?null:this.list.querySelector("."+q.selected);if(this.inputElement&&r===this.inputElement.value&&!t.isNullOrUndefined(o))return this.isSelected&&(this.onChangeEvent(i),this.isSelectCustom=!1),void e.prototype.hidePopup.call(this,i);if("combobox"===this.getModuleName()&&""!==this.inputElement.value.trim()){var h=this.sortedData,p=this.typeOfData(h).typeof,d=u(this.inputElement.value,this.liCollections,"Equal",!0,h,this.fields,p);this.selectedLI=d.item,t.isNullOrUndefined(d.index)&&(d.index=u(this.inputElement.value,this.liCollections,"StartsWith",!0,h,this.fields,p).index),this.activeIndex=d.index,t.isNullOrUndefined(this.selectedLI)?l&&(this.isSelectCustom=!0,this.removeSelection()):this.updateSelectedItem(this.selectedLI,null,!0)}this.isEscapeKey||!this.isTyped||this.isInteracted||this.customValue(i)}var c=this.allowObjectBinding&&!t.isNullOrUndefined(this.value)?t.getValue(this.fields.value?this.fields.value:"",this.value):this.value;t.isNullOrUndefined(this.listData)&&this.allowCustom&&!t.isNullOrUndefined(s)&&s!==c&&this.customValue(),e.prototype.hidePopup.call(this,i)},s.prototype.focusIn=function(){this.enabled&&(t.Browser.isDevice&&!this.isFiltering()&&(this.preventFocus=!0),e.prototype.focusIn.call(this))},s.prototype.clear=function(){this.value=null},s.prototype.focusOut=function(t){e.prototype.focusOut.call(this,t)},s.prototype.getItems=function(){return e.prototype.getItems.call(this)},s.prototype.getDataByValue=function(t){return e.prototype.getDataByValue.call(this,t)},s.prototype.renderHightSearch=function(){},le([t.Property(!1)],s.prototype,"autofill",void 0),le([t.Property(!0)],s.prototype,"allowCustom",void 0),le([t.Property({})],s.prototype,"htmlAttributes",void 0),le([t.Property(!1)],s.prototype,"allowFiltering",void 0),le([t.Property(!0)],s.prototype,"isDeviceFullScreen",void 0),le([t.Property(null)],s.prototype,"query",void 0),le([t.Property(null)],s.prototype,"index",void 0),le([t.Property(!0)],s.prototype,"showClearButton",void 0),le([t.Event()],s.prototype,"customValueSpecifier",void 0),le([t.Event()],s.prototype,"filtering",void 0),le([t.Property(null)],s.prototype,"valueTemplate",void 0),le([t.Property("Never")],s.prototype,"floatLabelType",void 0),le([t.Property(null)],s.prototype,"filterBarPlaceholder",void 0),le([t.Property(null)],s.prototype,"cssClass",void 0),le([t.Property(null)],s.prototype,"headerTemplate",void 0),le([t.Property(null)],s.prototype,"footerTemplate",void 0),le([t.Property(null)],s.prototype,"placeholder",void 0),le([t.Property("100%")],s.prototype,"width",void 0),le([t.Property("300px")],s.prototype,"popupHeight",void 0),le([t.Property("100%")],s.prototype,"popupWidth",void 0),le([t.Property(!1)],s.prototype,"readonly",void 0),le([t.Property(null)],s.prototype,"text",void 0),le([t.Property(null)],s.prototype,"value",void 0),le([t.Property(!1)],s.prototype,"allowObjectBinding",void 0),s=le([t.NotifyPropertyChanges],s)}(j),re=function(){var e=function(t,i){return(e=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])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),oe=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(l=e[r])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};q.root="e-autocomplete",q.icon="e-input-group-icon e-ddl-icon e-search-icon";var he=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.isFiltered=!1,s.searchList=!1,s}return re(s,e),s.prototype.preRender=function(){e.prototype.preRender.call(this)},s.prototype.getLocaleName=function(){return"auto-complete"},s.prototype.getNgDirective=function(){return"EJS-AUTOCOMPLETE"},s.prototype.getQuery=function(e){var s=e?e.clone():this.query?this.query.clone():new i.Query,l=this.allowObjectBinding&&!t.isNullOrUndefined(this.value)?t.getValue(this.fields.value?this.fields.value:"",this.value):this.value,n=""!==this.queryString||t.isNullOrUndefined(l)?this.filterType:"equal",a=""!==this.queryString||t.isNullOrUndefined(l)?this.queryString:l;if(this.isFiltered)if(this.enableVirtualization&&!t.isNullOrUndefined(this.customFilterQuery))s=this.customFilterQuery.clone();else if(!this.enableVirtualization)return s;if(null!==this.queryString&&""!==this.queryString){var r=this.typeOfData(this.dataSource).typeof;if((this.dataSource instanceof i.DataManager||"string"!==r)&&"number"!==r){var o=t.isNullOrUndefined(this.fields.value)?"":this.fields.value;s.where(o,n,a,this.ignoreCase,this.ignoreAccent)}else s.where("",n,a,this.ignoreCase,this.ignoreAccent)}if(!t.isNullOrUndefined(this.suggestionCount)&&!this.enableVirtualization){if(20!==this.suggestionCount)for(c=0;c<s.queries.length;c++)"onTake"===s.queries[c].fn&&s.queries.splice(c,1);s.take(this.suggestionCount)}if(this.enableVirtualization){var h=0,u=0,p=this.getTakeValue();if(s&&s.queries.length>0)for(c=0;c<s.queries.length;c++)"onSkip"===s.queries[c].fn&&(u=s.queries[c].e.nos),"onTake"===s.queries[c].fn&&(h=p<=s.queries[c].e.nos?s.queries[c].e.nos:p);if(h<=0&&this.query&&this.query.queries.length>0)for(c=0;c<this.query.queries.length;c++)if("onTake"===this.query.queries[c].fn){var d=this.query.queries[c].e.nos;h=p<=d?d:p}if(s&&s.queries.length>0)for(var c=0;c<s.queries.length;c++)if("onSkip"!==s.queries[c].fn){if("onTake"===s.queries[c].fn){var m=s.queries[c].e.nos;h=m<=h?h:m,s.queries.splice(c,1),--c}}else u=s.queries[c].e.nos,s.queries.splice(c,1),--c;u>0&&this.virtualItemStartIndex<=u?s.skip(u):s.skip(this.virtualItemStartIndex),h>0&&p<=h?s.take(h):s.take(p),s.requiresCount()}return s},s.prototype.performFiltering=function(e){var t=this,i={preventDefaultAction:!1,text:this.filterInput?this.filterInput.value:null,updateData:function(e,s,l){i.cancel||(t.isFiltered=!0,t.customFilterQuery=s,t.filterAction(e,s,l))},cancel:!1};this.trigger("filtering",i,function(i){i.cancel||t.isFiltered||i.preventDefaultAction||(t.searchList=!0,t.filterAction(t.dataSource,null,t.fields,e))})},s.prototype.searchLists=function(i){if(this.isTyped=!0,this.isDataFetched=this.isSelectCustom=!1,this.firstItem=this.dataSource&&this.dataSource.length>0?this.dataSource[0]:null,this.checkAndResetCache(),t.isNullOrUndefined(this.list)&&e.prototype.renderList.call(this,i,!0),this.queryString=this.filterInput.value,"mousedown"!==i.type&&(40===i.keyCode||38===i.keyCode))return this.queryString=""===this.queryString?null:this.queryString,this.beforePopupOpen=!0,void this.resetList(this.dataSource,this.fields,null,i);this.isSelected=!1,this.activeIndex=null,this.isRequesting=!1,""!==this.queryString&&this.debounceDelay>0?this.debouncedFiltering(i,this.debounceDelay):this.performFiltering(i)},s.prototype.filter=function(e,t,i){this.isFiltered=!0,this.filterAction(e,t,i)},s.prototype.filterAction=function(e,t,s,l){this.beforePopupOpen=!0;var n=this.list.classList.contains("e-nodata");if(""!==this.queryString&&this.queryString.length>=this.minLength){if(this.enableVirtualization&&this.isFiltering()&&this.isTyped&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null),this.resetList(e,s,t,l),n=this.list.classList.contains("e-nodata"),this.enableVirtualization&&!n&&(!this.list.querySelector(".e-virtual-ddl-content")&&this.list.querySelector(".e-list-parent")&&((a=this.createElement("div",{className:"e-virtual-ddl-content"})).style.cssText=this.getTransformValues(),this.list.appendChild(a).appendChild(this.list.querySelector(".e-list-parent"))),!this.list.querySelector(".e-virtual-ddl")&&this.list.parentElement)){var a=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"});a.style.cssText=this.GetVirtualTrackHeight(),this.list.parentElement.querySelector(".e-dropdownbase").appendChild(a)}("autocomplete"===this.getModuleName()&&!(this.dataSource instanceof i.DataManager)||"autocomplete"===this.getModuleName()&&this.dataSource instanceof i.DataManager&&0!==this.totalItemCount)&&this.getFilteringSkeletonCount()}else this.hidePopup(l),this.beforePopupOpen=!1;this.renderReactTemplates()},s.prototype.clearAll=function(i,s){(t.isNullOrUndefined(s)||!t.isNullOrUndefined(s)&&t.isNullOrUndefined(s.dataSource))&&(e.prototype.clearAll.call(this,i),this.checkAndResetCache()),this.beforePopupOpen&&this.hidePopup()},s.prototype.onActionComplete=function(s,l,n,a){this.enableVirtualization||(this.fixedHeaderElement=null),("autocomplete"===this.getModuleName()&&!(this.dataSource instanceof i.DataManager)||"autocomplete"===this.getModuleName()&&this.dataSource instanceof i.DataManager&&0!==this.totalItemCount)&&this.getFilteringSkeletonCount(),e.prototype.onActionComplete.call(this,s,l,n);var r=this.list.querySelector("."+q.li);t.isNullOrUndefined(r)||t.removeClass([r],q.focus),t.isNullOrUndefined(this.itemData)||this.enableVirtualization||this.focusIndexItem(),this.postBackAction()},s.prototype.postBackAction=function(){if(this.autofill&&!t.isNullOrUndefined(this.liCollections[0])&&this.searchList){var i=[this.liCollections[0]],s=this.listData,l=this.typeOfData(s).typeof,n=u(this.inputElement.value,i,"StartsWith",this.ignoreCase,s,this.fields,l);this.searchList=!1,t.isNullOrUndefined(n.item)||e.prototype.setAutoFill.call(this,this.liCollections[0],!0)}},s.prototype.setSelection=function(i,s){if(!this.isValidLI(i))return void(this.selectedLI=i);if(!t.isNullOrUndefined(s)&&"keydown"===s.type&&"enter"!==s.action&&"tab"!==s.action&&this.isValidLI(i)){var l=this.getFormattedValue(i.getAttribute("data-value"));if(this.activeIndex=this.getIndexByValue(l),this.setHoverList(i),this.selectedLI=i,this.setScrollPosition(s),this.autofill&&this.isPopupOpen){this.preventAutoFill=!1;var n=s&&"down"===s.action||"up"===s.action||"home"===s.action||"end"===s.action||"pageUp"===s.action||"pageDown"===s.action;e.prototype.setAutoFill.call(this,i,n)}}else e.prototype.setSelection.call(this,i,s),this.isFiltered=!1},s.prototype.listOption=function(i,s){var l=this,n=e.prototype.listOption.call(this,i,s);if(t.isNullOrUndefined(n.itemCreated))n.itemCreated=function(e){l.highlight&&(l.element.tagName===l.getNgDirective()&&l.itemTemplate?setTimeout(function(){c(e.item,l.queryString,l.ignoreCase,l.filterType)},0):c(e.item,l.queryString,l.ignoreCase,l.filterType))};else{var a=n.itemCreated;n.itemCreated=function(e){l.highlight&&c(e.item,l.queryString,l.ignoreCase,l.filterType),a.apply(l,[e])}}return n},s.prototype.isFiltering=function(){return!0},s.prototype.renderPopup=function(t){this.enableVirtualization||(this.list.scrollTop=0),e.prototype.renderPopup.call(this,t)},s.prototype.isEditTextBox=function(){return!1},s.prototype.isPopupButton=function(){return this.showPopupButton},s.prototype.isSelectFocusItem=function(e){return!1},s.prototype.setInputValue=function(e,s){var l=s&&s.text?s.text:s?s.value:s,n=e&&e.text?e.text:e&&e.value?e.value:this.value;if(this.allowObjectBinding&&(l=t.isNullOrUndefined(l)?l:t.getValue(this.fields.value?this.fields.value:"",l),n=t.isNullOrUndefined(n)?n:t.getValue(this.fields.value?this.fields.value:"",n)),!n||""!==this.typedString||this.allowCustom||this.dataSource instanceof i.DataManager)e&&(e.text?this.setOldText(l):this.setOldValue(l));else{var a="string"===this.typeOfData(this.dataSource).typeof?"":this.fields.value,r=this.getItems().length,o=new i.Query,h=this;new i.DataManager(this.dataSource).executeQuery(o.where(new i.Predicate(a,"equal",n))).then(function(t){t.result.length>0?(h.value=""!==a?h.allowObjectBinding?t.result[0]:t.result[0][h.fields.value].toString():t.result[0].toString(),h.addItem(t.result,r),h.updateValues()):e&&e.text?h.setOldText(l):e&&e.value?h.setOldValue(l):h.updateValues()})}},s.prototype.showPopup=function(e){if(this.enabled){if(this.beforePopupOpen)return void this.refreshPopup();this.beforePopupOpen=!0,this.preventAutoFill=!0,t.isNullOrUndefined(this.list)?this.renderList(e):this.resetList(this.dataSource,this.fields,null,e)}},s.prototype.hidePopup=function(t){e.prototype.hidePopup.call(this,t),this.activeIndex=null,this.virtualListInfo=this.viewPortInfo,this.previousStartIndex=this.viewPortInfo.startIndex,this.startIndex=this.viewPortInfo.startIndex,this.previousEndIndex=this.viewPortInfo.endIndex},s.prototype.onPropertyChanged=function(i,s){"autocomplete"===this.getModuleName()&&this.setUpdateInitial(["fields","query","dataSource"],i);for(var l=0,n=Object.keys(i);l<n.length;l++){var r=n[l];switch(r){case"showPopupButton":if(this.showPopupButton){var o=a.Input.appendSpan(q.icon,this.inputWrapper.container,this.createElement);this.inputWrapper.buttons[0]=o,a.Input.calculateWidth(this.inputElement,this.inputWrapper.container),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.isNullOrUndefined(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon"),this.inputWrapper&&this.inputWrapper.buttons&&this.inputWrapper.buttons[0]&&t.EventHandler.add(this.inputWrapper.buttons[0],"click",this.dropDownClick,this)}else t.detach(this.inputWrapper.buttons[0]),this.inputWrapper.buttons[0]=null;break;default:var h=this.getPropObject(r,i,s);e.prototype.onPropertyChanged.call(this,h.newProperty,h.oldProperty)}}},s.prototype.renderHightSearch=function(){if(this.highlight)for(var e=0;e<this.liCollections.length;e++){var t=this.ulElement.querySelector(".e-active");t||(f(this.liCollections[e]),c(this.liCollections[e],this.queryString,this.ignoreCase,this.filterType)),t=null}},s.prototype.getModuleName=function(){return"autocomplete"},s.prototype.render=function(){e.prototype.render.call(this)},oe([t.Complex({value:null,iconCss:null,groupBy:null,disabled:null},P)],s.prototype,"fields",void 0),oe([t.Property(!0)],s.prototype,"ignoreCase",void 0),oe([t.Property(!1)],s.prototype,"showPopupButton",void 0),oe([t.Property(!1)],s.prototype,"highlight",void 0),oe([t.Property(20)],s.prototype,"suggestionCount",void 0),oe([t.Property({})],s.prototype,"htmlAttributes",void 0),oe([t.Property(null)],s.prototype,"query",void 0),oe([t.Property(1)],s.prototype,"minLength",void 0),oe([t.Property("Contains")],s.prototype,"filterType",void 0),oe([t.Event()],s.prototype,"filtering",void 0),oe([t.Property(null)],s.prototype,"index",void 0),oe([t.Property("Never")],s.prototype,"floatLabelType",void 0),oe([t.Property(null)],s.prototype,"valueTemplate",void 0),oe([t.Property(null)],s.prototype,"filterBarPlaceholder",void 0),oe([t.Property(!1)],s.prototype,"allowFiltering",void 0),oe([t.Property(null)],s.prototype,"text",void 0),s=oe([t.NotifyPropertyChanges],s)}(ae),ue="e-float-line",pe="e-float-text",de="e-label-top",ce="e-label-bottom",me=function(){var e=function(t,i){return(e=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])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),fe=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(l=e[r])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},ve="e-input-focus",ge="e-hide-listitem",ye="e-chips",Ce="e-chip-selected",be=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.clearIconWidth=0,s.previousFilterText="",s.storedSelectAllHeight=0,s.isUpdateHeaderHeight=!1,s.isUpdateFooterHeight=!1,s.isBlurDispatching=!1,s.isFilterPrevented=!1,s.isFilteringAction=!1,s.isValidKey=!1,s.selectAllEventData=[],s.selectAllEventEle=[],s.preventSetCurrentData=!1,s.isSelectAllLoop=!1,s.scrollFocusStatus=!1,s.keyDownStatus=!1,s}return me(s,e),s.prototype.enableRTL=function(e){e?this.overAllWrapper.classList.add("e-rtl"):this.overAllWrapper.classList.remove("e-rtl"),this.popupObj&&(this.popupObj.enableRtl=e,this.popupObj.dataBind())},s.prototype.requiredModules=function(){var e=[];if(this.enableVirtualization&&e.push({args:[this],member:"VirtualScroll"}),"CheckBox"===this.mode){if(this.isGroupChecking=this.enableGroupCheckBox,this.enableGroupCheckBox){var t=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.enableSelectionOrder=!1,this.isProtectedOnChange=t}this.allowCustomValue=!1,this.hideSelectedItem=!1,this.closePopupOnSelect=!1,e.push({member:"CheckBoxSelection",args:[this]})}return e},s.prototype.updateHTMLAttribute=function(){if(Object.keys(this.htmlAttributes).length)for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];switch(s){case"class":var l=this.htmlAttributes[""+s].replace(/\s+/g," ").trim();""!==l&&(t.addClass([this.overAllWrapper],l.split(" ")),t.addClass([this.popupWrapper],l.split(" ")));break;case"disabled":this.enable(!1);break;case"placeholder":this.placeholder||(this.inputElement.setAttribute(s,this.htmlAttributes[""+s]),this.setProperties({placeholder:this.inputElement.placeholder},!0),this.refreshPlaceHolder());break;default:var n=["name","required","aria-required","form"],a=["title","role","style","class"];["id"].indexOf(s)>-1?this.element.setAttribute(s,this.htmlAttributes[""+s]):0===s.indexOf("data")||n.indexOf(s)>-1?this.hiddenElement.setAttribute(s,this.htmlAttributes[""+s]):a.indexOf(s)>-1?this.overAllWrapper.setAttribute(s,this.htmlAttributes[""+s]):"size"===s||t.isNullOrUndefined(this.inputElement)||this.inputElement.setAttribute(s,this.htmlAttributes[""+s])}}},s.prototype.updateReadonly=function(e){t.isNullOrUndefined(this.inputElement)||(e||"CheckBox"===this.mode?this.inputElement.setAttribute("readonly","true"):this.inputElement.removeAttribute("readonly"))},s.prototype.updateClearButton=function(e){e?(this.overAllClear.parentNode?this.overAllClear.style.display="":this.componentWrapper.appendChild(this.overAllClear),this.componentWrapper.classList.remove("e-close-icon-hide")):(this.overAllClear.style.display="none",this.componentWrapper.classList.add("e-close-icon-hide"))},s.prototype.updateCssClass=function(){if(!t.isNullOrUndefined(this.cssClass)&&""!==this.cssClass){var e=this.cssClass;""!==(e=this.cssClass.replace(/\s+/g," ").trim())&&(t.addClass([this.overAllWrapper],e.split(" ")),t.addClass([this.popupWrapper],e.split(" ")))}},s.prototype.updateOldPropCssClass=function(e){t.isNullOrUndefined(e)||""===e||""!==(e=e.replace(/\s+/g," ").trim())&&(t.removeClass([this.overAllWrapper],e.split(" ")),t.removeClass([this.popupWrapper],e.split(" ")))},s.prototype.onPopupShown=function(e){var i=this;if(t.Browser.isDevice&&"CheckBox"===this.mode&&this.allowFiltering){var s=this;window.onpopstate=function(){s.hidePopup(),s.inputElement.focus()},history.pushState({},"")}var l={name:"FadeIn",duration:100},n={popup:this.popupObj,event:e,cancel:!1,animation:l};this.trigger("open",n,function(e){e.cancel||(i.focusAtFirstListItem(!0),i.popupObj&&document.body.appendChild(i.popupObj.element),"CheckBox"===i.mode&&i.enableGroupCheckBox&&!t.isNullOrUndefined(i.fields.groupBy)&&i.updateListItems(i.list.querySelectorAll("li.e-list-item"),i.mainList.querySelectorAll("li.e-list-item")),("CheckBox"===i.mode||i.showDropDownIcon)&&t.addClass([i.overAllWrapper],["e-icon-anim"]),i.refreshPopup(),i.renderReactTemplates(),i.popupObj&&i.popupObj.show(e.animation,1e3===i.zIndex?i.element:null),i.isReact&&setTimeout(function(){if(i.popupHeight&&i.list&&"auto"!==i.popupHeight){var e="string"==typeof i.popupHeight?parseInt(i.popupHeight,10):i.popupHeight;if(!i.isUpdateHeaderHeight&&i.headerTemplate&&i.header){t=""===i.list.style.maxHeight?e:parseInt(i.list.style.maxHeight,10);i.list.style.maxHeight=(t-i.header.offsetHeight).toString()+"px",i.isUpdateHeaderHeight=!0}if(!i.isUpdateFooterHeight&&i.footerTemplate&&i.footer){var t=""===i.list.style.maxHeight?e:parseInt(i.list.style.maxHeight,10);i.list.style.maxHeight=(t-i.footer.offsetHeight).toString()+"px",i.isUpdateFooterHeight=!0}}},15),t.attributes(i.inputElement,{"aria-expanded":"true","aria-owns":i.element.id+"_popup","aria-controls":i.element.id}),i.updateAriaActiveDescendant(),i.isFirstClick&&(i.enableVirtualization||i.loadTemplate()),"CheckBox"===i.mode&&i.showSelectAll&&t.EventHandler.add(i.popupObj.element,"click",i.clickHandler,i))})},s.prototype.updateVirtualReOrderList=function(e){var t=this.getForQuery(this.value,!0).clone();if(this.isVirtualReorder=!0,this.enableVirtualization&&this.dataSource instanceof i.DataManager?this.resetList(this.selectedListData,this.fields,t):this.resetList(this.dataSource,this.fields,t),this.UpdateSkeleton(),this.isVirtualReorder=!1,this.liCollections=this.list.querySelectorAll("."+H.li),this.virtualItemCount=this.itemCount,"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.list.querySelector(".e-virtual-ddl"))this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight();else{var s=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"});s.style.cssText=this.GetVirtualTrackHeight(),this.popupWrapper.querySelector(".e-dropdownbase").appendChild(s)}this.list.querySelector(".e-virtual-ddl-content")&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()),e&&this.loadTemplate()},s.prototype.updateListItems=function(e,t){for(var i=0;i<e.length;i++)this.findGroupStart(e[i]),this.findGroupStart(t[i]);this.deselectHeader()},s.prototype.loadTemplate=function(){if(this.refreshListItems(null),this.enableVirtualization&&this.list&&"CheckBox"===this.mode){var e=this.list.querySelectorAll(".e-reorder")[0];this.list.querySelector(".e-virtual-ddl-content")&&e&&this.list.querySelector(".e-virtual-ddl-content").removeChild(e)}"CheckBox"===this.mode&&this.removeFocus(),this.notify("reOrder",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,e:this}),this.isPreventScrollAction=!0},s.prototype.setScrollPosition=function(){if((!this.hideSelectedItem&&"CheckBox"!==this.mode||"CheckBox"===this.mode&&!this.enableSelectionOrder)&&!t.isNullOrUndefined(this.value)&&this.value.length>0){var e=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",this.value[this.value.length-1]):this.value[this.value.length-1],i=this.findListElement(this.hideSelectedItem?this.ulElement:this.list,"li","data-value",e);t.isNullOrUndefined(i)||this.scrollBottom(i,void 0,!1,null,!0)}if(this.enableVirtualization){var s=this.list.querySelector("."+H.focus);this.isKeyBoardAction=!1,this.scrollBottom(s,void 0,!1,null,!0)}},s.prototype.focusAtFirstListItem=function(e){if(this.ulElement&&this.ulElement.querySelector("li."+H.li)){var t=void 0;if("CheckBox"===this.mode)return void this.removeFocus();if(this.enableVirtualization){if(this.fields.disabled)t=this.ulElement.querySelector("li."+H.li+":not(.e-virtual-list):not(.e-hide-listitem):not(.e-disabled)"),e&&this.viewPortInfo&&0!==this.viewPortInfo.startIndex&&(t=(i=this.ulElement.querySelectorAll("li."+H.li+":not(.e-virtual-list):not(.e-hide-listitem)"))&&i.length>0?i[2]:t);else if(t=this.ulElement.querySelector("li."+H.li+":not(.e-virtual-list):not(.e-hide-listitem)"),e&&this.viewPortInfo&&0!==this.viewPortInfo.startIndex){var i=this.ulElement.querySelectorAll("li."+H.li+":not(.e-virtual-list):not(.e-hide-listitem)");t=i&&i.length>0?i[2]:t}}else t=this.fields.disabled?this.ulElement.querySelector("li."+H.li+":not(."+ge+"):not(.e-disabled)"):this.ulElement.querySelector("li."+H.li+":not(."+ge+")");null!==t&&(this.removeFocus(),this.addListFocus(t))}},s.prototype.focusAtLastListItem=function(e){var i;e?i=u(e,this.liCollections,"StartsWith",this.ignoreCase):this.value&&this.value.length?u(this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",this.value[this.value.length-1]):this.value[this.value.length-1],this.liCollections,"StartsWith",this.ignoreCase):i=null,i&&null!==i.item&&(this.addListFocus(i.item),((this.allowCustomValue||this.allowFiltering)&&this.isPopupOpen()&&this.closePopupOnSelect&&!this.enableVirtualization||this.closePopupOnSelect&&!this.enableVirtualization)&&this.scrollBottom(i.item,i.index))},s.prototype.getAriaAttributes=function(){return{"aria-disabled":"false",role:"combobox","aria-expanded":"false"}},s.prototype.updateListARIA=function(){t.isNullOrUndefined(this.ulElement)||t.attributes(this.ulElement,{id:this.element.id+"_options",role:"listbox","aria-hidden":"false","aria-label":"list"});var e=!(t.isNullOrUndefined(this.inputElement)||!this.inputElement.disabled);this.isPopupOpen()||t.isNullOrUndefined(this.inputElement)||t.attributes(this.inputElement,this.getAriaAttributes()),e&&t.attributes(this.inputElement,{"aria-disabled":"true"}),this.ensureAriaDisabled(e?"true":"false")},s.prototype.ensureAriaDisabled=function(e){if(this.htmlAttributes&&this.htmlAttributes["aria-disabled"]){var i=this.htmlAttributes;t.extend(i,{"aria-disabled":e},i),this.setProperties({htmlAttributes:i},!0)}},s.prototype.removelastSelection=function(e){if(null!==this.chipCollectionWrapper.querySelector("span."+Ce))return void this.removeSelectedChip(e);var i=this.chipCollectionWrapper.querySelectorAll("span.e-chips"),s=i[i.length-1].getAttribute("data-value");t.isNullOrUndefined(this.value)||(this.tempValues=(this.allowObjectBinding,this.value.slice()));var l=this.allowObjectBinding?this.enableVirtualization?this.getVirtualDataByValue(this.getFormattedValue(s)):this.getDataByValue(this.getFormattedValue(s)):this.getFormattedValue(s);this.allowCustomValue&&("false"!==s&&!1===l||!t.isNullOrUndefined(l)&&"NaN"===l.toString())&&(l=s),this.removeValue(l,e),this.removeChipSelection(),this.updateDelimeter(this.delimiterChar,e),this.makeTextBoxEmpty(),this.mainList&&this.listData&&this.refreshSelection(),this.checkPlaceholderSize()},s.prototype.onActionFailure=function(t){e.prototype.onActionFailure.call(this,t),this.renderPopup(),this.onPopupShown()},s.prototype.targetElement=function(){return this.targetInputElement=this.inputElement,"CheckBox"===this.mode&&this.allowFiltering&&this.notify("targetElement",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),this.targetInputElement?this.targetInputElement.value:null},s.prototype.getForQuery=function(e,s){var l,n=this.isPrimitiveData?"":this.fields.value;if(this.enableVirtualization&&e){if(s){for(var a=this.viewPortInfo.startIndex,r=a+this.viewPortInfo.endIndex<=e.length&&e[a+this.viewPortInfo.endIndex]?a+this.viewPortInfo.endIndex:e.length,o=a;o<r;o++){h=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",e[o]):e[o];l=o===a?new i.Predicate(n,"equal",h):l.or(n,"equal",h)}return(new i.Query).where(l)}for(o=0;o<e.length;o++){var h=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",e[o]):e[o];l=this.isaddNonPresentItems?0===o?new i.Predicate(n,"equal",e[o]):l.or(n,"equal",e[o]):0===o?l=new i.Predicate(n,"notequal",h):l.and(n,"notequal",h)}return(new i.Query).where(l)}for(o=0;o<e.length;o++)l=0===o?new i.Predicate(n,"equal",e[o]):l.or(n,"equal",e[o]);return this.dataSource instanceof i.DataManager&&this.dataSource.adaptor instanceof i.JsonAdaptor?(new i.Query).where(l):this.getQuery(this.query).clone().where(l)},s.prototype.onActionComplete=function(s,l,n,a){var r=this;this.dataSource instanceof i.DataManager&&!t.isNullOrUndefined(n)&&!this.virtualGroupDataSource&&(this.totalItemCount=n.count),this.value&&l&&l.length>0&&this.allowFiltering&&"CheckBox"!==this.mode&&!this.enableVirtualization&&!this.isFilterPrevented&&!this.allowCustomValue&&this.isFilteringAction&&l.every(function(e){var i=t.getValue(r.fields.value?r.fields.value:"",e);return r.value.some(function(e){var s=r.allowObjectBinding?t.getValue(r.fields.value?r.fields.value:"",e):e;return i===s})})&&(s.innerHTML="",l=[]),e.prototype.onActionComplete.call(this,s,l,n),this.skeletonCount=0!==this.totalItemCount&&this.totalItemCount<2*this.itemCount&&(!(this.dataSource instanceof i.DataManager)||this.dataSource instanceof i.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,this.updateSelectElementData(this.allowFiltering);var o=this;if(!t.isNullOrUndefined(this.value)&&!this.allowCustomValue&&!this.enableVirtualization&&this.listData&&this.listData.length>0)for(var h=0;h<this.value.length;h++){var u=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",o.value[h]):o.value[h];this.findListElement(this.allowFiltering&&!t.isNullOrUndefined(this.mainList)?this.mainList:s,"li","data-value",u)||this.dataSource instanceof i.DataManager||(this.value.splice(h,1),h-=1)}var p=[];t.isNullOrUndefined(this.value)||(p=this.presentItemValue(this.ulElement));var d=p.some(function(e){return null!==e});if(p.length>0&&this.dataSource instanceof i.DataManager&&!t.isNullOrUndefined(this.value)&&null!=this.listData&&(!this.enableVirtualization||this.enableVirtualization&&this.valueTemplate)&&d?(this.isaddNonPresentItems=!0,this.addNonPresentItems(p,this.ulElement,this.listData),this.isaddNonPresentItems=!1):this.updateActionList(s,l,n),this.dataSource instanceof i.DataManager&&this.allowCustomValue&&!this.isCustomRendered&&this.inputElement.value&&""!==this.inputElement.value){var c=new i.Query;c=this.allowFiltering?c.where(this.fields.text,"startswith",this.inputElement.value,this.ignoreCase,this.ignoreAccent):c,this.checkForCustomValue(c,this.fields),this.isCustomRendered=!0,this.remoteCustomValue=!this.enableVirtualization&&this.remoteCustomValue}"CheckBox"!==this.mode||!this.enableGroupCheckBox||t.isNullOrUndefined(this.fields.groupBy)||t.isNullOrUndefined(this.fields.disabled)||this.disableGroupHeader(),this.dataSource instanceof i.DataManager&&"CheckBox"===this.mode&&this.allowFiltering&&this.removeFocus()},s.prototype.updateActionList=function(e,s,l,n){"CheckBox"===this.mode&&this.showSelectAll&&this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),this.mainList||this.mainData?(t.isNullOrUndefined(this.mainData)||0===this.mainData.length)&&(this.mainData=s):(this.mainList=e.cloneNode?e.cloneNode(!0):e,this.mainData=s,this.mainListCollection=this.liCollections),(this.remoteCustomValue||s.length<=0)&&this.allowCustomValue&&this.inputFocus&&this.allowFiltering&&this.inputElement.value&&""!==this.inputElement.value&&(this.checkForCustomValue(this.tempQuery,this.fields),this.isCustomRendered)||(this.value&&this.value.length&&("CheckBox"!==this.mode&&!t.isNullOrUndefined(this.inputElement)&&""!==this.inputElement.value.trim()||"CheckBox"===this.mode||(8===this.keyCode||46===this.keyCode)&&this.allowFiltering&&this.allowCustomValue&&this.dataSource instanceof i.DataManager&&""===this.inputElement.value)&&this.refreshSelection(),this.updateListARIA(),this.unwireListEvents(),this.wireListEvents(),t.isNullOrUndefined(this.setInitialValue)||this.setInitialValue(),t.isNullOrUndefined(this.selectAllAction)||this.selectAllAction(),this.setDynValue&&(t.isNullOrUndefined(this.text)||!t.isNullOrUndefined(this.value)&&0!==this.value.length||this.initialTextUpdate(),this.enableVirtualization?this.dataSource instanceof i.DataManager||this.initialValueUpdate():this.isRemoveSelection?this.initialValueUpdate():this.initialValueUpdate(this.listData,!0),this.initialUpdate(),this.refreshPlaceHolder(),"CheckBox"!==this.mode&&this.changeOnBlur&&this.updateValueState(null,this.value,null)),this.renderPopup(),this.beforePopupOpen&&(this.beforePopupOpen=!1,this.onPopupShown(l)))},s.prototype.refreshSelection=function(){var e,i,s=this.hideSelectedItem?ge:H.selected;if(!t.isNullOrUndefined(this.value))for(var l=0;!t.isNullOrUndefined(this.value[l]);l++)if(e=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",this.value[l]):this.value[l],i=this.findListElement(this.list,"li","data-value",e)){if(t.addClass([i],s),this.hideSelectedItem&&i.previousSibling&&i.previousElementSibling.classList.contains(H.group)&&(!i.nextElementSibling||i.nextElementSibling.classList.contains(H.group))&&t.addClass([i.previousElementSibling],s),this.hideSelectedItem&&this.fields.groupBy&&!i.previousElementSibling.classList.contains(ge)&&this.hideGroupItem(e),this.hideSelectedItem&&i.classList.contains(H.focus)){t.removeClass([i],H.focus);var n=i.parentElement.querySelectorAll("."+H.li+":not(."+ge+"):not(.e-disabled)");n.length>0?(t.addClass([n[0]],H.focus),this.updateAriaActiveDescendant()):this.list&&this.list.querySelectorAll("."+H.li).length>0||(this.l10nUpdate(),t.addClass([this.list],H.noData))}if(i.setAttribute("aria-selected","true"),"CheckBox"===this.mode&&i.classList.contains("e-active")&&0===i.getElementsByClassName("e-check").length){var a={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:i,e:null};this.notify("updatelist",a)}}this.checkSelectAll(),this.checkMaxSelection()},s.prototype.hideGroupItem=function(e){var i,s,l=this.hideSelectedItem?ge:H.selected;s=i=this.findListElement(this.ulElement,"li","data-value",e);var n=0,a=0,r=!0,o=!0;do{i&&i.previousElementSibling&&!i.previousElementSibling.classList.contains(ge)&&i.previousElementSibling.classList.contains(H.li)&&(r=!1),!r||!i||i.previousElementSibling&&i.previousElementSibling.classList.contains(H.group)?n=10:i=i.previousElementSibling,s&&s.nextElementSibling&&!s.nextElementSibling.classList.contains(ge)&&s.nextElementSibling.classList.contains(H.li)&&(o=!1),!o||!s||s.nextElementSibling&&s.nextElementSibling.classList.contains(H.group)?a=10:s=s.nextElementSibling}while(n<10||a<10);r&&o&&!i.previousElementSibling.classList.contains(ge)?t.addClass([i.previousElementSibling],l):r&&o&&i.previousElementSibling.classList.contains(ge)&&t.removeClass([i.previousElementSibling],l)},s.prototype.getValidLi=function(){var e=this.ulElement.querySelector("li."+H.li+":not(."+ge+")");return t.isNullOrUndefined(e)?this.liCollections[0]:e},s.prototype.checkSelectAll=function(){var e=t.isNullOrUndefined(this.fields.disabled)?this.list.querySelectorAll("li.e-list-group-item.e-active").length:this.list.querySelectorAll("li.e-list-group-item.e-active:not(.e-disabled)").length,i=this.list.querySelectorAll("li.e-list-item"),s=this.enableVirtualization?this.list.querySelectorAll("li."+H.li+":not(.e-virtual-list)").length:t.isNullOrUndefined(this.fields.disabled)?this.list.querySelectorAll("li."+H.li).length:this.list.querySelectorAll("li."+H.li+":not(.e-disabled)").length,l=this.list.querySelectorAll("li."+H.selected).length;if(this.enableGroupCheckBox&&!t.isNullOrUndefined(this.fields.groupBy)&&(l-=e),!this.enableVirtualization&&(s===l||l===this.maximumSelectionLength)&&"CheckBox"===this.mode&&this.showSelectAll||this.enableVirtualization&&"CheckBox"===this.mode&&this.showSelectAll&&this.value&&this.value.length===this.totalItemCount?this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"check"}):s!==l&&"CheckBox"===this.mode&&this.showSelectAll&&this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"uncheck"}),this.enableGroupCheckBox&&this.fields.groupBy&&!this.enableSelectionOrder){for(var n=0;n<i.length;n++)this.findGroupStart(i[n]);this.deselectHeader()}},s.prototype.openClick=function(e){this.openOnClick||"CheckBox"===this.mode||this.isPopupOpen()?this.openOnClick||"CheckBox"!==this.mode||this.isPopupOpen()||this.showPopup():""!==this.targetElement()?this.showPopup():this.hidePopup(e)},s.prototype.keyUp=function(e){if("CheckBox"===this.mode&&!this.openOnClick){var i=String.fromCharCode(e.keyCode).match(/\w/);t.isNullOrUndefined(i)||(this.isValidKey=!0)}this.isValidKey=this.isPopupOpen()&&8===e.keyCode||this.isValidKey,this.isValidKey=(!e.ctrlKey||86!==e.keyCode)&&this.isValidKey,this.isValidKey&&this.inputElement&&(this.isValidKey=!1,this.expandTextbox(),this.showOverAllClear(),e.keyCode,this.search(e))},s.prototype.filter=function(e,t,i){this.isFiltered=!0,this.remoteFilterAction=!0,this.dataUpdater(e,t,i)},s.prototype.getQuery=function(e){var s=e?e.clone():this.query?this.query.clone():new i.Query;if(this.isFiltered){if(this.enableVirtualization&&!t.isNullOrUndefined(this.customFilterQuery))return s=this.customFilterQuery.clone(),this.virtualFilterQuery(s);if(!this.enableVirtualization)return s}if(this.isFilterAction){if(null!==this.targetElement()&&!this.enableVirtualization||this.enableVirtualization&&null!==this.targetElement()&&""!==this.targetElement().trim()){var l=this.typeOfData(this.dataSource).typeof;if((this.dataSource instanceof i.DataManager||"string"!==l)&&"number"!==l){if(this.enableVirtualization&&""!==this.targetElement()&&!this.isClearAllAction||!this.enableVirtualization){var n=this.fields;s.where(t.isNullOrUndefined(n.text)?"":n.text,this.filterType,this.targetElement(),this.ignoreCase,this.ignoreAccent)}}else s.where("",this.filterType,this.targetElement(),this.ignoreCase,this.ignoreAccent)}return this.enableVirtualization&&0!==this.viewPortInfo.endIndex&&!this.virtualSelectAll?this.virtualFilterQuery(s):this.virtualSelectAll?e?e.skip(0).take(this.maximumSelectionLength).requiresCount():this.query?this.query.skip(0).take(this.maximumSelectionLength).requiresCount():(new i.Query).skip(0).take(this.maximumSelectionLength).requiresCount():s}return this.enableVirtualization&&0!==this.viewPortInfo.endIndex&&!this.virtualSelectAll?this.virtualFilterQuery(s):this.virtualSelectAll?e?e.skip(0).take(this.maximumSelectionLength).requiresCount():this.query?this.query.skip(0).take(this.maximumSelectionLength).requiresCount():(new i.Query).skip(0).take(this.maximumSelectionLength).requiresCount():e||(this.query?this.query:new i.Query)},s.prototype.virtualFilterQuery=function(e){for(var t=this.getTakeValue(),i=!0,s=!0,l=0;l<e.queries.length;l++)"multiselect"===this.getModuleName()&&(e.queries[l].e&&"or"===e.queries[l].e.condition||e.queries[l].e&&"equal"===e.queries[l].e.operator)&&(i=!1),"onSkip"===e.queries[l].fn&&(s=!1),e.queries[l].fn;var n=0;if(e&&e.queries.length>0)for(l=0;l<e.queries.length;l++)"onTake"===e.queries[l].fn&&(n=t<=e.queries[l].e.nos?e.queries[l].e.nos:t);if(n<=0&&this.query&&this.query.queries.length>0)for(l=0;l<this.query.queries.length;l++)"onTake"===this.query.queries[l].fn&&(n=t<=this.query.queries[l].e.nos?this.query.queries[l].e.nos:t);if(e&&e.queries.length>0)for(l=0;l<e.queries.length;l++)"onTake"===e.queries[l].fn&&(n=e.queries[l].e.nos<=n?n:e.queries[l].e.nos,e.queries.splice(l,1),--l);return(this.allowFiltering&&s||!i||!this.allowFiltering&&s)&&!this.isVirtualReorder&&(i?e.skip(this.virtualItemStartIndex):e.skip(this.viewPortInfo.startIndex)),this.isIncrementalRequest?e.take(this.incrementalEndIndex):n>0?e.take(n):e.take(t),e.requiresCount(),this.customFilterQuery=null,e},s.prototype.getTakeValue=function(){return this.allowFiltering&&t.Browser.isDevice?Math.round(window.outerHeight/this.listItemHeight):this.itemCount},s.prototype.dataUpdater=function(e,t,s){this.isDataFetched=!1;var l=this.list.classList.contains(H.noData);if(""!==this.targetElement().trim()||this.allowCustomValue&&"CheckBox"!==this.mode&&""!==this.targetElement()){if(this.enableVirtualization&&this.allowFiltering&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null,this.list.querySelector(".e-list-parent.e-reorder")&&this.list.querySelector(".e-list-parent.e-reorder").remove()),this.resetList(e,s,t),this.enableVirtualization&&(l||this.allowCustomValue)&&!this.list.classList.contains(H.noData)){if(!this.list.querySelector(".e-virtual-ddl-content")){var n=this.createElement("div",{className:"e-virtual-ddl-content"});n.style.cssText=this.getTransformValues(),this.list.appendChild(n).appendChild(this.list.querySelector(".e-list-parent"))}if("CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),!this.list.querySelector(".e-virtual-ddl")){var a=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"});a.style.cssText=this.GetVirtualTrackHeight(),document.getElementsByClassName("e-multi-select-list-wrapper")[0].querySelector(".e-dropdownbase").appendChild(a)}}this.allowCustomValue&&(e instanceof i.DataManager?(this.remoteCustomValue=!0,this.tempQuery=t):this.checkForCustomValue(t,s))}else{var r=this.enableVirtualization?this.list.cloneNode(!0):this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;if(this.backCommand||this.enableVirtualization&&"CheckBox"===this.mode&&this.value&&this.value.length>0){this.remoteCustomValue=!1;var o=!1;this.allowCustomValue&&0===r.querySelectorAll("li").length&&this.mainData.length>0&&(this.mainData=[]),this.enableVirtualization&&(this.allowFiltering&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null),this.value&&this.value.length>0&&"CheckBox"===this.mode?(this.notify("setCurrentViewDataAsync",{component:this.getModuleName(),module:"VirtualScroll"}),o=!0):(this.totalItemCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.resetList(e,s,t),"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.UpdateSkeleton(),!l&&!this.allowCustomValue||this.list.classList.contains(H.noData)||(this.list.querySelector(".e-virtual-ddl-content")||((n=this.createElement("div",{className:"e-virtual-ddl-content"})).style.cssText=this.getTransformValues(),this.list.appendChild(n).appendChild(this.list.querySelector(".e-list-parent"))),this.list.querySelector(".e-virtual-ddl")||((a=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"})).style.cssText=this.GetVirtualTrackHeight(),document.getElementsByClassName("e-multi-select-list-wrapper")[0].querySelector(".e-dropdownbase").appendChild(a))))),this.onActionComplete(r,this.mainData),this.value&&this.value.length&&this.refreshSelection(),8!==this.keyCode&&this.focusAtFirstListItem(),o||this.notify("reOrder",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,e:this})}}this.enableVirtualization&&this.allowFiltering&&this.getFilteringSkeletonCount(),this.refreshPopup(),this.allowResize&&this.setResize(),"CheckBox"===this.mode&&this.removeFocus()},s.prototype.secureRandom=function(){var e=new Uint32Array(1);return window.crypto.getRandomValues(e),e[0]/4294967296},s.prototype.checkForCustomValue=function(e,s){var l=!this.getValueByText(this.inputElement.value,this.ignoreCase),n=s||this.fields;if(this.isCustomReset=!0,this.allowCustomValue&&l){var a=this.inputElement.value,r=!t.isNullOrUndefined(this.mainData)&&this.mainData.length>0?this.mainData[0]:this.mainData;if(r&&"string"!=typeof r&&"number"!=typeof r&&"boolean"!=typeof r){var o={};t.setValue(n.text,a,o),"number"==typeof t.getValue(this.fields.value?this.fields.value:"value",r)&&this.fields.value!==this.fields.text?t.setValue(n.value,this.secureRandom(),o):t.setValue(n.value,a,o);var h={};if(this.allowObjectBinding){var p=this.listData&&this.listData.length>0?Object.keys(this.listData[0]):this.firstItem?Object.keys(this.firstItem):Object.keys(o),d="number"==typeof t.getValue(this.fields.value?this.fields.value:"value",r)&&this.fields.value!==this.fields.text;p.forEach(function(e){h[e]=e===s.value||e===s.text?e===s.text&&d?t.getValue(s.text,o):t.getValue(s.value,o):null})}if(o=this.allowObjectBinding?h:o,this.enableVirtualization){this.virtualCustomData=o;var c=this.dataSource instanceof i.DataManager?JSON.parse(JSON.stringify(this.listData)):JSON.parse(JSON.stringify(this.dataSource));this.virtualCustomSelectData&&this.virtualCustomSelectData.length>0&&c.concat(this.virtualCustomSelectData),c.splice(0,0,o),this.isCustomDataUpdated=!0;var m=this.totalItemCount;this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=this.itemCount,this.resetList(c,n,e),this.isCustomDataUpdated=!1,this.totalItemCount=this.enableVirtualization&&this.dataSource instanceof i.DataManager?m:this.totalItemCount}else this.dataSource instanceof i.DataManager&&this.allowCustomValue&&this.allowFiltering&&(this.remoteCustomValue=!1),(c=JSON.parse(JSON.stringify(this.listData))).splice(0,0,o),this.resetList(c,n,e),this.focusAtLastListItem(a)}else this.listData&&((c=JSON.parse(JSON.stringify(this.listData))).splice(0,0,this.inputElement.value),c[0]="number"!=typeof r||isNaN(parseFloat(c[0]))?c[0]:parseFloat(c[0]),c[0]="boolean"==typeof r?"true"===c[0]||"false"!==c[0]&&c[0]:c[0],this.resetList(c,n),this.focusAtLastListItem(a))}else if(this.listData&&this.mainData&&!l&&this.allowCustomValue)if(this.allowFiltering&&this.isRemoteSelection&&this.remoteCustomValue)this.isRemoteSelection=!1,this.enableVirtualization||this.resetList(this.listData,n,e);else if(!this.allowFiltering&&this.list){var f=this.list.querySelectorAll("li."+H.li+":not(.e-hide-listitem)"),v=u(this.targetElement(),f,"StartsWith",this.ignoreCase);v&&null!==v.item&&this.addListFocus(v.item)}this.isCustomReset=!1,this.value&&this.value.length&&this.refreshSelection()},s.prototype.getNgDirective=function(){return"EJS-MULTISELECT"},s.prototype.wrapperClick=function(e){if(this.setDynValue=!1,this.keyboardEvent=null,this.isKeyBoardAction=!1,this.enabled){if(e.target===this.overAllClear)return void e.preventDefault();if(this.inputFocus||this.inputElement.focus(),!this.readonly){if(e.target&&-1!==e.target.classList.toString().indexOf("e-chips-close"))return void(this.isPopupOpen()&&this.refreshPopup());!this.isPopupOpen()&&(this.openOnClick||this.showDropDownIcon&&e.target&&"e-input-group-icon e-ddl-icon"===e.target.className)?this.showPopup(e):(this.hidePopup(e),"CheckBox"===this.mode&&(this.showOverAllClear(),this.inputFocus=!0,this.overAllWrapper.classList.contains(ve)||this.overAllWrapper.classList.add(ve)))}this.targetElement()&&""!==this.targetElement()||e.preventDefault(),this.checkAndScrollParent(),0===this.maximumSelectionLength&&this.checkMaxSelection()}},s.prototype.checkAndScrollParent=function(){for(var e=this.overAllWrapper?this.overAllWrapper.parentElement:null;e;){var t=getComputedStyle(e),i=parseFloat(t.maxHeight)||parseFloat(t.height);if(!isNaN(i)&&this.isPopupOpen()){var s=t.overflowY,l=this.overAllWrapper.getBoundingClientRect().bottom,n=e.getBoundingClientRect().bottom;if(("auto"===s||"scroll"===s)&&l>n)return void(e.scrollTop+=l-n+10)}e=e.parentElement}},s.prototype.enable=function(e){e?(this.overAllWrapper.classList.remove("e-disabled"),this.inputElement.removeAttribute("disabled"),t.attributes(this.inputElement,{"aria-disabled":"false"}),this.ensureAriaDisabled("false")):(this.overAllWrapper.classList.add("e-disabled"),this.inputElement.setAttribute("disabled","true"),t.attributes(this.inputElement,{"aria-disabled":"true"}),this.ensureAriaDisabled("true")),this.enabled!==e&&(this.enabled=e),this.hidePopup()},s.prototype.onBlurHandler=function(e,i){var s;if(this.isBlurDispatching&&this.isAngular)return void(this.isBlurDispatching=!1);if(t.isNullOrUndefined(e)||(s=e.relatedTarget),this.popupObj&&document.body.contains(this.popupObj.element)&&this.popupObj.element.contains(s))return void("CheckBox"!==this.mode?this.inputElement.focus():"Auto"===this.floatLabelType&&(this.overAllWrapper.classList.contains("e-outline")||this.overAllWrapper.classList.contains("e-filled"))&&t.addClass([this.overAllWrapper],"e-valid-input"));if("Auto"===this.floatLabelType&&this.overAllWrapper.classList.contains("e-outline")&&"CheckBox"===this.mode&&(t.isNullOrUndefined(this.value)||0===this.value.length)&&t.removeClass([this.overAllWrapper],"e-valid-input"),"CheckBox"===this.mode&&t.Browser.isIE&&!t.isNullOrUndefined(e)&&!i)return this.inputFocus=!1,void this.overAllWrapper.classList.remove(ve);if(this.scrollFocusStatus)return t.isNullOrUndefined(e)||e.preventDefault(),this.inputElement.focus(),void(this.scrollFocusStatus=!1);if(this.inputFocus=!1,this.overAllWrapper.classList.remove(ve),this.addTagOnBlur){var l=this.getValueByText(this.inputElement.value,this.ignoreCase,this.ignoreAccent),n=this.findListElement(this.list,"li","data-value",l),r=this.hideSelectedItem?ge:H.selected;!(!n||n.classList.contains(r))&&(this.updateListSelection(n,e),"Delimiter"===this.mode&&this.updateDelimeter(this.delimiterChar))}this.updateDataList(),this.refreshListItems(null),"Box"!==this.mode&&"CheckBox"!==this.mode&&this.updateDelimView(),this.changeOnBlur&&(this.updateValueState(e,this.value,this.tempValues),this.dispatchEvent(this.hiddenElement,"change")),this.overAllClear.style.display="none",this.isPopupOpen()&&this.hidePopup(e),this.makeTextBoxEmpty(),this.trigger("blur"),this.focused=!0,t.Browser.isDevice&&"Delimiter"!==this.mode&&"CheckBox"!==this.mode&&this.removeChipFocus(),this.removeChipSelection(),this.refreshInputHight(),S(this.overAllWrapper,this.componentWrapper,this.value,this.floatLabelType,this.placeholder),this.refreshPlaceHolder(),(this.allowFiltering||!0===this.enableSelectionOrder&&"CheckBox"===this.mode)&&!t.isNullOrUndefined(this.mainList)&&(this.ulElement=this.mainList),this.checkPlaceholderSize(),null===this.element.querySelector(".e-multiselect .e-float-text-content")&&a.Input.createSpanElement(this.overAllWrapper,this.createElement),this.calculateWidth(),t.isNullOrUndefined(this.overAllWrapper)||t.isNullOrUndefined(this.overAllWrapper.getElementsByClassName("e-ddl-icon")[0]&&this.overAllWrapper.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType)||this.overAllWrapper.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon"),this.isBlurDispatching=!0,this.isAngular&&this.dispatchEvent(this.inputElement,"blur")},s.prototype.calculateWidth=function(){var e;if(this.overAllWrapper){if(!this.showDropDownIcon||this.overAllWrapper.querySelector(".e-label-top"))e=this.overAllWrapper.clientWidth-2*parseInt(getComputedStyle(this.inputElement).paddingRight,10);else{var t=this.dropIcon.offsetWidth+parseInt(getComputedStyle(this.dropIcon).marginRight,10);e=this.overAllWrapper.clientWidth-(t+2*parseInt(getComputedStyle(this.inputElement).paddingRight,10))}"Never"!==this.floatLabelType&&a.Input.calculateWidth(e,this.overAllWrapper,this.getModuleName())}},s.prototype.checkPlaceholderSize=function(){if(this.showDropDownIcon){var e=this.dropIcon.offsetWidth+parseInt(window.getComputedStyle(this.dropIcon).marginRight,10);this.setPlaceholderSize(e)}else t.isNullOrUndefined(this.dropIcon)||this.setPlaceholderSize(this.showDropDownIcon?this.dropIcon.offsetWidth:0)},s.prototype.setPlaceholderSize=function(e){t.isNullOrUndefined(this.value)||0===this.value.length?0!==this.dropIcon.offsetWidth?this.searchWrapper.style.width="calc(100% - "+(e+10)+"px":t.addClass([this.searchWrapper],"e-search-custom-width"):t.isNullOrUndefined(this.value)||(this.searchWrapper.removeAttribute("style"),t.removeClass([this.searchWrapper],"e-search-custom-width"))},s.prototype.refreshInputHight=function(){t.isNullOrUndefined(this.searchWrapper)||(this.value&&this.value.length||!t.isNullOrUndefined(this.text)&&""!==this.text?this.searchWrapper.classList.add("e-zero-size"):this.searchWrapper.classList.remove("e-zero-size"))},s.prototype.validateValues=function(e,t){return JSON.stringify(e.slice().sort())!==JSON.stringify(t.slice().sort())},s.prototype.updateValueState=function(e,t,i){var s=t||[],l=i||[];if(this.initStatus&&this.validateValues(s,l)){var n={e:e,oldValue:(this.allowObjectBinding,i),value:(this.allowObjectBinding,t),isInteracted:!!e,element:this.element,event:e};this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",n),this.enableVirtualization&&this.enableSelectionOrder&&"CheckBox"===this.mode&&(this.preventSetCurrentData=!1),this.updateTempValue(),this.changeOnBlur||this.dispatchEvent(this.hiddenElement,"change")}this.selectedValueInfo=this.viewPortInfo},s.prototype.updateTempValue=function(){this.value?this.tempValues=(this.allowObjectBinding,this.value.slice()):this.tempValues=this.value},s.prototype.updateAriaActiveDescendant=function(){t.isNullOrUndefined(this.ulElement)||t.isNullOrUndefined(this.ulElement.getElementsByClassName("e-item-focus")[0])||t.attributes(this.inputElement,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id})},s.prototype.pageUpSelection=function(e,i){var s=this.list.querySelectorAll("li."+H.li+":not(."+ge+"):not(.e-reorder-hide)"),l=e>=0?s[e+1]:s[0];if(this.fields.disabled&&l&&!this.enableVirtualization){for(;l&&(l.classList.contains("e-disabled")||l.classList.contains(ge)||l.classList.contains(".e-reorder-hide")||l.classList.contains("e-list-group-item"));)l=l.previousElementSibling;if(!l)return}this.enableVirtualization&&i&&(l=this.liCollections.length>=e&&e>=0?this.liCollections[e]:this.liCollections[this.skeletonCount]),!t.isNullOrUndefined(l)&&l.classList.contains("e-virtual-list")&&(l=this.liCollections[this.skeletonCount]),this.enableVirtualization?(t.isNullOrUndefined(l)||l.classList.contains("e-item-focus")?0===this.viewPortInfo.startIndex&&(this.isKeyBoardAction=!0,this.scrollTop(l,this.getIndexByValue(l.getAttribute("data-value")),this.keyboardEvent.keyCode)):(this.isKeyBoardAction=!0,this.addListFocus(l),this.scrollTop(l,this.getIndexByValue(l.getAttribute("data-value")),this.keyboardEvent.keyCode)),this.previousFocusItem=l):(this.isKeyBoardAction=!0,this.addListFocus(l),this.scrollTop(l,this.getIndexByValue(l.getAttribute("data-value")),this.keyboardEvent.keyCode))},s.prototype.pageDownSelection=function(e,t){var i=this.getItems(),s=this.list.querySelectorAll("li."+H.li+":not(."+ge+"):not(.e-reorder-hide):not(.e-virtual-list-end)"),l=e<=s.length?s[e-1]:s[s.length-1];if(this.fields.disabled&&l&&!this.enableVirtualization){for(;l&&(l.classList.contains("e-disabled")||l.classList.contains(ge)||l.classList.contains(".e-reorder-hide")||l.classList.contains("e-list-group-item"));)l=l.nextElementSibling;if(!l)return}this.enableVirtualization&&this.skeletonCount>0&&(l=e<i.length?this.liCollections[e]:this.liCollections[i.length-1]),this.enableVirtualization&&t&&(l=e<=i.length?this.liCollections[e]:this.liCollections[i.length-1]),this.enableVirtualization&&l&&l.classList.contains("e-virtual-list-end")&&(l=s[s.length-1]),this.isKeyBoardAction=!0,this.addListFocus(l),this.previousFocusItem=l,this.scrollBottom(l,this.getIndexByValue(l.getAttribute("data-value")),!1,this.keyboardEvent.keyCode)},s.prototype.getItems=function(){return this.list||e.prototype.render.call(this),this.ulElement&&this.ulElement.querySelectorAll("."+H.li).length>0?this.ulElement.querySelectorAll("."+H.li+":not(."+ge+")"):[]},s.prototype.focusInHandler=function(e){var t=this;if(this.enabled){if(this.showOverAllClear(),this.inputFocus=!0,this.value&&this.value.length&&("Delimiter"!==this.mode&&"CheckBox"!==this.mode?this.chipCollectionWrapper.style.display="":this.showDelimWrapper(),"CheckBox"!==this.mode&&(this.viewWrapper.style.display="none")),"CheckBox"!==this.mode&&this.searchWrapper.classList.remove("e-zero-size"),this.checkPlaceholderSize(),this.focused){var i={isInteracted:!!e,event:e};this.trigger("focus",i),this.focused=!1}return this.overAllWrapper.classList.contains(ve)||this.overAllWrapper.classList.add(ve),b(this.overAllWrapper,this.componentWrapper),this.isPopupOpen()&&this.refreshPopup(),this.allowResize&&this.setResize(),setTimeout(function(){t.calculateWidth()},150),!0}return!1},s.prototype.showDelimWrapper=function(){"CheckBox"===this.mode?this.viewWrapper.style.display="":this.delimiterWrapper.style.display="",this.componentWrapper.classList.add("e-delimiter")},s.prototype.hideDelimWrapper=function(){this.delimiterWrapper.style.display="none",this.componentWrapper.classList.remove("e-delimiter")},s.prototype.expandTextbox=function(){var e=5;if(this.placeholder){var t=this.placeholder.charCodeAt(0),i=44032<=t&&t<=55215?1.5:19968<=t&&t<=40959?2:1;e=e>this.inputElement.placeholder.length?e:this.inputElement.placeholder.length*i}this.inputElement.value.length>e?this.inputElement.size=this.inputElement.value.length:this.inputElement.size=e},s.prototype.isPopupOpen=function(){return null!==this.popupWrapper&&null!==this.popupWrapper.parentElement},s.prototype.refreshPopup=function(){this.popupObj&&this.mobFilter&&(this.popupObj.setProperties({width:this.calcPopupWidth()}),this.popupObj.refreshPosition(this.overAllWrapper),this.popupObj.resolveCollision())},s.prototype.checkTextLength=function(){return this.targetElement().length<1},s.prototype.popupKeyActions=function(e){switch(e.keyCode){case 38:this.hidePopup(e),"CheckBox"===this.mode&&this.inputElement.focus(),e.preventDefault();break;case 40:this.isPopupOpen()||(this.showPopup(e),e.preventDefault())}},s.prototype.updatePopupPosition=function(){this.refreshPopup()},s.prototype.updateAriaAttribute=function(){var e=this.list.querySelector("."+H.focus);if(!t.isNullOrUndefined(e))if(this.inputElement.setAttribute("aria-activedescendant",e.id),this.allowFiltering){var i=this.popupWrapper.querySelector(".e-input-filter");i&&i.setAttribute("aria-activedescendant",e.id)}else"CheckBox"===this.mode&&this.overAllWrapper.setAttribute("aria-activedescendant",e.id)},s.prototype.homeNavigation=function(e,t){if(this.removeFocus(),this.enableVirtualization)if(e)this.enableVirtualization&&0!==this.viewPortInfo.startIndex&&(this.viewPortInfo.startIndex=0,this.viewPortInfo.endIndex=this.itemCount,this.updateVirtualItemIndex(),this.resetList(this.dataSource,this.fields,this.query));else if(this.enableVirtualization&&(!this.value&&this.viewPortInfo.endIndex!==this.totalItemCount||this.value&&this.value.length>0&&this.viewPortInfo.endIndex!==this.totalItemCount+this.value.length)){this.viewPortInfo.startIndex=this.totalItemCount-this.itemCount,this.viewPortInfo.endIndex=this.totalItemCount,this.updateVirtualItemIndex();var s=(new i.Query).clone();this.value&&this.value.length>0&&(s=(s=this.getForQuery(this.value).clone()).skip(this.totalItemCount-this.itemCount)),this.resetList(this.dataSource,this.fields,s)}this.UpdateSkeleton();var l=this.ulElement.querySelectorAll("li."+H.li+":not(."+ge+"):not(.e-reorder-hide)");if(l.length>0){var n=l[e?0:l.length-1];this.enableVirtualization&&e&&(n=l[this.skeletonCount]),this.removeFocus(),n.classList.add(H.focus),this.enableVirtualization&&e?this.scrollTop(n,void 0,this.keyboardEvent.keyCode):t||this.scrollBottom(n,void 0,!1,this.keyboardEvent.keyCode),this.updateAriaActiveDescendant()}},s.prototype.updateSelectionList=function(){if(!t.isNullOrUndefined(this.value)&&this.value.length)for(var e=0;e<this.value.length;e++){var i=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",this.value[e]):this.value[e],s=this.getElementByValue(i);s&&!s.classList.contains(H.selected)&&s.classList.add("e-active")}},s.prototype.handleVirtualKeyboardActions=function(e,t){var i,s=this.list.querySelector("."+H.focus);switch(this.isKeyBoardAction=!0,e.keyCode){case 40:this.arrowDown(e,!0);break;case 38:this.arrowUp(e,!0);break;case 33:e.preventDefault(),s&&(i=this.getIndexByValue(this.previousFocusItem.getAttribute("data-value"))-1,this.pageUpSelection(i,!0),this.updateAriaAttribute());break;case 34:e.preventDefault(),s&&(i=this.getIndexByValue(this.previousFocusItem.getAttribute("data-value")),this.pageDownSelection(i,!0),this.updateAriaAttribute());break;case 35:case 36:this.isMouseScrollAction=!0,this.homeNavigation(36===e.keyCode,!0),this.isPreventScrollAction=!0}this.keyboardEvent=null,this.isScrollChanged=!0,this.isKeyBoardAction=!1},s.prototype.onKeyDown=function(e){if(!this.readonly&&(this.enabled||"CheckBox"===this.mode)&&(this.preventSetCurrentData=!1,this.keyboardEvent=e,this.isPreventKeyAction&&this.enableVirtualization&&e.preventDefault(),this.keyCode=e.keyCode,this.keyDownStatus=!0,!(e.keyCode>111&&e.keyCode<124))){if(e.altKey)return void this.popupKeyActions(e);if(this.isPopupOpen()){var t=this.list.querySelector("."+H.focus),i=void 0;switch(e.keyCode){case 36:case 35:this.isMouseScrollAction=!0,this.isKeyBoardAction=!0,this.homeNavigation(36===e.keyCode);break;case 33:return e.preventDefault(),void(t&&(i=this.getIndexByValue(t.getAttribute("data-value")),this.pageUpSelection(i-this.getPageCount()-1),this.updateAriaAttribute()));case 34:return e.preventDefault(),void(t&&(i=this.getIndexByValue(t.getAttribute("data-value")),this.pageDownSelection(i+this.getPageCount()),this.updateAriaAttribute()));case 38:this.isKeyBoardAction=!0,this.arrowUp(e);break;case 40:this.isKeyBoardAction=!0,this.arrowDown(e);break;case 27:return e.preventDefault(),this.isKeyBoardAction=!0,this.hidePopup(e),"CheckBox"===this.mode&&this.inputElement.focus(),void(this.isKeyBoardAction=!1);case 13:return e.preventDefault(),this.isKeyBoardAction=!0,"CheckBox"!==this.mode&&this.selectByKey(e),this.checkPlaceholderSize(),void(this.isKeyBoardAction=!1);case 32:return this.isKeyBoardAction=!0,this.spaceKeySelection(e),void(this.isKeyBoardAction=!1);case 9:e.preventDefault(),this.isKeyBoardAction=!0,this.hidePopup(e),this.inputElement.focus(),this.overAllWrapper.classList.add(ve)}}else switch(e.keyCode){case 13:case 9:case 16:case 17:case 20:return;case 40:this.openOnClick&&this.showPopup();break;case 27:return e.preventDefault(),void this.escapeAction()}this.checkTextLength()&&this.keyNavigation(e),"CheckBox"===this.mode&&this.enableSelectionOrder&&(this.allowFiltering&&(this.previousFilterText=this.targetElement()),this.checkBackCommand(e)),this.expandTextbox(),"CheckBox"===this.mode&&this.showSelectAll||this.refreshPopup(),this.allowResize&&this.setResize(),this.isKeyBoardAction=!1}},s.prototype.arrowDown=function(e,i){e.preventDefault(),this.moveByList(1,i),this.keyAction=!0,(document.activeElement.classList.contains("e-input-filter")||"CheckBox"===this.mode&&!this.allowFiltering&&document.activeElement!==this.list)&&t.EventHandler.add(this.list,"keydown",this.onKeyDown,this),this.updateAriaAttribute()},s.prototype.arrowUp=function(e,i){e.preventDefault(),this.keyAction=!0;var s=this.list.querySelectorAll("li."+H.li+":not(."+ge+"):not(.e-reorder-hide)");this.enableGroupCheckBox&&"CheckBox"===this.mode&&!t.isNullOrUndefined(this.fields.groupBy)&&(s=this.list.querySelectorAll("li."+H.li+",li."+H.group+":not(."+ge+"):not(.e-reorder-hide)"));var l=this.list.querySelector("li."+H.focus);if(this.focusFirstListItem=!t.isNullOrUndefined(this.liCollections[0])&&this.liCollections[0].classList.contains("e-item-focus"),this.list&&this.list.querySelector(".e-list-parent.e-ul.e-reorder")){var n=this.list.querySelectorAll("li."+H.li+":not(."+ge+"):not(.e-reorder-hide):not(.e-virtual-list-end)");n.length>0&&(this.focusFirstListItem=!t.isNullOrUndefined(n[0])&&n[0].classList.contains("e-item-focus"))}Array.prototype.slice.call(s).indexOf(l)<=0&&"CheckBox"===this.mode&&this.allowFiltering&&(this.keyAction=!1,this.notify("inputFocus",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"focus"})),this.moveByList(-1,i),this.updateAriaAttribute()},s.prototype.spaceKeySelection=function(e){if("CheckBox"===this.mode){var i=this.list.querySelector("li."+H.focus),s=document.getElementsByClassName("e-selectall-parent")[0];if((!t.isNullOrUndefined(i)||s&&s.classList.contains("e-item-focus"))&&(e.preventDefault(),this.keyAction=!0),this.selectByKey(e),this.keyAction){var l=this.list.querySelector("li."+H.focus);!t.isNullOrUndefined(l)&&s&&s.classList.contains("e-item-focus")&&l.classList.remove("e-item-focus")}}this.checkPlaceholderSize()},s.prototype.checkBackCommand=function(e){(8===e.keyCode&&this.allowFiltering?this.targetElement()!==this.previousFilterText:""===this.targetElement())?this.backCommand=!1:this.backCommand=!0},s.prototype.keyNavigation=function(e){if("Delimiter"!==this.mode&&"CheckBox"!==this.mode&&this.value&&this.value.length)switch(e.keyCode){case 37:e.preventDefault(),this.moveBy(-1,e);break;case 39:e.preventDefault(),this.moveBy(1,e);break;case 8:this.removelastSelection(e);break;case 46:this.removeSelectedChip(e)}else if(8===e.keyCode&&"Delimiter"===this.mode&&this.value&&this.value.length){e.preventDefault();var i=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",this.value[this.value.length-1]):this.value[this.value.length-1];this.removeValue(this.value[this.value.length-1],e),this.updateDelimeter(this.delimiterChar,e),this.focusAtLastListItem(i)}},s.prototype.selectByKey=function(e){this.removeChipSelection(),this.selectListByKey(e),this.hideSelectedItem&&this.focusAtFirstListItem()},s.prototype.escapeAction=function(){var e=this.tempValues?this.tempValues.slice():[];this.allowObjectBinding&&(e=this.tempValues?this.tempValues.slice():[]),this.value&&this.validateValues(this.value,e)&&("CheckBox"!==this.mode&&(this.value=e,(this.allowFiltering||this.allowCustomValue)&&this.refreshListItems(null),this.initialValueUpdate()),"Delimiter"!==this.mode&&"CheckBox"!==this.mode?this.chipCollectionWrapper.style.display="":this.showDelimWrapper(),this.refreshPlaceHolder(),this.value.length?this.showOverAllClear():this.hideOverAllClear()),this.makeTextBoxEmpty()},s.prototype.scrollBottom=function(e,i,s,l,n){void 0===s&&(s=!1),void 0===l&&(l=null),void 0===n&&(n=!1),(!t.isNullOrUndefined(e)&&e.classList.contains("e-virtual-list")||this.enableVirtualization&&t.isNullOrUndefined(e))&&(e=this.liCollections[this.skeletonCount]);var a=e&&!isNaN(parseInt(window.getComputedStyle(e).marginBottom,10))?parseInt(window.getComputedStyle(e).marginBottom,10):0;this.isUpwardScrolling=!1;var r=this.list.querySelectorAll(".e-virtual-list:not(.e-virtual-list-end)").length,o=this.list.querySelectorAll("li:not(.e-virtual-list-end)"),h=o&&o.length>0&&o[o.length-1]?o[o.length-1].getAttribute("data-value"):null,u=this.virtualListInfo&&this.virtualListInfo.startIndex?e.offsetTop+this.virtualListInfo.startIndex*(e.offsetHeight+a):e.offsetTop,p=this.list.offsetHeight,d=u-r*(e.offsetHeight+a)+(e.offsetHeight+a)-this.list.scrollTop,c=this.list.scrollTop+d-p,m=!1,f=u-r*(e.offsetHeight+a)+(e.offsetHeight+a)-this.list.scrollTop;if(f=this.fields.groupBy&&!t.isNullOrUndefined(this.fixedHeaderElement)?f-this.fixedHeaderElement.offsetHeight:f,0!==i||this.enableVirtualization){if(d>p||!(f>0&&this.list.offsetHeight>f)){var v=e?e.getAttribute("data-value"):null,g=34===l?this.getPageCount()-1:1;!this.enableVirtualization||this.isKeyBoardAction||s?this.isKeyBoardAction&&this.enableVirtualization&&h&&v===h&&35!==l&&!this.isVirtualScrolling?(this.isPreventKeyAction=!0,this.list.scrollTop+=(e.offsetHeight+a)*g,this.isPreventKeyAction=!this.isScrollerAtEnd()&&this.isPreventKeyAction,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1):this.enableVirtualization&&35===l?(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1,this.list.scrollTop=this.list.scrollHeight):(34===l&&this.enableVirtualization&&!this.isVirtualScrolling&&(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1),this.list.scrollTop=c):this.list.scrollTop=this.virtualListInfo&&this.virtualListInfo.startIndex?n&&this.virtualListInfo.startIndex?this.virtualListInfo.startIndex*this.listItemHeight+2*this.listItemHeight:this.virtualListInfo.startIndex*this.listItemHeight:0,m=this.isKeyBoardAction}}else this.list.scrollTop=0;this.isKeyBoardAction=m},s.prototype.scrollTop=function(e,i,s){void 0===s&&(s=null);var l=this.list.querySelectorAll(".e-virtual-list:not(.e-virtual-list-end)").length,n=e&&!isNaN(parseInt(window.getComputedStyle(e).marginBottom,10))?parseInt(window.getComputedStyle(e).marginBottom,10):0,a=this.virtualListInfo&&this.virtualListInfo.startIndex?e.offsetTop+this.virtualListInfo.startIndex*(e.offsetHeight+n):e.offsetTop,r=a-l*(e.offsetHeight+n)-this.list.scrollTop,o=this.list.querySelector("li.e-list-item:not(.e-virtual-list)")?this.list.querySelector("li.e-list-item:not(.e-virtual-list)").getAttribute("data-value"):null;r=this.fields.groupBy&&!t.isUndefined(this.fixedHeaderElement)?r-this.fixedHeaderElement.offsetHeight:r;var h=a-l*(e.offsetHeight+n)+(e.offsetHeight+n)-this.list.scrollTop,u=this.enableVirtualization&&"autocomplete"===this.getModuleName()&&r<=0;if(0!==i||this.enableVirtualization)if(r<0||u){var p=e?e.getAttribute("data-value"):null,d=33===s?this.getPageCount()-2:1;this.enableVirtualization&&this.isKeyBoardAction&&o&&p===o&&36!==s&&!this.isVirtualScrolling?(this.isUpwardScrolling=!0,this.isPreventKeyAction=!0,this.isKeyBoardAction=!1,this.list.scrollTop-=(e.offsetHeight+n)*d,this.isPreventKeyAction=0!==this.list.scrollTop&&this.isPreventKeyAction,this.isPreventScrollAction=!1):this.enableVirtualization&&36===s?(this.isPreventScrollAction=!1,this.isPreventKeyAction=!0,this.isKeyBoardAction=!1,this.list.scrollTo(0,0)):(33===s&&this.enableVirtualization&&!this.isVirtualScrolling&&(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1),this.list.scrollTop=this.list.scrollTop+r)}else h>0&&this.list.offsetHeight>h||(this.list.scrollTop=e.offsetTop-(this.fields.groupBy&&!t.isNullOrUndefined(this.fixedHeaderElement)?this.fixedHeaderElement.offsetHeight:0));else this.list.scrollTop=0},s.prototype.isScrollerAtEnd=function(){return this.list&&this.list.scrollTop+this.list.clientHeight>=this.list.scrollHeight},s.prototype.selectListByKey=function(e){var i,s=this.list.querySelector("li."+H.focus),l=this.value&&this.value.length?this.value.length:0;if(null!==s){if(e.preventDefault(),s.classList.contains("e-active")&&(l-=1),this.isValidLI(s)&&l<this.maximumSelectionLength){this.updateListSelection(s,e),this.addListFocus(s),"CheckBox"===this.mode?(this.updateDelimView(),this.updateDelimeter(this.delimiterChar,e),this.refreshInputHight(),this.checkPlaceholderSize(),this.enableGroupCheckBox&&!t.isNullOrUndefined(this.fields.groupBy)&&(i=s.firstElementChild.lastElementChild,this.findGroupStart(i),this.deselectHeader())):this.updateDelimeter(this.delimiterChar,e);var n=""!==this.targetElement().trim();this.makeTextBoxEmpty(),"CheckBox"!==this.mode&&this.refreshListItems(s.textContent,n),this.changeOnBlur||this.updateValueState(e,this.value,this.tempValues),this.refreshPopup()}else!this.isValidLI(s)&&l<this.maximumSelectionLength&&((i=s.firstElementChild.lastElementChild).classList.contains("e-check")?this.selectAllItem(!1,e,s):this.selectAllItem(!0,e,s));this.refreshSelection(),this.closePopupOnSelect&&this.hidePopup(e)}var a=document.getElementsByClassName("e-selectall-parent")[0];if(a&&a.classList.contains("e-item-focus")){var r=a.childNodes[0];if(r.classList.contains("e-check")){r.classList.remove("e-check");o={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"check",name:"checkSelectAll"};this.notify("checkSelectAll",o),this.selectAllItem(!1,e,s)}else{r.classList.add("e-check");var o={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"check",name:"checkSelectAll"};this.notify("checkSelectAll",o),this.selectAllItem(!0,e,s)}}this.refreshPlaceHolder()},s.prototype.refreshListItems=function(e,i){if((this.allowFiltering||"CheckBox"===this.mode&&!0===this.enableSelectionOrder||this.allowCustomValue)&&this.mainList&&this.listData){var s=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;if(this.enableVirtualization)if(this.allowCustomValue&&this.virtualCustomData&&null==e&&this.virtualCustomData&&this.viewPortInfo&&0===this.viewPortInfo.startIndex&&this.viewPortInfo.endIndex===this.itemCount)this.virtualCustomData=null,this.renderItems(this.mainData,this.fields);else if(this.allowFiltering&&i){if(this.updateInitialData(),this.onActionComplete(s,this.mainData),this.isVirtualTrackHeight=!1,this.list.getElementsByClassName("e-virtual-ddl")[0])this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight();else if(!this.list.querySelector(".e-virtual-ddl")&&this.skeletonCount>0){var l=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"});l.style.cssText=this.GetVirtualTrackHeight(),this.popupWrapper.querySelector(".e-dropdownbase").appendChild(l)}}else this.onActionComplete(this.list,this.listData);else this.onActionComplete(s,this.mainData);this.focusAtLastListItem(e),this.value&&this.value.length&&this.refreshSelection()}else!t.isNullOrUndefined(this.fields.groupBy)&&this.value&&this.value.length&&this.refreshSelection()},s.prototype.removeSelectedChip=function(e){var i,s=this.chipCollectionWrapper.querySelector("span."+Ce);if(null!==s){t.isNullOrUndefined(this.value)||(this.tempValues=(this.allowObjectBinding,this.value.slice())),null!==(i=s.nextElementSibling)&&(this.removeChipSelection(),this.addChipSelection(i,e));var l=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(s.getAttribute("data-value"))):s.getAttribute("data-value");this.removeValue(l,e),this.updateDelimeter(this.delimiterChar,e),this.makeTextBoxEmpty()}this.closePopupOnSelect&&this.hidePopup(e),this.checkPlaceholderSize()},s.prototype.moveByTop=function(e){var t,i=this.list.querySelectorAll("li."+H.li);i.length>1&&(this.removeFocus(),t=e?0:i.length-1,this.addListFocus(i[t]),this.scrollBottom(i[t],t)),this.updateAriaAttribute()},s.prototype.clickHandler=function(e){var t=e.target.className,i=document.getElementsByClassName("e-selectall-parent")[0];"e-input-filter e-input"!==t&&"e-input-group e-control-wrapper e-input-focus"!==t||!i.classList.contains("e-item-focus")||i.classList.remove("e-item-focus")},s.prototype.moveByList=function(e,i){if(this.list){var s=this.list.querySelectorAll("li."+H.li+":not(."+ge+"):not(.e-reorder-hide):not(.e-virtual-list-end)");"CheckBox"===this.mode&&this.enableGroupCheckBox&&!t.isNullOrUndefined(this.fields.groupBy)&&(s=this.list.querySelectorAll("li."+H.li+",li."+H.group+":not(."+ge+"):not(.e-reorder-hide):not(.e-virtual-list-end)"));var l=this.list.querySelector("li."+H.focus);this.enableVirtualization&&i&&!t.isNullOrUndefined(this.currentFocuedListElement)&&(l=this.getElementByValue(this.getFormattedValue(this.currentFocuedListElement.getAttribute("data-value"))));var n=-1,a=document.getElementsByClassName("e-selectall-parent")[0];if("CheckBox"===this.mode&&this.showSelectAll&&1===e&&!t.isNullOrUndefined(a)&&!a.classList.contains("e-item-focus")&&0===this.list.getElementsByClassName("e-item-focus").length&&this.liCollections.length>1)!this.focusFirstListItem&&a.classList.contains("e-item-focus")?a.classList.remove("e-item-focus"):a.classList.contains("e-item-focus")||a.classList.add("e-item-focus");else if(s.length){"CheckBox"===this.mode&&this.showSelectAll&&!t.isNullOrUndefined(a&&-1===e)&&(this.focusFirstListItem&&1!==e||!a.classList.contains("e-item-focus")?!this.focusFirstListItem||a.classList.contains("e-item-focus")||1===e&&this.list.querySelector(".e-item-focus")||a.classList.add("e-item-focus"):a.classList.remove("e-item-focus"));for(var r=0;r<s.length;r++)if(s[r]===l){n=r;break}if(e>0)n<s.length-1&&(this.removeFocus(),this.enableVirtualization&&i?this.addListFocus(s[n]):this.enableVirtualization&&s[n+1].classList.contains("e-virtual-list")?this.addListFocus(s[this.skeletonCount]):this.addListFocus(s[++n]),n>-1&&(this.updateCheck(s[n]),this.scrollBottom(s[n],n),this.currentFocuedListElement=s[n]));else if(n>0)if(this.enableVirtualization){var o=s[n-1].classList.contains("e-virtual-list"),h=i?n:n-1;!i&&o||this.removeFocus(),!i&&o||(this.addListFocus(s[h]),this.updateCheck(s[h]),this.scrollTop(s[h],n),this.currentFocuedListElement=s[h])}else this.removeFocus(),this.addListFocus(s[--n]),this.updateCheck(s[n]),this.scrollTop(s[n],n)}}var u=this.list?this.list.querySelector(".e-item-focus"):null;if(this.isDisabledElement(u)){if(0===this.list.querySelectorAll(".e-list-item:not(.e-hide-listitem):not(.e-disabled)").length||38===this.keyCode&&"CheckBox"===this.mode&&this.enableGroupCheckBox&&!t.isNullOrUndefined(this.fields.groupBy)&&u===this.list.querySelector("li.e-list-group-item"))return void this.removeFocus();0===(r=this.getIndexByValue(u.getAttribute("data-value")))&&(e=1),r===this.list.querySelectorAll(".e-list-item:not(.e-hide-listitem)").length-1&&(e=-1),this.moveByList(e)}},s.prototype.getElementByValue=function(e){for(var t,i=0,s=this.getItems();i<s.length;i++){var l=s[i];if(this.getFormattedValue(l.getAttribute("data-value"))===e){t=l;break}}return t},s.prototype.updateCheck=function(e){"CheckBox"===this.mode&&this.enableGroupCheckBox&&!t.isNullOrUndefined(this.fields.groupBy)&&(e.firstElementChild.lastElementChild.classList.contains("e-check")?e.classList.add("e-active"):e.classList.remove("e-active"))},s.prototype.moveBy=function(e,t){var i,s=this.chipCollectionWrapper.querySelectorAll("span.e-chips"),l=this.chipCollectionWrapper.querySelector("span."+Ce);null===l?e<0&&this.addChipSelection(s[s.length-1],t):e<0?null!==(i=l.previousElementSibling)&&(this.removeChipSelection(),this.addChipSelection(i,t)):(i=l.nextElementSibling,this.removeChipSelection(),null!==i&&this.addChipSelection(i,t))},s.prototype.chipClick=function(e){if(this.enabled){var i=t.closest(e.target,".e-chips");this.removeChipSelection(),this.addChipSelection(i,e)}},s.prototype.removeChipSelection=function(){if(this.chipCollectionWrapper){var e=this.chipCollectionWrapper.querySelectorAll("span.e-chips."+Ce);if(e&&e.length>0)for(var t=0;t<e.length;t++)e[t].removeAttribute("aria-live");this.removeChipFocus()}},s.prototype.addChipSelection=function(e,i){t.addClass([e],Ce),e&&e.setAttribute("aria-live","polite"),this.trigger("chipSelection",i)},s.prototype.getVirtualDataByValue=function(e){if(!t.isNullOrUndefined(this.selectedListData)){var i=this.typeOfData(this.selectedListData).typeof;if("string"===i||"number"===i||"boolean"===i)for(var s=0,l=this.selectedListData;s<l.length;s++){r=l[s];if(!t.isNullOrUndefined(r)&&r===e)return r}else for(var n=0,a=this.selectedListData;n<a.length;n++){var r=a[n];if(!t.isNullOrUndefined(r)&&t.getValue(this.fields.value?this.fields.value:"value",r)===e)return r}}return null},s.prototype.onChipRemove=function(e){if(3!==e.which&&2!==e.button&&this.enabled&&!this.readonly){var i=e.target.parentElement.getAttribute("data-value"),s=this.allowObjectBinding?this.enableVirtualization?this.getVirtualDataByValue(this.getFormattedValue(i)):this.getDataByValue(this.getFormattedValue(i)):this.getFormattedValue(i);if(this.allowCustomValue&&("false"!==i&&!1===s||!t.isNullOrUndefined(s)&&"NaN"===s.toString())&&(s=i),this.isPopupOpen()&&"CheckBox"!==this.mode&&this.hidePopup(e),this.inputFocus||this.inputElement.focus(),this.removeValue(s,e),s=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",s):s,t.isNullOrUndefined(this.findListElement(this.list,"li","data-value",s))&&this.mainList&&this.listData){var l=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.onActionComplete(l,this.mainData)}this.updateDelimeter(this.delimiterChar,e),this.placeholder&&"Never"===this.floatLabelType?(this.makeTextBoxEmpty(),this.checkPlaceholderSize()):this.inputElement.value="",e.preventDefault()}},s.prototype.makeTextBoxEmpty=function(){this.inputElement.value="",this.refreshPlaceHolder()},s.prototype.refreshPlaceHolder=function(){this.placeholder&&"Never"===this.floatLabelType?this.value&&this.value.length||!t.isNullOrUndefined(this.text)&&""!==this.text?this.inputElement.placeholder="":this.inputElement.placeholder=E(this.placeholder):(this.setFloatLabelType(),null===this.element.querySelector(".e-multiselect .e-float-text-content")&&a.Input.createSpanElement(this.overAllWrapper,this.createElement)),this.expandTextbox()},s.prototype.removeAllItems=function(e,i,s,l,n){var a=this.allowObjectBinding?this.indexOfObjectInArray(e,this.value):this.value.indexOf(e),r=this.value.slice(0);r.splice(a,1),this.setProperties({value:[].concat([],r)},!0),l.setAttribute("aria-selected","false");var o=this.hideSelectedItem?ge:H.selected;t.removeClass([l],o),this.notify("activeList",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:l,e:this,index:a}),this.invokeCheckboxSelection(l,i,s);var h=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",e):e;this.updateMainList(!0,h,n),this.updateChipStatus()},s.prototype.invokeCheckboxSelection=function(e,t,i){this.notify("updatelist",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:e,e:t}),this.updateAriaActiveDescendant(),this.value&&this.value.length!==this.mainData.length&&"CheckBox"===this.mode&&this.showSelectAll&&!this.isSelectAll&&!i&&this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"uncheck"})},s.prototype.removeValue=function(i,s,l,n){var a=this,r=this.allowObjectBinding?this.indexOfObjectInArray(i,this.value):this.value.indexOf(this.getFormattedValue(i));-1===r&&this.allowCustomValue&&!t.isNullOrUndefined(i)&&(r=this.allowObjectBinding?this.indexOfObjectInArray(i,this.value):this.value.indexOf(i.toString()));var o=s&&s.target;n=!!(n||o&&o.classList.contains("e-close-hooker"))||null;var h=this.hideSelectedItem?ge:H.selected;if(-1!==r){var u=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",i):i,p=this.virtualSelectAll?null:this.findListElement(this.list,"li","data-value",u),d=this.allowObjectBinding?i:this.getDataByValue(i),c={e:s,item:p,itemData:d,isInteracted:!!s,cancel:!1};this.trigger("removing",c,function(o){if(o.cancel)a.removeIndex++;else{a.isRemoveSelection=!!a.enableVirtualization||a.isRemoveSelection,a.currentRemoveValue=a.allowObjectBinding?t.getValue(a.fields.value?a.fields.value:"",i):i,a.virtualSelectAll=!1;var u=a.value.slice(0);if(u.splice(r,1),a.enableVirtualization&&a.selectedListData&&a.selectedListData.splice(r,1),a.setProperties({value:[].concat([],u)},!0),a.enableVirtualization){var c=0===r&&a.text.split(a.delimiterChar)&&1===a.text.split(a.delimiterChar).length?a.text.replace(a.text.split(a.delimiterChar)[r],""):0===r?a.text.replace(a.text.split(a.delimiterChar)[r]+a.delimiterChar,""):a.text.replace(a.delimiterChar+a.text.split(a.delimiterChar)[r],"");a.setProperties({text:c.toString()},!0)}if(null!==p){var m=a.allowObjectBinding?t.getValue(a.fields.value?a.fields.value:"",i):i,f=a.findListElement(a.mainList,"li","data-value",m);p.setAttribute("aria-selected","false"),t.removeClass([p],h),f&&(f.setAttribute("aria-selected","false"),t.removeClass([p,f],h)),a.notify("activeList",{module:"CheckBoxSelection",enable:"CheckBox"===a.mode,li:p,e:a,index:r}),a.invokeCheckboxSelection(p,s,n)}var v=a.allowObjectBinding?t.getValue(a.fields.value?a.fields.value:"",i):i;if(a.hideSelectedItem&&a.fields.groupBy&&p&&a.hideGroupItem(v),a.hideSelectedItem&&a.fixedHeaderElement&&a.fields.groupBy&&"CheckBox"!==a.mode&&a.isPopupOpen()&&e.prototype.scrollStop.call(a),a.updateMainList(!0,v),a.removeChip(v,n),a.updateChipStatus(),(a.value&&a.value.length?a.value.length:0)<a.maximumSelectionLength){var g=a.list.querySelectorAll("li."+H.li+":not(.e-active)");t.removeClass(g,"e-disable");var y=a.mainList.querySelectorAll("li."+H.li+":not(.e-active)");t.removeClass(y,"e-disable")}a.trigger("removed",o);var C=s&&s.currentTarget,b=!(!C||!C.classList.contains("e-selectall-parent"))||null;if(!a.changeOnBlur&&!n&&s&&l&&!b&&a.isSelectAllTarget&&a.updateValueState(s,a.value,a.tempValues),l&&(a.selectAllEventData.push(d),a.selectAllEventEle.push(p)),1===l){a.changeOnBlur||a.updateValueState(s,a.value,a.tempValues);var S={event:s,items:a.selectAllEventEle,itemData:a.selectAllEventData,isInteracted:!!s,isChecked:!1};a.trigger("selectedAll",S),a.selectAllEventData=[],a.selectAllEventEle=[]}!n||1!==l&&null!==l||a.clearAllCallback(s,n),a.isPopupOpen()&&p&&p.parentElement.classList.contains("e-reorder")&&(a.hideSelectedItem&&a.value&&Array.isArray(a.value)&&a.value.length>0&&a.totalItemsCount(),a.notify("setCurrentViewDataAsync",{module:"VirtualScroll"}))}})}},s.prototype.updateMainList=function(e,i,s){if(this.allowFiltering||"CheckBox"===this.mode){var l=s||this.findListElement(this.mainList,"li","data-value",i);l&&(e?(l.setAttribute("aria-selected","false"),t.removeClass([l],this.hideSelectedItem?ge:H.selected),"CheckBox"===this.mode&&t.removeClass([l.firstElementChild.lastElementChild],"e-check")):(l.setAttribute("aria-selected","true"),t.addClass([l],this.hideSelectedItem?ge:H.selected),"CheckBox"===this.mode&&t.addClass([l.firstElementChild.lastElementChild],"e-check")))}},s.prototype.removeChip=function(e,i){if(this.chipCollectionWrapper&&(!this.enableVirtualization||!i)){var s=this.findListElement(this.chipCollectionWrapper,"span","data-value",e);s&&t.remove(s)}},s.prototype.setWidth=function(e){t.isNullOrUndefined(e)||("number"==typeof e?this.overAllWrapper.style.width=t.formatUnit(e):"string"==typeof e&&(this.overAllWrapper.style.width=e.match(/px|%|em/)?e:t.formatUnit(e)))},s.prototype.updateChipStatus=function(){this.value&&this.value.length?(t.isNullOrUndefined(this.chipCollectionWrapper)||(this.chipCollectionWrapper.style.display=""),"Delimiter"!==this.mode&&"CheckBox"!==this.mode||this.showDelimWrapper(),this.showOverAllClear()):(t.isNullOrUndefined(this.chipCollectionWrapper)||(this.chipCollectionWrapper.style.display="none"),t.isNullOrUndefined(this.delimiterWrapper)||(this.delimiterWrapper.style.display="none"),this.hideOverAllClear())},s.prototype.indexOfObjectInArray=function(e,t){for(var i=0;i<t.length;i++){var s=function(i){var s=t[i];if(Object.keys(e).every(function(t){return s.hasOwnProperty(t)&&s[t]===e[t]}))return{value:i}}(i);if("object"==typeof s)return s.value}return-1},s.prototype.addValue=function(e,i,s){this.value||(this.value=[]);var l=this.allowObjectBinding?this.getDataByValue(e):e;if(this.allowObjectBinding&&!this.isObjectInArray(this.getDataByValue(e),this.value)||!this.allowObjectBinding&&this.value.indexOf(l)<0){if(this.setProperties({value:[].concat([],this.value,[l])},!0),this.enableVirtualization&&!this.isSelectAllLoop){var n=this.viewWrapper.innerHTML,a=void 0;n+=1===this.value.length?"":this.delimiterChar+" ",n+=a=this.getOverflowVal(this.value.length-1),a=this.viewWrapper.innerHTML,this.updateWrapperText(this.viewWrapper,n)}if(this.enableVirtualization&&"CheckBox"===this.mode){var r=[],a=(this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",this.value[this.value.length-1]):this.value[this.value.length-1],i),o=null!=this.text&&""!==this.text?this.text+this.delimiterChar+a:a;r.push(o),this.setProperties({text:r.toString()},!0)}}var h=this.findListElement(this.list,"li","data-value",e);this.removeFocus(),h&&(this.addListFocus(h),this.addListSelection(h)),"Delimiter"!==this.mode&&"CheckBox"!==this.mode&&this.addChip(i,e,s),this.hideSelectedItem&&this.fields.groupBy&&this.hideGroupItem(e),this.updateChipStatus(),this.checkMaxSelection()},s.prototype.updateListItemsState=function(e){var i=e.querySelectorAll("li."+H.li+".e-active");t.removeClass(i,"e-disable");var s=e.querySelectorAll("li."+H.li+":not(.e-active)");t.addClass(s,"e-disable")},s.prototype.checkMaxSelection=function(){var e=this.value&&this.value.length?this.value.length:0;if(0===this.maximumSelectionLength)return this.updateListItemsState(this.list),void(this.mainList&&this.updateListItemsState(this.mainList));if(e===this.maximumSelectionLength){var i=this.list.querySelectorAll("li."+H.li+".e-active");t.removeClass(i,"e-disable");var s=this.list.querySelectorAll("li."+H.li+":not(.e-active)");t.addClass(s,"e-disable")}if(e<this.maximumSelectionLength){var l=this.list.querySelectorAll("li."+H.li);t.removeClass(l,"e-disable")}},s.prototype.dispatchSelect=function(i,s,l,n,a,r,o){var h=this,u=this.listData;if(this.initStatus&&!n&&(!this.allowObjectBinding||this.allowObjectBinding&&i)){i=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",i):i;var p=r||this.getDataByValue(i),d={e:s,item:l,itemData:p,isInteracted:!!s,cancel:!1};this.trigger("select",d,function(n){if(!n.cancel){if(a&&(h.selectAllEventData.push(p),h.selectAllEventEle.push(l)),1===a){var d={event:s,items:h.selectAllEventEle,itemData:h.selectAllEventData,isInteracted:!!s,isChecked:!0};h.trigger("selectedAll",d),h.selectAllEventData=[]}h.allowCustomValue&&h.isServerRendered&&h.listData!==u&&(h.listData=u),i=h.allowObjectBinding?h.getDataByValue(i):i,h.enableVirtualization&&(t.isNullOrUndefined(h.selectedListData)?h.selectedListData=h.allowObjectBinding?[i]:[h.getDataByValue(i)]:r?Array.isArray(h.selectedListData)?h.selectedListData.push(r):h.selectedListData=[h.selectedListData,r]:Array.isArray(h.selectedListData)?h.selectedListData.push(h.allowObjectBinding?i:h.getDataByValue(i)):h.selectedListData=[h.selectedListData,h.allowObjectBinding?i:h.getDataByValue(i)]),(h.enableVirtualization&&i||!h.enableVirtualization)&&h.updateListSelectEventCallback(i,l,s,o),h.hideSelectedItem&&h.fixedHeaderElement&&h.fields.groupBy&&"CheckBox"!==h.mode&&e.prototype.scrollStop.call(h)}})}},s.prototype.addChip=function(e,t,i){this.chipCollectionWrapper&&this.getChip(e,t,i)},s.prototype.removeChipFocus=function(){var e=this.chipCollectionWrapper.querySelectorAll("span.e-chips."+Ce);if(t.removeClass(e,Ce),t.Browser.isDevice)for(var i=this.chipCollectionWrapper.querySelectorAll("span."+"e-chips-close".split(" ")[0]),s=0;s<i.length;s++)i[s].style.display="none"},s.prototype.onMobileChipInteraction=function(e){var i=t.closest(e.target,".e-chips"),s=i.querySelector("span."+"e-chips-close".split(" ")[0]);this.enabled&&!this.readonly&&(i.classList.contains(Ce)||(this.removeChipFocus(),s.style.display="",i.classList.add(Ce)),this.refreshPopup(),e.preventDefault())},s.prototype.multiCompiler=function(e){var i=!1;if("function"!=typeof e&&e)try{i=!!t.selectAll(e,document).length}catch(e){i=!1}return i},s.prototype.encodeHtmlEntities=function(e){return e.replace(/[\u00A0-\u9999<>&]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},s.prototype.getChip=function(e,i,s){var l,n=this,a={text:i,value:i},r=this.createElement("span",{className:ye,attrs:{"data-value":i,title:e,role:"option","aria-selected":"true"}}),o=this.createElement("span",{className:"e-chipcontent"}),h=this.createElement("span",{className:"e-chips-close"});if(this.mainData&&(a=this.getDataByValue(i)),this.valueTemplate&&!t.isNullOrUndefined(a)){var u=this.multiCompiler(this.valueTemplate),p=(l="function"!=typeof this.valueTemplate&&u?t.compile(t.select(this.valueTemplate,document).innerHTML.trim()):t.compile(this.valueTemplate))(a,this,"valueTemplate",this.valueTemplateId,this.isStringTemplate,null,o);p&&p.length>0&&t.append(p,o),this.renderReactTemplates()}else this.enableHtmlSanitizer?o.innerText=e:o.innerHTML=this.encodeHtmlEntities(e.toString());r.appendChild(o);var d={isInteracted:!!s,itemData:a,e:s,setClass:function(e){t.addClass([r],e)},cancel:!1};this.isPreventChange=this.isAngular&&this.preventChange,this.trigger("tagging",d,function(e){e.cancel||(t.Browser.isDevice?(r.classList.add("e-mob-chip"),t.append([h],r),h.style.display="none",t.EventHandler.add(r,"click",n.onMobileChipInteraction,n)):(t.EventHandler.add(r,"mousedown",n.chipClick,n),n.showClearButton&&r.appendChild(h)),t.EventHandler.add(h,"mousedown",n.onChipRemove,n),n.chipCollectionWrapper.appendChild(r),!n.changeOnBlur&&s&&n.updateValueState(s,n.value,n.tempValues))})},s.prototype.calcPopupWidth=function(){var e=t.formatUnit(this.popupWidth);return e.indexOf("%")>-1&&(e=(this.componentWrapper.offsetWidth*parseFloat(e)/100).toString()+"px"),this.allowResize&&this.resizeWidth?this.resizeWidth+"px":e},s.prototype.mouseIn=function(){this.enabled&&!this.readonly&&this.showOverAllClear()},s.prototype.mouseOut=function(){this.inputFocus||(this.overAllClear.style.display="none")},s.prototype.listOption=function(e,i){var s=!t.isNullOrUndefined(i.iconCss),l=t.isNullOrUndefined(i.properties)?i:i.properties;return this.listCurrentOptions=null!==i.text||null!==i.value?{fields:l,showIcon:s,ariaAttributes:{groupItemRole:"presentation"}}:{fields:{value:"text"}},t.extend(this.listCurrentOptions,this.listCurrentOptions,i,!0),"CheckBox"===this.mode&&this.notify("listoption",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,dataSource:e,fieldProperty:l}),this.listCurrentOptions},s.prototype.renderPopup=function(){var i=this;if(this.list||e.prototype.render.call(this),this.popupObj&&document.body.contains(this.popupObj.element)&&this.allowFiltering)return void this.refreshPopup();if(!this.popupObj&&!t.isNullOrUndefined(this.popupWrapper)){document.body.appendChild(this.popupWrapper);var s=this.popupWrapper.querySelector(".e-filter-parent");"CheckBox"===this.mode&&!this.allowFiltering&&s&&this.filterParent&&(s.remove(),this.filterParent=null);var l=parseInt(this.popupHeight,10);if(this.popupWrapper.style.visibility="hidden",this.headerTemplate&&(this.setHeaderTemplate(),l-=this.header.offsetHeight,this.isUpdateHeaderHeight=0!==this.header.offsetHeight),t.append([this.list],this.popupWrapper),!this.list.classList.contains(H.noData)&&this.getItems()[1]&&(this.listItemHeight=this.getItems()[1].offsetHeight+parseInt(window.getComputedStyle(this.getItems()[1]).marginBottom,10)),this.enableVirtualization&&!this.list.classList.contains(H.noData)){if(!this.list.querySelector(".e-virtual-ddl-content")&&this.list.querySelector(".e-list-parent")){var a=this.createElement("div",{className:"e-virtual-ddl-content"});a.style.cssText=this.getTransformValues(),this.list.appendChild(a).appendChild(this.list.querySelector(".e-list-parent"))}else this.list.querySelector(".e-virtual-ddl-content")&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues());if(this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+H.li),this.virtualItemCount=this.itemCount,"CheckBox"!==this.mode&&this.totalItemsCount(),this.list.querySelector(".e-virtual-ddl"))this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight();else{var r=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"});r.style.cssText=this.GetVirtualTrackHeight(),this.popupWrapper.querySelector(".e-dropdownbase").appendChild(r)}}if(this.footerTemplate&&(this.setFooterTemplate(),l-=this.footer.offsetHeight,this.isUpdateFooterHeight=0!==this.footer.offsetHeight),"CheckBox"===this.mode&&this.showSelectAll?(this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),l-=this.selectAllHeight):"CheckBox"!==this.mode||this.showSelectAll||this.headerTemplate||this.footerTemplate?"CheckBox"!==this.mode||this.showSelectAll||(this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),l=parseInt(this.popupHeight,10),this.headerTemplate&&this.header&&(l-=this.header.offsetHeight),this.footerTemplate&&this.footer&&(l-=this.footer.offsetHeight)):(this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),l=parseInt(this.popupHeight,10)),"CheckBox"===this.mode){var o={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,popupElement:this.popupWrapper};this.allowFiltering&&(this.notify("searchBox",o),l-=this.searchBoxHeight),t.addClass([this.popupWrapper],"e-checkbox")}"auto"!==this.popupHeight?(this.list.style.maxHeight=t.formatUnit(l),this.popupWrapper.style.maxHeight=t.formatUnit(this.popupHeight)):this.list.style.maxHeight=t.formatUnit(this.popupHeight),this.popupObj=new n.Popup(this.popupWrapper,{width:this.calcPopupWidth(),targetType:"relative",position:this.enableRtl?{X:"right",Y:"bottom"}:{X:"left",Y:"bottom"},relateTo:this.overAllWrapper,collision:this.enableRtl?{X:"fit",Y:"flip"}:{X:"flip",Y:"flip"},offsetY:1,enableRtl:this.enableRtl,zIndex:this.zIndex,close:function(){if(i.popupObj.element.parentElement){i.popupObj.unwireScrollEvents();var e=i.popupWrapper.querySelector(".e-input-filter");"CheckBox"===i.mode&&e&&document.activeElement===e&&e.blur(),t.detach(i.popupObj.element)}},open:function(){if(i.popupObj.resolveCollision(),!i.isFirstClick){var e=i.list.querySelector("ul");e&&("CheckBox"!==i.mode&&(i.allowFiltering||i.allowCustomValue)&&(""!==i.targetElement().trim()||""!==i.targetElement()&&i.allowCustomValue)||(i.mainList=e.cloneNode?e.cloneNode(!0):e)),i.isFirstClick=!0}i.popupObj.wireScrollEvents(),"CheckBox"!==i.mode&&(i.allowFiltering||i.allowCustomValue)&&(""!==i.targetElement().trim()||""!==i.targetElement()&&i.allowCustomValue)||i.enableVirtualization||(i.loadTemplate(),i.enableVirtualization&&"CheckBox"===i.mode&&i.UpdateSkeleton()),i.isPreventScrollAction=!0,i.setScrollPosition(),!i.list.classList.contains(H.noData)&&i.getItems()[1]&&0!==i.getItems()[1].offsetHeight&&(i.listItemHeight=i.getItems()[1].offsetHeight+parseInt(window.getComputedStyle(i.getItems()[1]).marginBottom,10),i.list.getElementsByClassName("e-virtual-ddl-content")[0]&&(i.list.getElementsByClassName("e-virtual-ddl-content")[0].style=i.getTransformValues())),i.allowFiltering&&i.notify("inputFocus",{module:"CheckBoxSelection",enable:"CheckBox"===i.mode,value:"focus"}),i.enableVirtualization&&(i.notify("bindScrollEvent",{module:"VirtualScroll",component:i.getModuleName(),enable:i.enableVirtualization}),setTimeout(function(){i.value?i.updateSelectionList():i.viewPortInfo&&i.viewPortInfo.offsets.top&&(i.list.scrollTop=i.viewPortInfo.offsets.top)},5))},targetExitViewport:function(){t.Browser.isDevice||i.hidePopup()}}),this.checkCollision(this.popupWrapper),this.popupContentElement=this.popupObj.element.querySelector(".e-content"),"CheckBox"===this.mode&&t.Browser.isDevice&&this.allowFiltering&&this.isDeviceFullScreen&&this.notify("deviceSearchBox",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),this.allowResize&&this.setResize(),this.popupObj.close(),this.popupWrapper.style.visibility=""}},s.prototype.checkCollision=function(e){"CheckBox"===this.mode&&t.Browser.isDevice&&this.allowFiltering&&this.isDeviceFullScreen||(n.isCollide(e).length>0&&(e.style.marginTop=-parseInt(getComputedStyle(e).marginTop,10)+"px"),this.popupObj.resolveCollision())},s.prototype.setHeaderTemplate=function(){var e;this.header&&this.header.remove(),this.header=this.createElement("div"),t.addClass([this.header],"e-ddl-header");var i=this.multiCompiler(this.headerTemplate),s=(e="function"!=typeof this.headerTemplate&&i?t.compile(t.select(this.headerTemplate,document).innerHTML.trim()):t.compile(this.headerTemplate))({},this,"headerTemplate",this.headerTemplateId,this.isStringTemplate,null,this.header);s&&s.length>0&&t.append(s,this.header),"CheckBox"===this.mode&&this.showSelectAll?t.prepend([this.header],this.popupWrapper):t.append([this.header],this.popupWrapper),t.EventHandler.add(this.header,"mousedown",this.onListMouseDown,this)},s.prototype.setFooterTemplate=function(){var e;this.footer&&this.footer.remove(),this.footer=this.createElement("div"),t.addClass([this.footer],"e-ddl-footer");var i=this.multiCompiler(this.footerTemplate),s=(e="function"!=typeof this.footerTemplate&&i?t.compile(t.select(this.footerTemplate,document).innerHTML.trim()):t.compile(this.footerTemplate))({},this,"footerTemplate",this.footerTemplateId,this.isStringTemplate,null,this.footer);s&&s.length>0&&t.append(s,this.footer),t.append([this.footer],this.popupWrapper),t.EventHandler.add(this.footer,"mousedown",this.onListMouseDown,this)},s.prototype.updateInitialData=function(){var e=this.selectData;this.renderItems(e,this.fields,!1,this.isClearAllAction);if(this.list.scrollTop=0,this.virtualListInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount},this.previousStartIndex=0,this.previousEndIndex=this.itemCount,this.dataSource instanceof i.DataManager?this.remoteDataCount>=0?this.totalItemCount=this.dataCount=this.remoteDataCount:this.resetList(this.dataSource):this.totalItemCount=this.dataCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.getSkeletonCount(),this.skeletonCount=0!==this.totalItemCount&&this.totalItemCount<2*this.itemCount&&(!(this.dataSource instanceof i.DataManager)||this.dataSource instanceof i.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,this.UpdateSkeleton(),this.list.getElementsByClassName("e-virtual-ddl")[0])this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight();else if(!this.list.querySelector(".e-virtual-ddl")&&this.skeletonCount>0){var t=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"});t.style.cssText=this.GetVirtualTrackHeight(),this.popupWrapper.querySelector(".e-dropdownbase").appendChild(t)}this.listData=e,this.liCollections=this.list.querySelectorAll(".e-list-item"),this.list.getElementsByClassName("e-virtual-ddl-content")[0]&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()),this.enableVirtualization&&this.notify("setGeneratedData",{module:"VirtualScroll"})},s.prototype.clearAll=function(e){if(this.enabled&&!this.readonly){var i=void 0;if(this.setDynValue=!1,this.isClearAllAction=!0,this.value&&this.value.length>0){this.allowFiltering&&(this.refreshListItems(null),"CheckBox"===this.mode&&this.targetInputElement&&(this.targetInputElement.value=""));var s=this.list&&this.list.querySelectorAll("li.e-list-item");if(s&&s.length>0)this.selectAllItems(!1,e);else for(this.removeIndex=0,i=this.value[this.removeIndex];this.removeIndex<this.value.length;i=this.value[this.removeIndex])this.removeValue(i,e,null,!0);this.selectedElementID=null,this.inputElement.removeAttribute("aria-activedescendant")}else this.clearAllCallback(e);this.checkAndResetCache(),null===this.element.querySelector(".e-multiselect .e-float-text-content")&&a.Input.createSpanElement(this.overAllWrapper,this.createElement),this.calculateWidth(),t.isNullOrUndefined(this.overAllWrapper)||t.isNullOrUndefined(this.overAllWrapper.getElementsByClassName("e-ddl-icon")[0]&&this.overAllWrapper.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType)||this.overAllWrapper.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon"),this.enableVirtualization&&(this.updateInitialData(),this.chipCollectionWrapper&&(this.chipCollectionWrapper.innerHTML=""),this.isCustomDataUpdated||this.notify("setGeneratedData",{module:"VirtualScroll"})),this.enableVirtualization&&(this.list.scrollTop=0,this.virtualListInfo=null,this.previousStartIndex=0,this.previousEndIndex=this.itemCount),this.isClearAllAction=!1}this.isClearAllItem=!0,t.EventHandler.add(document,"mouseup",this.preventSelection,this)},s.prototype.preventSelection=function(e){this.isClearAllItem&&e.stopPropagation(),this.isClearAllItem=!1,t.EventHandler.remove(document,"mouseup",this.preventSelection)},s.prototype.clearAllCallback=function(e,i){var s=this.value?this.value.slice():[];if(this.mainList&&this.listData&&(this.allowFiltering&&"CheckBox"!==this.mode||this.allowCustomValue)){var l=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.onActionComplete(l,this.mainData)}this.focusAtFirstListItem(),this.updateDelimeter(this.delimiterChar,e),"Box"===this.mode||this.inputFocus&&"CheckBox"!==this.mode||this.updateDelimView(),""!==this.inputElement.value&&(this.makeTextBoxEmpty(),this.search(null)),this.checkPlaceholderSize(),this.isPopupOpen()&&this.refreshPopup(),this.allowResize&&this.setResize(),this.inputFocus||(this.changeOnBlur&&this.updateValueState(e,this.value,s),"CheckBox"!==this.mode&&this.inputElement.focus()),"CheckBox"===this.mode&&(this.refreshPlaceHolder(),this.refreshInputHight(),this.changeOnBlur&&i&&(t.isNullOrUndefined(this.value)||0===this.value.length)&&this.updateValueState(e,this.value,this.tempValues)),this.changeOnBlur||!i||!t.isNullOrUndefined(this.value)&&0!==this.value.length||this.updateValueState(e,this.value,this.tempValues),"CheckBox"===this.mode&&this.enableGroupCheckBox&&!t.isNullOrUndefined(this.fields.groupBy)&&this.updateListItems(this.list.querySelectorAll("li.e-list-item"),this.mainList.querySelectorAll("li.e-list-item")),e.preventDefault()},s.prototype.windowResize=function(){this.refreshPopup(),this.inputFocus&&"CheckBox"!==this.mode||!this.viewWrapper||!this.viewWrapper.parentElement||this.updateDelimView()},s.prototype.resetValueHandler=function(e){if(!t.isNullOrUndefined(this.inputElement)){var i=t.closest(this.inputElement,"form");if(i&&e.target===i){var s=this.element.tagName===this.getNgDirective()?null:this.element.getAttribute("data-initial-value");this.text=s}}},s.prototype.wireEvent=function(){t.EventHandler.add(this.componentWrapper,"mousedown",this.wrapperClick,this),t.EventHandler.add(window,"resize",this.windowResize,this),t.EventHandler.add(this.inputElement,"focus",this.focusInHandler,this),t.EventHandler.add(this.inputElement,"keydown",this.onKeyDown,this),t.EventHandler.add(this.inputElement,"keyup",this.keyUp,this),"CheckBox"!==this.mode&&t.EventHandler.add(this.inputElement,"input",this.onInput,this),t.EventHandler.add(this.inputElement,"blur",this.onBlurHandler,this),t.EventHandler.add(this.componentWrapper,"mouseover",this.mouseIn,this);var e=t.closest(this.inputElement,"form");e&&t.EventHandler.add(e,"reset",this.resetValueHandler,this),t.EventHandler.add(this.componentWrapper,"mouseout",this.mouseOut,this),t.EventHandler.add(this.overAllClear,"mousedown",this.clearAll,this),t.EventHandler.add(this.inputElement,"paste",this.pasteHandler,this)},s.prototype.onInput=function(e){this.keyDownStatus?this.isValidKey=!0:this.isValidKey=!1,this.keyDownStatus=!1,t.Browser.isDevice&&"mozilla"===t.Browser.info.name&&this.search(e)},s.prototype.pasteHandler=function(e){var t=this;setTimeout(function(){t.expandTextbox(),t.search(e)})},s.prototype.performFiltering=function(e){var t=this,s={preventDefaultAction:!1,text:this.targetElement(),updateData:function(e,i,l){s.cancel||(t.isFiltered=!0,t.customFilterQuery=i,t.remoteFilterAction=!0,t.isCustomFiltering=!0,t.dataUpdater(e,i,l))},event:e,cancel:!1};this.trigger("filtering",s,function(e){t.isFilterPrevented=e.cancel,e.cancel||t.isFiltered||e.preventDefaultAction||(t.isFilterAction=!0,t.isFilteringAction=!0,t.dataSource instanceof i.DataManager&&t.allowCustomValue&&(t.isCustomRendered=!1),t.dataUpdater(t.dataSource,null,t.fields),t.isFilteringAction=!1)})},s.prototype.search=function(e){if(this.preventSetCurrentData=!1,this.firstItem=this.dataSource&&this.dataSource.length>0?this.dataSource[0]:null,t.isNullOrUndefined(e)||(this.keyCode=e.keyCode),!this.isPopupOpen()&&this.openOnClick&&this.showPopup(e),this.openClick(e),!this.checkTextLength()||this.allowFiltering||t.isNullOrUndefined(e)||8===e.keyCode){var s=this.targetElement();if(this.allowFiltering)this.allowCustomValue&&(this.isRemoteSelection=!0),this.checkAndResetCache(),this.isRequesting=!1,""!==this.targetElement()&&this.debounceDelay>0?this.debouncedFiltering(e,this.debounceDelay):this.performFiltering(e);else if(this.allowCustomValue){var l=new i.Query;l=this.allowFiltering&&""!==s?l.where(this.fields.text,"startswith",s,this.ignoreCase,this.ignoreAccent):l,this.enableVirtualization?this.dataUpdater(this.dataSource,l,this.fields):this.dataUpdater(this.mainData,l,this.fields),this.UpdateSkeleton()}else{var n=this.list.querySelectorAll("li."+H.li+":not(.e-hide-listitem)"),a=this.typeOfData(this.listData).typeof,r=u(this.targetElement(),n,"StartsWith",this.ignoreCase);if(this.enableVirtualization&&""!==this.targetElement().trim()&&!this.allowFiltering){var o=!1;for((this.viewPortInfo.endIndex>=this.incrementalEndIndex&&this.incrementalEndIndex<=this.totalItemCount||0===this.incrementalEndIndex)&&(o=!0,this.incrementalStartIndex=0,this.incrementalEndIndex=100>this.totalItemCount?this.totalItemCount:100,this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),o=!1),(0!==this.viewPortInfo.startIndex||o)&&this.updateIncrementalView(0,this.itemCount),r=u(this.targetElement(),this.incrementalLiCollections,this.filterType,!0,this.listData,this.fields,a);t.isNullOrUndefined(r)&&this.incrementalEndIndex<this.totalItemCount&&(this.incrementalStartIndex=this.incrementalEndIndex,this.incrementalEndIndex=this.incrementalEndIndex+100>this.totalItemCount?this.totalItemCount:this.incrementalEndIndex+100,this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),o=!0,(0!==this.viewPortInfo.startIndex||o)&&this.updateIncrementalView(0,this.itemCount),r=u(this.targetElement(),this.incrementalLiCollections,this.filterType,!0,this.listData,this.fields,a),t.isNullOrUndefined(r));)if(t.isNullOrUndefined(r)&&this.incrementalEndIndex>=this.totalItemCount){this.incrementalStartIndex=0,this.incrementalEndIndex=100>this.totalItemCount?this.totalItemCount:100;break}if(r.index&&!(this.viewPortInfo.startIndex>=r.index&&r.index>=this.viewPortInfo.endIndex)){p=(h=r.index-(this.itemCount/2-2)>0?r.index-(this.itemCount/2-2):0)+this.itemCount>this.totalItemCount?this.totalItemCount:h+this.itemCount;h!==this.viewPortInfo.startIndex&&this.updateIncrementalView(h,p)}if(t.isNullOrUndefined(r.item))this.updateIncrementalView(0,this.itemCount),this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.list.scrollTop=0;else{if(this.getIndexByValue(r.item.getAttribute("data-value"))-this.skeletonCount>this.itemCount/2){var h=this.viewPortInfo.startIndex+(this.itemCount/2-2)<this.totalItemCount?this.viewPortInfo.startIndex+(this.itemCount/2-2):this.totalItemCount,p=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount;this.updateIncrementalView(h,p)}r.item=this.getElementByValue(r.item.getAttribute("data-value"))}r&&r.item&&(r.item=this.getElementByValue(r.item.getAttribute("data-value")))}r&&r.item?(this.addListFocus(r.item),this.list.scrollTop=r.item.offsetHeight*r.index):""!==this.targetElement()?this.removeFocus():this.focusAtFirstListItem()}}else this.focusAtFirstListItem();this.enableVirtualization&&this.allowFiltering&&this.getFilteringSkeletonCount()},s.prototype.preRender=function(){null===this.allowFiltering&&(this.allowFiltering="CheckBox"===this.mode),this.preventSetCurrentData=!1,this.initializeData(),this.updateDataAttribute(this.htmlAttributes),e.prototype.preRender.call(this)},s.prototype.getLocaleName=function(){return"multi-select"},s.prototype.initializeData=function(){this.mainListCollection=[],this.beforePopupOpen=!1,this.isFilterAction=!1,this.remoteFilterAction=!1,this.isFirstClick=!1,this.mobFilter=!0,this.isFiltered=!1,this.focused=!0,this.initial=!0,this.backCommand=!0,this.isCustomRendered=!1,this.isRemoteSelection=!1,this.isSelectAllTarget=!0,this.isaddNonPresentItems=!1,this.viewPortInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount}},s.prototype.updateData=function(e,i,s){var l,n="",a="Delimiter"===this.mode||"CheckBox"===this.mode,r=[],o=this.listData;if(this.enableVirtualization||(this.listData=this.mainData),t.isNullOrUndefined(this.hiddenElement)||this.enableVirtualization||(this.hiddenElement.innerHTML=""),!t.isNullOrUndefined(this.value)){for(var h,u=this.value.length,p="",d=this,c=0;c<u;c++){var m=function(o){var c=d.allowObjectBinding?t.getValue(d.fields.value?d.fields.value:"",d.value[o]):d.value[o],m=d.findListElement(t.isNullOrUndefined(d.mainList)?d.ulElement:d.mainList,"li","data-value",c);if(d.enableVirtualization&&(m=d.findListElement(t.isNullOrUndefined(d.list)?d.ulElement:d.list,"li","data-value",c)),t.isNullOrUndefined(m)&&!d.allowCustomValue&&!d.enableVirtualization&&d.listData&&d.listData.length>0)d.value.splice(o,1),o-=1,u-=1;else{if(d.listData){if(d.enableVirtualization){!a||d.isDynamicRemoteVirtualData||s||(n=d.delimiterWrapper&&""===d.delimiterWrapper.innerHTML?n:d.delimiterWrapper.innerHTML);var f=d.allowObjectBinding?t.getValue(d.fields.value?d.fields.value:"",d.value[d.value.length-1]):d.value[d.value.length-1];if(d.isRemoveSelection)n=d.text.replace(/,/g,e+" ")+e+" ",r=d.text.split(e);else{l=s&&a?d.text.replace(/,/g,e+" "):d.getTextByValue(f);var v=d.isDynamicRemoteVirtualData&&null!=f&&""!==f&&!s?d.getTextByValue(f):s?d.text:d.text&&""!==d.text?d.text+d.delimiterChar+l:l;n+=l+e+" ",r.push(v),p=d.hiddenElement.innerHTML}if(i&&i.currentTarget&&i.currentTarget.classList.contains("e-chips-close")||i&&"Backspace"===i.key){var g=i.target.parentElement.getAttribute("data-value");if("Backspace"===i.key){var y=d.hiddenElement.lastChild;y&&d.hiddenElement.removeChild(y)}else d.hiddenElement.childNodes.forEach(function(e){e.value===g&&e.parentNode.removeChild(e)});p=d.hiddenElement.innerHTML}else p+="<option selected value='"+f+"'>"+o+"</option>";return h=o,"break"}l=d.getTextByValue(c)}else l=c;n+=l+e+" ",r.push(l)}p+='<option selected value="'+c+'">'+o+"</option>",h=o}(c);if(c=h,"break"===m)break}t.isNullOrUndefined(this.hiddenElement)||(this.isRemoveSelection?(this.findListElement(this.hiddenElement,"option","value",this.currentRemoveValue)&&this.hiddenElement.removeChild(this.findListElement(this.hiddenElement,"option","value",this.currentRemoveValue)),this.isRemoveSelection=!1):this.hiddenElement.innerHTML=p)}var f=i&&i.target&&i.target.classList.contains("e-chips-close");(!this.enableVirtualization||this.enableVirtualization&&"CheckBox"!==this.mode&&!f)&&this.setProperties({text:r.toString()},!0),a&&(this.updateWrapperText(this.delimiterWrapper,n),this.delimiterWrapper.setAttribute("id",t.getUniqueID("delim_val")),this.inputElement.setAttribute("aria-describedby",this.delimiterWrapper.id));var v=i&&i.target,g=!(!v||!v.classList.contains("e-close-hooker"))||null;(!this.changeOnBlur&&i&&!g||this.isSelectAll)&&(this.isSelectAll=!1,this.updateValueState(i,this.value,this.tempValues)),this.listData=o,this.addValidInputClass()},s.prototype.initialTextUpdate=function(){if(t.isNullOrUndefined(this.text))this.setProperties({value:null},!0);else{for(var e=this.text.split(this.delimiterChar),i=[],s=0;e.length>s;s++){var l=this.getValueByText(e[s]);t.isNullOrUndefined(l)?this.allowCustomValue&&i.push(e[s]):i.push(l)}if(i&&i.length){var n=this.allowObjectBinding?this.getDataByValue(i):i;this.setProperties({value:n},!0)}}},s.prototype.renderList=function(t){!t&&this.allowCustomValue&&this.list&&(this.list.textContent===this.noRecordsTemplate||this.list.querySelector(".e-ul")&&0===this.list.querySelector(".e-ul").childElementCount)&&(t=!0),e.prototype.render.call(this,null,t),this.totalItemCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.unwireListEvents(),this.wireListEvents()},s.prototype.initialValueUpdate=function(e,s){if(this.list){var l=void 0,n=void 0,a=void 0;if(this.chipCollectionWrapper&&(this.chipCollectionWrapper.innerHTML=""),this.removeListSelection(),!t.isNullOrUndefined(this.value))for(var r=0;!t.isNullOrUndefined(this.value[r]);r++){a=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",this.value[r]):this.value[r],n=this.findListElement(this.hideSelectedItem?this.ulElement:this.list,"li","data-value",a);var o=!1;if(this.enableVirtualization){if(l=null,null!=e&&e.length>0)for(var h=0;h<e.length;h++)if(this.isPrimitiveData&&e[h]===a||!this.isPrimitiveData&&t.getValue(this.fields.value?this.fields.value:"value",e[h])===a){l=this.isPrimitiveData?e[h]:t.getValue(this.fields.text,e[h]),this.enableVirtualization&&(t.isNullOrUndefined(this.selectedListData)?this.selectedListData=[e[h]]:(this.allowObjectBinding&&!this.isObjectInArray(e[h],this.selectedListData)||!this.allowObjectBinding)&&(Array.isArray(this.selectedListData)?this.selectedListData.push(e[h]):this.selectedListData=[this.selectedListData,e[h]]));break}t.isNullOrUndefined(l)&&this.allowCustomValue&&(!(this.dataSource instanceof i.DataManager)||this.dataSource instanceof i.DataManager&&s)?(l=this.getTextByValue(a),o=!0):!t.isNullOrUndefined(l)||this.allowCustomValue||this.dataSource instanceof i.DataManager&&!(this.dataSource instanceof i.DataManager&&s)||(this.value.splice(r,1),r-=1)}else l=this.getTextByValue(a);if(n&&"true"!==n.getAttribute("aria-selected")||n&&"true"===n.getAttribute("aria-selected")&&this.hideSelectedItem&&("Box"===this.mode||"Default"===this.mode)||this.enableVirtualization&&null!=a&&null!=l&&!o){var u=[],p=this.isDynamicRemoteVirtualData&&null!=l&&""!==l&&0===r?l:null==this.text||""===this.text||this.text.includes(l)?l:this.text+this.delimiterChar+l;u.push(p),this.setProperties({text:u.toString()},!0),this.addChip(l,a),this.addListSelection(n)}else if(!this.enableVirtualization&&a&&this.allowCustomValue||this.enableVirtualization&&a&&this.allowCustomValue&&(!(this.dataSource instanceof i.DataManager)||this.dataSource instanceof i.DataManager&&s)){var d=this.listData.length,c={};t.setValue(this.fields.text,a,c),t.setValue(this.fields.value,a,c);var m=this.popupWrapper.querySelector("."+H.noData);this.enableVirtualization||this.addItem(c,d),this.enableVirtualization&&(this.virtualCustomSelectData&&this.virtualCustomSelectData.length>=0?this.virtualCustomSelectData.push(c):this.virtualCustomSelectData=[c]),n=n||this.findListElement(this.hideSelectedItem?this.ulElement:this.list,"li","data-value",a),this.popupWrapper.contains(m)&&(this.list.setAttribute("style",m.getAttribute("style")),this.popupWrapper.replaceChild(this.list,m),this.wireListEvents());var u=[],p=null!=this.text&&""!==this.text?this.text+this.delimiterChar+l:l;u.push(p),this.setProperties({text:u.toString()},!0),this.addChip(l,a),this.addListSelection(n)}}"CheckBox"===this.mode?(this.updateDelimView(),this.changeOnBlur&&this.updateValueState(null,this.value,this.tempValues),this.updateDelimeter(this.delimiterChar),this.refreshInputHight()):this.updateDelimeter(this.delimiterChar,null,s),"CheckBox"!==this.mode||!this.showSelectAll||!t.isNullOrUndefined(this.value)&&this.value.length||this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"uncheck"}),"Box"===this.mode||"Default"===this.mode&&this.inputFocus?this.chipCollectionWrapper.style.display="":"Delimiter"!==this.mode&&"CheckBox"!==this.mode||this.showDelimWrapper()}},s.prototype.updateActionCompleteData=function(e,i){this.value&&(!this.allowObjectBinding&&this.value.indexOf(e.getAttribute("data-value"))>-1||this.allowObjectBinding&&this.isObjectInArray(this.getDataByValue(e.getAttribute("data-value")),this.value))&&(this.mainList=this.ulElement,this.hideSelectedItem&&t.addClass([e],ge))},s.prototype.updateAddItemList=function(e,i){this.popupObj&&this.popupObj.element&&this.popupObj.element.querySelector("."+H.noData)&&e?(this.list=e,this.mainList=this.ulElement=e.querySelector("ul"),t.remove(this.popupWrapper.querySelector(".e-content")),this.popupObj=null,this.renderPopup()):this.allowCustomValue&&(this.list=e,this.mainList=this.ulElement=e.querySelector("ul"))},s.prototype.updateDataList=function(){if(this.mainList&&this.ulElement&&!(this.isFiltered||this.isFilterAction||this.targetElement().trim())){var e=this.mainList.childElementCount<this.ulElement.childElementCount,t=this.ulElement.childElementCount>0&&this.ulElement.children[0].childElementCount>0&&this.mainList.children[0]&&this.mainList.children[0].childElementCount<this.ulElement.children[0].childElementCount,i=this.itemTemplate&&this.ulElement.childElementCount>0&&!(this.ulElement.childElementCount<this.mainList.childElementCount)&&(this.ulElement.children[0].childElementCount>0||this.fields.groupBy&&this.ulElement.children[1]&&this.ulElement.children[1].childElementCount>0);(e||t||i)&&(this.mainList=this.ulElement)}},s.prototype.isValidLI=function(e){return e&&!e.classList.contains(H.disabled)&&!e.classList.contains(H.group)&&e.classList.contains(H.li)},s.prototype.updateListSelection=function(e,i,s){var l=e.getAttribute("data-value"),n=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(l)):this.getFormattedValue(l);this.allowCustomValue&&("false"!==l&&!1===n||!t.isNullOrUndefined(n)&&"NaN"===n.toString())&&(n=l),this.removeHover(),!this.value||!this.allowObjectBinding&&-1===this.value.indexOf(n)||this.allowObjectBinding&&-1===this.indexOfObjectInArray(n,this.value)?this.dispatchSelect(n,i,e,"true"===e.getAttribute("aria-selected"),s):this.removeValue(n,i,s),this.checkAndScrollParent()},s.prototype.updateListSelectEventCallback=function(e,i,s,l){var n=this;e=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",e):e;var a=l||this.getTextByValue(e);if((this.allowCustomValue||this.allowFiltering)&&!this.findListElement(this.mainList,"li","data-value",e)&&(!this.enableVirtualization||this.enableVirtualization&&this.virtualCustomData)){var r=i?i.cloneNode(!0):i,o=this.fields.value?this.fields.value:"value";this.allowCustomValue&&this.mainData.length&&"number"==typeof t.getValue(o,this.mainData[0])&&(e=isNaN(parseFloat(e.toString()))?e:parseFloat(e.toString()));var h=this.getDataByValue(e),u={newData:h,cancel:!1};this.trigger("customValueSelection",u,function(i){i.cancel||(n.enableVirtualization&&n.virtualCustomData?(n.virtualCustomSelectData&&n.virtualCustomSelectData.length>=0?n.virtualCustomSelectData.push(h):n.virtualCustomSelectData=[h],n.remoteCustomValue=!1,n.addValue(e,a,s)):(t.append([r],n.mainList),n.mainData.push(h),n.remoteCustomValue=!1,n.addValue(e,a,s)))})}else this.remoteCustomValue=!1,this.addValue(e,a,s)},s.prototype.removeListSelection=function(){var e=this.hideSelectedItem?ge:H.selected,i=this.list.querySelectorAll("."+e),s=i.length;if(i&&i.length)for(t.removeClass(i,e);s>0;)i[s-1].setAttribute("aria-selected","false"),"CheckBox"===this.mode&&i&&i.length>s-1&&t.removeClass([i[s-1].firstElementChild.lastElementChild],"e-check"),s--;if(!t.isNullOrUndefined(this.mainList)){var l=this.mainList.querySelectorAll("."+e),n=l.length;if(l&&l.length)for(t.removeClass(l,e);n>0;)l[n-1].setAttribute("aria-selected","false"),"CheckBox"===this.mode&&(i&&i.length>n-1&&t.removeClass([i[n-1].firstElementChild.lastElementChild],"e-check"),t.removeClass([l[n-1].firstElementChild.lastElementChild],"e-check")),n--}},s.prototype.removeHover=function(){var e=this.list.querySelectorAll("."+H.hover);e&&e.length&&t.removeClass(e,H.hover)},s.prototype.removeFocus=function(){if(this.list&&this.mainList){var e=this.list.querySelectorAll("."+H.focus),i=this.mainList.querySelectorAll("."+H.focus);e&&e.length&&(t.removeClass(e,H.focus),t.removeClass(i,H.focus))}},s.prototype.addListHover=function(e){this.enabled&&this.isValidLI(e)?(this.removeHover(),t.addClass([e],H.hover)):null!==e&&e.classList.contains("e-list-group-item")&&this.enableGroupCheckBox&&"CheckBox"===this.mode&&!t.isNullOrUndefined(this.fields.groupBy)&&(this.removeHover(),t.addClass([e],H.hover))},s.prototype.addListFocus=function(e){this.enabled&&(this.isValidLI(e)||this.fields.disabled&&this.isDisabledElement(e))?(this.removeFocus(),t.addClass([e],H.focus),this.updateAriaActiveDescendant()):this.enableGroupCheckBox&&"CheckBox"===this.mode&&!t.isNullOrUndefined(this.fields.groupBy)&&(t.addClass([e],H.focus),this.updateAriaActiveDescendant())},s.prototype.addListSelection=function(e,i){var s=this.hideSelectedItem?ge:H.selected;this.isValidLI(e)&&!e.classList.contains(H.hover)&&(t.addClass([e],s),this.updateMainList(!1,e.getAttribute("data-value"),i),e.setAttribute("aria-selected","true"),"CheckBox"===this.mode&&e.classList.contains("e-active")&&0===e.getElementsByClassName("e-check").length&&this.notify("updatelist",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:e,e:this}),this.notify("activeList",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:e,e:this}),this.chipCollectionWrapper&&this.removeChipSelection(),this.selectedElementID=e.id)},s.prototype.updateDelimeter=function(e,t,i){this.updateData(e,t,i)},s.prototype.onMouseClick=function(e){var i=this;if(!this.isClearAllItem){this.keyCode=null,this.scrollFocusStatus=!1,this.keyboardEvent=null;var s=e.target,l=t.closest(s,"."+H.li);if(this.enableVirtualization&&l&&l.classList.contains("e-virtual-list"))return;if(t.closest(s,"."+H.group)&&this.enableGroupCheckBox&&"CheckBox"===this.mode&&this.fields.groupBy)(s=s.classList.contains("e-list-group-item")?s.firstElementChild.lastElementChild:e.target).classList.contains("e-check")?(this.selectAllItem(!1,e),s.classList.remove("e-check"),s.classList.remove("e-stop"),t.closest(s,".e-list-group-item").classList.remove("e-active"),s.setAttribute("aria-selected","false")):(this.selectAllItem(!0,e),s.classList.remove("e-stop"),s.classList.add("e-check"),t.closest(s,".e-list-group-item").classList.add("e-active"),s.setAttribute("aria-selected","true")),this.refreshSelection(),this.checkSelectAll();else{if(this.isValidLI(l)){var n=this.value&&this.value.length?this.value.length:0;l.classList.contains("e-active")&&(n-=1),n<this.maximumSelectionLength&&(this.updateListSelection(l,e),this.checkPlaceholderSize(),this.addListFocus(l),(this.allowCustomValue||this.allowFiltering)&&this.mainList&&this.listData?"CheckBox"!==this.mode&&(this.focusAtLastListItem(l.getAttribute("data-value")),this.refreshSelection()):this.makeTextBoxEmpty()),"CheckBox"===this.mode?(this.updateDelimView(),this.value&&this.value.length>50?setTimeout(function(){i.updateDelimeter(i.delimiterChar,e)},0):this.updateDelimeter(this.delimiterChar,e),this.refreshInputHight()):this.updateDelimeter(this.delimiterChar,e),this.checkSelectAll(),this.refreshPopup(),this.allowResize&&this.setResize(),this.hideSelectedItem&&this.focusAtFirstListItem(),this.closePopupOnSelect?this.hidePopup(e):e.preventDefault();var a=""!==this.targetElement().trim();this.makeTextBoxEmpty(),this.findGroupStart(s),"CheckBox"!==this.mode&&this.refreshListItems(t.isNullOrUndefined(l)?null:l.textContent,a)}else e.preventDefault();if(this.enableVirtualization&&this.hideSelectedItem){var r=this.list.querySelectorAll("li."+H.li+":not(."+ge+"):not(.e-reorder-hide):not(.e-virtual-list)");if(r.length){var o=this.virtualListHeight>0?Math.floor(this.virtualListHeight/this.listItemHeight):0;if(r.length<o+2){var h=this.getForQuery(this.value).clone();if(h=h.skip(this.virtualItemStartIndex),this.resetList(this.dataSource,this.fields,h),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+H.li),this.virtualItemCount=this.itemCount,"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.list.querySelector(".e-virtual-ddl"))this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight();else{var u=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"});u.style.cssText=this.GetVirtualTrackHeight(),this.popupWrapper.querySelector(".e-dropdownbase").appendChild(u)}this.list.querySelector(".e-virtual-ddl-content")&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues())}}}this.refreshPlaceHolder(),this.deselectHeader()}}},s.prototype.findGroupStart=function(e){if(this.enableGroupCheckBox&&"CheckBox"===this.mode&&!t.isNullOrUndefined(this.fields.groupBy)){var i=void 0;if(this.itemTemplate&&!e.getElementsByClassName("e-frame").length)for(;!e.getElementsByClassName("e-frame").length;)e=e.parentElement;for(e.classList.contains("e-frame")&&(e=e.parentElement.parentElement),i=this.findGroupAttrtibutes(e,0,0,0,0),i=this.findGroupAttrtibutes(e,i[0],i[1],i[2],1);!e.classList.contains("e-list-group-item")&&(e.classList.contains("e-list-icon")&&(e=e.parentElement),null!=(e=e.previousElementSibling)););this.updateCheckBox(e,i[0],i[1],i[2])}},s.prototype.findGroupAttrtibutes=function(e,t,i,s,l){for(;!e.classList.contains("e-list-group-item")&&(this.fields.disabled&&this.isDisabledElement(e)||(e.classList.contains("e-list-icon")&&(e=e.parentElement),e.getElementsByClassName("e-frame")[0].classList.contains("e-check")&&e.classList.contains("e-list-item")?t++:e.classList.contains("e-list-item")&&i++,s++),null!=(e=l?e.nextElementSibling:e.previousElementSibling)););return[t,i,s]},s.prototype.updateCheckBox=function(e,i,s,l){if(null!==e&&(t.isNullOrUndefined(this.fields.disabled)||0!==l)){var n=e.getElementsByClassName("e-frame")[0];l===i?(n.classList.remove("e-stop"),n.classList.add("e-check"),t.closest(n,".e-list-group-item").classList.add("e-active"),e.setAttribute("aria-selected","true")):l===s?(n.classList.remove("e-check"),n.classList.remove("e-stop"),t.closest(n,".e-list-group-item").classList.remove("e-active"),e.setAttribute("aria-selected","false")):this.maximumSelectionLength===i-1?(n.classList.remove("e-stop"),e.setAttribute("aria-selected","true"),t.closest(n,".e-list-group-item").classList.add("e-active"),n.classList.add("e-check")):(n.classList.remove("e-check"),n.classList.add("e-stop"),t.closest(n,".e-list-group-item").classList.add("e-active"),e.setAttribute("aria-selected","false"))}},s.prototype.disableGroupHeader=function(){var e=this.list.querySelectorAll("li.e-list-group-item");if(e)for(var t=0;t<e.length;t++){for(var i=!0,s=e[t].nextElementSibling;!s.classList.contains("e-list-group-item");){if(!this.isDisabledElement(s)){i=!1;break}if(null==(s=s.nextElementSibling))break}i&&this.disableListItem(e[t])}},s.prototype.deselectHeader=function(){var e=this.value&&this.value.length?this.value.length:0,i=this.list.querySelectorAll("li.e-list-group-item:not(.e-active)");e<this.maximumSelectionLength&&t.removeClass(i,"e-disable"),e===this.maximumSelectionLength&&t.addClass(i,"e-disable")},s.prototype.onMouseOver=function(e){var i=t.closest(e.target,"."+H.li);null===i&&"CheckBox"===this.mode&&!t.isNullOrUndefined(this.fields.groupBy)&&this.enableGroupCheckBox&&(i=t.closest(e.target,"."+H.group)),this.addListHover(i)},s.prototype.onMouseLeave=function(){this.removeHover()},s.prototype.onListMouseDown=function(e){e.preventDefault(),this.scrollFocusStatus=!0},s.prototype.onDocumentClick=function(e){if("CheckBox"!==this.mode){var i=e.target;!t.isNullOrUndefined(this.popupObj)&&t.closest(i,'[id="'+this.popupObj.element.id+'"]')||this.overAllWrapper.contains(e.target)?this.scrollFocusStatus=(t.Browser.isIE||"edge"===t.Browser.info.name)&&document.activeElement===this.inputElement:this.scrollFocusStatus=!1}},s.prototype.wireListEvents=function(){t.isNullOrUndefined(this.list)||(t.EventHandler.add(document,"mousedown",this.onDocumentClick,this),t.EventHandler.add(this.list,"mousedown",this.onListMouseDown,this),t.EventHandler.add(this.list,"mouseup",this.onMouseClick,this),t.EventHandler.add(this.list,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.list,"mouseout",this.onMouseLeave,this))},s.prototype.unwireListEvents=function(){t.EventHandler.remove(document,"mousedown",this.onDocumentClick),this.list&&(t.EventHandler.remove(this.list,"mousedown",this.onListMouseDown),t.EventHandler.remove(this.list,"mouseup",this.onMouseClick),t.EventHandler.remove(this.list,"mouseover",this.onMouseOver),t.EventHandler.remove(this.list,"mouseout",this.onMouseLeave))},s.prototype.hideOverAllClear=function(){this.value&&this.value.length&&""!==this.inputElement.value||(this.overAllClear.style.display="none")},s.prototype.showOverAllClear=function(){(this.value&&this.value.length||""!==this.inputElement.value)&&this.showClearButton&&!0!==this.readonly?this.overAllClear.style.display="":this.overAllClear.style.display="none"},s.prototype.focusIn=function(){document.activeElement!==this.inputElement&&this.enabled&&this.inputElement.focus()},s.prototype.focusOut=function(){document.activeElement===this.inputElement&&this.enabled&&this.inputElement.blur()},s.prototype.showSpinner=function(){if(t.isNullOrUndefined(this.spinnerElement)){var e=this.filterParent&&this.filterParent.querySelector(".e-clear-icon.e-icons");"none"!==this.overAllClear.style.display||e?this.spinnerElement=e||this.overAllClear:(this.spinnerElement=this.createElement("span",{className:"e-chips-close e-close-hooker e-ms-spinner-icon"}),this.componentWrapper.appendChild(this.spinnerElement)),n.createSpinner({target:this.spinnerElement,width:t.Browser.isDevice?"16px":"14px"},this.createElement),t.addClass([this.spinnerElement],"e-ddl-disable-icon"),n.showSpinner(this.spinnerElement)}},s.prototype.hideSpinner=function(){t.isNullOrUndefined(this.spinnerElement)||(n.hideSpinner(this.spinnerElement),t.removeClass([this.spinnerElement],"e-ddl-disable-icon"),this.spinnerElement.classList.contains("e-ms-spinner-icon")?t.detach(this.spinnerElement):this.spinnerElement.innerHTML="",this.spinnerElement=null)},s.prototype.updateWrapperText=function(e,t){this.valueTemplate||!this.enableHtmlSanitizer?e.innerHTML=this.encodeHtmlEntities(t):e.innerText=t},s.prototype.updateDelimView=function(){if(this.delimiterWrapper&&this.hideDelimWrapper(),this.chipCollectionWrapper&&(this.chipCollectionWrapper.style.display="none"),t.isNullOrUndefined(this.viewWrapper)||(this.viewWrapper.style.display="",this.viewWrapper.style.width="",this.viewWrapper.classList.remove("e-delim-total")),this.value&&this.value.length){var e="",i=void 0,s=void 0,l=1,n=void 0,a=void 0,r=0,o=void 0;this.enableVirtualization||this.updateWrapperText(this.viewWrapper,e);var h={noRecordsTemplate:"No records found",actionFailureTemplate:"Request failed",overflowCountTemplate:"+${count} more..",totalCountTemplate:"${count} selected"},u=new t.L10n(this.getLocaleName(),h,this.locale);""===u.getConstant("actionFailureTemplate")&&(u=new t.L10n("dropdowns",h,this.locale)),""===u.getConstant("noRecordsTemplate")&&(u=new t.L10n("dropdowns",h,this.locale));var p=u.getConstant("overflowCountTemplate"),d=u.getConstant("totalCountTemplate"),c=this.createElement("span",{className:"e-remain"}),m=p.replace("${count}",this.value.length.toString());c.innerText=m,this.viewWrapper.appendChild(c),this.renderReactTemplates();var f=c.offsetWidth;if(t.remove(c),this.showDropDownIcon&&(r=this.dropIcon.offsetWidth+parseInt(window.getComputedStyle(this.dropIcon).marginRight,10)),this.checkClearIconWidth(),!t.isNullOrUndefined(this.value)&&(this.allowCustomValue||this.listData&&this.listData.length>0))for(var v=0;!t.isNullOrUndefined(this.value[v]);v++){var g=this.text&&this.text.split(this.delimiterChar);if(this.enableVirtualization?g&&(e+=0===v?"":this.delimiterChar+" ",e+=i=g[v],i=this.viewWrapper.innerHTML,this.updateWrapperText(this.viewWrapper,e)):(e+=0===v?"":this.delimiterChar+" ",e+=i=this.getOverflowVal(v),i=this.viewWrapper.innerHTML,this.updateWrapperText(this.viewWrapper,e)),n=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10)+parseInt(window.getComputedStyle(this.viewWrapper).paddingLeft,10),o=this.componentWrapper.offsetWidth-parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft,10)-parseInt(window.getComputedStyle(this.componentWrapper).paddingRight,10),n+r+this.clearIconWidth>o){for(void 0!==s&&""!==s&&(i=s,v=l+1),this.updateWrapperText(this.viewWrapper,i),a=this.value.length-v,n=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10)+parseInt(window.getComputedStyle(this.viewWrapper).paddingLeft,10);n+f+r+this.clearIconWidth>o&&0!==n&&""!==this.viewWrapper.innerHTML;){var y=[];this.viewWrapper.innerHTML=y.join(this.delimiterChar),a=this.value.length,n=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10)+parseInt(window.getComputedStyle(this.viewWrapper).paddingLeft,10)}break}n+f+r+this.clearIconWidth<=o?(s=e,l=v):0===v&&(s="",l=-1)}if(a>0){var C=o-r-this.clearIconWidth;this.viewWrapper.appendChild(this.updateRemainTemplate(c,this.viewWrapper,a,p,d,C)),this.updateRemainWidth(this.viewWrapper,C),this.updateRemainingText(c,r,a,p,d)}}else t.isNullOrUndefined(this.viewWrapper)||(this.viewWrapper.innerHTML="",this.viewWrapper.style.display="none")},s.prototype.checkClearIconWidth=function(){this.showClearButton&&(this.clearIconWidth=parseInt(window.getComputedStyle(this.overAllClear).width,10)||this.overAllClear.offsetWidth)},s.prototype.updateRemainWidth=function(e,t){e.classList.contains("e-delim-total")&&t<e.offsetWidth+parseInt(window.getComputedStyle(e).paddingLeft,10)+parseInt(window.getComputedStyle(e).paddingRight,10)&&(e.style.width=t+"px")},s.prototype.updateRemainTemplate=function(e,t,i,s,l,n){t.firstChild&&3===t.firstChild.nodeType&&""===t.firstChild.nodeValue&&t.removeChild(t.firstChild),e.innerHTML="";var a=s.replace("${count}",i.toString()),r=l.replace("${count}",i.toString());return e.innerText=t.firstChild&&3===t.firstChild.nodeType?a:r,t.firstChild&&3===t.firstChild.nodeType?t.classList.remove("e-delim-total"):(t.classList.add("e-delim-total"),this.updateRemainWidth(t,n)),e},s.prototype.updateRemainingText=function(e,t,i,s,l){var n=this.componentWrapper.offsetWidth-parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft,10)-parseInt(window.getComputedStyle(this.componentWrapper).paddingRight,10),a=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10);if(a+t>=n&&0!==a&&this.viewWrapper.firstChild&&3===this.viewWrapper.firstChild.nodeType){for(;a+t>n&&0!==a&&this.viewWrapper.firstChild&&3===this.viewWrapper.firstChild.nodeType;){var r=this.viewWrapper.firstChild.nodeValue.split(this.delimiterChar);r.pop(),this.viewWrapper.firstChild.nodeValue=r.join(this.delimiterChar),""===this.viewWrapper.firstChild.nodeValue&&this.viewWrapper.removeChild(this.viewWrapper.firstChild),i++,a=this.viewWrapper.offsetWidth}var o=n-t;this.updateRemainTemplate(e,this.viewWrapper,i,s,l,o)}},s.prototype.getOverflowVal=function(e){var i;if(this.mainData&&this.mainData.length){var s=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",this.value[e]):this.value[e];if("CheckBox"===this.mode){var l=this.listData;this.listData=this.mainData,i=this.getTextByValue(s),this.listData=l}else i=this.getTextByValue(s)}else i=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",this.value[e]):this.value[e];return i},s.prototype.unWireEvent=function(){if(t.isNullOrUndefined(this.componentWrapper)||t.EventHandler.remove(this.componentWrapper,"mousedown",this.wrapperClick),t.EventHandler.remove(window,"resize",this.windowResize),!t.isNullOrUndefined(this.inputElement)){t.EventHandler.remove(this.inputElement,"focus",this.focusInHandler),t.EventHandler.remove(this.inputElement,"keydown",this.onKeyDown),"CheckBox"!==this.mode&&t.EventHandler.remove(this.inputElement,"input",this.onInput),t.EventHandler.remove(this.inputElement,"keyup",this.keyUp);var e=t.closest(this.inputElement,"form");e&&t.EventHandler.remove(e,"reset",this.resetValueHandler),t.EventHandler.remove(this.inputElement,"blur",this.onBlurHandler)}t.isNullOrUndefined(this.componentWrapper)||(t.EventHandler.remove(this.componentWrapper,"mouseover",this.mouseIn),t.EventHandler.remove(this.componentWrapper,"mouseout",this.mouseOut)),t.isNullOrUndefined(this.overAllClear)||t.EventHandler.remove(this.overAllClear,"mousedown",this.clearAll),t.isNullOrUndefined(this.inputElement)||t.EventHandler.remove(this.inputElement,"paste",this.pasteHandler)},s.prototype.resizingWireEvent=function(){t.EventHandler.add(document,"mousemove",this.resizePopup,this),t.EventHandler.add(document,"mouseup",this.stopResizing,this),t.EventHandler.add(document,"touchmove",this.resizePopup,this),t.EventHandler.add(document,"touchend",this.stopResizing,this)},s.prototype.resizingUnWireEvent=function(){t.EventHandler.remove(document,"mousemove",this.resizePopup),t.EventHandler.remove(document,"mouseup",this.stopResizing),t.EventHandler.remove(document,"touchmove",this.resizePopup),t.EventHandler.remove(document,"touchend",this.stopResizing)},s.prototype.selectAllItem=function(e,i,s){var l;if(t.isNullOrUndefined(this.list)||(l=this.list.querySelectorAll(e?'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)':'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)')),this.value&&this.value.length&&i&&i.target&&t.closest(i.target,".e-close-hooker")&&this.allowFiltering&&(l=this.mainList.querySelectorAll(e?'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)':'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)')),this.enableGroupCheckBox&&"CheckBox"===this.mode&&!t.isNullOrUndefined(this.fields.groupBy)){var n=i?this.groupTemplate?t.closest(i.target,".e-list-group-item"):i.target:null;if(n=i&&32===i.keyCode?s:n,(n=n&&n.classList.contains("e-frame")?n.parentElement.parentElement:n)&&n.classList.contains("e-list-group-item")){var a=n.nextElementSibling;if(t.isNullOrUndefined(a))return;for(;a.classList.contains("e-list-item");){if(!this.fields.disabled||!this.isDisabledElement(a))if(e){if(!a.firstElementChild.lastElementChild.classList.contains("e-check")){var r=this.value&&this.value.length?this.value.length:0;a.classList.contains("e-active")&&(r-=1),r<this.maximumSelectionLength&&this.updateListSelection(a,i)}}else a.firstElementChild.lastElementChild.classList.contains("e-check")&&this.updateListSelection(a,i);if(null==(a=a.nextElementSibling))break}if(n.classList.contains("e-list-group-item")){var o=this.list.getElementsByClassName("e-item-focus")[0];o&&o.classList.remove("e-item-focus"),e?n.classList.add("e-active"):n.classList.remove("e-active"),n.classList.add("e-item-focus"),this.updateAriaActiveDescendant()}this.textboxValueUpdate(),this.checkPlaceholderSize(),!this.changeOnBlur&&i&&this.updateValueState(i,this.value,this.tempValues)}else this.updateValue(i,l,e)}else this.updateValue(i,l,e);this.addValidInputClass()},s.prototype.virtualSelectionAll=function(e,i,s){var l=this,n=0,a=i.length,r=this.maximumSelectionLength;if(e){this.virtualSelectAll=!0,a=this.virtualSelectAllData&&0!==this.virtualSelectAllData.length?this.virtualSelectAllData.length:a,this.listData=this.virtualSelectAllData;var o=this.createListItems(this.virtualSelectAllData.slice(0,30),this.fields).querySelectorAll("li"),h=document.createDocumentFragment();o.forEach(function(e){h.appendChild(e.cloneNode(!0))}),i.forEach(function(e){h.appendChild(e.cloneNode(!0))});var u=h.childNodes;if(this.virtualSelectAllData instanceof Array){for(;n<a&&n<=50&&n<r;){if(this.isSelectAllTarget=a===n+1,u[n]){p=this.allowObjectBinding?this.getDataByValue(u[n].getAttribute("data-value")):this.getFormattedValue(u[n].getAttribute("data-value"));if(!this.allowObjectBinding&&this.value&&this.value.indexOf(p)>=0||this.allowObjectBinding&&this.indexOfObjectInArray(p,this.value)>=0){n++;continue}this.updateListSelection(u[n],s,a-n)}else{var p=t.getValue(this.fields.value?this.fields.value:"",this.virtualSelectAllData[n]);if(p=this.allowObjectBinding?this.getDataByValue(p):p,!this.allowObjectBinding&&this.value&&this.value.indexOf(p)>=0||this.allowObjectBinding&&this.indexOfObjectInArray(p,this.value)>=0){n++;continue}this.value&&null!=p&&Array.isArray(this.value)&&(!this.allowObjectBinding&&this.value.indexOf(p)<0||this.allowObjectBinding&&!this.isObjectInArray(p,this.value))&&this.dispatchSelect(p,s,null,!1,a)}n++}a>50&&setTimeout(function(){if(l.virtualSelectAllData&&l.virtualSelectAllData.length>0&&l.virtualSelectAllData.map(function(e){if(l.value&&null!=e[l.fields.value]&&Array.isArray(l.value)&&(!l.allowObjectBinding&&l.value.indexOf(e[l.fields.value])<0||l.allowObjectBinding&&!l.isObjectInArray(e[l.fields.value],l.value))){var t=e[l.fields.value],i=e[l.fields.text].toString();l.dispatchSelect(t,s,null,!1,a,e,i)}}),l.updatedataValueItems(s),l.isSelectAllLoop=!1,l.changeOnBlur||(l.updateValueState(s,l.value,l.tempValues),l.isSelectAll=l.isSelectAll?!l.isSelectAll:l.isSelectAll),l.updateHiddenElement(!0),l.popupWrapper&&i[n-1]&&i[n-1].classList.contains("e-item-focus")){var e=document.getElementsByClassName("e-selectall-parent")[0];e&&e.classList.contains("e-item-focus")&&i[n-1].classList.remove("e-item-focus")}l.checkSelectAll()},0)}}else this.virtualSelectAllData&&this.virtualSelectAllData.length>0&&this.virtualSelectAllData.map(function(e){l.virtualSelectAll=!0,l.removeValue(l.value[n],s,l.value.length-n)}),this.updatedataValueItems(s),this.changeOnBlur||(this.updateValueState(s,this.value,this.tempValues),this.isSelectAll=this.isSelectAll?!this.isSelectAll:this.isSelectAll),this.updateHiddenElement(),this.setProperties({value:[]},!0),this.selectedListData=[],this.virtualSelectAll=!1,t.isNullOrUndefined(this.viewPortInfo.startIndex)||t.isNullOrUndefined(this.viewPortInfo.endIndex)||this.notify("setCurrentViewDataAsync",{component:this.getModuleName(),module:"VirtualScroll"});this.checkSelectAll();var d=this.list.getElementsByClassName("e-virtual-ddl")[0];d&&(d.style=this.GetVirtualTrackHeight()),this.UpdateSkeleton();var c=this.list.getElementsByClassName("e-virtual-ddl-content")[0];c&&(c.style=this.getTransformValues())},s.prototype.updateValue=function(e,s,l){var n=this,a=s.length,r={event:e,items:l?s:[],itemData:l?this.listData:[],isInteracted:!!e,isChecked:l,preventSelectEvent:!1};if(this.trigger("beforeSelectAll",r),s&&s.length||this.enableVirtualization&&!l){var o=0,h=0;if(h=this.enableGroupCheckBox?l?this.maximumSelectionLength-(this.value?this.value.length:0):s.length:l?this.maximumSelectionLength-(this.value?this.value.length:0):this.maximumSelectionLength,r.preventSelectEvent){for(var u=0;u<s.length&&u<h;u++){this.removeHover();var p=s[u].getAttribute("data-value"),d=this.getFormattedValue(p);d=this.allowObjectBinding?this.getDataByValue(d):d;var c=this.mainList?this.mainList.querySelectorAll(l?'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)':'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)')[u]:null;l?(this.value=this.value?this.value:[],(!this.allowObjectBinding&&this.value.indexOf(d)<0||this.allowObjectBinding&&!this.isObjectInArray(d,this.value))&&this.setProperties({value:[].concat([],this.value,[d])},!0),this.removeFocus(),this.addListSelection(s[u],c),this.updateChipStatus(),this.checkMaxSelection()):this.removeAllItems(d,e,!1,s[u],c),this.enableGroupCheckBox&&this.findGroupStart(s[u])}if(!l&&(this.value&&this.value.length?this.value.length:0)<this.maximumSelectionLength){var m=this.list.querySelectorAll("li."+H.li+":not(.e-active)");t.removeClass(m,"e-disable")}var f={event:e,items:l?s:[],itemData:l?this.listData:[],isInteracted:!!e,isChecked:l};this.trigger("selectedAll",f)}else if(this.enableVirtualization)this.virtualSelectAllState=l,this.virtualSelectAll=!0,this.CurrentEvent=e,this.virtualSelectAllData||this.resetList(this.dataSource,this.fields,new i.Query),this.virtualSelectAllData&&this.virtualSelectionAll(l,s,e);else{for(;o<a&&o<=50&&o<h;)this.isSelectAllTarget=a===o+1,this.updateListSelection(s[o],e,a-o),this.enableGroupCheckBox&&this.findGroupStart(s[o]),o++;a>50&&setTimeout(function(){for(;o<a&&o<h;)n.isSelectAllTarget=a===o+1,n.updateListSelection(s[o],e,a-o),n.enableGroupCheckBox&&n.findGroupStart(s[o]),o++;if(n.updatedataValueItems(e),n.changeOnBlur||(n.updateValueState(e,n.value,n.tempValues),n.isSelectAll=n.isSelectAll?!n.isSelectAll:n.isSelectAll),n.updateHiddenElement(),n.popupWrapper&&s[o-1].classList.contains("e-item-focus")){var t=document.getElementsByClassName("e-selectall-parent")[0];t&&t.classList.contains("e-item-focus")&&s[o-1].classList.remove("e-item-focus")}},0)}}this.updatedataValueItems(e),this.checkPlaceholderSize(),a<=50&&!r.preventSelectEvent&&(this.changeOnBlur||(this.updateValueState(e,this.value,this.tempValues),this.isSelectAll=this.isSelectAll?!this.isSelectAll:this.isSelectAll),(this.enableVirtualization&&this.value&&this.value.length>0||!this.enableVirtualization)&&this.updateHiddenElement())},s.prototype.updateHiddenElement=function(e){var i=this,s="",l="",n="",a=[];"CheckBox"===this.mode&&(this.value.map(function(t,r){s+='<option selected value ="'+t+'">'+r+"</option>",e||(n=i.listData?i.getTextByValue(t):t,l+=n+i.delimiterChar+" ",a.push(n))}),this.hiddenElement.innerHTML=s,e||(this.updateWrapperText(this.delimiterWrapper,l),this.setProperties({text:a.toString()},!0)),this.delimiterWrapper.setAttribute("id",t.getUniqueID("delim_val")),this.inputElement.setAttribute("aria-describedby",this.delimiterWrapper.id),this.refreshInputHight(),this.refreshPlaceHolder())},s.prototype.updatedataValueItems=function(e){this.deselectHeader(),this.textboxValueUpdate(e)},s.prototype.textboxValueUpdate=function(e){var i=e&&e.target&&(t.closest(e.target,".e-selectall-parent")||t.closest(e.target,".e-close-hooker"));"Box"===this.mode||this.isPopupOpen()||"CheckBox"===this.mode&&(this.isSelectAll||i)?this.searchWrapper.classList.remove("e-zero-size"):this.updateDelimView(),"CheckBox"===this.mode?(this.updateDelimView(),(!i&&!this.isSelectAll&&this.isSelectAllTarget||this.isSelectAll&&this.isSelectAllTarget)&&this.updateDelimeter(this.delimiterChar,e),this.refreshInputHight()):this.updateDelimeter(this.delimiterChar,e),this.refreshPlaceHolder()},s.prototype.setZIndex=function(){this.popupObj&&this.popupObj.setProperties({zIndex:this.zIndex})},s.prototype.updateDataSource=function(e){this.checkAndResetCache(),t.isNullOrUndefined(this.list)?this.renderPopup():this.resetList(this.dataSource),this.value&&this.value.length&&(this.setProperties({value:this.value}),this.refreshSelection())},s.prototype.onLoadSelect=function(){this.setDynValue=!0,this.renderPopup()},s.prototype.selectAllItems=function(s,l){var n=this;if(t.isNullOrUndefined(this.list))this.selectAllAction=function(){if("CheckBox"===n.mode&&n.showSelectAll){var e={module:"CheckBoxSelection",enable:"CheckBox"===n.mode,value:s?"check":"uncheck"};n.notify("checkSelectAll",e)}n.selectAllItem(s,l),n.selectAllAction=null},e.prototype.render.call(this);else{if(this.selectAllAction=null,"CheckBox"===this.mode&&this.showSelectAll){var a={value:s?"check":"uncheck",enable:"CheckBox"===this.mode,module:"CheckBoxSelection"};this.notify("checkSelectAll",a)}this.selectAllItem(s,l)}this.dataSource instanceof i.DataManager&&!(this.dataSource instanceof i.DataManager&&this.virtualSelectAllData)||(this.virtualSelectAll=!1)},s.prototype.getPersistData=function(){return this.addOnPersist(["value"])},s.prototype.onPropertyChanged=function(i,s){(i.dataSource&&!t.isNullOrUndefined(Object.keys(i.dataSource))||i.query&&!t.isNullOrUndefined(Object.keys(i.query)))&&(this.mainList=null,this.mainData=null,this.isFirstClick=!1,this.isDynamicDataChange=!0),"multiselect"===this.getModuleName()&&(this.isFilterAction=!1,this.setUpdateInitial(["fields","query","dataSource"],i));for(var l=0,n=Object.keys(i);l<n.length;l++){var r=n[l];switch(r){case"query":case"dataSource":"CheckBox"===this.mode&&this.showSelectAll&&(t.isNullOrUndefined(this.popupObj)||(this.popupObj.destroy(),this.popupObj=null),this.renderPopup());break;case"htmlAttributes":this.updateHTMLAttribute();break;case"showClearButton":this.updateClearButton(i.showClearButton);break;case"text":this.fields.disabled&&(this.text=this.text&&!this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text)))?this.text:null),this.updateVal(this.value,this.value,"text");break;case"value":if(this.fields.disabled&&this.removeDisabledItemsValue(this.value),this.updateVal(this.value,s.value,"value"),this.addValidInputClass(),!this.closePopupOnSelect&&this.isPopupOpen()&&this.refreshPopup(),this.isPopupOpen()&&"CheckBox"===this.mode&&this.list&&this.list.querySelector(".e-active.e-disable")){var o=this.list.querySelectorAll("li."+H.li+".e-active.e-disable");t.removeClass(o,"e-disable")}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange;break;case"width":this.setWidth(i.width),this.popupObj.setProperties({width:this.calcPopupWidth()});break;case"placeholder":this.refreshPlaceHolder();break;case"filterBarPlaceholder":this.allowFiltering&&this.notify("filterBarPlaceholder",{filterBarPlaceholder:i.filterBarPlaceholder});break;case"delimiterChar":"Box"!==this.mode&&this.updateDelimView(),this.updateData(i.delimiterChar);break;case"cssClass":this.updateOldPropCssClass(s.cssClass),this.updateCssClass(),this.calculateWidth();break;case"enableRtl":this.enableRTL(i.enableRtl),e.prototype.onPropertyChanged.call(this,i,s);break;case"allowResize":if(this.allowResize=i.allowResize,!this.allowResize&&this.popupObj){h=parseInt(this.popupHeight,10);"auto"!==this.popupHeight?(this.list.style.maxHeight=t.formatUnit(h),this.popupWrapper.style.height=t.formatUnit(this.popupHeight),this.popupWrapper.style.maxHeight=t.formatUnit(this.popupHeight)):this.list.style.maxHeight=t.formatUnit(this.popupHeight)}break;case"readonly":this.updateReadonly(i.readonly),this.hidePopup();break;case"enabled":this.hidePopup(),this.enable(i.enabled);break;case"showSelectAll":this.popupObj&&(this.popupObj.destroy(),this.popupObj=null),this.renderPopup();break;case"showDropDownIcon":this.dropDownIcon();break;case"floatLabelType":this.setFloatLabelType(),this.addValidInputClass(),null===this.element.querySelector(".e-multiselect .e-float-text-content")&&a.Input.createSpanElement(this.overAllWrapper,this.createElement),this.calculateWidth(),t.isNullOrUndefined(this.overAllWrapper)||t.isNullOrUndefined(this.overAllWrapper.getElementsByClassName("e-ddl-icon")[0]&&this.overAllWrapper.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType)||this.overAllWrapper.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon");break;case"enableSelectionOrder":break;case"selectAllText":this.notify("selectAllText",!1);break;case"popupHeight":if(this.popupObj){var h=parseInt(this.popupHeight,10);"auto"!==this.popupHeight?(this.list.style.maxHeight=t.formatUnit(h),this.popupWrapper.style.maxHeight=t.formatUnit(this.popupHeight)):this.list.style.maxHeight=t.formatUnit(this.popupHeight)}break;case"headerTemplate":case"footerTemplate":this.reInitializePoup();break;case"allowFiltering":"CheckBox"===this.mode&&this.popupObj&&this.reInitializePoup(),this.updateSelectElementData(this.allowFiltering);break;case"fields":t.isNullOrUndefined(this.fields.groupBy)&&this.removeScrollEvent();break;default:var u=this.getPropObject(r,i,s);e.prototype.onPropertyChanged.call(this,u.newProperty,u.oldProperty)}}},s.prototype.reInitializePoup=function(){this.popupObj&&(this.popupObj.destroy(),this.popupObj=null),this.renderPopup()},s.prototype.totalItemsCount=function(){var e;if(this.dataSource instanceof i.DataManager?this.remoteDataCount>=0?e=this.totalItemCount=this.dataCount=this.remoteDataCount:this.resetList(this.dataSource):e=this.dataSource&&this.dataSource.length?this.dataSource.length:0,"CheckBox"===this.mode)this.totalItemCount=0!==e?e:this.totalItemCount;else if(this.hideSelectedItem){if(this.totalItemCount=0!==e&&this.value?e-this.value.length:this.totalItemCount,this.allowCustomValue&&this.virtualCustomSelectData&&this.virtualCustomSelectData.length>0)for(var s=0;s<this.virtualCustomSelectData.length;s++)for(var l=0;l<this.value.length;l++)(this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",this.value[l]):this.value[l])===t.getValue(this.fields.value?this.fields.value:"",this.virtualCustomSelectData[s])&&(this.totalItemCount+=1)}else this.totalItemCount=0!==e?e:this.totalItemCount,this.allowCustomValue&&this.virtualCustomSelectData&&this.virtualCustomSelectData.length>0&&(this.totalItemCount+=this.virtualCustomSelectData.length)},s.prototype.presentItemValue=function(e){for(var i=[],s=0;s<this.value.length;s++){var l=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",this.value[s]):this.value[s];if(!this.findListElement(this.allowFiltering&&!t.isNullOrUndefined(this.mainList)?this.mainList:e,"li","data-value",l)){var n=this.allowObjectBinding?this.getDataByValue(this.value[s]):this.value[s];i.push(n)}}return i},s.prototype.addNonPresentItems=function(e,t,i,s){var l=this;this.dataSource.executeQuery(this.getForQuery(e)).then(function(e){e.result.length>0&&l.addItem(e.result,i.length),l.updateActionList(t,i,s)})},s.prototype.updateVal=function(e,s,l){var n=this;if(this.list)if(!(this.dataSource instanceof i.DataManager)||this.listData&&this.mainList&&this.mainData){var a=[];t.isNullOrUndefined(this.value)||this.allowCustomValue||(a=this.presentItemValue(this.ulElement));var r=a.some(function(e){return null!==e});if("value"===l&&a.length>0&&this.dataSource instanceof i.DataManager&&!t.isNullOrUndefined(this.value)&&null!=this.listData&&(!this.enableVirtualization||this.enableVirtualization&&this.valueTemplate)&&r)this.mainData=null,this.setDynValue=!0,this.isaddNonPresentItems=!0,this.addNonPresentItems(a,this.ulElement,this.listData),this.isaddNonPresentItems=!1;else{if(this.selectedListData=[],"text"===l&&(this.initialTextUpdate(),e=this.value),(t.isNullOrUndefined(this.value)||0===this.value.length)&&(this.tempValues=s),this.allowCustomValue&&("Default"===this.mode||"Box"===this.mode)&&this.isReact&&this.inputFocus&&this.isPopupOpen()&&this.mainData!==this.listData){var o=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.onActionComplete(o,this.mainData)}if(this.enableVirtualization)if(!this.enableVirtualization||this.dataSource instanceof i.DataManager){if(!this.isInitRemoteVirtualData)if(this.allowObjectBinding&&!r&&this.value&&this.value.length){for(var h=this.isPrimitiveData?"":this.fields.value,u=void 0,p=0;p<this.value.length;p++){var d=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",this.value[p]):this.value[p];u=0===p?new i.Predicate(h,"equal",d):u.or(h,"equal",d)}this.dataSource instanceof i.DataManager&&this.dataSource.executeQuery((new i.Query).where(u)).then(function(e){if(e.result.length>0){var t=e.result;n.isDynamicRemoteVirtualData=!0,setTimeout(function(){n.initialValueUpdate(t,!0),n.isDynamicRemoteVirtualData=!1,(!n.inputFocus||n.inputFocus&&"Default"!==n.mode)&&n.initialUpdate()},100)}})}else this.isDynamicRemoteVirtualData=!0,this.initialValueUpdate(this.listData,!0),this.isDynamicRemoteVirtualData=!1,this.initialUpdate()}else this.initialValueUpdate(this.dataSource,!0);else this.initialValueUpdate();"Box"===this.mode||this.inputFocus||this.updateDelimView(),this.inputFocus||this.refreshInputHight(),this.refreshPlaceHolder(),"CheckBox"!==this.mode&&this.changeOnBlur&&this.updateValueState(null,e,s),this.checkPlaceholderSize()}}else this.onLoadSelect();else this.onLoadSelect(),this.enableVirtualization&&(this.setProperties({text:""},!0),this.selectedListData=[],this.checkInitialValue());this.changeOnBlur||this.updateValueState(null,e,s)},s.prototype.addItem=function(t,i){e.prototype.addItem.call(this,t,i)},s.prototype.hidePopup=function(e){var s=this;if(this.isPopupOpen()){var l={name:"FadeOut",duration:100,delay:100};this.customFilterQuery=null;var n={popup:this.popupObj,cancel:!1,animation:l,event:e||null};this.trigger("close",n,function(e){if(!e.cancel){s.fields.groupBy&&"CheckBox"!==s.mode&&s.fixedHeaderElement&&(t.remove(s.fixedHeaderElement),s.fixedHeaderElement=null),s.beforePopupOpen=!1,s.overAllWrapper.classList.remove("e-icon-anim");var l="CheckBox"===s.mode?s.targetElement():null;if(s.popupObj.hide(new t.Animation(e.animation)),t.attributes(s.inputElement,{"aria-expanded":"false"}),s.inputElement.removeAttribute("aria-owns"),s.inputElement.removeAttribute("aria-activedescendant"),s.allowFiltering&&s.notify("inputFocus",{module:"CheckBoxSelection",enable:"CheckBox"===s.mode,value:"clear"}),s.popupObj.hide(),t.removeClass([document.body,s.popupObj.element],"e-popup-full-page"),t.EventHandler.remove(s.list,"keydown",s.onKeyDown),"CheckBox"===s.mode&&s.showSelectAll&&t.EventHandler.remove(s.popupObj.element,"click",s.clickHandler),s.list&&s.list.parentElement&&s.allowResize){s.resizer&&s.list.parentElement.contains(s.resizer)&&s.list.parentElement.removeChild(s.resizer),s.list.parentElement.classList.contains("e-resize")&&s.list.parentElement.classList.remove("e-resize"),s.list.parentElement.style.boxSizing="",s.list.parentElement.style.paddingBottom="";var n=parseInt(s.popupHeight,10);s.list.style.maxHeight=t.formatUnit(n),"auto"!==s.popupHeight.toString().toLowerCase()&&s.initialPopupHeight>=parseInt(s.popupHeight.toString(),10)-2&&(s.list.parentElement.style.height=t.formatUnit(s.popupHeight)),s.list.parentElement.style.maxHeight=t.formatUnit(s.popupHeight)}s.resizer&&(t.EventHandler.remove(s.resizer,"mousedown",s.startResizing),s.resizer.remove()),s.enableVirtualization&&"CheckBox"===s.mode&&s.value&&s.value.length>0&&s.enableSelectionOrder&&(s.viewPortInfo.startIndex=s.virtualItemStartIndex=0,s.viewPortInfo.endIndex=s.virtualItemEndIndex=s.viewPortInfo.startIndex>0?s.viewPortInfo.endIndex:s.itemCount,s.virtualListInfo=s.viewPortInfo,s.previousStartIndex=0,s.previousEndIndex=s.itemCount);var a=void 0;s.dataSource instanceof i.DataManager?s.remoteDataCount>=0?s.totalItemCount=s.dataCount=s.remoteDataCount:s.resetList(s.dataSource):a=s.dataSource&&s.dataSource.length?s.dataSource.length:0,s.enableVirtualization&&(s.allowFiltering||s.allowCustomValue)&&(s.targetElement()||l)&&s.totalItemCount!==a&&(s.checkAndResetCache(),s.updateInitialData()),s.virtualCustomData&&s.viewPortInfo&&0===s.viewPortInfo.startIndex&&s.viewPortInfo.endIndex===s.itemCount&&s.renderItems(s.mainData,s.fields),s.virtualCustomData=null,s.isVirtualTrackHeight=!1}})}},s.prototype.showPopup=function(i){var s=this;if(this.enabled){this.firstItem=this.dataSource&&this.dataSource.length>0?this.dataSource[0]:null;var l={cancel:!1};this.trigger("beforeOpen",l,function(l){if(!l.cancel){if(!s.ulElement)return s.beforePopupOpen=!0,"CheckBox"===s.mode&&t.Browser.isDevice&&s.allowFiltering&&s.isDeviceFullScreen&&s.notify("popupFullScreen",{module:"CheckBoxSelection",enable:"CheckBox"===s.mode}),void e.prototype.render.call(s,i);"CheckBox"===s.mode&&t.Browser.isDevice&&s.allowFiltering&&s.isDeviceFullScreen&&s.notify("popupFullScreen",{module:"CheckBoxSelection",enable:"CheckBox"===s.mode});var n=s.ulElement.querySelectorAll("li.e-list-item").length,a=s.ulElement.querySelectorAll("li."+H.li+"."+ge).length;if(n>0&&n===a&&a===s.mainData.length&&(""===s.targetElement()||!s.allowCustomValue))return void(s.beforePopupOpen=!1);if(s.onPopupShown(i),s.enableVirtualization&&s.listData&&s.listData.length&&(t.isNullOrUndefined(s.value)||"dropdownlist"!==s.getModuleName()&&"combobox"!==s.getModuleName()||s.removeHover(),s.beforePopupOpen||(s.hideSelectedItem&&s.value&&Array.isArray(s.value)&&s.value.length>0&&s.totalItemsCount(),s.preventSetCurrentData||t.isNullOrUndefined(s.viewPortInfo.startIndex)||t.isNullOrUndefined(s.viewPortInfo.endIndex)||s.notify("setCurrentViewDataAsync",{component:s.getModuleName(),module:"VirtualScroll"}))),s.enableVirtualization&&!s.allowFiltering&&null!=s.selectedValueInfo&&s.selectedValueInfo.startIndex>0&&null!=s.value&&s.notify("dataProcessAsync",{module:"VirtualScroll",isOpen:!0}),s.enableVirtualization)s.updatevirtualizationList();else if(s.value&&s.value.length)for(var r=void 0,o=(s.getItems(),0),h=s.value;o<h.length;o++){var u=h[o],p=s.allowObjectBinding?t.getValue(s.fields.value?s.fields.value:"",u):u;(r=s.getElementByValue(p))&&s.addListSelection(r)}s.allowResize&&s.setResize(),s.preventSetCurrentData=!0}})}},s.prototype.selectAll=function(e){this.isSelectAll=!0,this.selectAllItems(e)},s.prototype.getModuleName=function(){return"multiselect"},s.prototype.clear=function(){var e=this;this.selectAll(!1),this.value&&this.value.length?setTimeout(function(){e.setProperties({value:null},!0)},0):this.setProperties({value:null},!0),this.checkAndResetCache(),this.enableVirtualization&&(this.updateInitialData(),this.chipCollectionWrapper&&(this.chipCollectionWrapper.innerHTML=""),this.isCustomDataUpdated||this.notify("setGeneratedData",{module:"VirtualScroll"}),this.list.scrollTop=0,this.virtualListInfo=null,this.previousStartIndex=0,this.previousEndIndex=this.itemCount)},s.prototype.render=function(){!t.isNullOrUndefined(this.value)&&this.value.length>0&&(this.value=this.value.slice()),this.setDynValue=this.initStatus=!1,this.isSelectAll=!1,this.selectAllEventEle=[],this.searchWrapper=this.createElement("span",{className:"e-searcher "+("Box"===this.mode?"e-multiselect-box":"")}),this.viewWrapper=this.createElement("span",{className:"e-delim-view e-delim-values"}),this.viewWrapper.style.display="none",this.overAllClear=this.createElement("span",{className:"e-chips-close e-close-hooker"}),this.overAllClear.style.display="none",this.componentWrapper=this.createElement("div",{className:"e-multi-select-wrapper"}),this.overAllWrapper=this.createElement("div",{className:"e-multiselect e-input-group e-control-wrapper"}),"CheckBox"===this.mode&&t.addClass([this.overAllWrapper],"e-checkbox"),t.Browser.isDevice&&this.componentWrapper.classList.add("e-mob-wrapper"),this.setWidth(this.width),this.overAllWrapper.appendChild(this.componentWrapper),this.popupWrapper=this.createElement("div",{id:this.element.id+"_popup",className:"e-ddl e-popup e-multi-select-list-wrapper"}),this.popupWrapper.setAttribute("aria-label",this.element.id),this.popupWrapper.setAttribute("role","dialog"),"Delimiter"===this.mode||"CheckBox"===this.mode?(this.delimiterWrapper=this.createElement("span",{className:"e-delim-values"}),this.delimiterWrapper.style.display="none",this.componentWrapper.appendChild(this.delimiterWrapper)):(this.chipCollectionWrapper=this.createElement("span",{className:"e-chips-collection"}),this.chipCollectionWrapper.style.display="none","Default"===this.mode?this.chipCollectionWrapper.setAttribute("id",t.getUniqueID("chip_default")):"Box"===this.mode&&this.chipCollectionWrapper.setAttribute("id",t.getUniqueID("chip_box")),this.componentWrapper.appendChild(this.chipCollectionWrapper)),"Box"!==this.mode&&this.componentWrapper.appendChild(this.viewWrapper),this.componentWrapper.appendChild(this.searchWrapper),this.showClearButton&&!t.Browser.isDevice?this.componentWrapper.appendChild(this.overAllClear):this.componentWrapper.classList.add("e-close-icon-hide"),this.dropDownIcon(),this.inputElement=this.createElement("input",{className:"e-dropdownbase",attrs:{spellcheck:"false",type:"text",autocomplete:"off",tabindex:"0",role:"combobox"}}),"Default"!==this.mode&&"Box"!==this.mode||this.inputElement.setAttribute("aria-describedby",this.chipCollectionWrapper.id),t.isNullOrUndefined(this.inputElement)||(t.attributes(this.inputElement,{"aria-expanded":"false"}),this.inputElement.hasAttribute("aria-label")||this.inputElement.setAttribute("aria-label",this.getModuleName())),this.element.tagName!==this.getNgDirective()&&(this.element.style.display="none"),this.element.tagName===this.getNgDirective()?(this.element.appendChild(this.overAllWrapper),this.searchWrapper.appendChild(this.inputElement)):(this.element.parentElement.insertBefore(this.overAllWrapper,this.element),this.searchWrapper.appendChild(this.inputElement),this.searchWrapper.appendChild(this.element),this.element.removeAttribute("tabindex")),"Never"!==this.floatLabelType?v(this.overAllWrapper,this.searchWrapper,this.element,this.inputElement,this.value,this.floatLabelType,this.placeholder):"Never"===this.floatLabelType&&this.refreshPlaceHolder(),this.addValidInputClass(),this.element.style.opacity="";var e=this.element.getAttribute("id")?this.element.getAttribute("id"):t.getUniqueID("ej2_dropdownlist");this.element.id=e,this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",class:"e-multi-hidden",tabindex:"-1",multiple:""}}),this.componentWrapper.appendChild(this.hiddenElement),this.validationAttribute(this.element,this.hiddenElement),"CheckBox"!==this.mode&&this.hideOverAllClear(),!t.isNullOrUndefined(t.closest(this.element,"fieldset"))&&t.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.wireEvent(),this.enable(this.enabled),this.enableRTL(this.enableRtl),this.enableVirtualization&&this.updateVirtualizationProperties(this.itemCount,this.allowFiltering,"CheckBox"===this.mode),this.listItemHeight=this.getListHeight(),this.getSkeletonCount(),this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=this.viewPortInfo.startIndex>0?this.viewPortInfo.endIndex:this.itemCount,this.checkInitialValue(),this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),null===this.element.querySelector(".e-multiselect .e-float-text-content")&&a.Input.createSpanElement(this.overAllWrapper,this.createElement),this.calculateWidth(),t.isNullOrUndefined(this.overAllWrapper)||t.isNullOrUndefined(this.overAllWrapper.getElementsByClassName("e-ddl-icon")[0]&&this.overAllWrapper.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType)||this.overAllWrapper.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon"),this.renderComplete()},s.prototype.setResize=function(){var e=this;if(this.list&&this.list.parentElement&&t.isNullOrUndefined(this.list.parentElement.querySelector(".e-resizer-right.e-icons"))&&(this.resizer=this.createElement("div",{id:this.element.id+"_resize-popup",className:"e-resizer-right e-icons"})),"CheckBox"===this.mode&&this.showSelectAll&&this.selectAllHeight&&0!==this.selectAllHeight&&(this.storedSelectAllHeight=this.selectAllHeight),this.list&&this.list.parentElement){this.list.parentElement.classList.add("e-resize"),this.initialPopupHeight=this.list.parentElement.clientHeight,"auto"!==this.popupHeight.toString().toLowerCase()&&this.initialPopupHeight>=parseInt(this.popupHeight.toString(),10)-2&&(this.list.parentElement.style.height="100%"),this.list.parentElement.style.boxSizing="border-box";var i="CheckBox"===this.mode&&this.searchBoxHeight?this.searchBoxHeight+16+(this.showSelectAll?this.storedSelectAllHeight:0):16;if(this.footer){var s=this.list.style.maxHeight,l=this.list.parentElement.style.maxHeight;setTimeout(function(){var t=Math.round(e.footer.getBoundingClientRect().height),n=(parseInt(l,10)-t).toString()+"px";s=(parseInt(n,10)-2).toString()+"px",t>0&&(e.list.parentElement.style.paddingBottom=(parseInt(l,10)-parseInt(s,10)+i).toString()+"px")},1)}else this.list.parentElement.style.paddingBottom=i+"px";if(this.list.parentElement.appendChild(this.resizer),this.list.parentElement.style.width=this.resizeWidth+"px",this.list.parentElement.style.height=this.resizeHeight+"px",this.list.parentElement.style.maxHeight=this.resizeHeight+"px",this.list.style.maxHeight=this.resizeHeight+"px",this.headerTemplate){var n=this.list.parentElement.querySelector(".e-ddl-header");n&&n.offsetHeight&&(this.headerTemplateHeight=n.offsetHeight),this.resizeHeight?this.list.style.maxHeight=this.resizeHeight-this.headerTemplateHeight-16+"px":this.list.style.maxHeight=parseInt(this.list.style.maxHeight,10)-16+"px"}}this.resizer&&(t.EventHandler.add(this.resizer,"mousedown",this.startResizing,this),t.EventHandler.add(this.resizer,"touchstart",this.startResizing,this))},s.prototype.startResizing=function(e){this.isResizing=!0,this.trigger("resizeStart",e);var t=e instanceof MouseEvent?e.clientX:e.touches[0].clientX,i=e instanceof MouseEvent?e.clientY:e.touches[0].clientY;this.list&&this.list.parentElement&&(this.originalWidth=this.list.parentElement.offsetWidth,this.originalHeight=this.list.parentElement.offsetHeight,this.originalMouseX=t,this.originalMouseY=i),this.resizingWireEvent(),e&&e.preventDefault()},s.prototype.resizePopup=function(e){if(this.isResizing){this.trigger("resizing",e);var t=e instanceof MouseEvent?e.clientX:e.touches[0].clientX,i=e instanceof MouseEvent?e.clientY:e.touches[0].clientY,s=t-this.originalMouseX,l=i-this.originalMouseY;if(this.resizeWidth=Math.max(this.originalWidth+s,100),this.resizeHeight=Math.max(this.originalHeight+l,130),this.list&&this.list.parentElement){var n=parseInt(window.getComputedStyle(this.list.parentElement).minWidth,10),a=parseInt(window.getComputedStyle(this.list.parentElement).minHeight,10);n=n||100,a=a||120,this.resizeWidth=Math.max(this.originalWidth+s,n),this.resizeHeight=Math.max(this.originalHeight+l,a),this.list.parentElement.style.width=this.resizeWidth+"px",this.list.parentElement.style.height=this.resizeHeight+"px",this.list.parentElement.style.maxHeight=this.resizeHeight+"px",this.list.style.maxHeight=this.resizeHeight+"px",this.headerTemplate&&(this.list.style.maxHeight=this.resizeHeight-this.headerTemplateHeight-16+"px"),this.fixedHeaderElement&&this.ulElement&&(this.fixedHeaderElement.style.width=this.ulElement.offsetWidth+"px")}e&&e.preventDefault()}},s.prototype.stopResizing=function(e){this.isResizing&&(this.isResizing=!1,this.trigger("resizeStop",e),this.resizingUnWireEvent()),e&&e.preventDefault()},s.prototype.getListHeight=function(){var e=this.createElement("div",{className:"e-dropdownbase"}),i=this.createElement("li",{className:"e-list-item"}),s=t.formatUnit(this.popupHeight);e.style.height=parseInt(s,10).toString()+"px",e.appendChild(i),document.body.appendChild(e),this.virtualListHeight=e.getBoundingClientRect().height;var l=Math.ceil(i.getBoundingClientRect().height)+parseInt(window.getComputedStyle(i).marginBottom,10);return e.remove(),l},s.prototype.removeDisabledItemsValue=function(e){if(e){for(var t=[],i=0,s=0;s<e.length;s++){var l=e[s];"object"==typeof l&&(l=JSON.parse(JSON.stringify(l))[this.fields.value]),null==l||this.isDisabledItemByIndex(this.getIndexByValue(l))||(t[i++]=e[s])}this.value=t.length>0?t:null}},s.prototype.checkInitialValue=function(){var s=this;this.fields.disabled&&this.removeDisabledItemsValue(this.value);var l=this.dataSource instanceof Array?this.dataSource.length>0:!t.isNullOrUndefined(this.dataSource);if((!this.value||!this.value.length)&&t.isNullOrUndefined(this.text)&&!l&&"SELECT"===this.element.tagName&&this.element.options.length>0){for(var n=this.element.options,a=[],r="",o=0,h=n.length;o<h;o++){var u=n[o];if(!t.isNullOrUndefined(u.getAttribute("selected")))if(u.getAttribute("value")){f=this.allowObjectBinding?this.getDataByValue(u.getAttribute("value")):u.getAttribute("value");a.push(f)}else r+=u.text+this.delimiterChar}a.length>0?this.setProperties({value:a},!0):""!==r&&this.setProperties({text:r},!0),(a.length>0||""!==r)&&(this.refreshInputHight(),this.refreshPlaceHolder())}if((this.value&&this.value.length||!t.isNullOrUndefined(this.text))&&(this.list||e.prototype.render.call(this)),this.fields.disabled&&(this.text=this.text&&!this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text)))?this.text:null),t.isNullOrUndefined(this.text)||!t.isNullOrUndefined(this.value)&&0!==this.value.length||this.initialTextUpdate(),this.value&&this.value.length){var p;if(this.enableVirtualization){for(var d=this.isPrimitiveData?"":this.fields.value,c=void 0,m=0;m<this.value.length;m++){var f=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",this.value[m]):this.value[m];c=0===m?new i.Predicate(d,"equal",f):c.or(d,"equal",f)}this.dataSource instanceof i.DataManager?this.dataSource.executeQuery((new i.Query).where(c)).then(function(e){e.result.length>0&&(p=e.result,s.initStatus=!1,s.isInitRemoteVirtualData=!0,setTimeout(function(){s.initialValueUpdate(p,!0),s.initialUpdate(),s.isInitRemoteVirtualData=!1},100),s.initStatus=!0)}):p=new i.DataManager(this.dataSource).executeLocal((new i.Query).where(c))}this.dataSource instanceof i.DataManager?this.setInitialValue=function(){s.initStatus=!1,s.enableVirtualization&&(!s.enableVirtualization||s.dataSource instanceof i.DataManager)||s.initialValueUpdate(p),s.initialUpdate(),s.setInitialValue=null,s.initStatus=!0}:(this.initialValueUpdate(p,!0),this.initialUpdate()),this.updateTempValue()}else this.initialUpdate();this.initStatus=!0,this.checkAutoFocus(),t.isNullOrUndefined(this.text)||this.element.setAttribute("data-initial-value",this.text)},s.prototype.checkAutoFocus=function(){this.element.hasAttribute("autofocus")&&this.inputElement.focus()},s.prototype.updatevirtualizationList=function(){if(this.value&&this.value.length){for(var e=void 0,i=0,s=this.value;i<s.length;i++){var l=s[i],n=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",l):l;(e=this.getElementByValue(n))&&this.addListSelection(e)}if(this.enableVirtualization&&this.hideSelectedItem){var a=this.list.querySelectorAll("li."+H.li+":not(."+ge+"):not(.e-reorder-hide):not(.e-virtual-list)");if(a.length){var r=this.virtualListHeight>0?Math.floor(this.virtualListHeight/this.listItemHeight):0;if(a.length<r+2){var o=this.getForQuery(this.value).clone();o=o.skip(this.viewPortInfo.startIndex),this.resetList(this.dataSource,this.fields,o)}}}}},s.prototype.setFloatLabelType=function(){y(this.overAllWrapper,this.componentWrapper,this.searchWrapper,this.inputElement,this.value,this.floatLabelType,this.placeholder),"Never"!==this.floatLabelType&&v(this.overAllWrapper,this.searchWrapper,this.element,this.inputElement,this.value,this.floatLabelType,this.placeholder)},s.prototype.addValidInputClass=function(){t.isNullOrUndefined(this.overAllWrapper)||(!t.isNullOrUndefined(this.value)&&this.value.length||"Always"===this.floatLabelType?t.addClass([this.overAllWrapper],"e-valid-input"):t.removeClass([this.overAllWrapper],"e-valid-input"))},s.prototype.dropDownIcon=function(){this.showDropDownIcon?(this.dropIcon=this.createElement("span",{className:"e-input-group-icon e-ddl-icon"}),this.componentWrapper.appendChild(this.dropIcon),t.addClass([this.componentWrapper],["e-down-icon"])):t.isNullOrUndefined(this.dropIcon)||(this.dropIcon.parentElement.removeChild(this.dropIcon),t.removeClass([this.componentWrapper],["e-down-icon"]))},s.prototype.initialUpdate=function(){"Box"===this.mode||this.setDynValue&&"Default"===this.mode&&this.inputFocus||this.updateDelimView(),this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=this.itemCount,this.updateCssClass(),this.updateHTMLAttribute(),this.updateReadonly(this.readonly),this.refreshInputHight(),this.checkPlaceholderSize()},s.prototype.disableItem=function(e){if(this.fields.disabled){this.list||this.renderList();var i=-1;if(this.liCollections&&this.liCollections.length>0&&this.listData&&this.fields.disabled){if("string"==typeof e)i=this.getIndexByValue(e);else if("object"==typeof e){if(e instanceof HTMLLIElement){for(l=0;l<this.liCollections.length;l++)if(this.liCollections[l]===e){i=this.getIndexByValue(e.getAttribute("data-value"));break}}else for(var s=JSON.parse(JSON.stringify(e))[this.fields.value],l=0;l<this.listData.length;l++)if(JSON.parse(JSON.stringify(this.listData[l]))[this.fields.value]===s){i=this.getIndexByValue(s);break}}else i=e;if(i<this.liCollections.length&&i>-1&&!JSON.parse(JSON.stringify(this.listData[i]))[this.fields.disabled]){var n=this.liCollections[i];if(n){this.disableListItem(n);var a=JSON.parse(JSON.stringify(this.listData[i]));if(a[this.fields.disabled]=!0,this.listData[i]=a,n.classList.contains(H.focus)&&this.removeFocus(),n.classList.contains(ge)||n.classList.contains(H.selected)){var r=this.value;this.removeDisabledItemsValue(this.value),this.updateVal(this.value,r,"value")}"CheckBox"===this.mode&&this.enableGroupCheckBox&&!t.isNullOrUndefined(this.fields.groupBy)&&this.disableGroupHeader()}}}}},s.prototype.destroy=function(){this.isReact&&this.clearTemplate(),t.isNullOrUndefined(this.popupObj)||(this.popupObj.hide(),this.popupObj.destroy()),this.notify("destroy",{}),this.unwireListEvents(),this.unWireEvent();var i=["readonly","aria-disabled","placeholder","aria-label","aria-expanded"],s=i.length;if(!t.isNullOrUndefined(this.inputElement))for(;s>0;)this.inputElement.removeAttribute(i[s-1]),s--;for(t.isNullOrUndefined(this.element)||(this.element.removeAttribute("data-initial-value"),this.element.style.display="block"),this.overAllWrapper&&this.overAllWrapper.parentElement&&(this.overAllWrapper.parentElement.tagName===this.getNgDirective()?t.remove(this.overAllWrapper):(this.overAllWrapper.parentElement.insertBefore(this.element,this.overAllWrapper),t.remove(this.overAllWrapper))),this.popupWrapper&&this.popupWrapper.parentElement&&this.popupWrapper.parentElement.remove();this.searchWrapper&&this.searchWrapper.firstChild;)this.searchWrapper.removeChild(this.searchWrapper.firstChild);this.searchWrapper&&this.searchWrapper.parentElement&&this.searchWrapper.parentElement.remove(),this.viewWrapper&&this.viewWrapper.parentElement&&this.viewWrapper.parentElement.remove(),this.overAllClear&&this.overAllClear.parentElement&&this.overAllClear.parentElement.remove(),this.delimiterWrapper&&this.delimiterWrapper.parentElement&&this.delimiterWrapper.parentElement.remove();var l=this.overAllWrapper.querySelector("select.e-multi-hidden");for(l&&l.parentElement&&l.parentElement.remove();this.componentWrapper&&this.componentWrapper.firstChild;)this.componentWrapper.removeChild(this.componentWrapper.firstChild);for(this.componentWrapper&&this.componentWrapper.parentElement&&(this.componentWrapper.removeAttribute("class"),this.componentWrapper.parentElement.remove());this.popupWrapper&&this.popupWrapper.firstChild;)this.popupWrapper.removeChild(this.popupWrapper.firstChild);if(this.inputElement)for(var n=["readonly","aria-disabled","placeholder","aria-labelledby","aria-expanded","autocomplete","aria-readonly","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-label","aria-hidden","tabindex","aria-controls","aria-describedby","size","role","type","class"],a=0;a<n.length;a++)this.inputElement.removeAttribute(n[a]);this.inputElement&&this.inputElement.remove(),this.list=null,this.popupObj=null,this.mainData=null,this.filterParent=null,this.ulElement=null,this.componentWrapper=null,this.overAllClear=null,this.overAllWrapper=null,this.hiddenElement=null,this.searchWrapper=null,this.viewWrapper=null,this.chipCollectionWrapper=null,this.targetInputElement=null,this.popupWrapper=null,this.inputElement=null,this.delimiterWrapper=null,this.liCollections=null,this.popupContentElement=null,this.header=null,this.mainList=null,this.mainListCollection=null,this.footer=null,this.selectAllEventEle=null,e.prototype.destroy.call(this)},fe([t.Complex({text:null,value:null,iconCss:null,groupBy:null,disabled:null},P)],s.prototype,"fields",void 0),fe([t.Property(!1)],s.prototype,"enablePersistence",void 0),fe([t.Property(null)],s.prototype,"groupTemplate",void 0),fe([t.Property("No records found")],s.prototype,"noRecordsTemplate",void 0),fe([t.Property("Request failed")],s.prototype,"actionFailureTemplate",void 0),fe([t.Property("None")],s.prototype,"sortOrder",void 0),fe([t.Property(!0)],s.prototype,"enabled",void 0),fe([t.Property(!0)],s.prototype,"enableHtmlSanitizer",void 0),fe([t.Property(!1)],s.prototype,"enableVirtualization",void 0),fe([t.Property([])],s.prototype,"dataSource",void 0),fe([t.Property(null)],s.prototype,"query",void 0),fe([t.Property("StartsWith")],s.prototype,"filterType",void 0),fe([t.Property(1e3)],s.prototype,"zIndex",void 0),fe([t.Property(!1)],s.prototype,"ignoreAccent",void 0),fe([t.Property()],s.prototype,"locale",void 0),fe([t.Property(!1)],s.prototype,"enableGroupCheckBox",void 0),fe([t.Property(null)],s.prototype,"cssClass",void 0),fe([t.Property("100%")],s.prototype,"width",void 0),fe([t.Property("300px")],s.prototype,"popupHeight",void 0),fe([t.Property("100%")],s.prototype,"popupWidth",void 0),fe([t.Property(null)],s.prototype,"placeholder",void 0),fe([t.Property(null)],s.prototype,"filterBarPlaceholder",void 0),fe([t.Property({})],s.prototype,"htmlAttributes",void 0),fe([t.Property(null)],s.prototype,"valueTemplate",void 0),fe([t.Property(null)],s.prototype,"headerTemplate",void 0),fe([t.Property(null)],s.prototype,"footerTemplate",void 0),fe([t.Property(null)],s.prototype,"itemTemplate",void 0),fe([t.Property(null)],s.prototype,"allowFiltering",void 0),fe([t.Property(300)],s.prototype,"debounceDelay",void 0),fe([t.Property(!0)],s.prototype,"isDeviceFullScreen",void 0),fe([t.Property(!0)],s.prototype,"changeOnBlur",void 0),fe([t.Property(!1)],s.prototype,"allowCustomValue",void 0),fe([t.Property(!0)],s.prototype,"showClearButton",void 0),fe([t.Property(1e3)],s.prototype,"maximumSelectionLength",void 0),fe([t.Property(!1)],s.prototype,"readonly",void 0),fe([t.Property(!1)],s.prototype,"allowResize",void 0),fe([t.Property(null)],s.prototype,"text",void 0),fe([t.Property(null)],s.prototype,"value",void 0),fe([t.Property(!1)],s.prototype,"allowObjectBinding",void 0),fe([t.Property(!0)],s.prototype,"hideSelectedItem",void 0),fe([t.Property(!0)],s.prototype,"closePopupOnSelect",void 0),fe([t.Property("Default")],s.prototype,"mode",void 0),fe([t.Property(",")],s.prototype,"delimiterChar",void 0),fe([t.Property(!0)],s.prototype,"ignoreCase",void 0),fe([t.Property(!1)],s.prototype,"showDropDownIcon",void 0),fe([t.Property("Never")],s.prototype,"floatLabelType",void 0),fe([t.Property(!1)],s.prototype,"showSelectAll",void 0),fe([t.Property("Select All")],s.prototype,"selectAllText",void 0),fe([t.Property("Unselect All")],s.prototype,"unSelectAllText",void 0),fe([t.Property(!0)],s.prototype,"enableSelectionOrder",void 0),fe([t.Property(!0)],s.prototype,"openOnClick",void 0),fe([t.Property(!1)],s.prototype,"addTagOnBlur",void 0),fe([t.Event()],s.prototype,"change",void 0),fe([t.Event()],s.prototype,"removing",void 0),fe([t.Event()],s.prototype,"removed",void 0),fe([t.Event()],s.prototype,"beforeSelectAll",void 0),fe([t.Event()],s.prototype,"selectedAll",void 0),fe([t.Event()],s.prototype,"beforeOpen",void 0),fe([t.Event()],s.prototype,"open",void 0),fe([t.Event()],s.prototype,"close",void 0),fe([t.Event()],s.prototype,"blur",void 0),fe([t.Event()],s.prototype,"focus",void 0),fe([t.Event()],s.prototype,"chipSelection",void 0),fe([t.Event()],s.prototype,"resizeStop",void 0),fe([t.Event()],s.prototype,"resizing",void 0),fe([t.Event()],s.prototype,"resizeStart",void 0),fe([t.Event()],s.prototype,"filtering",void 0),fe([t.Event()],s.prototype,"tagging",void 0),fe([t.Event()],s.prototype,"customValueSelection",void 0),s=fe([t.NotifyPropertyChanges],s)}(U),Se=function(){function e(e){this.activeLi=[],this.activeEle=[],this.parent=e,this.removeEventListener(),this.addEventListener()}return e.prototype.getModuleName=function(){return"CheckBoxSelection"},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("updatelist",this.listSelection,this),this.parent.on("listoption",this.listOption,this),this.parent.on("selectAll",this.setSelectAll,this),this.parent.on("checkSelectAll",this.checkSelectAll,this),this.parent.on("searchBox",this.setSearchBox,this),this.parent.on("blur",this.onBlurHandler,this),this.parent.on("targetElement",this.targetElement,this),this.parent.on("deviceSearchBox",this.setDeviceSearchBox,this),this.parent.on("inputFocus",this.getFocus,this),this.parent.on("reOrder",this.setReorder,this),this.parent.on("activeList",this.getActiveList,this),this.parent.on("selectAllText",this.setLocale,this),this.parent.on("filterBarPlaceholder",this.setPlaceholder,this),t.EventHandler.add(document,"mousedown",this.onDocumentClick,this),this.parent.on("addItem",this.checboxCreate,this),this.parent.on("popupFullScreen",this.setPopupFullScreen,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updatelist",this.listSelection),this.parent.off("listoption",this.listOption),this.parent.off("selectAll",this.setSelectAll),this.parent.off("checkSelectAll",this.checkSelectAll),this.parent.off("searchBox",this.setSearchBox),this.parent.off("blur",this.onBlurHandler),this.parent.off("targetElement",this.targetElement),this.parent.off("deviceSearchBox",this.setDeviceSearchBox),this.parent.off("inputFocus",this.getFocus),this.parent.off("reOrder",this.setReorder),this.parent.off("activeList",this.getActiveList),this.parent.off("selectAllText",this.setLocale),this.parent.off("filterBarPlaceholder",this.setPlaceholder),this.parent.off("addItem",this.checboxCreate),this.parent.off("popupFullScreen",this.setPopupFullScreen))},e.prototype.listOption=function(e){var i=this;if(t.isNullOrUndefined(this.parent.listCurrentOptions.itemCreated))this.parent.listCurrentOptions.itemCreated=function(e){i.checboxCreate(e)};else{var s=this.parent.listCurrentOptions.itemCreated;this.parent.listCurrentOptions.itemCreated=function(e){i.checboxCreate(e),s.apply(i,[e])}}},e.prototype.setPlaceholder=function(e){a.Input.setPlaceholder(e.filterBarPlaceholder,this.filterInput)},e.prototype.checboxCreate=function(e){var i;if(i=t.isNullOrUndefined(e.item)?e:e.item,this.parent.enableGroupCheckBox||"e-list-group-item "!==i.className&&"e-list-group-item"!==i.className){var s=r.createCheckBox(this.parent.createElement,!0),l=t.select("div.e-icons",i);return i.insertBefore(s,i.childNodes[t.isNullOrUndefined(l)?0:1]),t.select(".e-frame",s),this.parent.enableGroupCheckBox&&this.parent.popupWrapper.classList.add("e-multiselect-group"),i}return i},e.prototype.setSelectAll=function(){this.parent.showSelectAll?(t.isNullOrUndefined(this.checkAllParent)&&(this.checkAllParent=this.parent.createElement("div",{className:"e-selectall-parent"}),this.selectAllSpan=this.parent.createElement("span",{className:"e-all-text"}),this.selectAllSpan.textContent="",this.checkAllParent.appendChild(this.selectAllSpan),this.setLocale(),this.checboxCreate(this.checkAllParent),this.parent.headerTemplate&&(t.isNullOrUndefined(this.parent.filterParent)?t.append([this.checkAllParent],this.parent.popupWrapper):t.append([this.checkAllParent],this.parent.filterParent)),this.parent.headerTemplate||(t.isNullOrUndefined(this.parent.filterParent)?t.prepend([this.checkAllParent],this.parent.popupWrapper):this.parent.filterParent.parentNode.insertBefore(this.checkAllParent,this.parent.filterParent.nextSibling)),t.EventHandler.add(this.checkAllParent,"mousedown",this.clickHandler,this)),this.parent.list.classList.contains("e-nodata")||this.parent.listData&&this.parent.listData.length<=1&&!this.parent.enableVirtualization&&!this.parent.isDynamicDataChange||this.parent.isDynamicDataChange&&this.parent.listData&&this.parent.listData.length<=1?this.checkAllParent.style.display="none":this.checkAllParent.style.display="block",this.parent.selectAllHeight=this.checkAllParent.getBoundingClientRect().height):t.isNullOrUndefined(this.checkAllParent)||(this.checkAllParent.parentElement.removeChild(this.checkAllParent),this.checkAllParent=null)},e.prototype.destroy=function(){this.removeEventListener(),t.EventHandler.remove(document,"mousedown",this.onDocumentClick),this.checkAllParent=null,this.clearIconElement=null,this.filterInput=null,this.filterInputObj=null,this.checkWrapper=null,this.selectAllSpan=null},e.prototype.listSelection=function(e){var i;if(t.isNullOrUndefined(e.e)){var s=e.li.querySelector(".e-checkbox-wrapper");i=s?s.childNodes[1]:e.li.lastElementChild.childNodes[1]}else{e.li.querySelector(".e-checkbox-wrapper .e-frame");i=t.isNullOrUndefined(e.e.target)?e.li.querySelector(".e-checkbox-wrapper").childNodes[1]:e.e.target.classList.contains("e-frame")&&(!this.parent.showSelectAll||this.checkAllParent&&!this.checkAllParent.contains(e.e.target))?e.e.target:e.li.querySelector(".e-checkbox-wrapper").childNodes[1]}if((this.parent.itemTemplate||this.parent.enableGroupCheckBox)&&(i=e.li.firstElementChild.childNodes[1]),t.isNullOrUndefined(i)||(this.checkWrapper=t.closest(i,".e-checkbox-wrapper")),!t.isNullOrUndefined(this.checkWrapper)){var l=t.select(".e-frame",this.checkWrapper);this.validateCheckNode(this.checkWrapper,l.classList.contains("e-check"),e.li,e.e,!1)}},e.prototype.validateCheckNode=function(e,t,i,s,l){this.changeState(e,t?"uncheck":"check",s,!0,l)},e.prototype.clickHandler=function(e){var i;i=e.currentTarget.classList.contains(this.checkAllParent.className)||e.currentTarget.classList.value===this.checkAllParent.className?e.currentTarget.firstElementChild.lastElementChild:e.currentTarget,this.checkWrapper=t.closest(i,".e-checkbox-wrapper");if(!t.isNullOrUndefined(this.checkWrapper)){var s=t.select(".e-frame",this.checkWrapper);this.validateCheckNode(this.checkWrapper,s.classList.contains("e-check"),null,e,!0)}e.preventDefault()},e.prototype.changeState=function(e,i,s,l,n){var a=e.getElementsByClassName("e-frame")[0];"check"!==i||a.classList.contains("e-check")?"uncheck"===i&&(a.classList.contains("e-check")||a.classList.contains("e-stop"))?(t.removeClass([a],["e-check","e-stop"]),n&&(this.parent.selectAllItems(!1,s),this.setLocale())):"indeterminate"!==i||a.classList.contains("e-stop")||(t.removeClass([a],["e-check"]),a.classList.add("e-stop"),n&&(this.parent.selectAllItems(!1,s),this.setLocale())):(a.classList.remove("e-stop"),a.classList.add("e-check"),n&&(this.parent.selectAllItems(!0,s),this.setLocale(!0)))},e.prototype.setSearchBox=function(e){if(t.isNullOrUndefined(this.parent.filterParent)){this.parent.filterParent=this.parent.createElement("span",{className:"e-filter-parent"}),this.filterInput=this.parent.createElement("input",{attrs:{type:"text"},className:"e-input-filter"}),this.parent.element.parentNode.insertBefore(this.filterInput,this.parent.element);var i=!1;return t.Browser.isDevice&&this.parent.isDeviceFullScreen&&(i=!0,this.parent.mobFilter=!1),this.filterInputObj=a.Input.createInput({element:this.filterInput,buttons:i?["e-input-group-icon e-back-icon e-icons","e-input-group-icon e-clear-icon e-icons"]:["e-input-group-icon e-clear-icon e-icons"],properties:{placeholder:this.parent.filterBarPlaceholder}},this.parent.createElement),t.isNullOrUndefined(this.parent.cssClass)||(-1!==this.parent.cssClass.split(" ").indexOf("e-outline")?t.addClass([this.filterInputObj.container],"e-outline"):-1!==this.parent.cssClass.split(" ").indexOf("e-filled")&&t.addClass([this.filterInputObj.container],"e-filled")),t.append([this.filterInputObj.container],this.parent.filterParent),t.prepend([this.parent.filterParent],e.popupElement),t.attributes(this.filterInput,{"aria-disabled":"false",role:"combobox",autocomplete:"off",autocapitalize:"off",spellcheck:"false","aria-label":"multiselect","aria-expanded":"true","aria-controls":e.popupElement.id}),this.clearIconElement=this.filterInput.parentElement.querySelector(".e-clear-icon"),!t.Browser.isDevice&&this.clearIconElement&&(t.EventHandler.add(this.clearIconElement,"mousedown",this.clearText,this),this.clearIconElement.style.visibility="hidden"),t.EventHandler.add(this.filterInput,"input",this.parent.onInput,this.parent),t.EventHandler.add(this.filterInput,"keyup",this.parent.keyUp,this.parent),t.EventHandler.add(this.filterInput,"keydown",this.parent.onKeyDown,this.parent),t.EventHandler.add(this.filterInput,"blur",this.onBlurHandler,this),t.EventHandler.add(this.filterInput,"paste",this.parent.pasteHandler,this.parent),this.parent.searchBoxHeight=this.filterInputObj.container.parentElement.getBoundingClientRect().height,this.filterInputObj}},e.prototype.clickOnBackIcon=function(e){this.parent.hidePopup(),t.removeClass([document.body,this.parent.popupObj.element],"e-popup-full-page"),this.parent.inputElement.focus()},e.prototype.clearText=function(e){this.parent.targetInputElement.value="",this.parent.allowFiltering&&""===this.parent.targetInputElement.value&&this.parent.search(null),this.parent.refreshListItems(null),this.parent.refreshPopup(),this.clearIconElement.style.visibility="hidden",this.filterInput.focus(),(!this.parent.enableVirtualization||this.parent.enableVirtualization&&(t.isNullOrUndefined(this.parent.value)||this.parent.value&&0===this.parent.value.length))&&this.setReorder(e),this.boundPreventListSelection=this.preventListSelection.bind(this),this.parent.popupWrapper.addEventListener("mouseup",this.boundPreventListSelection,!0),e.preventDefault()},e.prototype.preventListSelection=function(e){e.stopPropagation(),this.parent.popupWrapper.removeEventListener("mouseup",this.boundPreventListSelection,!0),this.boundPreventListSelection=null},e.prototype.setDeviceSearchBox=function(){this.parent.popupObj.element.classList.add("e-ddl-device"),this.parent.popupObj.element.classList.add("e-ddl-device-filter"),this.parent.popupObj.position={X:0,Y:0},this.parent.popupObj.dataBind(),this.setSearchBoxPosition(),this.backIconElement=this.filterInputObj.container.querySelector(".e-back-icon"),this.clearIconElement=this.filterInputObj.container.querySelector(".e-clear-icon"),this.clearIconElement.style.visibility="hidden",t.EventHandler.add(this.backIconElement,"click",this.clickOnBackIcon,this),t.EventHandler.add(this.clearIconElement,"click",this.clearText,this)},e.prototype.setSearchBoxPosition=function(){var e=this.filterInput.parentElement.getBoundingClientRect().height,i=0,s=0,l=0;this.checkAllParent&&(i=this.checkAllParent.getBoundingClientRect().height),this.parent.header&&(l=this.parent.header.getBoundingClientRect().height),this.parent.footer&&(s=this.parent.footer.getBoundingClientRect().height),this.parent.popupObj.element.style.maxHeight="100%",this.parent.popupObj.element.style.width="100%",this.parent.list.style.maxHeight=window.innerHeight-e-i-l-s+"px",this.parent.list.style.height=window.innerHeight-e-i-l-s+"px";var n=this.filterInput.parentElement.querySelector(".e-clear-icon");t.detach(this.filterInput),n.parentElement.insertBefore(this.filterInput,n)},e.prototype.setPopupFullScreen=function(){this.parent&&this.parent.popupObj&&(t.attributes(this.parent.popupObj.element,{style:"left:0px;right:0px;top:0px;bottom:0px;"}),t.addClass([document.body,this.parent.popupObj.element],"e-popup-full-page"),this.parent.popupObj.element.style.maxHeight="100%",this.parent.popupObj.element.style.width="100%")},e.prototype.targetElement=function(){return t.isNullOrUndefined(this.clearIconElement)||(this.parent.targetInputElement=this.filterInput,this.clearIconElement.style.visibility=""===this.parent.targetInputElement.value?"hidden":"visible"),this.parent.targetInputElement.value},e.prototype.onBlurHandler=function(e){if(!this.parent.element.classList.contains("e-listbox")){var i=void 0;if(this.parent.keyAction)return;if(t.Browser.isIE&&(i=!t.isNullOrUndefined(e)&&e.target),t.Browser.isIE||(i=!t.isNullOrUndefined(e)&&e.relatedTarget),this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&this.parent.popupObj.element.contains(i)&&!t.Browser.isIE&&this.filterInput)return void this.filterInput.focus();if(this.parent.scrollFocusStatus&&this.filterInput)return e.preventDefault(),this.filterInput.focus(),void(this.parent.scrollFocusStatus=!1);this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&!this.parent.popupObj.element.classList.contains("e-popup-close")&&(this.parent.inputFocus=!1,this.parent.updateValueState(e,this.parent.value,this.parent.tempValues),this.parent.dispatchEvent(this.parent.hiddenElement,"change")),this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&!this.parent.popupObj.element.classList.contains("e-popup-close")&&(this.parent.inputFocus=!1,this.parent.overAllWrapper.classList.remove("e-input-focus"),this.parent.trigger("blur"),this.parent.focused=!0),this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&!this.parent.popupObj.element.classList.contains("e-popup-close")&&!t.Browser.isDevice&&this.parent.hidePopup()}},e.prototype.onDocumentClick=function(e){if("listbox"!==this.parent.getLocaleName()){var i=e.target;!t.isNullOrUndefined(this.parent.popupObj)&&t.closest(i,'[id="'+this.parent.popupObj.element.id+'"]')&&(this.filterInput&&""!==this.filterInput.value||e.preventDefault()),!t.isNullOrUndefined(this.parent.popupObj)&&t.closest(i,'[id="'+this.parent.popupObj.element.id+'"]')||t.isNullOrUndefined(this.parent.overAllWrapper)||this.parent.overAllWrapper.contains(e.target)?this.parent.scrollFocusStatus=(t.Browser.isIE||"edge"===t.Browser.info.name)&&document.activeElement===this.filterInput:(this.parent.overAllWrapper.classList.contains(H.focus)||this.parent.isPopupOpen())&&(this.parent.inputFocus=!1,this.parent.scrollFocusStatus=!1,this.parent.hidePopup(),this.parent.onBlurHandler(e,!0),this.parent.focused=!0),t.isNullOrUndefined(this.parent.overAllWrapper)||this.parent.overAllWrapper.contains(e.target)||!this.parent.overAllWrapper.classList.contains("e-input-focus")||this.parent.isPopupOpen()||(t.Browser.isIE?this.parent.onBlurHandler():this.parent.onBlurHandler(e)),this.filterInput===i&&this.filterInput.focus()}},e.prototype.getFocus=function(e){if(this.parent.overAllWrapper.classList.remove("e-input-focus"),this.parent.keyAction&&"clear"!==e.value&&"focus"!==e.value)return void(this.parent.keyAction=!1);"focus"===e.value&&(this.filterInput.focus(),this.parent.removeFocus(),t.EventHandler.remove(this.parent.list,"keydown",this.parent.onKeyDown)),"clear"===e.value&&(this.filterInput.value="",this.clearIconElement.style.visibility="hidden")},e.prototype.checkSelectAll=function(e){"check"===e.value&&(this.changeState(this.checkAllParent,e.value,null,null,!1),this.setLocale(!0)),"uncheck"===e.value&&(this.changeState(this.checkAllParent,e.value,null,null,!1),this.setLocale()),"indeterminate"===e.value&&(this.changeState(this.checkAllParent,e.value,null,null,!1),this.setLocale())},e.prototype.setLocale=function(e){if("Select All"!==this.parent.selectAllText||"Unselect All"!==this.parent.unSelectAllText){var i=e?this.parent.unSelectAllText:this.parent.selectAllText;this.selectAllSpan.textContent="";for(var s=t.compile(i),l=e?"unSelectAllText":"selectAllText",n=0,a=s({},this.parent,l,null,!this.parent.isStringTemplate);n<a.length;n++){var r=a[n];this.selectAllSpan.textContent=r.textContent}}else{var o={selectAllText:"Select All",unSelectAllText:"Unselect All"},h=new t.L10n(this.parent.getLocaleName(),{},this.parent.locale);""===h.getConstant("selectAllText")&&(h=new t.L10n("dropdowns",o,this.parent.locale)),t.isNullOrUndefined(this.selectAllSpan)||(this.selectAllSpan.textContent=e?h.getConstant("unSelectAllText"):h.getConstant("selectAllText"))}},e.prototype.getActiveList=function(e){e.li.classList.contains("e-active")?this.activeLi.push(e.li.cloneNode(!0)):this.activeLi.splice(e.index,1)},e.prototype.setReorder=function(e){if(this.parent.enableSelectionOrder&&!t.isNullOrUndefined(this.parent.value)){var i=this.parent.ulElement.querySelectorAll("li.e-active").length,s=void 0,l=this.parent.createElement("ul",{className:"e-list-parent e-ul e-reorder"});if(i>0)if(this.parent.ulElement.querySelectorAll("li.e-active").forEach(function(e){l.appendChild(e)}),s=this.parent.ulElement.querySelectorAll("li.e-active"),t.addClass(s,"e-reorder-hide"),this.parent.enableVirtualization){var n=this.parent.list.querySelector(".e-virtual-ddl-content");t.prepend([l],n)}else t.prepend([l],this.parent.list);this.parent.focusAtFirstListItem()}},e}(),Ee=function(){var e=function(t,i){return(e=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])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),xe=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(l=e[r])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},Ie=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ee(i,e),xe([t.Property("Multiple")],i.prototype,"mode",void 0),xe([t.Property(!1)],i.prototype,"showCheckbox",void 0),xe([t.Property(!1)],i.prototype,"showSelectAll",void 0),xe([t.Property("Left")],i.prototype,"checkboxPosition",void 0),i}(t.ChildProperty),we=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ee(i,e),xe([t.Property([])],i.prototype,"items",void 0),xe([t.Property("Right")],i.prototype,"position",void 0),i}(t.ChildProperty),Oe=function(e){function l(t,i){var s=e.call(this,t,i)||this;return s.isValidKey=!1,s.isBackSpace=!1,s.isDataSourceUpdate=!1,s.keyDownStatus=!1,s}Ee(l,e),o=l,l.prototype.addItem=function(t,s){e.prototype.addItem.call(this,t,s),this.allowFiltering&&""!==this.filterInput.value&&this.filteringAction(this.jsonData,new i.Query,this.fields)},l.prototype.render=function(){if(this.isAngular&&this.allowFiltering){var i=this.element,s=i.cloneNode(!0);i.parentNode.replaceChild(s,i),this.element=s,t.setValue("ej2_instances",[this],this.element)}this.inputString="",this.initLoad=!0,this.isCustomFiltering=!1,this.initialSelectedOptions=this.value,this.inputFormName=this.element.getAttribute("name"),e.prototype.render.call(this),this.setEnabled(),this.renderComplete()},l.prototype.initWrapper=function(){var e=this.createElement("select",{className:"e-hidden-select",attrs:{multiple:""}});e.style.visibility="hidden",this.list.classList.add("e-listbox-wrapper"),this.list.querySelector(".e-list-parent").setAttribute("role","presentation");for(var i=this.list.querySelectorAll(".e-list-group-item"),s=0;s<i.length;s++)i[s].removeAttribute("tabindex"),i[s].setAttribute("role","option");this.itemTemplate&&this.list.classList.add("e-list-template"),this.list.classList.add("e-wrapper"),this.list.classList.add("e-lib"),"EJS-LISTBOX"===this.element.tagName?(this.element.setAttribute("tabindex","0"),this.initLoad&&this.element.appendChild(this.list)):(this.initLoad&&this.element.parentElement&&this.element.parentElement.insertBefore(this.list,this.element),this.list.insertBefore(this.element,this.list.firstChild),this.element.style.display="none"),this.list.insertBefore(e,this.list.firstChild),this.list.getElementsByClassName("e-list-item")[0]&&this.list.getElementsByClassName("e-list-item")[0].classList.remove(H.focus),this.itemTemplate&&this.renderReactTemplates(),t.removeClass([this.list],[H.content,H.root]),this.validationAttribute(this.element,e),this.list.setAttribute("role","listbox"),t.attributes(this.list,{role:"listbox","aria-label":"listbox","aria-multiselectable":"Multiple"===this.selectionSettings.mode?"true":"false"}),this.updateSelectionSettings()},l.prototype.updateSelectionSettings=function(){if(this.selectionSettings.showCheckbox&&this.selectionSettings.showSelectAll&&this.liCollections.length){var e=new t.L10n(this.getModuleName(),{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.locale);if(this.showSelectAll=!0,this.selectAllText=e.getConstant("selectAllText"),this.unSelectAllText=e.getConstant("unSelectAllText"),this.popupWrapper=this.list,this.checkBoxSelectionModule.checkAllParent=null,this.filterParent)if(this.filterParent.parentNode){var i=this.filterParent.querySelector("input.e-input-filter");i.classList.contains("e-input-focus")||i.classList.contains("e-valid-input")||0!==this.selectedListItemCount||(this.filterParent=null),this.selectedListItemCount>0&&this.showSelectAll&&(this.filterParent=null)}else this.filterParent=null;this.notify("selectAll",{})}},l.prototype.initDraggable=function(){var e=this;this.ulElement&&(this.ulElement.id=this.element.id+"_parent"),this.allowDragAndDrop&&new s.Sortable(this.ulElement,{scope:this.scope,itemClass:"e-list-item",beforeDragStart:this.triggerDragStart.bind(this),drag:this.triggerDrag.bind(this),beforeDrop:this.beforeDragEnd.bind(this),drop:this.dragEnd.bind(this),placeHolder:function(){return e.createElement("span",{className:"e-placeholder"})},helper:function(t){var i=e.list.cloneNode(),s=t.sender.cloneNode(!0);i.appendChild(s);var l=e.getItems()[0];return i.style.width=l.offsetWidth+"px",i.style.height=l.offsetHeight+"px",(e.value&&e.value.length)>1&&e.isSelected(s)&&s.appendChild(e.createElement("span",{className:"e-list-badge",innerHTML:e.value.length+""})),i.style.zIndex=n.getZindexPartial(e.element)+"",i}})},l.prototype.updateActionCompleteData=function(e,t,i){this.jsonData.splice(null===i?this.jsonData.length:i,0,t)},l.prototype.initToolbar=function(){var e=this.toolbarSettings.position,i=this.element.getAttribute("data-value");if(this.toolbarSettings.items=t.isNullOrUndefined(this.toolbarSettings.items)?[]:this.toolbarSettings.items,this.toolbarSettings.items.length){var s=this.createElement("div",{className:"e-listbox-tool",attrs:{role:"toolbar"}}),l=this.createElement("div",{className:"e-listboxtool-wrapper e-lib e-"+e.toLowerCase()});this.list.parentElement.insertBefore(l,this.list),l.appendChild("Right"===e?this.list:s),l.appendChild("Right"===e?s:this.list),this.createButtons(s),this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName())),this.scope?document.querySelector(this.scope).setAttribute("data-value",this.element.id):this.updateToolBarState()}var n=this.element.getAttribute("data-value");i&&n&&i!==n?(this.tBListBox=t.getComponent(document.getElementById(i),this.getModuleName()),this.tBListBox.updateToolBarState()):n?(this.tBListBox=t.getComponent(document.getElementById(n),this.getModuleName()),this.tBListBox.updateToolBarState()):this.refreshing&&this.updateToolBarState()},l.prototype.createButtons=function(e){var i,s,l,n=this,a=new t.L10n(this.getModuleName(),{moveUp:"Move Up",moveDown:"Move Down",moveTo:"Move To",moveFrom:"Move From",moveAllTo:"Move All To",moveAllFrom:"Move All From"},this.locale);this.toolbarSettings.items.forEach(function(t){l=a.getConstant(t),s=n.createElement("button",{attrs:{type:"button","data-value":t,title:l,"aria-label":l}}),e.appendChild(s),(i=new r.Button({iconCss:"e-icons e-"+t.toLowerCase()},s)).createElement=n.createElement})},l.prototype.validationAttribute=function(t,i){this.inputFormName&&t.setAttribute("name",this.inputFormName),e.prototype.validationAttribute.call(this,t,i),i.required=t.required,t.required=!1},l.prototype.setHeight=function(){(this.toolbarSettings.items.length?this.list.parentElement:this.list).style.height=t.formatUnit(this.height),this.allowFiltering&&this.height.toString().indexOf("%")>0?t.addClass([this.list],"e-filter-list"):t.removeClass([this.list],"e-filter-list")},l.prototype.setCssClass=function(){var e=this.toolbarSettings.items.length?this.list.parentElement:this.list;this.cssClass&&t.addClass([e],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.enableRtl&&t.addClass([this.list],"e-rtl")},l.prototype.setEnable=function(){var e=this.toolbarSettings.items.length?this.list.parentElement:this.list;this.enabled?t.removeClass([e],s.cssClass.disabled):t.addClass([e],s.cssClass.disabled)},l.prototype.showSpinner=function(){this.spinner||(this.spinner=this.createElement("div",{className:"e-listbox-wrapper"})),this.spinner.style.height=t.formatUnit(this.height),this.element.parentElement&&this.element.parentElement.insertBefore(this.spinner,this.element.nextSibling),n.createSpinner({target:this.spinner},this.createElement),n.showSpinner(this.spinner)},l.prototype.hideSpinner=function(){this.spinner.querySelector(".e-spinner-pane")&&n.hideSpinner(this.spinner),this.spinner.parentElement&&t.detach(this.spinner)},l.prototype.onInput=function(){this.isDataSourceUpdate=!1,this.keyDownStatus?this.isValidKey=!0:this.isValidKey=!1,this.keyDownStatus=!1,this.refreshClearIcon()},l.prototype.clearText=function(){this.filterInput.value="",this.refreshClearIcon();var e=document.createEvent("KeyboardEvent");this.isValidKey=!0,this.KeyUp(e)},l.prototype.refreshClearIcon=function(){this.filterInput.parentElement.querySelector("."+Ae.clearIcon)&&(this.filterInput.parentElement.querySelector("."+Ae.clearIcon).style.visibility=""===this.filterInput.value?"hidden":"visible")},l.prototype.onActionComplete=function(i,s,l){var n,a,r,o=this;if(this.allowFiltering&&this.list.getElementsByClassName("e-filter-parent")[0]&&(n=this.list.getElementsByClassName("e-filter-parent")[0].cloneNode(!0)),0===s.length){var h=i.childNodes[0];h&&i.removeChild(h)}if(this.allowFiltering&&(a=this.list.getElementsByClassName("e-input-filter")[0])&&(r=a.selectionStart),e.prototype.onActionComplete.call(this,i,s,l),this.initWrapper(),this.allowFiltering&&!t.isNullOrUndefined(n)){this.list.insertBefore(n,this.list.firstElementChild),this.filterParent=this.list.getElementsByClassName("e-filter-parent")[0],this.filterWireEvents(n);var u=n.querySelector(".e-input-filter");u&&(u.addEventListener("focus",function(){n.childNodes[0].classList.contains("e-input-focus")||n.childNodes[0].classList.add("e-input-focus")}),u.addEventListener("blur",function(){n.childNodes[0].classList.contains("e-input-focus")&&n.childNodes[0].classList.remove("e-input-focus")}))}if(this.setSelection(this.value,!0,!1,!this.isRendered),this.initDraggable(),this.mainList=this.ulElement,this.initLoad)this.jsonData=[],t.extend(this.jsonData,s,[]),this.initToolbarAndStyles(),this.wireEvents(),this.showCheckbox&&this.setCheckboxPosition(),this.allowFiltering&&this.setFiltering();else if(this.isDataSourceUpdate&&(this.jsonData=[],t.extend(this.jsonData,s,[]),this.isDataSourceUpdate=!1),this.allowFiltering){if(a=this.list.getElementsByClassName("e-input-filter")[0],t.isNullOrUndefined(a))return;a.selectionStart=r,a.selectionEnd=r,(""!==a.value||""===a.value&&this.isBackSpace)&&(a.focus(),setTimeout(function(){o.isBackSpace=!1}))}if(this.toolbarSettings.items.length&&this.scope&&this.scope.indexOf("#")>-1&&!t.isNullOrUndefined(l)){var p=this.scope.replace("#","");t.getComponent(document.getElementById(p),this.getModuleName()).initToolbar()}this.initLoad=!1},l.prototype.initToolbarAndStyles=function(){this.initToolbar(),this.setCssClass(),this.setEnable(),this.setHeight()},l.prototype.triggerDragStart=function(e){var i,s=this,l=t.extend(this.getDragArgs(e),{dragSelected:!0},{cancel:!1});t.Browser.isIos&&(this.list.style.overflow="hidden"),this.trigger("dragStart",l,function(l){s.allowDragAll=l.dragSelected,s.allowDragAll||(i=s.ulElement.getElementsByClassName("e-list-badge")[0])&&t.detach(i),l.cancel&&(e.cancel=!0)})},l.prototype.triggerDrag=function(e){var t,i,s=this,l=10;if(this.itemTemplate&&e.target)if(e.target&&e.target.closest(".e-list-item"))l=e.target.closest(".e-list-item").scrollHeight;else{var n=e.element.querySelector(".e-list-item");n&&(l=n.scrollHeight)}var a,r=e.event;this.stopTimer(),e.target&&(e.target.classList.contains("e-listbox-wrapper")||e.target.classList.contains("e-list-item")||e.target.classList.contains("e-filter-parent")||e.target.classList.contains("e-input-group")||e.target.closest(".e-list-item"))&&(a=e.target.classList.contains("e-list-item")||e.target.classList.contains("e-filter-parent")||e.target.classList.contains("e-input-group")||e.target.closest(".e-list-item")?e.target.closest(".e-listbox-wrapper"):e.target,(t=this.allowFiltering?a.querySelector(".e-list-parent"):a)&&((i=t.getBoundingClientRect()).y+t.offsetHeight-(r.clientY+36)<1?this.timer=window.setInterval(function(){s.setScrollDown(t,l,!0)},70):r.clientY-36-i.y<1&&(this.timer=window.setInterval(function(){s.setScrollDown(t,l,!1)},70)))),null!==e.target&&this.trigger("drag",this.getDragArgs(e))},l.prototype.setScrollDown=function(e,t,i){e.scrollTop=i?e.scrollTop+t:e.scrollTop-t},l.prototype.stopTimer=function(){window.clearInterval(this.timer)},l.prototype.beforeDragEnd=function(e){this.stopTimer();var i=[];this.dragValue=this.getFormattedValue(e.droppedElement.getAttribute("data-value")),this.value.indexOf(this.dragValue)>-1?e.items=this.getDataByValues(this.value):e.items=this.getDataByValues([this.dragValue]),t.extend(i,e.items),this.trigger("beforeDrop",e),JSON.stringify(e.items)!==JSON.stringify(i)&&(this.customDraggedItem=e.items)},l.prototype.dragEnd=function(e){var i,s,l,n,a,r,o=this,h=this.getFormattedValue(e.droppedElement.getAttribute("data-value")),u=this.getComponent(e.droppedElement),p=this.getDragArgs({target:e.droppedElement},!0),d={previousData:this.dataSource},c={previousData:u.dataSource},m=t.extend({},p,{target:e.target,source:{previousData:this.dataSource},previousIndex:e.previousIndex,currentIndex:e.currentIndex});if(u!==this){L=t.extend(d,{currentData:this.listData});m=t.extend(m,{source:L,destination:c})}t.Browser.isIos&&(this.list.style.overflow="");var f=this.getComponent(e.target);if(f&&0===f.listData.length){var v=f.ulElement.childNodes[0];v&&f.allowDragAndDrop&&f.ulElement.removeChild(v)}if(u===this){var g=this.ulElement;i=[].slice.call(this.listData),s=[].slice.call(this.liCollections),l=[].slice.call(this.jsonData),r=[].slice.call(this.sortedData);var y=e.currentIndex,C=e.currentIndex=this.getCurIdx(this,e.currentIndex),b=i.indexOf(this.getDataByValue(h)),S=l.indexOf(this.getDataByValue(h)),E=r.indexOf(this.getDataByValue(h));i.splice(C,0,i.splice(b,1)[0]),r.splice(y,0,r.splice(E,1)[0]),l.splice(C,0,l.splice(S,1)[0]),s.splice(C,0,s.splice(b,1)[0]),this.allowDragAll&&(a=this.value&&Array.prototype.indexOf.call(this.value,h)>-1?this.value:[h],t.isNullOrUndefined(this.customDraggedItem)||(a=[],this.customDraggedItem.forEach(function(e){a.push(t.getValue(o.fields.value,e))})),a.forEach(function(e){if(e!==h){var t=i.indexOf(o.getDataByValue(e)),n=l.indexOf(o.getDataByValue(e)),a=r.indexOf(o.getDataByValue(e));t>C&&C++,l.splice(C,0,l.splice(n,1)[0]),i.splice(C,0,i.splice(t,1)[0]),r.splice(y,0,r.splice(a,1)[0]),s.splice(C,0,s.splice(t,1)[0]),g.insertBefore(o.getItems()[o.getIndexByValue(e)],g.getElementsByClassName("e-placeholder")[0])}})),this.listData=i,this.jsonData=l,this.sortedData=r,this.liCollections=s}else{var x,I=[].slice.call(this.liCollections),w=e.currentIndex=this.getCurIdx(u,e.currentIndex),O=u.ulElement;i=[].slice.call(u.listData),s=[].slice.call(u.liCollections),l=[].slice.call(u.jsonData),r=[].slice.call(u.sortedData),a=this.value&&Array.prototype.indexOf.call(this.value,h)>-1&&this.allowDragAll?this.value:[h],t.isNullOrUndefined(this.customDraggedItem)||(a=[],this.customDraggedItem.forEach(function(e){a.push(t.getValue(o.fields.value,e))}));var A=[].slice.call(this.listData),D=[].slice.call(this.sortedData);if(a.forEach(function(t){n=o.getDataByValue(t);var a=o.listData.indexOf(n),u=o.jsonData.indexOf(n),p=o.sortedData.indexOf(n);A.splice(a,1),o.jsonData.splice(u,1),D.splice(p,1),o.listData=A,o.sortedData=D;var d=t===h?e.currentIndex:w;if(i.splice(d,0,n),l.splice(d,0,n),r.splice(d,0,n),s.splice(d,0,I.splice(a,1)[0]),t)x=o.getItems()[o.getIndexByValue(t)];else for(var c=o.getItems(),m=0;m<c.length;m++)if(null===c[m].getAttribute("data-value")&&c[m].classList.contains("e-list-item")){x=c[m];break}x||(x=e.helper),o.removeSelected(o,t===h?[e.droppedElement]:[x]),O.insertBefore(x,O.getElementsByClassName("e-placeholder")[0]),w++}),this.fields.groupBy){N=this.renderItems(this.listData,this.fields);this.updateListItems(N,this.ulElement),this.setSelection()}if("None"!==u.sortOrder||this.selectionSettings.showCheckbox!==u.selectionSettings.showCheckbox||u.fields.groupBy||u.itemTemplate||this.itemTemplate){var k=t.getComponent(O,"sortable"),N=u.renderItems(i,u.fields);u.updateListItems(N,O),this.setSelection(),k.placeHolderElement&&O.appendChild(k.placeHolderElement),O.appendChild(e.helper),u.setSelection()}this.liCollections=I,u.liCollections=s,u.jsonData=t.extend([],[],l,!1),u.listData=t.extend([],[],i,!1),"None"===u.sortOrder&&(u.sortedData=t.extend([],[],r,!1)),0===this.listData.length&&this.l10nUpdate()}if(this===u){var L=t.extend(d,{currentData:i});m=t.extend(m,{source:L})}else{var T=t.extend(c,{currentData:i});m=t.extend(m,{destination:T})}t.isNullOrUndefined(this.customDraggedItem)||(m.items=this.customDraggedItem),this.trigger("drop",m);var B=m.elements;if(B.length)for(var V=0;V<B.length;V++)B[V].classList.remove("e-grabbed");this.toolbarSettings.items.length>0?this.updateToolBarState():this.tBListBox&&this.tBListBox.toolbarSettings.items.length>0&&this.tBListBox.updateToolBarState()},l.prototype.updateListItems=function(e,t){t.innerHTML="",t.append.apply(t,e.childNodes)},l.prototype.removeSelected=function(e,i){e.selectionSettings.showCheckbox?i.forEach(function(e){e.getElementsByClassName("e-frame")[0].classList.remove("e-check")}):t.removeClass(i,s.cssClass.selected)},l.prototype.getCurIdx=function(e,t){return e.fields.groupBy&&(t-=[].slice.call(e.ulElement.children).slice(0,t).filter(function(e){return e.classList.contains(s.cssClass.group)}).length),t},l.prototype.getComponent=function(e){var i,s="EJS-LISTBOX"===this.element.tagName?t.closest(e,".e-listbox"):t.closest(e,".e-listbox-wrapper")&&t.closest(e,".e-listbox-wrapper").querySelector(".e-listbox");return s&&(i=t.getComponent(s,this.getModuleName())),i},l.prototype.setEnabled=function(){this.element.setAttribute("aria-disabled",this.enabled?"false":"true")},l.prototype.listOption=function(i,s){return this.listCurrentOptions=e.prototype.listOption.call(this,i,s),this.listCurrentOptions=t.extend({},this.listCurrentOptions,{itemCreated:this.triggerBeforeItemRender.bind(this)},!0),this.notify("listoption",{module:"CheckBoxSelection"}),this.listCurrentOptions},l.prototype.triggerBeforeItemRender=function(e){e.item.setAttribute("tabindex","-1"),this.trigger("beforeItemRender",{element:e.item,item:e.curData})},l.prototype.requiredModules=function(){var e=[];return this.selectionSettings.showCheckbox&&e.push({member:"CheckBoxSelection",args:[this]}),e},l.prototype.enableItems=function(e,i,l){var n=this;void 0===i&&(i=!0);var a;if(e.forEach(function(e){var r=e;(a=n.findListElement(n.list,"li","data-value",l?r:n.getValueByText(r)))&&(i?(t.removeClass([a],s.cssClass.disabled),a.removeAttribute("aria-disabled")):(t.addClass([a],s.cssClass.disabled),a.setAttribute("aria-disabled","true")))}),this.allowFiltering&&this.filterInput&&""!==this.filterInput.value&&this.toolbarSettings.items.length>0){var r=!1;this.ulElement.childNodes.forEach(function(e){e.classList.contains("e-disabled")||(r=!0)}),r||(this.list.parentElement.getElementsByClassName("e-listbox-tool")[0].querySelector('[data-value="moveAllTo"]').disabled=!0)}},l.prototype.selectItems=function(e,i,l){void 0===i&&(i=!0),i&&!this.selectionSettings.showCheckbox&&"Single"===this.selectionSettings.mode&&this.getSelectedItems().forEach(function(e){e.classList.remove("e-active"),e.removeAttribute("aria-selected"),t.removeClass([e],s.cssClass.selected)}),this.setSelection(e,i,!l),this.updateSelectedOptions();for(var n=[],a=0;a<e.length;a++)for(var r=this.list.querySelectorAll('[aria-selected="true"]'),o=0;o<r.length;o++)e[a]===this.getFormattedValue(r[o].getAttribute("data-value"))&&n.push(r[o]);this.triggerChange(n,null)},l.prototype.selectAll=function(e){void 0===e&&(e=!0),this.selectAllItems(e)},l.prototype.addItems=function(t,s){e.prototype.addItem.call(this,t,s),this.allowFiltering&&""!==this.filterInput.value&&this.filteringAction(this.jsonData,new i.Query,this.fields)},l.prototype.removeItems=function(e,t){this.removeItem(e,t)},l.prototype.removeItem=function(e,i){var s=this,l=[],n=this.list.querySelectorAll("."+H.li);if(e){e=e instanceof Array?e:[e];var a=this.fields,r=void 0,o={},h=[];t.extend(h,[],this.jsonData);for(var u=[],p=[],d=0;d<h.length;d++)o[h[d]instanceof Object?h[d][a.value]:h[d].toString()]=d;for(var c=0;c<e.length;c++)if(r=e[c]instanceof Object?e[c][a.value]:e[c].toString(),Object.prototype.hasOwnProperty.call(o,r)){var m=o[r];l.push(n[m]),u.push(m),p.push(m)}u.sort(function(e,t){return t-e}).forEach(function(e){s.listData.splice(e,1),s.jsonData.splice(e,1)});for(var f=p.length-1;f>=0;f--)this.updateLiCollection(p[f])}else i=i||0,l.push(n[i]),this.listData.splice(i,1),this.jsonData.splice(i,1),this.updateLiCollection(i);for(d=0;d<l.length;d++)this.ulElement.removeChild(l[d]);0===this.listData.length&&this.l10nUpdate(),this.listData.length!==this.sortedData.length&&(this.sortedData=this.listData),this.value=[],this.updateToolBarState()},l.prototype.getDataByValues=function(e){for(var t=[],i=0;i<e.length;i++)t.push(this.getDataByValue(e[i]));return t},l.prototype.moveUp=function(e){var t=e?this.getElemByValue(e):this.getSelectedItems();this.moveUpDown(!0,!1,t)},l.prototype.moveDown=function(e){var t=e?this.getElemByValue(e):this.getSelectedItems();this.moveUpDown(!1,!1,t)},l.prototype.moveTop=function(e){var t=e?this.getElemByValue(e):this.getSelectedItems();this.moveUpDown(null,!1,t,!0)},l.prototype.moveBottom=function(e){var t=e?this.getElemByValue(e):this.getSelectedItems();this.moveUpDown(!0,!1,t,!1,!0)},l.prototype.moveTo=function(e,i,s){var l=e?this.getElemByValue(e):this.getSelectedItems(),n=s?t.getComponent(s,o):this.getScopedListBox();this.moveData(this,n,!1,l,i)},l.prototype.moveAllTo=function(e,i){if(this.toolbarAction="moveAllTo",this.listData.length>0){var s=e?t.getComponent(e,o):this.getScopedListBox();this.moveAllData(this,s,!1,i)}},l.prototype.getDataList=function(){return this.jsonData},l.prototype.getSortedList=function(){var e,t;if(e=t=this.sortedData,this.fields.groupBy){e=[];for(var i=0;i<t.length;i++)t[i].isHeader||e.push(t[i])}return e},l.prototype.getElemByValue=function(e){for(var t=[],i=0;i<e.length;i++)t.push(this.ulElement.querySelector('[data-value ="'+e[i]+'"]'));return t},l.prototype.updateLiCollection=function(e){var t=[].slice.call(this.liCollections);t.splice(e,1),this.liCollections=t},l.prototype.selectAllItems=function(e,t){var i=this;if([].slice.call(this.getItems()).forEach(function(t){if(!t.classList.contains(s.cssClass.disabled))if(i.selectionSettings.showCheckbox){var l=t.getElementsByClassName("e-check")[0];(!l&&e||l&&!e)&&(i.notify("updatelist",{li:t,module:"listbox"}),i.maximumSelectionLength>=i.list.querySelectorAll(".e-list-item span.e-check").length&&i.checkMaxSelection())}else e?t.classList.add(s.cssClass.selected):t.classList.remove(s.cssClass.selected)}),this.updateSelectedOptions(),this.allowFiltering&&this.selectionSettings.showCheckbox){var l=this.list.getElementsByTagName("li"),n=0;if(e){var a=this;for(n=0;n<l.length;n++)!function(){var e=a.getFormattedValue(l[n].getAttribute("data-value"));a.value.some(function(t){return t===e})||a.value.push(a.getFormattedValue(l[n].getAttribute("data-value")))}()}else{var r=this;for(n=0;n<l.length;n++)!function(){var e=r.getFormattedValue(l[n].getAttribute("data-value"));r.value=r.value.filter(function(t){return t!==e})}()}document.querySelectorAll("ul").length<2&&this.updateMainList()}this.triggerChange(this.getSelectedItems(),t)},l.prototype.updateMainList=function(){var e=this.mainList.querySelectorAll(".e-list-item"),t=this.ulElement.querySelectorAll(".e-list-item"),i=e.length,s=t.length;if(this.selectionSettings.showCheckbox||document.querySelectorAll("ul").length>1||i!==s){var l=0,n=0,a=0;for(l;l<i;){if(this.value)for(n;n<this.value.length;n++)e[l].getAttribute("data-value")===this.value[n]&&a++;!a&&this.selectionSettings.showCheckbox&&e[l].getElementsByClassName("e-frame")[0].classList.remove("e-check"),document.querySelectorAll("ul").length>1&&a&&i!==s?(this.mainList.removeChild(this.mainList.getElementsByTagName("li")[l]),l=0):l++,a=0,n=0}}},l.prototype.wireEvents=function(){var e=t.closest(this.element,"form"),i="EJS-LISTBOX"===this.element.tagName?this.element:this.list;t.EventHandler.add(this.list,"click",this.clickHandler,this),t.EventHandler.add(i,"keydown",this.keyDownHandler,this),t.EventHandler.add(i,"focusout",this.focusOutHandler,this),this.wireToolbarEvent(),this.selectionSettings.showCheckbox&&t.EventHandler.remove(document,"mousedown",this.checkBoxSelectionModule.onDocumentClick),(this.fields.groupBy||this.element.querySelector("select>optgroup"))&&t.EventHandler.remove(this.list,"scroll",this.setFloatingHeader),e&&t.EventHandler.add(e,"reset",this.formResetHandler,this),window.addEventListener("resize",this.resizeHandler.bind(this))},l.prototype.wireToolbarEvent=function(){this.toolbarSettings.items.length&&t.EventHandler.add(this.getToolElem(),"click",this.toolbarClickHandler,this)},l.prototype.unwireEvents=function(){var e=t.closest(this.element,"form"),i="EJS-LISTBOX"===this.element.tagName?this.element:this.list;t.EventHandler.remove(this.list,"click",this.clickHandler),t.EventHandler.remove(i,"keydown",this.keyDownHandler),t.EventHandler.remove(i,"focusout",this.focusOutHandler),this.allowFiltering&&this.clearFilterIconElem&&t.EventHandler.remove(this.clearFilterIconElem,"click",this.clearText),this.toolbarSettings.items.length&&t.EventHandler.remove(this.getToolElem(),"click",this.toolbarClickHandler),e&&t.EventHandler.remove(e,"reset",this.formResetHandler),window.removeEventListener("resize",this.resizeHandler.bind(this))},l.prototype.clickHandler=function(e){var i=t.closest(e.target,".e-list-item");t.isNullOrUndefined(i)||this.selectHandler(e)},l.prototype.checkSelectAll=function(){for(var e=0,t=this.list.querySelectorAll("li."+H.li),i=0;i<t.length;i++)t[i].classList.contains("e-disabled")||e++;var s=this.getSelectedItems().length;this.selectedListItemCount=s,this.showSelectAll&&e&&this.notify("checkSelectAll",{module:"CheckBoxSelection",value:e===s?"check":0===s?"uncheck":"indeterminate"})},l.prototype.getQuery=function(e){var t=e?e.clone():this.query?this.query.clone():new i.Query;if(this.allowFiltering){var s=""===this.inputString?"contains":this.filterType,l=this.typeOfData(this.dataSource).typeof;if(null===l&&(l=this.typeOfData(this.jsonData).typeof),(this.dataSource instanceof i.DataManager||"string"!==l)&&"number"!==l){var n=this.fields.text?this.fields.text:"";t.where(n,s,this.inputString,this.ignoreCase,this.ignoreAccent)}else t.where("",s,this.inputString,this.ignoreCase,this.ignoreAccent)}else t=e||(this.query?this.query:new i.Query);return t},l.prototype.setFiltering=function(){var e;if(this.initLoad||t.isNullOrUndefined(this.filterParent))return this.filterParent=this.createElement("span",{className:Ae.filterParent}),this.filterInput=this.createElement("input",{attrs:{type:"text"},className:Ae.filterInput}),this.element.parentNode.insertBefore(this.filterInput,this.element),e=a.Input.createInput({element:this.filterInput,buttons:[Ae.filterBarClearIcon],properties:{placeholder:this.filterBarPlaceholder}},this.createElement),t.append([e.container],this.filterParent),t.prepend([this.filterParent],this.list),t.attributes(this.filterInput,{"aria-disabled":"false","aria-label":"search list item",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",role:"textbox"}),this.height.toString().indexOf("%")<0?t.addClass([this.list],"e-filter-list"):this.height.toString().indexOf("%")>0&&(this.ulElement.style.height=this.ulElement.offsetHeight-this.filterParent.offsetHeight+"px"),this.inputString=this.filterInput.value,this.filterWireEvents(),e},l.prototype.filterWireEvents=function(e){e&&(this.filterInput=e.querySelector(".e-input-filter")),this.clearFilterIconElem=this.filterInput.parentElement.querySelector("."+Ae.clearIcon),this.clearFilterIconElem&&(t.EventHandler.add(this.clearFilterIconElem,"click",this.clearText,this),e||(this.clearFilterIconElem.style.visibility="hidden")),t.EventHandler.add(this.filterInput,"input",this.onInput,this),t.EventHandler.add(this.filterInput,"keyup",this.KeyUp,this),t.EventHandler.add(this.filterInput,"keydown",this.onKeyDown,this)},l.prototype.selectHandler=function(e,i){var l,n=!0,a=t.closest(e.target,".e-list-item"),r=[a];if(a&&a.parentElement){if(l=[].slice.call(a.parentElement.children).indexOf(a),this.selectionSettings.showCheckbox?n=!a.getElementsByClassName("e-frame")[0].classList.contains("e-check"):(e.ctrlKey||e.metaKey||t.Browser.isDevice)&&this.isSelected(a)?(a.classList.remove(s.cssClass.selected),a.removeAttribute("aria-selected"),n=!1):"Multiple"===this.selectionSettings.mode&&(e.ctrlKey||e.metaKey||t.Browser.isDevice)||(this.getSelectedItems().forEach(function(e){e.removeAttribute("aria-selected")}),t.removeClass(this.getSelectedItems(),s.cssClass.selected)),e.shiftKey&&!this.selectionSettings.showCheckbox&&"Single"!==this.selectionSettings.mode?r=[].slice.call(a.parentElement.children).slice(Math.min(l,this.prevSelIdx),Math.max(l,this.prevSelIdx)+1).filter(function(e){return e.classList.contains("e-list-item")}):this.prevSelIdx=[].slice.call(a.parentElement.children).indexOf(a),n?(this.selectionSettings.showCheckbox||t.addClass(r,s.cssClass.selected),r.forEach(function(e){e.setAttribute("aria-selected","true")}),this.list.setAttribute("aria-activedescendant",a.id)):r.forEach(function(e){e.setAttribute("aria-selected","false")}),i||!(this.maximumSelectionLength>(this.value&&this.value.length))&&n||!(this.maximumSelectionLength>=(this.value&&this.value.length))&&n||this.maximumSelectionLength<(this.value&&this.value.length)||this.notify("updatelist",{li:a,e:e,module:"listbox"}),this.allowFiltering&&!i){var o=this.getFormattedValue(a.getAttribute("data-value"));if(n){var h=[];t.extend(h,this.value),h.push(o),this.value=h}else this.value=this.value.filter(function(e){return e!==o});document.querySelectorAll("ul").length<2&&this.updateMainList()}this.updateSelectedOptions(),this.triggerChange(this.getSelectedItems(),e),this.list&&this.checkMaxSelection()}},l.prototype.triggerChange=function(e,t){this.trigger("change",{elements:e,items:this.getDataByElements(e),value:this.value,event:t})},l.prototype.getDataByElems=function(e){for(var t=[],i=e.length,s=0;s<i;s++){var l=e[s].getAttribute("data-value"),n=this.getFormattedValue(l);t.push(this.getDataByValue(n))}return t},l.prototype.getDataByElements=function(e){var i,s=[],l=0;if(!t.isNullOrUndefined(this.listData)){var n=this.typeOfData(this.listData).typeof;if("string"===n||"number"===n||"boolean"===n)for(var a=0,r=this.listData;a<r.length;a++){for(var o=r[a],h=l,u=e.length;h<u;h++)if(i=this.getFormattedValue(e[h].getAttribute("data-value")),!t.isNullOrUndefined(o)&&o===i){l=h,s.push(o);break}if(e.length===s.length)break}else for(var p=0,d=this.listData;p<d.length;p++){for(var o=d[p],h=l,u=e.length;h<u;h++)if(i=this.getFormattedValue(e[h].getAttribute("data-value")),!t.isNullOrUndefined(o)&&t.getValue(this.fields.value?this.fields.value:"value",o)===i){l=h,s.push(o);break}if(e.length===s.length)break}return s}return null},l.prototype.checkMaxSelection=function(){var e=this.list.querySelectorAll(".e-list-item span.e-check").length;if(this.selectionSettings.showCheckbox){var t=0,i=this.list.getElementsByClassName("e-list-item");for(t;t<i.length;t++)i[t].querySelector(".e-frame.e-check")||(e===this.maximumSelectionLength?i[t].classList.add("e-disable"):i[t].classList.contains("e-disable")&&i[t].classList.remove("e-disable"))}},l.prototype.toolbarClickHandler=function(e){var i=t.closest(e.target,"button");if(i){if(this.toolbarAction=i.getAttribute("data-value"),i.disabled)return;switch(this.toolbarAction){case"moveUp":this.moveUpDown(!0);break;case"moveDown":this.moveUpDown();break;case"moveTo":this.moveItemTo();break;case"moveFrom":this.moveItemFrom();break;case"moveAllTo":this.moveAllItemTo();break;case"moveAllFrom":this.moveAllItemFrom();break;default:this.trigger("actionBegin",{cancel:!1,items:this.getDataByElems(this.getSelectedItems()),eventName:this.toolbarAction})}}},l.prototype.moveUpDown=function(e,t,i,l,n){var a=this,r=this.getSelectedItems();if(i&&(r=i),!(e&&this.isSelected(this.ulElement.firstElementChild)||!e&&this.isSelected(this.ulElement.lastElementChild))||i){var o=this.getDataByElems(r),h={cancel:!1,items:o,eventName:this.toolbarAction};this.trigger("actionBegin",h),h.cancel||((e?r:r.reverse()).forEach(function(t){var i=Array.prototype.indexOf.call(a.ulElement.querySelectorAll(".e-list-item"),t),r=Array.prototype.indexOf.call(a.ulElement.children,t);l?(s.moveTo(a.ulElement,a.ulElement,[r],0),a.changeData(r,0,i,t)):n?(s.moveTo(a.ulElement,a.ulElement,[r],a.ulElement.querySelectorAll(".e-list-item").length),a.changeData(r,a.ulElement.querySelectorAll(".e-list-item").length,i,t)):(s.moveTo(a.ulElement,a.ulElement,[r],e?r-1:r+2),a.changeData(r,e?r-1:r+1,e?i-1:i+1,t))}),this.trigger("actionComplete",{items:o,eventName:this.toolbarAction}),r[0].focus(),!t&&this.toolbarSettings.items.length&&this.getToolElem().querySelector("[data-value="+(e?"moveUp":"moveDown")+"]").focus(),this.updateToolBarState())}},l.prototype.moveItemTo=function(){this.moveData(this,this.getScopedListBox())},l.prototype.moveItemFrom=function(){this.moveData(this.getScopedListBox(),this)},l.prototype.moveData=function(e,i,l,n,a){var r=[],o=[],h=[],u=[],p=[].slice.call(e.listData),d=[].slice.call(i.listData),c=[].slice.call(e.sortedData),m=[].slice.call(i.sortedData),f=[].slice.call(e.liCollections),v=[],g=[].slice.call(i.liCollections),y=[],C=[],b=e.getSelectedItems();n&&(b=n);var S="None"!==i.sortOrder||i.selectionSettings.showCheckbox!==e.selectionSettings.showCheckbox||i.fields.groupBy||i.itemTemplate||e.itemTemplate;if(e.value=[],b.length){this.removeSelected(e,b);var E,x=Array.prototype.slice.call(e.ulElement.children),I=Array.prototype.slice.call(e.ulElement.querySelectorAll(".e-list-item")),w=e.listData,O=e.sortedData,A=e.jsonData,D={};if(b.length>199)for(var k=0,N=e.listData;k<N.length;k++){var L=N[k];if(!t.isNullOrUndefined(L)){var T=e.getFormattedValue(t.getValue(e.fields.value?e.fields.value:"value",L));D[T]=L}}b.forEach(function(t){if(b.length<200)E=e.getDataByElems([t])[0];else{var i=t.getAttribute("data-value"),s=e.getFormattedValue(i);E=D[s]}r.push(x.indexOf(t)),v.push(I.indexOf(t)),o.push(w.indexOf(E)),u.push(O.indexOf(E)),h.push(A.indexOf(E))}),"None"!==this.sortOrder?u.forEach(function(t){y.push(e.sortedData[t])}):h.forEach(function(t){y.push(e.jsonData[t])});var B={cancel:!1,items:y,eventName:this.toolbarAction};if(e.trigger("actionBegin",B),B.cancel)return;var V=[];if(v.sort(function(e,t){return e-t}).reverse().forEach(function(e){V.push(f.splice(e,1)[0])}),e.liCollections=f,a){var P=g.splice(0,a);i.liCollections=P.concat(V.reverse()).concat(g)}else i.liCollections=g.concat(V.reverse());if(0===i.listData.length){var H=i.ulElement.childNodes[0];H&&i.ulElement.removeChild(H)}if(o.sort(function(e,t){return t-e}).forEach(function(e){p.splice(e,1)[0]}),u.sort(function(e,t){return t-e}).forEach(function(e){c.splice(e,1)[0]}),h.slice().reverse().forEach(function(t){C.push(e.jsonData.splice(t,1)[0])}),S)if(e.fields.groupBy){W=e.renderItems(p,e.fields);e.updateListItems(W,e.ulElement)}else b.forEach(function(e){t.detach(e)});else s.moveTo(e.ulElement,i.ulElement,r,a),e.trigger("actionComplete",{items:y,eventName:this.toolbarAction});i.mainList.childElementCount!==i.jsonData.length&&(i.mainList=i.ulElement);var U=[].slice.call(i.jsonData);m=[].slice.call(i.sortedData),this.selectNextList(b,v,o,e),l&&this.list.focus(),e.listData=p,e.sortedData=c,a=a||d.length;for(var F=y.length-1;F>=0;F--)d.splice(a,0,y[F]),U.splice(a,0,y[F]),m.splice(a,0,y[F]);if(i.listData=d,i.jsonData=U,i.sortedData=m,S){var W=i.renderItems(d,i.fields);i.updateListItems(W,i.ulElement),i.setSelection(),e.trigger("actionComplete",{items:y,eventName:this.toolbarAction})}e.updateSelectedOptions(),0===e.listData.length&&e.l10nUpdate()}if(1===e.value.length&&e.getSelectedItems().length&&(e.value[0]=e.getFormattedValue(e.getSelectedItems()[0].getAttribute("data-value"))),e.liCollections.length===e.ulElement.querySelectorAll(".e-disabled").length&&this.toolbarAction){var q=this.list.parentElement.getElementsByClassName("e-listbox-tool")[0],M="moveFrom"===this.toolbarAction?"moveAllFrom":"moveAllTo";q&&(q.querySelector('[data-value="'+M+'"]').disabled=!0)}},l.prototype.selectNextList=function(e,t,i,l){var n,a,r=l.ulElement.querySelectorAll(".e-list-item").length,o=-1;1===e.length&&r&&!l.selectionSettings.showCheckbox&&(a=r<=t[0]?r-1:t[0],n=l.ulElement.querySelectorAll(".e-list-item")[a],(o=l.getValidIndex(n,a,r===i[0]?38:40))>-1&&l.ulElement.querySelectorAll(".e-list-item")[o].classList.add(s.cssClass.selected))},l.prototype.moveAllItemTo=function(){this.moveAllData(this,this.getScopedListBox())},l.prototype.moveAllItemFrom=function(){this.moveAllData(this.getScopedListBox(),this)},l.prototype.moveAllData=function(e,t,i,l){var n=[].slice.call(t.listData),a=[].slice.call(t.jsonData),r="None"!==t.sortOrder||t.selectionSettings.showCheckbox!==e.selectionSettings.showCheckbox||t.fields.groupBy||t.itemTemplate||e.itemTemplate,o=[],h=[],u=[];this.removeSelected(e,e.getSelectedItems());var p=[].slice.call(e.listData),d={cancel:!1,items:p,eventName:this.toolbarAction};if(e.trigger("actionBegin",d),!d.cancel){if(0===t.listData.length){var c=t.ulElement.childNodes[0];c&&t.ulElement.removeChild(c)}e.listData.length>0&&(u=Array.apply(null,{length:e.ulElement.childElementCount}).map(Number.call,Number));for(var m=e.ulElement.childNodes,f=e.ulElement.childElementCount,v=[],g=0;g<f;g++){var y=m[g];y.classList.contains("e-disabled")?(o.push(y),null!=this.sortOrder?h.push(e.sortedData[g]):h.push(e.listData[g])):v.push(g)}u=v,s.moveTo(e.ulElement,t.ulElement,u,l),e.trigger("actionComplete",{items:p,eventName:this.toolbarAction}),i&&this.list.focus(),l=l||n.length;for(g=0;g<u.length;g++)null!=this.sortOrder?n.splice(l+g,0,e.sortedData[u[g]]):n.splice(l+g,0,e.listData[u[g]]);for(g=0;g<u.length;g++)a.splice(l+g,0,e.jsonData[u[g]]);var C=[];o.length>0?(e.liCollections=o,C=[].slice.call(e.liCollections)):(C=[].slice.call(e.liCollections),e.liCollections=[]);var b=[].slice.call(t.liCollections);if(l){var S=b.splice(0,l);t.liCollections=S.concat(C).concat(b)}else t.liCollections=b.concat(C);e.value=[];for(var E=(n=(n=n.filter(function(e){return void 0!==e})).filter(function(e){return!0!==e.isHeader})).filter(function(e){return-1===t.jsonData.indexOf(e)}),g=0;g<E.length;g++)t.jsonData.splice(l+g,0,E[g]);if(t.listData=n,e.listData.length===e.jsonData.length)e.listData=e.sortedData=e.jsonData=h;else if(e.allowFiltering){var x=[];if(o.length>0){for(g=0;g<o.length;g++)x.push(e.getDataByValue(o[g].getAttribute("data-value")));e.listData=e.listData.filter(function(e){return!x.some(function(t){return e===t})})}for(g=0;g<e.listData.length;g++)for(var I=0;I<e.jsonData.length;I++)e.listData[g]===e.jsonData[I]&&e.jsonData.splice(I,1);o.length>0?(e.listData=x,e.sortedData=[]):e.listData=e.sortedData=[]}if(r){var w=t.renderItems(n,t.fields);t.updateListItems(w,t.ulElement)}else t.sortedData=n;e.updateSelectedOptions(),o.length>0&&(this.list.parentElement.getElementsByClassName("e-listbox-tool")[0].querySelector('[data-value="'+this.toolbarAction+'"]').disabled=!0),0===e.listData.length&&0===o.length&&e.l10nUpdate()}},l.prototype.changeData=function(e,t,i,s){var l=[].slice.call(this.listData),n=[].slice.call(this.jsonData),a=[].slice.call(this.sortedData),r=Array.prototype.indexOf.call(this.jsonData,this.getDataByElems([s])[0]),o=Array.prototype.indexOf.call(this.sortedData,this.getDataByElems([s])[0]),h=[].slice.call(this.liCollections);l.splice(t,0,l.splice(e,1)[0]),n.splice(i,0,n.splice(r,1)[0]),a.splice(t,0,a.splice(o,1)[0]),h.splice(t,0,h.splice(e,1)[0]),this.listData=l,this.jsonData=n,this.liCollections=h,this.sortedData=a},l.prototype.getSelectedItems=function(){var e=[];return this.selectionSettings.showCheckbox?[].slice.call(this.ulElement.getElementsByClassName("e-check")).forEach(function(i){e.push(t.closest(i,".e-list-item"))}):e=[].slice.call(this.ulElement.getElementsByClassName(s.cssClass.selected)),e},l.prototype.getScopedListBox=function(){var e,i=this;return this.scope&&[].slice.call(document.querySelectorAll(this.scope)).forEach(function(s){t.getComponent(s,i.getModuleName())&&(e=t.getComponent(s,i.getModuleName()))}),e},l.prototype.getGrabbedItems=function(e){for(var t=!1,i=0;i<this.value.length;i++)if(this.value[i]===this.getFormattedValue(e.target.getAttribute("data-value"))){t=!0;break}if(t)for(i=0;i<this.value.length;i++)for(var s=this.list.querySelectorAll('[aria-selected="true"]'),l=0;l<s.length;l++)this.value[i]===this.getFormattedValue(s[l].getAttribute("data-value"))&&s[l].classList.add("e-grabbed");return this.isAngular?Array.prototype.slice.call(this.element.getElementsByClassName("e-list-parent")[0].querySelectorAll(".e-grabbed")):Array.prototype.slice.call(this.element.nextElementSibling.querySelectorAll(".e-grabbed"))},l.prototype.getDragArgs=function(e,t){var i=this.getGrabbedItems(e);return i.length?t&&i.push(e.target):i=[e.target],{elements:i,event:e.event,items:this.getDataByElems(i)}},l.prototype.onKeyDown=function(e){this.keyDownHandler(e),e.stopPropagation()},l.prototype.keyDownHandler=function(e){if([32,35,36,37,38,39,40,65].indexOf(e.keyCode)>-1&&(!this.allowFiltering||this.allowFiltering&&e.target!==this.filterInput)){if(e.target&&e.target.className.indexOf("e-edit-template")>-1)return;if(e.preventDefault(),32===e.keyCode&&this.ulElement.children.length)this.selectHandler({target:this.ulElement.getElementsByClassName("e-focused")[0],ctrlKey:e.ctrlKey,shiftKey:e.shiftKey});else if(65===e.keyCode&&e.ctrlKey&&"Multiple"===this.selectionSettings.mode)this.selectAll();else if((38===e.keyCode||40===e.keyCode)&&e.ctrlKey&&e.shiftKey)this.moveUpDown(38===e.keyCode,!0);else if(!this.toolbarSettings.items.length&&!this.tBListBox||39!==e.keyCode&&37!==e.keyCode||!e.ctrlKey)37!==e.keyCode&&39!==e.keyCode&&"KeyA"!==e.code&&this.upDownKeyHandler(e);else{var t=this.tBListBox||this.getScopedListBox();39===e.keyCode?e.shiftKey?this.moveAllData(this,t,!0):this.moveData(this,t,!0):e.shiftKey?this.moveAllData(t,this,!0):this.moveData(t,this,!0)}}else this.allowFiltering&&(40!==e.keyCode&&38!==e.keyCode||this.upDownKeyHandler(e))},l.prototype.upDownKeyHandler=function(e){var i=this.ulElement,l=40===e.keyCode||36===e.keyCode?0:i.childElementCount-1,n=i.getElementsByClassName("e-focused")[0]||i.getElementsByClassName(s.cssClass.selected)[0];if(n){if(35!==e.keyCode&&36!==e.keyCode&&(l=Array.prototype.indexOf.call(i.children,n),40===e.keyCode?l++:l--,l<0||l>i.childElementCount-1))return;t.removeClass([n],"e-focused")}var a=i.children[l];if(a){if(-1===(l=this.getValidIndex(a,l,e.keyCode)))return void t.addClass([n],"e-focused");if(i.children[l].focus(),i.children[l].classList.add("e-focused"),e.ctrlKey&&(this.selectionSettings.showCheckbox||!e.shiftKey||36!==e.keyCode&&35!==e.keyCode)||this.selectHandler({target:i.children[l],ctrlKey:e.ctrlKey,shiftKey:e.shiftKey},!0),this.selectionSettings.showCheckbox&&e.ctrlKey&&e.shiftKey&&(36===e.keyCode||35===e.keyCode))for(var r=Array.prototype.indexOf.call(i.children,n),o="Home"===e.code?0:r,h="Home"===e.code?r:i.children.length-1,u=o;u<=h;u++){var p=i.children[u];this.notify("updatelist",{li:p,e:{target:this.ulElement.getElementsByClassName("e-focused")[0],ctrlKey:e.ctrlKey,shiftKey:e.shiftKey},module:"listbox"})}}},l.prototype.KeyUp=function(e){var s=this;if(this.allowFiltering&&e.ctrlKey&&65===e.keyCode)return void e.preventDefault();var l=e.code&&e.keyCode>=96&&e.keyCode<=105?String.fromCharCode(e.keyCode-48):String.fromCharCode(e.keyCode),n=l.match(/\w/),a=l.match(/[A-Za-z0-9\u00C0-\u024F ]/);if(t.isNullOrUndefined(n)&&t.isNullOrUndefined(a)||(this.isValidKey=!0),this.isBackSpace=8===e.keyCode,this.isValidKey=8===e.keyCode||46===e.keyCode||this.isValidKey,this.isValidKey&&(this.isValidKey=!1,e.keyCode,this.allowFiltering)){var r={preventDefaultAction:!1,text:this.targetElement(),updateData:function(e,t,i){r.cancel||(s.isFiltered=!0,s.remoteFilterAction=!0,s.preventDefActionFilter=r.preventDefaultAction,s.dataUpdater(e,t,i),s.preventDefActionFilter=!1)},event:e,cancel:!1};this.trigger("filtering",r,function(e){s.isDataFetched=!1,e.cancel||""!==s.filterInput.value&&s.isFiltered||(s.preventDefActionFilter=!1,e.cancel||s.isCustomFiltering||e.preventDefaultAction||(s.inputString=s.filterInput.value,s.filteringAction(s.jsonData,new i.Query,s.fields),s.toolbarSettings.items.length>0&&s.updateToolBarState()),s.isFiltered||s.isCustomFiltering||e.preventDefaultAction||s.dataUpdater(s.jsonData,new i.Query,s.fields))})}},l.prototype.filter=function(e,t,i){this.isCustomFiltering=!0,this.filteringAction(e,t,i)},l.prototype.filteringAction=function(e,t,i){this.resetList(e,i,t)},l.prototype.targetElement=function(){return this.targetInputElement=this.list.getElementsByClassName("e-input-filter")[0],t.isNullOrUndefined(this.targetInputElement)?null:this.targetInputElement.value},l.prototype.dataUpdater=function(e,t,i){if(this.isDataFetched=!1,this.targetElement()&&""===this.targetElement().trim()){var s=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.remoteCustomValue=!1,this.isAngular&&this.itemTemplate&&(s=this.renderItems(this.listData,i)),this.onActionComplete(s,this.jsonData),this.notify("reOrder",{module:"CheckBoxSelection",enable:this.selectionSettings.showCheckbox,e:this})}else this.resetList(e,i,t)},l.prototype.focusOutHandler=function(){var e=this.list.getElementsByClassName("e-focused")[0];e&&e.classList.remove("e-focused"),this.allowFiltering&&this.refreshClearIcon()},l.prototype.resizeHandler=function(){!this.list||this.cssClass&&this.cssClass.indexOf("e-horizontal-listbox")>-1||this.list.getElementsByClassName("e-filter-parent").length>0&&this.allowFiltering&&this.ulElement.style.setProperty("height","calc(100% - "+this.filterParent.offsetHeight+"px)","important")},l.prototype.getValidIndex=function(e,t,i){var l=this.ulElement;return(e.classList.contains("e-disabled")||e.classList.contains(s.cssClass.group))&&(40===i||36===i?t++:t--),t<0||t===l.childElementCount?-1:(((e=l.childNodes[t]).classList.contains("e-disabled")||e.classList.contains(s.cssClass.group))&&(t=this.getValidIndex(e,t,i)),t)},l.prototype.updateSelectedOptions=function(){var e=this,i=[],s=[];if(t.extend(s,this.value),this.getSelectedItems().forEach(function(t){t.classList.contains("e-grabbed")||i.push(e.getFormattedValue(t.getAttribute("data-value")))}),this.mainList.childElementCount===this.ulElement.childElementCount)if(this.allowFiltering&&this.selectionSettings.showCheckbox){for(var l=0;l<i.length;l++)s.indexOf(i[l])>-1||s.push(i[l]);this.setProperties({value:s},!0)}else this.setProperties({value:i},!0);this.updateSelectTag(),this.updateToolBarState(),this.tBListBox&&this.tBListBox.updateToolBarState()},l.prototype.clearSelection=function(e){var t=this;if(void 0===e&&(e=this.value),this.selectionSettings.showCheckbox){var i;this.getSelectedItems().forEach(function(s){i=t.getFormattedValue(s.getAttribute("data-value")),e.indexOf(i)<0&&(s.getElementsByClassName("e-check")[0].classList.remove("e-check"),s.removeAttribute("aria-selected"))})}},l.prototype.setSelection=function(e,t,i,l){var n=this;void 0===e&&(e=this.value),void 0===t&&(t=!0),void 0===i&&(i=!1),void 0===l&&(l=!0);var a,r;e&&e.forEach(function(e){var o;if("string"==typeof(o=i?n.getValueByText(e):e))if(-1!==o.indexOf("\n")){var h=CSS.escape(o);a=n.list.querySelector('[data-value="'+h+'"]')}else o=o.split("\\").join("\\\\"),a=n.list.querySelector('[data-value="'+o.replace(/"/g,'\\"')+'"]');else a=n.list.querySelector('[data-value="'+o+'"]');a&&(r=n.selectionSettings.showCheckbox&&!a.classList.contains("e-disabled")?a.getElementsByClassName("e-frame")[0].classList.contains("e-check"):a.classList.contains("e-selected"),(!t&&r||t&&!r&&a)&&(n.selectionSettings.showCheckbox&&!a.classList.contains("e-disabled")?(n.notify("updatelist",{li:a,module:"listbox"}),l&&a.focus()):t&&!a.classList.contains("e-disabled")?(a.classList.add(s.cssClass.selected),a.setAttribute("aria-selected","true"),l&&a.focus()):(a.classList.remove(s.cssClass.selected),a.removeAttribute("aria-selected"))))}),this.updateSelectTag()},l.prototype.updateSelectTag=function(){var e=this.getSelectTag(),i="";if(!t.isNullOrUndefined(e)){if(e.innerHTML="",this.value){for(var s=0,l=this.value.length;s<l;s++)i+="<option selected>"+this.value[s]+"</option>";e.innerHTML+=i;for(var s=0,l=e.childNodes.length;s<l;s++)e.childNodes[s].setAttribute("value",this.value[s].toString())}this.checkSelectAll()}},l.prototype.checkDisabledState=function(e){return t.isNullOrUndefined(e.ulElement)?!(!t.isNullOrUndefined(this.dataSource)&&t.isNullOrUndefined(this.dataSource.length)):e.ulElement.querySelectorAll(".e-disabled").length>0?e.liCollections.length===e.ulElement.querySelectorAll(".e-disabled").length:0===e.ulElement.querySelectorAll("."+s.cssClass.li).length},l.prototype.updateToolBarState=function(){var e=this;if(this.toolbarSettings.items.length){var t=this.getScopedListBox(),i=this.list.parentElement.getElementsByClassName("e-listbox-tool")[0];this.toolbarSettings.items.forEach(function(s){var l=i.querySelector('[data-value="'+s+'"]');switch(s){case"moveAllTo":l.disabled=e.checkDisabledState(e);break;case"moveAllFrom":l.disabled=e.checkDisabledState(t);break;case"moveFrom":l.disabled=!t.value||!t.value.length;break;case"moveUp":l.disabled=!(e.value&&e.value.length&&!e.isSelected(e.ulElement.children[0]));break;case"moveDown":l.disabled=!(e.value&&e.value.length&&!e.isSelected(e.ulElement.children[e.ulElement.childElementCount-1]));break;default:l.disabled=!e.value||!e.value.length}})}},l.prototype.setCheckboxPosition=function(){var e=this.list;this.initLoad||"Left"!==this.selectionSettings.checkboxPosition||e.classList.remove("e-right"),"Right"===this.selectionSettings.checkboxPosition&&e.classList.add("e-right")},l.prototype.showCheckbox=function(e){var i=0,s=this.list.lastElementChild.querySelectorAll("li"),l=this.list.lastElementChild.getElementsByClassName("e-list-item").length;if(e){if(this.ulElement=this.renderItems(this.listData,this.fields),this.mainList=this.ulElement,this.list.removeChild(this.list.getElementsByTagName("ul")[0]),this.list.appendChild(this.ulElement),this.selectionSettings.showSelectAll&&!this.list.getElementsByClassName("e-selectall-parent")[0]){var n=new t.L10n(this.getModuleName(),{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.locale);this.showSelectAll=!0,this.selectAllText=n.getConstant("selectAllText"),this.unSelectAllText=n.getConstant("unSelectAllText"),this.popupWrapper=this.list,this.checkBoxSelectionModule.checkAllParent=null,this.notify("selectAll",{}),this.checkSelectAll()}}else{for(this.list.getElementsByClassName("e-selectall-parent")[0]&&this.list.removeChild(this.list.getElementsByClassName("e-selectall-parent")[0]),i;i<l;i++)s[i].classList.contains("e-list-item")&&s[i].removeChild(s[i].getElementsByClassName("e-checkbox-wrapper")[0]),s[i].hasAttribute("aria-selected")&&s[i].removeAttribute("aria-selected");this.mainList=this.ulElement}this.value=[]},l.prototype.isSelected=function(e){return!t.isNullOrUndefined(e)&&(e.classList.contains(s.cssClass.selected)||null!==e.querySelector(".e-check"))},l.prototype.getSelectTag=function(){return this.list.getElementsByClassName("e-hidden-select")[0]},l.prototype.getToolElem=function(){return this.list.parentElement.getElementsByClassName("e-listbox-tool")[0]},l.prototype.formResetHandler=function(){this.value=this.initialSelectedOptions},l.prototype.getModuleName=function(){return"listbox"},l.prototype.getPersistData=function(){return this.addOnPersist(["value"])},l.prototype.getLocaleName=function(){return"listbox"},l.prototype.destroy=function(){this.unwireEvents(),"EJS-LISTBOX"===this.element.tagName?this.element.innerHTML="":(this.element.style.display="inline-block",this.toolbarSettings.items.length&&(this.list.parentElement.parentElement.insertBefore(this.list,this.list.parentElement),t.detach(this.list.nextElementSibling)),this.list.parentElement.insertBefore(this.element,this.list)),e.prototype.destroy.call(this),this.enableRtlElements=[],this.liCollections=null,this.list=null,this.ulElement=null,this.mainList=null,this.spinner=null,this.rippleFun=null,this.itemTemplate&&this.clearTemplate()},l.prototype.onPropertyChanged=function(i,l){var n=this.toolbarSettings.items.length?this.list.parentElement:this.list;e.prototype.onPropertyChanged.call(this,i,l),this.setUpdateInitial(["fields","query","dataSource"],i);for(var r=0,o=Object.keys(i);r<o.length;r++)switch(o[r]){case"cssClass":l.cssClass&&t.removeClass([n],l.cssClass.split(" ")),i.cssClass&&t.addClass([n],i.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":i.enableRtl?this.list.classList.add("e-rtl"):this.list.classList.remove("e-rtl");break;case"value":t.removeClass(this.list.querySelectorAll("."+s.cssClass.selected),s.cssClass.selected),this.clearSelection(this.value),this.setSelection();break;case"height":this.setHeight();break;case"enabled":this.setEnable();break;case"allowDragAndDrop":i.allowDragAndDrop?this.initDraggable():this.ulElement.classList.contains("e-sortable")&&t.getComponent(this.ulElement,"sortable").destroy();break;case"allowFiltering":this.allowFiltering?this.setFiltering():(this.list.removeChild(this.list.getElementsByClassName("e-filter-parent")[0]),this.filterParent=null,t.removeClass([this.list],"e-filter-list"));break;case"filterBarPlaceholder":this.allowFiltering&&this.filterInput&&a.Input.setPlaceholder(i.filterBarPlaceholder,this.filterInput);break;case"scope":this.allowDragAndDrop&&(t.getComponent(this.ulElement,"sortable").scope=i.scope),this.toolbarSettings.items.length&&(l.scope&&(t.getComponent(document.querySelector(l.scope),this.getModuleName()).tBListBox=null),i.scope&&(t.getComponent(document.querySelector(i.scope),this.getModuleName()).tBListBox=this));break;case"toolbarSettings":var h=void 0,u=i.toolbarSettings.position,p=this.getToolElem();u&&(t.removeClass([n],["e-right","e-left"]),n.classList.add("e-"+u.toLowerCase()),"Left"===u?n.insertBefore(p,this.list):n.appendChild(p)),i.toolbarSettings.items&&(l.toolbarSettings.items=t.isNullOrUndefined(l.toolbarSettings.items)?[]:l.toolbarSettings.items,l.toolbarSettings&&l.toolbarSettings.items.length&&((h=this.list.parentElement).parentElement.insertBefore(this.list,h),t.detach(h)),this.initToolbarAndStyles(),this.wireToolbarEvent());break;case"selectionSettings":var d=i.selectionSettings.showSelectAll,c=i.selectionSettings.showCheckbox;if(!t.isNullOrUndefined(d)){if(this.showSelectAll=d,this.showSelectAll){var m=new t.L10n(this.getModuleName(),{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.locale);this.checkBoxSelectionModule.checkAllParent=null,this.showSelectAll=!0,this.selectAllText=m.getConstant("selectAllText"),this.unSelectAllText=m.getConstant("selectAllText"),this.popupWrapper=this.list}this.notify("selectAll",{}),this.checkSelectAll()}t.isNullOrUndefined(c)||this.showCheckbox(c),this.selectionSettings.showCheckbox&&this.setCheckboxPosition();break;case"dataSource":this.isDataSourceUpdate=!0,this.jsonData=[].slice.call(this.dataSource)}};var o;return xe([t.Property("")],l.prototype,"cssClass",void 0),xe([t.Property([])],l.prototype,"value",void 0),xe([t.Property("")],l.prototype,"height",void 0),xe([t.Property(!0)],l.prototype,"enabled",void 0),xe([t.Property(!1)],l.prototype,"enablePersistence",void 0),xe([t.Property(!1)],l.prototype,"allowDragAndDrop",void 0),xe([t.Property(1e3)],l.prototype,"maximumSelectionLength",void 0),xe([t.Property(!1)],l.prototype,"allowFiltering",void 0),xe([t.Property("")],l.prototype,"scope",void 0),xe([t.Property(!0)],l.prototype,"ignoreCase",void 0),xe([t.Property(null)],l.prototype,"filterBarPlaceholder",void 0),xe([t.Property("None")],l.prototype,"sortOrder",void 0),xe([t.Event()],l.prototype,"beforeItemRender",void 0),xe([t.Event()],l.prototype,"filtering",void 0),xe([t.Event()],l.prototype,"select",void 0),xe([t.Event()],l.prototype,"change",void 0),xe([t.Event()],l.prototype,"beforeDrop",void 0),xe([t.Event()],l.prototype,"dragStart",void 0),xe([t.Event()],l.prototype,"drag",void 0),xe([t.Event()],l.prototype,"drop",void 0),xe([t.Event()],l.prototype,"dataBound",void 0),xe([t.Property(null)],l.prototype,"groupTemplate",void 0),xe([t.Property("Request failed")],l.prototype,"actionFailureTemplate",void 0),xe([t.Property(1e3)],l.prototype,"zIndex",void 0),xe([t.Property(!1)],l.prototype,"ignoreAccent",void 0),xe([t.Complex({},we)],l.prototype,"toolbarSettings",void 0),xe([t.Complex({},Ie)],l.prototype,"selectionSettings",void 0),l=o=xe([t.NotifyPropertyChanges],l)}(U),Ae={backIcon:"e-input-group-icon e-back-icon e-icons",filterBarClearIcon:"e-input-group-icon e-clear-icon e-icons",filterInput:"e-input-filter",filterParent:"e-filter-parent",clearIcon:"e-clear-icon"},De=function(){var e=function(t,i){return(e=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])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),ke=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(l=e[r])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},Ne=function(e){function s(t,i){return e.call(this,t,i)||this}return De(s,e),s.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"minLength":this.minLength=e.minLength;break;case"suffixText":this.suffixText=e.suffixText;break;case"allowSpaces":this.allowSpaces=e.allowSpaces;break;case"mentionChar":this.mentionChar=e.mentionChar;break;case"showMentionChar":this.showMentionChar=e.showMentionChar;break;case"requireLeadingSpace":this.requireLeadingSpace=e.requireLeadingSpace;break;case"cssClass":this.updateCssClass(e.cssClass,t.cssClass)}},s.prototype.updateCssClass=function(e,i){t.isNullOrUndefined(i)||(i=i.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),this.setCssClass(e,[this.inputElement],i),this.popupObj&&this.setCssClass(e,[this.popupObj.element],i)},s.prototype.setCssClass=function(e,i,s){t.isNullOrUndefined(s)||""===s||t.removeClass(i,s.split(" ")),t.isNullOrUndefined(e)||""===e||t.addClass(i,e.split(" "))},s.prototype.initializeData=function(){this.isSelected=!1,this.isFiltered=!1,this.beforePopupOpen=!1,this.initRemoteRender=!1,this.isListResetted=!1,this.isPopupOpen=!1,this.isCollided=!1,this.lineBreak=!1,this.isRTE=!1,this.keyEventName="mousedown"},s.prototype.preRender=function(){this.initializeData(),e.prototype.preRender.call(this)},s.prototype.render=function(){var e="string"==typeof this.target;this.inputElement=t.isNullOrUndefined(this.target)?this.element:this.checkAndUpdateInternalComponent(e?document.querySelector(this.target):this.target),this.isContentEditable(this.inputElement)&&(this.inputElement.hasAttribute("contenteditable")||this.inputElement.setAttribute("contenteditable","true"),t.addClass([this.inputElement],["e-mention"]),t.isNullOrUndefined(this.target)&&t.addClass([this.inputElement],["e-editable-element"])),this.inputElement.setAttribute("role","textbox"),this.inputElement.setAttribute("aria-label","mention"),this.queryString=this.elementValue(),this.wireEvent()},s.prototype.wireEvent=function(){t.EventHandler.add(this.inputElement,"keyup",this.onKeyUp,this),this.bindCommonEvent()},s.prototype.unWireEvent=function(){t.EventHandler.remove(this.inputElement,"keyup",this.onKeyUp),this.unBindCommonEvent()},s.prototype.bindCommonEvent=function(){t.Browser.isDevice||this.inputElement.addEventListener("keydown",this.keyDownHandler.bind(this),!this.isRTE)},s.prototype.hideSpinner=function(){this.hideWaitingSpinner()},s.prototype.hideWaitingSpinner=function(){t.isNullOrUndefined(this.spinnerElement)||n.hideSpinner(this.spinnerElement),t.isNullOrUndefined(this.spinnerTemplate)||t.isNullOrUndefined(this.spinnerTemplateElement)||t.detach(this.spinnerTemplateElement)},s.prototype.checkAndUpdateInternalComponent=function(e){if(!this.isVue&&e.classList.contains("e-richtexteditor"))return e.querySelector(".e-content");if(this.isVue&&"TEXTAREA"===e.nodeName&&e.classList.contains("e-rte-hidden")){var t=e.parentElement;if(t&&t.classList.contains("e-richtexteditor"))return t.querySelector(".e-content")}return e&&e.parentElement&&e.parentElement.classList.contains("e-rte-content")&&(this.isRTE=!0,this.keyEventName="click"),e},s.prototype.showWaitingSpinner=function(){t.isNullOrUndefined(this.popupObj)||(t.isNullOrUndefined(this.spinnerTemplate)&&t.isNullOrUndefined(this.spinnerElement)&&(this.spinnerElement=this.popupObj.element,n.createSpinner({target:this.spinnerElement,width:t.Browser.isDevice?"16px":"14px"},this.createElement),n.showSpinner(this.spinnerElement)),t.isNullOrUndefined(this.spinnerTemplate)||this.setSpinnerTemplate())},s.prototype.keyDownHandler=function(e){var t=!0;switch(e.keyCode){case 38:e.action=e.altKey?"hide":"up";break;case 40:e.action=e.altKey?"open":"down";break;case 33:e.action="pageUp";break;case 34:e.action="pageDown";break;case 36:e.action="home";break;case 35:e.action="end";break;case 9:e.action=e.shiftKey?"close":"tab";break;case 27:e.action="escape";break;case 32:e.action="space";break;case 13:e.action="enter";break;default:t=!1}t&&this.keyActionHandler(e)},s.prototype.keyActionHandler=function(e){var i="down"===e.action||"up"===e.action||"pageUp"===e.action||"pageDown"===e.action||"home"===e.action||"end"===e.action,s="tab"===e.action||"close"===e.action;if(void 0!==this.list||this.isRequested||s||"escape"===e.action||"space"===e.action||this.mentionChar.charCodeAt(0)!==this.getLastLetter(this.getTextRange()).charCodeAt(0)||this.renderList(),!(t.isNullOrUndefined(this.list)||!t.isNullOrUndefined(this.liCollections)&&i&&0===this.liCollections.length||this.isRequested))switch("escape"===e.action&&e.preventDefault(),this.isSelected="escape"!==e.action&&this.isSelected,e.action){case"down":case"up":this.isUpDownKey=!0,this.updateUpDownAction(e);break;case"tab":if(this.isPopupOpen){e.preventDefault();var l=this.list.querySelector("."+H.selected);l&&(this.isSelected=!0,this.setSelection(l,e)),this.isPopupOpen&&this.hidePopup(e)}break;case"enter":this.isPopupOpen&&(e.preventDefault(),this.popupObj&&this.popupObj.element.contains(this.selectedLI)&&this.updateSelectedItem(this.selectedLI,e,!1,!0));break;case"escape":this.isPopupOpen&&this.hidePopup(e)}},s.prototype.updateUpDownAction=function(e){if(!this.fields.disabled||!this.list||0!==this.list.querySelectorAll(".e-list-item:not(.e-disabled)").length){var i=this.list.querySelector("."+H.focus);if(this.isSelectFocusItem(i))this.setSelection(i,e);else if(!t.isNullOrUndefined(this.liCollections)){var s=this.list.querySelector("."+H.selected);if(!t.isNullOrUndefined(s)){var l=this.getFormattedValue(s.getAttribute("data-value"));this.activeIndex=this.getIndexByValue(l)}var n="down"===e.action?this.activeIndex+1:this.activeIndex-1,a=0;a="down"===e.action&&t.isNullOrUndefined(this.activeIndex)?0:this.liCollections.length-1,n=n<0?this.liCollections.length-1:n===this.liCollections.length?0:n;var r=t.isNullOrUndefined(this.activeIndex)?this.liCollections[a]:this.liCollections[n];t.isNullOrUndefined(r)||this.setSelection(r,e)}for(var o,n=0;n<this.liCollections.length;n++)if(this.liCollections[n].classList.contains(H.focus)||this.liCollections[n].classList.contains(H.selected)){o=n;break}null!=o&&this.isDisabledElement(this.liCollections[o])&&this.updateUpDownAction(e),this.isPopupOpen&&e.preventDefault()}},s.prototype.isSelectFocusItem=function(e){return!t.isNullOrUndefined(e)},s.prototype.unBindCommonEvent=function(){t.Browser.isDevice||this.inputElement.removeEventListener("keydown",this.keyDownHandler.bind(this),!this.isRTE)},s.prototype.onKeyUp=function(e){var i;if(this.isUpDownKey&&this.isPopupOpen&&229===e.keyCode)return void(this.isUpDownKey=!1);this.isTyped="Enter"!==e.code&&"Space"!==e.code&&"ArrowDown"!==e.code&&"ArrowUp"!==e.code;var s=!(!document.activeElement.parentElement||!document.activeElement.parentElement.querySelector(".e-rte-image"));document.activeElement===this.inputElement||s||this.inputElement.focus(),this.isContentEditable(this.inputElement)&&(this.range=this.getCurrentRange(),this.range&&(i=this.range.startContainer.textContent.split("")));var l=this.getTextRange(),n=new RegExp(this.mentionChar.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\s"),a=!l||!n.test(l),r=this.getLastLetter(l),o=l?l.charAt(Math.max(0,l.indexOf(this.mentionChar)-1)):"";this.allowSpaces||(a&&l&&l.includes(this.mentionChar)&&""!==l.split(this.mentionChar).pop()&&(!this.requireLeadingSpace||this.requireLeadingSpace&&(" "===o||0===l.indexOf(this.mentionChar)))&&(r=this.mentionChar+l.split(this.mentionChar).pop()),!this.requireLeadingSpace&&r&&r.includes(this.mentionChar)&&(r=this.mentionChar+r.split(this.mentionChar).pop()));var h=this.mentionChar.toString()+this.mentionChar.toString(),u=new RegExp(this.mentionChar.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),p=new RegExp("[a-zA-Z]","g");if("Shift"!==e.key&&37!==e.keyCode&&39!==e.keyCode){if(this.beforePopupOpen&&this.isPopupOpen&&r===h)return void this.hidePopup();if(!l||!r||!r.includes(this.mentionChar)&&!this.requireLeadingSpace&&!this.allowSpaces||"Enter"===e.code||27===e.keyCode||r.match(u)&&r.match(u).length>1||this.isContentEditable(this.inputElement)&&this.range.startContainer&&this.range.startContainer.previousElementSibling&&"BR"!==this.range.startContainer.previousElementSibling.tagName&&this.range.startContainer.textContent.split("").length>0&&(1===i.length||-1===i[i.length-2].indexOf("")||1===this.range.startContainer.nodeType))return void(a&&this.isPopupOpen&&this.allowSpaces&&l&&""!==l.trim()&&p.test(l)&&-1!==l.indexOf(this.mentionChar)&&!this.isMatchedText()&&l.length>1&&" "!==l.replace(/\u00A0/g," ").charAt(l.length-2)&&this.list&&this.list.querySelectorAll("ul").length>0&&"Enter"!==e.code?(this.queryString=l.substring(l.lastIndexOf(this.mentionChar)+1).replace(" "," "),this.searchLists(e)):this.requireLeadingSpace&&(!this.isPopupOpen||this.allowSpaces&&r||"ArrowDown"===e.code||"ArrowUp"===e.code)?"Backspace"!==e.key&&"Delete"!==e.key||!this.range||this.range.startOffset===this.range.endOffset||this.range.deleteContents():(this.hidePopup(),this.lineBreak=!0));r.includes(this.mentionChar)&&(this.queryString=this.requireLeadingSpace?r.replace(this.mentionChar,""):r.substring(r.lastIndexOf(this.mentionChar)+1).trim()),this.mentionChar.charCodeAt(0)!==r.charCodeAt(0)||""===this.queryString||38===e.keyCode||40===e.keyCode||this.lineBreak?(this.requireLeadingSpace?0===r.indexOf(this.mentionChar):r.includes(this.mentionChar))&&!this.isPopupOpen&&8!==e.keyCode&&(!this.popupObj||t.isNullOrUndefined(this.target)&&!document.body.contains(this.popupObj.element)||!t.isNullOrUndefined(this.target)&&document.body.contains(this.popupObj.element))?(this.initRemoteRender&&this.list&&this.list.classList.contains("e-nodata")&&this.searchLists(e),this.resetList(this.dataSource,this.fields),t.isNullOrUndefined(this.list)&&this.initValue(),!this.isPopupOpen&&38!==e.keyCode&&40!==e.keyCode&&this.queryString.length>=this.minLength&&(this.didPopupOpenByTypingInitialChar=!0,this.showPopup(),this.initRemoteRender&&0===this.list.querySelectorAll("li").length&&this.showWaitingSpinner(),this.lineBreak=!1)):this.allowSpaces&&""!==this.queryString&&l&&""!==l.trim()&&l.replace(" "," ").lastIndexOf(" ")<l.length-1&&38!==e.keyCode&&40!==e.keyCode&&8!==e.keyCode&&(this.mentionChar.charCodeAt(0)===r.charCodeAt(0)||this.liCollections&&this.liCollections.length>0)?(this.queryString=l.substring(l.lastIndexOf(this.mentionChar)+1).replace(" "," "),this.searchLists(e)):""===this.queryString&&this.isPopupOpen&&38!==e.keyCode&&40!==e.keyCode&&this.mentionChar.charCodeAt(0)===r.charCodeAt(0)&&(this.searchLists(e),this.isListResetted||this.resetList(this.dataSource,this.fields)):(this.searchLists(e),!this.isPopupOpen&&this.queryString.length>=this.minLength&&(this.isContentEditable(this.inputElement)?this.isContentEditable(this.inputElement)&&this.range&&this.range.startContainer!==this.inputElement&&9!==e.keyCode&&this.showPopup():this.showPopup())),this.isListResetted=!1}},s.prototype.isMatchedText=function(){for(var e=!1,t=0;t<(this.liCollections&&this.liCollections.length);t++)this.getTextRange()&&this.getTextRange().substring(this.getTextRange().lastIndexOf(this.mentionChar)+1).replace(" "," ").trim()===this.liCollections[t].getAttribute("data-value").toLowerCase()&&(e=!0);return e},s.prototype.getCurrentRange=function(){return this.range=this.inputElement.ownerDocument.getSelection().rangeCount>0&&this.inputElement.ownerDocument.getSelection().getRangeAt(0),this.range},s.prototype.performFiltering=function(e){var t=this,i={preventDefaultAction:!1,text:this.queryString,updateData:function(e,s,l){i.cancel||(t.isFiltered=!0,t.filterAction(e,s,l))},cancel:!1};this.trigger("filtering",i,function(e){e.cancel||t.isFiltered||e.preventDefaultAction||t.filterAction(t.dataSource,null,t.fields)})},s.prototype.searchLists=function(i){if(this.isDataFetched=!1,t.isNullOrUndefined(this.list)&&(e.prototype.render.call(this),this.unWireListEvents(),this.wireListEvents()),"mousedown"!==i.type&&(40===i.keyCode||38===i.keyCode))return this.queryString=""===this.queryString?null:this.queryString,this.beforePopupOpen=!0,void this.resetList(this.dataSource,this.fields);this.isSelected=!1,this.activeIndex=null,""!==this.queryString&&this.debounceDelay>0?this.debouncedFiltering(i,this.debounceDelay):this.performFiltering(i)},s.prototype.filterAction=function(e,t,i){this.beforePopupOpen=!0,this.queryString.length>=this.minLength?(this.resetList(e,i,t),this.isListResetted=!0):(this.isPopupOpen&&this.hidePopup(),this.beforePopupOpen=!1),this.setDataIndex(),this.renderReactTemplates()},s.prototype.onActionComplete=function(i,s,l,n){if(e.prototype.onActionComplete.call(this,i,s,l),this.isActive){t.isNullOrUndefined(i)||(t.attributes(i,{id:this.inputElement.id+"_options",role:"listbox","aria-hidden":"false"}),this.isRTE&&this.cssClass&&this.cssClass.indexOf("e-slash-menu")>-1&&(i.id=this.inputElement.id+"_slash_menu_options"));var a=this.fields.disabled?i.querySelector("."+H.li+":not(.e-disabled)"):i.querySelector("."+H.li);if(a){a.classList.add(H.selected),this.selectedLI=a;var r=this.getFormattedValue(a.getAttribute("data-value"));this.selectEventCallback(a,this.getDataByValue(r),r,!0)}this.beforePopupOpen&&this.isPopupOpen&&(t.isNullOrUndefined(this.popupObj.element)||this.popupObj.element.remove(),this.renderPopup())}},s.prototype.setDataIndex=function(){for(var e=0;this.liCollections&&e<this.liCollections.length;e++)this.liCollections[e].setAttribute("data-index",e.toString())},s.prototype.listOption=function(i,s){var l=this,n=e.prototype.listOption.call(this,i,s);if(t.isNullOrUndefined(n.itemCreated))n.itemCreated=function(e){l.highlight&&(l.inputElement.tagName===l.getNgDirective()&&l.itemTemplate?setTimeout(function(){c(e.item,l.queryString,l.ignoreCase,l.filterType)},0):c(e.item,l.queryString,l.ignoreCase,l.filterType))};else{var a=n.itemCreated;n.itemCreated=function(e){l.highlight&&c(e.item,l.queryString,l.ignoreCase,l.filterType),a.apply(l,[e])}}return n},s.prototype.elementValue=function(){return this.isContentEditable(this.inputElement)?this.inputElement.textContent.replace(this.mentionChar,""):this.inputElement.value.replace(this.mentionChar,"")},s.prototype.getQuery=function(e){var s=e?e.clone():this.query?this.query.clone():new i.Query,l=""!==this.queryString||t.isNullOrUndefined(this.elementValue())?this.filterType:"equal",n=""!==this.queryString||t.isNullOrUndefined(this.elementValue())?this.queryString:this.elementValue();if(this.isFiltered)return s;if(null!==this.queryString&&""!==this.queryString){var a=this.typeOfData(this.dataSource).typeof;if((this.dataSource instanceof i.DataManager||"string"!==a)&&"number"!==a){var r=t.isNullOrUndefined(this.fields.text)?"":this.fields.text;s.where(r,l,n,this.ignoreCase,this.ignoreAccent)}else s.where("",l,n,this.ignoreCase,this.ignoreAccent)}if(!t.isNullOrUndefined(this.suggestionCount)){if(25!==this.suggestionCount)for(var o=0;o<s.queries.length;o++)"onTake"===s.queries[o].fn&&s.queries.splice(o,1);s.take(this.suggestionCount)}return s},s.prototype.renderHightSearch=function(){if(this.highlight)for(var e=0;e<this.liCollections.length;e++)this.ulElement.querySelector(".e-active")||(f(this.liCollections[e]),c(this.liCollections[e],this.queryString,this.ignoreCase,this.filterType))},s.prototype.getTextRange=function(){var e;if(this.isContentEditable(this.inputElement)){if(this.range){var i=this.range.startContainer;if(!t.isNullOrUndefined(i)){var s=i.textContent,l=this.range.startOffset;s&&l>=0&&(e=s.substring(0,l))}}}else{var n=this.inputElement;if(!t.isNullOrUndefined(n)){var a=n.selectionStart;n.value&&a>=0&&(e=n.value.substring(0,a))}}return e},s.prototype.getLastLetter=function(e){if(t.isNullOrUndefined(e))return"";var i=(e.indexOf("")>-1?e.replace(/\u200B/g,"").replace(/\u00A0/g," "):e.replace(/\u00A0/g," ")).split(/\s+/);return i[i.length-1].trim()},s.prototype.isContentEditable=function(e){return e&&"INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName},s.prototype.showPopup=function(){this.beforePopupOpen=!0,document.activeElement!==this.inputElement&&this.inputElement.focus(),this.queryString=this.didPopupOpenByTypingInitialChar?this.queryString:"",this.didPopupOpenByTypingInitialChar=!1,this.isContentEditable(this.inputElement)&&(this.range=this.getCurrentRange()),this.isTyped||this.resetList(this.dataSource,this.fields),t.isNullOrUndefined(this.list)&&this.initValue(),this.renderPopup(),t.attributes(this.inputElement,{"aria-activedescendant":this.selectedElementID}),null==this.selectedElementID&&this.inputElement.removeAttribute("aria-activedescendant")},s.prototype.hidePopup=function(e){this.removeSelection(),this.closePopup(0,e)},s.prototype.closePopup=function(e,i){var s=this;if(this.popupObj&&document.body.contains(this.popupObj.element)&&this.beforePopupOpen){t.EventHandler.remove(document,"mousedown",this.onDocumentClick),this.inputElement.removeAttribute("aria-owns"),this.inputElement.removeAttribute("aria-activedescendant"),this.beforePopupOpen=!1;var l={name:"FadeOut",duration:100,delay:e||0},n={popup:this.popupObj,cancel:!1,animation:l,event:i||null};this.trigger("closed",n,function(e){!e.cancel&&s.popupObj&&(s.isPopupOpen?s.popupObj.hide(new t.Animation(e.animation)):s.destroyPopup())})}},s.prototype.renderPopup=function(){var e=this,i={cancel:!1};this.trigger("beforeOpen",i,function(i){if(i.cancel)e.beforePopupOpen=!1;else{var s;if(t.isNullOrUndefined(e.target)?s=e.createElement("div",{id:e.inputElement.id+"_popup",className:"e-mention e-popup "+(null!=e.cssClass?e.cssClass:"")}):(s=e.element,null!=e.cssClass&&t.addClass([s],e.cssClass.split(" "))),e.isRTE&&e.cssClass&&e.cssClass.indexOf("e-slash-menu")>-1?s.id=e.inputElement.id+"_slash_menu_popup":t.isNullOrUndefined(e.target)||(s.id=e.inputElement.id+"_popup"),e.listHeight=t.formatUnit(e.popupHeight),!t.isNullOrUndefined(e.list.querySelector("li"))&&!e.initRemoteRender){var l=e.list.querySelector("."+H.focus);if(!t.isNullOrUndefined(l)){e.selectedLI=l;var a=e.getFormattedValue(l.getAttribute("data-value"));e.selectEventCallback(l,e.getDataByValue(a),a,!0)}}if(t.append([e.list],s),e.inputElement.parentElement){var r=e.inputElement.parentElement.closest(".e-richtexteditor");r&&s.firstElementChild&&s.firstElementChild.childElementCount>0&&(s.firstElementChild.setAttribute("aria-owns",r.id),t.addClass([s],"e-rte-elements"))}e.popupObj&&document.body.contains(e.popupObj.element)&&(document.contains(s)||!t.isNullOrUndefined(e.target))||document.body.appendChild(s);var o;s.style.visibility="hidden",e.setHeight(s);e.initializePopup(s,0,0),e.checkCollision(s),s.style.visibility="visible";var h=s.parentElement.offsetWidth-s.offsetWidth,u=s.offsetHeight;t.addClass([s],["e-mention","e-popup","e-popup-close"]),t.isNullOrUndefined(e.list)||(e.unWireListEvents(),e.wireListEvents()),e.selectedElementID=e.selectedLI?e.selectedLI.id:null,t.attributes(e.inputElement,{"aria-owns":e.inputElement.id+"_options","aria-activedescendant":e.selectedElementID}),null==e.selectedElementID&&e.inputElement.removeAttribute("aria-activedescendant");var p={name:"FadeIn",duration:100};e.beforePopupOpen=!0;var d={popup:e.popupObj,cancel:!1,animation:p};e.trigger("opened",d,function(i){if(i.cancel)e.beforePopupOpen=!1,e.destroyPopup();else{if(e.renderReactTemplates(),e.popupObj&&e.popupObj.show(new t.Animation(i.animation),1e3===e.zIndex?e.inputElement:null),t.isNullOrUndefined(e.getTriggerCharPosition()))return;o=e.getCoordinates(e.inputElement,e.getTriggerCharPosition()),e.isCollided?(e.collision.length>0&&e.collision.indexOf("right")>-1&&-1===e.collision.indexOf("bottom")?s.style.cssText="top: ".concat(o.top.toString(),"px;\n left: ").concat(h.toString(),"px;\nposition: absolute;\n display: block;"):e.collision&&e.collision.length>0&&e.collision.indexOf("bottom")>-1&&-1===e.collision.indexOf("right")?(s.style.left=t.formatUnit(o.left),s.style.top=t.formatUnit(o.top-parseInt(u.toString(),10))):e.collision&&e.collision.length>0&&e.collision.indexOf("bottom")>-1&&e.collision.indexOf("right")>-1?(s.style.left=t.formatUnit(h),s.style.top=t.formatUnit(o.top-parseInt(u.toString(),10))):(s.style.left=t.formatUnit(o.left),s.style.top=t.formatUnit(o.top-parseInt(e.popupHeight.toString(),10))),e.isCollided=!1,e.collision=[]):s.style.cssText="top: ".concat(o.top.toString(),"px;\n left: ").concat(o.left.toString(),"px;\nposition: absolute;\n display: block;"),s.style.width="100%"===e.popupWidth||t.isNullOrUndefined(e.popupWidth)?"auto":t.formatUnit(e.popupWidth),e.setHeight(s),s.style.zIndex=1e3===e.zIndex?n.getZindexPartial(s).toString():e.zIndex.toString()}})}})},s.prototype.setHeight=function(e){"auto"!==this.popupHeight&&this.list?(this.list.style.maxHeight=(parseInt(this.listHeight,10)-2).toString()+"px",e.style.maxHeight=t.formatUnit(this.popupHeight)):e.style.height="auto"},s.prototype.checkCollision=function(e){if(!t.Browser.isDevice||t.Browser.isDevice&&"mention"!==this.getModuleName()){var i=this.getCoordinates(this.inputElement,this.getTriggerCharPosition());this.collision=n.isCollide(e,null,i.left,i.top),this.collision.length>0&&(e.style.marginTop=-parseInt(getComputedStyle(e).marginTop,10)+"px",this.isCollided=!0),this.popupObj.resolveCollision()}},s.prototype.getTriggerCharPosition=function(){var e,t=this.getTextRange();if(void 0!==t&&null!==t){e=0;var i=t.lastIndexOf(this.mentionChar);i>=e&&(e=i)}return e||0},s.prototype.initializePopup=function(e,i,s){var l=this;this.popupObj=new n.Popup(e,{width:this.setWidth(),targetType:"relative",relateTo:this.inputElement,collision:{X:"flip",Y:"flip"},offsetY:i,enableRtl:this.enableRtl,offsetX:s,position:{X:"left",Y:"bottom"},actionOnScroll:"hide",zIndex:this.zIndex,close:function(){l.destroyPopup()},open:function(){t.EventHandler.add(document,"mousedown",l.onDocumentClick,l),l.isPopupOpen=!0,l.setDataIndex()}})},s.prototype.setWidth=function(){var e=t.formatUnit(this.popupWidth);return e.indexOf("%")>-1&&(e=(this.inputElement.offsetWidth*parseFloat(e)/100).toString()+"px"),e},s.prototype.destroyPopup=function(){this.isPopupOpen=!1,this.popupObj.destroy(),t.isNullOrUndefined(this.target)?t.detach(this.popupObj.element):(this.popupObj.element.innerHTML="",this.popupObj.element.removeAttribute("style"),this.popupObj.element.removeAttribute("aria-disabled")),this.list.classList.contains("e-nodata")&&(this.list=null)},s.prototype.onDocumentClick=function(e){var i=e.target;!t.isNullOrUndefined(this.popupObj)&&t.closest(i,"#"+this.popupObj.element.id)||this.hidePopup(e)},s.prototype.getCoordinates=function(e,i){var s,l,n,a,r,o,h,u=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing"];if(this.isContentEditable(this.inputElement)){var p=this.getTriggerCharPosition();a=this.range,n=document.createRange(),this.getTextRange()&&-1!==this.getTextRange().lastIndexOf(this.mentionChar)?(n.setStart(a.startContainer,p),n.setEnd(a.startContainer,p)):(n.setStart(a.startContainer,a.startOffset),n.setEnd(a.startContainer,a.endOffset)),this.isTyped=!1,n.collapse(!1),h=0===n.getBoundingClientRect().top?n.startContainer.getClientRects()[0]:n.getBoundingClientRect()}else s=this.createElement("div",{className:"e-form-mirror-div"}),document.body.appendChild(s),o=getComputedStyle(e),s.style.position="absolute",s.style.visibility="hidden",u.forEach(function(e){s.style[e]=o[e]}),s.textContent=e.value.substring(0,i),"INPUT"===this.inputElement.nodeName&&(s.textContent=s.textContent.replace(/\s/g," ")),(l=this.createElement("span")).textContent=e.value.substring(i)||".",s.appendChild(l),h=e.getBoundingClientRect();var d=h.top,c=h.left,m=document.querySelectorAll("iframe");if(m.length>0)for(S=0;S<m.length;S++){var f=m[S];if(f.contentDocument&&f.contentDocument.contains(e)){var v=f.getBoundingClientRect();d+=v.top,c+=v.left}}var g=document.documentElement,y=(window.pageXOffset||g.scrollLeft)-(g.clientLeft||0),C=(window.pageYOffset||g.scrollTop)-(g.clientTop||0),b=0;if(!t.isNullOrUndefined(n)&&0===n.getBoundingClientRect().top)for(var S=0;S<this.range.startContainer.childNodes.length;S++)if(this.range.startContainer.childNodes[S].nodeType!==Node.TEXT_NODE&&""!==this.range.startContainer.childNodes[S].textContent.trim())b+=this.range.startContainer.childNodes[S].getClientRects()[0].width;else if(""!==this.range.startContainer.childNodes[S].textContent){var E=document.createElement("span");E.innerHTML=this.range.startContainer.childNodes[S].nodeValue,document.body.appendChild(E);var x=E.offsetWidth;document.body.removeChild(E),b+=x}return this.isContentEditable(this.inputElement)?r=this.collision&&this.collision.length>0&&this.collision.indexOf("right")>-1&&-1===this.collision.indexOf("bottom")?{top:d+C+parseInt(getComputedStyle(this.inputElement).fontSize,10),left:c+y+b}:{top:d+C+parseInt(getComputedStyle(this.inputElement).fontSize,10)-(this.isCollided?10:0),left:c+y+b}:(r={top:d+C+l.offsetTop+parseInt(o.borderTopWidth,10)+parseInt(o.fontSize,10)+3-e.scrollTop-(this.isCollided?10:0),left:c+y+l.offsetLeft+parseInt(o.borderLeftWidth,10)},document.body.removeChild(s)),r},s.prototype.initValue=function(){this.isDataFetched=!1,this.renderList(),this.dataSource instanceof i.DataManager?this.initRemoteRender=!0:this.updateValues()},s.prototype.updateValues=function(){var e=this.list.querySelector("."+H.focus);t.isNullOrUndefined(e)||this.setSelection(e,null)},s.prototype.renderList=function(){e.prototype.render.call(this),this.unWireListEvents(),this.wireListEvents()},s.prototype.wireListEvents=function(){t.EventHandler.add(this.list,this.keyEventName,this.onMouseClick,this),t.EventHandler.add(this.list,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.list,"mouseout",this.onMouseLeave,this)},s.prototype.unWireListEvents=function(){t.EventHandler.remove(this.list,this.keyEventName,this.onMouseClick),t.EventHandler.remove(this.list,"mouseover",this.onMouseOver),t.EventHandler.remove(this.list,"mouseout",this.onMouseLeave)},s.prototype.onMouseClick=function(e){var i=e.target,s=t.closest(i,"."+H.li);if(this.isValidLI(s)&&!this.isDisabledElement(s)){this.isSelected=!0,this.setSelection(s,e);this.closePopup(100,e),this.inputElement.focus(),this.isRTE||e.preventDefault()}},s.prototype.updateSelectedItem=function(e,i,s,l){var n=this;this.removeSelection(),e.classList.add(H.selected),this.removeHover();var a=this.getFormattedValue(e.getAttribute("data-value")),r=this.getDataByValue(a);if(s||t.isNullOrUndefined(i)||"down"===i.action||"up"===i.action)this.selectEventCallback(e,r,a),l&&this.setSelectOptions(e,i);else{var o=this.detachChanges(r);this.isSelected=!0;var h={e:i,item:e,itemData:o,isInteracted:!!i,cancel:!1};this.trigger("select",h,function(t){t.cancel?(e.classList.remove(H.selected),n.isSelected=!1,n.isSelectCancel=!0):(n.selectEventCallback(e,r,a),l&&n.setSelectOptions(e,i))})}},s.prototype.setSelection=function(e,t){this.isValidLI(e)&&(!e.classList.contains(H.selected)||this.isPopupOpen&&this.isSelected&&e.classList.contains(H.selected))?this.updateSelectedItem(e,t,!1,!0):this.setSelectOptions(e,t)},s.prototype.setSelectOptions=function(e,i){this.list&&this.removeHover(),this.previousSelectedLI=t.isNullOrUndefined(this.selectedLI)?null:this.selectedLI,this.selectedLI=e,this.isPopupOpen&&!t.isNullOrUndefined(this.selectedLI)&&this.setScrollPosition(i),(!i||38!==i.keyCode&&40!==i.keyCode)&&(t.isNullOrUndefined(i)||this.setValue(i))},s.prototype.setScrollPosition=function(e){if(t.isNullOrUndefined(e))this.scrollBottom(!0);else switch(e.action){case"pageDown":case"down":case"end":this.scrollBottom();break;default:this.scrollTop()}},s.prototype.scrollBottom=function(e){if(!t.isNullOrUndefined(this.selectedLI)){var i=this.list.offsetHeight,s=this.selectedLI.offsetTop+this.selectedLI.offsetHeight-this.list.scrollTop,l=this.list.scrollTop+s-i;l=e?l+2*parseInt(getComputedStyle(this.list).paddingTop,10):l;var n=this.selectedLI.offsetTop+this.selectedLI.offsetHeight-this.list.scrollTop;0===this.activeIndex?this.list.scrollTop=0:(s>i||!(n>0&&this.list.offsetHeight>n))&&(this.list.scrollTop=l)}},s.prototype.scrollTop=function(){if(!t.isNullOrUndefined(this.selectedLI)){var e=t.isNullOrUndefined(this.fields.groupBy)||t.isNullOrUndefined(this.fixedHeaderElement)?this.selectedLI.offsetTop-this.list.scrollTop:this.selectedLI.offsetTop-(this.list.scrollTop+this.fixedHeaderElement.offsetHeight);e=this.fields.groupBy&&e;var i=this.selectedLI.offsetTop+this.selectedLI.offsetHeight-this.list.scrollTop;0===this.activeIndex?this.list.scrollTop=0:e<0?this.list.scrollTop=this.list.scrollTop+e:i>0&&this.list.offsetHeight>i||(this.list.scrollTop=this.selectedLI.offsetTop)}},s.prototype.selectEventCallback=function(e,i,s,l){this.previousItemData=t.isNullOrUndefined(this.itemData)?null:this.itemData,this.item=e,this.itemData=i;var n=this.list.querySelector("."+H.focus);n&&t.removeClass([n],H.focus),l&&t.addClass([e],H.selected),e.setAttribute("aria-selected","true"),this.activeIndex=this.getIndexByValue(s)},s.prototype.detachChanges=function(e){return"string"==typeof e||"boolean"==typeof e||"number"==typeof e?Object.defineProperties({},{value:{value:e,enumerable:!0},text:{value:e,enumerable:!0}}):e},s.prototype.setValue=function(e){return this.isReact?(t.isNullOrUndefined(this.displayTemplate)?this.updateMentionValue(e):this.setDisplayTemplate(e),!0):(t.isNullOrUndefined(this.displayTemplate)||this.setDisplayTemplate(),this.updateMentionValue(e),!0)},s.prototype.updateMentionValue=function(e){var i,s,l,n,a=this.getItemData(),r="string"==typeof this.suffixText?this.suffixText:"",o=this.inputElement.ownerDocument.getSelection(),h=this.getTriggerCharPosition();if(this.isSelectCancel)return void(this.isSelectCancel=!1);if(null!==a.text&&(i=this.mentionVal(a.text)),this.isContentEditable(this.inputElement)){s=this.getTriggerCharPosition()+this.mentionChar.length,this.range&&this.range.startContainer.textContent.trim()!==this.mentionChar&&(s=this.range.endOffset),n=this.range,l=document.createRange(),this.getTextRange()&&-1!==this.getTextRange().lastIndexOf(this.mentionChar)||this.getTextRange()&&this.getTextRange().trim()===this.mentionChar?(l.setStart(n.startContainer,h),l.setEnd(n.startContainer,s)):""!==n.commonAncestorContainer.textContent.trim()&&!t.isNullOrUndefined(n.commonAncestorContainer.textContent.trim())&&this.getTextRange()&&-1!==this.getTextRange().lastIndexOf(this.mentionChar)?(l.setStart(n.startContainer,n.startOffset-1),l.setEnd(n.startContainer,n.endOffset-1)):(l.setStart(n.startContainer,n.startOffset),l.setEnd(n.startContainer,n.endOffset)),this.isTyped=!1,l.deleteContents(),l.startContainer.parentElement.normalize();var u=this.createElement("div");u.innerHTML=i;for(var p=document.createDocumentFragment(),d=void 0,c=void 0;d=u.firstChild;)c=p.appendChild(d);if(l.insertNode(p),c&&(l=l.cloneRange(),this.isRTE&&3===c.nodeType?l.setStart(c,c.textContent.length):l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l)),this.isPopupOpen&&this.hidePopup(),!t.isNullOrUndefined(e.pointerType)&&"mouse"===e.pointerType){var m=new CustomEvent("content-changed",{detail:{click:!0}});this.inputElement.dispatchEvent(m)}this.onChangeEvent(e)}else{var f=this.inputElement,v=this.getTextRange().substring(h+this.mentionChar.length,this.getTextRange().length);i+=r,s=h+this.mentionChar.length,s+=v.length,f.value=f.value.substring(0,h)+i+f.value.substring(s,f.value.length),f.selectionStart=h+i.length,f.selectionEnd=h+i.length,this.isPopupOpen&&this.hidePopup(),this.onChangeEvent(e)}},s.prototype.mentionVal=function(e){var i=this.showMentionChar?this.mentionChar:"";return t.isNullOrUndefined(this.displayTemplate)||t.isNullOrUndefined(this.displayTempElement)||(e=this.displayTempElement.innerHTML),this.isContentEditable(this.inputElement)?t.Browser.isAndroid?'<span contenteditable="true" class="e-mention-chip">'+i+e+"</span>".concat("string"==typeof this.suffixText?this.suffixText:"​"):"mozilla"===t.Browser.info.name?'<span><span contenteditable="false" class="e-mention-chip">'+i+e+"</span></span>".concat("string"==typeof this.suffixText?this.suffixText:"​"):'<span contenteditable="false" class="e-mention-chip">'+i+e+"</span>".concat("string"==typeof this.suffixText?this.suffixText:"​"):i+e},s.prototype.setDisplayTemplate=function(e){var i=this;this.isReact&&(this.clearTemplate(["displayTemplate"]),this.displayTempElement&&(t.detach(this.displayTempElement),this.displayTempElement=null)),this.displayTempElement||(this.displayTempElement=this.createElement("div")),this.isReact||(this.displayTempElement.innerHTML="");var s=t.compile(this.displayTemplate)(this.itemData,this,"displayTemplate",this.displayTemplateId,this.isStringTemplate,null,this.displayTempElement);s&&s.length>0&&t.append(s,this.displayTempElement),this.isReact?this.renderTemplates(function(){i.updateMentionValue(e)}):this.renderTemplates()},s.prototype.renderTemplates=function(e){this.renderReactTemplates(e)},s.prototype.setSpinnerTemplate=function(){var e=this;this.isReact&&(this.clearTemplate(["spinnerTemplate"]),this.spinnerTemplateElement&&(t.detach(this.spinnerTemplateElement),this.spinnerTemplateElement=null)),this.spinnerTemplateElement||(this.spinnerTemplateElement=this.createElement("div")),this.isReact||(this.spinnerTemplateElement.innerHTML="");var i=t.compile(this.spinnerTemplate)(null,this,"spinnerTemplate",this.spinnerTemplateId,this.isStringTemplate,null,this.spinnerTemplateElement);if(i&&i.length>0)for(var s=0;s<i.length;s++)this.spinnerTemplateElement.appendChild(i[s]);this.isReact?this.renderTemplates(function(){e.popupObj.element.appendChild(e.spinnerTemplateElement)}):(this.renderTemplates(),this.popupObj.element.appendChild(this.spinnerTemplateElement))},s.prototype.onChangeEvent=function(e){this.isSelected=!1;var t,i=this.detachMentionChanges(this.itemData);t="string"==typeof this.previousItemData||"boolean"==typeof this.previousItemData||"number"==typeof this.previousItemData?Object.defineProperties({},{value:{value:this.previousItemData,enumerable:!0},text:{value:this.previousItemData,enumerable:!0}}):this.previousItemData;var s={e:e,item:this.item,itemData:i,previousItem:this.previousSelectedLI,previousItemData:t,isInteracted:!!e,value:this.item.innerHTML,element:this.inputElement};this.trigger("change",s)},s.prototype.detachMentionChanges=function(e){return"string"==typeof e||"boolean"==typeof e||"number"==typeof e?Object.defineProperties({},{value:{value:e,enumerable:!0},text:{value:e,enumerable:!0}}):e},s.prototype.getItemData=function(){var e=this.fields,i=null;i=this.itemData;var s,l;return t.isNullOrUndefined(i)||(s=t.getValue(e.value,i),l=t.getValue(e.text,i)),{value:t.isNullOrUndefined(i)||t.isUndefined(s)?i:s,text:t.isNullOrUndefined(i)||t.isUndefined(s)?i:l}},s.prototype.removeSelection=function(){if(this.list){var e=this.list.querySelectorAll("."+H.selected);e.length&&(t.removeClass(e,H.selected),e[0].removeAttribute("aria-selected"))}},s.prototype.onMouseOver=function(e){var i=t.closest(e.target,"."+H.li);this.setHover(i)},s.prototype.setHover=function(e){this.isValidLI(e)&&!e.classList.contains(H.hover)&&(this.removeHover(),t.addClass([e],H.hover))},s.prototype.removeHover=function(){if(this.list){var e=this.list.querySelectorAll("."+H.hover);e&&e.length&&t.removeClass(e,H.hover)}},s.prototype.isValidLI=function(e){return e&&e.hasAttribute("role")&&"option"===e.getAttribute("role")},s.prototype.onMouseLeave=function(){this.removeHover()},s.prototype.search=function(e,i,s){this.isContentEditable(this.inputElement)&&(this.range=this.getCurrentRange());var l=this.getTextRange();this.queryString=e;var n=this.getLastLetter(l);if((!this.ignoreCase||e!==n&&e!==n.toLowerCase())&&(this.ignoreCase||e!==n))return void(this.isPopupOpen&&this.hidePopup());this.resetList(this.dataSource,this.fields),t.isNullOrUndefined(this.list)?(this.renderList(),this.renderPopup()):this.isPopupOpen||this.renderPopup(),this.popupObj.element.style.left=t.formatUnit(i),this.popupObj.element.style.top=t.formatUnit(s)},s.prototype.disableItem=function(e){if(this.fields.disabled){this.list||this.renderList();var t=-1;if(this.liCollections&&this.liCollections.length>0&&this.listData&&this.fields.disabled){if("string"==typeof e)t=this.getIndexByValue(e);else if("object"==typeof e){if(e instanceof HTMLLIElement){for(s=0;s<this.liCollections.length;s++)if(this.liCollections[s]===e){t=this.getIndexByValue(e.getAttribute("data-value"));break}}else for(var i=JSON.parse(JSON.stringify(e))[this.fields.value],s=0;s<this.listData.length;s++)if(JSON.parse(JSON.stringify(this.listData[s]))[this.fields.value]===i){t=this.getIndexByValue(i);break}}else t=e;if(t<this.liCollections.length&&t>-1&&!JSON.parse(JSON.stringify(this.listData[t]))[this.fields.disabled]){var l=this.liCollections[t];if(l){this.disableListItem(l);var n=JSON.parse(JSON.stringify(this.listData[t]));n[this.fields.disabled]=!0,this.listData[t]=n,this.dataSource=this.listData}}}}},s.prototype.destroy=function(){this.hidePopup(),this.unWireEvent(),this.list&&this.unWireListEvents(),this.inputElement&&!this.inputElement.classList.contains("e-"+this.getModuleName())||(this.previousSelectedLI=null,this.item=null,this.selectedLI=null,this.popupObj=null,e.prototype.destroy.call(this))},s.prototype.getLocaleName=function(){return"mention"},s.prototype.getNgDirective=function(){return"EJS-MENTION"},s.prototype.getModuleName=function(){return"mention"},ke([t.Property(null)],s.prototype,"cssClass",void 0),ke([t.Property("@")],s.prototype,"mentionChar",void 0),ke([t.Property(!1)],s.prototype,"showMentionChar",void 0),ke([t.Property(!1)],s.prototype,"allowSpaces",void 0),ke([t.Property(null)],s.prototype,"suffixText",void 0),ke([t.Property(25)],s.prototype,"suggestionCount",void 0),ke([t.Property(0)],s.prototype,"minLength",void 0),ke([t.Property("None")],s.prototype,"sortOrder",void 0),ke([t.Property(!0)],s.prototype,"ignoreCase",void 0),ke([t.Property(!0)],s.prototype,"requireLeadingSpace",void 0),ke([t.Property(!1)],s.prototype,"highlight",void 0),ke([t.Property()],s.prototype,"locale",void 0),ke([t.Property("auto")],s.prototype,"popupWidth",void 0),ke([t.Property("300px")],s.prototype,"popupHeight",void 0),ke([t.Property(300)],s.prototype,"debounceDelay",void 0),ke([t.Property(null)],s.prototype,"displayTemplate",void 0),ke([t.Property(null)],s.prototype,"itemTemplate",void 0),ke([t.Property("No records found")],s.prototype,"noRecordsTemplate",void 0),ke([t.Property(null)],s.prototype,"spinnerTemplate",void 0),ke([t.Property()],s.prototype,"target",void 0),ke([t.Property([])],s.prototype,"dataSource",void 0),ke([t.Property(null)],s.prototype,"query",void 0),ke([t.Property("Contains")],s.prototype,"filterType",void 0),ke([t.Complex({text:null,value:null,iconCss:null,groupBy:null},P)],s.prototype,"fields",void 0),ke([t.Event()],s.prototype,"actionBegin",void 0),ke([t.Event()],s.prototype,"actionComplete",void 0),ke([t.Event()],s.prototype,"actionFailure",void 0),ke([t.Event()],s.prototype,"change",void 0),ke([t.Event()],s.prototype,"beforeOpen",void 0),ke([t.Event()],s.prototype,"opened",void 0),ke([t.Event()],s.prototype,"closed",void 0),ke([t.Event()],s.prototype,"select",void 0),ke([t.Event()],s.prototype,"filtering",void 0),ke([t.Event()],s.prototype,"created",void 0),ke([t.Event()],s.prototype,"destroyed",void 0),s=ke([t.NotifyPropertyChanges],s)}(U);return j.Inject(T),ae.Inject(T),he.Inject(T),be.Inject(Se,T),Oe.Inject(Se),e.AutoComplete=he,e.CheckBoxSelection=Se,e.ComboBox=ae,e.DropDownBase=U,e.DropDownList=j,e.DropDownTree=ie,e.FieldSettings=P,e.Fields=ee,e.ListBox=Oe,e.Mention=Ne,e.MultiSelect=be,e.Search=u,e.SelectionSettings=Ie,e.ToolbarSettings=we,e.TreeSettings=te,e.VirtualScroll=T,e.createFloatLabel=v,e.dropDownBaseClasses=H,e.dropDownListClasses=q,e.encodePlaceholder=E,e.escapeCharRegExp=p,e.floatLabelBlur=S,e.floatLabelFocus=b,e.highlightSearch=c,e.incrementalSearch=h,e.removeFloating=y,e.resetIncrementalSearchValues=d,e.revertHighlightSearch=f,e.setPlaceHolder=C,e.updateFloatLabelState=g,e}({},ej.base,ej.data,ej.lists,ej.notifications,ej.popups,ej.inputs,ej.buttons,ej.navigations),this.ejs=ej;
|
|
10
|
+
this.ej=this.ej||{},this.ej.dropdowns=function(e,t,i,s,l,n,a,r,o){"use strict";function h(e,t,i,s,l,n,a,r,o){n&&""!==x?x===I&&(w=String.fromCharCode(e)):""!==w?(x=w+String.fromCharCode(e),w=""):x+=String.fromCharCode(e),r?(setTimeout(function(){w=""},700),setTimeout(function(){x=""},3e3)):setTimeout(function(){x=""},1e3);var h;if(x=s?x.toLowerCase():x,D!==l||I!==x||o){var u=t,p=x.length,d=void 0,c=i=i?i+1:0;O=[];do{c===u.length&&(c=-1),d=u[h=-1===c?0:c],(s?d.innerText.toLowerCase():d.innerText).substr(0,p)===x&&O.push(u[h]),c++}while(c!==i);if(I=x,D=l,r){for(var m=!1,f=0;f<O.length;f++)if(a&&O[f].textContent.toLowerCase()===a.toLowerCase()){h=f,m=!0;break}return a&&m&&(h+=1),O[h]?O[h]:O[0]}return O[0]}for(c=0;c<O.length;c++){if(O[c].classList.contains(A)){h=c;break}if(a&&O[c].textContent.toLowerCase()===a.toLowerCase()){h=c;break}}return h+=1,r?O[h]&&O.length-1!==h?O[h]:O[O.length]:O[h]?O[h]:O[0]}function u(e,t,i,s,l,n,a,r){var o=t;s=void 0===s||null===s||s;var h={item:null,index:null};if(e&&e.length&&t){var u=e.length,d=s?e.toLocaleLowerCase():e;d=p(d);for(var c=0,m=o;c<m.length;c++){var f=function(e,o){var p,c=o[e];if(t&&l){var m=c,f=n.text.split(".");l.filter(function(e){Array.prototype.slice.call(f).forEach(function(t){("object"===a&&!e.isHeader&&-1!==m.textContent.toString().indexOf(e[t])&&null!=e[n.value]&&m.getAttribute("data-value")===e[n.value].toString()||"string"===a&&-1!==m.textContent.toString().indexOf(e))&&(p="object"===a?e[t]:e)})})}var v=l&&p?(s?p.toString().toLocaleLowerCase():p).replace(/^\s+|\s+$/g,""):(s?c.textContent.toLocaleLowerCase():c.textContent).replace(/^\s+|\s+$/g,"");if(r&&v&&d&&(v=v.normalize("NFD").replace(/[\u0300-\u036f]/g,""),d=d.normalize("NFD").replace(/[\u0300-\u036f]/g,"")),"Equal"===i&&v===d||"StartsWith"===i&&v.substr(0,u)===d||"EndsWith"===i&&v.substr(v.length-d.length)===d||"Contains"===i&&new RegExp(d,"g").test(v))return h.item=c,h.index=e,{value:{item:c,index:e}}}(c,m);if("object"==typeof f)return f.value}return h}return h}function p(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function d(e){D===e&&(D="",I="",x="",O=[])}function c(e,t,i,s){if(/<[^>]*>/g.test(e.innerText)&&(e.innerText=e.innerText.replace(/[\u00A0-\u9999<>&]/g,function(e){return"&#"+e.charCodeAt(0)+";"})),""!==t){var l=i?"gim":"gm";t=/^[a-zA-Z0-9- ]*$/.test(t)?t:t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var n="StartsWith"===s?"^("+t+")":"EndsWith"===s?"("+t+")$":"("+t+")";m(e,new RegExp(n,l))}}function m(e,t){for(var i=0;e.childNodes&&i<e.childNodes.length;i++){if(3===e.childNodes[i].nodeType&&""!==e.childNodes[i].textContent.trim()){var s=e.childNodes[i].nodeValue.trim().replace(t,'<span class="e-highlight">$1</span>');e.childNodes[i].nodeValue="",e.innerHTML=e.innerHTML.trim()+s;break}m(e.childNodes[i],t)}}function f(e){for(var t=e.querySelectorAll(".e-highlight"),i=t.length-1;i>=0;i--){var s=t[i].parentNode,l=document.createTextNode(t[i].textContent);s.replaceChild(l,t[i])}}function v(e,i,s,l,n,a,r){var o=t.createElement("span",{className:ue}),h=t.createElement("label",{className:pe}),u=s.getAttribute("id")?s.getAttribute("id"):t.getUniqueID("ej2_multiselect");s.id=u,t.isNullOrUndefined(s.id)||""===s.id||(h.id="label_"+s.id.replace(/ /g,"_"),h.setAttribute("for",s.id),t.attributes(l,{"aria-labelledby":h.id})),t.isNullOrUndefined(l.placeholder)||""===l.placeholder||(h.innerText=E(l.placeholder),l.removeAttribute("placeholder")),h.innerText=E(r),i.appendChild(o),i.appendChild(h),e.classList.add("e-float-input"),g(n,h),"Always"===a&&(h.classList.contains(ce)&&t.removeClass([h],ce),t.addClass([h],de))}function g(e,i){e&&e.length>0?(t.addClass([i],de),t.removeClass([i],ce)):(t.removeClass([i],de),t.addClass([i],ce))}function y(e,i,s,l,n,a,r){var o,h=i.querySelector("."+pe),u=i.querySelector("."+ue);t.isNullOrUndefined(h)?C(n,l,o=null!==r?r:""):(o=h.innerText,t.detach(s.querySelector("."+pe)),C(n,l,o),t.isNullOrUndefined(u)||t.detach(s.querySelector("."+ue))),e.classList.remove("e-float-input")}function C(e,t,i){e&&e.length?t.placeholder="":t.placeholder=i}function b(e,i){e.classList.add("e-input-focus");var s=i.querySelector("."+pe);t.isNullOrUndefined(s)||(t.addClass([s],de),s.classList.contains(ce)&&t.removeClass([s],ce))}function S(e,i,s,l,n){e.classList.remove("e-input-focus");var a=i.querySelector("."+pe);s&&s.length<=0&&"Auto"===l&&!t.isNullOrUndefined(a)&&(a.classList.contains(de)&&t.removeClass([a],de),t.addClass([a],ce))}function E(e){var i="";if(!t.isNullOrUndefined(e)&&""!==e){var s=document.createElement("span");s.innerHTML='<input placeholder="'+e+'"/>',i=s.children[0].placeholder}return i}var x="",I="",w="",O=[],A="e-active",D="",k=function(){return(k=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++){t=arguments[i];for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l])}return e}).apply(this,arguments)},N=function(e,t,i,s){return new(i||(i=Promise))(function(l,n){function a(e){try{o(s.next(e))}catch(e){n(e)}}function r(e){try{o(s.throw(e))}catch(e){n(e)}}function o(e){e.done?l(e.value):new i(function(t){t(e.value)}).then(a,r)}o((s=s.apply(e,t||[])).next())})},L=function(e,t){function i(e){return function(t){return s([e,t])}}function s(i){if(l)throw new TypeError("Generator is already executing.");for(;o;)try{if(l=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(a=o.trys,!(a=a.length>0&&a[a.length-1])&&(6===i[0]||2===i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],n=0}finally{l=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}var l,n,a,r,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return r={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r},T=function(){function e(e){var t=this;this.sentinelInfo={up:{check:function(e,i){var s=e.top-t.containerElementRect.top;return i.entered=s>=0,s+t.parent.listItemHeight*t.parent.virtualItemCount/2>=0},axis:"Y"},down:{check:function(e,i){var s=e.bottom;return i.entered=e.bottom<=t.containerElementRect.bottom,s-t.parent.listItemHeight*t.parent.virtualItemCount/2<=t.parent.listItemHeight*t.parent.virtualItemCount/2},axis:"Y"}},this.parent=e,this.removeEventListener(),this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("observe",this.observe,this),this.parent.on("setGeneratedData",this.setGeneratedData,this),this.parent.on("dataProcessAsync",this.dataProcessAsync,this),this.parent.on("setCurrentViewDataAsync",this.setCurrentViewDataAsync,this),this.parent.on("bindScrollEvent",this.bindScrollEvent,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("observe",this.observe),this.parent.off("setGeneratedData",this.setGeneratedData),this.parent.off("dataProcessAsync",this.dataProcessAsync),this.parent.off("setCurrentViewDataAsync",this.setCurrentViewDataAsync),this.parent.off("bindScrollEvent",this.bindScrollEvent))},e.prototype.bindScrollEvent=function(e){var t=this;this.component=e.component,this.observe(function(e){return t.scrollListener(e)})},e.prototype.observe=function(e){this.containerElementRect=this.parent.popupContentElement.getBoundingClientRect(),t.EventHandler.add(this.parent.popupContentElement,"wheel mousedown",this.popupScrollHandler,this),this.touchModule=new t.Touch(this.parent.popupContentElement,{scroll:this.popupScrollHandler.bind(this)}),t.EventHandler.add(this.parent.popupContentElement,"scroll",this.virtualScrollHandler(e),this)},e.prototype.getModuleName=function(){return"VirtualScroll"},e.prototype.popupScrollHandler=function(){this.parent.isMouseScrollAction=!0,this.parent.isPreventScrollAction=!1},e.prototype.getPageQuery=function(e,t,i){return 0===i||this.parent.allowFiltering||"autocomplete"===this.component||(e=e.skip(t)),e},e.prototype.setGeneratedData=function(e,t){for(var i=0,s=this.parent.listData.length+this.parent.virtualItemStartIndex,l=this.parent.virtualItemStartIndex;l<s;l++){if(!this.parent.generatedDataObject[l]&&null!==t&&this.parent.listData.slice(i,i+1).length>0){var n=this.parent.listData.slice(i,i+1);n.length>0&&(this.parent.generatedDataObject[l]=n)}i++}},e.prototype.generateAndExecuteQueryAsync=function(e,s,l,n){void 0===s&&(s=0),void 0===l&&(l=0),void 0===n&&(n=!1);var a=this.parent.dataSource;if(!n)if(t.isNullOrUndefined(this.parent.query))e=this.getPageQuery(e,s,l);else{var r=this.removeSkipAndTakeEvents(this.parent.query.clone());e=this.getPageQuery(r,s,l)}var o=this.parent.isCustomFilter;if("combobox"===this.component){var h=0;this.parent.dataSource instanceof i.DataManager?h=this.parent.remoteDataCount:this.parent.dataSource&&this.parent.dataSource.length>0&&(h=this.parent.dataSource.length),h>0&&(this.parent.isCustomFilter=h===this.parent.totalItemCount&&this.parent.queryString!==this.parent.typedString||this.parent.isCustomFilter)}this.parent.resetList(a,this.parent.fields,e),this.parent.isCustomFilter=o},e.prototype.removeSkipAndTakeEvents=function(e){return e.queries=e.queries.filter(function(e){return"onSkip"!==e.fn&&"onTake"!==e.fn}),e},e.prototype.setCurrentViewDataAsync=function(e){var s=[],l=!1,n=!0;t.isNullOrUndefined(this.component)&&(this.component=e.component);var a=this.parent.viewPortInfo.endIndex;if("multiselect"===this.component&&"CheckBox"===this.parent.mode&&this.parent.value&&Array.isArray(this.parent.value)&&this.parent.value.length>0&&this.parent.enableSelectionOrder&&""===this.parent.targetElement().trim()){if(this.parent.viewPortInfo.startIndex<this.parent.value.length){if(a=this.parent.viewPortInfo.endIndex-this.parent.value.length,0===this.parent.viewPortInfo.startIndex){if((m=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(m),this.parent.updateVirtualReOrderList(!0),this.parent.value.length<this.parent.itemCount&&this.parent.value.length!==this.parent.totalItemCount){var r=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)");r&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(r),u=(u=this.parent.getForQuery(this.parent.value).clone()).skip(0).take(this.parent.itemCount-(this.parent.value.length-this.parent.viewPortInfo.startIndex)),this.parent.appendUncheckList=!0,this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,u),n=!1,this.parent.appendUncheckList=this.parent.dataSource instanceof i.DataManager&&this.parent.appendUncheckList,n=!1}else{var o=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)");o&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(o)}n=!1}else 0!==this.parent.viewPortInfo.startIndex&&(this.parent.dataSource instanceof i.DataManager&&(this.parent.setCurrentView=!1),this.parent.updateVirtualReOrderList(!0),(m=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(m),n=!1);0!==this.parent.viewPortInfo.startIndex&&this.parent.viewPortInfo.startIndex-this.parent.value.length!==this.parent.itemCount&&this.parent.viewPortInfo.startIndex+this.parent.itemCount>this.parent.value.length&&(u=(u=this.parent.getForQuery(this.parent.value).clone()).skip(0).take(this.parent.itemCount-(this.parent.value.length-this.parent.viewPortInfo.startIndex)),this.parent.appendUncheckList=!0,this.parent.setCurrentView=!1,(m=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(m),this.parent.resetList(this.parent.dataSource,this.parent.fields,u),n=!1,this.parent.appendUncheckList=this.parent.dataSource instanceof i.DataManager&&this.parent.appendUncheckList)}else{var h=this.parent.list.querySelectorAll(".e-reorder")[0];this.parent.list.querySelector(".e-virtual-ddl-content")&&h&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(h);var u=this.parent.getForQuery(this.parent.value).clone(),p=this.parent.viewPortInfo.startIndex-this.parent.value.length>=0?this.parent.viewPortInfo.startIndex-this.parent.value.length:0;u=u.skip(p),this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,u),n=!1}this.parent.totalItemsCount()}if(n)for(var d=this.parent.viewPortInfo.startIndex;d<a;d++){var c=d;if("multiselect"===this.component&&"CheckBox"===this.parent.mode){var m=this.parent.list.querySelector(".e-list-parent.e-reorder");m&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(m)}var f=this.parent.generatedDataObject[c];if("multiselect"===this.component&&this.parent.hideSelectedItem){if(f){var v=t.getValue(this.parent.fields.value,f[0]);if(this.parent.value&&null!==v&&Array.isArray(this.parent.value)&&this.parent.value.length>0&&this.parent.value.indexOf(v)<0){u=this.parent.getForQuery(this.parent.value).clone();u=this.parent.viewPortInfo.endIndex===this.parent.totalItemCount+this.parent.value.length&&this.parent.hideSelectedItem?u.skip(this.parent.totalItemCount-this.parent.itemCount):u.skip(this.parent.viewPortInfo.startIndex),this.parent.setCurrentView=!1,this.parent.isPreventScrollAction=!0,this.parent.resetList(this.parent.dataSource,this.parent.fields,u),l=!0;break}(null===this.parent.value||this.parent.value&&0===this.parent.value.length)&&s.push(f[0])}if(c===a-1&&s.length!==this.parent.itemCount&&this.parent.hideSelectedItem){u=this.parent.value&&this.parent.value.length>0?this.parent.getForQuery(this.parent.value).clone():new i.Query;u=this.parent.value&&this.parent.viewPortInfo.endIndex===this.parent.totalItemCount+this.parent.value.length&&this.parent.hideSelectedItem?u.skip(this.parent.totalItemCount-this.parent.itemCount):u.skip(this.parent.viewPortInfo.startIndex),this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,u),l=!0}}else f&&s.push(f[0]);this.parent.setCurrentView=!1}if(!l&&n){"multiselect"===this.component&&this.parent.allowCustomValue&&0===this.parent.viewPortInfo.startIndex&&this.parent.virtualCustomData&&s.splice(0,0,this.parent.virtualCustomData);"multiselect"===this.component&&this.parent.allowCustomValue&&this.parent.viewPortInfo.endIndex===this.parent.totalItemCount&&this.parent.virtualCustomSelectData&&this.parent.virtualCustomSelectData.length>0&&(s=s.concat(this.parent.virtualCustomSelectData)),this.parent.renderItems(s,this.parent.fields,"multiselect"===this.component&&"CheckBox"===this.parent.mode),this.parent.updateSelectionList()}"multiselect"===this.component&&(this.parent.updatevirtualizationList(),this.parent.checkMaxSelection()),this.parent.getSkeletonCount(),this.parent.skeletonCount=0!==this.parent.totalItemCount&&this.parent.totalItemCount<2*this.parent.itemCount&&(!(this.parent.dataSource instanceof i.DataManager)||this.parent.dataSource instanceof i.DataManager&&this.parent.totalItemCount<=this.parent.itemCount)?0:this.parent.skeletonCount;var g=this.parent.list.getElementsByClassName("e-virtual-ddl")[0],y="multiselect"!==this.component||"multiselect"===this.component&&!(this.parent.dataSource instanceof i.DataManager)||this.parent.dataSource instanceof i.DataManager&&!l;if(g&&y)g.style=this.parent.GetVirtualTrackHeight();else if(!g&&this.parent.skeletonCount>0&&this.parent.popupWrapper){var C=this.parent.createElement("div",{id:this.parent.element.id+"_popup",className:"e-virtual-ddl",styles:this.parent.GetVirtualTrackHeight()});this.parent.popupWrapper.querySelector(".e-dropdownbase").appendChild(C)}("multiselect"!==this.component||"multiselect"===this.component&&!(this.parent.dataSource instanceof i.DataManager)||this.parent.dataSource instanceof i.DataManager&&(!l||0===this.parent.viewPortInfo.startIndex))&&this.parent.UpdateSkeleton(),this.parent.liCollections=this.parent.list.querySelectorAll(".e-list-item");var b=this.parent.list.getElementsByClassName("e-virtual-ddl-content")[0];if(b&&y&&(b.style=this.parent.getTransformValues()),this.parent.fields.groupBy&&this.parent.scrollStop(),40===this.parent.keyCode&&this.parent.isScrollChanged&&this.parent.hideSelectedItem&&!t.isNullOrUndefined(this.parent.currentFocuedListElement)){var S=this.parent.getElementByValue(this.parent.currentFocuedListElement.getAttribute("data-value"));this.parent.addListFocus(S),this.parent.isScrollChanged=!1}},e.prototype.generateQueryAndSetQueryIndexAsync=function(e,t){var s=!1,l=0,n=0,a=this.parent.viewPortInfo.endIndex;if(!t&&0!==a)for(var r=this.parent.viewPortInfo.startIndex;r<=a;r++)r in this.parent.generatedDataObject||(s?n=r===a?r:r+1:(s=!0,l=n=r));!s||this.parent.totalItemCount===l&&this.parent.totalItemCount===n||(this.parent.virtualItemStartIndex=l,this.parent.virtualItemEndIndex=n,this.parent.setCurrentView=!0,this.generateAndExecuteQueryAsync(e,l,n),"multiselect"===this.component&&this.parent.hideSelectedItem&&this.parent.value&&Array.isArray(this.parent.value)&&this.parent.value.length>0&&this.parent.totalItemsCount(),"multiselect"===this.component&&this.parent.virtualItemStartIndex===this.parent.virtualItemEndIndex&&(this.parent.virtualItemStartIndex=this.parent.viewPortInfo.startIndex,this.parent.virtualItemEndIndex=this.parent.viewPortInfo.endIndex)),(!(this.parent.dataSource instanceof i.DataManager)||this.parent.dataSource instanceof i.DataManager&&!this.parent.isRequesting)&&this.setCurrentViewDataAsync()},e.prototype.dataProcessAsync=function(e){this.parent.selectedValueInfo=null,this.parent.virtualItemStartIndex=this.parent.viewPortInfo.startIndex,this.parent.virtualItemEndIndex=this.parent.viewPortInfo.endIndex,this.generateQueryAndSetQueryIndexAsync(new i.Query,e)},e.prototype.virtualScrollRefreshAsync=function(){return N(this,void 0,void 0,function(){return L(this,function(e){switch(e.label){case 0:return this.parent.isCustomFilter=!(this.parent.isTyped||"combobox"===this.component&&this.parent.allowFiltering&&this.parent.queryString!==this.parent.typedString||!t.isNullOrUndefined(this.parent.filterInput)&&!t.isNullOrUndefined(this.parent.filterInput.value)&&""!==this.parent.filterInput.value&&"combobox"!==this.component)&&!("autocomplete"===this.component&&null!=this.parent.value)||this.parent.isCustomFilter,(this.parent.allowFiltering||"autocomplete"===this.component)&&(t.isNullOrUndefined(this.parent.typedString)||"combobox"===this.component&&!t.isNullOrUndefined(this.parent.typedString)&&this.parent.allowFiltering?(this.parent.getSkeletonCount(!0),"combobox"===this.component&&(this.parent.skeletonCount=0!==this.parent.totalItemCount&&this.parent.totalItemCount<2*this.parent.itemCount&&(!(this.parent.dataSource instanceof i.DataManager)||this.parent.dataSource instanceof i.DataManager&&this.parent.totalItemCount<=this.parent.itemCount)?0:this.parent.skeletonCount)):(this.parent.viewPortInfo.endIndex>=this.parent.dataCount&&(this.parent.viewPortInfo.endIndex=this.parent.dataCount),this.parent.viewPortInfo.startIndex>=this.parent.dataCount&&(this.parent.viewPortInfo.startIndex=this.parent.dataCount-this.parent.itemCount))),[4,this.dataProcessAsync()];case 1:return e.sent(),null==this.parent.keyboardEvent||this.parent.dataSource instanceof i.DataManager&&(!(this.parent.dataSource instanceof i.DataManager)||this.parent.isRequesting)||this.parent.handleVirtualKeyboardActions(this.parent.keyboardEvent,this.parent.pageCount),this.parent.customFilterQuery||(this.parent.isCustomFilter=!1),[2]}})})},e.prototype.scrollListener=function(e){var i=this;if(!this.parent.isPreventScrollAction&&!this.parent.isVirtualTrackHeight){this.parent.preventSetCurrentData=!1;var s=e.sentinel,l=this.parent.previousStartIndex;this.parent.viewPortInfo=this.getInfoFromView(e.direction,s,e.offset,!1),this.parent.isUpwardScrolling=!1,this.parent.previousStartIndex===l||this.parent.isKeyBoardAction?this.parent.isScrollActionTriggered&&(this.parent.isPreventKeyAction=!1,this.parent.isScrollActionTriggered=!1,this.parent.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.parent.getTransformValues()):(this.parent.isScrollActionTriggered=!1,this.parent.currentPageNumber=this.parent.viewPortInfo.currentPageNumber,this.parent.virtualListInfo=k({},this.parent.viewPortInfo),this.parent.isPreventKeyAction=!0,this.parent.isVirtualScrolling=!0,setTimeout(function(){i.parent.pageCount=i.parent.getPageCount(),i.parent.isRequesting=!1,i.virtualScrollRefreshAsync().then(function(){i.parent.popupObj&&(i.parent.list=i.parent.popupObj.element.querySelector(".e-content")||t.select(".e-content"),i.parent.updateSelectionList(),i.parent.liCollections=i.parent.getItems()),i.parent.isKeyBoardAction=!1,i.parent.isVirtualScrolling=!1,i.parent.isPreventKeyAction=!1})},5)),this.parent.previousInfo=this.parent.viewPortInfo}},e.prototype.getInfoFromView=function(e,i,s,l){var n={direction:e,sentinelInfo:i,offsets:s,startIndex:this.parent.previousStartIndex,endIndex:this.parent.previousEndIndex},a=this.parent.popupContentElement?this.parent.popupContentElement.getBoundingClientRect().height:0,r=this.parent.listItemHeight,o=s.top/r,h=a/r,u=o+h,p=this.parent.virtualItemCount/4,d=this.parent.totalItemCount;if("down"===n.direction){f=Math.round(u)-Math.round(p);if(t.isNullOrUndefined(n.startIndex)||u>n.startIndex+Math.round(this.parent.virtualItemCount/2+p)&&n.endIndex!==d){n.startIndex=f>=0?Math.round(f):0,n.startIndex=n.startIndex>o?Math.floor(o):n.startIndex;m=n.startIndex+this.parent.virtualItemCount;n.startIndex=m<u?Math.ceil(u)-this.parent.virtualItemCount:n.startIndex,n.endIndex=m<d?m:d,n.startIndex=m>=d?n.endIndex-this.parent.virtualItemCount>0?n.endIndex-this.parent.virtualItemCount:0:n.startIndex,n.currentPageNumber=Math.ceil(n.endIndex/this.parent.virtualItemCount)}}else if("up"===n.direction&&(n.startIndex&&n.endIndex||Math.ceil(o)>this.parent.previousStartIndex)&&(o<Math.round((n.startIndex*r+p*r)/r)||Math.ceil(o)>this.parent.previousStartIndex)){var c=p>h?p:h+h/4,m=Math.round(o+c);n.endIndex=m<d?m:d;var f=n.endIndex-this.parent.virtualItemCount;n.startIndex=f>0?f:0,n.endIndex=f<0?this.parent.virtualItemCount:n.endIndex,n.currentPageNumber=Math.ceil(n.startIndex/this.parent.virtualItemCount)}return l?this.parent.scrollPreStartIndex=n.startIndex:(this.parent.previousStartIndex=n.startIndex,this.parent.startIndex=n.startIndex,this.parent.previousEndIndex=n.endIndex),n},e.prototype.virtualScrollHandler=function(e){var i=this,s="chrome"===t.Browser.info.name?200:100,l=0,n=t.debounce(e,s),a=t.debounce(e,50);return function(e){var t=e.target.scrollTop,s=e.target.scrollLeft,r=l<t&&!i.parent.isUpwardScrolling?"down":"up";l=t;var o=i.sentinelInfo[r],h=i.parent.scrollPreStartIndex,u={top:t,left:s};i.parent.list&&i.parent.list.querySelectorAll(".e-virtual-list").length>0&&(i.getInfoFromView(r,o,u,!0),i.parent.scrollPreStartIndex===h||i.parent.isPreventScrollAction||(i.parent.isScrollActionTriggered=!0,i.parent.list.querySelector(".e-virtual-ddl-content").style.transform="translate(0px,"+t+"px)"));var p=n;"X"===o.axis&&(p=a),p({direction:r,sentinel:o,offset:{top:t,left:s},focusElement:document.activeElement})}},e.prototype.destroy=function(){this.removeEventListener()},e}(),B=function(){var e=function(t,i){return(e=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])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),V=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(l=e[r])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},P=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return B(i,e),V([t.Property()],i.prototype,"text",void 0),V([t.Property()],i.prototype,"value",void 0),V([t.Property()],i.prototype,"iconCss",void 0),V([t.Property()],i.prototype,"groupBy",void 0),V([t.Property()],i.prototype,"htmlAttributes",void 0),V([t.Property()],i.prototype,"disabled",void 0),i}(t.ChildProperty),H={root:"e-dropdownbase",rtl:"e-rtl",content:"e-content",selected:"e-active",hover:"e-hover",noData:"e-nodata",fixedHead:"e-fixed-head",focus:"e-item-focus",li:"e-list-item",group:"e-list-group-item",disabled:"e-disabled",grouping:"e-dd-group",virtualList:"e-list-item e-virtual-list"},U=function(e){function n(t,i){var s=e.call(this,t,i)||this;return s.preventChange=!1,s.isPreventChange=!1,s.isDynamicDataChange=!1,s.addedNewItem=!1,s.isAddNewItemTemplate=!1,s.isRequesting=!1,s.isVirtualizationEnabled=!1,s.isCustomDataUpdated=!1,s.isAllowFiltering=!1,s.virtualizedItemsCount=0,s.isCheckBoxSelection=!1,s.totalItemCount=0,s.dataCount=0,s.remoteDataCount=-1,s.isRemoteDataUpdated=!1,s.isIncrementalRequest=!1,s.itemCount=30,s.virtualListHeight=0,s.isVirtualScrolling=!1,s.isPreventScrollAction=!1,s.scrollPreStartIndex=0,s.isScrollActionTriggered=!1,s.previousStartIndex=0,s.isMouseScrollAction=!1,s.isKeyBoardAction=!1,s.isScrollChanged=!1,s.isUpwardScrolling=!1,s.startIndex=0,s.currentPageNumber=0,s.pageCount=0,s.isPreventKeyAction=!1,s.generatedDataObject={},s.skeletonCount=32,s.isVirtualTrackHeight=!1,s.virtualSelectAll=!1,s.isVirtualReorder=!1,s.incrementalQueryString="",s.incrementalEndIndex=0,s.incrementalStartIndex=0,s.incrementalPreQueryString="",s.isObjectCustomValue=!1,s.appendUncheckList=!1,s.getInitialData=!1,s.preventPopupOpen=!0,s.virtualSelectAllState=!1,s.CurrentEvent=null,s.isDynamicData=!1,s.isPrimitiveData=!1,s.isCustomFiltering=!1,s.debounceTimer=null,s.virtualListInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:0},s.viewPortInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:0},s.selectedValueInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:0},s}return B(n,e),n.prototype.getPropObject=function(e,t,i){var s=new Object,l=new Object,n=function(e){return e};s[n(e)]=t[n(e)],l[n(e)]=i[n(e)];var a=new Object;return a.newProperty=s,a.oldProperty=l,a},n.prototype.getValueByText=function(e,i,s){var l=null;return t.isNullOrUndefined(this.listData)||(l=i?this.checkValueCase(e,!0,s):this.checkValueCase(e,!1,s)),l},n.prototype.checkValueCase=function(e,i,s,l){var n=this,a=null;if(l&&(a=e),!t.isNullOrUndefined(this.listData)){var r=this.listData,o=this.fields,h=this.typeOfData(r).typeof;if("string"===h||"number"===h||"boolean"===h)for(var u=0,p=r;u<p.length;u++){var d=p[u];t.isNullOrUndefined(d)||(s?i?this.checkIgnoreCase(String(d),e)&&(a=this.checkingAccent(String(d),e,i)):a=this.checkingAccent(String(d),e,i):i?this.checkIgnoreCase(String(d),e)&&(a=this.getItemValue(String(d),e,i)):this.checkNonIgnoreCase(String(d),e)&&(a=this.getItemValue(String(d),e,i,l)))}else if(i)r.filter(function(i){var s=t.getValue(o.value,i);!t.isNullOrUndefined(s)&&n.checkIgnoreCase(t.getValue(o.text,i).toString(),e)&&(a=t.getValue(o.value,i))});else if(l){var c=null;c=a,r.filter(function(e){var i=t.getValue(o.value,e);t.isNullOrUndefined(i)||t.isNullOrUndefined(a)||i.toString()!==c.toString()||(a=t.getValue(o.text,e))})}else r.filter(function(i){n.checkNonIgnoreCase(t.getValue(o.text,i),e)&&(a=t.getValue(o.value,i))})}return a},n.prototype.checkingAccent=function(e,t,s){var l=i.DataUtil.ignoreDiacritics(String(e)),n=i.DataUtil.ignoreDiacritics(t.toString()),a=null;return s?this.checkIgnoreCase(l,n)&&(a=this.getItemValue(String(e),t,s)):this.checkNonIgnoreCase(String(e),t)&&(a=this.getItemValue(String(e),t,s)),a},n.prototype.checkIgnoreCase=function(e,t){return String(e).toLowerCase()===t.toString().toLowerCase()},n.prototype.checkNonIgnoreCase=function(e,t){return String(e)===t.toString()},n.prototype.getItemValue=function(e,t,i,s){var l=this.listData,n=this.typeOfData(l).typeof;return s?e.toString():i?"string"===n?String(e):this.getFormattedValue(String(e)):"string"===n?t:this.getFormattedValue(t)},n.prototype.templateCompiler=function(e){var i=!1;if("function"!=typeof e&&e)try{i=!!t.selectAll(e,document).length}catch(e){i=!1}return i},n.prototype.l10nUpdate=function(e){var i="listbox"===this.getModuleName()?this.ulElement:this.list;if(!t.isNullOrUndefined(this.noRecordsTemplate)&&"No records found"!==this.noRecordsTemplate||"Request failed"!==this.actionFailureTemplate){var s=e?this.actionFailureTemplate:this.noRecordsTemplate,l=void 0,n=e?this.actionFailureTemplateId:this.noRecordsTemplateId;i.innerHTML="";var a=this.templateCompiler(s);l="function"!=typeof s&&a?t.compile(t.select(s,document).innerHTML.trim()):t.compile(s);var r=e?"actionFailureTemplate":"noRecordsTemplate",o=void 0;if((o=this.isReact&&"function"==typeof s?l({},this,r,n,this.isStringTemplate,null):l({},this,r,n,this.isStringTemplate,null,i))&&o.length>0)for(var h=0;h<o.length;h++)"listbox"===this.getModuleName()&&"noRecordsTemplate"===r?"#text"===o[h].nodeName?((c=this.createElement("li")).textContent=o[h].textContent,c.classList.add("e-list-nrt"),c.setAttribute("role","option"),i.appendChild(c)):(o[h].classList.add("e-list-nr-template"),i.appendChild(o[h])):(o[h]instanceof HTMLElement||o[h]instanceof Text&&""!==o[h].textContent)&&i.appendChild(o[h]);this.renderReactTemplates()}else{var u={noRecordsTemplate:"No records found",actionFailureTemplate:"Request failed"},p=new t.L10n(this.getLocaleName(),{},this.locale);""!==p.getConstant("actionFailureTemplate")||""!==p.getConstant("noRecordsTemplate")?this.l10n=p:this.l10n=new t.L10n("listbox"===this.getModuleName()?"listbox":"mention"===this.getModuleName()?"mention":"dropdowns",u,this.locale);var d=e?this.l10n.getConstant("actionFailureTemplate"):this.l10n.getConstant("noRecordsTemplate");if("listbox"===this.getModuleName()){var c=this.createElement("li");c.textContent=d,i.appendChild(c),c.classList.add("e-list-nrt"),c.setAttribute("role","option")}else t.isNullOrUndefined(i)||(i.innerHTML=d)}},n.prototype.checkAndResetCache=function(){this.isVirtualizationEnabled&&(this.generatedDataObject={},this.virtualItemStartIndex=this.virtualItemEndIndex=0,this.viewPortInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount},this.selectedValueInfo=null)},n.prototype.updateIncrementalInfo=function(e,t){this.viewPortInfo.startIndex=e,this.viewPortInfo.endIndex=t,this.updateVirtualItemIndex(),this.isIncrementalRequest=!0,this.resetList(this.dataSource,this.fields,this.query),this.isIncrementalRequest=!1},n.prototype.updateIncrementalView=function(e,t){this.viewPortInfo.startIndex=e,this.viewPortInfo.endIndex=t,this.updateVirtualItemIndex(),this.resetList(this.dataSource,this.fields,this.query),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+H.li),this.ulElement=this.list.querySelector("ul")},n.prototype.updateVirtualItemIndex=function(){this.virtualItemStartIndex=this.viewPortInfo.startIndex,this.virtualItemEndIndex=this.viewPortInfo.endIndex,this.virtualListInfo=this.viewPortInfo},n.prototype.getFilteringSkeletonCount=function(){var e=this.skeletonCount;this.getSkeletonCount(!0),this.skeletonCount=this.dataCount<2*this.itemCount&&(!(this.dataSource instanceof i.DataManager)||this.dataSource instanceof i.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount;var t=!0;if("autocomplete"!==this.getModuleName()&&"multiselect"!==this.getModuleName()||!(this.totalItemCount<2*this.itemCount)||this.dataSource instanceof i.DataManager&&!(this.dataSource instanceof i.DataManager&&this.totalItemCount<=this.itemCount)||(this.skeletonCount=0,t=!1),!this.list.classList.contains(H.noData)){if(e!==this.skeletonCount&&t?this.UpdateSkeleton(!0,Math.abs(e-this.skeletonCount)):this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll(".e-list-item"),this.list.getElementsByClassName("e-virtual-ddl").length>0)this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight();else if(!this.list.querySelector(".e-virtual-ddl")&&this.skeletonCount>0&&this.list.querySelector(".e-dropdownbase")){var s=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()});this.list.querySelector(".e-dropdownbase").appendChild(s)}this.list.getElementsByClassName("e-virtual-ddl-content").length>0&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues())}},n.prototype.getSkeletonCount=function(e){this.virtualListHeight=null!=this.listContainerHeight?parseInt(this.listContainerHeight,10):this.virtualListHeight;var t=this.virtualListHeight>0&&this.listItemHeight>0?Math.floor(this.virtualListHeight/this.listItemHeight):0;this.skeletonCount=4*t<this.itemCount?this.itemCount:4*t,this.itemCount=e?this.itemCount:this.skeletonCount,this.virtualItemCount=this.itemCount,this.skeletonCount=Math.floor(this.skeletonCount/2)},n.prototype.GetVirtualTrackHeight=function(){var e=this.totalItemCount===this.viewPortInfo.endIndex?this.totalItemCount*this.listItemHeight-this.itemCount*this.listItemHeight:this.totalItemCount*this.listItemHeight,t="height: "+((e=this.isVirtualTrackHeight?0:e)-this.itemCount*this.listItemHeight)+"px;";return"autocomplete"!==this.getModuleName()&&"multiselect"!==this.getModuleName()||0!==this.skeletonCount?t:"height: 0px;"},n.prototype.getTransformValues=function(){var e=this.viewPortInfo.startIndex*this.listItemHeight;return e-=this.skeletonCount*this.listItemHeight,"transform: translate(0px, "+(e=0===this.viewPortInfo.startIndex&&this.listData&&0===this.listData.length||0===this.skeletonCount?0:e)+"px);"},n.prototype.UpdateSkeleton=function(e,t){var i=this.list.querySelector(".e-virtual-ddl-content"),s=this.list.querySelector(".e-virtual-list");if(i&&(!s||e)&&this.isVirtualizationEnabled){for(var n=e?t:this.skeletonCount,a=0;a<n;a++){r=this.createElement("li",{className:H.virtualList,styles:"overflow: inherit"});this.isVirtualizationEnabled&&this.itemTemplate&&(r.style.height=this.listItemHeight-parseInt(window.getComputedStyle(this.getItems()[1]).marginBottom,10)+"px"),(o=new l.Skeleton({shape:"Text",height:"10px",width:"95%",cssClass:"e-skeleton-text"})).appendTo(this.createElement("div")),r.appendChild(o.element),i.firstChild&&i.firstChild.insertBefore(r,i.firstChild.children[0])}if("multiselect"===this.getModuleName()&&!this.isVirtualReorder&&!i.firstChild.classList.contains("e-reorder")){for(a=0;a<n&&this.totalItemCount!==this.viewPortInfo.endIndex;a++){var r=this.createElement("li",{className:H.virtualList+" e-virtual-list-end",styles:"overflow: inherit"});this.isVirtualizationEnabled&&this.itemTemplate&&(r.style.height=this.listItemHeight-parseInt(window.getComputedStyle(this.getItems()[1]).marginBottom,10)+"px");var o=new l.Skeleton({shape:"Text",height:"10px",width:"95%",cssClass:"e-skeleton-text-end"});o.appendTo(this.createElement("div")),r.appendChild(o.element),i.firstChild&&i.firstChild.appendChild(r)}this.totalItemCount===this.viewPortInfo.endIndex&&i.querySelectorAll(".e-virtual-list-end").forEach(function(e){return e.remove()})}}},n.prototype.getLocaleName=function(){return"drop-down-base"},n.prototype.getTextByValue=function(e){return this.checkValueCase(e,!1,!1,!0)},n.prototype.getFormattedValue=function(e){if(this.listData&&this.listData.length){var i=void 0;if(i=this.properties.allowCustomValue&&this.properties.value&&this.properties.value instanceof Array&&this.properties.value.length>0?this.typeOfData(this.properties.value):this.typeOfData(this.listData),!t.isNullOrUndefined(i.item)&&"number"==typeof t.getValue(this.fields.value?this.fields.value:"value",i.item)||"number"===i.typeof)return parseFloat(e);if(!t.isNullOrUndefined(i.item)&&"boolean"==typeof t.getValue(this.fields.value?this.fields.value:"value",i.item)||"boolean"===i.typeof)return"true"===e||""+e=="true"}return e},n.prototype.setEnableRtl=function(){t.isNullOrUndefined(this.enableRtlElements)||(this.list&&this.enableRtlElements.push(this.list),this.enableRtl?t.addClass(this.enableRtlElements,H.rtl):t.removeClass(this.enableRtlElements,H.rtl))},n.prototype.initialize=function(e){if(this.bindEvent=!0,this.preventPopupOpen=!0,this.actionFailureTemplateId=this.element.id+"ActionFailureTemplate","UL"===this.element.tagName){var i=s.ListBase.createJsonFromElement(this.element);this.setProperties({fields:{text:"text",value:"text"}},!0),this.resetList(i,this.fields)}else"SELECT"===this.element.tagName?(this.dataSource instanceof Array?this.dataSource.length>0:!t.isNullOrUndefined(this.dataSource))?this.isDynamicDataChange&&this.setListData(this.dataSource,this.fields,this.query):this.renderItemsBySelect():this.setListData(this.dataSource,this.fields,this.query,e)},n.prototype.getPersistData=function(){return this.addOnPersist([])},n.prototype.updateDataAttribute=function(e){for(var i=["class","style","id","type","aria-expanded","aria-autocomplete","aria-readonly"],s={},l=0;l<this.element.attributes.length;l++)-1!==i.indexOf(this.element.attributes[l].name)||"dropdownlist"===this.getModuleName()&&"readonly"===this.element.attributes[l].name||(s[this.element.attributes[l].name]=this.element.getAttribute(this.element.attributes[l].name));t.extend(s,e,s),this.setProperties({htmlAttributes:s},!0)},n.prototype.renderItemsBySelect=function(){var e,t=this.element,i=t.querySelectorAll("select>optgroup"),s="multiselect"===this.getModuleName()&&this.isGroupChecking&&i.length>0;e=s?{value:"value",text:"text",groupBy:"categeory"}:e={value:"value",text:"text"};var l=[],n=t.querySelectorAll("select>option");if(this.getJSONfromOption(l,n,e),i.length){for(var a=0;a<i.length;a++){var r=i[a],o={};o[e.text]=r.label,o.isHeader=!0;var h=r.querySelectorAll("option");s?this.getJSONfromOption(l,h,e,r.label):(l.push(o),this.getJSONfromOption(l,h,e))}t.querySelectorAll("select>option")}this.updateFields(e.text,e.value,s?e.groupBy:this.fields.groupBy,this.fields.htmlAttributes,this.fields.iconCss,this.fields.disabled),this.resetList(l,e)},n.prototype.updateFields=function(e,i,s,l,n,a){var r={fields:{text:e,value:i,groupBy:t.isNullOrUndefined(s)?this.fields&&this.fields.groupBy:s,htmlAttributes:t.isNullOrUndefined(l)?this.fields&&this.fields.htmlAttributes:l,iconCss:t.isNullOrUndefined(n)?this.fields&&this.fields.iconCss:n,disabled:t.isNullOrUndefined(a)?this.fields&&this.fields.disabled:a}};this.setProperties(r,!0)},n.prototype.getJSONfromOption=function(e,i,s,l){void 0===l&&(l=null);for(var n=0,a=i;n<a.length;n++){var r=a[n],o={};o[s.text]=r.text,o[s.value]=t.isNullOrUndefined(r.getAttribute(s.value))?r.value:r.getAttribute(s.value),t.isNullOrUndefined(l)||(o[s.groupBy]=l),e.push(o)}},n.prototype.preRender=function(){this.scrollTimer=-1,this.enableRtlElements=[],this.isRequested=!1,this.isDataFetched=!1,this.itemTemplateId=this.element.id+"ItemTemplate",this.displayTemplateId=this.element.id+"DisplayTemplate",this.spinnerTemplateId=this.element.id+"SpinnerTemplate",this.valueTemplateId=this.element.id+"ValueTemplate",this.groupTemplateId=this.element.id+"GroupTemplate",this.headerTemplateId=this.element.id+"HeaderTemplate",this.footerTemplateId=this.element.id+"FooterTemplate",this.noRecordsTemplateId=this.element.id+"NoRecordsTemplate"},n.prototype.setListData=function(e,t,s,l){var n=this;t=t||this.fields;var a;this.isActive=!0;var r={cancel:!1,data:e,query:s};this.isPreventChange=!(!this.isAngular||!this.preventChange)||this.isPreventChange,this.isRequesting||this.trigger("actionBegin",r,function(s){if(!s.cancel)if(n.isRequesting=!0,n.showSpinner(),e instanceof i.DataManager){n.isRequested=!0;var r=!1;if(n.isDataFetched)return void n.emptyDataRequest(t);var o=n.getQuery(s.query);s.data.executeQuery(o).then(function(e){n.isPreventChange=!(!n.isAngular||!n.preventChange)||n.isPreventChange;var s=!0;if(!n.virtualSelectAll){for(var l=o.clone(),h=0;h<l.queries.length;h++)"onWhere"===l.queries[h].fn&&(r=!0);if(n.isVirtualizationEnabled&&0!==e.count&&e.count<2*n.itemCount){if(l)for(h=0;h<l.queries.length;h++){if("multiselect"===n.getModuleName()&&n.isCheckBoxSelection&&l.queries[h].e&&("notequal"===l.queries[h].e.operator||"equal"===l.queries[h].e.operator||"or"===l.queries[h].e.condition||"and"===l.queries[h].e.condition)&&!n.isCustomFiltering){s=!1;break}"onTake"===l.queries[h].fn&&(l.queries[h].e.nos=e.count),"multiselect"!==n.getModuleName()||"or"!==l.queries[h].e.condition&&"equal"!==l.queries[h].e.operator||n.isCustomFiltering||(s=!1)}}else if(n.isVirtualTrackHeight=!1,l)for(h=0;h<l.queries.length;h++)"multiselect"===n.getModuleName()&&(l.queries[h].e&&"or"===l.queries[h].e.condition||l.queries[h].e&&"equal"===l.queries[h].e.operator)&&(s=!1)}s&&(n.dataCount=n.totalItemCount=e.count),n.trigger("actionComplete",e,function(e){if(!e.cancel){n.isRequesting=!1,n.isCustomFiltering=!1;var s=e.result;if(n.isIncrementalRequest)return void(a=n.renderItems(s,t));if((!n.isVirtualizationEnabled&&0===s.length||n.isVirtualizationEnabled&&0===s.length&&!r)&&(n.isDataFetched=!0),r||(n.remoteDataCount=e.count),n.dataCount=n.virtualSelectAll?n.dataCount:e.count,n.totalItemCount=n.virtualSelectAll?n.totalItemCount:e.count,a=n.renderItems(s,t),n.appendUncheckList=!1,n.isUpdateGroupTemplate=!1,n.onActionComplete(a,s,e),n.groupTemplate&&(n.isAngular&&"multiselect"===n.getModuleName()&&n.updateGroupHeaderItems(a),n.renderGroupTemplate(a)),n.isUpdateGroupTemplate=!0,n.isRequested=!1,n.bindChildItems(s,a,t,e),n.getInitialData)return n.getInitialData=!1,void(n.preventPopupOpen=!1);var l=!1;n.isVirtualizationEnabled&&n.setCurrentView&&(l=!0,n.notify("setCurrentViewDataAsync",{module:"VirtualScroll"})),null!=n.keyboardEvent&&n.handleVirtualKeyboardActions(n.keyboardEvent,n.pageCount);var o="multiselect"!==n.getModuleName()||"multiselect"===n.getModuleName()&&(!(n.dataSource instanceof i.DataManager)||n.dataSource instanceof i.DataManager&&!l);n.isVirtualizationEnabled&&o&&(n.getFilteringSkeletonCount(),n.updatePopupPosition()),n.virtualSelectAll&&n.virtualSelectAllData&&(n.virtualSelectionAll(n.virtualSelectAllState,n.liCollections,n.CurrentEvent),n.virtualSelectAllState=!1,n.CurrentEvent=null,n.virtualSelectAll=!1)}})}).catch(function(e){n.isRequested=!1,n.isRequesting=!1,n.onActionFailure(e),n.hideSpinner()})}else{n.isRequesting=!1;var h=!0,u=void 0;if(n.isVirtualizationEnabled&&!n.virtualGroupDataSource&&n.fields.groupBy){var p=new i.DataManager(n.dataSource).executeLocal((new i.Query).group(n.fields.groupBy));n.virtualGroupDataSource=p.records}var d=n.isVirtualizationEnabled&&n.virtualGroupDataSource&&!n.isCustomDataUpdated?new i.DataManager(n.virtualGroupDataSource):new i.DataManager(s.data);if(u=n.getQuery(s.query).executeLocal(d),!n.virtualSelectAll){var c=n.getQuery(s.query);if(n.isVirtualizationEnabled&&0!==u.count&&u.count<2*n.itemCount&&!n.appendUncheckList){if(c){for(m=0;m<c.queries.length;m++){if("multiselect"===n.getModuleName()&&n.isCheckBoxSelection&&c.queries[m].e&&("notequal"===c.queries[m].e.operator||"equal"===c.queries[m].e.operator||"or"===c.queries[m].e.condition||"and"===c.queries[m].e.condition)&&!n.isCustomFiltering){h=!1;break}"onTake"===c.queries[m].fn&&(c.queries[m].e.nos=u.count,u=c.executeLocal(d)),"multiselect"!==n.getModuleName()||"or"!==c.queries[m].e.condition&&"equal"!==c.queries[m].e.operator||n.isCustomFiltering||(h=!1)}h&&(u=c.executeLocal(d),n.isVirtualTrackHeight=!(n.dataSource instanceof i.DataManager||n.isCustomDataUpdated))}}else if(n.isVirtualTrackHeight=!1,c)for(var m=0;m<c.queries.length;m++)"multiselect"===n.getModuleName()&&(c.queries[m].e&&"or"===c.queries[m].e.condition||c.queries[m].e&&"equal"===c.queries[m].e.operator)&&(h=!1)}!h||n.dataSource instanceof i.DataManager||n.isCustomDataUpdated||n.virtualSelectAll||(n.dataCount=n.totalItemCount=n.virtualSelectAll?u.length:u.count);var f={cancel:!1,result:u=n.isVirtualizationEnabled?u.result:u};n.isPreventChange=!(!n.isAngular||!n.preventChange)||n.isPreventChange,n.trigger("actionComplete",f,function(e){if(n.isCustomFiltering=!1,n.isIncrementalRequest)return void(a=n.renderItems(e.result,t));if(!e.cancel){if(a=n.renderItems(e.result,t),n.isUpdateGroupTemplate=!1,n.onActionComplete(a,e.result,l),n.groupTemplate&&(n.isAngular&&"multiselect"===n.getModuleName()&&n.updateGroupHeaderItems(a),n.renderGroupTemplate(a)),n.isUpdateGroupTemplate=!0,n.bindChildItems(e.result,a,t),n.getInitialData)return n.getInitialData=!1,void(n.preventPopupOpen=!1);setTimeout(function(){"multiselect"===n.getModuleName()&&null!=n.itemTemplate&&a.childElementCount>0&&(a.children[0].childElementCount>0||n.fields.groupBy&&a.children[1]&&a.children[1].childElementCount>0)&&n.updateDataList()})}})}})},n.prototype.updateGroupHeaderItems=function(e){for(var t=e.querySelectorAll("."+H.group),i=[],s=0;s<t.length;s++)i.push(t[s].cloneNode?t[s].cloneNode(!0):t[s]);this.isFilterAction?this.fiteredGroupHeaderItems=i:this.groupHeaderItems=i},n.prototype.setCustomListData=function(e,t,s,l){var n=this;t=t||this.fields;var a;if(this.isActive=!0,this.isPreventChange=!(!this.isAngular||!this.preventChange)||this.isPreventChange,!this.isRequesting){this.isRequesting=!0,this.showSpinner(),this.isRequesting=!1;var r=!0,o=void 0;if(this.isVirtualizationEnabled&&!this.virtualGroupDataSource&&this.fields.groupBy){var h=new i.DataManager(this.dataSource).executeLocal((new i.Query).group(this.fields.groupBy));this.virtualGroupDataSource=h.records}var u=this.isVirtualizationEnabled&&this.virtualGroupDataSource&&!this.isCustomDataUpdated?new i.DataManager(this.virtualGroupDataSource):new i.DataManager(e);if(o=this.getQuery(s).executeLocal(u),!this.virtualSelectAll){var p=this.getQuery(s);if(this.isVirtualizationEnabled&&0!==o.count&&o.count<2*this.itemCount&&!this.appendUncheckList){if(p){for(d=0;d<p.queries.length;d++)"onTake"===p.queries[d].fn&&(p.queries[d].e.nos=o.count,o=p.executeLocal(u)),"multiselect"!==this.getModuleName()||"or"!==p.queries[d].e.condition&&"equal"!==p.queries[d].e.operator||this.isCustomFiltering||(r=!1);r&&(o=p.executeLocal(u),this.isVirtualTrackHeight=!(this.dataSource instanceof i.DataManager||this.isCustomDataUpdated))}}else if(this.isVirtualTrackHeight=!1,p)for(var d=0;d<p.queries.length;d++)"multiselect"===this.getModuleName()&&(p.queries[d].e&&"or"===p.queries[d].e.condition||p.queries[d].e&&"equal"===p.queries[d].e.operator)&&(r=!1)}if(!r||this.dataSource instanceof i.DataManager||this.isCustomDataUpdated||this.virtualSelectAll||(this.dataCount=this.totalItemCount=this.virtualSelectAll?o.length:o.count),o=this.isVirtualizationEnabled?o.result:o,this.isPreventChange=!(!this.isAngular||!this.preventChange)||this.isPreventChange,this.isCustomFiltering=!1,this.isIncrementalRequest)return void(a=this.renderItems(o,t));a=this.renderItems(o,t),this.onActionComplete(a,o,l),this.groupTemplate&&this.renderGroupTemplate(a),this.bindChildItems(o,a,t),setTimeout(function(){"multiselect"===n.getModuleName()&&null!=n.itemTemplate&&a.childElementCount>0&&(a.children[0].childElementCount>0||n.fields.groupBy&&a.children[1]&&a.children[1].childElementCount>0)&&n.updateDataList()})}},n.prototype.handleVirtualKeyboardActions=function(e,t){},n.prototype.updatePopupState=function(){},n.prototype.updatePopupPosition=function(){},n.prototype.virtualSelectionAll=function(e,t,i){},n.prototype.updateRemoteData=function(){this.setListData(this.dataSource,this.fields,this.query)},n.prototype.bindChildItems=function(e,i,s,l){var n=this;e.length>=100&&"autocomplete"===this.getModuleName()?setTimeout(function(){var a=n.remainingItems(n.sortedData,s);t.append(a,i),n.liCollections=n.list.querySelectorAll("."+H.li),n.updateListValues(),n.raiseDataBound(e,l)},0):this.raiseDataBound(e,l)},n.prototype.isObjectInArray=function(e,t){return t.some(function(t){return Object.keys(e).every(function(i){return Object.prototype.hasOwnProperty.call(t,i)&&t[i]===e[i]})})},n.prototype.updateListValues=function(){},n.prototype.findListElement=function(e,t,i,s){var l=null;if(e)for(var n=[].slice.call(e.querySelectorAll(t)),a=0;a<n.length;a++)if(n[a].getAttribute(i)===s+""){l=n[a];break}return l},n.prototype.raiseDataBound=function(e,t){this.hideSpinner();var i={items:e,e:t};this.trigger("dataBound",i)},n.prototype.remainingItems=function(e,t){var l=new i.DataManager(e).executeLocal((new i.Query).skip(100));if(this.itemTemplate){var n=this.templateListItem(l,t);return[].slice.call(n.childNodes)}var a=this.typeOfData(l).typeof;return"string"===a||"number"===a||"boolean"===a?s.ListBase.createListItemFromArray(this.createElement,l,!0,this.listOption(l,t),this):s.ListBase.createListItemFromJson(this.createElement,l,this.listOption(l,t),1,!0,this)},n.prototype.emptyDataRequest=function(e){var t=[];this.onActionComplete(this.renderItems(t,e),t),this.isRequested=!1,this.isRequesting=!1,this.hideSpinner()},n.prototype.showSpinner=function(){},n.prototype.hideSpinner=function(){},n.prototype.onActionFailure=function(e){this.liCollections=[],this.trigger("actionFailure",e),this.l10nUpdate(!0),t.isNullOrUndefined(this.list)||t.addClass([this.list],H.noData)},n.prototype.onActionComplete=function(e,i,s){var l=this;if(this.listData=i,!this.isVirtualizationEnabled||this.isCustomDataUpdated||this.virtualSelectAll||this.notify("setGeneratedData",{module:"VirtualScroll"}),"listbox"!==this.getModuleName()&&e.setAttribute("tabindex","0"),this.isReact&&this.clearTemplate(["itemTemplate","groupTemplate","actionFailureTemplate","noRecordsTemplate"]),this.isVirtualizationEnabled||(this.fixedHeaderElement=t.isNullOrUndefined(this.fixedHeaderElement)?this.fixedHeaderElement:null),"multiselect"===this.getModuleName()&&this.properties.allowCustomValue&&this.fields.groupBy)for(h=0;h<e.childElementCount;h++)e.children[h].classList.contains("e-list-group-item")&&(t.isNullOrUndefined(e.children[h].innerHTML)||""===e.children[h].innerHTML)&&t.addClass([e.children[h]],"e-hide-group-header"),e.children[0].classList.contains("e-hide-group-header")&&t.setStyleAttribute(e.children[1],{zIndex:11});if("multiselect"===this.getModuleName()&&this.isAngular&&this.ngEle){var n=this.list;if(n){var a=n.offsetHeight+"px";n.style.height=a}}if(!t.isNullOrUndefined(this.list)&&!this.isVirtualizationEnabled){if(this.list.innerHTML="",this.isUpdateGroupTemplate&&this.isAngular&&this.groupTemplate&&"multiselect"===this.getModuleName()){var r=e.querySelectorAll("."+H.group);if(r.length>0&&this.groupHeaderItems.length>0){for(var o={},h=0;h<this.groupHeaderItems.length;h++)o[this.groupHeaderItems[h].id]=this.groupHeaderItems[h].innerHTML;for(h=0;h<r.length;h++)Object.prototype.hasOwnProperty.call(o,r[h].id)&&(r[h].innerHTML=o[r[h].id])}this.renderGroupTemplate(e)}this.list.appendChild(e),this.liCollections=this.list.querySelectorAll("."+H.li),this.ulElement=this.list.querySelector("ul"),this.postRender(this.list,i,this.bindEvent)}if("multiselect"===this.getModuleName()&&this.isAngular&&this.ngEle){var u=this.list;u&&setTimeout(function(){u.style.height="",l.refreshPopup()},0)}},n.prototype.postRender=function(e,i,s){if(this.fields.disabled)for(var l=e.querySelectorAll("."+H.li),n=("None"!==this.sortOrder?t.isNullOrUndefined(this.fields.groupBy)?this.sortedData:this.sortedData.filter(function(e){return!("isHeader"in e)||!0!==e.isHeader}):this.listData),a=0;a<l.length;a++)if(n[a]&&JSON.parse(JSON.stringify(n[a]))[this.fields.disabled])if(t.isNullOrUndefined(this.fields.groupBy))this.disableListItem(l[a]);else{var r=n[a],o=t.getValue(this.fields.value?this.fields.value:"value",r),h=e.querySelector('li[data-value="'+o+'"]');t.isNullOrUndefined(h)||this.disableListItem(h)}var u=this.fields.disabled?e.querySelector("."+H.li+":not(.e-disabled"):e.querySelector("."+H.li),p=e.querySelector("."+H.selected);if(u&&!p){if(this.isVirtualizationEnabled&&0!==this.viewPortInfo.startIndex){var d=this.ulElement.querySelectorAll("li."+H.li+":not(.e-virtual-list):not(.e-hide-listitem)");u=d&&d.length>0?d[2]:u}u&&u.classList.add(H.focus)}i.length<=0?(this.l10nUpdate(),t.addClass([e],H.noData)):e.classList.remove(H.noData)},n.prototype.getQuery=function(e){return e||(this.query?this.query:new i.Query)},n.prototype.performFiltering=function(e){},n.prototype.debouncedFiltering=function(e,t){var i=this;null!==this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(function(){i.performFiltering(e)},t)},n.prototype.updateVirtualizationProperties=function(e,t,i){this.isVirtualizationEnabled=!0,this.virtualizedItemsCount=e,this.isAllowFiltering=t,this.isCheckBoxSelection=i},n.prototype.renderGroupTemplate=function(e){if(null!==this.fields.groupBy&&this.dataSource||this.element.querySelector("."+H.group)){var i=this.dataSource,l={groupTemplateID:this.groupTemplateId,isStringTemplate:this.isStringTemplate},n=this.isAngular&&"multiselect"===this.getModuleName()&&!t.isNullOrUndefined(e)&&e.classList.contains(H.fixedHead)?[e]:e.querySelectorAll("."+H.group),a=this.templateCompiler(this.groupTemplate);if("function"!=typeof this.groupTemplate&&a){var r=t.select(this.groupTemplate,document).innerHTML.trim(),o=s.ListBase.renderGroupTemplate(r,i,this.fields.properties,n,l,this);if(this.isGroupChecking)for(h=0;h<o.length;h++)this.notify("addItem",{module:"CheckBoxSelection",item:o[h]})}else{o=s.ListBase.renderGroupTemplate(this.groupTemplate,i,this.fields.properties,n,l,this);if(this.isGroupChecking)for(var h=0;h<o.length;h++)this.notify("addItem",{module:"CheckBoxSelection",item:o[h]})}this.renderReactTemplates()}},n.prototype.createListItems=function(e,l){if(e){if(l.groupBy||this.element.querySelector("optgroup")){if(l.groupBy){"None"!==this.sortOrder&&(e=this.getSortedDataSource(e));var n=l.properties||l;e=s.ListBase.groupDataSource(e,n,this.sortOrder)}t.addClass([this.list],H.grouping)}else("listbox"!==this.getModuleName()||"listbox"===this.getModuleName()&&!this.preventDefActionFilter)&&(e=this.getSortedDataSource(e));var a=this.listOption(e,l),r=e.length>100?new i.DataManager(e).executeLocal((new i.Query).take(100)):e;return this.sortedData=e,s.ListBase.createList(this.createElement,"autocomplete"===this.getModuleName()?r:e,a,!0,this)}return null},n.prototype.listOption=function(e,i){var s=!t.isNullOrUndefined(i.iconCss),l=t.isNullOrUndefined(i.properties)?i:i.properties,n=null!==i.text||null!==i.value?{fields:l,showIcon:s,ariaAttributes:{groupItemRole:"presentation"}}:{fields:{value:"text"}};return t.extend({},n,i,!0)},n.prototype.setFloatingHeader=function(e){t.isNullOrUndefined(this.list)||this.list.classList.contains(H.noData)||(t.isNullOrUndefined(this.fixedHeaderElement)&&(this.fixedHeaderElement=this.createElement("div",{className:H.fixedHead}),t.isNullOrUndefined(this.list)||this.list.querySelector("li").classList.contains(H.group)||(this.fixedHeaderElement.style.display="none"),t.isNullOrUndefined(this.fixedHeaderElement)||t.isNullOrUndefined(this.list)||t.prepend([this.fixedHeaderElement],this.list),this.setFixedHeader()),t.isNullOrUndefined(this.fixedHeaderElement)||"0"!==this.fixedHeaderElement.style.zIndex||this.setFixedHeader(),this.scrollStop(e))},n.prototype.scrollStop=function(e,i){for(var s=t.isNullOrUndefined(e)?this.list:e.target,l=getComputedStyle(this.getValidLi(),null).getPropertyValue("height"),n=getComputedStyle(this.getValidLi(),null).getPropertyValue("margin-bottom"),a=parseInt(n,10),r="multiselect"===this.getModuleName()?parseFloat(l):parseInt(l,10),o=Math.round(s.scrollTop/(r+a)),h=this.list.querySelectorAll("li:not(.e-hide-listitem)"),u=this.list.querySelectorAll(".e-virtual-list").length,p=o;p>-1;p--){var d=this.isVirtualizationEnabled?p+u:p;if(this.isVirtualizationEnabled){if(this.fixedHeaderElement&&this.updateGroupHeader(d,h,s))break;i&&(!t.isNullOrUndefined(h[d])&&h[d].classList.contains(H.selected)&&"autocomplete"!==this.getModuleName()||!t.isNullOrUndefined(h[d])&&h[d].classList.contains(H.focus)&&this.getModuleName())}else if(this.updateGroupHeader(d,h,s))break}},n.prototype.getPageCount=function(e){if(this.list){var t=this.list.classList.contains(H.noData)?null:getComputedStyle(this.getItems()[0],null).getPropertyValue("height"),i=Math.round(this.list.getBoundingClientRect().height/parseInt(t,10));return e?i:Math.round(i)}return 0},n.prototype.updateGroupHeader=function(e,i,s){return!t.isNullOrUndefined(i[e])&&i[e].classList.contains(H.group)?(this.updateGroupFixedHeader(i[e],s),!0):(this.fixedHeaderElement.style.display="none",this.fixedHeaderElement.style.top="none",!1)},n.prototype.updateFixedGroupTemplateHader=function(e){var t=e.cloneNode?e.cloneNode(!0):e,i=!1;if(this.groupHeaderItems&&this.groupHeaderItems.length>0)for(s=0;s<this.groupHeaderItems.length;s++)if(t.id===this.groupHeaderItems[s].id){t.innerHTML=this.groupHeaderItems[s].innerHTML,i=!0;break}if(!i&&this.fiteredGroupHeaderItems&&this.fiteredGroupHeaderItems.length>0)for(var s=0;s<this.fiteredGroupHeaderItems.length;s++)if(t.id===this.fiteredGroupHeaderItems[s].id){t.innerHTML=this.fiteredGroupHeaderItems[s].innerHTML;break}this.fixedHeaderElement.innerHTML=t.innerHTML,this.renderGroupTemplate(this.fixedHeaderElement)},n.prototype.updateGroupFixedHeader=function(e,i){this.fixedHeaderElement&&this.list&&this.list.parentElement&&(t.isNullOrUndefined(e.innerHTML)||(this.groupTemplate&&this.isAngular&&"multiselect"===this.getModuleName()?this.updateFixedGroupTemplateHader(e):this.fixedHeaderElement.innerHTML=e.innerHTML),this.fixedHeaderElement.style.position="fixed",this.fixedHeaderElement.style.top=this.list.parentElement.offsetTop+this.list.offsetTop-window.scrollY+"px",this.fixedHeaderElement.style.display="block")},n.prototype.getValidLi=function(){return this.isVirtualizationEnabled&&this.liCollections[0].classList.contains("e-virtual-list")?this.liCollections[this.skeletonCount]:this.liCollections[0]},n.prototype.renderItems=function(e,t,l,n){var a;if(this.itemTemplate&&e){"multiselect"===this.getModuleName()&&this.virtualSelectAll&&(this.virtualSelectAllData=e,e=e.slice(this.virtualItemStartIndex,this.virtualItemEndIndex));var r=e;r&&t.groupBy?("None"!==this.sortOrder&&(r=this.getSortedDataSource(r)),r=s.ListBase.groupDataSource(r,t.properties,this.sortOrder)):("listbox"!==this.getModuleName()||"listbox"===this.getModuleName()&&!this.preventDefActionFilter)&&(r=this.getSortedDataSource(r)),this.sortedData=r;var o=r.length>100?new i.DataManager(r).executeLocal((new i.Query).take(100)):r;if(a=this.templateListItem("autocomplete"===this.getModuleName()?o:r,t),this.isIncrementalRequest)return this.incrementalLiCollections=a.querySelectorAll("."+H.li),this.incrementalUlElement=a,this.incrementalListData=e,a;if(this.isVirtualizationEnabled){var h=this.list.querySelector(".e-list-parent"),u=this.list.querySelector(".e-virtual-ddl-content");if(e.length>=this.virtualizedItemsCount&&h&&u||h&&u&&this.isAllowFiltering||h&&u&&"autocomplete"===this.getModuleName()){"multiselect"===this.getModuleName()&&this.isCheckBoxSelection&&this.appendUncheckList&&this.list&&this.list.querySelector(".e-active")?(u.appendChild(a),l=!0):u.replaceChild(a,h);var p=this.list.querySelectorAll(".e-reorder");this.list.querySelector(".e-virtual-ddl-content")&&p&&p.length>0&&!l&&this.list.querySelector(".e-virtual-ddl-content").removeChild(p[0]),this.updateListElements(e)}else u||(this.list.innerHTML="",this.createVirtualContent(),this.list.querySelector(".e-virtual-ddl-content").appendChild(a),this.updateListElements(e))}}else{if("multiselect"===this.getModuleName()&&this.virtualSelectAll&&!n&&(this.virtualSelectAllData=e,e=e.slice(this.virtualItemStartIndex,this.virtualItemEndIndex)),a=this.createListItems(e,t),this.isIncrementalRequest)return this.incrementalLiCollections=a.querySelectorAll("."+H.li),this.incrementalUlElement=a,this.incrementalListData=e,a;if(this.isVirtualizationEnabled){var h=this.list.querySelector(".e-list-parent:not(.e-reorder)"),u=this.list.querySelector(".e-virtual-ddl-content");(!h&&this.list.querySelector(".e-list-parent.e-reorder")||h&&this.isVirtualReorder&&this.list.querySelector(".e-list-parent.e-reorder"))&&(h=this.list.querySelector(".e-list-parent.e-reorder")),e.length>=this.virtualizedItemsCount&&h&&u||h&&u&&this.isAllowFiltering||h&&u&&("autocomplete"===this.getModuleName()||"multiselect"===this.getModuleName())?(("multiselect"!==this.getModuleName()||"multiselect"===this.getModuleName()&&(!(this.dataSource instanceof i.DataManager)||this.dataSource instanceof i.DataManager&&!this.setCurrentView))&&(this.appendUncheckList?u.appendChild(a):u.replaceChild(a,h)),this.updateListElements(e)):u&&u.firstChild||(this.list.innerHTML="",this.createVirtualContent(),this.list.querySelector(".e-virtual-ddl-content").appendChild(a),this.updateListElements(e))}}return a},n.prototype.createVirtualContent=function(){this.list.querySelector(".e-virtual-ddl-content")||this.list.appendChild(this.createElement("div",{className:"e-virtual-ddl-content"}))},n.prototype.updateListElements=function(e){this.liCollections=this.list.querySelectorAll("."+H.li),this.ulElement=this.list.querySelector("ul"),this.listData=e,this.postRender(this.list,e,this.bindEvent)},n.prototype.templateListItem=function(e,i){var l=this.listOption(e,i);l.templateID=this.itemTemplateId,l.isStringTemplate=this.isStringTemplate;var n,a=this.templateCompiler(this.itemTemplate);if("function"!=typeof this.itemTemplate&&a){var r=t.select(this.itemTemplate,document).innerHTML.trim();return n=s.ListBase.renderContentTemplate(this.createElement,r,e,i.properties,l,this),this.isVirtualizationEnabled&&this.isReact&&this.renderReactTemplates(),n}return n=s.ListBase.renderContentTemplate(this.createElement,this.itemTemplate,e,i.properties,l,this),this.isVirtualizationEnabled&&this.isReact&&this.renderReactTemplates(),n},n.prototype.typeOfData=function(e){for(var i={typeof:null,item:null},s=0;!t.isNullOrUndefined(e)&&s<e.length;s++)if(!t.isNullOrUndefined(e[s])&&!("string"==typeof e[s]||"number"==typeof e[s]||"boolean"==typeof e[s]?t.isNullOrUndefined(e[s]):t.isNullOrUndefined(t.getValue(this.fields.value?this.fields.value:"value",e[s]))))return i={typeof:typeof e[s],item:e[s]};return i},n.prototype.setFixedHeader=function(){t.isNullOrUndefined(this.list)||(this.list.parentElement.style.display="block");var e=0;if(this.list&&this.list.parentElement&&(e=parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-width"),10),isNaN(e)&&(e=parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-top-width"),10)+parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-bottom-width"),10)+parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-left-width"),10)+parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-right-width"),10))),!t.isNullOrUndefined(this.liCollections)){var i=this.getValidLi().offsetWidth-e;this.fixedHeaderElement.style.width=i.toString()+"px"}t.setStyleAttribute(this.fixedHeaderElement,{zIndex:10});var s=this.ulElement.querySelector("."+H.group+":not(.e-hide-listitem)");t.isNullOrUndefined(s)||(this.groupTemplate&&this.isAngular&&"multiselect"===this.getModuleName()?this.updateFixedGroupTemplateHader(s):this.fixedHeaderElement.innerHTML=s.innerHTML)},n.prototype.getSortedDataSource=function(e){if(e&&"None"!==this.sortOrder){var t=this.fields.text?this.fields.text:"text";"string"!==this.typeOfData(e).typeof&&"number"!==this.typeOfData(e).typeof&&"boolean"!==this.typeOfData(e).typeof||(t=""),e=s.ListBase.getDataSource(e,s.ListBase.addSorting(this.sortOrder,t))}return e},n.prototype.getIndexByValue=function(e){var i,s=[];s=this.fields.disabled&&"multiselect"===this.getModuleName()&&this.liCollections?this.liCollections:this.getItems();for(var l=0;l<s.length;l++)if(!t.isNullOrUndefined(e)&&s[l].getAttribute("data-value")===e.toString()){i=l;break}return i},n.prototype.getIndexByValueFilter=function(e,i){var s;if(!i)return null;var l=i.querySelectorAll("li:not(.e-list-group-item)");if(l)for(var n=0;n<l.length;n++)if(!t.isNullOrUndefined(e)&&l[n].getAttribute("data-value")===e.toString()){s=n;break}return s},n.prototype.dispatchEvent=function(e,t){var i=document.createEvent("HTMLEvents");i.initEvent(t,!1,!0),e&&e.dispatchEvent(i)},n.prototype.setFields=function(){this.fields.value&&!this.fields.text?this.updateFields(this.fields.value,this.fields.value):!this.fields.value&&this.fields.text?this.updateFields(this.fields.text,this.fields.text):this.fields.value||this.fields.text||(this.isPrimitiveData=!0,this.updateFields("text","text"))},n.prototype.resetList=function(e,i,s,l){this.list&&(("SELECT"===this.element.tagName&&this.element.options.length>0||"UL"===this.element.tagName&&this.element.childNodes.length>0)&&!(e instanceof Array?e.length>0:!t.isNullOrUndefined(e))&&this.selectData&&this.selectData.length>0&&(e=this.selectData),e="combobox"===this.getModuleName()&&this.selectData&&e instanceof Array&&e.length<this.selectData.length&&this.addedNewItem?this.selectData:e,this.addedNewItem=!1,this.isCustomReset&&"multiselect"===this.getModuleName()?this.setCustomListData(e,i,s,l):this.setListData(e,i,s,l))},n.prototype.updateSelectElementData=function(e){(e||this.isVirtualizationEnabled)&&t.isNullOrUndefined(this.selectData)&&this.listData&&this.listData.length>0&&(this.selectData=this.listData)},n.prototype.updateSelection=function(){},n.prototype.renderList=function(){this.render()},n.prototype.updateDataSource=function(e,t){this.resetList(this.dataSource),this.totalItemCount=this.dataSource instanceof i.DataManager?this.dataSource.dataSource.json.length:0},n.prototype.setUpdateInitial=function(e,i,s){this.isDataFetched=!1,this.isPrimitiveData=!1;for(var l={},n=0;e.length>n;n++)i[e[n]]&&"fields"===e[n]?(this.setFields(),l[e[n]]=i[e[n]]):i[e[n]]&&(l[e[n]]=i[e[n]]);Object.keys(l).length>0&&(-1===Object.keys(l).indexOf("dataSource")&&(l.dataSource=this.dataSource),"listbox"===this.getModuleName()?this.isReact&&(!this.isReact||t.isNullOrUndefined(i.dataSource)&&t.isNullOrUndefined(i.sortOrder))||this.updateDataSource(l,s):(this.isDynamicData=!0,this.updateDataSource(l,s)))},n.prototype.onPropertyChanged=function(e,i){"dropdownbase"===this.getModuleName()&&this.setUpdateInitial(["fields","query","dataSource"],e),this.setUpdateInitial(["sortOrder","itemTemplate"],e);for(var s=0,l=Object.keys(e);s<l.length;s++)switch(l[s]){case"query":case"sortOrder":case"dataSource":case"itemTemplate":break;case"enableRtl":this.setEnableRtl();break;case"groupTemplate":if(this.renderGroupTemplate(this.list),this.ulElement&&this.fixedHeaderElement){var n=this.ulElement.querySelector("."+H.group);this.fixedHeaderElement.innerHTML=n.innerHTML}break;case"locale":this.list&&!t.isNullOrUndefined(this.liCollections)&&0===this.liCollections.length&&this.l10nUpdate();break;case"zIndex":this.setProperties({zIndex:e.zIndex},!0),this.setZIndex()}},n.prototype.render=function(e,i){"listbox"===this.getModuleName()?this.list=this.createElement("div",{className:H.content,attrs:{tabindex:"0"}}):this.list=this.createElement("div",{className:H.content}),this.list.classList.add(H.root),this.setFields();var s={duration:300,selector:"."+H.li};this.rippleFun=t.rippleEffect(this.list,s);var l=this.element.querySelector("select>optgroup");if((this.fields.groupBy||!t.isNullOrUndefined(l))&&!this.isGroupChecking){t.EventHandler.add(this.list,"scroll",this.setFloatingHeader,this);for(var n=this.getScrollableParent(),a=0;a<n.length;a++){var r=n[a];t.EventHandler.add(r,"scroll",this.updateGroupFixedHeader,this)}}if("dropdownbase"===this.getModuleName()){this.element.getAttribute("tabindex")&&this.list.setAttribute("tabindex",this.element.getAttribute("tabindex")),t.removeClass([this.element],H.root),this.element.style.display="none";var o=this.createElement("div");this.element.parentElement.insertBefore(o,this.element),o.appendChild(this.element),o.appendChild(this.list)}this.setEnableRtl(),i||this.initialize(e)},n.prototype.getScrollableParent=function(){for(var e=getComputedStyle(this.element),t=[],i=/(auto|scroll)/,s=this.element.parentElement;s&&"HTML"!==s.tagName;){var l=getComputedStyle(s);"absolute"===e.position&&"static"===l.position||!i.test(l.overflow+l.overflowY+l.overflowX)||t.push(s),s=s.parentElement}return t.push(document),t},n.prototype.removeScrollEvent=function(){this.list&&t.EventHandler.remove(this.list,"scroll",this.setFloatingHeader)},n.prototype.getModuleName=function(){return"dropdownbase"},n.prototype.getItems=function(){return this.ulElement.querySelectorAll("."+H.li)},n.prototype.addItem=function(e,i){if((!this.list||this.list.textContent===this.noRecordsTemplate&&"listbox"!==this.getModuleName())&&this.renderList(),"None"!==this.sortOrder&&t.isNullOrUndefined(i)){var l=[].slice.call(this.listData);l.push(e),l=this.getSortedDataSource(l),i=this.fields.groupBy?(l=s.ListBase.groupDataSource(l,this.fields.properties,this.sortOrder)).indexOf(e):l.indexOf(e)}var n=this.getItems().length,a=0===n,r=this.list.querySelector("."+H.selected);e=e instanceof Array?e:[e];var o;o=t.isNullOrUndefined(i)||i<0||i>n-1?n:i;var h=this.fields;e&&h.groupBy&&(e=s.ListBase.groupDataSource(e,h.properties));for(var u=[],p=0;p<e.length;p++){var d=e[p],c=d.isHeader,m=this.createElement("li",{className:c?H.group:H.li,id:"option-add-"+p}),f=d instanceof Object?t.getValue(h.text,d):d;if(c&&(m.innerText=f),this.itemTemplate&&!c){var v=this.templateCompiler(this.itemTemplate),g=("function"!=typeof this.itemTemplate&&v?t.compile(t.select(this.itemTemplate,document).innerHTML.trim()):t.compile(this.itemTemplate))(d,this,"itemTemplate",this.itemTemplateId,this.isStringTemplate,null,m);g&&t.append(g,m)}else c||m.appendChild(document.createTextNode(f));m.setAttribute("data-value",d instanceof Object?t.getValue(h.value,d):d),m.setAttribute("role","option"),this.notify("addItem",{module:"CheckBoxSelection",item:m}),u.push(m),"listbox"===this.getModuleName()?(this.listData.splice(a?this.listData.length:o,0,d),this.listData.length!==this.sortedData.length&&(this.sortedData=this.listData)):this.listData.push(d),"None"===this.sortOrder&&t.isNullOrUndefined(i)&&0===o&&(o=null),"listbox"===this.getModuleName()?this.updateActionCompleteData(m,d,a?null:o+p):this.updateActionCompleteData(m,d,o),this.trigger("beforeItemRender",{element:m,item:d})}if(0===n&&t.isNullOrUndefined(this.list.querySelector("ul")))t.isNullOrUndefined(this.list)||(this.list.innerHTML="",this.list.classList.remove(H.noData),this.isAddNewItemTemplate=!0,t.isNullOrUndefined(this.ulElement)||this.list.appendChild(this.ulElement)),this.liCollections=u,t.isNullOrUndefined(u)||t.isNullOrUndefined(this.ulElement)||t.append(u,this.ulElement),this.updateAddItemList(this.list,n);else{"listbox"===this.getModuleName()&&0===n&&(this.ulElement.innerHTML="");for(var y=[],p=0;p<e.length;p++){for(var C=this.ulElement.querySelectorAll(".e-list-group-item"),b=0;b<C.length;b++)y[b]=C[b].innerText;if(y.indexOf(u[p].innerText)>-1&&h.groupBy){for(b=0;b<C.length;b++)if(y[b]===u[p].innerText){"None"===this.sortOrder?this.ulElement.insertBefore(u[p+1],C[b+1]):this.ulElement.insertBefore(u[p+1],this.ulElement.childNodes[i]),p+=1;break}}else this.liCollections[o]&&this.liCollections[o].parentNode?this.liCollections[o].parentNode.insertBefore(u[p],this.liCollections[o]):i&&"listbox"===this.getModuleName()?this.ulElement.insertBefore(u[p],this.ulElement.childNodes[i+p]):this.ulElement.appendChild(u[p]);var S=[].slice.call(this.liCollections);S.splice(o,0,u[p]),this.liCollections=S,o+=1,"multiselect"===this.getModuleName()&&this.updateDataList()}}"listbox"===this.getModuleName()&&this.isReact&&this.renderReactTemplates(),(r||0===i)&&this.updateSelection(),this.addedNewItem=!0},n.prototype.isDisabledElement=function(e){return!(!e||!e.classList.contains("e-disabled"))},n.prototype.isDisabledItemByIndex=function(e){return!(!this.fields.disabled||!this.liCollections)&&this.isDisabledElement(this.liCollections[e])},n.prototype.disableListItem=function(e){e.classList.add("e-disabled"),e.setAttribute("aria-disabled","true"),e.setAttribute("aria-selected","false")},n.prototype.validationAttribute=function(e,t){var i=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");t.setAttribute("name",i),e.removeAttribute("name");for(var s=["required","aria-required","form"],l=0;l<s.length;l++)if(e.getAttribute(s[l])){var n=e.getAttribute(s[l]);t.setAttribute(s[l],n),e.removeAttribute(s[l])}},n.prototype.setZIndex=function(){},n.prototype.updateActionCompleteData=function(e,t,i){},n.prototype.updateAddItemList=function(e,t){},n.prototype.updateDataList=function(){},n.prototype.getDataByValue=function(e){if(!t.isNullOrUndefined(this.listData)){var i=this.typeOfData(this.listData).typeof;if("string"===i||"number"===i||"boolean"===i)for(var s=0,l=this.listData;s<l.length;s++){r=l[s];if(!t.isNullOrUndefined(r)&&r===e)return r}else for(var n=0,a=this.listData;n<a.length;n++){var r=a[n];if(!t.isNullOrUndefined(r)&&t.getValue(this.fields.value?this.fields.value:"value",r)===e)return r}}return null},n.prototype.destroy=function(){if(document){if(this.fields&&this.fields.groupBy)for(var i=this.getScrollableParent(),s=0;s<i.length;s++){var l=i[s];t.EventHandler.remove(l,"scroll",this.updateGroupFixedHeader)}document.body.contains(this.list)&&(t.EventHandler.remove(this.list,"scroll",this.setFloatingHeader),t.isNullOrUndefined(this.rippleFun)||this.rippleFun(),t.detach(this.list))}this.liCollections=null,this.ulElement=null,this.list=null,this.enableRtlElements=null,this.groupHeaderItems=null,this.fiteredGroupHeaderItems=null,this.rippleFun=null,e.prototype.destroy.call(this)},V([t.Complex({text:null,value:null,iconCss:null,groupBy:null,disabled:null},P)],n.prototype,"fields",void 0),V([t.Property(null)],n.prototype,"itemTemplate",void 0),V([t.Property(null)],n.prototype,"groupTemplate",void 0),V([t.Property("No records found")],n.prototype,"noRecordsTemplate",void 0),V([t.Property("Request failed")],n.prototype,"actionFailureTemplate",void 0),V([t.Property("None")],n.prototype,"sortOrder",void 0),V([t.Property([])],n.prototype,"dataSource",void 0),V([t.Property(null)],n.prototype,"query",void 0),V([t.Property("StartsWith")],n.prototype,"filterType",void 0),V([t.Property(!0)],n.prototype,"ignoreCase",void 0),V([t.Property(1e3)],n.prototype,"zIndex",void 0),V([t.Property(!1)],n.prototype,"ignoreAccent",void 0),V([t.Property()],n.prototype,"locale",void 0),V([t.Event()],n.prototype,"actionBegin",void 0),V([t.Event()],n.prototype,"actionComplete",void 0),V([t.Event()],n.prototype,"actionFailure",void 0),V([t.Event()],n.prototype,"select",void 0),V([t.Event()],n.prototype,"dataBound",void 0),V([t.Event()],n.prototype,"created",void 0),V([t.Event()],n.prototype,"destroyed",void 0),n=V([t.NotifyPropertyChanges],n)}(t.Component),F=function(){var e=function(t,i){return(e=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])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),W=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(l=e[r])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},q={root:"e-dropdownlist",hover:H.hover,selected:H.selected,rtl:H.rtl,li:H.li,disable:H.disabled,base:H.root,focus:H.focus,content:H.content,input:"e-input-group",inputFocus:"e-input-focus",icon:"e-input-group-icon e-ddl-icon",iconAnimation:"e-icon-anim",value:"e-input-value",device:"e-ddl-device",backIcon:"e-input-group-icon e-back-icon e-icons",filterBarClearIcon:"e-input-group-icon e-clear-icon e-icons",filterInput:"e-input-filter",resizeIcon:"e-resizer-right e-icons",filterParent:"e-filter-parent",mobileFilter:"e-ddl-device-filter",footer:"e-ddl-footer",header:"e-ddl-header",clearIcon:"e-clear-icon",clearIconHide:"e-clear-icon-hide",popupFullScreen:"e-popup-full-page",disableIcon:"e-ddl-disable-icon",hiddenElement:"e-ddl-hidden",virtualList:"e-list-item e-virtual-list"},M={container:null,buttons:[]},j=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.isListSearched=!1,s.preventChange=!1,s.isTouched=!1,s.isFocused=!1,s.autoFill=!1,s.isUpdateHeaderHeight=!1,s.isUpdateFooterHeight=!1,s.isReactTemplateUpdate=!1,s}return F(s,e),s.prototype.preRender=function(){this.valueTempElement=null,this.element.style.opacity="0",this.initializeData(),e.prototype.preRender.call(this),this.activeIndex=this.index,this.queryString=""},s.prototype.initializeData=function(){this.isPopupOpen=!1,this.isDocumentClick=!1,this.isPopupRender=!1,this.isInteracted=!1,this.isFilterFocus=!1,this.beforePopupOpen=!1,this.initial=!0,this.initialRemoteRender=!1,this.isNotSearchList=!1,this.isTyped=!1,this.isSelected=!1,this.preventFocus=!1,this.preventAutoFill=!1,this.isValidKey=!1,this.typedString="",this.isEscapeKey=!1,this.isPreventBlur=!1,this.isTabKey=!1,this.actionCompleteData={isUpdated:!1},this.actionData={isUpdated:!1},this.prevSelectPoints={},this.isSelectCustom=!1,this.isDropDownClick=!1,this.preventAltUp=!1,this.isCustomFilter=!1,this.isSecondClick=!1,this.previousValue=null,this.keyConfigure={tab:"tab",enter:"13",escape:"27",end:"35",home:"36",down:"40",up:"38",pageUp:"33",pageDown:"34",open:"alt+40",close:"shift+tab",hide:"alt+38",space:"32"},this.viewPortInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount}},s.prototype.setZIndex=function(){this.popupObj&&this.popupObj.setProperties({zIndex:this.zIndex})},s.prototype.requiredModules=function(){var e=[];return this.enableVirtualization&&e.push({args:[this],member:"VirtualScroll"}),e},s.prototype.renderList=function(t,s){e.prototype.render.call(this,t,s),this.dataSource instanceof i.DataManager||(this.totalItemCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0),this.enableVirtualization&&this.isFiltering()&&"combobox"===this.getModuleName()&&(this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+H.li),this.ulElement=this.list.querySelector("ul")),this.unWireListEvents(),this.wireListEvents()},s.prototype.floatLabelChange=function(){if("dropdownlist"===this.getModuleName()&&"Auto"===this.floatLabelType){var e=this.inputWrapper.container.querySelector(".e-float-text");e&&""!==this.inputElement.value||this.isInteracted?t.classList(e,["e-label-top"],["e-label-bottom"]):e&&t.classList(e,["e-label-bottom"],["e-label-top"])}},s.prototype.resetHandler=function(e){e.preventDefault(),this.clearAll(e),this.enableVirtualization&&(this.list.scrollTop=0,this.virtualListInfo=null,this.previousStartIndex=0,this.previousEndIndex=0)},s.prototype.resetFocusElement=function(){if(this.removeHover(),this.removeSelection(),this.removeFocus(),this.list.scrollTop=0,"autocomplete"!==this.getModuleName()&&!t.isNullOrUndefined(this.ulElement)){var e=this.fields.disabled?this.ulElement.querySelector("."+q.li+":not(.e-disabled)"):this.ulElement.querySelector("."+q.li);this.enableVirtualization&&(e=this.liCollections[this.skeletonCount]),e&&e.classList.add(q.focus)}},s.prototype.clearAll=function(e,s){this.previousItemData=t.isNullOrUndefined(this.itemData)?null:this.itemData,!t.isNullOrUndefined(s)&&(t.isNullOrUndefined(s)||!t.isNullOrUndefined(s.dataSource)&&(s.dataSource instanceof i.DataManager||0!==s.dataSource.length))||(this.isActive=!0,this.resetSelection(s));var l=this.getItemData();if(!this.allowObjectBinding&&this.previousValue===l.value||this.allowObjectBinding&&this.previousValue&&this.isObjectInArray(this.previousValue,[this.allowCustom?this.value?this.value:l:l.value?this.getDataByValue(l.value):l]))return this.checkAndResetCache(),void(this.enableVirtualization&&this.list&&this.updateInitialData());this.onChangeEvent(e),this.checkAndResetCache(),this.enableVirtualization&&this.updateInitialData()},s.prototype.resetSelection=function(e){this.list&&(t.isNullOrUndefined(e)||!t.isNullOrUndefined(e.dataSource)&&(e.dataSource instanceof i.DataManager||0!==e.dataSource.length)?(this.allowFiltering&&"autocomplete"!==this.getModuleName()&&!t.isNullOrUndefined(this.actionCompleteData.ulElement)&&!t.isNullOrUndefined(this.actionCompleteData.list)&&this.actionCompleteData.list.length>0&&this.onActionComplete(this.actionCompleteData.ulElement.cloneNode(!0),this.actionCompleteData.list),this.resetFocusElement()):(this.selectedLI=null,this.actionCompleteData.isUpdated=!1,this.actionCompleteData.ulElement=null,this.actionCompleteData.list=null,this.resetList(e.dataSource))),t.isNullOrUndefined(this.hiddenElement)||(this.hiddenElement.innerHTML=""),t.isNullOrUndefined(this.inputElement)||(this.inputElement.value=""),this.value=null,this.itemData=null,this.text=null,this.index=null,this.activeIndex=null,this.item=null,this.queryString="",this.valueTempElement&&(t.detach(this.valueTempElement),this.inputElement.style.display="block",this.valueTempElement=null),this.setSelection(null,null),this.isSelectCustom=!1,this.updateIconState(),this.cloneElements()},s.prototype.setHTMLAttributes=function(){if(Object.keys(this.htmlAttributes).length)for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if("class"===s){var l=this.htmlAttributes[""+s].replace(/\s+/g," ").trim();""!==l&&t.addClass([this.inputWrapper.container],l.split(" "))}else if("disabled"===s&&"disabled"===this.htmlAttributes[""+s])this.enabled=!1,this.setEnable();else if("readonly"!==s||t.isNullOrUndefined(this.htmlAttributes[""+s]))if("style"===s)this.inputWrapper.container.setAttribute("style",this.htmlAttributes[""+s]);else if("aria-label"===s)"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.readonly?"dropdownlist"===this.getModuleName()&&this.inputWrapper.container.setAttribute("aria-label",this.htmlAttributes[""+s]):this.inputElement.setAttribute("aria-label",this.htmlAttributes[""+s]);else{var n=["title","id","placeholder","role","autocomplete","autocapitalize","spellcheck","minlength","maxlength"],r=["name","required"];"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||n.push("tabindex"),r.indexOf(s)>-1||0===s.indexOf("data")?this.hiddenElement.setAttribute(s,this.htmlAttributes[""+s]):n.indexOf(s)>-1?"placeholder"===s&&this.element.getAttribute("placeholder")!==this.htmlAttributes[""+s]?a.Input.setPlaceholder(this.htmlAttributes[""+s],this.inputElement):"placeholder"!==s&&this.inputElement.setAttribute(s,this.htmlAttributes[""+s]):this.inputWrapper.container.setAttribute(s,this.htmlAttributes[""+s])}else this.readonly=!0,this.dataBind()}"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.inputWrapper.container.removeAttribute("tabindex")},s.prototype.getAriaAttributes=function(){return{"aria-disabled":"false",role:"combobox","aria-expanded":"false","aria-live":"polite","aria-labelledby":this.hiddenElement.id}},s.prototype.setEnableRtl=function(){t.isNullOrUndefined(this.inputElement)||t.isNullOrUndefined(this.inputElement.parentElement)||a.Input.setEnableRtl(this.enableRtl,[this.inputElement.parentElement]),this.popupObj&&(this.popupObj.enableRtl=this.enableRtl,this.popupObj.dataBind())},s.prototype.setEnable=function(){a.Input.setEnabled(this.enabled,this.inputElement),this.enabled?(t.removeClass([this.inputWrapper.container],q.disable),this.inputElement.setAttribute("aria-disabled","false"),this.targetElement().setAttribute("tabindex",this.tabIndex),this.inputWrapper&&this.inputWrapper.container&&(this.inputWrapper.container.setAttribute("aria-disabled","false"),this.inputWrapper.container.removeAttribute("disabled"))):(this.hidePopup(),t.addClass([this.inputWrapper.container],q.disable),this.inputElement.setAttribute("aria-disabled","true"),this.targetElement().tabIndex=-1,this.inputWrapper&&this.inputWrapper.container&&(this.inputWrapper.container.setAttribute("aria-disabled","true"),this.inputWrapper.container.setAttribute("disabled","")))},s.prototype.getPersistData=function(){return this.addOnPersist(["value"])},s.prototype.getLocaleName=function(){return"drop-down-list"},s.prototype.preventTabIndex=function(e){"dropdownlist"===this.getModuleName()&&(e.tabIndex=-1)},s.prototype.targetElement=function(){return t.isNullOrUndefined(this.inputWrapper)?null:this.inputWrapper.container},s.prototype.getNgDirective=function(){return"EJS-DROPDOWNLIST"},s.prototype.getElementByText=function(e){return this.getElementByValue(this.getValueByText(e))},s.prototype.getElementByValue=function(e){for(var t,i=0,s=this.getItems();i<s.length;i++){var l=s[i];if(this.getFormattedValue(l.getAttribute("data-value"))===e){t=l;break}}return t},s.prototype.initValue=function(){this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=this.itemCount,this.renderList(),this.dataSource instanceof i.DataManager?this.initialRemoteRender=!0:this.updateValues()},s.prototype.isDisableItemValue=function(e){if("object"==typeof e){var t=JSON.parse(JSON.stringify(e))[this.fields.value];return this.isDisabledItemByIndex(this.getIndexByValue(t))}return this.isDisabledItemByIndex(this.getIndexByValue(e))},s.prototype.updateValues=function(){if(this.fields.disabled&&(null!=this.value&&(this.value=this.isDisableItemValue(this.value)?null:this.value),null!=this.text&&(this.text=this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text)))?null:this.text),null!=this.index&&(this.index=this.isDisabledItemByIndex(this.index)?null:this.index,this.activeIndex=this.index)),this.selectedValueInfo=this.viewPortInfo,t.isNullOrUndefined(this.value))if(this.text&&t.isNullOrUndefined(this.value)){var e=this.getElementByText(this.text);if(t.isNullOrUndefined(e))return void this.setProperties({text:null});this.setSelection(e,null)}else this.setSelection(this.liCollections[this.activeIndex],null);else{var i=this.allowObjectBinding&&!t.isNullOrUndefined(this.value)?t.getValue(this.fields.value?this.fields.value:"",this.value):this.value;this.setSelection(this.getElementByValue(i),null)}this.setHiddenValue(),a.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton)},s.prototype.onBlurHandler=function(e){if(this.enabled){var i=e.relatedTarget,s=e.target,l=this.isPreventBlur;if(this.isPreventBlur=!1,l&&!this.isDocumentClick&&this.isPopupOpen&&(!t.isNullOrUndefined(s)||!this.isFilterLayout()&&t.isNullOrUndefined(i)))return void("dropdownlist"===this.getModuleName()&&this.allowFiltering&&this.isPopupOpen?this.filterInput.focus():this.targetElement().focus());if(this.isDocumentClick||!t.isNullOrUndefined(this.popupObj)&&document.body.contains(this.popupObj.element)&&this.popupObj.element.classList.contains(q.mobileFilter))return void(this.beforePopupOpen||(this.isDocumentClick=!1));("dropdownlist"===this.getModuleName()&&!this.isFilterFocus&&i!==this.inputElement&&(document.activeElement!==i||document.activeElement===i&&s.classList.contains(q.inputFocus))||t.isNullOrUndefined(i)&&"dropdownlist"===this.getModuleName()&&this.allowFiltering&&s!==this.inputWrapper.container||"dropdownlist"!==this.getModuleName()&&!this.inputWrapper.container.contains(i)||this.isTabKey)&&(this.isDocumentClick=!!this.isPopupOpen,this.focusOutAction(e),this.isTabKey=!1),!this.isRequested||this.isPopupOpen||this.isPreventBlur||(this.isActive=!1,this.beforePopupOpen=!1),this.isFocused=!1}},s.prototype.focusOutAction=function(e){this.isInteracted=!1,this.focusOut(e),this.onFocusOut(e)},s.prototype.onFocusOut=function(e){this.enabled&&(this.isSelected&&(this.isSelectCustom=!1,this.onChangeEvent(e)),this.floatLabelChange(),this.updateFloatLabelOverflowWidth(),this.dispatchEvent(this.hiddenElement,"change"),"dropdownlist"===this.getModuleName()&&"INPUT"!==this.element.tagName&&this.dispatchEvent(this.inputElement,"blur"),this.inputWrapper.clearButton&&t.addClass([this.inputWrapper.clearButton],q.clearIconHide),this.trigger("blur"))},s.prototype.onFocus=function(e){if(!this.isInteracted){this.isInteracted=!0;var t={isInteracted:!!e,event:e};this.trigger("focus",t)}if(this.updateIconState(),"Never"!==this.floatLabelType&&this.inputWrapper&&this.inputWrapper.container){var i=this.inputWrapper.container.querySelector(".e-float-text");i&&i.removeAttribute("style")}this.isFocused=!0},s.prototype.resizingWireEvent=function(){t.EventHandler.add(document,"mousemove",this.resizePopup,this),t.EventHandler.add(document,"mouseup",this.stopResizing,this),t.EventHandler.add(document,"touchmove",this.resizePopup,this),t.EventHandler.add(document,"touchend",this.stopResizing,this)},s.prototype.resizingUnWireEvent=function(){t.EventHandler.remove(document,"mousemove",this.resizePopup),t.EventHandler.remove(document,"mouseup",this.stopResizing),t.EventHandler.remove(document,"touchmove",this.resizePopup),t.EventHandler.remove(document,"touchend",this.stopResizing)},s.prototype.resetValueHandler=function(e){var i=t.closest(this.inputElement,"form");if(i&&e.target===i){var s=this.element.tagName===this.getNgDirective()?null:this.inputElement.getAttribute("value");this.text=s}},s.prototype.wireEvent=function(){t.EventHandler.add(this.inputWrapper.container,"mousedown",this.dropDownClick,this),t.EventHandler.add(this.inputWrapper.container,"focus",this.focusIn,this),t.EventHandler.add(this.inputWrapper.container,"keypress",this.onSearch,this),t.EventHandler.add(window,"resize",this.windowResize,this),this.bindCommonEvent()},s.prototype.bindCommonEvent=function(){t.EventHandler.add(this.targetElement(),"blur",this.onBlurHandler,this);var e=t.closest(this.inputElement,"form");e&&t.EventHandler.add(e,"reset",this.resetValueHandler,this),t.Browser.isDevice?this.keyboardModule=new t.KeyboardEvents(this.targetElement(),{keyAction:this.mobileKeyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}):this.keyboardModule=new t.KeyboardEvents(this.targetElement(),{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}),this.bindClearEvent()},s.prototype.windowResize=function(){this.isPopupOpen&&this.popupObj.refreshPosition(this.inputWrapper.container)},s.prototype.bindClearEvent=function(){this.showClearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this)},s.prototype.unBindCommonEvent=function(){!t.isNullOrUndefined(this.inputWrapper)&&this.targetElement()&&t.EventHandler.remove(this.targetElement(),"blur",this.onBlurHandler);var e=this.inputElement&&t.closest(this.inputElement,"form");e&&t.EventHandler.remove(e,"reset",this.resetValueHandler),t.Browser.isDevice||this.keyboardModule.destroy(),this.showClearButton&&t.EventHandler.remove(this.inputWrapper.clearButton,"mousedown",this.resetHandler)},s.prototype.updateIconState=function(){this.showClearButton&&(""===this.inputElement.value||this.readonly?t.addClass([this.inputWrapper.clearButton],q.clearIconHide):t.removeClass([this.inputWrapper.clearButton],q.clearIconHide))},s.prototype.wireListEvents=function(){t.isNullOrUndefined(this.list)||(t.EventHandler.add(this.list,"click",this.onMouseClick,this),t.EventHandler.add(this.list,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.list,"mouseout",this.onMouseLeave,this))},s.prototype.onSearch=function(e){32!==e.charCode&&13!==e.charCode&&(void 0===this.list&&this.renderList(),this.searchKeyEvent=e,this.onServerIncrementalSearch(e))},s.prototype.onServerIncrementalSearch=function(e){this.isRequested||t.isNullOrUndefined(this.list)||t.isNullOrUndefined(this.list.querySelector("li"))||!this.enabled||this.readonly||this.incrementalSearch(e)},s.prototype.startResizing=function(e){this.isResizing=!0,this.trigger("resizeStart",e);var t=e instanceof MouseEvent?e.clientX:e.touches[0].clientX,i=e instanceof MouseEvent?e.clientY:e.touches[0].clientY;this.list&&this.list.parentElement&&(this.originalWidth=this.list.parentElement.offsetWidth,this.originalHeight=this.list.parentElement.offsetHeight,this.originalMouseX=t,this.originalMouseY=i),this.resizingWireEvent(),e&&e.preventDefault()},s.prototype.resizePopup=function(e){if(this.isResizing){this.trigger("resizing",e);var t=e instanceof MouseEvent?e.clientX:e.touches[0].clientX,i=e instanceof MouseEvent?e.clientY:e.touches[0].clientY,s=t-this.originalMouseX,l=i-this.originalMouseY;if(this.list&&this.list.parentElement){var n=parseInt(window.getComputedStyle(this.list.parentElement).minWidth,10),a=parseInt(window.getComputedStyle(this.list.parentElement).minHeight,10);n=n||100,a=a||120,this.resizeWidth=Math.max(this.originalWidth+s,n),this.resizeHeight=Math.max(this.originalHeight+l,a),this.list.parentElement.style.width=this.resizeWidth+"px",this.list.parentElement.style.height=this.resizeHeight+"px",this.list.parentElement.style.maxHeight=this.resizeHeight+"px",this.list.style.maxHeight=this.resizeHeight+"px",this.fixedHeaderElement&&this.ulElement&&(this.fixedHeaderElement.style.width=this.ulElement.offsetWidth+"px")}e&&e.preventDefault()}},s.prototype.stopResizing=function(e){this.isResizing&&(this.isResizing=!1,this.trigger("resizeStop",e),this.resizingUnWireEvent()),e&&e.preventDefault()},s.prototype.onMouseClick=function(e){var i=e.target;this.keyboardEvent=null;var s=t.closest(i,"."+H.li);if(this.isValidLI(s)&&!this.isDisabledElement(s))if(this.setSelection(s,e),t.Browser.isDevice&&this.isFilterLayout())history.back();else{this.closePopup(100,e)}},s.prototype.onMouseOver=function(e){var i=t.closest(e.target,"."+H.li);this.setHover(i)},s.prototype.setHover=function(e){this.enabled&&this.isValidLI(e)&&!e.classList.contains(H.hover)&&(this.removeHover(),t.addClass([e],H.hover))},s.prototype.onMouseLeave=function(){this.removeHover()},s.prototype.removeHover=function(){if(this.list){var e=this.list.querySelectorAll("."+H.hover);e&&e.length&&t.removeClass(e,H.hover)}},s.prototype.isValidLI=function(e){return e&&e.hasAttribute("role")&&"option"===e.getAttribute("role")},s.prototype.updateIncrementalItemIndex=function(e,t){this.incrementalStartIndex=e,this.incrementalEndIndex=t},s.prototype.incrementalSearch=function(e){if(this.liCollections.length>0)if(this.enableVirtualization){var i=!1,s=!1,l=this.ulElement.getElementsByClassName("e-active")[0],n=l?l.textContent:null;""===this.incrementalQueryString?(this.incrementalQueryString=String.fromCharCode(e.charCode),this.incrementalPreQueryString=this.incrementalQueryString):String.fromCharCode(e.charCode).toLocaleLowerCase()===this.incrementalPreQueryString.toLocaleLowerCase()?s=!0:this.incrementalQueryString=String.fromCharCode(e.charCode),(this.viewPortInfo.endIndex>=this.incrementalEndIndex&&this.incrementalEndIndex<=this.totalItemCount||0===this.incrementalEndIndex)&&(i=!0,this.incrementalStartIndex=this.incrementalEndIndex,0===this.incrementalEndIndex?this.incrementalEndIndex=100>this.totalItemCount?this.totalItemCount:100:this.incrementalEndIndex=this.incrementalEndIndex+100>this.totalItemCount?this.totalItemCount:this.incrementalEndIndex+100,this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),i=!0),(0!==this.viewPortInfo.startIndex||i)&&this.updateIncrementalView(0,this.itemCount);for(d=h(e.charCode,this.incrementalLiCollections,this.activeIndex,!0,this.element.id,s,n,!0);t.isNullOrUndefined(d)&&this.incrementalEndIndex<this.totalItemCount&&(this.updateIncrementalItemIndex(this.incrementalEndIndex,this.incrementalEndIndex+100>this.totalItemCount?this.totalItemCount:this.incrementalEndIndex+100),this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),i=!0,(0!==this.viewPortInfo.startIndex||i)&&this.updateIncrementalView(0,this.itemCount),d=h(e.charCode,this.incrementalLiCollections,0,!0,this.element.id,s,n,!0,!0),t.isNullOrUndefined(d));)if(t.isNullOrUndefined(d)&&this.incrementalEndIndex>=this.totalItemCount){this.updateIncrementalItemIndex(0,100>this.totalItemCount?this.totalItemCount:100);break}t.isNullOrUndefined(d)&&this.incrementalEndIndex>=this.totalItemCount&&(this.updateIncrementalItemIndex(0,100>this.totalItemCount?this.totalItemCount:100),this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),i=!0,(0!==this.viewPortInfo.startIndex||i)&&this.updateIncrementalView(0,this.itemCount),d=h(e.charCode,this.incrementalLiCollections,0,!0,this.element.id,s,n,!0,!0));var a=d&&this.getIndexByValue(d.getAttribute("data-value"));if(a)a-=this.skeletonCount;else for(var r=0;r<this.incrementalLiCollections.length;r++)if(!t.isNullOrUndefined(d)&&!t.isNullOrUndefined(d.getAttribute("data-value"))&&this.incrementalLiCollections[r].getAttribute("data-value")===d.getAttribute("data-value").toString()){a=r,a=this.incrementalStartIndex+a;break}if(a&&!(this.viewPortInfo.startIndex>=a&&a>=this.viewPortInfo.endIndex)){var o=a-(this.itemCount/2-2)>0?a-(this.itemCount/2-2):0,u=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount;this.updateIncrementalView(o,u)}if(t.isNullOrUndefined(d))this.updateIncrementalView(0,this.itemCount),this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.list.scrollTop=0;else{if(this.getIndexByValue(d.getAttribute("data-value"))-this.skeletonCount>this.itemCount/2){var o=this.viewPortInfo.startIndex+(this.itemCount/2-2)<this.totalItemCount?this.viewPortInfo.startIndex+(this.itemCount/2-2):this.totalItemCount,u=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount;this.updateIncrementalView(o,u)}if(d=this.getElementByValue(d.getAttribute("data-value")),this.setSelection(d,e),this.setScrollPosition(),this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.enableVirtualization&&!this.fields.groupBy){var p=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*this.selectedLI.offsetHeight:this.selectedLI.offsetTop;this.list.scrollTop=p-this.list.querySelectorAll(".e-virtual-list").length*this.selectedLI.offsetHeight}this.incrementalPreQueryString=this.incrementalQueryString}}else{var d=void 0;if(this.fields.disabled){var c=this.list.querySelectorAll("."+H.li+":not(.e-disabled)");d=h(e.charCode,c,this.activeIndex,!0,this.element.id)}else d=h(e.charCode,this.liCollections,this.activeIndex,!0,this.element.id);t.isNullOrUndefined(d)||(this.setSelection(d,e),this.setScrollPosition())}},s.prototype.hideSpinner=function(){t.isNullOrUndefined(this.spinnerElement)||(n.hideSpinner(this.spinnerElement),t.removeClass([this.spinnerElement],q.disableIcon),this.spinnerElement.innerHTML="",this.spinnerElement=null)},s.prototype.showSpinner=function(){t.isNullOrUndefined(this.spinnerElement)&&(this.spinnerElement=t.Browser.isDevice&&!t.isNullOrUndefined(this.filterInputObj)&&this.filterInputObj.buttons[1]||!t.isNullOrUndefined(this.filterInputObj)&&this.filterInputObj.buttons[0]||this.inputWrapper.buttons[0],t.addClass([this.spinnerElement],q.disableIcon),n.createSpinner({target:this.spinnerElement,width:t.Browser.isDevice?"16px":"14px"},this.createElement),n.showSpinner(this.spinnerElement))},s.prototype.keyActionHandler=function(e){if(this.enabled){this.keyboardEvent=e,this.isPreventKeyAction&&this.enableVirtualization&&e.preventDefault();var i="pageUp"===e.action||"pageDown"===e.action,s="dropdownlist"!==this.getModuleName()&&("home"===e.action||"end"===e.action);this.isEscapeKey="escape"===e.action,this.isTabKey=!this.isPopupOpen&&"tab"===e.action;var l="down"===e.action||"up"===e.action||"pageUp"===e.action||"pageDown"===e.action||"home"===e.action||"end"===e.action;if((!(this.isEditTextBox()||i||s)||this.isPopupOpen)&&!this.readonly){var n="tab"===e.action||"close"===e.action;if(!t.isNullOrUndefined(this.list)||this.isRequested||n||"escape"===e.action||(this.searchKeyEvent=e,this.enableVirtualization&&(!this.enableVirtualization||"autocomplete"===this.getModuleName()||"mousedown"===e.type||40!==e.keyCode&&38!==e.keyCode)||(this.renderList(e),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+H.li),this.ulElement=this.list.querySelector("ul"))),t.isNullOrUndefined(this.list)||!t.isNullOrUndefined(this.liCollections)&&l&&0===this.liCollections.length||this.isRequested)return;switch((n&&"autocomplete"!==this.getModuleName()&&this.isPopupOpen||"escape"===e.action)&&e.preventDefault(),this.isSelected="escape"!==e.action&&this.isSelected,this.isTyped=!l&&"escape"!==e.action&&this.isTyped,e.action){case"down":case"up":this.updateUpDownAction(e);break;case"pageUp":this.pageUpSelection(this.activeIndex-this.getPageCount(),e),e.preventDefault();break;case"pageDown":this.pageDownSelection(this.activeIndex+this.getPageCount(),e),e.preventDefault();break;case"home":case"end":this.isMouseScrollAction=!0,this.updateHomeEndAction(e);break;case"space":"dropdownlist"===this.getModuleName()&&(this.beforePopupOpen||(this.showPopup(),e.preventDefault()));break;case"open":this.showPopup(e);break;case"hide":this.preventAltUp=this.isPopupOpen,this.hidePopup(e),this.focusDropDown(e);break;case"enter":this.selectCurrentItem(e);break;case"tab":this.selectCurrentValueOnTab(e);break;case"escape":case"close":this.isPopupOpen&&(this.hidePopup(e),this.focusDropDown(e))}}}},s.prototype.updateUpDownAction=function(e,i){if(!this.fields.disabled||!this.list||0!==this.list.querySelectorAll(".e-list-item:not(.e-disabled)").length){if(this.allowFiltering&&!this.enableVirtualization&&"autocomplete"!==this.getModuleName()){o=this.getItemData().value;t.isNullOrUndefined(o)&&(o="null");d=this.getIndexByValue(o);t.isNullOrUndefined(d)||(this.activeIndex=d)}var s=this.list.querySelector("."+q.focus);if(this.isSelectFocusItem(s)&&!i){if(this.setSelection(s,e),this.enableVirtualization){p=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*this.selectedLI.offsetHeight:this.selectedLI.offsetTop;this.fields.groupBy&&(p=this.virtualListInfo&&0===this.virtualListInfo.startIndex?this.selectedLI.offsetHeight-p:p-this.selectedLI.offsetHeight),this.list.scrollTop=p-this.list.querySelectorAll(".e-virtual-list").length*this.selectedLI.offsetHeight}}else if(!t.isNullOrUndefined(this.liCollections)){var l=this.activeIndex,n="down"===e.action?this.activeIndex+1:this.activeIndex-1;n=i?l:n;var a=0;"autocomplete"===this.getModuleName()&&(a="down"===e.action&&t.isNullOrUndefined(this.activeIndex)?0:this.liCollections.length-1,n=n<0?this.liCollections.length-1:n===this.liCollections.length?0:n);var r=void 0;if("autocomplete"!==this.getModuleName()||"autocomplete"===this.getModuleName()&&this.isPopupOpen)if(this.enableVirtualization)if(i)if("autocomplete"===this.getModuleName()){o=this.getFormattedValue(this.selectedLI.getAttribute("data-value"));r=this.getElementByValue(o)}else r=this.getElementByValue(this.getItemData().value);else r=t.isNullOrUndefined(this.activeIndex)?this.liCollections[this.skeletonCount]:this.liCollections[n],r=t.isNullOrUndefined(r)||r.classList.contains("e-virtual-list")?null:r;else r=t.isNullOrUndefined(this.activeIndex)?this.liCollections[a]:this.liCollections[n];if(t.isNullOrUndefined(r)){if(this.enableVirtualization&&!this.isPopupOpen&&"autocomplete"!==this.getModuleName()&&(this.viewPortInfo.endIndex!==this.totalItemCount&&"down"===e.action||0!==this.viewPortInfo.startIndex&&"up"===e.action)){if("down"===e.action){this.viewPortInfo.startIndex=this.viewPortInfo.startIndex+this.itemCount<this.totalItemCount-this.itemCount?this.viewPortInfo.startIndex+this.itemCount:this.totalItemCount-this.itemCount,this.viewPortInfo.endIndex=this.viewPortInfo.startIndex+this.itemCount,this.updateVirtualItemIndex(),this.isCustomFilter="combobox"===this.getModuleName()||this.isCustomFilter,this.resetList(this.dataSource,this.fields,this.query),this.isCustomFilter="combobox"!==this.getModuleName()&&this.isCustomFilter;o="null"!==this.liCollections[0].getAttribute("data-value")?this.getFormattedValue(this.liCollections[0].getAttribute("data-value")):null;(h=this.getDataByValue(o))&&(this.itemData=h)}else if("up"===e.action){this.viewPortInfo.startIndex=this.viewPortInfo.startIndex-this.itemCount>0?this.viewPortInfo.startIndex-this.itemCount:0,this.viewPortInfo.endIndex=this.viewPortInfo.startIndex+this.itemCount,this.updateVirtualItemIndex(),this.isCustomFilter="combobox"===this.getModuleName()||this.isCustomFilter,this.resetList(this.dataSource,this.fields,this.query),this.isCustomFilter="combobox"!==this.getModuleName()&&this.isCustomFilter;var o="null"!==this.liCollections[this.liCollections.length-1].getAttribute("data-value")?this.getFormattedValue(this.liCollections[this.liCollections.length-1].getAttribute("data-value")):null,h=this.getDataByValue(o);h&&(this.itemData=h)}this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+H.li),this.ulElement=this.list.querySelector("ul"),this.handleVirtualKeyboardActions(e,this.pageCount)}}else{var u=this.liCollections[this.skeletonCount]&&this.liCollections[this.skeletonCount].classList.contains("e-item-focus");if(this.setSelection(r,e),u&&this.enableVirtualization&&"autocomplete"===this.getModuleName()&&!i){var p=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*this.selectedLI.offsetHeight:this.selectedLI.offsetTop;p=this.virtualListInfo&&0===this.virtualListInfo.startIndex&&this.fields.groupBy?this.selectedLI.offsetHeight-p:p-this.selectedLI.offsetHeight,this.list.scrollTop=p-this.list.querySelectorAll(".e-virtual-list").length*this.selectedLI.offsetHeight}}}if(this.allowFiltering&&!this.enableVirtualization&&"autocomplete"!==this.getModuleName()){var o=this.getItemData().value,d=this.getIndexByValueFilter(o,this.actionCompleteData.ulElement);t.isNullOrUndefined(d)||(this.activeIndex=d)}this.allowFiltering&&"dropdownlist"===this.getModuleName()&&this.filterInput&&(t.isNullOrUndefined(this.ulElement)||t.isNullOrUndefined(this.ulElement.getElementsByClassName("e-item-focus")[0])?t.isNullOrUndefined(this.ulElement)||t.isNullOrUndefined(this.ulElement.getElementsByClassName("e-active")[0])||t.attributes(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-active")[0].id}):t.attributes(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}));for(var c,n=0;n<this.liCollections.length;n++)if(this.liCollections[n].classList.contains(q.focus)||this.liCollections[n].classList.contains(q.selected)){c=n;break}null!=c&&this.isDisabledElement(this.liCollections[c])&&("autocomplete"!==this.getModuleName()&&(this.liCollections.length-1===c&&"down"===e.action&&(e.action="up"),0===c&&"up"===e.action&&(e.action="down")),this.updateUpDownAction(e)),e.preventDefault()}},s.prototype.updateHomeEndAction=function(e,t){if("dropdownlist"===this.getModuleName()){var i=0;if("home"===e.action?(i=0,this.enableVirtualization&&this.isPopupOpen?i=this.skeletonCount:this.enableVirtualization&&!this.isPopupOpen&&0!==this.viewPortInfo.startIndex&&(this.viewPortInfo.startIndex=0,this.viewPortInfo.endIndex=this.itemCount,this.updateVirtualItemIndex(),this.resetList(this.dataSource,this.fields,this.query))):(this.enableVirtualization&&!this.isPopupOpen&&this.viewPortInfo.endIndex!==this.totalItemCount&&(this.viewPortInfo.startIndex=this.totalItemCount-this.itemCount,this.viewPortInfo.endIndex=this.totalItemCount,this.updateVirtualItemIndex(),this.resetList(this.dataSource,this.fields,this.query)),i=this.getItems().length-1),e.preventDefault(),this.activeIndex===i)return void(t&&this.setSelection(this.liCollections[i],e));if(!this.enableVirtualization&&this.liCollections[i]&&this.liCollections[i].classList.contains("e-disabled"))return;this.setSelection(this.liCollections[i],e)}},s.prototype.selectCurrentValueOnTab=function(e){"autocomplete"===this.getModuleName()?this.selectCurrentItem(e):this.isPopupOpen&&(this.hidePopup(e),this.focusDropDown(e))},s.prototype.mobileKeyActionHandler=function(e){if(this.enabled&&(!this.isEditTextBox()||this.isPopupOpen)&&!this.readonly){if(void 0!==this.list||this.isRequested||(this.searchKeyEvent=e,this.renderList()),t.isNullOrUndefined(this.list)||!t.isNullOrUndefined(this.liCollections)&&0===this.liCollections.length||this.isRequested)return;"enter"===e.action&&this.selectCurrentItem(e)}},s.prototype.handleVirtualKeyboardActions=function(e,i){switch(e.action){case"down":case"up":null==this.itemData&&"autocomplete"!==this.getModuleName()||this.updateUpDownAction(e,!0);break;case"pageUp":this.activeIndex="autocomplete"===this.getModuleName()?this.getIndexByValue(this.selectedLI.getAttribute("data-value"))+this.getPageCount()-1:this.getIndexByValue(this.previousValue),this.pageUpSelection(this.activeIndex-this.getPageCount(),e,!0),e.preventDefault();break;case"pageDown":this.activeIndex="autocomplete"===this.getModuleName()?this.getIndexByValue(this.selectedLI.getAttribute("data-value"))-this.getPageCount():this.getIndexByValue(this.previousValue),this.pageDownSelection(t.isNullOrUndefined(this.activeIndex)?2*this.getPageCount():this.activeIndex+this.getPageCount(),e,!0),e.preventDefault();break;case"home":case"end":this.isMouseScrollAction=!0,this.updateHomeEndAction(e,!0)}this.keyboardEvent=null},s.prototype.selectCurrentItem=function(e){if(this.isPopupOpen){var t=this.list.querySelector("."+q.focus);if(this.isDisabledElement(t))return;t&&(this.setSelection(t,e),this.isTyped=!1),this.isSelected&&(this.isSelectCustom=!1,this.onChangeEvent(e)),this.hidePopup(e),this.focusDropDown(e)}else this.showPopup()},s.prototype.isSelectFocusItem=function(e){return!t.isNullOrUndefined(e)},s.prototype.pageUpSelection=function(e,i,s){var l=e>=0?this.liCollections[e+1]:this.liCollections[0];if(!this.enableVirtualization&&l&&l.classList.contains("e-disabled"))for(var n=e>=0?e+1:0;n<this.liCollections.length&&(!(l=this.liCollections[n])||l.classList.contains("e-disabled"));)if(--n<0)return;this.enableVirtualization&&null==this.activeIndex&&(l=this.liCollections.length>=e&&e>=0?this.liCollections[e+this.skeletonCount+1]:this.liCollections[0]),!t.isNullOrUndefined(l)&&l.classList.contains("e-virtual-list")&&(l=this.liCollections[this.skeletonCount]),this.PageUpDownSelection(l,i),this.allowFiltering&&"dropdownlist"===this.getModuleName()&&(t.isNullOrUndefined(this.ulElement)||t.isNullOrUndefined(this.ulElement.getElementsByClassName("e-item-focus")[0])?t.isNullOrUndefined(this.ulElement)||t.isNullOrUndefined(this.ulElement.getElementsByClassName("e-active")[0])||t.attributes(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-active")[0].id}):t.attributes(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}))},s.prototype.PageUpDownSelection=function(e,i){this.enableVirtualization?t.isNullOrUndefined(e)||("autocomplete"===this.getModuleName()||e.classList.contains("e-active"))&&("autocomplete"!==this.getModuleName()||e.classList.contains("e-item-focus"))||this.setSelection(e,i):this.setSelection(e,i)},s.prototype.pageDownSelection=function(e,i,s){var l=this.getItems(),n=e<=l.length?this.liCollections[e-1]:this.liCollections[l.length-1];if(!this.enableVirtualization&&n&&n.classList.contains("e-disabled"))for(;e>=0&&e<this.liCollections.length&&(!(n=e<=l.length?this.liCollections[e-1]:this.liCollections[l.length-1])||n.classList.contains("e-disabled"));)e++;this.enableVirtualization&&this.skeletonCount>0&&(n=(e="dropdownlist"===this.getModuleName()&&this.allowFiltering?e+1:e)<l.length?this.liCollections[e]:this.liCollections[l.length-1]),this.enableVirtualization&&null==this.activeIndex&&(n=e<=l.length?this.liCollections[e+this.skeletonCount-1]:this.liCollections[l.length-1]),this.PageUpDownSelection(n,i),this.allowFiltering&&"dropdownlist"===this.getModuleName()&&(t.isNullOrUndefined(this.ulElement)||t.isNullOrUndefined(this.ulElement.getElementsByClassName("e-item-focus")[0])?t.isNullOrUndefined(this.ulElement)||t.isNullOrUndefined(this.ulElement.getElementsByClassName("e-active")[0])||t.attributes(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-active")[0].id}):t.attributes(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}))},s.prototype.unWireEvent=function(){t.isNullOrUndefined(this.inputWrapper)||(t.EventHandler.remove(this.inputWrapper.container,"mousedown",this.dropDownClick),t.EventHandler.remove(this.inputWrapper.container,"keypress",this.onSearch),t.EventHandler.remove(this.inputWrapper.container,"focus",this.focusIn),t.EventHandler.remove(window,"resize",this.windowResize)),this.unBindCommonEvent()},s.prototype.unWireListEvents=function(){this.list&&(t.EventHandler.remove(this.list,"click",this.onMouseClick),t.EventHandler.remove(this.list,"mouseover",this.onMouseOver),t.EventHandler.remove(this.list,"mouseout",this.onMouseLeave))},s.prototype.checkSelector=function(e){return'[id="'+e.replace(/(:|\.|\[|\]|,|=|@|\\|\/|#)/g,"\\$1")+'"]'},s.prototype.onDocumentClick=function(e){var i=e.target;if(!t.isNullOrUndefined(this.popupObj)&&t.closest(i,this.checkSelector(this.popupObj.element.id))||t.isNullOrUndefined(this.inputWrapper)||this.inputWrapper.container.contains(e.target))i===this.inputElement||this.allowFiltering&&i===this.filterInput||"combobox"===this.getModuleName()&&!this.allowFiltering&&t.Browser.isDevice&&i===this.inputWrapper.buttons[0]||(this.isPreventBlur=(t.Browser.isIE||"edge"===t.Browser.info.name)&&(document.activeElement===this.targetElement()||document.activeElement===this.filterInput),e.preventDefault());else if(this.inputWrapper.container.classList.contains(q.inputFocus)||this.isPopupOpen){this.isDocumentClick=!0;var s=this.isRequested;"combobox"===this.getModuleName()&&this.isTyped&&(this.isInteracted=!1),this.hidePopup(e),this.isInteracted=!1,s||(this.onFocusOut(e),this.inputWrapper.container.classList.remove(q.inputFocus))}},s.prototype.activeStateChange=function(){this.isDocumentClick&&(this.hidePopup(),this.onFocusOut(),this.inputWrapper.container.classList.remove(q.inputFocus))},s.prototype.focusDropDown=function(e){!this.initial&&this.isFilterLayout()&&this.focusIn(e)},s.prototype.dropDownClick=function(e){if(3!==e.which&&2!==e.button&&(this.keyboardEvent=null,!this.targetElement().classList.contains(q.disable)&&this.inputWrapper.clearButton!==e.target)){var t=e.target;if(t===this.inputElement||this.allowFiltering&&t===this.filterInput||"combobox"===this.getModuleName()||e.preventDefault(),this.readonly)this.focusIn(e);else{this.isPopupOpen||this.popupObj&&document.body.contains(this.popupObj.element)&&this.beforePopupOpen&&this.isPopupRender?(this.hidePopup(e),this.isFilterLayout()&&this.focusDropDown(e)):(this.focusIn(e),this.floatLabelChange(),this.queryString=""===this.inputElement.value.trim()?null:this.inputElement.value,this.isDropDownClick=!0,this.showPopup(e));var s=this,l=this.dataSource instanceof i.DataManager&&this.groupTemplate?700:this.element.tagName===this.getNgDirective()&&this.itemTemplate?500:100;this.isSecondClick||setTimeout(function(){s.cloneElements(),s.isSecondClick=!0,s.isSecondClick=!(s.isReact&&s.isFiltering()&&s.dataSource instanceof i.DataManager&&!s.list.querySelector("ul"))},l)}}},s.prototype.cloneElements=function(){if(this.list){var e=this.list.querySelector("ul");e&&(e=e.cloneNode?e.cloneNode(!0):e,this.actionCompleteData.ulElement=e)}},s.prototype.updateSelectedItem=function(e,i,s,l){var n=this;this.removeSelection(),e.classList.add(H.selected),this.removeHover();var a=null!==e.getAttribute("data-value")?this.getFormattedValue(e.getAttribute("data-value")):null,r=this.getDataByValue(a);if(this.initial||s||t.isNullOrUndefined(i))this.selectEventCallback(e,i,s,r,a),l&&this.setSelectOptions(e,i);else{var o=this.detachChanges(r);this.isSelected=!0;var h={e:i,item:e,itemData:o,isInteracted:!!i,cancel:!1};this.trigger("select",h,function(t){t.cancel?e.classList.remove(H.selected):(n.selectEventCallback(e,i,s,r,a),l&&n.setSelectOptions(e,i))})}},s.prototype.selectEventCallback=function(e,s,l,n,a){this.previousItemData=t.isNullOrUndefined(this.itemData)?null:this.itemData,this.itemData!==n&&(this.previousValue=t.isNullOrUndefined(this.itemData)?null:"object"!=typeof this.itemData||this.allowObjectBinding?this.itemData:this.checkFieldValue(this.itemData,this.fields.value.split("."))),this.item=e,this.itemData=n;var r=this.list.querySelector("."+H.focus);if(r&&t.removeClass([r],H.focus),e.setAttribute("aria-selected","true"),t.isNullOrUndefined(a)&&(a="null"),this.allowFiltering&&!this.enableVirtualization&&"autocomplete"!==this.getModuleName()){var o=this.getIndexByValueFilter(a,this.actionCompleteData.ulElement);t.isNullOrUndefined(o)?this.activeIndex=this.getIndexByValue(a):this.activeIndex=o}else this.enableVirtualization&&null==this.activeIndex&&this.dataSource instanceof i.DataManager&&(this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+H.li),this.ulElement=this.list.querySelector("ul")),this.activeIndex=this.getIndexByValue(a)},s.prototype.activeItem=function(e){this.isValidLI(e)&&!e.classList.contains(H.selected)&&(this.removeSelection(),e.classList.add(H.selected),this.removeHover(),e.setAttribute("aria-selected","true"))},s.prototype.setValue=function(e){var i=this.getItemData();this.isTouched=!t.isNullOrUndefined(e),null===i.value?a.Input.setValue(null,this.inputElement,this.floatLabelType,this.showClearButton):a.Input.setValue(i.text,this.inputElement,this.floatLabelType,this.showClearButton),this.valueTemplate&&null!==this.itemData?this.setValueTemplate():t.isNullOrUndefined(this.valueTempElement)||this.inputElement.previousSibling!==this.valueTempElement||(t.detach(this.valueTempElement),this.inputElement.style.display="block"),t.isNullOrUndefined(i.value)||this.enableVirtualization||!this.allowFiltering||(this.activeIndex=this.getIndexByValueFilter(i.value,this.actionCompleteData.ulElement),t.isNullOrUndefined(this.activeIndex)&&(this.activeIndex=this.getIndexByValue(i.value)));var s=q.clearIcon,l=this.isFiltering()&&this.filterInput&&"combobox"===this.getModuleName()&&this.filterInput.parentElement.querySelector("."+s);return this.isFiltering()&&l&&l.style.removeProperty("visibility"),!this.allowObjectBinding&&this.previousValue===i.value||this.allowObjectBinding&&null!=this.previousValue&&this.isObjectInArray(this.previousValue,[this.allowCustom&&this.isObjectCustomValue?this.value?this.value:i:i.value?this.getDataByValue(i.value):i])?(this.isSelected=!1,!0):(this.isSelected=!this.initial,this.isSelectCustom=!1,"dropdownlist"===this.getModuleName()&&this.updateIconState(),!1)},s.prototype.setSelection=function(e,s){if(this.isValidLI(e)&&(!e.classList.contains(H.selected)||this.isPopupOpen&&this.isSelected&&e.classList.contains(H.selected)))this.updateSelectedItem(e,s,!1,!0);else if(this.setSelectOptions(e,s),this.enableVirtualization&&this.value){var l=this.isPrimitiveData?"":this.fields.value,n=this.allowObjectBinding&&!t.isNullOrUndefined(this.value)?t.getValue(this.fields.value?this.fields.value:"",this.value):this.value;if(this.dataSource instanceof i.DataManager){if((o=new i.DataManager(this.virtualGroupDataSource).executeLocal((new i.Query).where(new i.Predicate(l,"equal",n))))&&o.length>0){this.itemData=o[0];var a=this.getItemData(),r=this.allowObjectBinding?this.getDataByValue(a.value):a.value;(this.value===a.value&&this.text!==a.text||this.value!==a.value&&this.text===a.text)&&this.setProperties({text:a.text?a.text.toString():a.text,value:r})}}else{var o=new i.DataManager(this.dataSource).executeLocal((new i.Query).where(new i.Predicate(l,"equal",n)));if(o&&o.length>0){this.itemData=o[0];var a=this.getItemData(),r=this.allowObjectBinding?this.getDataByValue(a.value):a.value;(this.value===a.value&&this.text!==a.text||this.value!==a.value&&this.text===a.text)&&(this.setProperties({text:a.text?a.text.toString():a.text,value:r}),t.isNullOrUndefined(e)&&(this.previousValue=this.value))}}}},s.prototype.setSelectOptions=function(e,i){this.list&&this.removeHover(),this.previousSelectedLI=t.isNullOrUndefined(this.selectedLI)?null:this.selectedLI,this.selectedLI=e,this.setValue(i)||((!this.isPopupOpen&&!t.isNullOrUndefined(e)||this.isPopupOpen&&!t.isNullOrUndefined(i)&&("keydown"!==i.type||"keydown"===i.type&&"enter"===i.action))&&(this.isSelectCustom=!1,this.onChangeEvent(i)),!this.isPopupOpen||t.isNullOrUndefined(this.selectedLI)||null===this.itemData||i&&"click"===i.type||this.setScrollPosition(i),"mozilla"!==t.Browser.info.name&&this.targetElement()&&(t.attributes(this.targetElement(),{"aria-describedby":""!==this.inputElement.id?this.inputElement.id:this.element.id}),this.targetElement().removeAttribute("aria-live")),!this.isPopupOpen||t.isNullOrUndefined(this.ulElement)||t.isNullOrUndefined(this.ulElement.getElementsByClassName("e-item-focus")[0])?!this.isPopupOpen||t.isNullOrUndefined(this.ulElement)||t.isNullOrUndefined(this.ulElement.getElementsByClassName("e-active")[0])||t.attributes(this.targetElement(),{"aria-activedescendant":this.ulElement.getElementsByClassName("e-active")[0].id}):t.attributes(this.targetElement(),{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}))},s.prototype.dropdownCompiler=function(e){var t=!1;if("function"!=typeof e&&e)try{t=!!document.querySelectorAll(e).length}catch(e){t=!1}return t},s.prototype.setValueTemplate=function(){var e;this.isReact&&(this.clearTemplate(["valueTemplate"]),this.valueTempElement&&(t.detach(this.valueTempElement),this.inputElement.style.display="block",this.valueTempElement=null)),this.valueTempElement||(this.valueTempElement=this.createElement("span",{className:q.value}),this.inputElement.parentElement.insertBefore(this.valueTempElement,this.inputElement),this.inputElement.style.display="none"),this.isReact||(this.valueTempElement.innerHTML="");var i=this.dropdownCompiler(this.valueTemplate),s=(e="function"!=typeof this.valueTemplate&&i?t.compile(document.querySelector(this.valueTemplate).innerHTML.trim()):t.compile(this.valueTemplate))(this.itemData,this,"valueTemplate",this.valueTemplateId,this.isStringTemplate,null,this.valueTempElement);s&&s.length>0&&t.append(s,this.valueTempElement),this.renderReactTemplates()},s.prototype.removeSelection=function(){if(this.list){var e=this.list.querySelectorAll("."+H.selected);e.length&&(t.removeClass(e,H.selected),e[0].removeAttribute("aria-selected"))}},s.prototype.getItemData=function(){var e=this.fields,i=null;i=this.itemData;var s,l;return t.isNullOrUndefined(i)||(s=t.getValue(e.value,i),l=t.getValue(e.text,i)),{value:t.isNullOrUndefined(i)||t.isUndefined(s)?i:s,text:t.isNullOrUndefined(i)||t.isUndefined(s)?i:l}},s.prototype.onChangeEvent=function(e,s){var l=this,n=this.getItemData(),a=this.isSelectCustom?null:this.activeIndex;if(this.enableVirtualization){var r=this.dataSource instanceof i.DataManager?this.virtualGroupDataSource:this.dataSource;if(n.value&&r&&r.length>0){var o=r.findIndex(function(e){return!t.isNullOrUndefined(n.value)&&t.getValue(l.fields.value,e)===n.value});-1!==o&&(a=o)}}var h=this.allowObjectBinding?s?this.value:this.getDataByValue(n.value):n.value;this.setProperties({index:a,text:n.text?n.text.toString():n.text,value:h},!0),this.detachChangeEvent(e)},s.prototype.detachChanges=function(e){return"string"==typeof e||"boolean"==typeof e||"number"==typeof e?Object.defineProperties({},{value:{value:e,enumerable:!0},text:{value:e,enumerable:!0}}):e},s.prototype.detachChangeEvent=function(e){if(this.isSelected=!1,this.previousValue=this.value,this.activeIndex=this.enableVirtualization?this.getIndexByValue(this.value):this.index,this.typedString=t.isNullOrUndefined(this.text)?"":this.text,!this.initial){var i=this.detachChanges(this.itemData),s=void 0;s="string"==typeof this.previousItemData||"boolean"==typeof this.previousItemData||"number"==typeof this.previousItemData?Object.defineProperties({},{value:{value:this.previousItemData,enumerable:!0},text:{value:this.previousItemData,enumerable:!0}}):this.previousItemData,this.setHiddenValue();var l={e:e,item:this.item,itemData:i,previousItem:this.previousSelectedLI,previousItemData:s,isInteracted:!!e,value:this.value,element:this.element,event:e};this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",l)}!t.isNullOrUndefined(this.value)&&""!==this.value||"Always"===this.floatLabelType||t.removeClass([this.inputWrapper.container],"e-valid-input")},s.prototype.setHiddenValue=function(){if(t.isNullOrUndefined(this.value))this.hiddenElement.innerHTML="";else{var e=this.allowObjectBinding&&!t.isNullOrUndefined(this.value)?t.getValue(this.fields.value?this.fields.value:"",this.value):this.value;if(this.hiddenElement.querySelector("option"))(s=this.hiddenElement.querySelector("option")).textContent=this.text,s.setAttribute("value",e.toString());else if(!t.isNullOrUndefined(this.hiddenElement)){var i=document.createElement("option");i.text=this.text,i.setAttribute("selected",""),this.hiddenElement.appendChild(i);var s=this.hiddenElement.querySelector("option");s.setAttribute("value",e.toString())}}},s.prototype.onFilterUp=function(e){if(e.ctrlKey&&86===e.keyCode||!this.isValidKey&&40!==e.keyCode&&38!==e.keyCode)this.isValidKey=!1;else switch(this.isValidKey=!1,this.filterArgs=e,this.firstItem=this.dataSource&&this.dataSource.length>0?this.dataSource[0]:null,e.keyCode){case 38:case 40:"autocomplete"!==this.getModuleName()||this.isPopupOpen||this.preventAltUp||this.isRequested?this.preventAutoFill=!1:(this.preventAutoFill=!0,this.searchLists(e)),this.preventAltUp=!1,"autocomplete"!==this.getModuleName()||t.isNullOrUndefined(this.ulElement)||t.isNullOrUndefined(this.ulElement.getElementsByClassName("e-item-focus")[0])||t.attributes(this.targetElement(),{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}),e.preventDefault();break;case 46:case 8:this.typedString=this.filterInput.value,!this.isPopupOpen&&""!==this.typedString||this.isPopupOpen&&this.queryString.length>0?(this.preventAutoFill=!0,this.searchLists(e)):""===this.typedString&&""===this.queryString&&"autocomplete"!==this.getModuleName()?(this.preventAutoFill=!0,this.searchLists(e)):""===this.typedString&&(this.list&&this.resetFocusElement(),this.activeIndex=null,"dropdownlist"!==this.getModuleName()&&(this.preventAutoFill=!0,this.searchLists(e),"autocomplete"===this.getModuleName()&&this.hidePopup())),e.preventDefault();break;default:this.isFiltering()&&"combobox"===this.getModuleName()&&t.isNullOrUndefined(this.list)&&(this.getInitialData=!0,this.renderList(),this.isSecondClick||this.isDropDownClick||this.executeCloneElements()),this.typedString=this.filterInput.value,this.preventAutoFill=!1,this.getInitialData||this.searchLists(e),(this.enableVirtualization&&"autocomplete"!==this.getModuleName()||"autocomplete"===this.getModuleName()&&!(this.dataSource instanceof i.DataManager)||"autocomplete"===this.getModuleName()&&this.dataSource instanceof i.DataManager&&0!==this.totalItemCount)&&this.getFilteringSkeletonCount()}},s.prototype.onFilterDown=function(e){switch(e.keyCode){case 13:break;case 40:case 38:this.queryString=this.filterInput.value,e.preventDefault();break;case 9:this.isPopupOpen&&"autocomplete"!==this.getModuleName()&&e.preventDefault();break;default:this.prevSelectPoints=this.getSelectionPoints(),this.queryString=this.filterInput.value}},s.prototype.removeFillSelection=function(){if(this.isInteracted){var e=this.getSelectionPoints();this.inputElement.setSelectionRange(e.end,e.end)}},s.prototype.getQuery=function(e){var s;if(!this.isCustomFilter&&this.allowFiltering&&this.filterInput){s=e?e.clone():this.query?this.query.clone():new i.Query;var l=""===this.typedString?"contains":this.filterType,n=this.typeOfData(this.dataSource).typeof;if((this.dataSource instanceof i.DataManager||"string"!==n)&&"number"!==n){if("combobox"!==this.getModuleName()||this.isFiltering()&&"combobox"===this.getModuleName()&&""!==this.typedString){var a=this.fields.text?this.fields.text:"";s.where(a,l,this.typedString,this.ignoreCase,this.ignoreAccent)}}else s.where("",l,this.typedString,this.ignoreCase,this.ignoreAccent)}else s=this.enableVirtualization&&!t.isNullOrUndefined(this.customFilterQuery)?this.customFilterQuery.clone():e?e.clone():this.query?this.query.clone():new i.Query;if(this.enableVirtualization&&0!==this.viewPortInfo.endIndex){var r=this.getTakeValue(),o=!1;if(s)for(p=0;p<s.queries.length;p++)if("onSkip"===s.queries[p].fn){o=!0;break}var h=0,u=0;if(s&&s.queries.length>0)for(p=0;p<s.queries.length;p++)"onSkip"===s.queries[p].fn&&(u=s.queries[p].e.nos),"onTake"===s.queries[p].fn&&(h=r<=s.queries[p].e.nos?s.queries[p].e.nos:r);if(h<=0&&this.query&&this.query.queries.length>0)for(p=0;p<this.query.queries.length;p++)"onTake"===this.query.queries[p].fn&&(h=r<=this.query.queries[p].e.nos?this.query.queries[p].e.nos:r);if(s&&s.queries.length>0)for(var p=0;p<s.queries.length;p++)"onSkip"!==s.queries[p].fn?"onTake"===s.queries[p].fn&&(h=s.queries[p].e.nos<=h?h:s.queries[p].e.nos,s.queries.splice(p,1),--p):(u=s.queries[p].e.nos,s.queries.splice(p,1),o=!1,--p);!this.allowFiltering&&this.isPopupOpen&&o||(u>0?s.skip(u):s.skip(this.virtualItemStartIndex)),this.isIncrementalRequest?s.take(this.incrementalEndIndex):h>0?s.take(h):s.take(r),s.requiresCount()}return s},s.prototype.getSelectionPoints=function(){var e=this.inputElement;return{start:Math.abs(e.selectionStart),end:Math.abs(e.selectionEnd)}},s.prototype.performFiltering=function(e){var t=this;this.checkAndResetCache(),this.isRequesting=!1;var i={preventDefaultAction:!1,text:this.filterInput?this.filterInput.value:"",updateData:function(e,s,l){i.cancel||(t.isCustomFilter=!0,t.customFilterQuery=s?s.clone():s,t.filteringAction(e,s,l))},baseEventArgs:e,cancel:!1};this.trigger("filtering",i,function(e){e.cancel||t.isCustomFilter||e.preventDefaultAction||t.filteringAction(t.dataSource,null,t.fields)})},s.prototype.searchLists=function(e){this.isTyped=!0,this.activeIndex=null,this.isListSearched=!0,this.filterInput.parentElement.querySelector("."+q.clearIcon)&&(this.filterInput.parentElement.querySelector("."+q.clearIcon).style.visibility=""===this.filterInput.value?"hidden":"visible"),this.isDataFetched=!1,this.isFiltering()&&(""!==this.typedString&&this.debounceDelay>0?this.debouncedFiltering(e,this.debounceDelay):this.performFiltering(e))},s.prototype.filter=function(e,t,i){this.isCustomFilter=!0,this.filteringAction(e,t,i)},s.prototype.filteringAction=function(e,i,s){if(!t.isNullOrUndefined(this.filterInput)){this.beforePopupOpen=!(!this.isPopupOpen&&"combobox"===this.getModuleName()&&""===this.filterInput.value||this.getInitialData);var l=this.list.classList.contains(H.noData);if(""!==this.filterInput.value.trim()||this.itemTemplate){if(this.isNotSearchList=!1,i=""===this.filterInput.value.trim()?null:i,this.enableVirtualization&&this.isFiltering()&&this.isTyped&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null),this.resetList(e,s,i),"dropdownlist"===this.getModuleName()&&this.list.classList.contains(H.noData)&&(this.popupContentElement.setAttribute("role","status"),this.popupContentElement.setAttribute("id","no-record"),t.attributes(this.filterInputObj.container,{"aria-activedescendant":"no-record"})),this.enableVirtualization&&l&&!this.list.classList.contains(H.noData)){if(!this.list.querySelector(".e-virtual-ddl-content")){var n=this.createElement("div",{className:"e-virtual-ddl-content"});n.style.cssText=this.getTransformValues(),this.list.appendChild(n).appendChild(this.list.querySelector(".e-list-parent"))}if(!this.list.querySelector(".e-virtual-ddl")){var a=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"});a.style.cssText=this.GetVirtualTrackHeight(),this.list.parentElement.querySelector(".e-dropdownbase").appendChild(a)}}}else this.actionCompleteData.isUpdated=!1,this.isTyped=!1,t.isNullOrUndefined(this.actionCompleteData.ulElement)||t.isNullOrUndefined(this.actionCompleteData.list)||(this.enableVirtualization&&(this.isFiltering()&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null),this.totalItemCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.resetList(e,s,i),l&&!this.list.classList.contains(H.noData)&&(this.list.querySelector(".e-virtual-ddl-content")||((n=this.createElement("div",{className:"e-virtual-ddl-content"})).style.cssText=this.getTransformValues(),this.list.appendChild(n).appendChild(this.list.querySelector(".e-list-parent"))),this.list.querySelector(".e-virtual-ddl")||((a=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"})).style.cssText=this.GetVirtualTrackHeight(),this.list.parentElement.querySelector(".e-dropdownbase").appendChild(a)))),this.onActionComplete(this.actionCompleteData.ulElement,this.actionCompleteData.list)),this.isTyped=!0,t.isNullOrUndefined(this.itemData)||"dropdownlist"!==this.getModuleName()||(this.focusIndexItem(),this.setScrollPosition()),this.isNotSearchList=!0;this.enableVirtualization&&this.getFilteringSkeletonCount(),this.renderReactTemplates(),this.filterInput&&""===this.filterInput.value&&"combobox"===this.getModuleName()&&this.executeCloneElements()}},s.prototype.setSearchBox=function(e){if(this.isFiltering()){var i=e.querySelector("."+q.filterParent)?e.querySelector("."+q.filterParent):this.createElement("span",{className:q.filterParent});this.filterInput=this.createElement("input",{attrs:{type:"text"},className:q.filterInput}),this.element.parentNode.insertBefore(this.filterInput,this.element);var s=!1;return t.Browser.isDevice&&this.isDeviceFullScreen&&(s=!0),this.filterInputObj=a.Input.createInput({element:this.filterInput,buttons:s?[q.backIcon,q.filterBarClearIcon]:[q.filterBarClearIcon],properties:{placeholder:this.filterBarPlaceholder}},this.createElement),t.isNullOrUndefined(this.cssClass)||(-1!==this.cssClass.split(" ").indexOf("e-outline")?t.addClass([this.filterInputObj.container],"e-outline"):-1!==this.cssClass.split(" ").indexOf("e-filled")&&t.addClass([this.filterInputObj.container],"e-filled")),t.append([this.filterInputObj.container],i),t.prepend([i],e),t.attributes(this.filterInput,{"aria-disabled":"false",role:"combobox",autocomplete:"off",autocapitalize:"off",spellcheck:"false"}),this.clearIconElement=this.filterInput.parentElement.querySelector("."+q.clearIcon),!t.Browser.isDevice&&this.clearIconElement&&(t.EventHandler.add(this.clearIconElement,"click",this.clearText,this),this.clearIconElement.style.visibility="hidden"),t.Browser.isDevice?this.searchKeyModule=new t.KeyboardEvents(this.filterInput,{keyAction:this.mobileKeyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}):this.searchKeyModule=new t.KeyboardEvents(this.filterInput,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}),t.EventHandler.add(this.filterInput,"input",this.onInput,this),t.EventHandler.add(this.filterInput,"keyup",this.onFilterUp,this),t.EventHandler.add(this.filterInput,"keydown",this.onFilterDown,this),t.EventHandler.add(this.filterInput,"blur",this.onBlurHandler,this),t.EventHandler.add(this.filterInput,"paste",this.pasteHandler,this),this.filterInputObj}return M},s.prototype.onInput=function(e){!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(e.data)&&e.data.length>1&&this.autoFill&&("combobox"===this.getModuleName()||"autocomplete"===this.getModuleName())&&(this.inputElement.value=e.data),this.isValidKey=!0,"combobox"===this.getModuleName()&&this.updateIconState(),t.Browser.isDevice&&"mozilla"===t.Browser.info.name&&(this.typedString=this.filterInput.value,this.preventAutoFill=!0,this.searchLists(e))},s.prototype.pasteHandler=function(e){var i=this;setTimeout(function(){i.typedString=i.filterInput.value,"combobox"===i.getModuleName()&&i.isFiltering()&&t.isNullOrUndefined(i.list)&&i.renderList(),i.searchLists(e)})},s.prototype.onActionFailure=function(t){e.prototype.onActionFailure.call(this,t),this.beforePopupOpen&&this.renderPopup()},s.prototype.getTakeValue=function(){return this.allowFiltering&&"dropdownlist"===this.getModuleName()&&t.Browser.isDevice?Math.round(window.outerHeight/this.listItemHeight):this.itemCount},s.prototype.onActionComplete=function(s,l,n,a){var r=this;if(this.dataSource instanceof i.DataManager&&!t.isNullOrUndefined(n)&&!this.virtualGroupDataSource&&(this.totalItemCount=n.count),this.isNotSearchList&&!this.enableVirtualization)return void(this.isNotSearchList=!1);if(this.getInitialData)return this.itemTemplate&&"EJS-COMBOBOX"===this.element.tagName&&this.allowFiltering?setTimeout(function(){r.updateActionCompleteDataValues(s,l)},0):this.updateActionCompleteDataValues(s,l),this.enableVirtualization&&this.updateSelectElementData(this.allowFiltering),this.getInitialData=!1,this.isReactTemplateUpdate=!0,this.typedString=this.filterInput.value,void this.searchLists(this.filterArgs);var o=this.itemCount;if(this.isActive||!t.isNullOrUndefined(s)){var h=this.selectedLI?this.selectedLI.cloneNode(!0):null;if(e.prototype.onActionComplete.call(this,s,l,n),this.skeletonCount=0!==this.totalItemCount&&this.totalItemCount<2*this.itemCount&&(!(this.dataSource instanceof i.DataManager)||this.dataSource instanceof i.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,this.updateSelectElementData(this.allowFiltering),this.isRequested&&!t.isNullOrUndefined(this.searchKeyEvent)&&"keydown"===this.searchKeyEvent.type&&(this.isRequested=!1,this.keyActionHandler(this.searchKeyEvent),this.searchKeyEvent=null),this.isRequested&&!t.isNullOrUndefined(this.searchKeyEvent)&&(this.incrementalSearch(this.searchKeyEvent),this.searchKeyEvent=null),this.enableVirtualization||(this.list.scrollTop=0),t.isNullOrUndefined(s)||t.attributes(s,{id:this.element.id+"_options",role:"listbox","aria-hidden":"false","aria-label":"listbox"}),this.initialRemoteRender){if(this.initial=!0,this.activeIndex=this.index,this.initialRemoteRender=!1,this.value&&this.dataSource instanceof i.DataManager){var u=t.isNullOrUndefined(this.fields.value)?this.fields.text:this.fields.value,p=this.allowObjectBinding&&!t.isNullOrUndefined(this.value)?t.getValue(u,this.value):this.value,d=this.fields.value.split("."),c=l.some(function(e){return t.isNullOrUndefined(e[u])&&d.length>1?r.checkFieldValue(e,d)===p:e[u]===p});this.enableVirtualization&&this.virtualGroupDataSource&&(c=this.virtualGroupDataSource.some(function(e){return t.isNullOrUndefined(e[u])&&d.length>1?r.checkFieldValue(e,d)===p:e[u]===p})),c||this.enableVirtualization?this.updateValues():this.dataSource.executeQuery(this.getQuery(this.query).where(new i.Predicate(u,"equal",p))).then(function(e){e.result.length>0?(r.enableVirtualization||r.addItem(e.result,l.length),r.updateValues()):r.updateValues()})}else this.updateValues();this.initial=!1}else"autocomplete"===this.getModuleName()&&this.value&&this.setInputValue();if("autocomplete"!==this.getModuleName()&&this.isFiltering()&&!this.isTyped){if((!this.actionCompleteData.isUpdated||!this.isCustomFilter&&!this.isFilterFocus||t.isNullOrUndefined(this.itemData)&&this.allowFiltering&&(this.dataSource instanceof i.DataManager||!t.isNullOrUndefined(this.dataSource)&&!t.isNullOrUndefined(this.dataSource.length)&&0!==this.dataSource.length))&&(this.itemTemplate&&("EJS-COMBOBOX"===this.element.tagName||this.isReact)&&this.allowFiltering?setTimeout(function(){r.updateActionCompleteDataValues(s,l)},0):this.updateActionCompleteDataValues(s,l)),this.isDynamicData){var m=this.allowObjectBinding&&!t.isNullOrUndefined(this.value)?t.getValue(this.fields.value?this.fields.value:"",this.value):this.value;this.itemData=this.getDataByValue(m),this.selectedLI=this.getElementByValue(m),this.isDynamicData=!1}if((this.allowCustom||this.allowFiltering&&!this.isValueInList(l,this.value)&&this.dataSource instanceof i.DataManager)&&!this.enableVirtualization)this.addNewItem(l,h);else if((this.allowCustom||this.allowFiltering&&this.isValueInList(l,this.value))&&!this.enableVirtualization){f=this.allowObjectBinding&&!t.isNullOrUndefined(this.value)?t.getValue(this.fields.value?this.fields.value:"",this.value):this.value;!t.isNullOrUndefined(this.value)&&h&&h.getAttribute("data-value")===f.toString()&&this.addNewItem(l,h)}(!t.isNullOrUndefined(this.itemData)||t.isNullOrUndefined(this.itemData)&&this.enableVirtualization)&&(this.getSkeletonCount(),this.skeletonCount=0!==this.totalItemCount&&this.totalItemCount<2*this.itemCount&&(!(this.dataSource instanceof i.DataManager)||this.dataSource instanceof i.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,this.UpdateSkeleton(),this.focusIndexItem()),this.enableVirtualization&&this.updateActionCompleteDataValues(s,l)}else if(this.enableVirtualization&&"autocomplete"!==this.getModuleName()&&!this.isFiltering()){var f=this.getItemData().value;this.activeIndex=this.getIndexByValue(f);var v=this.findListElement(this.list,"li","data-value",f);this.selectedLI=v}else this.enableVirtualization&&"autocomplete"===this.getModuleName()&&(this.activeIndex=this.skeletonCount);this.beforePopupOpen&&(this.renderPopup(n),this.enableVirtualization&&(this.list.querySelector(".e-virtual-list")||(this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll(".e-list-item"))),this.enableVirtualization&&o!==this.itemCount&&this.resetList(this.dataSource,this.fields))}},s.prototype.isValueInList=function(e,t){if(Array.isArray(e)){for(var i=0;i<e.length;i++)if(e[i]===t)return!0}else if("object"==typeof e&&null!==e)for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&e[s]===t)return!0;return!1},s.prototype.checkFieldValue=function(e,t){var i=e;return t.forEach(function(e){i=i[e]}),i},s.prototype.updateActionCompleteDataValues=function(e,t){this.actionCompleteData={ulElement:e.cloneNode(!0),list:t,isUpdated:!0},this.actionData.list!==this.actionCompleteData.list&&this.actionCompleteData.ulElement&&this.actionCompleteData.list&&(this.actionData=this.actionCompleteData)},s.prototype.addNewItem=function(e,i){var s=this;if(!t.isNullOrUndefined(this.itemData)&&!t.isNullOrUndefined(i)){var l=this.getItemData().value;e.some(function(e){return("string"==typeof e||"number"==typeof e||"boolean"==typeof e)&&e===l||t.getValue(s.fields.value,e)===l})||this.addItem(this.itemData)}},s.prototype.updateActionCompleteData=function(e,t,i){var s=this;"autocomplete"!==this.getModuleName()&&this.actionCompleteData.ulElement&&(this.itemTemplate&&"EJS-COMBOBOX"===this.element.tagName&&this.allowFiltering?setTimeout(function(){s.actionCompleteDataUpdate(e,t,i)},0):this.actionCompleteDataUpdate(e,t,i))},s.prototype.actionCompleteDataUpdate=function(e,t,i){null!==i?this.actionCompleteData.ulElement.insertBefore(e.cloneNode(!0),this.actionCompleteData.ulElement.childNodes[i]):this.actionCompleteData.ulElement.appendChild(e.cloneNode(!0)),this.isFiltering()&&this.actionCompleteData.list&&this.actionCompleteData.list.indexOf(t)<0&&this.actionCompleteData.list.push(t)},s.prototype.focusIndexItem=function(){var e=this.getItemData().value;this.activeIndex=this.enableVirtualization&&!t.isNullOrUndefined(e)||!this.enableVirtualization?this.getIndexByValue(e):this.activeIndex;var i=this.findListElement(this.list,"li","data-value",e);this.selectedLI=i,this.activeItem(i),this.enableVirtualization&&t.isNullOrUndefined(i)||this.removeFocus()},s.prototype.updateSelection=function(){var e=this.list.querySelector("."+H.selected);if(e)this.setProperties({index:this.getIndexByValue(e.getAttribute("data-value"))}),this.activeIndex=this.index;else{if(this.removeFocus(),this.allowFiltering&&this.actionCompleteData&&this.actionCompleteData.ulElement&&this.dataSource instanceof i.DataManager){var s=this.actionCompleteData.ulElement.querySelectorAll("."+q.focus);s&&s.length&&t.removeClass(s,q.focus)}this.list.querySelector("."+H.li).classList.add(q.focus)}},s.prototype.updateSelectionList=function(){if(!(this.list&&this.list.querySelector(".e-active"))&&!t.isNullOrUndefined(this.value)&&"autocomplete"!==this.getModuleName()){var e=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",this.value):this.value,i=this.findListElement(this.list,"li","data-value",e);i&&i.classList.add("e-active")}},s.prototype.removeFocus=function(){var e=this.list.querySelectorAll("."+q.focus);e&&e.length&&t.removeClass(e,q.focus)},s.prototype.renderPopup=function(e){var s=this;if(this.popupObj&&document.body.contains(this.popupObj.element))return void this.refreshPopup();var l={cancel:!1};this.trigger("beforeOpen",l,function(l){var n;if(l.cancel)s.beforePopupOpen=!1;else{var a=s.createElement("div",{id:s.element.id+"_popup",className:"e-ddl e-popup "+(null!==s.cssClass?s.cssClass:"")});a.setAttribute("aria-label",s.element.id),a.setAttribute("role","dialog");var r=s.setSearchBox(a);if(s.listContainerHeight=s.allowFiltering&&"dropdownlist"===s.getModuleName()&&t.Browser.isDevice&&s.isDeviceFullScreen?t.formatUnit(Math.round(window.outerHeight).toString()+"px"):t.formatUnit(s.popupHeight),s.headerTemplate&&(s.setHeaderTemplate(a),s.isUpdateHeaderHeight=0!==s.header.offsetHeight),t.append([s.list],a),s.footerTemplate&&(s.setFooterTemplate(a),s.isUpdateFooterHeight=0!==s.footer.offsetHeight),document.body.appendChild(a),a.style.top="0px",n=a.clientHeight,s.enableVirtualization&&(s.itemTemplate||s.isAngular)){var o=a.querySelectorAll("li.e-list-item:not(.e-virtual-list)"),h=a.querySelectorAll("li.e-virtual-list"),u=o&&o.length>0?Math.ceil(o[0].getBoundingClientRect().height)+parseInt(window.getComputedStyle(o[0]).marginBottom,10):0;u!==(h&&h.length>0?Math.ceil(h[0].getBoundingClientRect().height)+parseInt(window.getComputedStyle(h[0]).marginBottom,10):0)&&h&&h.length>0&&h.forEach(function(e){e.parentNode.removeChild(e)}),s.listItemHeight=u}if(s.enableVirtualization&&!s.list.classList.contains(H.noData)){if(s.getSkeletonCount(),s.skeletonCount=s.totalItemCount<2*s.itemCount&&(!(s.dataSource instanceof i.DataManager)||s.dataSource instanceof i.DataManager&&s.totalItemCount<=s.itemCount)?0:s.skeletonCount,s.list.querySelector(".e-virtual-ddl-content"))s.list.getElementsByClassName("e-virtual-ddl-content")[0].style=s.getTransformValues();else{var p=s.createElement("div",{className:"e-virtual-ddl-content"});p.style.cssText=s.getTransformValues(),s.list.appendChild(p).appendChild(s.list.querySelector(".e-list-parent"))}if(s.UpdateSkeleton(),s.liCollections=s.list.querySelectorAll("."+H.li),s.virtualItemCount=s.itemCount,s.list.querySelector(".e-virtual-ddl"))s.list.getElementsByClassName("e-virtual-ddl")[0].style=s.GetVirtualTrackHeight();else{var d=s.createElement("div",{id:s.element.id+"_popup",className:"e-virtual-ddl"});d.style.cssText=s.GetVirtualTrackHeight(),a.querySelector(".e-dropdownbase").appendChild(d)}}if(a.style.visibility="hidden","auto"!==s.popupHeight){if(s.searchBoxHeight=0,t.isNullOrUndefined(r.container)||"combobox"===s.getModuleName()||"autocomplete"===s.getModuleName()||(s.searchBoxHeight=r.container.parentElement.getBoundingClientRect().height,s.listContainerHeight=(parseInt(s.listContainerHeight,10)-s.searchBoxHeight).toString()+"px"),s.headerTemplate){s.header=s.header?s.header:a.querySelector(".e-ddl-header");c=Math.round(s.header.getBoundingClientRect().height);s.listContainerHeight=(parseInt(s.listContainerHeight,10)-(c+s.searchBoxHeight)).toString()+"px"}if(s.footerTemplate){s.footer=s.footer?s.footer:a.querySelector(".e-ddl-footer");var c=Math.round(s.footer.getBoundingClientRect().height);s.listContainerHeight=(parseInt(s.listContainerHeight,10)-(c+s.searchBoxHeight)).toString()+"px"}s.list.style.maxHeight=(parseInt(s.listContainerHeight,10)-2).toString()+"px",a.style.maxHeight=t.formatUnit(s.popupHeight)}else a.style.height="auto";var m=0,f=void 0;if(s.isPreventScrollAction=!0,!t.isNullOrUndefined(s.selectedLI)&&!t.isNullOrUndefined(s.activeIndex)&&s.activeIndex>=0?s.setScrollPosition():s.enableVirtualization?s.setScrollPosition():s.list.scrollTop=0,t.Browser.isDevice&&s.isDeviceFullScreen&&!s.allowFiltering&&("dropdownlist"===s.getModuleName()||s.isDropDownClick&&"combobox"===s.getModuleName())){m=s.getOffsetValue(a);var v=s.isEmptyList()?s.list:s.liCollections[0];t.isNullOrUndefined(s.inputElement)||(f=-(parseInt(getComputedStyle(v).textIndent,10)-parseInt(getComputedStyle(s.inputElement).paddingLeft,10)+parseInt(getComputedStyle(s.inputElement.parentElement).borderLeftWidth,10)))}s.createPopup(a,m,f),s.popupContentElement=s.popupObj.element.querySelector(".e-content"),s.getFocusElement(),s.checkCollision(a),t.Browser.isDevice&&(parseInt(s.popupWidth.toString(),10)>window.outerWidth&&("dropdownlist"!==s.getModuleName()||!s.allowFiltering)&&s.popupObj.element.classList.add("e-wide-popup"),s.popupObj.element.classList.add(q.device),("dropdownlist"===s.getModuleName()||"combobox"===s.getModuleName()&&!s.allowFiltering&&s.isDropDownClick)&&(s.popupObj.collision={X:"fit",Y:"fit"}),s.isFilterLayout()&&s.isDeviceFullScreen&&(s.popupObj.element.classList.add(q.mobileFilter),s.popupObj.position={X:0,Y:0},s.popupObj.dataBind(),t.attributes(s.popupObj.element,{style:"left:0px;right:0px;top:0px;bottom:0px;"}),t.addClass([document.body,s.popupObj.element],q.popupFullScreen),s.setSearchBoxPosition(),s.backIconElement=r.container.querySelector(".e-back-icon"),s.clearIconElement=r.container.querySelector("."+q.clearIcon),t.EventHandler.add(s.backIconElement,"click",s.clickOnBackIcon,s),t.EventHandler.add(s.clearIconElement,"click",s.clearText,s))),a.style.visibility="visible",t.addClass([a],"e-popup-close");for(var g=0,y=s.popupObj.getScrollableParent(s.inputWrapper.container);g<y.length;g++){var C=y[g];t.EventHandler.add(C,"scroll",s.scrollHandler,s)}t.isNullOrUndefined(s.list)||(s.unWireListEvents(),s.wireListEvents()),s.selectedElementID=s.selectedLI?s.selectedLI.id:null,s.enableVirtualization&&(s.notify("bindScrollEvent",{module:"VirtualScroll",component:s.getModuleName(),enable:s.enableVirtualization}),setTimeout(function(){(s.value||s.list.querySelector(".e-active"))&&(s.updateSelectionList(),s.viewPortInfo&&s.viewPortInfo.offsets.top?s.list.scrollTop=s.viewPortInfo.offsets.top:s.scrollBottom(!0,!0))},5)),t.attributes(s.targetElement(),{"aria-expanded":"true","aria-owns":s.element.id+"_popup","aria-controls":s.element.id}),"dropdownlist"!==s.getModuleName()&&s.list.classList.contains("e-nodata")&&(t.attributes(s.targetElement(),{"aria-activedescendant":"no-record"}),s.popupContentElement.setAttribute("role","status"),s.popupContentElement.setAttribute("id","no-record")),s.inputElement.setAttribute("aria-expanded","true"),s.inputElement.setAttribute("aria-controls",s.element.id+"_popup");var b=s.isFiltering()?s.filterInput.parentElement:s.inputWrapper.container;t.addClass([b],[q.inputFocus]);var S={name:"FadeIn",duration:100};s.beforePopupOpen=!0;var E={popup:s.popupObj,event:e,cancel:!1,animation:S};if(s.trigger("open",E,function(e){e.cancel?(s.beforePopupOpen=!1,s.destroyPopup()):(t.isNullOrUndefined(s.inputWrapper)||t.addClass([s.inputWrapper.container],[q.iconAnimation]),s.renderReactTemplates(),s.isReact&&s.isFiltering()&&s.dataSource instanceof i.DataManager&&s.list.querySelector("ul")&&!s.isSecondClick&&s.executeCloneElements(),t.isNullOrUndefined(s.popupObj)||(s.popupObj.show(new t.Animation(e.animation),1e3===s.zIndex?s.element:null),s.isPopupRender=!0),s.isReact&&setTimeout(function(){if(s.popupHeight&&s.list&&"auto"!==s.popupHeight&&("dropdownlist"!==s.getModuleName()||!s.allowFiltering)){var e="string"==typeof s.popupHeight?parseInt(s.popupHeight,10):s.popupHeight;if(!s.isUpdateHeaderHeight&&s.headerTemplate&&s.header){t=""===s.list.style.maxHeight?e:parseInt(s.list.style.maxHeight,10);s.list.style.maxHeight=(t-s.header.offsetHeight).toString()+"px",s.isUpdateHeaderHeight=!0}if(!s.isUpdateFooterHeight&&s.footerTemplate&&s.footer){var t=""===s.list.style.maxHeight?e:parseInt(s.list.style.maxHeight,10);s.list.style.maxHeight=(t-s.footer.offsetHeight).toString()+"px",s.isUpdateFooterHeight=!0}}},15))}),s.allowResize&&("dropdownlist"!==s.getModuleName()||!(t.Browser.isDevice&&s.isDeviceFullScreen&&s.allowFiltering))){if(s.resizer=s.createElement("div",{id:s.element.id+"_resize-popup",className:q.resizeIcon}),s.list&&s.list.parentElement){if(s.list.parentElement.classList.add("e-resize"),"auto"!==s.popupHeight.toString().toLowerCase()&&n>=parseInt(s.popupHeight.toString(),10)-2&&(s.list.parentElement.style.height="100%"),s.list.parentElement.style.paddingBottom="dropdownlist"===s.getModuleName()&&s.allowFiltering&&s.searchBoxHeight?(s.searchBoxHeight+16).toString()+"px":16..toString()+"px",s.isReact&&s.footer){var x=s.list.style.maxHeight,I=s.list.parentElement.style.maxHeight,w=s.listContainerHeight;setTimeout(function(){s.footer=s.footer?s.footer:a.querySelector(".e-ddl-footer");var e=Math.round(s.footer.getBoundingClientRect().height);e>0&&(w=(parseInt(w,10)-e).toString()+"px",x=(parseInt(w,10)-2).toString()+"px",s.list.parentElement.style.paddingBottom=(parseInt(I,10)-parseInt(x,10)+16).toString()+"px")},1)}else(s.header||s.footer||s.itemTemplate)&&(s.list.parentElement.style.paddingBottom=(parseInt(s.list.parentElement.style.maxHeight,10)-parseInt(s.list.style.maxHeight,10)+16).toString()+"px");s.list.parentElement.appendChild(s.resizer),s.list.parentElement.style.width=s.resizeWidth+"px",s.list.parentElement.style.height=s.resizeHeight+"px",s.list.parentElement.style.maxHeight=s.resizeHeight+"px",s.list.style.maxHeight=s.resizeHeight+"px"}t.EventHandler.add(s.resizer,"mousedown",s.startResizing,s),t.EventHandler.add(s.resizer,"touchstart",s.startResizing,s)}}})},s.prototype.checkCollision=function(e){(!t.Browser.isDevice||t.Browser.isDevice&&"dropdownlist"!==this.getModuleName()&&!this.isDropDownClick)&&(n.isCollide(e).length>0&&(e.style.marginTop=-parseInt(getComputedStyle(e).marginTop,10)+"px"),this.popupObj.resolveCollision())},s.prototype.getOffsetValue=function(e){var t=getComputedStyle(e),i=parseInt(t.borderTopWidth,10),s=parseInt(t.borderBottomWidth,10);return this.setPopupPosition(i+s)},s.prototype.createPopup=function(e,i,s){var l=this;this.popupObj=new n.Popup(e,{width:this.setWidth(),targetType:"relative",relateTo:this.inputWrapper.container,collision:this.enableRtl?{X:"fit",Y:"flip"}:{X:"flip",Y:"flip"},offsetY:i,enableRtl:this.enableRtl,offsetX:s,position:this.enableRtl?{X:"right",Y:"bottom"}:{X:"left",Y:"bottom"},zIndex:this.zIndex,close:function(){l.isDocumentClick||l.focusDropDown(),l.isReact&&l.clearTemplate(["headerTemplate","footerTemplate"]),l.isNotSearchList=!1,l.isDocumentClick=!1,l.destroyPopup(),l.isFiltering()&&l.actionCompleteData.list&&l.actionCompleteData.list.length>0?(l.isActive=!0,l.isReactTemplateUpdate&&l.isReact&&l.itemTemplate&&!l.enableVirtualization&&(l.actionCompleteData.ulElement=l.renderItems(l.actionCompleteData.list,l.fields),l.isReactTemplateUpdate=!1),l.enableVirtualization?l.onActionComplete(l.ulElement,l.listData,null,!0):l.onActionComplete(l.actionCompleteData.ulElement,l.actionCompleteData.list,null,!0)):l.enableVirtualization&&l.focusIndexItem()},open:function(){t.EventHandler.add(document,"mousedown",l.onDocumentClick,l),l.isPopupOpen=!0;var e=l.actionCompleteData&&l.actionCompleteData.ulElement&&l.actionCompleteData.ulElement.querySelector("li"),i=l.list.querySelector("ul li");t.isNullOrUndefined(l.ulElement)||t.isNullOrUndefined(l.ulElement.getElementsByClassName("e-item-focus")[0])?t.isNullOrUndefined(l.ulElement)||t.isNullOrUndefined(l.ulElement.getElementsByClassName("e-active")[0])||t.attributes(l.targetElement(),{"aria-activedescendant":l.ulElement.getElementsByClassName("e-active")[0].id}):t.attributes(l.targetElement(),{"aria-activedescendant":l.ulElement.getElementsByClassName("e-item-focus")[0].id}),l.isFiltering()&&l.itemTemplate&&l.element.tagName===l.getNgDirective()&&e&&i&&e.textContent!==i.textContent&&"EJS-COMBOBOX"!==l.element.tagName&&l.cloneElements(),l.isFilterLayout()&&(t.removeClass([l.inputWrapper.container],[q.inputFocus]),l.isFilterFocus=!0,l.filterInput.focus(),l.inputWrapper.clearButton&&t.addClass([l.inputWrapper.clearButton],q.clearIconHide)),l.activeStateChange()},targetExitViewport:function(){t.Browser.isDevice||l.hidePopup()}})},s.prototype.isEmptyList=function(){return!t.isNullOrUndefined(this.liCollections)&&0===this.liCollections.length},s.prototype.getFocusElement=function(){},s.prototype.isFilterLayout=function(){return"dropdownlist"===this.getModuleName()&&this.allowFiltering},s.prototype.scrollHandler=function(){t.Browser.isDevice&&("dropdownlist"===this.getModuleName()&&!this.isFilterLayout()||"combobox"===this.getModuleName()&&!this.allowFiltering&&this.isDropDownClick)&&this.element&&!this.isElementInViewport(this.element)&&this.hidePopup()},s.prototype.isElementInViewport=function(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth},s.prototype.setSearchBoxPosition=function(){var e=this.filterInput.parentElement.getBoundingClientRect().height;this.popupObj.element.style.maxHeight="100%",this.popupObj.element.style.width="100%",this.list.style.maxHeight=window.innerHeight-e+"px",this.list.style.height=window.innerHeight-e+"px";var i=this.filterInput.parentElement.querySelector("."+q.clearIcon);t.detach(this.filterInput),i.parentElement.insertBefore(this.filterInput,i)},s.prototype.setPopupPosition=function(e){var i,s=e,l=this.list.querySelector("."+q.focus)||this.selectedLI,n=this.isEmptyList()?this.list:this.liCollections[0],a=this.isEmptyList()?this.list:this.liCollections[this.getItems().length-1],r=n.getBoundingClientRect().height;this.listItemHeight=r+parseInt(window.getComputedStyle(n).marginBottom,10);var o=this.list.offsetHeight/2,h=t.isNullOrUndefined(l)?n.offsetTop:l.offsetTop;if(a.offsetTop-o<h&&!t.isNullOrUndefined(this.liCollections)&&this.liCollections.length>0&&!t.isNullOrUndefined(l)){var u=this.list.offsetHeight/r,p=parseInt(getComputedStyle(this.list).paddingBottom,10);i=(u-(this.liCollections.length-this.activeIndex))*r-s+p,this.list.scrollTop=l.offsetTop}else h>o&&!this.enableVirtualization?(i=o-r/2,this.list.scrollTop=h-o+r/2):i=h;return-(i=i+r+s-(r-this.inputWrapper.container.offsetHeight)/2)},s.prototype.setWidth=function(){var e=t.formatUnit(this.popupWidth);if(e.indexOf("%")>-1&&(e=(this.inputWrapper.container.offsetWidth*parseFloat(e)/100).toString()+"px"),t.Browser.isDevice&&e.indexOf("px")>-1&&!this.allowFiltering&&("dropdownlist"===this.getModuleName()||this.isDropDownClick&&"combobox"===this.getModuleName())){var i=this.isEmptyList()?this.list:this.liCollections[0];e=parseInt(e,10)+2*(parseInt(getComputedStyle(i).textIndent,10)-parseInt(getComputedStyle(this.inputElement).paddingLeft,10)+parseInt(getComputedStyle(this.inputElement.parentElement).borderLeftWidth,10))+"px"}return e},s.prototype.scrollBottom=function(e,i,s){var l=this;if(void 0===i&&(i=!1),void 0===s&&(s=null),t.isNullOrUndefined(this.selectedLI)&&this.enableVirtualization&&(this.selectedLI=this.list.querySelector("."+H.li),!t.isNullOrUndefined(this.selectedLI)&&this.selectedLI.classList.contains("e-virtual-list")&&(this.selectedLI=this.liCollections[this.skeletonCount])),!t.isNullOrUndefined(this.selectedLI)){var n=this.selectedLI&&!isNaN(parseInt(window.getComputedStyle(this.selectedLI).marginBottom,10))?parseInt(window.getComputedStyle(this.selectedLI).marginBottom,10):0;this.isUpwardScrolling=!1;var a=this.list.querySelectorAll(".e-virtual-list").length,r=this.list.querySelector("li:last-of-type")?this.list.querySelector("li:last-of-type").getAttribute("data-value"):null,o=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*(this.selectedLI.offsetHeight+n):this.selectedLI.offsetTop,h=this.list.offsetHeight,u=o-a*(this.selectedLI.offsetHeight+n)+(this.selectedLI.offsetHeight+n)-this.list.scrollTop,p=this.list.scrollTop+u-h,d=!1;p=e?p+2*parseInt(getComputedStyle(this.list).paddingTop,10):p+parseInt(getComputedStyle(this.list).paddingTop,10);var c=o-a*(this.selectedLI.offsetHeight+n)+(this.selectedLI.offsetHeight+n)-this.list.scrollTop;if(c=this.fields.groupBy&&!t.isNullOrUndefined(this.fixedHeaderElement)?c-this.fixedHeaderElement.offsetHeight:c,0!==this.activeIndex||this.enableVirtualization){if(u>h||!(c>0&&this.list.offsetHeight>c)){var m=this.selectedLI?this.selectedLI.getAttribute("data-value"):null,f="pageDown"===s?this.getPageCount()-2:1;!this.enableVirtualization||this.isKeyBoardAction||i?this.isKeyBoardAction&&this.enableVirtualization&&r&&m===r&&"end"!==s&&!this.isVirtualScrolling?(this.isPreventKeyAction=!0,this.enableVirtualization&&this.itemTemplate?this.list.scrollTop+=p:(this.enableVirtualization&&(f="pageDown"===s?this.getPageCount()+1:f),this.list.scrollTop+=(this.selectedLI.offsetHeight+n)*f),this.isPreventKeyAction=!this.IsScrollerAtEnd()&&this.isPreventKeyAction,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1):this.enableVirtualization&&"end"===s?(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1,this.list.scrollTop=this.list.scrollHeight):("pageDown"===s&&this.enableVirtualization&&!this.isVirtualScrolling&&(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1),this.list.scrollTop=p):this.list.scrollTop=this.virtualListInfo&&this.virtualListInfo.startIndex?e&&this.virtualListInfo.startIndex?this.virtualListInfo.startIndex*this.listItemHeight+2*this.listItemHeight:this.virtualListInfo.startIndex*this.listItemHeight:0,d=this.isKeyBoardAction}}else this.list.scrollTop=0,d=this.isKeyBoardAction;this.isKeyBoardAction=d,this.enableVirtualization&&this.fields.groupBy&&this.fixedHeaderElement&&"down"===s&&setTimeout(function(){l.scrollStop(null,!0)},100)}},s.prototype.scrollTop=function(e){if(void 0===e&&(e=null),!t.isNullOrUndefined(this.selectedLI)){var i=this.selectedLI&&!isNaN(parseInt(window.getComputedStyle(this.selectedLI).marginBottom,10))?parseInt(window.getComputedStyle(this.selectedLI).marginBottom,10):0,s=this.list.querySelectorAll(".e-virtual-list").length,l=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*(this.selectedLI.offsetHeight+i):this.selectedLI.offsetTop,n=l-s*(this.selectedLI.offsetHeight+i)-this.list.scrollTop,a=this.list.querySelector("li.e-list-item:not(.e-virtual-list)")?this.list.querySelector("li.e-list-item:not(.e-virtual-list)").getAttribute("data-value"):null;n=this.fields.groupBy&&!t.isNullOrUndefined(this.fixedHeaderElement)?n-this.fixedHeaderElement.offsetHeight:n;var r=l-s*(this.selectedLI.offsetHeight+i)+(this.selectedLI.offsetHeight+i)-this.list.scrollTop,o=this.enableVirtualization&&"autocomplete"===this.getModuleName()&&n<=0;if(0!==this.activeIndex||this.enableVirtualization)if(n<0||o){var h=this.selectedLI?this.selectedLI.getAttribute("data-value"):null,u="pageUp"===e?this.getPageCount()-2:1;this.enableVirtualization&&(u="pageUp"===e?this.getPageCount():u),this.enableVirtualization&&this.isKeyBoardAction&&a&&h===a&&"home"!==e&&!this.isVirtualScrolling?(this.isUpwardScrolling=!0,this.isPreventKeyAction=!0,this.list.scrollTop-=(this.selectedLI.offsetHeight+i)*u,this.isPreventKeyAction=0!==this.list.scrollTop&&this.isPreventKeyAction,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1):this.enableVirtualization&&"home"===e?(this.isPreventScrollAction=!1,this.isPreventKeyAction=!0,this.isKeyBoardAction=!1,this.list.scrollTo(0,0)):("pageUp"===e&&this.enableVirtualization&&!this.isVirtualScrolling&&(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1),this.list.scrollTop=this.list.scrollTop+n)}else r>0&&this.list.offsetHeight>r||(this.list.scrollTop=this.selectedLI.offsetTop-(this.fields.groupBy&&!t.isNullOrUndefined(this.fixedHeaderElement)?this.fixedHeaderElement.offsetHeight:0));else this.list.scrollTop=0}},s.prototype.IsScrollerAtEnd=function(){return this.list&&this.list.scrollTop+this.list.clientHeight>=this.list.scrollHeight},s.prototype.isEditTextBox=function(){return!1},s.prototype.isFiltering=function(){return this.allowFiltering},s.prototype.isPopupButton=function(){return!0},s.prototype.setScrollPosition=function(e){if(this.isPreventScrollAction=!0,t.isNullOrUndefined(e))this.scrollBottom(!0);else switch(e.action){case"pageDown":case"down":case"end":this.isKeyBoardAction=!0,this.scrollBottom(!1,!1,e.action);break;default:this.isKeyBoardAction="up"===e.action||"pageUp"===e.action||"open"===e.action,this.scrollTop(e.action)}this.isKeyBoardAction=!1},s.prototype.clearText=function(){this.filterInput.value=this.typedString="",this.searchLists(null),this.enableVirtualization&&(this.list.scrollTop=0,this.totalItemCount=this.dataCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.list.getElementsByClassName("e-virtual-ddl")[0]&&(this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight()),this.getSkeletonCount(),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll(".e-list-item"),this.list.getElementsByClassName("e-virtual-ddl-content")[0]&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()))},s.prototype.setEleWidth=function(e){t.isNullOrUndefined(e)||("number"==typeof e?this.inputWrapper.container.style.width=t.formatUnit(e):"string"==typeof e&&(this.inputWrapper.container.style.width=e.match(/px|%|em/)?e:t.formatUnit(e)))},s.prototype.closePopup=function(e,s){var l=this,n=!t.isNullOrUndefined(this.filterInput)&&!t.isNullOrUndefined(this.filterInput.value)&&""!==this.filterInput.value;"combobox"===this.getModuleName()&&this.typedString;if(this.isTyped=!1,this.isVirtualTrackHeight=!1,this.popupObj&&document.body.contains(this.popupObj.element)&&this.beforePopupOpen){this.keyboardEvent=null,t.EventHandler.remove(document,"mousedown",this.onDocumentClick),this.isActive=!1,this.isDropDownClick=!1,this.preventAutoFill=!1;for(var r=0,o=this.popupObj.getScrollableParent(this.inputWrapper.container);r<o.length;r++){var h=o[r];t.EventHandler.remove(h,"scroll",this.scrollHandler)}t.Browser.isDevice&&this.isFilterLayout()&&this.isDeviceFullScreen&&t.removeClass([document.body,this.popupObj.element],q.popupFullScreen),this.isFilterLayout()&&(t.Browser.isDevice||(this.searchKeyModule.destroy(),this.clearIconElement&&t.EventHandler.remove(this.clearIconElement,"click",this.clearText)),this.backIconElement&&(t.EventHandler.remove(this.backIconElement,"click",this.clickOnBackIcon),t.EventHandler.remove(this.clearIconElement,"click",this.clearText)),t.isNullOrUndefined(this.filterInput)||(t.EventHandler.remove(this.filterInput,"input",this.onInput),t.EventHandler.remove(this.filterInput,"keyup",this.onFilterUp),t.EventHandler.remove(this.filterInput,"keydown",this.onFilterDown),t.EventHandler.remove(this.filterInput,"blur",this.onBlurHandler),t.EventHandler.remove(this.filterInput,"paste",this.pasteHandler)),this.allowFiltering&&"dropdownlist"===this.getModuleName()&&(this.filterInput.removeAttribute("aria-activedescendant"),this.filterInput.removeAttribute("aria-disabled"),this.filterInput.removeAttribute("role"),this.filterInput.removeAttribute("autocomplete"),this.filterInput.removeAttribute("autocapitalize"),this.filterInput.removeAttribute("spellcheck")),this.filterInput=null),t.attributes(this.targetElement(),{"aria-expanded":"false"}),this.inputElement.setAttribute("aria-expanded","false"),this.targetElement().removeAttribute("aria-owns"),this.targetElement().removeAttribute("aria-activedescendant"),this.inputWrapper.container.classList.remove(q.iconAnimation),this.isFiltering()&&(this.actionCompleteData.isUpdated=!1),this.enableVirtualization&&(null==this.value||this.isTyped?(this.viewPortInfo.endIndex=this.viewPortInfo&&this.viewPortInfo.endIndex>0?this.viewPortInfo.endIndex:this.itemCount,("autocomplete"===this.getModuleName()||"dropdownlist"===this.getModuleName()&&!t.isNullOrUndefined(this.typedString)&&""!==this.typedString||"combobox"===this.getModuleName()&&this.allowFiltering&&!t.isNullOrUndefined(this.typedString)&&""!==this.typedString)&&this.checkAndResetCache()):"autocomplete"===this.getModuleName()&&this.checkAndResetCache(),"dropdownlist"!==this.getModuleName()&&"combobox"!==this.getModuleName()||0===this.skeletonCount||this.getSkeletonCount(!0)),this.beforePopupOpen=!1;var u={name:"FadeOut",duration:100,delay:e||0},p={popup:this.popupObj,cancel:!1,animation:u,event:s||null};this.trigger("close",p,function(e){if("dropdownlist"===l.getModuleName()&&a.Input.destroy({element:l.filterInput,floatLabelType:l.floatLabelType,properties:{placeholder:l.filterBarPlaceholder},buttons:l.clearIconElement},l.clearIconElement),l.filterInputObj=null,!t.isNullOrUndefined(l.popupObj)&&!t.isNullOrUndefined(l.popupObj.element.querySelector(".e-fixed-head"))){var i=l.popupObj.element.querySelector(".e-fixed-head");i.parentNode.removeChild(i),l.fixedHeaderElement=null}e.cancel||("autocomplete"===l.getModuleName()&&l.rippleFun(),l.isPopupOpen?(l.isPopupRender=!1,l.popupObj.hide(new t.Animation(e.animation))):l.destroyPopup())}),t.Browser.isDevice&&!p.cancel&&this.popupObj.element.classList.contains("e-wide-popup")&&this.popupObj.element.classList.remove("e-wide-popup");var d;d=this.dataSource instanceof i.DataManager?this.remoteDataCount:this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.customFilterQuery=null,this.enableVirtualization&&this.isFiltering()&&n&&this.totalItemCount!==d&&(this.updateInitialData(),this.checkAndResetCache())}},s.prototype.updateInitialData=function(){var e=this.selectData;if(!t.isNullOrUndefined(e)){var s=this.renderItems(e,this.fields);if(this.list.scrollTop=0,this.virtualListInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount},"combobox"===this.getModuleName()&&(this.typedString=""),this.previousStartIndex=0,this.previousEndIndex=0,this.dataSource instanceof i.DataManager?this.remoteDataCount>=0?this.totalItemCount=this.dataCount=this.remoteDataCount:this.resetList(this.dataSource):this.totalItemCount=this.dataCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.list.getElementsByClassName("e-virtual-ddl")[0])this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight();else if(!this.list.querySelector(".e-virtual-ddl")&&this.list.parentElement){var l=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"});l.style.cssText=this.GetVirtualTrackHeight(),this.list.parentElement.querySelector(".e-dropdownbase").appendChild(l)}"autocomplete"!==this.getModuleName()&&0!==this.totalItemCount&&this.totalItemCount>2*this.itemCount&&this.getSkeletonCount(),this.UpdateSkeleton(),this.listData=e,this.updateActionCompleteDataValues(s,e),this.liCollections=this.list.querySelectorAll(".e-list-item"),this.list.getElementsByClassName("e-virtual-ddl-content")[0]&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues())}},s.prototype.destroyPopup=function(){this.isPopupOpen=!1,this.isFilterFocus=!1,this.inputElement.removeAttribute("aria-controls"),this.popupObj&&(this.resizer&&(t.EventHandler.remove(this.resizer,"mousedown",this.startResizing),t.EventHandler.remove(this.resizer,"touchstart",this.startResizing)),this.popupObj.destroy(),t.detach(this.popupObj.element))},s.prototype.clickOnBackIcon=function(){this.hidePopup(),this.focusIn()},s.prototype.render=function(){this.preselectedIndex=t.isNullOrUndefined(this.index)?null:this.index,"INPUT"===this.element.tagName?(this.inputElement=this.element,t.isNullOrUndefined(this.inputElement.getAttribute("role"))&&this.inputElement.setAttribute("role","combobox"),t.isNullOrUndefined(this.inputElement.getAttribute("type"))&&this.inputElement.setAttribute("type","text"),this.inputElement.setAttribute("aria-expanded","false")):(this.inputElement=this.createElement("input",{attrs:{role:"combobox",type:"text"}}),this.element.tagName!==this.getNgDirective()&&(this.element.style.display="none"),this.element.parentElement.insertBefore(this.inputElement,this.element),this.preventTabIndex(this.inputElement));var e=this.cssClass;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),!t.isNullOrUndefined(t.closest(this.element,"fieldset"))&&t.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.inputWrapper=a.Input.createInput({element:this.inputElement,buttons:this.isPopupButton()?[q.icon]:null,floatLabelType:this.floatLabelType,properties:{readonly:"dropdownlist"===this.getModuleName()||this.readonly,placeholder:this.placeholder,cssClass:e,enabled:this.enabled,enableRtl:this.enableRtl,showClearButton:this.showClearButton}},this.createElement),this.element.tagName===this.getNgDirective()?this.element.appendChild(this.inputWrapper.container):this.inputElement.parentElement.insertBefore(this.element,this.inputElement),this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",tabindex:"-1",class:q.hiddenElement}}),t.prepend([this.hiddenElement],this.inputWrapper.container),this.hiddenElement.hasAttribute("aria-label")||this.hiddenElement.setAttribute("aria-label",this.getModuleName()),this.validationAttribute(this.element,this.hiddenElement),this.setReadOnly(),this.setFields(),this.inputWrapper.container.style.width=t.formatUnit(this.width),this.inputWrapper.container.classList.add("e-ddl"),"Never"!==this.floatLabelType&&a.Input.calculateWidth(this.inputElement,this.inputWrapper.container),!t.isNullOrUndefined(this.inputWrapper.buttons[0])&&this.inputWrapper.container.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType&&this.inputWrapper.container.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon"),this.updateFloatLabelOverflowWidth(),this.wireEvent(),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex");var i=this.element.getAttribute("id")?this.element.getAttribute("id"):t.getUniqueID("ej2_dropdownlist");if(this.element.id=i,this.hiddenElement.id=i+"_hidden",this.targetElement().setAttribute("tabindex",this.tabIndex),"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.readonly?"dropdownlist"===this.getModuleName()&&(this.targetElement().hasAttribute("aria-label")||t.attributes(this.targetElement(),{"aria-label":this.getModuleName()}),this.inputElement.hasAttribute("aria-label")||this.inputElement.setAttribute("aria-label",this.getModuleName()),this.inputElement.setAttribute("aria-expanded","false")):this.inputElement.hasAttribute("aria-label")||this.inputElement.setAttribute("aria-label",this.getModuleName()),t.attributes(this.targetElement(),this.getAriaAttributes()),this.updateDataAttribute(this.htmlAttributes),this.setHTMLAttributes(),this.targetElement()===this.inputElement&&this.inputElement.removeAttribute("aria-labelledby"),null!==this.value||null!==this.activeIndex||null!==this.text)this.enableVirtualization&&(this.listItemHeight=this.getListHeight(),this.getSkeletonCount(),this.updateVirtualizationProperties(this.itemCount,this.allowFiltering),null!==this.index&&(this.activeIndex=this.index+this.skeletonCount)),this.initValue(),this.selectedValueInfo=this.viewPortInfo,this.enableVirtualization&&(this.activeIndex=this.activeIndex+this.skeletonCount);else if("SELECT"===this.element.tagName&&this.element.options[0]){var s=this.element;this.value=this.allowObjectBinding?this.getDataByValue(s.options[s.selectedIndex].value):s.options[s.selectedIndex].value,this.text=t.isNullOrUndefined(this.value)?null:s.options[s.selectedIndex].textContent,this.initValue()}this.setEnabled(),this.preventTabIndex(this.element),this.enabled||(this.targetElement().tabIndex=-1),this.initial=!1,this.element.style.opacity="",this.inputElement.onselect=function(e){e.stopImmediatePropagation()},this.inputElement.onchange=function(e){e.stopImmediatePropagation()},this.element.hasAttribute("autofocus")&&this.focusIn(),t.isNullOrUndefined(this.text)||this.inputElement.setAttribute("value",this.text),this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false");var l=this.inputWrapper.container.getElementsByClassName("e-float-text")[0];t.isNullOrUndefined(this.element.id)||""===this.element.id||t.isNullOrUndefined(l)||(l.id="label_"+this.element.id.replace(/ /g,"_"),t.attributes(this.inputElement,{"aria-labelledby":l.id})),this.renderComplete(),this.listItemHeight=this.getListHeight(),this.getSkeletonCount(),this.enableVirtualization&&this.updateVirtualizationProperties(this.itemCount,this.allowFiltering),this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=this.viewPortInfo.startIndex>0?this.viewPortInfo.endIndex:this.itemCount},s.prototype.getListHeight=function(){var e=this.createElement("div",{className:"e-dropdownbase"}),i=this.createElement("li",{className:"e-list-item"}),s=t.formatUnit(this.popupHeight);e.style.height=parseInt(s,10).toString()+"px",e.appendChild(i),document.body.appendChild(e),this.virtualListHeight=e.getBoundingClientRect().height;var l=Math.ceil(i.getBoundingClientRect().height)+parseInt(window.getComputedStyle(i).marginBottom,10);return e.remove(),l},s.prototype.setFooterTemplate=function(e){var i;this.footer?this.isReact&&"function"==typeof this.footerTemplate?this.clearTemplate(["footerTemplate"]):this.footer.innerHTML="":(this.footer=this.createElement("div"),t.addClass([this.footer],q.footer));var s=this.dropdownCompiler(this.footerTemplate),l=(i="function"!=typeof this.footerTemplate&&s?t.compile(t.select(this.footerTemplate,document).innerHTML.trim()):t.compile(this.footerTemplate))({},this,"footerTemplate",this.footerTemplateId,this.isStringTemplate,null,this.footer);l&&l.length>0&&t.append(l,this.footer),t.append([this.footer],e)},s.prototype.setHeaderTemplate=function(e){var i;this.header?this.header.innerHTML="":(this.header=this.createElement("div"),t.addClass([this.header],q.header));var s=this.dropdownCompiler(this.headerTemplate),l=(i="function"!=typeof this.headerTemplate&&s?t.compile(t.select(this.headerTemplate,document).innerHTML.trim()):t.compile(this.headerTemplate))({},this,"headerTemplate",this.headerTemplateId,this.isStringTemplate,null,this.header);l&&l.length&&t.append(l,this.header);var n=e.querySelector("div.e-content");e.insertBefore(this.header,n)},s.prototype.setEnabled=function(){this.element.setAttribute("aria-disabled",this.enabled?"false":"true")},s.prototype.setOldText=function(e){this.text=e},s.prototype.setOldValue=function(e){this.value=e},s.prototype.refreshPopup=function(){t.isNullOrUndefined(this.popupObj)||!document.body.contains(this.popupObj.element)||(!this.allowFiltering||t.Browser.isDevice&&this.isFilterLayout())&&"autocomplete"!==this.getModuleName()||(t.removeClass([this.popupObj.element],"e-popup-close"),this.popupObj.refreshPosition(this.inputWrapper.container),this.popupObj.resolveCollision())},s.prototype.checkData=function(e){!e.dataSource||t.isNullOrUndefined(Object.keys(e.dataSource))||!this.itemTemplate||!this.allowFiltering||this.isListSearched&&e.dataSource instanceof i.DataManager||(this.list&&!this.isReact?this.list.innerHTML="":this.list=null,this.actionCompleteData={ulElement:null,list:null,isUpdated:!1}),this.isListSearched=!1;var s=-1!==Object.keys(e).indexOf("value")&&t.isNullOrUndefined(e.value),l=-1!==Object.keys(e).indexOf("text")&&t.isNullOrUndefined(e.text);"autocomplete"!==this.getModuleName()&&this.allowFiltering&&(s||l)&&(this.itemData=null),this.allowFiltering&&e.dataSource&&!t.isNullOrUndefined(Object.keys(e.dataSource))?(this.actionCompleteData={ulElement:null,list:null,isUpdated:!1},this.actionData=this.actionCompleteData):this.allowFiltering&&e.query&&!t.isNullOrUndefined(Object.keys(e.query))&&(this.actionCompleteData="combobox"===this.getModuleName()?{ulElement:null,list:null,isUpdated:!1}:this.actionCompleteData,this.actionData=this.actionCompleteData)},s.prototype.updateDataSource=function(e,s){""===this.inputElement.value&&(t.isNullOrUndefined(e)||!t.isNullOrUndefined(e.dataSource)&&(e.dataSource instanceof i.DataManager||0!==e.dataSource.length))||this.clearAll(null,e),this.fields.groupBy&&e.fields&&!this.isGroupChecking&&this.list&&(t.EventHandler.remove(this.list,"scroll",this.setFloatingHeader),t.EventHandler.add(this.list,"scroll",this.setFloatingHeader,this)),(t.isNullOrUndefined(e)||!t.isNullOrUndefined(e.dataSource)&&(e.dataSource instanceof i.DataManager||0!==e.dataSource.length)||e.dataSource instanceof i.DataManager||!t.isNullOrUndefined(e)&&Array.isArray(e.dataSource)&&!t.isNullOrUndefined(s)&&Array.isArray(s.dataSource)&&e.dataSource.length!==s.dataSource.length)&&(this.typedString="",this.resetList(this.dataSource)),this.isCustomFilter||this.isFilterFocus||document.activeElement===this.filterInput||this.checkCustomValue()},s.prototype.checkCustomValue=function(){var e=this.allowObjectBinding&&!t.isNullOrUndefined(this.value)?t.getValue(this.fields.value?this.fields.value:"",this.value):this.value;this.itemData=this.getDataByValue(e);var i=this.getItemData(),s=this.allowObjectBinding?this.itemData:i.value,l=t.isNullOrUndefined(s)?null:this.index;t.isNullOrUndefined(l)&&e===s||this.isAngular?this.setProperties({text:i.text?i.text.toString():i.text,value:s}):this.setProperties({text:i.text?i.text.toString():i.text,index:l,value:s})},s.prototype.updateInputFields=function(){"dropdownlist"===this.getModuleName()&&a.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton)},s.prototype.onPropertyChanged=function(s,l){var n=this;t.isNullOrUndefined(s.dataSource)||this.isTouched||!t.isNullOrUndefined(s.value)||!t.isNullOrUndefined(s.index)||t.isNullOrUndefined(this.preselectedIndex)||t.isNullOrUndefined(this.index)||(s.index=this.index),t.isNullOrUndefined(s.value)&&t.isNullOrUndefined(s.index)||(this.isTouched=!0),"dropdownlist"===this.getModuleName()&&(this.checkData(s),this.setUpdateInitial(["fields","query","dataSource"],s));for(var r=this,o=0,h=Object.keys(s);o<h.length;o++){var u=function(o){switch(o){case"query":case"dataSource":r.getSkeletonCount(),r.checkAndResetCache();break;case"htmlAttributes":r.setHTMLAttributes();break;case"width":r.setEleWidth(s.width),a.Input.calculateWidth(r.inputElement,r.inputWrapper.container);break;case"placeholder":a.Input.setPlaceholder(s.placeholder,r.inputElement);break;case"filterBarPlaceholder":r.filterInput&&a.Input.setPlaceholder(s.filterBarPlaceholder,r.filterInput);break;case"readonly":"dropdownlist"!==r.getModuleName()&&a.Input.setReadonly(s.readonly,r.inputElement),r.setReadOnly();break;case"cssClass":r.setCssClass(s.cssClass,l.cssClass),a.Input.calculateWidth(r.inputElement,r.inputWrapper.container);break;case"enableRtl":r.setEnableRtl();break;case"enabled":r.setEnable();break;case"text":if(r.fields.disabled&&(s.text=s.text&&!r.isDisabledItemByIndex(r.getIndexByValue(r.getValueByText(s.text)))?s.text:null),null===s.text){r.clearAll();break}if(r.enableVirtualization){r.updateValues(),r.updateInputFields(),r.notify("setCurrentViewDataAsync",{module:"VirtualScroll"});break}if(r.list||(r.dataSource instanceof i.DataManager&&(r.initialRemoteRender=!0),r.renderList()),!r.initialRemoteRender){var h=r.getElementByText(s.text);if(!r.checkValidLi(h))if(r.liCollections&&100===r.liCollections.length&&"autocomplete"===r.getModuleName()&&r.listData.length>100)r.setSelectionData(s.text,l.text,"text");else if(s.text&&r.dataSource instanceof i.DataManager){var u=r.getItems().length,p=t.isNullOrUndefined(r.fields.text)?r.fields.value:r.fields.text;r.typedString="",r.dataSource.executeQuery(r.getQuery(r.query).where(new i.Predicate(p,"equal",s.text))).then(function(e){e.result.length>0?(n.addItem(e.result,u),n.updateValues()):n.setOldText(l.text)})}else"autocomplete"===r.getModuleName()?r.setInputValue(s,l):r.setOldText(l.text);r.updateInputFields()}break;case"value":if(r.fields.disabled&&(s.value=null==s.value||r.isDisableItemValue(s.value)?null:s.value),null===s.value){r.clearAll();break}if(r.allowObjectBinding&&!t.isNullOrUndefined(s.value)&&!t.isNullOrUndefined(l.value)&&r.isObjectInArray(s.value,[l.value]))return{value:void 0};if(r.enableVirtualization){r.updateValues(),r.updateInputFields(),r.notify("setCurrentViewDataAsync",{module:"VirtualScroll"}),r.preventChange=r.isAngular&&r.preventChange?!r.preventChange:r.preventChange;break}if(r.notify("beforeValueChange",{newProp:s}),r.list||(r.dataSource instanceof i.DataManager&&(r.initialRemoteRender=!0),r.renderList()),!r.initialRemoteRender){var d=r.allowObjectBinding&&!t.isNullOrUndefined(s.value)?t.getValue(r.fields.value?r.fields.value:"",s.value):s.value,c=r.getElementByValue(d);if(!r.checkValidLi(c))if(r.liCollections&&100===r.liCollections.length&&"autocomplete"===r.getModuleName()&&r.listData.length>100)r.setSelectionData(s.value,l.value,"value");else if(s.value&&r.dataSource instanceof i.DataManager){var m=r.getItems().length,p=t.isNullOrUndefined(r.fields.value)?r.fields.text:r.fields.value;r.typedString="";var f=r.allowObjectBinding&&!t.isNullOrUndefined(s.value)?t.getValue(p,s.value):s.value;r.dataSource.executeQuery(r.getQuery(r.query).where(new i.Predicate(p,"equal",f))).then(function(e){e.result.length>0?(n.addItem(e.result,m),n.updateValues()):n.setOldValue(l.value)})}else"autocomplete"===r.getModuleName()?r.setInputValue(s,l):r.setOldValue(l.value);r.updateInputFields(),r.preventChange=r.isAngular&&r.preventChange?!r.preventChange:r.preventChange}break;case"index":if(r.fields.disabled&&(s.index=null==s.index||r.isDisabledItemByIndex(s.index)?null:s.index),null===s.index){r.clearAll();break}if(r.list||(r.dataSource instanceof i.DataManager&&(r.initialRemoteRender=!0),r.renderList()),!r.initialRemoteRender&&r.liCollections){var v=r.liCollections[s.index];r.checkValidLi(v)||(r.liCollections&&100===r.liCollections.length&&"autocomplete"===r.getModuleName()&&r.listData.length>100?r.setSelectionData(s.index,l.index,"index"):r.index=l.index),r.updateInputFields()}break;case"footerTemplate":r.popupObj&&r.setFooterTemplate(r.popupObj.element);break;case"headerTemplate":r.popupObj&&r.setHeaderTemplate(r.popupObj.element);break;case"valueTemplate":t.isNullOrUndefined(r.itemData)||null===r.valueTemplate||r.setValueTemplate();break;case"allowFiltering":r.allowFiltering&&(r.actionCompleteData={ulElement:r.ulElement,list:r.listData,isUpdated:!0},r.actionData=r.actionCompleteData,r.updateSelectElementData(r.allowFiltering));break;case"floatLabelType":a.Input.removeFloating(r.inputWrapper),a.Input.addFloating(r.inputElement,s.floatLabelType,r.placeholder,r.createElement),!t.isNullOrUndefined(r.inputWrapper.buttons[0])&&r.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0]&&"Never"!==r.floatLabelType&&r.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon");break;case"showClearButton":r.inputWrapper.clearButton||(a.Input.setClearButton(s.showClearButton,r.inputElement,r.inputWrapper,null,r.createElement),r.bindClearEvent());break;default:var g=r.getPropObject(o,s,l);e.prototype.onPropertyChanged.call(r,g.newProperty,g.oldProperty)}}(h[o]);if("object"==typeof u)return u.value}},s.prototype.checkValidLi=function(e){return!!this.isValidLI(e)&&(this.setSelection(e,null),!0)},s.prototype.setSelectionData=function(e,i,s){var l,n=this;this.updateListValues=function(){if("text"===s)l=n.getElementByText(e),n.checkValidLi(l)||n.setOldText(i);else if("value"===s){var a=n.fields.value?n.fields.value:"";n.allowObjectBinding&&!t.isNullOrUndefined(e)&&t.getValue(a,e);l=n.getElementByValue(e),n.checkValidLi(l)||n.setOldValue(i)}else"index"===s&&(l=n.liCollections[e],n.checkValidLi(l)||(n.index=i))}},s.prototype.updatePopupState=function(){this.beforePopupOpen&&(this.beforePopupOpen=!1,this.showPopup())},s.prototype.setReadOnly=function(){this.readonly?t.addClass([this.inputWrapper.container],["e-readonly"]):t.removeClass([this.inputWrapper.container],["e-readonly"])},s.prototype.setInputValue=function(e,t){},s.prototype.setCssClass=function(e,i){t.isNullOrUndefined(i)||(i=i.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),a.Input.setCssClass(e,[this.inputWrapper.container],i),this.popupObj&&a.Input.setCssClass(e,[this.popupObj.element],i)},s.prototype.getRightIconsWidth=function(){for(var e=0,t=this.inputWrapper.container.querySelectorAll(".e-input-group-icon, .e-clear-icon"),i=0;i<t.length;i++)e+=t[i].offsetWidth;return e},s.prototype.updateFloatLabelOverflowWidth=function(){var e=this.inputWrapper.container,t=e.querySelector(".e-float-text"),i=e.clientWidth-this.getRightIconsWidth();t&&i&&(t.style.width=i+"px")},s.prototype.getModuleName=function(){return"dropdownlist"},s.prototype.showPopup=function(e){if(this.enabled){if("dropdownlist"===this.getModuleName()&&this.beforePopupOpen&&!this.isPopupOpen&&(this.beforePopupOpen=!1),this.firstItem=this.dataSource&&this.dataSource.length>0?this.dataSource[0]:null,this.isReact&&"combobox"===this.getModuleName()&&this.itemTemplate&&this.isCustomFilter&&this.isAddNewItemTemplate&&(this.renderList(),this.isAddNewItemTemplate=!1),this.isFiltering()&&this.dataSource instanceof i.DataManager&&this.actionData.list!==this.actionCompleteData.list&&this.actionData.list&&this.actionData.ulElement&&(this.actionCompleteData=this.actionData,this.onActionComplete(this.actionCompleteData.ulElement,this.actionCompleteData.list,null,!0)),this.beforePopupOpen)return void this.refreshPopup();this.beforePopupOpen=!0,this.isFiltering()&&!this.isActive&&this.actionCompleteData.list&&this.actionCompleteData.list[0]?(this.isActive=!0,this.onActionComplete(this.actionCompleteData.ulElement,this.actionCompleteData.list,null,!0)):(t.isNullOrUndefined(this.list)||!t.isUndefined(this.list)&&(this.list.classList.contains(H.noData)||this.list.querySelectorAll("."+H.li).length<=0))&&(this.isReact&&this.isFiltering()&&null!=this.itemTemplate&&(this.isSecondClick=!1),this.renderList(e)),this.enableVirtualization&&this.listData&&this.listData.length&&(t.isNullOrUndefined(this.value)||"dropdownlist"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.removeHover(),this.beforePopupOpen||this.notify("setCurrentViewDataAsync",{module:"VirtualScroll"})),this.beforePopupOpen&&this.invokeRenderPopup(e),this.enableVirtualization&&!this.allowFiltering&&null!=this.selectedValueInfo&&this.selectedValueInfo.startIndex>0&&null!=this.value&&this.notify("dataProcessAsync",{module:"VirtualScroll",isOpen:!0}),this.isSecondClick||this.isDropDownClick||this.executeCloneElements()}},s.prototype.executeCloneElements=function(){var e=this,t=this.element.tagName===this.getNgDirective()&&this.itemTemplate?500:100;this.isReact&&this.isFiltering()&&null!=this.itemTemplate&&setTimeout(function(){e.cloneElements(),e.isSecondClick=!(e.isReact&&e.isFiltering()&&e.dataSource instanceof i.DataManager&&!e.list.querySelector("ul"))},t)},s.prototype.invokeRenderPopup=function(e){if(t.Browser.isDevice&&this.isFilterLayout()){var i=this;window.onpopstate=function(){i.hidePopup()},history.pushState({},"")}t.isNullOrUndefined(this.list)||t.isNullOrUndefined(this.list.children[0])&&!this.list.classList.contains(H.noData)||this.renderPopup(e)},s.prototype.renderHightSearch=function(){},s.prototype.hidePopup=function(e){if(this.isEscapeKey&&"dropdownlist"===this.getModuleName())if(t.isNullOrUndefined(this.inputElement)||a.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton),this.isEscapeKey=!1,t.isNullOrUndefined(this.index))this.resetSelection();else{var i=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",this.value):this.value,s=this.findListElement(this.ulElement,"li","data-value",i);this.selectedLI=this.liCollections[this.index]||s,this.selectedLI&&(this.updateSelectedItem(this.selectedLI,null,!0),this.valueTemplate&&null!==this.itemData&&this.setValueTemplate())}this.isVirtualTrackHeight=!1,this.customFilterQuery=null,this.closePopup(0,e);var l=this.getItemData(),n=!t.isNullOrUndefined(this.selectedLI);n&&this.enableVirtualization&&this.selectedLI.classList&&(n=this.selectedLI.classList.contains("e-active")),this.inputElement&&""===this.inputElement.value&&!this.isInteracted&&(this.isSelectCustom||n&&this.inputElement.value!==l.text)&&(this.isSelectCustom=!1,this.clearAll(e))},s.prototype.focusIn=function(e){if(this.enabled&&!this.targetElement().classList.contains(q.disable)){var i=!1;this.preventFocus&&t.Browser.isDevice&&(this.inputWrapper.container.tabIndex=1,this.inputWrapper.container.focus(),this.preventFocus=!1,i=!0),i||this.targetElement().focus(),t.addClass([this.inputWrapper.container],[q.inputFocus]),this.onFocus(e),"Never"!==this.floatLabelType&&a.Input.calculateWidth(this.inputElement,this.inputWrapper.container)}},s.prototype.focusOut=function(e){this.enabled&&(this.enableVirtualization||"combobox"!==this.getModuleName()&&"autocomplete"!==this.getModuleName()||(this.isTyped=!0),this.hidePopup(e),this.targetElement()&&this.targetElement().blur(),t.removeClass([this.inputWrapper.container],[q.inputFocus]),"Never"!==this.floatLabelType&&a.Input.calculateWidth(this.inputElement,this.inputWrapper.container))},s.prototype.disableItem=function(e){if(this.fields.disabled){this.list||this.renderList();var t=-1;if(this.liCollections&&this.liCollections.length>0&&this.listData&&this.fields.disabled){if("string"==typeof e)t=this.getIndexByValue(e);else if("object"==typeof e){if(e instanceof HTMLLIElement){for(s=0;s<this.liCollections.length;s++)if(this.liCollections[s]===e){t=this.getIndexByValue(e.getAttribute("data-value"));break}}else for(var i=JSON.parse(JSON.stringify(e))[this.fields.value],s=0;s<this.listData.length;s++)if(JSON.parse(JSON.stringify(this.listData[s]))[this.fields.value]===i){t=this.getIndexByValue(i);break}}else t=e;if(t<this.liCollections.length&&t>-1&&!JSON.parse(JSON.stringify(this.listData[t]))[this.fields.disabled]){var l=this.liCollections[t];if(l){this.disableListItem(l);var n=JSON.parse(JSON.stringify(this.listData[t]));n[this.fields.disabled]=!0,this.listData[t]=n,this.dataSource=this.listData,l.classList.contains(q.focus)&&this.removeFocus(),l.classList.contains(q.selected)&&this.clear()}}}}},s.prototype.destroy=function(){if(this.isActive=!1,this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),d(this.element.id),this.isReact&&this.clearTemplate(),this.hidePopup(),this.popupObj&&(this.isPopupRender=!1,this.popupObj.hide()),this.unWireEvent(),this.list&&this.unWireListEvents(),!this.element||this.element.classList.contains("e-"+this.getModuleName())){if(this.inputElement){for(var i=["readonly","aria-disabled","placeholder","aria-labelledby","aria-expanded","autocomplete","aria-readonly","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-describedby","aria-label"],s=0;s<i.length;s++)this.inputElement.removeAttribute(i[s]);this.inputElement.setAttribute("tabindex",this.tabIndex),this.inputElement.classList.remove("e-input"),a.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton)}this.element.removeAttribute("tabindex"),this.element.style.display="block",this.inputWrapper.container&&this.inputWrapper.container.parentElement&&(this.inputWrapper.container.parentElement.tagName===this.getNgDirective()?t.detach(this.inputWrapper.container):(this.inputWrapper.container.parentElement.insertBefore(this.element,this.inputWrapper.container),t.detach(this.inputWrapper.container))),delete this.hiddenElement,this.filterInput=null,this.keyboardModule=null,this.ulElement=null,this.list=null,this.clearIconElement=null,this.popupObj=null,this.popupContentElement=null,this.rippleFun=null,this.selectedLI=null,this.liCollections=null,this.item=null,this.footer=null,this.header=null,this.previousSelectedLI=null,this.valueTempElement=null,this.actionData.ulElement=null,this.inputElement&&!t.isNullOrUndefined(this.inputElement.onchange)&&(this.inputElement.onchange=null),this.inputElement&&!t.isNullOrUndefined(this.inputElement.onselect)&&(this.inputElement.onselect=null),a.Input.destroy({element:this.inputElement,floatLabelType:this.floatLabelType,properties:this.properties,buttons:this.inputWrapper.container.querySelectorAll(".e-input-group-icon")[0]},this.clearButton),this.clearButton=null,this.inputElement=null,this.inputWrapper=null,e.prototype.destroy.call(this)}},s.prototype.getItems=function(){return this.list||(this.dataSource instanceof i.DataManager&&(this.initialRemoteRender=!0),this.renderList()),this.ulElement?e.prototype.getItems.call(this):[]},s.prototype.getDataByValue=function(t){return e.prototype.getDataByValue.call(this,t)},s.prototype.clear=function(){this.value=null},W([t.Property(null)],s.prototype,"cssClass",void 0),W([t.Property("100%")],s.prototype,"width",void 0),W([t.Property(!0)],s.prototype,"enabled",void 0),W([t.Property(!1)],s.prototype,"enablePersistence",void 0),W([t.Property("300px")],s.prototype,"popupHeight",void 0),W([t.Property("100%")],s.prototype,"popupWidth",void 0),W([t.Property(null)],s.prototype,"placeholder",void 0),W([t.Property(null)],s.prototype,"filterBarPlaceholder",void 0),W([t.Property({})],s.prototype,"htmlAttributes",void 0),W([t.Property(null)],s.prototype,"query",void 0),W([t.Property(null)],s.prototype,"valueTemplate",void 0),W([t.Property(null)],s.prototype,"headerTemplate",void 0),W([t.Property(null)],s.prototype,"footerTemplate",void 0),W([t.Property(!1)],s.prototype,"allowFiltering",void 0),W([t.Property(300)],s.prototype,"debounceDelay",void 0),W([t.Property(!0)],s.prototype,"isDeviceFullScreen",void 0),W([t.Property(!1)],s.prototype,"readonly",void 0),W([t.Property(!1)],s.prototype,"enableVirtualization",void 0),W([t.Property(!1)],s.prototype,"allowResize",void 0),W([t.Property(null)],s.prototype,"text",void 0),W([t.Property(null)],s.prototype,"value",void 0),W([t.Property(!1)],s.prototype,"allowObjectBinding",void 0),W([t.Property(null)],s.prototype,"index",void 0),W([t.Property("Never")],s.prototype,"floatLabelType",void 0),W([t.Property(!1)],s.prototype,"showClearButton",void 0),W([t.Event()],s.prototype,"filtering",void 0),W([t.Event()],s.prototype,"change",void 0),W([t.Event()],s.prototype,"beforeOpen",void 0),W([t.Event()],s.prototype,"open",void 0),W([t.Event()],s.prototype,"close",void 0),W([t.Event()],s.prototype,"blur",void 0),W([t.Event()],s.prototype,"focus",void 0),W([t.Event()],s.prototype,"resizeStop",void 0),W([t.Event()],s.prototype,"resizing",void 0),W([t.Event()],s.prototype,"resizeStart",void 0),s=W([t.NotifyPropertyChanges],s)}(U),R=function(){var e=function(t,i){return(e=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])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),z=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(l=e[r])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},K="e-input-group-icon e-ddt-icon e-icons",G="e-show-chip",_="e-show-clear",Q="e-chip-input",J="e-input-focus",X="e-icon-hide",Y="e-check",$="e-no-data",Z="e-show-text",ee=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return R(i,e),z([t.Property("child")],i.prototype,"child",void 0),z([t.Property([])],i.prototype,"dataSource",void 0),z([t.Property("expanded")],i.prototype,"expanded",void 0),z([t.Property("hasChildren")],i.prototype,"hasChildren",void 0),z([t.Property("htmlAttributes")],i.prototype,"htmlAttributes",void 0),z([t.Property("iconCss")],i.prototype,"iconCss",void 0),z([t.Property("imageUrl")],i.prototype,"imageUrl",void 0),z([t.Property("parentValue")],i.prototype,"parentValue",void 0),z([t.Property(null)],i.prototype,"query",void 0),z([t.Property("selectable")],i.prototype,"selectable",void 0),z([t.Property("selected")],i.prototype,"selected",void 0),z([t.Property(null)],i.prototype,"tableName",void 0),z([t.Property("text")],i.prototype,"text",void 0),z([t.Property("tooltip")],i.prototype,"tooltip",void 0),z([t.Property("value")],i.prototype,"value",void 0),i}(t.ChildProperty),te=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return R(i,e),z([t.Property(!1)],i.prototype,"autoCheck",void 0),z([t.Property(!0)],i.prototype,"checkDisabledChildren",void 0),z([t.Property("Auto")],i.prototype,"expandOn",void 0),z([t.Property(!1)],i.prototype,"loadOnDemand",void 0),i}(t.ChildProperty),ie=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.filterTimer=null,s.isFilteredData=!1,s.isFilterRestore=!1,s.selectedData=[],s.filterDelayTime=300,s.isClicked=!1,s.documentClickContext=s.onDocumentClick.bind(s),s.isCheckAllCalled=!1,s.isFromFilterChange=!1,s}return R(s,e),s.prototype.getPersistData=function(){var e=["value"];return this.addOnPersist(e)},s.prototype.getLocaleName=function(){return"drop-down-tree"},s.prototype.preRender=function(){this.inputFocus=!1,this.isPopupOpen=!1,this.isFirstRender=!0,this.isInitialized=!1,this.currentText=null,this.currentValue=null,this.oldValue=null,this.removeValue=!1,this.selectedText=[],this.treeItems=[],this.dataValue=null,this.isNodeSelected=!1,this.isDynamicChange=!1,this.clearIconWidth=0,this.headerTemplateId=this.element.id+"HeaderTemplate",this.footerTemplateId=this.element.id+"FooterTemplate",this.actionFailureTemplateId=this.element.id+"ActionFailureTemplate",this.noRecordsTemplateId=this.element.id+"NoRecordsTemplate",this.customTemplateId=this.element.id+"CustomTemplate",this.keyConfigs={escape:"escape",altUp:"alt+uparrow",altDown:"alt+downarrow",tab:"tab",shiftTab:"shift+tab",end:"end",enter:"enter",home:"home",moveDown:"downarrow",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",ctrlDown:"ctrl+downarrow",ctrlUp:"ctrl+uparrow",ctrlEnter:"ctrl+enter",ctrlHome:"ctrl+home",ctrlEnd:"ctrl+end",shiftDown:"shift+downarrow",shiftUp:"shift+uparrow",shiftEnter:"shift+enter",shiftHome:"shift+home",shiftEnd:"shift+end",csDown:"ctrl+shift+downarrow",csUp:"ctrl+shift+uparrow",csEnter:"ctrl+shift+enter",csHome:"ctrl+shift+home",csEnd:"ctrl+shift+end",space:"space",ctrlA:"ctrl+A"}},s.prototype.render=function(){var e=t.select("#"+this.element.id+"_tree",document);if(e){var s=t.select("#"+this.element.id+"_options",document);t.detach(s||e.parentElement)}"INPUT"===this.element.tagName?(this.inputEle=this.element,t.isNullOrUndefined(this.inputEle.getAttribute("role"))&&(this.inputEle.setAttribute("aria-expanded","false"),this.inputEle.setAttribute("role","combobox"),this.inputEle.setAttribute("aria-haspopup","tree"),this.inputEle.setAttribute("aria-controls",this.element.id+"_options")),t.isNullOrUndefined(this.inputEle.getAttribute("type"))&&this.inputEle.setAttribute("type","text")):(t.isNullOrUndefined(this.element.id)?this.inputEle=this.createElement("input",{attrs:{role:"textbox",type:"text"}}):this.inputEle=this.createElement("input",{attrs:{role:"textbox",type:"text",id:this.element.id+"_textbox"}}),this.element.parentElement.insertBefore(this.inputEle,this.element)),this.inputObj=a.Input.createInput({element:this.inputEle,floatLabelType:this.floatLabelType,buttons:this.showDropDownIcon?[K]:null,properties:{readonly:!0,placeholder:this.placeholder,enabled:this.enabled,cssClass:this.cssClass,enableRtl:this.enableRtl}},this.createElement),this.inputWrapper=this.inputObj.container,this.inputWrapper.classList.contains("e-input-group")||this.inputWrapper.classList.add("e-input-group"),this.showDropDownIcon&&this.inputWrapper.classList.add("e-show-dd-icon"),this.element.tagName===this.getDirective()&&this.element.appendChild(this.inputWrapper),this.createHiddenElement(),this.createClearIcon(),this.inputWrapper.classList.add("e-ddt"),this.setElementWidth(this.width),this.updateDataAttribute(),this.setHTMLAttributes(),this.setAttributes(),this.popupDiv=this.createElement("div",{className:"e-popup-content"}),this.popupDiv.classList.add("e-dropdown"),this.tree=this.createElement("div",{id:this.element.id+"_tree"}),this.popupDiv.appendChild(this.tree),this.destroyPopupOnHide||document.body.appendChild(this.popupDiv),this.wireTreeEvents(),t.addClass([this.popupDiv],"e-ddt-icon-hide"),this.renderTree(),this.isRemoteData=this.fields.dataSource instanceof i.DataManager,(this.allowMultiSelection||this.showCheckBox)&&("Delimiter"!==this.mode&&this.createChip(),this.wrapText||"Custom"===this.mode||(this.overFlowWrapper=this.createElement("span",{className:"e-overflow "+X}),this.inputWrapper.insertBefore(this.overFlowWrapper,this.hiddenElement),"Box"!==this.mode&&t.addClass([this.overFlowWrapper],Z))),this.isRemoteData||(this.setTreeValue(),this.setTreeText(),this.updateHiddenValue(),this.setSelectedValue(),this.wrapText||this.updateView()),this.wireEvents();var l=t.select(".e-list-parent",this.treeObj.element);l&&l.getAttribute("aria-multiselectable")&&l.removeAttribute("aria-multiselectable"),this.setOldValue(),this.isRemoteData||(this.isInitialized=!0),this.hasTemplate=this.itemTemplate||this.headerTemplate||this.footerTemplate||this.actionFailureTemplate||this.noRecordsTemplate||this.customTemplate||this.valueTemplate,this.renderComplete()},s.prototype.hideCheckAll=function(e){var i=t.isNullOrUndefined(this.popupEle)?null:this.popupEle.querySelector(".e-selectall-parent");t.isNullOrUndefined(i)||(e&&!i.classList.contains("e-hide-selectall")?t.addClass([i],"e-hide-selectall"):!e&&i.classList.contains("e-hide-selectall")&&t.removeClass([i],"e-hide-selectall"))},s.prototype.renderFilter=function(){this.filterContainer=this.createElement("div",{id:this.element.id+"_filter_wrap",className:"e-filter-wrap"});var e=this.createElement("input",{id:this.element.id+"_filter",attrs:{autocomplete:"off","aria-label":this.filterBarPlaceholder}});this.filterContainer.appendChild(e),t.prepend([this.filterContainer],this.popupEle),this.filterObj=new a.TextBox({value:"",showClearButton:!0,placeholder:this.filterBarPlaceholder,input:this.filterChangeHandler.bind(this)}),this.filterObj.appendTo("#"+this.element.id+"_filter"),this.keyboardModule=new t.KeyboardEvents(this.filterObj.element,{keyAction:this.filterKeyAction.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},s.prototype.filterKeyAction=function(e){var i,s=this,l={cancel:!1,event:e};this.trigger("keyPress",l,function(l){if(!l.cancel)switch(e.action){case"altUp":s.isPopupOpen&&s.hidePopup();break;case"shiftTab":t.addClass([s.inputWrapper],[J]);break;case"moveDown":e.preventDefault(),s.filterObj.element.blur(),(i=s.treeObj.element.querySelector("li"))&&i.focus()}})},s.prototype.filterChangeHandler=function(e){var i=this;t.isNullOrUndefined(e.value)||(window.clearTimeout(this.filterTimer),this.filterTimer=window.setTimeout(function(){i.filterHandler(e.value,e.event)},this.filterDelayTime))},s.prototype.isChildObject=function(){return"object"==typeof this.treeObj.fields.child},s.prototype.filterHandler=function(e,t){var s=this;this.isFromFilterChange=!0,this.isFilteredData||(this.isRemoteData&&(this.treeObj.expandedNodes=[]),this.treeData=this.treeObj.getTreeData());var l=this.cloneFields(this.fields),n={cancel:!1,preventDefaultAction:!1,event:t,text:e.trim(),fields:l};this.trigger("filtering",n,function(e){if(!e.cancel){var t=!1,l=void 0;if(s.isFilteredData=!0,""===e.text?(s.isFilteredData=!1,s.isFilterRestore=!0,l=s.cloneFields(s.fields),s.treeObj.element.classList.remove("e-filtering")):e.preventDefaultAction?(l=e.fields,s.treeObj.element.classList.add("e-filtering")):(1===s.treeDataType?l=s.selfReferencefilter(e.text,e.fields):s.fields.dataSource instanceof i.DataManager?((l=s.remoteDataFilter(e.text,e.fields)).child=s.fields.child,s.treeObj.fields=s.getTreeFields(e.fields),s.treeObj.dataBind(),t=!0):l=s.nestedFilter(e.text,e.fields),s.treeObj.element.classList.add("e-filtering")),s.hideCheckAll(s.isFilteredData),t)return;if(s.isRemoteData&&(s.isChildObject()?l.child=s.fields.child:l=e.fields),s.treeObj.fields=s.getTreeFields(l),(s.previousFilterText&&""!==s.previousFilterText&&""!==e.text&&-1!==s.previousFilterText.indexOf(e.text)||e.text&&""!==e.text&&""!==s.previousFilterText&&-1!==e.text.indexOf(s.previousFilterText))&&(s.isFilterRestore=!0),s.previousFilterText=e.text,s.treeObj.dataBind(),s.popupObj&&s.popupObj.refreshPosition(),s.hasTemplate&&s.portals&&s.treeObj.portals){for(var n=0;n<s.treeObj.portals.length;n++)-1===s.portals.indexOf(s.treeObj.portals[n])&&s.portals.push(s.treeObj.portals[n]);s.isReact&&s.renderReactTemplates()}}})},s.prototype.remoteDataFilter=function(e,i){var s=this;return i.dataSource=this.treeData.map(function(t){return s.remoteChildFilter(e,t)}).filter(function(e){return!t.isNullOrUndefined(e)}),i},s.prototype.remoteChildFilter=function(e,i,s,l){var n=this.isChildObject()?i.child:i[this.fields.child];if(t.isNullOrUndefined(n))return this.isMatchedNode(e,i,s,l)?i:null;for(var a=[],r=0;r<n.length;r++){var o=this.remoteChildFilter(e,n[r],!0,!0);t.isNullOrUndefined(o)||a.push(o)}var h=Object.assign({},i);return l=!1,0!==a.length?h.child=a:(h.child=null,h=this.isMatchedNode(e,h)?h:null),h},s.prototype.nestedFilter=function(e,i){for(var s=[],l=0;l<this.treeData.length;l++){var n=this.nestedChildFilter(e,this.treeData[parseInt(l.toString(),10)]);t.isNullOrUndefined(n)||s.push(n)}return i.dataSource=s,i},s.prototype.nestedChildFilter=function(e,i){var s=i[this.fields.child];if(t.isNullOrUndefined(s))return this.isMatchedNode(e,i)?i:null;for(var l=[],n=0;n<s.length;n++){var a=this.nestedChildFilter(e,s[parseInt(n.toString(),10)]);t.isNullOrUndefined(a)||l.push(a)}var r=Object.assign({},i);return 0!==l.length?(r[this.fields.child]=l,r):(r[this.fields.child]=null,this.isMatchedNode(e,r)?r:null)},s.prototype.selfReferencefilter=function(e,i){for(var s=[],l=[],n=0;n<this.treeData.length;n++)this.isMatchedNode(e,this.treeData[n])&&s.push(this.treeData[n]);for(n=0;n<s.length;n++)if(-1===l.indexOf(s[n])){l.push(s[n]);for(var a=s[parseInt(n.toString(),10)][this.fields.parentValue];!t.isNullOrUndefined(a);){for(var r=null,o=0;o<this.treeData.length;o++){var h=this.treeData[parseInt(o.toString(),10)][this.fields.value];if(!t.isNullOrUndefined(h)&&h===a){r=this.treeData[o];break}}if(t.isNullOrUndefined(r)||-1!==l.indexOf(r))break;l.push(r),a=r[this.fields.parentValue]}}return i.dataSource=l,i},s.prototype.isMatchedNode=function(e,s,l,n){var a;if(!(a=l&&n&&this.isChildObject()?s[this.fields.child.text]:s[this.fields.text])&&!t.isNullOrUndefined(this.fields.child.text)){for(var r=this.fields.child;!s[r.text];)r=r.child;a=s[r.text]}return this.ignoreCase&&(a=a.toLowerCase(),e=e.toLowerCase()),this.ignoreAccent&&(a=i.DataUtil.ignoreDiacritics(a),e=i.DataUtil.ignoreDiacritics(e)),"StartsWith"===this.filterType?a.slice(0,e.length)===e:"EndsWith"===this.filterType?a.slice(-e.length)===e:-1!==a.indexOf(e)},s.prototype.wireEvents=function(){t.Browser.isIos&&t.EventHandler.add(this.inputWrapper,"touchstart",this.handleIosTouch,this),t.EventHandler.add(this.inputWrapper,"mouseup",this.dropDownClick,this),t.EventHandler.add(this.inputWrapper,"focus",this.focusIn,this),t.EventHandler.add(this.inputWrapper,"blur",this.focusOut,this),t.EventHandler.add(this.inputWrapper,"mousemove",this.mouseIn,this),t.EventHandler.add(this.inputWrapper,"mouseout",this.onMouseLeave,this),t.EventHandler.add(this.overAllClear,"mousedown",this.clearAll,this),t.EventHandler.add(window,"resize",this.windowResize,this);var e=t.closest(this.inputWrapper,"form");e&&t.EventHandler.add(e,"reset",this.resetValueHandler,this),this.keyboardModule=new t.KeyboardEvents(this.inputWrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},s.prototype.wireTreeEvents=function(){this.keyboardModule=new t.KeyboardEvents(this.tree,{keyAction:this.treeAction.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},s.prototype.wireCheckAllWrapperEvents=function(){this.keyboardModule=new t.KeyboardEvents(this.checkAllParent,{keyAction:this.checkAllAction.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},s.prototype.unWireEvents=function(){t.Browser.isIos&&t.EventHandler.remove(this.inputWrapper,"touchstart",this.handleIosTouch),t.EventHandler.remove(this.inputWrapper,"mouseup",this.dropDownClick),t.EventHandler.remove(this.inputWrapper,"focus",this.focusIn),t.EventHandler.remove(this.inputWrapper,"blur",this.focusOut),t.EventHandler.remove(this.inputWrapper,"mousemove",this.mouseIn),t.EventHandler.remove(this.inputWrapper,"mouseout",this.onMouseLeave),t.EventHandler.remove(this.overAllClear,"mousedown",this.clearAll),t.EventHandler.remove(window,"resize",this.windowResize);var e=t.closest(this.inputWrapper,"form");e&&t.EventHandler.remove(e,"reset",this.resetValueHandler),this.keyboardModule.destroy(),this.showSelectAll&&this.checkAllParent&&t.EventHandler.remove(this.checkAllParent,"mouseup",this.clickHandler),document.removeEventListener("mousedown",this.documentClickContext)},s.prototype.handleIosTouch=function(e){var t=e.target;t&&t.classList.contains("e-clear-icon")||(e.preventDefault(),this.dropDownClick(e))},s.prototype.dropDownClick=function(e){if(this.enabled&&!this.readonly){if(this.isClearButtonClick)return void(this.isClearButtonClick=!1);this.isPopupOpen?this.hidePopup():("touchstart"===e.type||"button"in e&&2!==e.button)&&(this.focusIn(e),this.renderPopup()),this.showOverAllClear()}},s.prototype.mouseIn=function(){!this.enabled&&this.readonly||this.showOverAllClear()},s.prototype.onMouseLeave=function(){this.inputFocus||(t.addClass([this.overAllClear],X),t.removeClass([this.inputWrapper],_))},s.prototype.getDirective=function(){return"EJS-DROPDOWNTREE"},s.prototype.focusOut=function(e){if(this.enabled&&!this.readonly&&this.inputFocus&&(!t.Browser.isIE&&"edge"!==t.Browser.info.name||e.target!==this.inputWrapper)){var i=e.relatedTarget;i===this.inputEle||!t.isNullOrUndefined(i)||e.target===this.inputWrapper&&this.isPopupOpen||this.onFocusOut(e)}},s.prototype.onFocusOut=function(e){if(this.inputFocus=!1,this.isPopupOpen&&this.hidePopup(),this.isClearButtonClick&&(this.isClearButtonClick=!1),this.showClearButton&&(this.clearIconWidth=t.select(".e-clear-icon",this.inputWrapper).offsetWidth,t.addClass([this.overAllClear],X),t.removeClass([this.inputWrapper],_)),t.removeClass([this.inputWrapper],[J]),this.allowMultiSelection||this.showCheckBox){var i=!!this.value&&!!this.value.length;"Delimiter"!==this.mode&&"Custom"!==this.mode&&this.chipWrapper&&"Default"===this.mode&&(t.addClass([this.chipWrapper],X),t.removeClass([this.inputWrapper],G),t.removeClass([this.inputEle],Q)),i&&"Custom"!==this.mode&&this.showOrHideValueTemplate(!0),!this.wrapText&&i&&this.updateView()}this.changeOnBlur&&this.triggerChangeEvent(e),this.removeValue=!1,this.setOldValue(),this.trigger("blur")},s.prototype.updateView=function(){!this.showCheckBox&&!this.allowMultiSelection||"Custom"===this.mode||this.inputFocus||("Box"!==this.mode?t.addClass([this.inputWrapper,this.overFlowWrapper],Z):t.addClass([this.inputWrapper],G),this.value&&0!==this.value.length&&(this.inputWrapper.contains(this.chipWrapper)&&t.addClass([this.chipWrapper],X),t.addClass([this.inputEle],Q),this.updateOverFlowView()),this.ensurePlaceHolder())},s.prototype.triggerChangeEvent=function(e){if((!this.ddtCompareValues(this.oldValue,this.value)||this.isChipDelete)&&!this.removeValue){var t={e:e,oldValue:this.oldValue,value:this.value,isInteracted:!!e,element:this.element};this.trigger("change",t),this.setOldValue()}},s.prototype.ddtCompareValues=function(e,t){if(null===e||null===t)return null===e?t===e:0===e.length&&t===e;if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0},s.prototype.focusIn=function(e){if(this.enabled&&!this.readonly&&!this.inputFocus){this.showOverAllClear(),this.inputFocus=!0,t.addClass([this.inputWrapper],[J]),(this.allowMultiSelection||this.showCheckBox)&&("Delimiter"!==this.mode&&this.inputFocus&&(this.chipWrapper&&this.value&&0!==this.value.length&&(t.removeClass([this.chipWrapper],X),t.addClass([this.inputEle],Q),this.showOrHideValueTemplate(!1,!0)),t.addClass([this.inputWrapper],G),this.popupObj&&this.popupObj.refreshPosition()),this.wrapText||"Custom"===this.mode||(this.inputWrapper.contains(this.overFlowWrapper)&&t.addClass([this.overFlowWrapper],X),"Delimiter"===this.mode?(t.removeClass([this.inputWrapper],G),t.removeClass([this.inputEle],Q),this.showOrHideValueTemplate(!0)):t.addClass([this.inputWrapper],G),t.removeClass([this.inputWrapper],Z),this.ensurePlaceHolder()));var i={isInteracted:!!e,event:e};this.trigger("focus",i)}},s.prototype.treeAction=function(e){var t=this,i={cancel:!1,event:e};this.trigger("keyPress",i,function(i){if(i.cancel)e.stopImmediatePropagation();else switch(e.action){case"escape":case"altUp":t.inputWrapper.focus(),e.preventDefault(),t.isPopupOpen&&t.hidePopup();break;case"tab":t.isPopupOpen&&t.hidePopup();break;case"enter":case"ctrlEnter":case"shiftEnter":case"csEnter":t.showCheckBox||(t.isValueChange=!0,t.keyEventArgs=e);break;case"space":t.isValueChange=!0,t.keyEventArgs=e;break;case"ctrlA":t.allowMultiSelection&&t.selectAll(!0)}})},s.prototype.keyActionHandler=function(e){var t=this,i={cancel:!1,event:e};this.trigger("keyPress",i,function(i){if(!i.cancel)switch(e.action){case"escape":case"altUp":t.isPopupOpen&&t.hidePopup();break;case"shiftTab":t.isPopupOpen&&t.hidePopup(),t.inputFocus&&t.onFocusOut();break;case"altDown":t.isPopupOpen||(t.showPopup(),e.preventDefault());break;case"moveDown":t.showSelectAll&&t.showCheckBox&&t.checkAllParent.focus();break;case"tab":!t.isPopupOpen&&t.inputFocus&&t.onFocusOut()}})},s.prototype.checkAllAction=function(e){var i,s=this,l={cancel:!1,event:e};this.trigger("keyPress",l,function(l){if(!l.cancel)switch(e.action){case"space":s.clickHandler(e);break;case"moveDown":e.preventDefault(),(i=s.treeObj.element.querySelector('li[tabindex="0"]')||s.treeObj.element.querySelector("li")).focus(),t.addClass([i],["e-node-focus"])}})},s.prototype.windowResize=function(){this.popupObj&&(this.popupObj.setProperties({width:this.setWidth()}),this.popupObj.refreshPosition())},s.prototype.resetValueHandler=function(e){var i=t.closest(this.inputWrapper,"form");i&&e.target===i&&(this.isDynamicChange=!0,this.setProperties({value:null},!0),this.resetValue(!0),this.isDynamicChange=!1)},s.prototype.getAriaAttributes=function(){return{}},s.prototype.updateOverFlowView=function(){if(this.overFlowWrapper.classList.remove("e-total-count"),t.removeClass([this.overFlowWrapper],X),this.value&&this.value.length){var e="",i=void 0,s=void 0,l=void 0,n=1,a=void 0,r=void 0,o=0;this.overFlowWrapper.innerHTML="";var h={overflowCountTemplate:"+${count} more..",totalCountTemplate:"${count} selected"};this.l10n=new t.L10n(this.getLocaleName(),h,this.locale);var u=this.l10n.getConstant("overflowCountTemplate"),p=this.l10n.getConstant("totalCountTemplate"),d=this.createElement("span",{className:"e-remain"});this.overFlowWrapper.appendChild(d),d.innerText=u.replace("${count}",this.value.length.toString());var c=d.offsetWidth;if(t.remove(d),this.showDropDownIcon&&(o=t.select(".e-ddt-icon",this.inputWrapper).offsetWidth),!t.isNullOrUndefined(this.value))if("Box"!==this.mode){if(this.valueTemplate)return r=this.updateChipAndValueTemplate(!1,o,c),this.checkRemainingTemplate(r,d,u,p),void this.updateDelimMode();for(var m=0;!t.isNullOrUndefined(this.value[m]);m++){if(e+=0===m?"":this.delimiterChar+" ",s=this.getOverflowVal(m),e+=s,s=this.overFlowWrapper.innerHTML,this.enableHtmlSanitizer?this.overFlowWrapper.innerText=t.SanitizeHtmlHelper.sanitize(e):this.overFlowWrapper.innerHTML=e,a=this.overFlowWrapper.offsetWidth,i=this.inputWrapper.offsetWidth,a+o+this.clearIconWidth>i){for(void 0!==l&&""!==l&&(s=l,m=n+1),this.overFlowWrapper.innerHTML=s,r=this.value.length-m,a=this.overFlowWrapper.offsetWidth;a+c+o+this.clearIconWidth>=i&&0!==a&&""!==this.overFlowWrapper.innerHTML;){var f=this.overFlowWrapper.innerHTML.split(this.delimiterChar);f.pop(),this.overFlowWrapper.innerHTML=f.join(this.delimiterChar),r++,a=this.overFlowWrapper.offsetWidth}break}a+c+o+this.clearIconWidth<=i?(l=e,n=m):0===m&&(l="",n=-1)}}else r=this.updateChipAndValueTemplate(!0,o,c);this.checkRemainingTemplate(r,d,u,p)}else this.overFlowWrapper.innerHTML="",t.addClass([this.overFlowWrapper],X);this.updateDelimMode()},s.prototype.checkRemainingTemplate=function(e,i,s,l){e>0&&this.overFlowWrapper.appendChild(this.updateRemainTemplate(i,e,s,l)),"Box"!==this.mode||this.overFlowWrapper.classList.contains("e-total-count")||t.addClass([i],"e-wrap-count")},s.prototype.updateChipAndValueTemplate=function(e,i,s){void 0===i&&(i=0);var l,n,a,r,o,h="",u=1;t.addClass([e?this.chipWrapper:this.valueTemplateContainer],X);for(var p=(e?this.chipWrapper:this.valueTemplateContainer).cloneNode(!0),d=e?t.selectAll(".e-chips",p):Array.prototype.slice.call(p.children),c=0;c<d.length;c++){if(n=this.overFlowWrapper.innerHTML,this.overFlowWrapper.appendChild(d[c]),h=this.overFlowWrapper.innerHTML,r=this.overFlowWrapper.offsetWidth,l=this.inputWrapper.offsetWidth,r+i+this.clearIconWidth>l){for(void 0!==a&&""!==a&&(n=a,c=u+1),this.overFlowWrapper.innerHTML=n,o=this.value.length-c,r=this.overFlowWrapper.offsetWidth;r+s+i+this.clearIconWidth>=l&&0!==r&&""!==this.overFlowWrapper.innerHTML;)this.overFlowWrapper.removeChild(this.overFlowWrapper.lastChild),o++,r=this.overFlowWrapper.offsetWidth;break}r+s+i+this.clearIconWidth<=l?(a=h,u=c):0===c&&(a="",u=-1)}return o},s.prototype.updateRemainTemplate=function(e,i,s,l){return this.overFlowWrapper.firstChild&&3===this.overFlowWrapper.firstChild.nodeType&&""===this.overFlowWrapper.firstChild.nodeValue&&this.overFlowWrapper.removeChild(this.overFlowWrapper.firstChild),e.innerHTML="",e.innerText=this.overFlowWrapper.firstChild&&(3===this.overFlowWrapper.firstChild.nodeType||"Box"===this.mode||this.valueTemplateContainer)?s.replace("${count}",i.toString()):l.replace("${count}",i.toString()),!this.overFlowWrapper.firstChild||3!==this.overFlowWrapper.firstChild.nodeType&&"Box"!==this.mode?(t.addClass([this.overFlowWrapper],"e-total-count"),t.removeClass([this.overFlowWrapper],"e-wrap-count")):t.removeClass([this.overFlowWrapper],"e-total-count"),e},s.prototype.getOverflowVal=function(e){var i,s=this.getSelectedData(this.value[parseInt(e.toString(),10)]),l=this.treeObj.getNode(this.value[e]);return i=t.getValue(this.treeSettings.loadOnDemand?this.fields.text:"text",s),t.isNullOrUndefined(i)&&!t.isNullOrUndefined(l.text)&&(i=l.text.toString()),i},s.prototype.updateDelimMode=function(){"Box"!==this.mode?t.select(".e-remain",this.overFlowWrapper)&&!this.overFlowWrapper.classList.contains("e-total-count")?(t.addClass([this.overFlowWrapper],"e-wrap-count"),t.addClass([this.overFlowWrapper],Z)):(this.overFlowWrapper.classList.remove("e-wrap-count"),t.removeClass([this.overFlowWrapper],"e-wrap-count")):t.select(".e-remain",this.overFlowWrapper)&&this.overFlowWrapper.classList.remove("e-wrap-count")},s.prototype.createHiddenElement=function(){this.allowMultiSelection||this.showCheckBox?this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",class:"e-ddt-hidden",tabindex:"-1",multiple:"","aria-label":this.getModuleName()}}):this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",tabindex:"-1",class:"e-ddt-hidden","aria-label":this.getModuleName()}}),t.prepend([this.hiddenElement],this.inputWrapper),this.validationAttribute()},s.prototype.createClearIcon=function(){this.overAllClear=this.createElement("span",{className:"e-clear-icon e-icons"}),t.addClass([this.overAllClear],X),t.removeClass([this.inputWrapper],_),this.showClearButton&&this.inputWrapper.insertBefore(this.overAllClear,this.inputObj.buttons[0])},s.prototype.validationAttribute=function(){var e=this.inputEle.getAttribute("name")?this.inputEle.getAttribute("name"):this.inputEle.getAttribute("id");this.hiddenElement.setAttribute("name",e),this.inputEle.removeAttribute("name");for(var t=["required","aria-required","form"],i=0;i<t.length;i++){var s=this.inputEle.getAttribute(t[i]);s&&(this.hiddenElement.setAttribute(t[i],s),this.inputEle.removeAttribute(t[i]))}},s.prototype.createChip=function(){this.inputWrapper.contains(this.chipWrapper)||(this.chipWrapper=this.createElement("span",{className:"e-chips-wrapper"}),this.chipCollection=this.createElement("span",{className:"e-chips-collection"}),this.chipWrapper.appendChild(this.chipCollection),this.inputWrapper.insertBefore(this.chipWrapper,this.hiddenElement),t.addClass([this.inputWrapper],G),this.getValidMode()&&null!==this.value&&this.value&&0!==this.value.length?t.addClass([this.inputEle],Q):(null===this.value||this.value&&0===this.value.length||this.checkWrapper)&&t.addClass([this.chipWrapper],X))},s.prototype.getValidMode=function(){return!(!this.allowMultiSelection&&!this.showCheckBox)&&("Box"===this.mode||!("Default"!==this.mode||!this.inputFocus))},s.prototype.createSelectAllWrapper=function(){this.checkAllParent=this.createElement("div",{className:"e-selectall-parent",attrs:{tabindex:"0"}}),this.selectAllSpan=this.createElement("span",{className:"e-all-text"}),this.selectAllSpan.textContent="";var e=t.closest(this.element,".e-bigger"),i=t.isNullOrUndefined(e)?"":"e-small";this.checkBoxElement=r.createCheckBox(this.createElement,!0,{cssClass:i}),this.checkBoxElement.setAttribute("role","checkbox"),this.checkAllParent.appendChild(this.checkBoxElement),this.checkAllParent.appendChild(this.selectAllSpan),this.setLocale(),t.EventHandler.add(this.checkAllParent,"mouseup",this.clickHandler,this),this.wireCheckAllWrapperEvents()},s.prototype.clickHandler=function(e){var i;if(i=e.currentTarget&&e.currentTarget.classList.contains("e-selectall-parent")?e.currentTarget.firstElementChild.lastElementChild:e.target,this.checkWrapper=t.closest(i,".e-checkbox-wrapper"),!t.isNullOrUndefined(this.checkWrapper)){this.isClicked=!0;var s=t.select(".e-frame",this.checkWrapper);this.changeState(this.checkWrapper,s.classList.contains(Y)?"uncheck":"check",e),this.isClicked=!1}e.preventDefault()},s.prototype.changeState=function(e,i,s){var l,n=e.getElementsByClassName("e-frame")[0];"check"!==i||n.classList.contains(Y)?"uncheck"===i&&n.classList.contains(Y)&&(n.classList.remove(Y),l="false",this.isReverseUpdate||(this.treeObj.uncheckAll(),this.changeOnBlur||this.triggerChangeEvent(s)),this.setLocale(!1)):(n.classList.add(Y),l="true",this.isReverseUpdate||(this.setOldValue(),this.isCheckAllCalled=!0,this.treeObj.checkAll(),this.changeOnBlur||this.triggerChangeEvent(s)),this.setLocale(!0)),this.setMultiSelect(),this.ensurePlaceHolder(),l="check"===i?"true":"false",t.isNullOrUndefined(l)||e.parentElement.setAttribute("aria-checked",l)},s.prototype.setLocale=function(e){if(this.selectAllSpan)if("Select All"!==this.selectAllText||"Unselect All"!==this.unSelectAllText){var i=e?this.unSelectAllText:this.selectAllText;this.selectAllSpan.textContent="";for(var s=0,l=t.compile(i)({},this,e?"unSelectAllText":"selectAllText",null,!this.isStringTemplate);s<l.length;s++){var n=l[s];this.selectAllSpan.textContent=n.textContent}}else this.selectAllSpan.textContent=e?this.unSelectAllText:this.selectAllText},s.prototype.setAttributes=function(){this.inputEle.setAttribute("tabindex","-1"),this.inputEle.setAttribute("aria-label",this.getModuleName());var e=this.element.getAttribute("id");this.hiddenElement.id=e+"_hidden",this.inputWrapper.setAttribute("tabindex",this.inputWrapper.classList.contains("e-disabled")?"-1":"0"),this.inputWrapper.setAttribute("aria-label",this.getModuleName()),t.attributes(this.inputWrapper,this.getAriaAttributes())},s.prototype.setHTMLAttributes=function(){if(Object.keys(this.htmlAttributes).length)for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i=t[e];if("class"===i)this.inputWrapper.classList.add(this.htmlAttributes[""+i]);else if("disabled"===i)this.setProperties({enabled:!1},!0),this.setEnable();else if("readonly"===i)this.setProperties({readonly:!0},!0),this.dataBind();else if("style"===i)this.inputWrapper.style.cssText=this.htmlAttributes[""+i];else{var s=["title","id","placeholder","aria-placeholder","role","autocorrect","autocomplete","autocapitalize","spellcheck","minlength","maxlength"],l=["name","required"];0===i.indexOf("data")||l.indexOf(i)>-1?this.hiddenElement.setAttribute(i,this.htmlAttributes[""+i]):s.indexOf(i)>-1&&"placeholder"===i?a.Input.setPlaceholder(this.htmlAttributes[""+i],this.inputEle):this.inputEle.setAttribute(i,this.htmlAttributes[""+i])}}},s.prototype.updateDataAttribute=function(){for(var e=this.htmlAttributes,i=["class","style","id","type"],s={},l=0;l<this.element.attributes.length;l++)-1===i.indexOf(this.element.attributes[l].name)&&"readonly"!==this.element.attributes[l].name&&(s[this.element.attributes[l].name]=this.element.getAttribute(this.element.attributes[l].name));t.extend(s,e,s),this.setProperties({htmlAttributes:s},!0)},s.prototype.showOverAllClear=function(){this.enabled&&!this.readonly&&this.overAllClear&&(!!this.value&&!!this.value.length&&this.showClearButton?(t.removeClass([this.overAllClear],X),t.addClass([this.inputWrapper],_)):(t.addClass([this.overAllClear],X),t.removeClass([this.inputWrapper],_)))},s.prototype.setTreeValue=function(){if(null!==this.value&&0!==this.value.length){var e=void 0;if(this.showCheckBox||this.allowMultiSelection){for(var i=this.value.length-1;i>=0;i--)e=this.treeObj.getTreeData(this.value[i])[0],t.isNullOrUndefined(e)&&this.value.splice(i,1);0!==this.value.length&&this.setValidValue()}else e=this.treeObj.getTreeData(this.value[0])[0],t.isNullOrUndefined(e)?this.setProperties({value:this.currentValue},!0):(this.setProperties({text:e[this.fields.text]},!0),this.setValidValue())}},s.prototype.setTreeText=function(){if((null===this.value||this.isInitialized)&&null!==this.text){var e=void 0,i=[];if(this.showCheckBox||this.allowMultiSelection){for(var s=this.text.split(this.delimiterChar),l=0;l<s.length;l++)e=this.getItems(s[l]),t.isNullOrUndefined(e)||i.push(e[this.fields.value].toString());0!==i.length?(this.setOldValue(),this.setProperties({value:i},!0),this.setValidValue()):this.setProperties({text:this.currentText},!0)}else e=this.getItems(this.text),t.isNullOrUndefined(e)?this.setProperties({text:this.currentText},!0):(this.setOldValue(),this.setProperties({value:[e[this.fields.value].toString()]},!0),this.setValidValue())}},s.prototype.setSelectedValue=function(){null!==this.value&&0!==this.value.length||this.isInitialized||(this.setOldValue(),this.treeObj.selectedNodes.length>0&&!this.showCheckBox?(this.setProperties({value:this.treeObj.selectedNodes},!0),this.allowMultiSelection&&this.updateMode()):this.showCheckBox&&this.treeObj.checkedNodes&&this.treeObj.checkedNodes.length>0&&(this.setProperties({value:this.treeObj.checkedNodes},!0),t.setValue("selectedNodes",[],this.treeObj),this.treeObj.dataBind(),this.updateMode()),this.updateSelectedValues(),this.currentText=this.text,this.currentValue=this.value)},s.prototype.setValueTemplate=function(){var e=this;if(this.valueTemplate){var t=this.initializeValueTemplate();this.getValueTemplateElement(this.value[0],t),this.hasTemplate&&this.portals&&(this.treeObj.portals&&(this.portals=this.portals.concat(this.treeObj.portals.filter(function(t){return!e.portals.includes(t)}))),this.isReact&&this.renderReactTemplates(this.reactCallBack)),this.showOrHideValueTemplate(!0)}},s.prototype.getValueTemplateElement=function(e,i){var s=i(this.getNodeData(e,this.isFilteredData?this.treeData:this.treeItems),this,"valueTemplate",this.element.id+"valueTemplate",this.isStringTemplate,void 0,this.valueTemplateContainer);s&&(s=Array.prototype.slice.call(s),t.append(s,this.valueTemplateContainer))},s.prototype.setValidValue=function(){var e=this;if(this.showCheckBox||this.allowMultiSelection)this.showCheckBox?(this.value.length!==this.treeObj.checkedNodes.length||this.value.filter(function(t){return-1===e.treeObj.checkedNodes.indexOf(t)}).length>0||this.treeSettings.autoCheck)&&(this.treeObj.checkedNodes=this.value.slice(),this.treeObj.dataBind(),this.setMultiSelect()):(this.treeObj.selectedNodes=this.value.slice(),this.selectedText=[],this.updateSelectedValues()),this.treeObj.dataBind();else{a.Input.setValue(this.text,this.inputEle,this.floatLabelType),this.setValueTemplate();var s=this.value[0].toString();this.treeObj.selectedNodes[0]!==s&&(t.setValue("selectedNodes",[s],this.treeObj),this.fields.dataSource instanceof i.DataManager&&this.updateSelectedValues())}this.currentText=this.text,this.currentValue=this.value,!t.isNullOrUndefined(this.value)&&this.value.length>0&&!t.isNullOrUndefined(this.currentText)&&this.inputWrapper.setAttribute("aria-label",this.currentText.replace(/,/g,", ")),this.isInitialized&&this.triggerChangeEvent()},s.prototype.getItems=function(e){var i;if(1===this.treeDataType)for(var s=0;s<this.treeItems.length;s++){var l=t.getValue(this.fields.text,this.treeItems[parseInt(s.toString(),10)]);if(!t.isNullOrUndefined(this.treeItems[s])&&!t.isNullOrUndefined(l)&&l===e){i=this.treeItems[s];break}}else i=this.getNestedItems(this.treeItems,this.fields,e);return i},s.prototype.getNestedItems=function(e,s,l){for(var n,a=0,r=e.length;a<r;a++){var o=t.getValue(this.fields.text,e[parseInt(a.toString(),10)]);if(e[a]&&o&&o.toString()===l)return e[a];if("string"!=typeof s.child||t.isNullOrUndefined(t.getValue(s.child,e[a]))){if(this.fields.dataSource instanceof i.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[a]))){if(void 0!==(n=this.getNestedItems(t.getValue("child",e[parseInt(a.toString(),10)]),this.getChildType(s),l)))break}}else{var h=t.getValue(s.child,e[parseInt(a.toString(),10)]);if(void 0!==(n=this.getNestedItems(h,this.getChildType(s),l)))break}}return n},s.prototype.getChildType=function(e){return"string"==typeof e.child||t.isNullOrUndefined(e.child)?e:e.child},s.prototype.renderTree=function(){this.treeObj=new o.TreeView({fields:this.getTreeFields(this.fields),enableRtl:this.enableRtl,nodeSelected:this.onNodeSelected.bind(this),nodeChecked:this.onNodeChecked.bind(this),nodeChecking:this.beforeCheck.bind(this),nodeExpanded:this.onNodeExpanded.bind(this),actionFailure:this.onActionFailure.bind(this),nodeClicked:this.onNodeClicked.bind(this),dataBound:this.OnDataBound.bind(this),allowMultiSelection:this.allowMultiSelection,enableHtmlSanitizer:this.enableHtmlSanitizer,showCheckBox:this.showCheckBox,autoCheck:this.treeSettings.autoCheck,sortOrder:this.sortOrder,expandOn:this.treeSettings.expandOn,loadOnDemand:this.treeSettings.loadOnDemand,nodeSelecting:this.onBeforeSelect.bind(this),nodeTemplate:this.itemTemplate,checkDisabledChildren:this.treeSettings.checkDisabledChildren,checkOnClick:!0}),this.treeObj.root=this.root?this.root:this,this.treeObj.appendTo(this.tree)},s.prototype.renderPopup=function(){var e=this;this.isFilteredData&&(this.treeObj.element.classList.remove("e-filtering"),this.filterObj.value="",this.treeObj.fields=this.getTreeFields(this.fields),this.isFilterRestore=!0,this.isFilteredData=!1,this.hideCheckAll(!1));var i=!1,s={cancel:!1};this.trigger("beforeOpen",s,function(s){if(s.cancel?i=!0:(t.addClass([e.inputWrapper],["e-icon-anim"]),e.isReact&&e.isFilterRestore&&e.treeObj.refresh(),e.isFirstRender?(e.popupEle=e.createElement("div",{id:e.element.id+"_options",className:"e-ddt e-popup "+(null!=e.cssClass?e.cssClass:"")}),e.popupEle.setAttribute("role","region"),e.popupEle.setAttribute("aria-label",e.element.id),document.body.appendChild(e.popupEle),e.createPopup(e.popupEle)):(e.popupEle=e.popupObj.element,e.isReact&&e.isFilterRestore&&(e.isFilteredData=!0,e.popupEle.removeChild(e.filterContainer)))),(e.isFirstRender&&!i||e.isFilteredData)&&(e.isFilteredData=!1,t.prepend([e.popupDiv],e.popupEle),t.removeClass([e.popupDiv],"e-ddt-icon-hide"),e.allowFiltering&&e.renderFilter(),e.showCheckBox&&e.showSelectAll&&!e.popupDiv.classList.contains($)&&(e.createSelectAllWrapper(),e.popupEle.insertBefore(e.checkAllParent,e.popupDiv)),e.headerTemplate&&e.setHeaderTemplate(),e.footerTemplate&&e.setFooterTemplate(),e.isFirstRender=!1,e.hasTemplate&&e.portals&&(e.treeObj.portals&&(e.portals=e.portals.concat(e.treeObj.portals.filter(function(t){return!e.portals.includes(t)}))),e.isReact&&e.renderReactTemplates(e.reactCallBack))),!i){if(t.attributes(e.inputEle,{"aria-expanded":"true"}),e.popupObj.show(null,1e3===e.zIndex?e.inputEle:null),t.removeClass([e.popupEle],"e-ddt-icon-hide"),e.updatePopupHeight(),e.popupObj.refreshPosition(),e.checkCollision(e.popupEle),!e.showSelectAll&&!e.allowFiltering&&!e.popupDiv.classList.contains($)&&e.treeItems.length>0){if(r=null!=e.value&&null!=e.text?e.treeObj.element.querySelector('[data-uid="'+e.value[e.value.length-1]+'"]'):null)e.treeObj.element.querySelector("li").setAttribute("tabindex","-1"),r.setAttribute("tabindex","0");else{a=e.treeObj.element.querySelector(".e-node-focus");r=e.treeObj.element.querySelector('li[tabindex="0"]:not(.e-disable)')||e.treeObj.element.querySelector("li:not(.e-disable)"),e.removeFocus(r,a)}e.updateFocus(r)}if(e.treeObj.checkedNodes.length>0&&!e.isFilterRestore){var l=e.treeObj.element.querySelectorAll("li:not(.e-disable)");if(e.treeObj.element.querySelectorAll("li[aria-checked=true]").length===l.length&&e.checkBoxElement){var n=t.closest(e.checkBoxElement,".e-checkbox-wrapper");e.changeState(n,"check"),e.checkSelectAll=!1}}if(e.showSelectAll&&!e.allowFiltering){var a=e.treeObj.element.querySelector(".e-node-focus"),r=e.popupEle.querySelector(".e-selectall-parent");e.removeFocus(r,a),e.updateFocus(r)}if(e.allowFiltering){r=e.treeObj.element.querySelector("li.e-node-focus");t.isNullOrUndefined(r)||t.removeClass([r],"e-node-focus"),t.removeClass([e.inputWrapper],[J]),e.filterObj.element.focus()}var o={popup:e.popupObj};e.trigger("open",o)}})},s.prototype.checkCollision=function(e){n.isCollide(e).length>0&&(e.style.marginTop=-parseInt(getComputedStyle(e).marginTop,10)+"px"),this.popupObj.resolveCollision()},s.prototype.removeFocus=function(e,i){i&&i!==e&&(i.setAttribute("tabindex","-1"),t.removeClass([i],"e-node-focus"))},s.prototype.updateFocus=function(e){t.isNullOrUndefined(e)||(e.focus(),t.addClass([e],["e-node-focus"]))},s.prototype.reactCallBack=function(){t.isNullOrUndefined(this.popupObj)||(this.updatePopupHeight(),this.popupObj.refreshPosition())},s.prototype.updatePopupHeight=function(){if(!this.isFirstRender){var e=this.getHeight();if(this.popupEle.style.maxHeight=e,this.allowFiltering){i=Math.round(this.filterContainer.getBoundingClientRect().height);e=t.formatUnit(parseInt(e,10)-i+"px")}if(this.headerTemplate){i=Math.round(this.header.getBoundingClientRect().height);e=t.formatUnit(parseInt(e,10)-i+"px")}if(this.showCheckBox&&this.showSelectAll&&!this.popupDiv.classList.contains($)){i=Math.round(this.checkAllParent.getBoundingClientRect().height);e=t.formatUnit(parseInt(e,10)-i+"px")}if(this.footerTemplate){var i=Math.round(this.footer.getBoundingClientRect().height);e=t.formatUnit(parseInt(e,10)-i+"px")}var s=parseInt(window.getComputedStyle(this.popupEle).borderTopWidth,10);s+=parseInt(window.getComputedStyle(this.popupEle).borderBottomWidth,10),e=t.formatUnit(parseInt(e,10)-s+"px"),this.popupDiv.style.maxHeight=e}},s.prototype.createPopup=function(e){var i=this;this.isFirstRender&&(this.popupObj=new n.Popup(e,{width:this.setWidth(),targetType:"relative",collision:{X:"flip",Y:"flip"},relateTo:this.inputWrapper,zIndex:this.zIndex,enableRtl:this.enableRtl,position:{X:"left",Y:"bottom"},close:function(){i.isPopupOpen=!1},open:function(){document.addEventListener("mousedown",i.documentClickContext),i.isPopupOpen=!0},targetExitViewport:function(){t.Browser.isDevice||i.hidePopup()}}))},s.prototype.setElementWidth=function(e){var i=this.inputWrapper;t.isNullOrUndefined(e)||("number"==typeof e?i.style.width=t.formatUnit(e):"string"==typeof e&&(i.style.width=e.match(/px|%|em/)?e:t.formatUnit(e)))},s.prototype.setWidth=function(){var e=t.formatUnit(this.popupWidth);return e.indexOf("%")>-1?e=(this.inputWrapper.offsetWidth*parseFloat(e)/100).toString()+"px":"string"==typeof this.popupWidth&&(e=this.popupWidth.match(/px|em/)?this.popupWidth:e),e},s.prototype.getHeight=function(){var e=t.formatUnit(this.popupHeight);return e.indexOf("%")>-1?e=(document.documentElement.clientHeight*parseFloat(e)/100).toString()+"px":"string"==typeof this.popupHeight&&(e=this.popupHeight.match(/px|em/)?this.popupHeight:e),e},s.prototype.onDocumentClick=function(e){var i=e.target,s=t.closest(i,".e-list-parent"),l=t.closest(i,".e-filter-wrap"),n=t.closest(i,".e-ddt-header"),a=t.closest(i,".e-ddt-footer"),r=!!i.classList.contains("e-dropdown")||(t.matches(i,".e-ddt .e-popup")||t.matches(i,".e-ddt .e-treeview"));this.isPopupOpen&&(!t.isNullOrUndefined(this.inputWrapper)&&this.inputWrapper.contains(i)||s||r||n||a)||(this.allowMultiSelection||this.showCheckBox)&&(this.isPopupOpen&&i.classList.contains("e-chips-close")||this.isPopupOpen&&(i.classList.contains("e-selectall-parent")||i.classList.contains("e-all-text")||i.classList.contains("e-frame")))?(this.isDocumentClick=!1,e.preventDefault()):t.isNullOrUndefined(this.inputWrapper)||this.inputWrapper.contains(i)||!this.inputFocus||l||this.focusOut(e)},s.prototype.onActionFailure=function(e){this.trigger("actionFailure",e),this.l10nUpdate(!0),t.addClass([this.popupDiv],$)},s.prototype.OnDataBound=function(e){this.treeItems=e.data,this.treeItems.length<=0?(this.l10nUpdate(),t.addClass([this.popupDiv],$),this.hideCheckAll(!0)):this.popupDiv.classList.contains($)&&this.treeItems.length>=1&&(t.removeClass([this.popupDiv],$),this.hideCheckAll(!1)),this.isFilteredData||(this.treeDataType=this.getTreeDataType(this.treeItems,this.fields)),this.isFirstRender&&this.isRemoteData&&(this.setTreeValue(),this.setTreeText(),this.updateHiddenValue(),this.setSelectedValue(),this.wrapText||this.updateView(),this.treeObj.element.focus(),this.isInitialized=!0);var i={data:e.data};this.trigger("dataBound",i),null===this.filterObj&&(this.isFilteredData=!1),this.isFilteredData&&this.treeObj.expandAll(),this.isFilterRestore&&(this.restoreFilterSelection(),this.showSelectAll||(this.isFilterRestore=!1))},s.prototype.restoreFilterSelection=function(){this.treeObj.checkedNodes&&(this.treeObj.checkedNodes=[]);var e=Array.isArray(this.value)?this.value:[];this.showCheckBox?this.treeObj.checkedNodes=e:this.treeObj.selectedNodes=e},s.prototype.setCssClass=function(e,i){var s=this.popupObj?[this.inputWrapper,this.popupObj.element]:[this.inputWrapper];t.isNullOrUndefined(i)||""===i||t.removeClass(s,i.split(" ")),t.isNullOrUndefined(e)||""===e||t.addClass(s,e.split(" "))},s.prototype.setEnableRTL=function(e){e?this.inputWrapper.classList.add("e-rtl"):this.inputWrapper.classList.remove("e-rtl"),this.popupObj&&(this.popupObj.enableRtl=e,this.popupObj.dataBind()),this.treeObj&&(this.treeObj.enableRtl=e,this.treeObj.dataBind())},s.prototype.setEnable=function(){a.Input.setEnabled(this.enabled,this.inputEle),this.enabled?(t.removeClass([this.inputWrapper],"e-disabled"),this.inputEle.setAttribute("aria-disabled","false"),this.inputWrapper.setAttribute("aria-disabled","false")):(this.isPopupOpen&&this.hidePopup(),t.addClass([this.inputWrapper],"e-disabled"),this.inputWrapper&&this.inputWrapper.classList.contains(J)&&t.removeClass([this.inputWrapper],[J]),this.inputEle.setAttribute("aria-disabled","true"),this.inputWrapper.setAttribute("aria-disabled","true"))},s.prototype.cloneFields=function(e){return{dataSource:e.dataSource,value:e.value,text:e.text,parentValue:e.parentValue,child:this.cloneChildField(e.child),hasChildren:e.hasChildren,expanded:e.expanded,iconCss:e.iconCss,imageUrl:e.imageUrl,htmlAttributes:e.htmlAttributes,query:e.query,selected:e.selected,selectable:e.selectable,tableName:e.tableName,tooltip:e.tooltip}},s.prototype.cloneChildField=function(e){return"string"==typeof e?e:{dataSource:e.dataSource,value:e.value,text:e.text,parentValue:e.parentValue,child:e.child?this.cloneChildField(e.child):null,hasChildren:e.hasChildren,expanded:e.expanded,iconCss:e.iconCss,imageUrl:e.imageUrl,htmlAttributes:e.htmlAttributes,query:e.query,selected:e.selected,selectable:e.selectable,tableName:e.tableName,tooltip:e.tooltip}},s.prototype.getTreeFields=function(e){return{dataSource:e.dataSource,id:e.value,text:e.text,parentID:e.parentValue,child:this.getTreeChildren(e.child),hasChildren:e.hasChildren,expanded:e.expanded,iconCss:e.iconCss,imageUrl:e.imageUrl,isChecked:e.selected,htmlAttributes:e.htmlAttributes,query:e.query,selectable:e.selectable,selected:e.selected,tableName:e.tableName,tooltip:e.tooltip}},s.prototype.getTreeChildren=function(e){if("string"==typeof e)return e;if(!t.isNullOrUndefined(e)){var i=e=this.getActualProperties(e);return e.value&&(i.id=e.value),e.parentValue&&(i.parentID=e.parentValue),e.child&&(i.child=this.getTreeChildren(e.child)),e.selected&&this.showCheckBox&&(i.isChecked=e.selected),i}return null},s.prototype.getTreeDataType=function(e,s){if(this.fields.dataSource instanceof i.DataManager){for(l=0;l<e.length;l++)if("string"==typeof s.child&&t.isNullOrUndefined(t.getValue(s.child,e[l])))return 1;return 2}t.isNullOrUndefined(this.fields.dataSource)&&(this.fields.dataSource=[]);for(var l=0,n=this.fields.dataSource.length;l<n;l++){if("string"==typeof s.child&&!t.isNullOrUndefined(t.getValue(s.child,this.fields.dataSource[l])))return 2;if(!t.isNullOrUndefined(t.getValue(s.parentValue,this.fields.dataSource[l]))||!t.isNullOrUndefined(t.getValue(s.hasChildren,this.fields.dataSource[l])))return 1}return 1},s.prototype.setFields=function(){this.resetValue(),this.hasTemplate&&this.updateTemplate(),this.treeObj.fields=this.getTreeFields(this.fields),this.setProperties({value:this.oldValue},!0),this.treeObj.dataBind(),this.updateValue(this.value)},s.prototype.getEventArgs=function(e){var t,i=e.data,s=e.nodeData;return this.showCheckBox&&("check"===e.action?t="select":"uncheck"===e.action&&(t="un-select")),{action:this.showCheckBox?t:e.action,isInteracted:!!this.isClicked||e.isInteracted,item:e.node,itemData:this.showCheckBox?i[0]:s}},s.prototype.onBeforeSelect=function(e){e.isInteracted&&(this.setOldValue(),null===this.value&&this.setProperties({value:[]},!0))},s.prototype.updateHiddenValue=function(){this.allowMultiSelection||this.showCheckBox||(this.value&&this.value.length?this.hiddenElement.innerHTML='<option selected value ="'+this.value[0]+'">'+this.text+"</option>":this.hiddenElement.innerHTML="")},s.prototype.onNodeSelected=function(e){if(!this.showCheckBox){var i=this.getEventArgs(e);this.trigger("select",i);var s;if(e.isInteracted){var l=t.getValue("id",e.nodeData).toString();this.allowMultiSelection?this.allowMultiSelection&&this.setMultiSelect():(this.hiddenElement.innerHTML="",this.setProperties({value:[l]},!0),s=this.itemTemplate?t.getValue("text",this.treeObj.getNode(l)):t.getValue("text",e.nodeData).toString(),a.Input.setValue(s,this.inputEle,this.floatLabelType),this.setProperties({text:s},!0),this.currentText=this.text,this.currentValue=this.value,this.setValueTemplate(),!t.isNullOrUndefined(this.value)&&this.value.length>0&&this.inputWrapper.setAttribute("aria-label",e.nodeData.text.toString()),t.attributes(this.inputWrapper,{"aria-describedby":this.element.id}),t.attributes(this.inputWrapper,{"aria-activedescendant":l.toString()}),this.updateHiddenValue(),this.showOverAllClear(),this.hidePopup(),this.isNodeSelected=!0)}this.isValueChange&&!this.changeOnBlur&&(this.triggerChangeEvent(this.keyEventArgs),this.isValueChange=!1)}},s.prototype.onNodeClicked=function(e){!this.changeOnBlur&&this.isNodeSelected&&(this.triggerChangeEvent(e.event),this.isNodeSelected=!1);var t=e.event.target;(t.classList.contains("e-fullrow")||t.classList.contains("e-list-text"))&&this.showCheckBox&&(this.setMultiSelect(),this.ensurePlaceHolder()),this.changeOnBlur||!this.allowMultiSelection&&!this.showCheckBox||this.triggerChangeEvent(e.event)},s.prototype.onNodeChecked=function(e){var i=this.getEventArgs(e);if(this.trigger("select",i),this.isFilteredData&&"uncheck"===e.action){var s=t.getValue("id",e.data[0]).toString();this.removeSelectedData(s,!0)}if((!this.isChipDelete&&e.isInteracted||!this.isFilteredData&&"check"===e.action&&this.isFromFilterChange)&&(this.setMultiSelect(),this.ensurePlaceHolder()),this.showSelectAll&&this.checkBoxElement){var l=this.treeObj.element.querySelectorAll("li:not(.e-disable)"),n=this.treeObj.element.querySelectorAll("li[aria-checked=true]"),a=t.closest(this.checkBoxElement,".e-checkbox-wrapper");a&&"uncheck"===e.action&&(e.isInteracted||0===n.length||!t.isNullOrUndefined(e.data[0])&&"false"===e.data[0].isChecked)||!e.isInteracted&&this.isFilterRestore?(this.isFilterRestore=!1,this.isReverseUpdate=!0,this.changeState(a,"uncheck"),this.isReverseUpdate=!1):a&&"check"===e.action&&n.length===l.length&&(e.isInteracted||this.isCheckAllCalled||!t.isNullOrUndefined(e.data[0])&&"true"===e.data[0].isChecked)&&(this.isReverseUpdate=!0,this.isCheckAllCalled=!1,this.changeState(a,"check"),this.isReverseUpdate=!1)}this.isValueChange&&!this.changeOnBlur&&(this.triggerChangeEvent(this.keyEventArgs),this.isValueChange=!1)},s.prototype.beforeCheck=function(e){e.isInteracted&&this.setOldValue()},s.prototype.onNodeExpanded=function(){if(this.hasTemplate&&this.portals&&this.treeObj.portals){for(var e=0;e<this.treeObj.portals.length;e++)-1===this.portals.indexOf(this.treeObj.portals[e])&&this.portals.push(this.treeObj.portals[e]);this.renderReactTemplates()}},s.prototype.updateClearButton=function(e){if(e?this.inputWrapper.contains(this.overAllClear)?(t.removeClass([this.overAllClear],X),t.addClass([this.inputWrapper],_)):this.inputEle.parentElement.insertBefore(this.overAllClear,this.inputEle.nextSibling):(t.addClass([this.overAllClear],X),t.removeClass([this.inputWrapper],_)),(this.allowMultiSelection||this.showCheckBox)&&this.chipWrapper)for(var i=t.selectAll(".e-chips-close",this.chipWrapper),s=0;s<i.length;s++)e?t.removeClass([i[s]],X):t.addClass([i[s]],X)},s.prototype.updateDropDownIconState=function(e){var i=t.select(".e-ddt-icon",this.inputWrapper);e?(i?t.removeClass([i],X):a.Input.appendSpan(K,this.inputWrapper,this.createElement),t.addClass([this.inputWrapper],"e-show-dd-icon")):(t.addClass([i],X),t.removeClass([this.inputWrapper],"e-show-dd-icon"))},s.prototype.updateMode=function(){if("Custom"!==this.mode)if("Delimiter"!==this.mode){this.inputWrapper.contains(this.chipWrapper)||this.createChip();var e=this.getValidMode();this.chipWrapper.classList.contains(X)&&e?(t.removeClass([this.chipWrapper],X),this.showOrHideValueTemplate(!1,!0),t.addClass([this.inputWrapper],G)):e||(t.addClass([this.chipWrapper],X),t.removeClass([this.inputWrapper],G),this.showOrHideValueTemplate(!0));var i=null!==this.value&&0!==this.value.length;e&&i?t.addClass([this.inputEle],Q):t.removeClass([this.inputEle],Q)}else this.inputEle.classList.contains(Q)&&(t.removeClass([this.inputEle],Q),this.chipWrapper&&(t.addClass([this.chipWrapper],X),t.removeClass([this.inputWrapper],G),this.showOrHideValueTemplate(!0)))},s.prototype.ensurePlaceHolder=function(){(t.isNullOrUndefined(this.value)||null!==this.value&&0===this.value.length)&&(t.removeClass([this.inputEle],Q),this.chipWrapper&&(t.addClass([this.chipWrapper],X),this.showOrHideValueTemplate(!0)))},s.prototype.ensureClearIconPosition=function(e){"Never"!==e&&this.inputWrapper.insertBefore(this.overAllClear,this.inputObj.buttons[0])},s.prototype.setMultiSelectValue=function(e){var i=this;if(this.isFilteredData){var s=t.isNullOrUndefined(this.value)?[]:this.value;s=s.filter(function(e){var t=i.treeObj.getTreeData(e);return!Array.isArray(t)||t.every(function(e){return e.selected})});for(var l=0;l<e.length;l++)(t.isNullOrUndefined(this.value)||-1===this.value.indexOf(e[l]))&&s.push(e[l]);this.setProperties({value:s},!0)}else this.setProperties({value:this.isFromFilterChange&&e&&0===e.length?this.value:e},!0),this.isFromFilterChange=!1,!e||0===e.length||this.showCheckBox||this.ddtCompareValues(this.treeObj.selectedNodes,this.value.slice())||(this.treeObj.selectedNodes=this.value.slice(),this.treeObj.dataBind())},s.prototype.setMultiSelect=function(){if(this.showCheckBox&&!this.isDynamicChange)this.setMultiSelectValue(this.treeObj.checkedNodes.slice());else{var e=this.allowMultiSelection?this.showCheckBox?this.treeObj.checkedNodes:this.treeObj.selectedNodes:this.value?this.showCheckBox?this.value:[this.value[0]]:null;this.setMultiSelectValue(e),this.showCheckBox&&null!==this.value&&(this.treeObj.checkedNodes=this.value,this.treeObj.dataBind())}this.selectedText=[];var i=!!this.allowMultiSelection||!!this.showCheckBox;this.inputWrapper.contains(this.chipWrapper)&&!i&&(t.removeClass([this.inputEle],Q),t.detach(this.chipWrapper)),this.getValidMode()&&null!==this.value&&(t.addClass([this.inputEle],Q),this.chipWrapper&&(t.removeClass([this.chipWrapper],X),this.showOrHideValueTemplate(!1,!0)));var s=!!this.value&&!!this.value.length;this.chipWrapper&&"Box"===this.mode&&!s&&(t.addClass([this.chipWrapper],X),t.removeClass([this.inputEle],Q),this.showOrHideValueTemplate(!0)),this.updateSelectedValues()},s.prototype.getSelectedData=function(e){var i=null;if(this.isFilteredData)for(var s=0;s<this.selectedData.length;s++)if(t.getValue(this.treeSettings.loadOnDemand?this.fields.value:"id",this.selectedData[s]).toString()===e){i=this.selectedData[s];break}return t.isNullOrUndefined(i)&&(i=this.treeSettings.loadOnDemand?this.getNodeData(e,this.treeItems):this.treeObj.getNode(e),t.isNullOrUndefined(i)||this.selectedData.push(i)),i},s.prototype.getNodeData=function(e,i){if(!t.isNullOrUndefined(e)){if(1!==this.treeDataType)return this.getChildNodeData(i,this.fields,e);for(var s=0,l=i.length;s<l;s++){var n=t.getValue(this.fields.value,i[s]);if(!t.isNullOrUndefined(i[s])&&!t.isNullOrUndefined(n)&&n.toString()===e)return i[s]}}},s.prototype.getChildNodeData=function(e,s,l){var n;if(t.isNullOrUndefined(e))return n;for(var a=0,r=e.length;a<r;a++){var o=t.getValue(s.value,e[a]);if(e[a]&&o&&o.toString()===l)return e[a];if("string"!=typeof s.child||t.isNullOrUndefined(t.getValue(s.child,e[a]))){if(this.fields.dataSource instanceof i.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[a]))){if(void 0!==(n=this.getChildNodeData(t.getValue("child",e[a]),this.getChildMapperFields(s),l)))break}}else{var h=t.getValue(s.child,e[a]);if(void 0!==(n=this.getChildNodeData(h,this.getChildMapperFields(s),l)))break}}return n},s.prototype.getChildMapperFields=function(e){return"string"==typeof e.child||t.isNullOrUndefined(e.child)?e:e.child},s.prototype.removeSelectedData=function(e,i){var s=t.isNullOrUndefined(this.value)?[]:this.value.slice();s.splice(s.indexOf(e),1),this.setProperties({value:s},i);for(var l=0;l<this.selectedData.length;l++)if(t.getValue(this.treeSettings.loadOnDemand?this.fields.value:"id",this.selectedData[l]).toString()===e){this.selectedData.splice(l,1);break}},s.prototype.initializeValueTemplate=function(){if(!this.valueTemplate)return null;if(this.isReact&&!t.isNullOrUndefined(this.valueTemplateContainer))t.detach(this.valueTemplateContainer),this.valueTemplateContainer=null;else if(this.valueTemplateContainer)for(;this.valueTemplateContainer.firstChild;)this.valueTemplateContainer.removeChild(this.valueTemplateContainer.firstChild);return t.isNullOrUndefined(this.valueTemplateContainer)&&(this.valueTemplateContainer=this.createElement("span",{className:"e-overflow e-show-text e-input-value "+X})),this.inputWrapper.insertBefore(this.valueTemplateContainer,this.inputEle),this.templateComplier(this.valueTemplate)},s.prototype.showOrHideValueTemplate=function(e,i){void 0===i&&(i=!1),this.valueTemplateContainer&&"Box"!==this.mode&&(e?(t.removeClass([this.valueTemplateContainer],X),t.addClass([this.inputWrapper],G),t.addClass([this.inputEle],Q)):(t.addClass([this.valueTemplateContainer],X),i||(t.removeClass([this.inputWrapper],G),t.removeClass([this.inputEle],Q))))},s.prototype.updateSelectedValues=function(){var e=this;this.dataValue="";var i,s,l,n="";this.hiddenElement.innerHTML="";var r="";if(this.isChipDelete&&!this.treeSettings.autoCheck||!this.inputWrapper.contains(this.chipWrapper)||(this.chipCollection.innerHTML=""),this.isFilteredData||(this.selectedData=[]),!t.isNullOrUndefined(this.value)){for(var o=this.initializeValueTemplate(),h=0,u=this.value.length;h<u;h++){l=this.getSelectedData(this.value[h]);var p=this.treeObj.getNode(this.value[h]);s=t.getValue(this.treeSettings.loadOnDemand?this.fields.text:"text",l),t.isNullOrUndefined(s)&&!t.isNullOrUndefined(p.text)&&(s=p.text.toString()),this.selectedText.push(s),i=this.selectedText[this.selectedText.length-1],this.selectedText.length>1?(this.dataValue+=this.delimiterChar+" "+i,n+=","+i):(this.dataValue+=i,n+=i),"Custom"===this.mode||"Delimiter"===this.mode||this.isChipDelete&&!this.treeSettings.autoCheck||!this.allowMultiSelection&&!this.showCheckBox||this.setChipValues(i,this.value[h]),r+='<option selected value ="'+this.value[h]+'">'+this.selectedText[this.selectedText.length-1]+"</option>",this.valueTemplate&&this.getValueTemplateElement(this.value[h],o)}this.hasTemplate&&this.portals&&(this.treeObj.portals&&(this.portals=this.portals.concat(this.treeObj.portals.filter(function(t){return!e.portals.includes(t)}))),this.isReact&&this.renderReactTemplates(this.reactCallBack)),this.selectedText.length>=1&&this.setProperties({text:n},!0),this.hiddenElement.innerHTML=r,"Custom"===this.mode&&(this.allowMultiSelection||this.showCheckBox)&&this.setTagValues()}var d=this.getValidMode();"Custom"===this.mode||"Box"===this.mode||!this.allowMultiSelection&&!this.showCheckBox||d||(this.chipWrapper&&(t.addClass([this.chipWrapper],X),t.removeClass([this.inputWrapper],G)),this.showOrHideValueTemplate(!0)),a.Input.setValue(this.dataValue,this.inputEle,this.floatLabelType),""===n?this.setProperties({text:null},!0):this.setProperties({text:n},!0),this.showClearButton&&this.inputFocus&&this.showOverAllClear(),(this.allowMultiSelection||this.showCheckBox)&&this.popupObj&&this.popupObj.refreshPosition(),this.currentText=this.text,this.currentValue=this.value,!t.isNullOrUndefined(this.value)&&this.value.length>0&&!t.isNullOrUndefined(this.currentText)?this.inputWrapper.setAttribute("aria-label",this.currentText.replace(/,/g,", ")):this.inputWrapper.setAttribute("aria-label",this.getModuleName())},s.prototype.setChipValues=function(e,i){this.inputWrapper.contains(this.chipWrapper)||this.createChip();var s=this.createElement("span",{className:"e-chips",attrs:{"data-value":i}}),l=this.createElement("span",{className:"e-chipcontent"}),n=this.createElement("span",{className:"e-chips-close e-icons"});this.enableHtmlSanitizer?l.innerText=t.SanitizeHtmlHelper.sanitize(e):l.innerHTML=e,s.appendChild(l),this.chipCollection.appendChild(s),this.showClearButton&&(s.appendChild(n),t.EventHandler.add(n,"mouseup",this.removeChip,this))},s.prototype.setTagValues=function(){if(null===this.value||null==this.text||0===this.value.length)return void(this.inputWrapper.contains(this.chipWrapper)&&t.addClass([this.chipWrapper],X));this.inputWrapper.contains(this.chipWrapper)||this.createChip(),this.inputWrapper.classList.contains(G)||t.addClass([this.inputWrapper],G);var e=this.createElement("span",{className:"e-chips"});this.inputEle.classList.contains(Q)||t.addClass([this.inputEle],Q),this.chipWrapper.classList.contains(X)&&(t.removeClass([this.chipWrapper],X),this.showOrHideValueTemplate(!1,!0));var i=this.createElement("span",{className:"e-chipcontent"}),s=this.customTemplate,l=this.customTemplateId,n=this.templateComplier(s)({value:this.value,text:this.text},this,"customTemplate",l,this.isStringTemplate,void 0,i);n&&(n=Array.prototype.slice.call(n),t.append(n,i)),e.appendChild(i),this.chipCollection.appendChild(e),this.isReact&&this.renderReactTemplates()},s.prototype.setSelectAllWrapper=function(e){this.isFirstRender||(e&&!this.popupEle.contains(this.checkAllParent)&&this.showCheckBox?(this.createSelectAllWrapper(),this.popupEle.insertBefore(this.checkAllParent,this.popupDiv)):this.popupEle.contains(this.checkAllParent)&&(t.detach(this.checkAllParent),this.checkAllParent=null))},s.prototype.setHeaderTemplate=function(){this.header?this.header.innerHTML="":(this.header=this.createElement("div"),t.addClass([this.header],"e-ddt-header"));var e=this.templateComplier(this.headerTemplate)({},this,"headerTemplate",this.headerTemplateId,this.isStringTemplate,void 0,this.header);e&&(e=Array.prototype.slice.call(e),t.append(e,this.header)),this.popupEle.insertBefore(this.header,this.checkAllParent?this.checkAllParent:this.popupDiv)},s.prototype.templateComplier=function(e){if(e)try{return"function"!=typeof e&&document.querySelectorAll(e).length?t.compile(document.querySelector(e).innerHTML.trim()):t.compile(e)}catch(i){return t.compile(e)}return t.compile(e)},s.prototype.setFooterTemplate=function(){this.footer?this.isReact&&"function"==typeof this.footerTemplate?this.clearTemplate(["footerTemplate"]):this.footer.innerHTML="":(this.footer=this.createElement("div"),t.addClass([this.footer],"e-ddt-footer"));var e=this.templateComplier(this.footerTemplate)({},this,"footerTemplate",this.footerTemplateId,this.isStringTemplate,void 0,this.footer);e&&(e=Array.prototype.slice.call(e),t.append(e,this.footer)),t.append([this.footer],this.popupEle)},s.prototype.clearAll=function(e){this.enabled&&!this.readonly&&(this.resetValue(),this.showOverAllClear(),(this.allowMultiSelection||this.showCheckBox)&&(this.popupObj&&this.popupObj.refreshPosition(),this.wrapText||this.updateOverflowWrapper(!0)),e&&(this.isClearButtonClick=!0),this.changeOnBlur||this.triggerChangeEvent(e))},s.prototype.removeChip=function(e){if(this.enabled&&!this.readonly){e.target.classList.contains("e-chips-close")&&!this.isPopupOpen&&(e.stopPropagation(),e.preventDefault());var i=e.target.parentElement,s=i.getAttribute("data-value");this.chipCollection&&i&&t.remove(i),this.isChipDelete=!0,this.isClearButtonClick=!0,this.removeSelectedData(s,!0),this.selectedText=[],this.allowMultiSelection&&(this.treeObj.selectedNodes=this.value.slice(),this.updateSelectedValues()),this.showCheckBox&&(this.treeObj.uncheckAll([s]),this.clearCheckAll(),this.setMultiSelect()),this.triggerChangeEvent(e),this.isChipDelete=!1,this.ensurePlaceHolder()}},s.prototype.resetValue=function(e){Array.isArray(this.value)&&0===this.value.length&&null==this.text||(a.Input.setValue(null,this.inputEle,this.floatLabelType),e||(this.setOldValue(),this.setProperties({value:[]},!0),this.showOrHideValueTemplate(!1)),(t.isNullOrUndefined(this.value)||0===this.value.length)&&this.inputWrapper.setAttribute("aria-label",this.getModuleName()),this.dataValue=null,this.setProperties({text:null},!0),this.selectedData=[],t.setValue("selectedNodes",[],this.treeObj),this.hiddenElement.innerHTML="",this.showCheckBox&&(this.treeObj.uncheckAll(),this.setMultiSelect(),this.clearCheckAll()),null!==this.oldValue||e?e&&this.triggerChangeEvent():this.removeValue=!0,(this.allowMultiSelection||this.showCheckBox)&&this.chipWrapper&&(this.chipCollection.innerHTML="",this.wrapText||this.updateOverflowWrapper(!0),this.ensurePlaceHolder()))},s.prototype.clearCheckAll=function(){this.showSelectAll&&this.value&&0===this.value.length&&this.setLocale(!1)},s.prototype.setOldValue=function(){this.oldValue=Array.isArray(this.value)?this.value.slice():this.value},s.prototype.selectAllItems=function(e){if(this.showCheckBox)e?(this.isCheckAllCalled=!0,this.treeObj.checkAll()):this.treeObj.uncheckAll(),this.checkSelectAll=e;else if(this.allowMultiSelection)if(e){for(var i=t.selectAll("li",this.treeObj.element),s=void 0,l=[],n=0;n<i.length;n++)s=i[n].getAttribute("data-uid").toString(),l.push(s);this.treeObj.selectedNodes=l}else this.treeObj.selectedNodes=[];this.updateMode(),this.setMultiSelect(),this.wrapText||(e?this.updateView():this.updateOverflowWrapper(!0))},s.prototype.updateTreeSettings=function(e){if("autoCheck"===e)this.treeObj.autoCheck=this.treeSettings.autoCheck;else if("loadOnDemand"===e)this.treeObj.loadOnDemand=this.treeSettings.loadOnDemand;else{if("expandOn"===e)return this.treeObj.expandOn=this.treeSettings.expandOn,void this.treeObj.dataBind();"checkDisabledChildren"===e&&(this.treeObj.checkDisabledChildren=this.treeSettings.checkDisabledChildren)}this.treeObj.dataBind(),this.setMultiSelect(),this.updateValue(this.value)},s.prototype.updateCheckBoxState=function(e){this.hasTemplate&&this.updateTemplate(),this.wrapText||this.updateOverflowWrapper(!1),this.treeObj.showCheckBox=e,this.treeObj.dataBind(),this.isDynamicChange=!0,this.setSelectAllWrapper(this.showSelectAll),this.showSelectAll&&this.setLocale(),this.showCheckBox&&this.updateMode(),this.setMultiSelect(),this.isDynamicChange=!1},s.prototype.updateTemplate=function(){this.popupObj&&(this.clearTemplate(),this.portals=[],this.popupObj.destroy(),this.isPopupOpen?(this.hidePopup(),this.isFirstRender=!0,this.renderPopup()):this.isFirstRender=!0)},s.prototype.l10nUpdate=function(e){if(this.noRecord?this.noRecord.innerHTML="":this.noRecord=this.createElement("div"),"No Records Found"!==this.noRecordsTemplate||"The Request Failed"!==this.actionFailureTemplate){var i=e?this.actionFailureTemplate:this.noRecordsTemplate,s=e?this.actionFailureTemplateId:this.noRecordsTemplateId,l=e?"actionFailureTemplate":"noRecordsTemplate",n=this.templateComplier(i)({},this,l,s,this.isStringTemplate,void 0,this.noRecord);n&&(n=Array.prototype.slice.call(n),t.append(n,this.noRecord))}else{var a={noRecordsTemplate:"No Records Found",actionFailureTemplate:"The Request Failed"};this.l10n=new t.L10n(this.getLocaleName(),a,this.locale),this.noRecord.innerHTML=e?this.l10n.getConstant("actionFailureTemplate"):this.l10n.getConstant("noRecordsTemplate")}t.addClass([this.noRecord],"e-ddt-nodata"),t.prepend([this.noRecord],this.popupDiv),this.treeObj&&this.treeObj.element.removeAttribute("aria-activedescendant")},s.prototype.updateRecordTemplate=function(e){this.treeItems&&this.treeItems.length<=0&&(this.l10nUpdate(e),this.hasTemplate&&this.updateTemplate())},s.prototype.updateOverflowWrapper=function(e){e?this.inputWrapper.contains(this.overFlowWrapper)&&e&&(this.overFlowWrapper.innerHTML=""):this.inputWrapper.contains(this.overFlowWrapper)||(this.overFlowWrapper=this.createElement("span",{className:"e-overflow "+X}),this.inputWrapper.insertBefore(this.overFlowWrapper,this.hiddenElement))},s.prototype.updateMultiSelection=function(e){this.wrapText||this.updateOverflowWrapper(!1),this.treeObj.allowMultiSelection=e,this.treeObj.dataBind(),this.updateOption(),this.allowMultiSelection&&this.updateMode(),this.setMultiSelect()},s.prototype.updateAllowFiltering=function(e){this.isFirstRender||(e?this.renderFilter():this.destroyFilter())},s.prototype.updateFilterPlaceHolder=function(){this.filterObj&&(this.filterObj.placeholder=this.filterBarPlaceholder,this.filterObj.element.setAttribute("aria-label",this.filterBarPlaceholder))},s.prototype.updateValue=function(e){this.isDynamicChange=!0,t.isNullOrUndefined(e)||0===e.length?this.resetValue(!0):(this.setTreeValue(),!this.allowMultiSelection&&!this.showCheckBox||this.wrapText||(this.updateOverflowWrapper(!1),this.updateView())),this.updateHiddenValue(),this.isDynamicChange=!1},s.prototype.updateText=function(e){t.isNullOrUndefined(e)?this.resetValue():(this.setTreeText(),!this.allowMultiSelection&&!this.showCheckBox||this.wrapText||(this.updateOverflowWrapper(!1),this.updateView())),this.updateHiddenValue()},s.prototype.updateModelMode=function(){if(!!this.allowMultiSelection||!!this.showCheckBox){if(!this.wrapText){var e=t.select(".e-overflow:not(.e-input-value)",this.inputWrapper);e&&(e.innerHTML="")}this.updateMode(),this.setMultiSelect(),!this.wrapText&&this.value&&0!==this.value.length&&(this.updateOverFlowView(),t.addClass([this.inputEle],Q),"Box"===this.mode?t.removeClass([this.overFlowWrapper,this.inputWrapper],Z):t.addClass([this.overFlowWrapper,this.inputWrapper],Z))}},s.prototype.updateOption=function(){this.hiddenElement.hasAttribute("multiple")||!this.allowMultiSelection&&!this.showCheckBox?!this.hiddenElement.hasAttribute("multiple")||this.allowMultiSelection||this.showCheckBox||this.hiddenElement.removeAttribute("multiple"):this.hiddenElement.setAttribute("multiple","")},s.prototype.onPropertyChanged=function(e,i){for(var s=0,l=Object.keys(e);s<l.length;s++)switch(l[s]){case"width":this.setElementWidth(e.width),this.popupObj&&(this.popupObj.element.style.width=this.setWidth());break;case"placeholder":a.Input.setPlaceholder(e.placeholder,this.inputEle);break;case"cssClass":this.setCssClass(e.cssClass,i.cssClass);break;case"enableRtl":this.setEnableRTL(this.enableRtl);break;case"fields":this.setFields();break;case"readonly":a.Input.setReadonly(e.readonly,this.inputEle);break;case"enabled":this.setEnable();break;case"floatLabelType":a.Input.removeFloating(this.inputObj),a.Input.addFloating(this.inputEle,e.floatLabelType,this.placeholder,this.createElement),this.ensureClearIconPosition(e.floatLabelType);break;case"showClearButton":this.updateClearButton(e.showClearButton);break;case"allowFiltering":this.updateAllowFiltering(e.allowFiltering);break;case"filterBarPlaceholder":this.updateFilterPlaceHolder();break;case"value":JSON.stringify(i.value)!==JSON.stringify(e.value)&&(this.oldValue=i.value,this.updateValue(e.value));break;case"text":this.updateText(e.text);break;case"allowMultiSelection":this.updateMultiSelection(e.allowMultiSelection);break;case"mode":if(!this.showCheckBox&&!this.allowMultiSelection)return;"Custom"===this.mode?(this.overFlowWrapper&&t.detach(this.overFlowWrapper),this.chipWrapper&&t.detach(this.chipWrapper),this.setTagValues()):("Custom"===i.mode&&this.updateOverflowWrapper(this.wrapText),this.updateModelMode());break;case"delimiterChar":if("Box"===this.mode)return;(this.showCheckBox||this.allowMultiSelection)&&this.setMultiSelect();break;case"selectAllText":this.showCheckBox&&this.showSelectAll&&this.setLocale();break;case"unSelectAllText":this.showCheckBox&&this.showSelectAll&&this.setLocale(!1);break;case"showSelectAll":this.showCheckBox&&(this.setSelectAllWrapper(e.showSelectAll),this.updatePopupHeight());break;case"showCheckBox":this.updateCheckBoxState(e.showCheckBox),this.wrapText||this.updateOverflowWrapper(!0),this.updatePopupHeight(),this.updateOption();break;case"treeSettings":for(var n=0,r=Object.keys(e.treeSettings);n<r.length;n++){var o=r[n];this.updateTreeSettings(o)}break;case"customTemplate":if("Custom"!==this.mode)return;this.chipCollection.innerHTML="",this.setTagValues();break;case"sortOrder":this.hasTemplate&&this.updateTemplate(),this.treeObj.sortOrder=e.sortOrder,this.treeObj.dataBind(),this.updateValue(this.value);break;case"showDropDownIcon":this.updateDropDownIconState(e.showDropDownIcon);break;case"popupWidth":this.popupObj&&(this.popupObj.element.style.width=this.setWidth());break;case"popupHeight":this.popupObj&&this.updatePopupHeight();break;case"zIndex":this.popupObj&&(this.popupObj.zIndex=e.zIndex,this.popupObj.dataBind());break;case"headerTemplate":case"footerTemplate":this.updateTemplate();break;case"itemTemplate":this.updateTemplate(),this.treeObj.nodeTemplate=e.itemTemplate,this.treeObj.dataBind();break;case"noRecordsTemplate":this.updateRecordTemplate();break;case"actionFailureTemplate":this.updateRecordTemplate(!0);break;case"htmlAttributes":this.setHTMLAttributes();break;case"wrapText":this.updateOverflowWrapper(this.wrapText),!this.allowMultiSelection&&!this.showCheckBox||this.wrapText?(t.addClass([this.overFlowWrapper],X),this.chipWrapper&&"Box"===this.mode?t.removeClass([this.chipWrapper],X):(t.removeClass([this.inputWrapper],G),t.removeClass([this.inputEle],Q)),this.ensurePlaceHolder()):this.updateView()}},s.prototype.clear=function(){this.clearAll(),this.inputFocus?this.onFocusOut():(this.changeOnBlur&&this.triggerChangeEvent(),this.removeValue=!1)},s.prototype.destroy=function(){for(this.clearTemplate(),this.unWireEvents(),this.setCssClass(null,this.cssClass),this.setProperties({text:null},!0),this.treeObj.destroy(),this.destroyFilter(),this.popupObj&&(this.popupObj.destroy(),t.detach(this.popupObj.element)),this.element.tagName!==this.getDirective()&&this.inputWrapper.parentElement.insertBefore(this.element,this.inputWrapper),a.Input.setValue(null,this.inputEle,this.floatLabelType),t.detach(this.inputWrapper),t.detach(this.popupDiv),t.detach(this.hiddenElement),a.Input.setRipple(!1,[this.inputObj]),this.element.classList.remove("e-input"),(this.showCheckBox||this.allowMultiSelection||this.value&&this.valueTemplateContainer)&&this.element.classList.remove(Q),t.detach(this.inputObj.container),this.inputObj.buttons.length&&t.detach(this.inputObj.buttons[0]),this.inputObj=null;this.hiddenElement.options.length>0;)this.hiddenElement.remove(0);if(this.hiddenElement.innerHTML="",this.hiddenElement=null,this.inputWrapper.innerHTML="",this.inputWrapper=null,this.popupDiv=null,this.tree=null,this.popupObj=null,this.treeObj=null,this.overAllClear=null,this.chipCollection)for(var i=0,s=t.selectAll(".e-chips-close",this.chipCollection);i<s.length;i++){var l=s[i];t.EventHandler.remove(l,"mouseup",this.removeChip)}this.chipWrapper=null,this.chipCollection=null,this.checkAllParent=null,this.selectAllSpan=null,this.checkBoxElement=null,this.checkWrapper=null,this.popupEle=null,this.header=null,this.footer=null,this.overFlowWrapper=null,this.keyboardModule=null,e.prototype.destroy.call(this),this.setProperties({value:[]},!0)},s.prototype.destroyFilter=function(){this.filterObj&&(this.filterObj.destroy(),t.detach(this.filterObj.element),t.detach(this.filterContainer),this.filterObj=null)},s.prototype.destroyPopup=function(){this.isPopupOpen=!1,this.isReact&&this.clearTemplate(["headerTemplate","footerTemplate","itemTemplate","actionFailureTemplate","noRecordsTemplate"]),this.popupObj&&(this.popupObj.destroy(),t.detach(this.popupObj.element))},s.prototype.ensureVisible=function(e){this.treeObj.ensureVisible(e)},s.prototype.getData=function(e){return this.treeObj.getTreeData(e)},s.prototype.hidePopup=function(){var e={popup:this.popupObj,cancel:!1};this.trigger("close",e),e.cancel||(this.inputWrapper.classList.remove("e-icon-anim"),this.popupEle&&t.addClass([this.popupEle],"e-ddt-icon-hide"),t.attributes(this.inputEle,{"aria-expanded":"false"}),this.popupObj&&this.isPopupOpen&&(this.popupObj.hide(),this.inputFocus&&(this.inputWrapper.focus(),this.allowFiltering&&t.addClass([this.inputWrapper],[J])),this.isFilteredData&&(this.treeObj.treeData=this.treeData),this.destroyPopupOnHide&&(this.isFirstRender=!0,this.destroyPopup())))},s.prototype.selectAll=function(e){this.selectAllItems(e)},s.prototype.showPopup=function(){!this.enabled||this.readonly||this.isPopupOpen||(this.renderPopup(),this.focusIn())},s.prototype.getModuleName=function(){return"dropdowntree"},z([t.Property("The Request Failed")],s.prototype,"actionFailureTemplate",void 0),z([t.Property(!1)],s.prototype,"allowFiltering",void 0),z([t.Property(!1)],s.prototype,"allowMultiSelection",void 0),z([t.Property(!0)],s.prototype,"changeOnBlur",void 0),z([t.Property("")],s.prototype,"cssClass",void 0),z([t.Property("${value.length} item(s) selected")],s.prototype,"customTemplate",void 0),z([t.Property(",")],s.prototype,"delimiterChar",void 0),z([t.Property(!0)],s.prototype,"enabled",void 0),z([t.Complex({},ee)],s.prototype,"fields",void 0),z([t.Property(null)],s.prototype,"filterBarPlaceholder",void 0),z([t.Property("StartsWith")],s.prototype,"filterType",void 0),z([t.Property("Never")],s.prototype,"floatLabelType",void 0),z([t.Property(null)],s.prototype,"footerTemplate",void 0),z([t.Property(!1)],s.prototype,"ignoreAccent",void 0),z([t.Property(!0)],s.prototype,"ignoreCase",void 0),z([t.Property(null)],s.prototype,"headerTemplate",void 0),z([t.Property({})],s.prototype,"htmlAttributes",void 0),z([t.Property(null)],s.prototype,"itemTemplate",void 0),z([t.Property("Default")],s.prototype,"mode",void 0),z([t.Property("No Records Found")],s.prototype,"noRecordsTemplate",void 0),z([t.Property(null)],s.prototype,"placeholder",void 0),z([t.Property("300px")],s.prototype,"popupHeight",void 0),z([t.Property("100%")],s.prototype,"popupWidth",void 0),z([t.Property(!1)],s.prototype,"readonly",void 0),z([t.Property(!1)],s.prototype,"showSelectAll",void 0),z([t.Property("Select All")],s.prototype,"selectAllText",void 0),z([t.Property(!1)],s.prototype,"showCheckBox",void 0),z([t.Property(!0)],s.prototype,"destroyPopupOnHide",void 0),z([t.Property(!0)],s.prototype,"enableHtmlSanitizer",void 0),z([t.Property(!0)],s.prototype,"showClearButton",void 0),z([t.Property(!0)],s.prototype,"showDropDownIcon",void 0),z([t.Property("None")],s.prototype,"sortOrder",void 0),z([t.Property(null)],s.prototype,"text",void 0),z([t.Complex({},te)],s.prototype,"treeSettings",void 0),z([t.Property("Unselect All")],s.prototype,"unSelectAllText",void 0),z([t.Property(null)],s.prototype,"value",void 0),z([t.Property(null)],s.prototype,"valueTemplate",void 0),z([t.Property("100%")],s.prototype,"width",void 0),z([t.Property(1e3)],s.prototype,"zIndex",void 0),z([t.Property(!1)],s.prototype,"wrapText",void 0),z([t.Event()],s.prototype,"actionFailure",void 0),z([t.Event()],s.prototype,"beforeOpen",void 0),z([t.Event()],s.prototype,"change",void 0),z([t.Event()],s.prototype,"close",void 0),z([t.Event()],s.prototype,"blur",void 0),z([t.Event()],s.prototype,"created",void 0),z([t.Event()],s.prototype,"dataBound",void 0),z([t.Event()],s.prototype,"destroyed",void 0),z([t.Event()],s.prototype,"filtering",void 0),z([t.Event()],s.prototype,"focus",void 0),z([t.Event()],s.prototype,"keyPress",void 0),z([t.Event()],s.prototype,"open",void 0),z([t.Event()],s.prototype,"select",void 0),s=z([t.NotifyPropertyChanges],s)}(t.Component),se=function(){var e=function(t,i){return(e=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])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),le=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(l=e[r])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};q.root="e-combobox";var ne={container:null,buttons:[]},ae=function(e){function s(t,i){return e.call(this,t,i)||this}return se(s,e),s.prototype.preRender=function(){e.prototype.preRender.call(this)},s.prototype.getLocaleName=function(){return"combo-box"},s.prototype.wireEvent=function(){"combobox"===this.getModuleName()&&(t.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.preventBlur,this),t.EventHandler.add(this.inputWrapper.container,"blur",this.onBlurHandler,this)),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.dropDownClick,this),t.EventHandler.add(this.inputElement,"focus",this.targetFocus,this),this.readonly||(t.EventHandler.add(this.inputElement,"input",this.onInput,this),t.EventHandler.add(this.inputElement,"keyup",this.onFilterUp,this),t.EventHandler.add(this.inputElement,"keydown",this.onFilterDown,this),t.EventHandler.add(this.inputElement,"paste",this.pasteHandler,this),t.EventHandler.add(window,"resize",this.windowResize,this)),this.bindCommonEvent()},s.prototype.preventBlur=function(e){(this.allowFiltering||document.activeElement===this.inputElement||document.activeElement.classList.contains(q.input)||!t.Browser.isDevice)&&t.Browser.isDevice||e.preventDefault()},s.prototype.onBlurHandler=function(i){var s=this.inputElement&&""===this.inputElement.value?null:this.inputElement&&this.inputElement.value,l=t.isNullOrUndefined(this.text)?this.text:this.text.replace(/\r\n|\n|\r/g,"");t.isNullOrUndefined(this.listData)||t.isNullOrUndefined(s)||s===l||this.customValue(i),e.prototype.onBlurHandler.call(this,i)},s.prototype.targetElement=function(){return this.inputElement},s.prototype.setOldText=function(e){a.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton),this.customValue(),this.removeSelection()},s.prototype.setOldValue=function(e){this.allowCustom?(this.selectedLI=this.getElementByValue(this.value),this.valueMuteChange(this.value)):this.valueMuteChange(null),this.removeSelection(),this.setHiddenValue()},s.prototype.valueMuteChange=function(e){e=this.allowObjectBinding&&!t.isNullOrUndefined(e)?t.getValue(this.fields.value?this.fields.value:"",e):e;var i=t.isNullOrUndefined(e)?null:e.toString();a.Input.setValue(i,this.inputElement,this.floatLabelType,this.showClearButton);var s={};if(this.allowObjectBinding&&(e=this.getDataByValue(e),t.isNullOrUndefined(e))){var l=this.fields,n=!1,r=!1;if(this.allowObjectBinding){var o=Object.keys(this.value);o.forEach(function(e){if(e===l.value)return void(r=!0)}),o.forEach(function(e){if(e===l.text)return void(n=!0)})}s={text:r?n?t.getValue(l.text,this.value):t.getValue(l.value,this.value):null,value:r?this.value:null,index:null}}this.allowObjectBinding?this.setProperties(s,!0):this.setProperties({value:e,text:e?e.toString():e,index:null},!0),this.activeIndex=this.index;var h=this.fields,u={};u[h.text]=t.isNullOrUndefined(e)?null:e.toString(),u[h.value]=t.isNullOrUndefined(e)?null:e.toString(),this.itemData=u,this.item=null,(!this.allowObjectBinding&&this.previousValue!==this.value||this.allowObjectBinding&&this.previousValue&&this.value&&!this.isObjectInArray(this.previousValue,[this.value]))&&this.detachChangeEvent(null)},s.prototype.updateValues=function(){var e=this;if(this.fields.disabled&&(null!=this.value&&(this.value=this.isDisableItemValue(this.value)?null:this.value),null!=this.text&&(this.text=this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text)))?null:this.text),null!=this.index&&(this.index=this.isDisabledItemByIndex(this.index)?null:this.index,this.activeIndex=this.index)),t.isNullOrUndefined(this.value))this.text&&t.isNullOrUndefined(this.value)?(l=this.getElementByText(this.text))?this.setSelection(l,null):(a.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton),this.customValue()):t.isNullOrUndefined(this.activeIndex)||t.isNullOrUndefined(this.liCollections[this.activeIndex])||this.setSelection(this.liCollections[this.activeIndex],null);else{var s=this.allowObjectBinding&&!t.isNullOrUndefined(this.value)?t.getValue(this.fields.value?this.fields.value:"",this.value):this.value,l=this.getElementByValue(s),n=!t.isNullOrUndefined(l);if(this.enableVirtualization&&this.value){var r=this.fields.value?this.fields.value:"",o=this.allowObjectBinding&&!t.isNullOrUndefined(this.value)?t.getValue(this.fields.value?this.fields.value:"",this.value):this.value;if(this.dataSource instanceof i.DataManager)this.dataSource.executeQuery((new i.Query).where(new i.Predicate(r,"equal",o))).then(function(i){if(i&&i.result&&i.result.length>0){e.itemData=i.result[0];var s=e.getItemData(),l=e.allowObjectBinding?e.itemData:s.value,n=e.allowObjectBinding&&!t.isNullOrUndefined(e.value)?t.getValue(e.fields.value?e.fields.value:"",e.value):e.value;(n===s.value&&e.text!==s.text.toString()||n!==s.value&&e.text===s.text.toString())&&(e.setProperties({text:s.text?s.text.toString():s.text,value:l},!0),e.setHiddenValue(),a.Input.setValue(e.text,e.inputElement,e.floatLabelType,e.showClearButton))}else e.allowCustom?(e.valueMuteChange(e.value),e.setHiddenValue(),a.Input.setValue(e.text,e.inputElement,e.floatLabelType,e.showClearButton)):e.valueMuteChange(null)});else{var h=new i.DataManager(this.dataSource).executeLocal((new i.Query).where(new i.Predicate(r,"equal",o)));if(h&&h.length>0){this.itemData=h[0],n=!0;var u=this.getItemData(),p=this.allowObjectBinding?this.getDataByValue(u.value):u.value;(this.value===u.value&&this.text!==u.text||this.value!==u.value&&this.text===u.text)&&(this.setProperties({text:u.text?u.text.toString():u.text,value:p}),t.isNullOrUndefined(l)&&(this.previousValue=this.value))}}}l?this.setSelection(l,null):!this.enableVirtualization&&this.allowCustom||this.allowCustom&&this.enableVirtualization&&!n&&!(this.dataSource instanceof i.DataManager)?this.valueMuteChange(this.value):this.enableVirtualization&&(!this.enableVirtualization||this.dataSource instanceof i.DataManager||n)||this.valueMuteChange(null)}this.setHiddenValue(),a.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton)},s.prototype.updateIconState=function(){this.showClearButton&&(this.inputElement&&""!==this.inputElement.value&&!this.readonly?t.removeClass([this.inputWrapper.clearButton],q.clearIconHide):t.addClass([this.inputWrapper.clearButton],q.clearIconHide))},s.prototype.getAriaAttributes=function(){return{role:"combobox","aria-autocomplete":"both","aria-labelledby":this.hiddenElement.id,"aria-expanded":"false","aria-readonly":this.readonly?this.readonly.toString():"false",autocomplete:"off",autocapitalize:"off",spellcheck:"false"}},s.prototype.searchLists=function(t){this.isTyped=!0,this.isFiltering()?(e.prototype.searchLists.call(this,t),this.ulElement&&""===this.filterInput.value.trim()&&this.setHoverList(this.ulElement.querySelector("."+q.li))):(this.ulElement&&""===this.inputElement.value&&this.preventAutoFill&&this.setHoverList(this.ulElement.querySelector("."+q.li)),this.incrementalSearch(t))},s.prototype.getNgDirective=function(){return"EJS-COMBOBOX"},s.prototype.setSearchBox=function(){return this.filterInput=this.inputElement,this.isFiltering()||this.isReact&&"combobox"===this.getModuleName()?this.inputWrapper:ne},s.prototype.onActionComplete=function(t,i,s,l){var n=this;e.prototype.onActionComplete.call(this,t,i,s),this.isSelectCustom&&this.removeSelection(),this.preventAutoFill||"combobox"!==this.getModuleName()||!this.isTyped||this.enableVirtualization||setTimeout(function(){n.inlineSearch()})},s.prototype.getFocusElement=function(){var e=this.isSelectCustom?{text:""}:this.getItemData(),i=t.isNullOrUndefined(this.list)?this.list:this.list.querySelector("."+q.selected);if(e.text&&e.text.toString()===this.inputElement.value&&!t.isNullOrUndefined(i))return i;if((t.Browser.isDevice&&!this.isDropDownClick||!t.Browser.isDevice)&&!t.isNullOrUndefined(this.liCollections)&&this.liCollections.length>0){var s=this.inputElement.value,l=this.sortedData,n=this.typeOfData(l).typeof,a=u(s,this.liCollections,this.filterType,!0,l,this.fields,n,this.ignoreAccent);if(this.enableVirtualization&&""!==s&&"autocomplete"!==this.getModuleName()&&this.isTyped&&!this.allowFiltering){var r=!1,o=this.viewPortInfo.endIndex>=this.incrementalEndIndex&&this.incrementalEndIndex<=this.totalItemCount,h=0===this.incrementalEndIndex;for((o||h)&&(r=!0,this.incrementalStartIndex=this.incrementalEndIndex,this.incrementalEndIndex=h?Math.min(100,this.totalItemCount):Math.min(this.incrementalEndIndex+100,this.totalItemCount),this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),r=!0),(0!==this.viewPortInfo.startIndex||r)&&this.updateIncrementalView(0,this.itemCount),a=u(s,this.incrementalLiCollections,this.filterType,!0,l,this.fields,n);t.isNullOrUndefined(a.item)&&this.incrementalEndIndex<this.totalItemCount;){if(this.incrementalStartIndex=this.incrementalEndIndex,this.incrementalEndIndex=this.incrementalEndIndex+100>this.totalItemCount?this.totalItemCount:this.incrementalEndIndex+100,this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),r=!0,(0!==this.viewPortInfo.startIndex||r)&&this.updateIncrementalView(0,this.itemCount),a=u(s,this.incrementalLiCollections,this.filterType,!0,l,this.fields,n),!t.isNullOrUndefined(a)){a.index=a.index+this.incrementalStartIndex;break}if(t.isNullOrUndefined(a)&&this.incrementalEndIndex>=this.totalItemCount){this.incrementalStartIndex=0,this.incrementalEndIndex=100>this.totalItemCount?this.totalItemCount:100;break}}var p=a.index-(this.itemCount/2-2)>0?a.index-(this.itemCount/2-2):0,d=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount;if(p!==this.viewPortInfo.startIndex&&this.updateIncrementalView(p,d),t.isNullOrUndefined(a.item))this.updateIncrementalView(0,this.itemCount),this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.list.scrollTop=0;else{var c=this.viewPortInfo.startIndex+(this.itemCount/2-2)<this.totalItemCount?this.viewPortInfo.startIndex+(this.itemCount/2-2):this.totalItemCount,m=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount;this.updateIncrementalView(c,m),a.item=this.getElementByValue(a.item.getAttribute("data-value"))}a&&a.item&&(a.item=this.getElementByValue(a.item.getAttribute("data-value")))}var f=a.item,v=this.getItemData();if(!t.isNullOrUndefined(f)&&!this.enableVirtualization||this.enableVirtualization&&this.isTyped&&t.isNullOrUndefined(v)&&t.isNullOrUndefined(v.value)&&v.value.toString()===f.getAttribute("data-value").toString()){var g=this.getIndexByValue(f.getAttribute("data-value"))-1,y=parseInt(getComputedStyle(this.liCollections[0],null).getPropertyValue("height"),10);if(!isNaN(y)&&"autocomplete"!==this.getModuleName()){this.removeFocus();var C=this.fields.groupBy?this.liCollections[0].offsetHeight:0;if(this.enableVirtualization){if(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.enableVirtualization&&!this.fields.groupBy){var b=f.offsetTop,S=this.virtualListInfo&&this.virtualListInfo.startIndex?this.virtualListInfo.startIndex:0,E=f.offsetHeight,x=b+S*E,I=this.list.querySelectorAll(".e-virtual-list").length*E;this.list.scrollTop=x-I}}else this.list.scrollTop=g*y+C;t.addClass([f],q.focus)}}else this.isSelectCustom&&""!==this.inputElement.value.trim()&&(this.removeFocus(),this.enableVirtualization||(this.list.scrollTop=0));return f}return null},s.prototype.setValue=function(t){return(t&&"keydown"===t.type&&"enter"===t.action||t&&"click"===t.type)&&this.removeFillSelection(),this.autofill&&"combobox"===this.getModuleName()&&t&&"keydown"===t.type&&"enter"!==t.action?(this.preventAutoFill=!1,this.inlineSearch(t),!1):e.prototype.setValue.call(this,t)},s.prototype.checkCustomValue=function(){var e=this.allowObjectBinding&&!t.isNullOrUndefined(this.value)?t.getValue(this.fields.value?this.fields.value:"",this.value):this.value;this.itemData=this.getDataByValue(e);var i=this.getItemData(),s=this.allowObjectBinding?this.itemData:i.value;this.allowCustom&&t.isNullOrUndefined(i.value)&&t.isNullOrUndefined(i.text)||this.setProperties({value:s},!this.allowCustom)},s.prototype.showSpinner=function(){t.isNullOrUndefined(this.spinnerElement)&&(this.spinnerElement="autocomplete"===this.getModuleName()?this.inputWrapper.buttons[0]||this.inputWrapper.clearButton||a.Input.appendSpan("e-input-group-icon e-atc-spinner-icon",this.inputWrapper.container,this.createElement):this.inputWrapper.buttons[0]||this.inputWrapper.clearButton,t.addClass([this.spinnerElement],q.disableIcon),n.createSpinner({target:this.spinnerElement,width:t.Browser.isDevice?"16px":"14px"},this.createElement),n.showSpinner(this.spinnerElement))},s.prototype.hideSpinner=function(){t.isNullOrUndefined(this.spinnerElement)||(n.hideSpinner(this.spinnerElement),t.removeClass([this.spinnerElement],q.disableIcon),this.spinnerElement.classList.contains("e-atc-spinner-icon")?t.detach(this.spinnerElement):this.spinnerElement.innerHTML="",this.spinnerElement=null)},s.prototype.setAutoFill=function(e,t){if(t||this.setHoverList(e),this.autofill&&!this.preventAutoFill){var i=this.getTextByValue(e.getAttribute("data-value")).toString(),s=this.getFormattedValue(e.getAttribute("data-value"));"combobox"===this.getModuleName()&&(!this.isSelected&&!this.allowObjectBinding&&this.previousValue!==s||this.allowObjectBinding&&this.previousValue&&s&&!this.isObjectInArray(this.previousValue,[this.getDataByValue(s)])?(this.updateSelectedItem(e,null),this.isSelected=!0,this.previousValue=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(e.getAttribute("data-value"))):this.getFormattedValue(e.getAttribute("data-value"))):this.updateSelectedItem(e,null,!0)),this.isAndroidAutoFill(i)||this.setAutoFillSelection(i,t)}},s.prototype.isAndroidAutoFill=function(e){if(t.Browser.isAndroid){var i=this.getSelectionPoints(),s=this.prevSelectPoints.end,l=i.end,n=this.prevSelectPoints.start,a=i.start;return 0!==s&&(s===e.length&&n===e.length||n>a&&s>l||s===l&&n===a)}return!1},s.prototype.clearAll=function(i,s){(t.isNullOrUndefined(s)||!t.isNullOrUndefined(s)&&t.isNullOrUndefined(s.dataSource))&&e.prototype.clearAll.call(this,i),this.isFiltering()&&!t.isNullOrUndefined(i)&&i.target===this.inputWrapper.clearButton&&(this.typedString=this.filterInput.value,this.searchLists(i))},s.prototype.isSelectFocusItem=function(e){return!t.isNullOrUndefined(e)},s.prototype.inlineSearch=function(e){var i=e&&("down"===e.action||"up"===e.action||"home"===e.action||"end"===e.action||"pageUp"===e.action||"pageDown"===e.action),s=i?this.liCollections[this.activeIndex]:this.getFocusElement();if(t.isNullOrUndefined(s)){if(t.isNullOrUndefined(this.inputElement)||""!==this.inputElement.value)this.activeIndex=null,this.removeSelection(),this.liCollections&&this.liCollections.length>0&&!this.isCustomFilter&&this.removeFocus();else if(this.activeIndex=null,!t.isNullOrUndefined(this.list)){this.enableVirtualization||(this.list.scrollTop=0);var l=this.list.querySelector("."+q.li);this.setHoverList(l)}}else{if(!i){var n=this.getFormattedValue(s.getAttribute("data-value"));this.activeIndex=this.getIndexByValue(n),this.activeIndex=t.isNullOrUndefined(this.activeIndex)?null:this.activeIndex}this.preventAutoFill=""!==this.inputElement.value&&this.preventAutoFill,this.setAutoFill(s,i)}},s.prototype.incrementalSearch=function(e){this.showPopup(e),t.isNullOrUndefined(this.listData)||(this.inlineSearch(e),e.preventDefault())},s.prototype.setAutoFillSelection=function(e,t){void 0===t&&(t=!1);var i=this.getSelectionPoints(),s=this.inputElement.value.substr(0,i.start);if(s&&s.toLowerCase()===e.substr(0,i.start).toLowerCase()){var l=s+e.substr(s.length,e.length);a.Input.setValue(l,this.inputElement,this.floatLabelType,this.showClearButton),this.inputElement.setSelectionRange(i.start,this.inputElement.value.length)}else t&&(a.Input.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton),this.inputElement.setSelectionRange(0,this.inputElement.value.length))},s.prototype.getValueByText=function(t){return e.prototype.getValueByText.call(this,t,this.ignoreCase,this.ignoreAccent)},s.prototype.unWireEvent=function(){"combobox"===this.getModuleName()&&(t.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.preventBlur),t.EventHandler.remove(this.inputWrapper.container,"blur",this.onBlurHandler)),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.dropDownClick),this.inputElement&&(t.EventHandler.remove(this.inputElement,"focus",this.targetFocus),this.readonly||(t.EventHandler.remove(this.inputElement,"input",this.onInput),t.EventHandler.remove(this.inputElement,"keyup",this.onFilterUp),t.EventHandler.remove(this.inputElement,"keydown",this.onFilterDown),t.EventHandler.remove(this.inputElement,"paste",this.pasteHandler),t.EventHandler.remove(window,"resize",this.windowResize))),this.unBindCommonEvent()},s.prototype.setSelection=function(i,s){e.prototype.setSelection.call(this,i,s),t.isNullOrUndefined(i)||this.autofill||this.isDropDownClick||this.removeFocus()},s.prototype.selectCurrentItem=function(e){var i;if(this.isPopupOpen){if(i=this.isSelected?this.list.querySelector("."+q.selected):this.list.querySelector("."+q.focus),this.isDisabledElement(i))return;i&&(this.setSelection(i,e),this.isTyped=!1),this.isSelected&&(this.isSelectCustom=!1,this.onChangeEvent(e))}"enter"===e.action&&""===this.inputElement.value?this.clearAll(e):this.isTyped&&!this.isSelected&&t.isNullOrUndefined(i)&&this.customValue(e),this.hidePopup(e)},s.prototype.setHoverList=function(e){this.removeSelection(),this.isValidLI(e)&&!e.classList.contains(q.selected)&&(this.removeFocus(),e.classList.add(q.focus))},s.prototype.targetFocus=function(e){t.Browser.isDevice&&!this.allowFiltering&&(this.preventFocus=!1),this.onFocus(e),a.Input.calculateWidth(this.inputElement,this.inputWrapper.container)},s.prototype.dropDownClick=function(i){i.preventDefault(),t.Browser.isDevice&&!this.isFiltering()&&(this.preventFocus=!0),e.prototype.dropDownClick.call(this,i)},s.prototype.customValue=function(e){var i=this,s=this.getValueByText(this.inputElement.value);if(this.allowCustom||""===this.inputElement.value)if(""!==this.inputElement.value){var l=this.value;if(t.isNullOrUndefined(s)){var n=""===this.inputElement.value?null:this.inputElement.value,r={text:n,item:{}};this.isObjectCustomValue=!0,this.initial?this.updateCustomValueCallback(n,r,l):this.trigger("customValueSpecifier",r,function(t){i.updateCustomValueCallback(n,t,l,e)})}else this.isSelectCustom=!1,s=this.allowObjectBinding?this.getDataByValue(s):s,this.setProperties({value:s}),(!this.allowObjectBinding&&l!==this.value||this.allowObjectBinding&&l&&this.value&&!this.isObjectInArray(l,[this.value]))&&this.onChangeEvent(e)}else this.allowCustom&&this.isFocused&&(this.isSelectCustom=!0);else{var o=this.previousValue,h=this.value;s=this.allowObjectBinding?this.getDataByValue(s):s,this.setProperties({value:s}),t.isNullOrUndefined(this.value)&&a.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.autofill&&(!this.allowObjectBinding&&o===this.value||this.allowObjectBinding&&o&&this.isObjectInArray(o,[this.value]))&&(!this.allowObjectBinding&&h!==this.value||this.allowObjectBinding&&h&&!this.isObjectInArray(h,[this.value]))&&this.onChangeEvent(null)}},s.prototype.updateCustomValueCallback=function(e,i,s,l){var n=this,a=this.fields,r=i.item,o={};r&&t.getValue(a.text,r)&&t.getValue(a.value,r)?o=r:(t.setValue(a.text,e,o),t.setValue(a.value,e,o)),this.itemData=o;var h={};if(this.allowObjectBinding){var u=this.listData&&this.listData.length>0?Object.keys(this.listData[0]):Object.keys(this.itemData);this.listData&&this.listData.length>0||!("autocomplete"===this.getModuleName()||"combobox"===this.getModuleName()&&this.allowFiltering)||(u=this.firstItem?Object.keys(this.firstItem):Object.keys(this.itemData)),u.forEach(function(e){h[e]=e===a.value||e===a.text?t.getValue(a.value,n.itemData):null})}var p={text:t.getValue(a.text,this.itemData),value:this.allowObjectBinding?h:t.getValue(a.value,this.itemData),index:null};this.setProperties(p,!0),this.setSelection(null,null),this.isSelectCustom=!0,this.isObjectCustomValue=!1,(!this.allowObjectBinding&&s!==this.value||this.allowObjectBinding&&(null==s&&null!==this.value||s&&!this.isObjectInArray(s,[this.value])))&&this.onChangeEvent(l,!0)},s.prototype.onPropertyChanged=function(i,s){"combobox"===this.getModuleName()&&(this.checkData(i),this.setUpdateInitial(["fields","query","dataSource"],i,s));for(var l=0,n=Object.keys(i);l<n.length;l++){var r=n[l];switch(r){case"readonly":a.Input.setReadonly(this.readonly,this.inputElement),this.readonly?(t.EventHandler.remove(this.inputElement,"input",this.onInput),t.EventHandler.remove(this.inputElement,"keyup",this.onFilterUp),t.EventHandler.remove(this.inputElement,"keydown",this.onFilterDown)):(t.EventHandler.add(this.inputElement,"input",this.onInput,this),t.EventHandler.add(this.inputElement,"keyup",this.onFilterUp,this),t.EventHandler.add(this.inputElement,"keydown",this.onFilterDown,this)),this.setReadOnly();break;case"allowFiltering":this.setSearchBox(),this.isFiltering()&&"combobox"===this.getModuleName()&&t.isNullOrUndefined(this.list)&&e.prototype.renderList.call(this);break;case"allowCustom":break;default:var o=this.getPropObject(r,i,s);e.prototype.onPropertyChanged.call(this,o.newProperty,o.oldProperty),this.isFiltering()&&"dataSource"===r&&t.isNullOrUndefined(this.list)&&this.itemTemplate&&"combobox"===this.getModuleName()&&e.prototype.renderList.call(this)}}},s.prototype.render=function(){e.prototype.render.call(this),this.setSearchBox(),this.renderComplete(),this.autoFill=this.autofill},s.prototype.getModuleName=function(){return"combobox"},s.prototype.addItem=function(t,i){e.prototype.addItem.call(this,t,i)},s.prototype.filter=function(t,i,s){e.prototype.filter.call(this,t,i,s)},s.prototype.showPopup=function(t){e.prototype.showPopup.call(this,t)},s.prototype.hidePopup=function(i){var s=this.inputElement&&""===this.inputElement.value?null:this.inputElement&&this.inputElement.value;if(!t.isNullOrUndefined(this.listData)){var l=this.isEscapeKey;this.isEscapeKey&&(a.Input.setValue(this.typedString,this.inputElement,this.floatLabelType,this.showClearButton),this.isEscapeKey=!1),this.autofill&&this.removeFillSelection();var n=this.isSelectCustom?{text:""}:this.getItemData(),r=t.isNullOrUndefined(n.text)?n.text:n.text.toString().replace(/\r\n|\n|\r/g,""),o=t.isNullOrUndefined(this.list)?null:this.list.querySelector("."+q.selected);if(this.inputElement&&r===this.inputElement.value&&!t.isNullOrUndefined(o))return this.isSelected&&(this.onChangeEvent(i),this.isSelectCustom=!1),void e.prototype.hidePopup.call(this,i);if("combobox"===this.getModuleName()&&""!==this.inputElement.value.trim()){var h=this.sortedData,p=this.typeOfData(h).typeof,d=u(this.inputElement.value,this.liCollections,"Equal",!0,h,this.fields,p);this.selectedLI=d.item,t.isNullOrUndefined(d.index)&&(d.index=u(this.inputElement.value,this.liCollections,"StartsWith",!0,h,this.fields,p).index),this.activeIndex=d.index,t.isNullOrUndefined(this.selectedLI)?l&&(this.isSelectCustom=!0,this.removeSelection()):this.updateSelectedItem(this.selectedLI,null,!0)}this.isEscapeKey||!this.isTyped||this.isInteracted||this.customValue(i)}var c=this.allowObjectBinding&&!t.isNullOrUndefined(this.value)?t.getValue(this.fields.value?this.fields.value:"",this.value):this.value;t.isNullOrUndefined(this.listData)&&this.allowCustom&&!t.isNullOrUndefined(s)&&s!==c&&this.customValue(),e.prototype.hidePopup.call(this,i)},s.prototype.focusIn=function(){this.enabled&&(t.Browser.isDevice&&!this.isFiltering()&&(this.preventFocus=!0),e.prototype.focusIn.call(this))},s.prototype.clear=function(){this.value=null},s.prototype.focusOut=function(t){e.prototype.focusOut.call(this,t)},s.prototype.getItems=function(){return e.prototype.getItems.call(this)},s.prototype.getDataByValue=function(t){return e.prototype.getDataByValue.call(this,t)},s.prototype.renderHightSearch=function(){},le([t.Property(!1)],s.prototype,"autofill",void 0),le([t.Property(!0)],s.prototype,"allowCustom",void 0),le([t.Property({})],s.prototype,"htmlAttributes",void 0),le([t.Property(!1)],s.prototype,"allowFiltering",void 0),le([t.Property(!0)],s.prototype,"isDeviceFullScreen",void 0),le([t.Property(null)],s.prototype,"query",void 0),le([t.Property(null)],s.prototype,"index",void 0),le([t.Property(!0)],s.prototype,"showClearButton",void 0),le([t.Event()],s.prototype,"customValueSpecifier",void 0),le([t.Event()],s.prototype,"filtering",void 0),le([t.Property(null)],s.prototype,"valueTemplate",void 0),le([t.Property("Never")],s.prototype,"floatLabelType",void 0),le([t.Property(null)],s.prototype,"filterBarPlaceholder",void 0),le([t.Property(null)],s.prototype,"cssClass",void 0),le([t.Property(null)],s.prototype,"headerTemplate",void 0),le([t.Property(null)],s.prototype,"footerTemplate",void 0),le([t.Property(null)],s.prototype,"placeholder",void 0),le([t.Property("100%")],s.prototype,"width",void 0),le([t.Property("300px")],s.prototype,"popupHeight",void 0),le([t.Property("100%")],s.prototype,"popupWidth",void 0),le([t.Property(!1)],s.prototype,"readonly",void 0),le([t.Property(null)],s.prototype,"text",void 0),le([t.Property(null)],s.prototype,"value",void 0),le([t.Property(!1)],s.prototype,"allowObjectBinding",void 0),s=le([t.NotifyPropertyChanges],s)}(j),re=function(){var e=function(t,i){return(e=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])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),oe=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(l=e[r])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};q.root="e-autocomplete",q.icon="e-input-group-icon e-ddl-icon e-search-icon";var he=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.isFiltered=!1,s.searchList=!1,s}return re(s,e),s.prototype.preRender=function(){e.prototype.preRender.call(this)},s.prototype.getLocaleName=function(){return"auto-complete"},s.prototype.getNgDirective=function(){return"EJS-AUTOCOMPLETE"},s.prototype.getQuery=function(e){var s=e?e.clone():this.query?this.query.clone():new i.Query,l=this.allowObjectBinding&&!t.isNullOrUndefined(this.value)?t.getValue(this.fields.value?this.fields.value:"",this.value):this.value,n=""!==this.queryString||t.isNullOrUndefined(l)?this.filterType:"equal",a=""!==this.queryString||t.isNullOrUndefined(l)?this.queryString:l;if(this.isFiltered)if(this.enableVirtualization&&!t.isNullOrUndefined(this.customFilterQuery))s=this.customFilterQuery.clone();else if(!this.enableVirtualization)return s;if(null!==this.queryString&&""!==this.queryString){var r=this.typeOfData(this.dataSource).typeof;if((this.dataSource instanceof i.DataManager||"string"!==r)&&"number"!==r){var o=t.isNullOrUndefined(this.fields.value)?"":this.fields.value;s.where(o,n,a,this.ignoreCase,this.ignoreAccent)}else s.where("",n,a,this.ignoreCase,this.ignoreAccent)}if(!t.isNullOrUndefined(this.suggestionCount)&&!this.enableVirtualization){if(20!==this.suggestionCount)for(c=0;c<s.queries.length;c++)"onTake"===s.queries[c].fn&&s.queries.splice(c,1);s.take(this.suggestionCount)}if(this.enableVirtualization){var h=0,u=0,p=this.getTakeValue();if(s&&s.queries.length>0)for(c=0;c<s.queries.length;c++)"onSkip"===s.queries[c].fn&&(u=s.queries[c].e.nos),"onTake"===s.queries[c].fn&&(h=p<=s.queries[c].e.nos?s.queries[c].e.nos:p);if(h<=0&&this.query&&this.query.queries.length>0)for(c=0;c<this.query.queries.length;c++)if("onTake"===this.query.queries[c].fn){var d=this.query.queries[c].e.nos;h=p<=d?d:p}if(s&&s.queries.length>0)for(var c=0;c<s.queries.length;c++)if("onSkip"!==s.queries[c].fn){if("onTake"===s.queries[c].fn){var m=s.queries[c].e.nos;h=m<=h?h:m,s.queries.splice(c,1),--c}}else u=s.queries[c].e.nos,s.queries.splice(c,1),--c;u>0&&this.virtualItemStartIndex<=u?s.skip(u):s.skip(this.virtualItemStartIndex),h>0&&p<=h?s.take(h):s.take(p),s.requiresCount()}return s},s.prototype.performFiltering=function(e){var t=this,i={preventDefaultAction:!1,text:this.filterInput?this.filterInput.value:null,updateData:function(e,s,l){i.cancel||(t.isFiltered=!0,t.customFilterQuery=s,t.filterAction(e,s,l))},cancel:!1};this.trigger("filtering",i,function(i){i.cancel||t.isFiltered||i.preventDefaultAction||(t.searchList=!0,t.filterAction(t.dataSource,null,t.fields,e))})},s.prototype.searchLists=function(i){if(this.isTyped=!0,this.isDataFetched=this.isSelectCustom=!1,this.firstItem=this.dataSource&&this.dataSource.length>0?this.dataSource[0]:null,this.checkAndResetCache(),t.isNullOrUndefined(this.list)&&e.prototype.renderList.call(this,i,!0),this.queryString=this.filterInput.value,"mousedown"!==i.type&&(40===i.keyCode||38===i.keyCode))return this.queryString=""===this.queryString?null:this.queryString,this.beforePopupOpen=!0,void this.resetList(this.dataSource,this.fields,null,i);this.isSelected=!1,this.activeIndex=null,this.isRequesting=!1,""!==this.queryString&&this.debounceDelay>0?this.debouncedFiltering(i,this.debounceDelay):this.performFiltering(i)},s.prototype.filter=function(e,t,i){this.isFiltered=!0,this.filterAction(e,t,i)},s.prototype.filterAction=function(e,t,s,l){this.beforePopupOpen=!0;var n=this.list.classList.contains("e-nodata");if(""!==this.queryString&&this.queryString.length>=this.minLength){if(this.enableVirtualization&&this.isFiltering()&&this.isTyped&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null),this.resetList(e,s,t,l),n=this.list.classList.contains("e-nodata"),this.enableVirtualization&&!n&&(!this.list.querySelector(".e-virtual-ddl-content")&&this.list.querySelector(".e-list-parent")&&((a=this.createElement("div",{className:"e-virtual-ddl-content"})).style.cssText=this.getTransformValues(),this.list.appendChild(a).appendChild(this.list.querySelector(".e-list-parent"))),!this.list.querySelector(".e-virtual-ddl")&&this.list.parentElement)){var a=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"});a.style.cssText=this.GetVirtualTrackHeight(),this.list.parentElement.querySelector(".e-dropdownbase").appendChild(a)}("autocomplete"===this.getModuleName()&&!(this.dataSource instanceof i.DataManager)||"autocomplete"===this.getModuleName()&&this.dataSource instanceof i.DataManager&&0!==this.totalItemCount)&&this.getFilteringSkeletonCount()}else this.hidePopup(l),this.beforePopupOpen=!1;this.renderReactTemplates()},s.prototype.clearAll=function(i,s){(t.isNullOrUndefined(s)||!t.isNullOrUndefined(s)&&t.isNullOrUndefined(s.dataSource))&&(e.prototype.clearAll.call(this,i),this.checkAndResetCache()),this.beforePopupOpen&&this.hidePopup()},s.prototype.onActionComplete=function(s,l,n,a){this.enableVirtualization||(this.fixedHeaderElement=null),("autocomplete"===this.getModuleName()&&!(this.dataSource instanceof i.DataManager)||"autocomplete"===this.getModuleName()&&this.dataSource instanceof i.DataManager&&0!==this.totalItemCount)&&this.getFilteringSkeletonCount(),e.prototype.onActionComplete.call(this,s,l,n);var r=this.list.querySelector("."+q.li);t.isNullOrUndefined(r)||t.removeClass([r],q.focus),t.isNullOrUndefined(this.itemData)||this.enableVirtualization||this.focusIndexItem(),this.postBackAction()},s.prototype.postBackAction=function(){if(this.autofill&&!t.isNullOrUndefined(this.liCollections[0])&&this.searchList){var i=[this.liCollections[0]],s=this.listData,l=this.typeOfData(s).typeof,n=u(this.inputElement.value,i,"StartsWith",this.ignoreCase,s,this.fields,l);this.searchList=!1,t.isNullOrUndefined(n.item)||e.prototype.setAutoFill.call(this,this.liCollections[0],!0)}},s.prototype.setSelection=function(i,s){if(!this.isValidLI(i))return void(this.selectedLI=i);if(!t.isNullOrUndefined(s)&&"keydown"===s.type&&"enter"!==s.action&&"tab"!==s.action&&this.isValidLI(i)){var l=this.getFormattedValue(i.getAttribute("data-value"));if(this.activeIndex=this.getIndexByValue(l),this.setHoverList(i),this.selectedLI=i,this.setScrollPosition(s),this.autofill&&this.isPopupOpen){this.preventAutoFill=!1;var n=s&&"down"===s.action||"up"===s.action||"home"===s.action||"end"===s.action||"pageUp"===s.action||"pageDown"===s.action;e.prototype.setAutoFill.call(this,i,n)}}else e.prototype.setSelection.call(this,i,s),this.isFiltered=!1},s.prototype.listOption=function(i,s){var l=this,n=e.prototype.listOption.call(this,i,s);if(t.isNullOrUndefined(n.itemCreated))n.itemCreated=function(e){l.highlight&&(l.element.tagName===l.getNgDirective()&&l.itemTemplate?setTimeout(function(){c(e.item,l.queryString,l.ignoreCase,l.filterType)},0):c(e.item,l.queryString,l.ignoreCase,l.filterType))};else{var a=n.itemCreated;n.itemCreated=function(e){l.highlight&&c(e.item,l.queryString,l.ignoreCase,l.filterType),a.apply(l,[e])}}return n},s.prototype.isFiltering=function(){return!0},s.prototype.renderPopup=function(t){this.enableVirtualization||(this.list.scrollTop=0),e.prototype.renderPopup.call(this,t)},s.prototype.isEditTextBox=function(){return!1},s.prototype.isPopupButton=function(){return this.showPopupButton},s.prototype.isSelectFocusItem=function(e){return!1},s.prototype.setInputValue=function(e,s){var l=s&&s.text?s.text:s?s.value:s,n=e&&e.text?e.text:e&&e.value?e.value:this.value;if(this.allowObjectBinding&&(l=t.isNullOrUndefined(l)?l:t.getValue(this.fields.value?this.fields.value:"",l),n=t.isNullOrUndefined(n)?n:t.getValue(this.fields.value?this.fields.value:"",n)),!n||""!==this.typedString||this.allowCustom||this.dataSource instanceof i.DataManager)e&&(e.text?this.setOldText(l):this.setOldValue(l));else{var a="string"===this.typeOfData(this.dataSource).typeof?"":this.fields.value,r=this.getItems().length,o=new i.Query,h=this;new i.DataManager(this.dataSource).executeQuery(o.where(new i.Predicate(a,"equal",n))).then(function(t){t.result.length>0?(h.value=""!==a?h.allowObjectBinding?t.result[0]:t.result[0][h.fields.value].toString():t.result[0].toString(),h.addItem(t.result,r),h.updateValues()):e&&e.text?h.setOldText(l):e&&e.value?h.setOldValue(l):h.updateValues()})}},s.prototype.showPopup=function(e){if(this.enabled){if(this.beforePopupOpen)return void this.refreshPopup();this.beforePopupOpen=!0,this.preventAutoFill=!0,t.isNullOrUndefined(this.list)?this.renderList(e):this.resetList(this.dataSource,this.fields,null,e)}},s.prototype.hidePopup=function(t){e.prototype.hidePopup.call(this,t),this.activeIndex=null,this.virtualListInfo=this.viewPortInfo,this.previousStartIndex=this.viewPortInfo.startIndex,this.startIndex=this.viewPortInfo.startIndex,this.previousEndIndex=this.viewPortInfo.endIndex},s.prototype.onPropertyChanged=function(i,s){"autocomplete"===this.getModuleName()&&this.setUpdateInitial(["fields","query","dataSource"],i);for(var l=0,n=Object.keys(i);l<n.length;l++){var r=n[l];switch(r){case"showPopupButton":if(this.showPopupButton){var o=a.Input.appendSpan(q.icon,this.inputWrapper.container,this.createElement);this.inputWrapper.buttons[0]=o,a.Input.calculateWidth(this.inputElement,this.inputWrapper.container),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.isNullOrUndefined(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon"),this.inputWrapper&&this.inputWrapper.buttons&&this.inputWrapper.buttons[0]&&t.EventHandler.add(this.inputWrapper.buttons[0],"click",this.dropDownClick,this)}else t.detach(this.inputWrapper.buttons[0]),this.inputWrapper.buttons[0]=null;break;default:var h=this.getPropObject(r,i,s);e.prototype.onPropertyChanged.call(this,h.newProperty,h.oldProperty)}}},s.prototype.renderHightSearch=function(){if(this.highlight)for(var e=0;e<this.liCollections.length;e++){var t=this.ulElement.querySelector(".e-active");t||(f(this.liCollections[e]),c(this.liCollections[e],this.queryString,this.ignoreCase,this.filterType)),t=null}},s.prototype.getModuleName=function(){return"autocomplete"},s.prototype.render=function(){e.prototype.render.call(this)},oe([t.Complex({value:null,iconCss:null,groupBy:null,disabled:null},P)],s.prototype,"fields",void 0),oe([t.Property(!0)],s.prototype,"ignoreCase",void 0),oe([t.Property(!1)],s.prototype,"showPopupButton",void 0),oe([t.Property(!1)],s.prototype,"highlight",void 0),oe([t.Property(20)],s.prototype,"suggestionCount",void 0),oe([t.Property({})],s.prototype,"htmlAttributes",void 0),oe([t.Property(null)],s.prototype,"query",void 0),oe([t.Property(1)],s.prototype,"minLength",void 0),oe([t.Property("Contains")],s.prototype,"filterType",void 0),oe([t.Event()],s.prototype,"filtering",void 0),oe([t.Property(null)],s.prototype,"index",void 0),oe([t.Property("Never")],s.prototype,"floatLabelType",void 0),oe([t.Property(null)],s.prototype,"valueTemplate",void 0),oe([t.Property(null)],s.prototype,"filterBarPlaceholder",void 0),oe([t.Property(!1)],s.prototype,"allowFiltering",void 0),oe([t.Property(null)],s.prototype,"text",void 0),s=oe([t.NotifyPropertyChanges],s)}(ae),ue="e-float-line",pe="e-float-text",de="e-label-top",ce="e-label-bottom",me=function(){var e=function(t,i){return(e=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])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),fe=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(l=e[r])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},ve="e-input-focus",ge="e-hide-listitem",ye="e-chips",Ce="e-chip-selected",be=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.clearIconWidth=0,s.previousFilterText="",s.storedSelectAllHeight=0,s.isUpdateHeaderHeight=!1,s.isUpdateFooterHeight=!1,s.isBlurDispatching=!1,s.isFilterPrevented=!1,s.isFilteringAction=!1,s.isValidKey=!1,s.selectAllEventData=[],s.selectAllEventEle=[],s.preventSetCurrentData=!1,s.isSelectAllLoop=!1,s.scrollFocusStatus=!1,s.keyDownStatus=!1,s}return me(s,e),s.prototype.enableRTL=function(e){e?this.overAllWrapper.classList.add("e-rtl"):this.overAllWrapper.classList.remove("e-rtl"),this.popupObj&&(this.popupObj.enableRtl=e,this.popupObj.dataBind())},s.prototype.requiredModules=function(){var e=[];if(this.enableVirtualization&&e.push({args:[this],member:"VirtualScroll"}),"CheckBox"===this.mode){if(this.isGroupChecking=this.enableGroupCheckBox,this.enableGroupCheckBox){var t=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.enableSelectionOrder=!1,this.isProtectedOnChange=t}this.allowCustomValue=!1,this.hideSelectedItem=!1,this.closePopupOnSelect=!1,e.push({member:"CheckBoxSelection",args:[this]})}return e},s.prototype.updateHTMLAttribute=function(){if(Object.keys(this.htmlAttributes).length)for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];switch(s){case"class":var l=this.htmlAttributes[""+s].replace(/\s+/g," ").trim();""!==l&&(t.addClass([this.overAllWrapper],l.split(" ")),t.addClass([this.popupWrapper],l.split(" ")));break;case"disabled":this.enable(!1);break;case"placeholder":this.placeholder||(this.inputElement.setAttribute(s,this.htmlAttributes[""+s]),this.setProperties({placeholder:this.inputElement.placeholder},!0),this.refreshPlaceHolder());break;default:var n=["name","required","aria-required","form"],a=["title","role","style","class"];["id"].indexOf(s)>-1?this.element.setAttribute(s,this.htmlAttributes[""+s]):0===s.indexOf("data")||n.indexOf(s)>-1?this.hiddenElement.setAttribute(s,this.htmlAttributes[""+s]):a.indexOf(s)>-1?this.overAllWrapper.setAttribute(s,this.htmlAttributes[""+s]):"size"===s||t.isNullOrUndefined(this.inputElement)||this.inputElement.setAttribute(s,this.htmlAttributes[""+s])}}},s.prototype.updateReadonly=function(e){t.isNullOrUndefined(this.inputElement)||(e||"CheckBox"===this.mode?this.inputElement.setAttribute("readonly","true"):this.inputElement.removeAttribute("readonly"))},s.prototype.updateClearButton=function(e){e?(this.overAllClear.parentNode?this.overAllClear.style.display="":this.componentWrapper.appendChild(this.overAllClear),this.componentWrapper.classList.remove("e-close-icon-hide")):(this.overAllClear.style.display="none",this.componentWrapper.classList.add("e-close-icon-hide"))},s.prototype.updateCssClass=function(){if(!t.isNullOrUndefined(this.cssClass)&&""!==this.cssClass){var e=this.cssClass;""!==(e=this.cssClass.replace(/\s+/g," ").trim())&&(t.addClass([this.overAllWrapper],e.split(" ")),t.addClass([this.popupWrapper],e.split(" ")))}},s.prototype.updateOldPropCssClass=function(e){t.isNullOrUndefined(e)||""===e||""!==(e=e.replace(/\s+/g," ").trim())&&(t.removeClass([this.overAllWrapper],e.split(" ")),t.removeClass([this.popupWrapper],e.split(" ")))},s.prototype.onPopupShown=function(e){var i=this;if(t.Browser.isDevice&&"CheckBox"===this.mode&&this.allowFiltering){var s=this;window.onpopstate=function(){s.hidePopup(),s.inputElement.focus()},history.pushState({},"")}var l={name:"FadeIn",duration:100},n={popup:this.popupObj,event:e,cancel:!1,animation:l};this.trigger("open",n,function(e){e.cancel||(i.focusAtFirstListItem(!0),i.popupObj&&document.body.appendChild(i.popupObj.element),"CheckBox"===i.mode&&i.enableGroupCheckBox&&!t.isNullOrUndefined(i.fields.groupBy)&&i.updateListItems(i.list.querySelectorAll("li.e-list-item"),i.mainList.querySelectorAll("li.e-list-item")),("CheckBox"===i.mode||i.showDropDownIcon)&&t.addClass([i.overAllWrapper],["e-icon-anim"]),i.refreshPopup(),i.renderReactTemplates(),i.popupObj&&i.popupObj.show(e.animation,1e3===i.zIndex?i.element:null),i.isReact&&setTimeout(function(){if(i.popupHeight&&i.list&&"auto"!==i.popupHeight){var e="string"==typeof i.popupHeight?parseInt(i.popupHeight,10):i.popupHeight;if(!i.isUpdateHeaderHeight&&i.headerTemplate&&i.header){t=""===i.list.style.maxHeight?e:parseInt(i.list.style.maxHeight,10);i.list.style.maxHeight=(t-i.header.offsetHeight).toString()+"px",i.isUpdateHeaderHeight=!0}if(!i.isUpdateFooterHeight&&i.footerTemplate&&i.footer){var t=""===i.list.style.maxHeight?e:parseInt(i.list.style.maxHeight,10);i.list.style.maxHeight=(t-i.footer.offsetHeight).toString()+"px",i.isUpdateFooterHeight=!0}}},15),t.attributes(i.inputElement,{"aria-expanded":"true","aria-owns":i.element.id+"_popup","aria-controls":i.element.id}),i.updateAriaActiveDescendant(),i.isFirstClick&&(i.enableVirtualization||i.loadTemplate()),"CheckBox"===i.mode&&i.showSelectAll&&t.EventHandler.add(i.popupObj.element,"click",i.clickHandler,i))})},s.prototype.updateVirtualReOrderList=function(e){var t=this.getForQuery(this.value,!0).clone();if(this.isVirtualReorder=!0,this.enableVirtualization&&this.dataSource instanceof i.DataManager?this.resetList(this.selectedListData,this.fields,t):this.resetList(this.dataSource,this.fields,t),this.UpdateSkeleton(),this.isVirtualReorder=!1,this.liCollections=this.list.querySelectorAll("."+H.li),this.virtualItemCount=this.itemCount,"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.list.querySelector(".e-virtual-ddl"))this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight();else{var s=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"});s.style.cssText=this.GetVirtualTrackHeight(),this.popupWrapper.querySelector(".e-dropdownbase").appendChild(s)}this.list.querySelector(".e-virtual-ddl-content")&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()),e&&this.loadTemplate()},s.prototype.updateListItems=function(e,t){for(var i=0;i<e.length;i++)this.findGroupStart(e[i]),this.findGroupStart(t[i]);this.deselectHeader()},s.prototype.loadTemplate=function(){if(this.refreshListItems(null),this.enableVirtualization&&this.list&&"CheckBox"===this.mode){var e=this.list.querySelectorAll(".e-reorder")[0];this.list.querySelector(".e-virtual-ddl-content")&&e&&this.list.querySelector(".e-virtual-ddl-content").removeChild(e)}"CheckBox"===this.mode&&this.removeFocus(),this.notify("reOrder",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,e:this}),this.isPreventScrollAction=!0},s.prototype.setScrollPosition=function(){if((!this.hideSelectedItem&&"CheckBox"!==this.mode||"CheckBox"===this.mode&&!this.enableSelectionOrder)&&!t.isNullOrUndefined(this.value)&&this.value.length>0){var e=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",this.value[this.value.length-1]):this.value[this.value.length-1],i=this.findListElement(this.hideSelectedItem?this.ulElement:this.list,"li","data-value",e);t.isNullOrUndefined(i)||this.scrollBottom(i,void 0,!1,null,!0)}if(this.enableVirtualization){var s=this.list.querySelector("."+H.focus);this.isKeyBoardAction=!1,this.scrollBottom(s,void 0,!1,null,!0)}},s.prototype.updatePopupHeightOnFilter=function(){if(this.allowFiltering&&this.allowResize&&this.keyboardEvent&&this.allowResize&&this.popupObj&&this.list){var e=this.inputElement&&this.inputElement.value,t=this.list.querySelectorAll("li.e-list-item:not(.e-hide-listitem):not(.e-disabled)"),i=e&&e.length>0;if(i&&t.length>0){var s=t[0].offsetHeight,l=t.length*s;this.popupObj.element.style.maxHeight=l+16+"px",this.list.style.maxHeight=l+"px"}else if(!i){var n=this.resizeHeight||parseInt(this.popupHeight,10);this.popupObj.element.style.maxHeight=n+"px",this.list.style.maxHeight=n+"px",this.setResize()}}},s.prototype.focusAtFirstListItem=function(e){if(this.ulElement&&this.ulElement.querySelector("li."+H.li)){var t=void 0;if("CheckBox"===this.mode)return void this.removeFocus();if(this.enableVirtualization){if(this.fields.disabled)t=this.ulElement.querySelector("li."+H.li+":not(.e-virtual-list):not(.e-hide-listitem):not(.e-disabled)"),e&&this.viewPortInfo&&0!==this.viewPortInfo.startIndex&&(t=(i=this.ulElement.querySelectorAll("li."+H.li+":not(.e-virtual-list):not(.e-hide-listitem)"))&&i.length>0?i[2]:t);else if(t=this.ulElement.querySelector("li."+H.li+":not(.e-virtual-list):not(.e-hide-listitem)"),e&&this.viewPortInfo&&0!==this.viewPortInfo.startIndex){var i=this.ulElement.querySelectorAll("li."+H.li+":not(.e-virtual-list):not(.e-hide-listitem)");t=i&&i.length>0?i[2]:t}}else t=this.fields.disabled?this.ulElement.querySelector("li."+H.li+":not(."+ge+"):not(.e-disabled)"):this.ulElement.querySelector("li."+H.li+":not(."+ge+")");null!==t&&(this.removeFocus(),this.addListFocus(t))}},s.prototype.focusAtLastListItem=function(e){var i;e?i=u(e,this.liCollections,"StartsWith",this.ignoreCase):this.value&&this.value.length?u(this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",this.value[this.value.length-1]):this.value[this.value.length-1],this.liCollections,"StartsWith",this.ignoreCase):i=null,i&&null!==i.item&&(this.addListFocus(i.item),((this.allowCustomValue||this.allowFiltering)&&this.isPopupOpen()&&this.closePopupOnSelect&&!this.enableVirtualization||this.closePopupOnSelect&&!this.enableVirtualization)&&this.scrollBottom(i.item,i.index))},s.prototype.getAriaAttributes=function(){return{"aria-disabled":"false",role:"combobox","aria-expanded":"false"}},s.prototype.updateListARIA=function(){t.isNullOrUndefined(this.ulElement)||t.attributes(this.ulElement,{id:this.element.id+"_options",role:"listbox","aria-hidden":"false","aria-label":"list"});var e=!(t.isNullOrUndefined(this.inputElement)||!this.inputElement.disabled);this.isPopupOpen()||t.isNullOrUndefined(this.inputElement)||t.attributes(this.inputElement,this.getAriaAttributes()),e&&t.attributes(this.inputElement,{"aria-disabled":"true"}),this.ensureAriaDisabled(e?"true":"false")},s.prototype.ensureAriaDisabled=function(e){if(this.htmlAttributes&&this.htmlAttributes["aria-disabled"]){var i=this.htmlAttributes;t.extend(i,{"aria-disabled":e},i),this.setProperties({htmlAttributes:i},!0)}},s.prototype.removelastSelection=function(e){if(null!==this.chipCollectionWrapper.querySelector("span."+Ce))return void this.removeSelectedChip(e);var i=this.chipCollectionWrapper.querySelectorAll("span.e-chips"),s=i[i.length-1].getAttribute("data-value");t.isNullOrUndefined(this.value)||(this.tempValues=(this.allowObjectBinding,this.value.slice()));var l=this.allowObjectBinding?this.enableVirtualization?this.getVirtualDataByValue(this.getFormattedValue(s)):this.getDataByValue(this.getFormattedValue(s)):this.getFormattedValue(s);this.allowCustomValue&&("false"!==s&&!1===l||!t.isNullOrUndefined(l)&&"NaN"===l.toString())&&(l=s),this.removeValue(l,e),this.removeChipSelection(),this.updateDelimeter(this.delimiterChar,e),this.makeTextBoxEmpty(),this.mainList&&this.listData&&this.refreshSelection(),this.checkPlaceholderSize()},s.prototype.onActionFailure=function(t){e.prototype.onActionFailure.call(this,t),this.renderPopup(),this.onPopupShown()},s.prototype.targetElement=function(){return this.targetInputElement=this.inputElement,"CheckBox"===this.mode&&this.allowFiltering&&this.notify("targetElement",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),this.targetInputElement?this.targetInputElement.value:null},s.prototype.getForQuery=function(e,s){var l,n=this.isPrimitiveData?"":this.fields.value;if(this.enableVirtualization&&e){if(s){for(var a=this.viewPortInfo.startIndex,r=a+this.viewPortInfo.endIndex<=e.length&&e[a+this.viewPortInfo.endIndex]?a+this.viewPortInfo.endIndex:e.length,o=a;o<r;o++){h=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",e[o]):e[o];l=o===a?new i.Predicate(n,"equal",h):l.or(n,"equal",h)}return(new i.Query).where(l)}for(o=0;o<e.length;o++){var h=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",e[o]):e[o];l=this.isaddNonPresentItems?0===o?new i.Predicate(n,"equal",e[o]):l.or(n,"equal",e[o]):0===o?l=new i.Predicate(n,"notequal",h):l.and(n,"notequal",h)}return(new i.Query).where(l)}for(o=0;o<e.length;o++)l=0===o?new i.Predicate(n,"equal",e[o]):l.or(n,"equal",e[o]);return this.dataSource instanceof i.DataManager&&this.dataSource.adaptor instanceof i.JsonAdaptor?(new i.Query).where(l):this.getQuery(this.query).clone().where(l)},s.prototype.onActionComplete=function(s,l,n,a){var r=this;this.dataSource instanceof i.DataManager&&!t.isNullOrUndefined(n)&&!this.virtualGroupDataSource&&(this.totalItemCount=n.count),this.value&&l&&l.length>0&&this.allowFiltering&&"CheckBox"!==this.mode&&!this.enableVirtualization&&!this.isFilterPrevented&&!this.allowCustomValue&&this.isFilteringAction&&l.every(function(e){var i=t.getValue(r.fields.value?r.fields.value:"",e);return r.value.some(function(e){var s=r.allowObjectBinding?t.getValue(r.fields.value?r.fields.value:"",e):e;return i===s})})&&(s.innerHTML="",l=[]),e.prototype.onActionComplete.call(this,s,l,n),this.skeletonCount=0!==this.totalItemCount&&this.totalItemCount<2*this.itemCount&&(!(this.dataSource instanceof i.DataManager)||this.dataSource instanceof i.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,this.updateSelectElementData(this.allowFiltering);var o=this;if(!t.isNullOrUndefined(this.value)&&!this.allowCustomValue&&!this.enableVirtualization&&this.listData&&this.listData.length>0)for(var h=0;h<this.value.length;h++){var u=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",o.value[h]):o.value[h];this.findListElement(this.allowFiltering&&!t.isNullOrUndefined(this.mainList)?this.mainList:s,"li","data-value",u)||this.dataSource instanceof i.DataManager||(this.value.splice(h,1),h-=1)}var p=[];t.isNullOrUndefined(this.value)||(p=this.presentItemValue(this.ulElement));var d=p.some(function(e){return null!==e});if(p.length>0&&this.dataSource instanceof i.DataManager&&!t.isNullOrUndefined(this.value)&&null!=this.listData&&(!this.enableVirtualization||this.enableVirtualization&&this.valueTemplate)&&d?(this.isaddNonPresentItems=!0,this.addNonPresentItems(p,this.ulElement,this.listData),this.isaddNonPresentItems=!1):this.updateActionList(s,l,n),this.dataSource instanceof i.DataManager&&this.allowCustomValue&&!this.isCustomRendered&&this.inputElement.value&&""!==this.inputElement.value){var c=new i.Query;c=this.allowFiltering?c.where(this.fields.text,"startswith",this.inputElement.value,this.ignoreCase,this.ignoreAccent):c,this.checkForCustomValue(c,this.fields),this.isCustomRendered=!0,this.remoteCustomValue=!this.enableVirtualization&&this.remoteCustomValue}"CheckBox"!==this.mode||!this.enableGroupCheckBox||t.isNullOrUndefined(this.fields.groupBy)||t.isNullOrUndefined(this.fields.disabled)||this.disableGroupHeader(),this.dataSource instanceof i.DataManager&&"CheckBox"===this.mode&&this.allowFiltering&&this.removeFocus()},s.prototype.updateActionList=function(e,s,l,n){"CheckBox"===this.mode&&this.showSelectAll&&this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),this.mainList||this.mainData?(t.isNullOrUndefined(this.mainData)||0===this.mainData.length)&&(this.mainData=s):(this.mainList=e.cloneNode?e.cloneNode(!0):e,this.mainData=s,this.mainListCollection=this.liCollections),(this.remoteCustomValue||s.length<=0)&&this.allowCustomValue&&this.inputFocus&&this.allowFiltering&&this.inputElement.value&&""!==this.inputElement.value&&(this.checkForCustomValue(this.tempQuery,this.fields),this.isCustomRendered)||(this.value&&this.value.length&&("CheckBox"!==this.mode&&!t.isNullOrUndefined(this.inputElement)&&""!==this.inputElement.value.trim()||"CheckBox"===this.mode||(8===this.keyCode||46===this.keyCode)&&this.allowFiltering&&this.allowCustomValue&&this.dataSource instanceof i.DataManager&&""===this.inputElement.value)&&this.refreshSelection(),this.updateListARIA(),this.unwireListEvents(),this.wireListEvents(),t.isNullOrUndefined(this.setInitialValue)||this.setInitialValue(),t.isNullOrUndefined(this.selectAllAction)||this.selectAllAction(),this.setDynValue&&(t.isNullOrUndefined(this.text)||!t.isNullOrUndefined(this.value)&&0!==this.value.length||this.initialTextUpdate(),this.enableVirtualization?this.dataSource instanceof i.DataManager||this.initialValueUpdate():this.isRemoveSelection?this.initialValueUpdate():this.initialValueUpdate(this.listData,!0),this.initialUpdate(),this.refreshPlaceHolder(),"CheckBox"!==this.mode&&this.changeOnBlur&&this.updateValueState(null,this.value,null)),this.renderPopup(),this.beforePopupOpen&&(this.beforePopupOpen=!1,this.onPopupShown(l)))},s.prototype.refreshSelection=function(){var e,i,s=this.hideSelectedItem?ge:H.selected;if(!t.isNullOrUndefined(this.value))for(var l=0;!t.isNullOrUndefined(this.value[l]);l++)if(e=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",this.value[l]):this.value[l],i=this.findListElement(this.list,"li","data-value",e)){if(t.addClass([i],s),this.hideSelectedItem&&i.previousSibling&&i.previousElementSibling.classList.contains(H.group)&&(!i.nextElementSibling||i.nextElementSibling.classList.contains(H.group))&&t.addClass([i.previousElementSibling],s),this.hideSelectedItem&&this.fields.groupBy&&!i.previousElementSibling.classList.contains(ge)&&this.hideGroupItem(e),this.hideSelectedItem&&i.classList.contains(H.focus)){t.removeClass([i],H.focus);var n=i.parentElement.querySelectorAll("."+H.li+":not(."+ge+"):not(.e-disabled)");n.length>0?(t.addClass([n[0]],H.focus),this.updateAriaActiveDescendant()):this.list&&this.list.querySelectorAll("."+H.li).length>0||(this.l10nUpdate(),t.addClass([this.list],H.noData))}if(i.setAttribute("aria-selected","true"),"CheckBox"===this.mode&&i.classList.contains("e-active")&&0===i.getElementsByClassName("e-check").length){var a={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:i,e:null};this.notify("updatelist",a)}}this.checkSelectAll(),this.checkMaxSelection()},s.prototype.hideGroupItem=function(e){var i,s,l=this.hideSelectedItem?ge:H.selected;s=i=this.findListElement(this.ulElement,"li","data-value",e);var n=0,a=0,r=!0,o=!0;do{i&&i.previousElementSibling&&!i.previousElementSibling.classList.contains(ge)&&i.previousElementSibling.classList.contains(H.li)&&(r=!1),!r||!i||i.previousElementSibling&&i.previousElementSibling.classList.contains(H.group)?n=10:i=i.previousElementSibling,s&&s.nextElementSibling&&!s.nextElementSibling.classList.contains(ge)&&s.nextElementSibling.classList.contains(H.li)&&(o=!1),!o||!s||s.nextElementSibling&&s.nextElementSibling.classList.contains(H.group)?a=10:s=s.nextElementSibling}while(n<10||a<10);r&&o&&!i.previousElementSibling.classList.contains(ge)?t.addClass([i.previousElementSibling],l):r&&o&&i.previousElementSibling.classList.contains(ge)&&t.removeClass([i.previousElementSibling],l)},s.prototype.getValidLi=function(){var e=this.ulElement.querySelector("li."+H.li+":not(."+ge+")");return t.isNullOrUndefined(e)?this.liCollections[0]:e},s.prototype.checkSelectAll=function(){var e=t.isNullOrUndefined(this.fields.disabled)?this.list.querySelectorAll("li.e-list-group-item.e-active").length:this.list.querySelectorAll("li.e-list-group-item.e-active:not(.e-disabled)").length,i=this.list.querySelectorAll("li.e-list-item"),s=this.enableVirtualization?this.list.querySelectorAll("li."+H.li+":not(.e-virtual-list)").length:t.isNullOrUndefined(this.fields.disabled)?this.list.querySelectorAll("li."+H.li).length:this.list.querySelectorAll("li."+H.li+":not(.e-disabled)").length,l=this.list.querySelectorAll("li."+H.selected).length;if(this.enableGroupCheckBox&&!t.isNullOrUndefined(this.fields.groupBy)&&(l-=e),!this.enableVirtualization&&(s===l||l===this.maximumSelectionLength)&&"CheckBox"===this.mode&&this.showSelectAll||this.enableVirtualization&&"CheckBox"===this.mode&&this.showSelectAll&&this.value&&this.value.length===this.totalItemCount?this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"check"}):s!==l&&"CheckBox"===this.mode&&this.showSelectAll&&this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"uncheck"}),this.enableGroupCheckBox&&this.fields.groupBy&&!this.enableSelectionOrder){for(var n=0;n<i.length;n++)this.findGroupStart(i[n]);this.deselectHeader()}},s.prototype.openClick=function(e){this.openOnClick||"CheckBox"===this.mode||this.isPopupOpen()?this.openOnClick||"CheckBox"!==this.mode||this.isPopupOpen()||this.showPopup():""!==this.targetElement()?this.showPopup():this.hidePopup(e)},s.prototype.keyUp=function(e){if("CheckBox"===this.mode&&!this.openOnClick){var i=String.fromCharCode(e.keyCode).match(/\w/);t.isNullOrUndefined(i)||(this.isValidKey=!0)}this.isValidKey=this.isPopupOpen()&&8===e.keyCode||this.isValidKey,this.isValidKey=(!e.ctrlKey||86!==e.keyCode)&&this.isValidKey,this.isValidKey&&this.inputElement&&(this.isValidKey=!1,this.expandTextbox(),this.showOverAllClear(),e.keyCode,this.search(e))},s.prototype.filter=function(e,t,i){this.isFiltered=!0,this.remoteFilterAction=!0,this.dataUpdater(e,t,i)},s.prototype.getQuery=function(e){var s=e?e.clone():this.query?this.query.clone():new i.Query;if(this.isFiltered){if(this.enableVirtualization&&!t.isNullOrUndefined(this.customFilterQuery))return s=this.customFilterQuery.clone(),this.virtualFilterQuery(s);if(!this.enableVirtualization)return s}if(this.isFilterAction){if(null!==this.targetElement()&&!this.enableVirtualization||this.enableVirtualization&&null!==this.targetElement()&&""!==this.targetElement().trim()){var l=this.typeOfData(this.dataSource).typeof;if((this.dataSource instanceof i.DataManager||"string"!==l)&&"number"!==l){if(this.enableVirtualization&&""!==this.targetElement()&&!this.isClearAllAction||!this.enableVirtualization){var n=this.fields;s.where(t.isNullOrUndefined(n.text)?"":n.text,this.filterType,this.targetElement(),this.ignoreCase,this.ignoreAccent)}}else s.where("",this.filterType,this.targetElement(),this.ignoreCase,this.ignoreAccent)}return this.enableVirtualization&&0!==this.viewPortInfo.endIndex&&!this.virtualSelectAll?this.virtualFilterQuery(s):this.virtualSelectAll?e?e.skip(0).take(this.maximumSelectionLength).requiresCount():this.query?this.query.skip(0).take(this.maximumSelectionLength).requiresCount():(new i.Query).skip(0).take(this.maximumSelectionLength).requiresCount():s}return this.enableVirtualization&&0!==this.viewPortInfo.endIndex&&!this.virtualSelectAll?this.virtualFilterQuery(s):this.virtualSelectAll?e?e.skip(0).take(this.maximumSelectionLength).requiresCount():this.query?this.query.skip(0).take(this.maximumSelectionLength).requiresCount():(new i.Query).skip(0).take(this.maximumSelectionLength).requiresCount():e||(this.query?this.query:new i.Query)},s.prototype.virtualFilterQuery=function(e){for(var t=this.getTakeValue(),i=!0,s=!0,l=0;l<e.queries.length;l++)"multiselect"===this.getModuleName()&&(e.queries[l].e&&"or"===e.queries[l].e.condition||e.queries[l].e&&"equal"===e.queries[l].e.operator)&&(i=!1),"onSkip"===e.queries[l].fn&&(s=!1),e.queries[l].fn;var n=0;if(e&&e.queries.length>0)for(l=0;l<e.queries.length;l++)"onTake"===e.queries[l].fn&&(n=t<=e.queries[l].e.nos?e.queries[l].e.nos:t);if(n<=0&&this.query&&this.query.queries.length>0)for(l=0;l<this.query.queries.length;l++)"onTake"===this.query.queries[l].fn&&(n=t<=this.query.queries[l].e.nos?this.query.queries[l].e.nos:t);if(e&&e.queries.length>0)for(l=0;l<e.queries.length;l++)"onTake"===e.queries[l].fn&&(n=e.queries[l].e.nos<=n?n:e.queries[l].e.nos,e.queries.splice(l,1),--l);return(this.allowFiltering&&s||!i||!this.allowFiltering&&s)&&!this.isVirtualReorder&&(i?e.skip(this.virtualItemStartIndex):e.skip(this.viewPortInfo.startIndex)),this.isIncrementalRequest?e.take(this.incrementalEndIndex):n>0?e.take(n):e.take(t),e.requiresCount(),this.customFilterQuery=null,e},s.prototype.getTakeValue=function(){return this.allowFiltering&&t.Browser.isDevice?Math.round(window.outerHeight/this.listItemHeight):this.itemCount},s.prototype.dataUpdater=function(e,t,s){this.isDataFetched=!1;var l=this.list.classList.contains(H.noData);if(""!==this.targetElement().trim()||this.allowCustomValue&&"CheckBox"!==this.mode&&""!==this.targetElement()){if(this.enableVirtualization&&this.allowFiltering&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null,this.list.querySelector(".e-list-parent.e-reorder")&&this.list.querySelector(".e-list-parent.e-reorder").remove()),this.resetList(e,s,t),this.enableVirtualization&&(l||this.allowCustomValue)&&!this.list.classList.contains(H.noData)){if(!this.list.querySelector(".e-virtual-ddl-content")){var n=this.createElement("div",{className:"e-virtual-ddl-content"});n.style.cssText=this.getTransformValues(),this.list.appendChild(n).appendChild(this.list.querySelector(".e-list-parent"))}if("CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),!this.list.querySelector(".e-virtual-ddl")){var a=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"});a.style.cssText=this.GetVirtualTrackHeight(),document.getElementsByClassName("e-multi-select-list-wrapper")[0].querySelector(".e-dropdownbase").appendChild(a)}}this.allowCustomValue&&(e instanceof i.DataManager?(this.remoteCustomValue=!0,this.tempQuery=t):this.checkForCustomValue(t,s))}else{var r=this.enableVirtualization?this.list.cloneNode(!0):this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;if(this.backCommand||this.enableVirtualization&&"CheckBox"===this.mode&&this.value&&this.value.length>0){this.remoteCustomValue=!1;var o=!1;this.allowCustomValue&&0===r.querySelectorAll("li").length&&this.mainData.length>0&&(this.mainData=[]),this.enableVirtualization&&(this.allowFiltering&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null),this.value&&this.value.length>0&&"CheckBox"===this.mode?(this.notify("setCurrentViewDataAsync",{component:this.getModuleName(),module:"VirtualScroll"}),o=!0):(this.totalItemCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.resetList(e,s,t),"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.UpdateSkeleton(),!l&&!this.allowCustomValue||this.list.classList.contains(H.noData)||(this.list.querySelector(".e-virtual-ddl-content")||((n=this.createElement("div",{className:"e-virtual-ddl-content"})).style.cssText=this.getTransformValues(),this.list.appendChild(n).appendChild(this.list.querySelector(".e-list-parent"))),this.list.querySelector(".e-virtual-ddl")||((a=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"})).style.cssText=this.GetVirtualTrackHeight(),document.getElementsByClassName("e-multi-select-list-wrapper")[0].querySelector(".e-dropdownbase").appendChild(a))))),this.onActionComplete(r,this.mainData),this.value&&this.value.length&&this.refreshSelection(),8!==this.keyCode&&this.focusAtFirstListItem(),o||this.notify("reOrder",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,e:this})}}this.enableVirtualization&&this.allowFiltering&&this.getFilteringSkeletonCount(),this.refreshPopup(),this.allowResize&&!this.isFilteringAction&&this.setResize(),"CheckBox"===this.mode&&this.removeFocus()},s.prototype.secureRandom=function(){var e=new Uint32Array(1);return window.crypto.getRandomValues(e),e[0]/4294967296},s.prototype.checkForCustomValue=function(e,s){var l=!this.getValueByText(this.inputElement.value,this.ignoreCase),n=s||this.fields;if(this.isCustomReset=!0,this.allowCustomValue&&l){var a=this.inputElement.value,r=!t.isNullOrUndefined(this.mainData)&&this.mainData.length>0?this.mainData[0]:this.mainData;if(r&&"string"!=typeof r&&"number"!=typeof r&&"boolean"!=typeof r){var o={};t.setValue(n.text,a,o),"number"==typeof t.getValue(this.fields.value?this.fields.value:"value",r)&&this.fields.value!==this.fields.text?t.setValue(n.value,this.secureRandom(),o):t.setValue(n.value,a,o);var h={};if(this.allowObjectBinding){var p=this.listData&&this.listData.length>0?Object.keys(this.listData[0]):this.firstItem?Object.keys(this.firstItem):Object.keys(o),d="number"==typeof t.getValue(this.fields.value?this.fields.value:"value",r)&&this.fields.value!==this.fields.text;p.forEach(function(e){h[e]=e===s.value||e===s.text?e===s.text&&d?t.getValue(s.text,o):t.getValue(s.value,o):null})}if(o=this.allowObjectBinding?h:o,this.enableVirtualization){this.virtualCustomData=o;var c=this.dataSource instanceof i.DataManager?JSON.parse(JSON.stringify(this.listData)):JSON.parse(JSON.stringify(this.dataSource));this.virtualCustomSelectData&&this.virtualCustomSelectData.length>0&&c.concat(this.virtualCustomSelectData),c.splice(0,0,o),this.isCustomDataUpdated=!0;var m=this.totalItemCount;this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=this.itemCount,this.resetList(c,n,e),this.isCustomDataUpdated=!1,this.totalItemCount=this.enableVirtualization&&this.dataSource instanceof i.DataManager?m:this.totalItemCount}else this.dataSource instanceof i.DataManager&&this.allowCustomValue&&this.allowFiltering&&(this.remoteCustomValue=!1),(c=JSON.parse(JSON.stringify(this.listData))).splice(0,0,o),this.resetList(c,n,e),this.focusAtLastListItem(a)}else this.listData&&((c=JSON.parse(JSON.stringify(this.listData))).splice(0,0,this.inputElement.value),c[0]="number"!=typeof r||isNaN(parseFloat(c[0]))?c[0]:parseFloat(c[0]),c[0]="boolean"==typeof r?"true"===c[0]||"false"!==c[0]&&c[0]:c[0],this.resetList(c,n),this.focusAtLastListItem(a))}else if(this.listData&&this.mainData&&!l&&this.allowCustomValue)if(this.allowFiltering&&this.isRemoteSelection&&this.remoteCustomValue)this.isRemoteSelection=!1,this.enableVirtualization||this.resetList(this.listData,n,e);else if(!this.allowFiltering&&this.list){var f=this.list.querySelectorAll("li."+H.li+":not(.e-hide-listitem)"),v=u(this.targetElement(),f,"StartsWith",this.ignoreCase);v&&null!==v.item&&this.addListFocus(v.item)}this.isCustomReset=!1,this.value&&this.value.length&&this.refreshSelection()},s.prototype.getNgDirective=function(){return"EJS-MULTISELECT"},s.prototype.wrapperClick=function(e){if(this.setDynValue=!1,this.keyboardEvent=null,this.isKeyBoardAction=!1,this.enabled){if(e.target===this.overAllClear)return void e.preventDefault();if(this.inputFocus||this.inputElement.focus(),!this.readonly){if(e.target&&-1!==e.target.classList.toString().indexOf("e-chips-close"))return void(this.isPopupOpen()&&this.refreshPopup());!this.isPopupOpen()&&(this.openOnClick||this.showDropDownIcon&&e.target&&"e-input-group-icon e-ddl-icon"===e.target.className)?this.showPopup(e):(this.hidePopup(e),"CheckBox"===this.mode&&(this.showOverAllClear(),this.inputFocus=!0,this.overAllWrapper.classList.contains(ve)||this.overAllWrapper.classList.add(ve)))}this.targetElement()&&""!==this.targetElement()||e.preventDefault(),this.checkAndScrollParent(),0===this.maximumSelectionLength&&this.checkMaxSelection()}},s.prototype.checkAndScrollParent=function(){for(var e=this.overAllWrapper?this.overAllWrapper.parentElement:null;e;){var t=getComputedStyle(e),i=parseFloat(t.maxHeight)||parseFloat(t.height);if(!isNaN(i)&&this.isPopupOpen()){var s=t.overflowY,l=this.overAllWrapper.getBoundingClientRect().bottom,n=e.getBoundingClientRect().bottom;if(("auto"===s||"scroll"===s)&&l>n)return void(e.scrollTop+=l-n+10)}e=e.parentElement}},s.prototype.enable=function(e){e?(this.overAllWrapper.classList.remove("e-disabled"),this.inputElement.removeAttribute("disabled"),t.attributes(this.inputElement,{"aria-disabled":"false"}),this.ensureAriaDisabled("false")):(this.overAllWrapper.classList.add("e-disabled"),this.inputElement.setAttribute("disabled","true"),t.attributes(this.inputElement,{"aria-disabled":"true"}),this.ensureAriaDisabled("true")),this.enabled!==e&&(this.enabled=e),this.hidePopup()},s.prototype.onBlurHandler=function(e,i){var s;if(this.updatePopupHeightOnFilter(),this.isBlurDispatching&&this.isAngular)return void(this.isBlurDispatching=!1);if(t.isNullOrUndefined(e)||(s=e.relatedTarget),this.popupObj&&document.body.contains(this.popupObj.element)&&this.popupObj.element.contains(s))return void("CheckBox"!==this.mode?this.inputElement.focus():"Auto"===this.floatLabelType&&(this.overAllWrapper.classList.contains("e-outline")||this.overAllWrapper.classList.contains("e-filled"))&&t.addClass([this.overAllWrapper],"e-valid-input"));if("Auto"===this.floatLabelType&&this.overAllWrapper.classList.contains("e-outline")&&"CheckBox"===this.mode&&(t.isNullOrUndefined(this.value)||0===this.value.length)&&t.removeClass([this.overAllWrapper],"e-valid-input"),"CheckBox"===this.mode&&t.Browser.isIE&&!t.isNullOrUndefined(e)&&!i)return this.inputFocus=!1,void this.overAllWrapper.classList.remove(ve);if(this.scrollFocusStatus)return t.isNullOrUndefined(e)||e.preventDefault(),this.inputElement.focus(),void(this.scrollFocusStatus=!1);if(this.inputFocus=!1,this.overAllWrapper.classList.remove(ve),this.addTagOnBlur){var l=this.getValueByText(this.inputElement.value,this.ignoreCase,this.ignoreAccent),n=this.findListElement(this.list,"li","data-value",l),r=this.hideSelectedItem?ge:H.selected;!(!n||n.classList.contains(r))&&(this.updateListSelection(n,e),"Delimiter"===this.mode&&this.updateDelimeter(this.delimiterChar))}this.updateDataList(),this.refreshListItems(null),"Box"!==this.mode&&"CheckBox"!==this.mode&&this.updateDelimView(),this.changeOnBlur&&(this.updateValueState(e,this.value,this.tempValues),this.dispatchEvent(this.hiddenElement,"change")),this.overAllClear.style.display="none",this.isPopupOpen()&&this.hidePopup(e),this.makeTextBoxEmpty(),this.trigger("blur"),this.focused=!0,t.Browser.isDevice&&"Delimiter"!==this.mode&&"CheckBox"!==this.mode&&this.removeChipFocus(),this.removeChipSelection(),this.refreshInputHight(),S(this.overAllWrapper,this.componentWrapper,this.value,this.floatLabelType,this.placeholder),this.refreshPlaceHolder(),(this.allowFiltering||!0===this.enableSelectionOrder&&"CheckBox"===this.mode)&&!t.isNullOrUndefined(this.mainList)&&(this.ulElement=this.mainList),this.checkPlaceholderSize(),null===this.element.querySelector(".e-multiselect .e-float-text-content")&&a.Input.createSpanElement(this.overAllWrapper,this.createElement),this.calculateWidth(),this.updateFloatLabelOverflowWidth(),t.isNullOrUndefined(this.overAllWrapper)||t.isNullOrUndefined(this.overAllWrapper.getElementsByClassName("e-ddl-icon")[0]&&this.overAllWrapper.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType)||this.overAllWrapper.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon"),this.isBlurDispatching=!0,this.isAngular&&this.dispatchEvent(this.inputElement,"blur")},s.prototype.calculateWidth=function(){var e;if(this.overAllWrapper){if(!this.showDropDownIcon||this.overAllWrapper.querySelector(".e-label-top"))e=this.overAllWrapper.clientWidth-2*parseInt(getComputedStyle(this.inputElement).paddingRight,10);else{var t=this.dropIcon.offsetWidth+parseInt(getComputedStyle(this.dropIcon).marginRight,10);e=this.overAllWrapper.clientWidth-(t+2*parseInt(getComputedStyle(this.inputElement).paddingRight,10))}"Never"!==this.floatLabelType&&a.Input.calculateWidth(e,this.overAllWrapper,this.getModuleName())}},s.prototype.checkPlaceholderSize=function(){if(this.showDropDownIcon){var e=this.dropIcon.offsetWidth+parseInt(window.getComputedStyle(this.dropIcon).marginRight,10);this.setPlaceholderSize(e)}else t.isNullOrUndefined(this.dropIcon)||this.setPlaceholderSize(this.showDropDownIcon?this.dropIcon.offsetWidth:0)},s.prototype.setPlaceholderSize=function(e){t.isNullOrUndefined(this.value)||0===this.value.length?0!==this.dropIcon.offsetWidth?this.searchWrapper.style.width="calc(100% - "+(e+10)+"px":t.addClass([this.searchWrapper],"e-search-custom-width"):t.isNullOrUndefined(this.value)||(this.searchWrapper.removeAttribute("style"),t.removeClass([this.searchWrapper],"e-search-custom-width"))},s.prototype.refreshInputHight=function(){t.isNullOrUndefined(this.searchWrapper)||(this.value&&this.value.length||!t.isNullOrUndefined(this.text)&&""!==this.text?this.searchWrapper.classList.add("e-zero-size"):this.searchWrapper.classList.remove("e-zero-size"))},s.prototype.validateValues=function(e,t){return JSON.stringify(e.slice().sort())!==JSON.stringify(t.slice().sort())},s.prototype.updateValueState=function(e,t,i){var s=t||[],l=i||[];if(this.initStatus&&this.validateValues(s,l)){var n={e:e,oldValue:(this.allowObjectBinding,i),value:(this.allowObjectBinding,t),isInteracted:!!e,element:this.element,event:e};this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",n),this.enableVirtualization&&this.enableSelectionOrder&&"CheckBox"===this.mode&&(this.preventSetCurrentData=!1),this.updateTempValue(),this.changeOnBlur||this.dispatchEvent(this.hiddenElement,"change")}this.selectedValueInfo=this.viewPortInfo},s.prototype.updateTempValue=function(){this.value?this.tempValues=(this.allowObjectBinding,this.value.slice()):this.tempValues=this.value},s.prototype.updateAriaActiveDescendant=function(){t.isNullOrUndefined(this.ulElement)||t.isNullOrUndefined(this.ulElement.getElementsByClassName("e-item-focus")[0])||t.attributes(this.inputElement,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id})},s.prototype.pageUpSelection=function(e,i){var s=this.list.querySelectorAll("li."+H.li+":not(."+ge+"):not(.e-reorder-hide)"),l=e>=0?s[e+1]:s[0];if(this.fields.disabled&&l&&!this.enableVirtualization){for(;l&&(l.classList.contains("e-disabled")||l.classList.contains(ge)||l.classList.contains(".e-reorder-hide")||l.classList.contains("e-list-group-item"));)l=l.previousElementSibling;if(!l)return}this.enableVirtualization&&i&&(l=this.liCollections.length>=e&&e>=0?this.liCollections[e]:this.liCollections[this.skeletonCount]),!t.isNullOrUndefined(l)&&l.classList.contains("e-virtual-list")&&(l=this.liCollections[this.skeletonCount]),this.enableVirtualization?(t.isNullOrUndefined(l)||l.classList.contains("e-item-focus")?0===this.viewPortInfo.startIndex&&(this.isKeyBoardAction=!0,this.scrollTop(l,this.getIndexByValue(l.getAttribute("data-value")),this.keyboardEvent.keyCode)):(this.isKeyBoardAction=!0,this.addListFocus(l),this.scrollTop(l,this.getIndexByValue(l.getAttribute("data-value")),this.keyboardEvent.keyCode)),this.previousFocusItem=l):(this.isKeyBoardAction=!0,this.addListFocus(l),this.scrollTop(l,this.getIndexByValue(l.getAttribute("data-value")),this.keyboardEvent.keyCode))},s.prototype.pageDownSelection=function(e,t){var i=this.getItems(),s=this.list.querySelectorAll("li."+H.li+":not(."+ge+"):not(.e-reorder-hide):not(.e-virtual-list-end)"),l=e<=s.length?s[e-1]:s[s.length-1];if(this.fields.disabled&&l&&!this.enableVirtualization){for(;l&&(l.classList.contains("e-disabled")||l.classList.contains(ge)||l.classList.contains(".e-reorder-hide")||l.classList.contains("e-list-group-item"));)l=l.nextElementSibling;if(!l)return}this.enableVirtualization&&this.skeletonCount>0&&(l=e<i.length?this.liCollections[e]:this.liCollections[i.length-1]),this.enableVirtualization&&t&&(l=e<=i.length?this.liCollections[e]:this.liCollections[i.length-1]),this.enableVirtualization&&l&&l.classList.contains("e-virtual-list-end")&&(l=s[s.length-1]),this.isKeyBoardAction=!0,this.addListFocus(l),this.previousFocusItem=l,this.scrollBottom(l,this.getIndexByValue(l.getAttribute("data-value")),!1,this.keyboardEvent.keyCode)},s.prototype.getItems=function(){return this.list||e.prototype.render.call(this),this.ulElement&&this.ulElement.querySelectorAll("."+H.li).length>0?this.ulElement.querySelectorAll("."+H.li+":not(."+ge+")"):[]},s.prototype.focusInHandler=function(e){var t=this;if(this.enabled){if(this.showOverAllClear(),this.inputFocus=!0,this.value&&this.value.length&&("Delimiter"!==this.mode&&"CheckBox"!==this.mode?this.chipCollectionWrapper.style.display="":this.showDelimWrapper(),"CheckBox"!==this.mode&&(this.viewWrapper.style.display="none")),"CheckBox"!==this.mode&&this.searchWrapper.classList.remove("e-zero-size"),this.checkPlaceholderSize(),"Never"!==this.floatLabelType&&this.overAllWrapper){var i=this.overAllWrapper.querySelector(".e-float-text");i&&i.removeAttribute("style")}if(this.focused){var s={isInteracted:!!e,event:e};this.trigger("focus",s),this.focused=!1}return this.overAllWrapper.classList.contains(ve)||this.overAllWrapper.classList.add(ve),b(this.overAllWrapper,this.componentWrapper),this.isPopupOpen()&&this.refreshPopup(),this.allowResize&&this.setResize(),setTimeout(function(){t.calculateWidth()},150),!0}return!1},s.prototype.showDelimWrapper=function(){"CheckBox"===this.mode?this.viewWrapper.style.display="":this.delimiterWrapper.style.display="",this.componentWrapper.classList.add("e-delimiter")},s.prototype.hideDelimWrapper=function(){this.delimiterWrapper.style.display="none",this.componentWrapper.classList.remove("e-delimiter")},s.prototype.expandTextbox=function(){var e=5;if(this.placeholder){var t=this.placeholder.charCodeAt(0),i=44032<=t&&t<=55215?1.5:19968<=t&&t<=40959?2:1;e=e>this.inputElement.placeholder.length?e:this.inputElement.placeholder.length*i}this.inputElement.value.length>e?this.inputElement.size=this.inputElement.value.length:this.inputElement.size=e},s.prototype.isPopupOpen=function(){return null!==this.popupWrapper&&null!==this.popupWrapper.parentElement},s.prototype.refreshPopup=function(){this.popupObj&&this.mobFilter&&(this.popupObj.setProperties({width:this.calcPopupWidth()}),this.popupObj.refreshPosition(this.overAllWrapper),this.popupObj.resolveCollision())},s.prototype.checkTextLength=function(){return this.targetElement().length<1},s.prototype.popupKeyActions=function(e){switch(e.keyCode){case 38:this.hidePopup(e),"CheckBox"===this.mode&&this.inputElement.focus(),e.preventDefault();break;case 40:this.isPopupOpen()||(this.showPopup(e),e.preventDefault())}},s.prototype.updatePopupPosition=function(){this.refreshPopup()},s.prototype.updateAriaAttribute=function(){var e=this.list.querySelector("."+H.focus);if(!t.isNullOrUndefined(e))if(this.inputElement.setAttribute("aria-activedescendant",e.id),this.allowFiltering){var i=this.popupWrapper.querySelector(".e-input-filter");i&&i.setAttribute("aria-activedescendant",e.id)}else"CheckBox"===this.mode&&this.overAllWrapper.setAttribute("aria-activedescendant",e.id)},s.prototype.homeNavigation=function(e,t){if(this.removeFocus(),this.enableVirtualization)if(e)this.enableVirtualization&&0!==this.viewPortInfo.startIndex&&(this.viewPortInfo.startIndex=0,this.viewPortInfo.endIndex=this.itemCount,this.updateVirtualItemIndex(),this.resetList(this.dataSource,this.fields,this.query));else if(this.enableVirtualization&&(!this.value&&this.viewPortInfo.endIndex!==this.totalItemCount||this.value&&this.value.length>0&&this.viewPortInfo.endIndex!==this.totalItemCount+this.value.length)){this.viewPortInfo.startIndex=this.totalItemCount-this.itemCount,this.viewPortInfo.endIndex=this.totalItemCount,this.updateVirtualItemIndex();var s=(new i.Query).clone();this.value&&this.value.length>0&&(s=(s=this.getForQuery(this.value).clone()).skip(this.totalItemCount-this.itemCount)),this.resetList(this.dataSource,this.fields,s)}this.UpdateSkeleton();var l=this.ulElement.querySelectorAll("li."+H.li+":not(."+ge+"):not(.e-reorder-hide)");if(l.length>0){var n=l[e?0:l.length-1];this.enableVirtualization&&e&&(n=l[this.skeletonCount]),this.removeFocus(),n.classList.add(H.focus),this.enableVirtualization&&e?this.scrollTop(n,void 0,this.keyboardEvent.keyCode):t||this.scrollBottom(n,void 0,!1,this.keyboardEvent.keyCode),this.updateAriaActiveDescendant()}},s.prototype.updateSelectionList=function(){if(!t.isNullOrUndefined(this.value)&&this.value.length)for(var e=0;e<this.value.length;e++){var i=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",this.value[e]):this.value[e],s=this.getElementByValue(i);s&&!s.classList.contains(H.selected)&&s.classList.add("e-active")}},s.prototype.handleVirtualKeyboardActions=function(e,t){var i,s=this.list.querySelector("."+H.focus);switch(this.isKeyBoardAction=!0,e.keyCode){case 40:this.arrowDown(e,!0);break;case 38:this.arrowUp(e,!0);break;case 33:e.preventDefault(),s&&(i=this.getIndexByValue(this.previousFocusItem.getAttribute("data-value"))-1,this.pageUpSelection(i,!0),this.updateAriaAttribute());break;case 34:e.preventDefault(),s&&(i=this.getIndexByValue(this.previousFocusItem.getAttribute("data-value")),this.pageDownSelection(i,!0),this.updateAriaAttribute());break;case 35:case 36:this.isMouseScrollAction=!0,this.homeNavigation(36===e.keyCode,!0),this.isPreventScrollAction=!0}this.keyboardEvent=null,this.isScrollChanged=!0,this.isKeyBoardAction=!1},s.prototype.onKeyDown=function(e){if(!this.readonly&&(this.enabled||"CheckBox"===this.mode)&&(this.preventSetCurrentData=!1,this.keyboardEvent=e,this.isPreventKeyAction&&this.enableVirtualization&&e.preventDefault(),this.keyCode=e.keyCode,this.keyDownStatus=!0,!(e.keyCode>111&&e.keyCode<124))){if(e.altKey)return void this.popupKeyActions(e);if(this.isPopupOpen()){var t=this.list.querySelector("."+H.focus),i=void 0;switch(e.keyCode){case 36:case 35:this.isMouseScrollAction=!0,this.isKeyBoardAction=!0,this.homeNavigation(36===e.keyCode);break;case 33:return e.preventDefault(),void(t&&(i=this.getIndexByValue(t.getAttribute("data-value")),this.pageUpSelection(i-this.getPageCount()-1),this.updateAriaAttribute()));case 34:return e.preventDefault(),void(t&&(i=this.getIndexByValue(t.getAttribute("data-value")),this.pageDownSelection(i+this.getPageCount()),this.updateAriaAttribute()));case 38:this.isKeyBoardAction=!0,this.arrowUp(e);break;case 40:this.isKeyBoardAction=!0,this.arrowDown(e);break;case 27:return e.preventDefault(),this.isKeyBoardAction=!0,this.hidePopup(e),"CheckBox"===this.mode&&this.inputElement.focus(),void(this.isKeyBoardAction=!1);case 13:return e.preventDefault(),this.isKeyBoardAction=!0,"CheckBox"!==this.mode&&this.selectByKey(e),this.checkPlaceholderSize(),void(this.isKeyBoardAction=!1);case 32:return this.isKeyBoardAction=!0,this.spaceKeySelection(e),void(this.isKeyBoardAction=!1);case 9:e.preventDefault(),this.isKeyBoardAction=!0,this.hidePopup(e),this.inputElement.focus(),this.overAllWrapper.classList.add(ve)}}else switch(e.keyCode){case 13:case 9:case 16:case 17:case 20:return;case 40:this.openOnClick&&this.showPopup();break;case 27:return e.preventDefault(),void this.escapeAction()}this.checkTextLength()&&this.keyNavigation(e),"CheckBox"===this.mode&&this.enableSelectionOrder&&(this.allowFiltering&&(this.previousFilterText=this.targetElement()),this.checkBackCommand(e)),this.expandTextbox(),"CheckBox"===this.mode&&this.showSelectAll||this.refreshPopup(),this.allowResize&&!this.isFilterAction&&this.setResize(),this.isKeyBoardAction=!1}},s.prototype.arrowDown=function(e,i){e.preventDefault(),this.moveByList(1,i),this.keyAction=!0,(document.activeElement.classList.contains("e-input-filter")||"CheckBox"===this.mode&&!this.allowFiltering&&document.activeElement!==this.list)&&t.EventHandler.add(this.list,"keydown",this.onKeyDown,this),this.updateAriaAttribute()},s.prototype.arrowUp=function(e,i){e.preventDefault(),this.keyAction=!0;var s=this.list.querySelectorAll("li."+H.li+":not(."+ge+"):not(.e-reorder-hide)");this.enableGroupCheckBox&&"CheckBox"===this.mode&&!t.isNullOrUndefined(this.fields.groupBy)&&(s=this.list.querySelectorAll("li."+H.li+",li."+H.group+":not(."+ge+"):not(.e-reorder-hide)"));var l=this.list.querySelector("li."+H.focus);if(this.focusFirstListItem=!t.isNullOrUndefined(this.liCollections[0])&&this.liCollections[0].classList.contains("e-item-focus"),this.list&&this.list.querySelector(".e-list-parent.e-ul.e-reorder")){var n=this.list.querySelectorAll("li."+H.li+":not(."+ge+"):not(.e-reorder-hide):not(.e-virtual-list-end)");n.length>0&&(this.focusFirstListItem=!t.isNullOrUndefined(n[0])&&n[0].classList.contains("e-item-focus"))}Array.prototype.slice.call(s).indexOf(l)<=0&&"CheckBox"===this.mode&&this.allowFiltering&&(this.keyAction=!1,this.notify("inputFocus",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"focus"})),this.moveByList(-1,i),this.updateAriaAttribute()},s.prototype.spaceKeySelection=function(e){if("CheckBox"===this.mode){var i=this.list.querySelector("li."+H.focus),s=document.getElementsByClassName("e-selectall-parent")[0];if((!t.isNullOrUndefined(i)||s&&s.classList.contains("e-item-focus"))&&(e.preventDefault(),this.keyAction=!0),this.selectByKey(e),this.keyAction){var l=this.list.querySelector("li."+H.focus);!t.isNullOrUndefined(l)&&s&&s.classList.contains("e-item-focus")&&l.classList.remove("e-item-focus")}}this.checkPlaceholderSize()},s.prototype.checkBackCommand=function(e){(8===e.keyCode&&this.allowFiltering?this.targetElement()!==this.previousFilterText:""===this.targetElement())?this.backCommand=!1:this.backCommand=!0},s.prototype.keyNavigation=function(e){if("Delimiter"!==this.mode&&"CheckBox"!==this.mode&&this.value&&this.value.length)switch(e.keyCode){case 37:e.preventDefault(),this.moveBy(-1,e);break;case 39:e.preventDefault(),this.moveBy(1,e);break;case 8:this.removelastSelection(e);break;case 46:this.removeSelectedChip(e)}else if(8===e.keyCode&&"Delimiter"===this.mode&&this.value&&this.value.length){e.preventDefault();var i=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",this.value[this.value.length-1]):this.value[this.value.length-1];this.removeValue(this.value[this.value.length-1],e),this.updateDelimeter(this.delimiterChar,e),this.focusAtLastListItem(i)}},s.prototype.selectByKey=function(e){this.removeChipSelection(),this.selectListByKey(e),this.hideSelectedItem&&this.focusAtFirstListItem()},s.prototype.escapeAction=function(){var e=this.tempValues?this.tempValues.slice():[];this.allowObjectBinding&&(e=this.tempValues?this.tempValues.slice():[]),this.value&&this.validateValues(this.value,e)&&("CheckBox"!==this.mode&&(this.value=e,(this.allowFiltering||this.allowCustomValue)&&this.refreshListItems(null),this.initialValueUpdate()),"Delimiter"!==this.mode&&"CheckBox"!==this.mode?this.chipCollectionWrapper.style.display="":this.showDelimWrapper(),this.refreshPlaceHolder(),this.value.length?this.showOverAllClear():this.hideOverAllClear()),this.makeTextBoxEmpty()},s.prototype.scrollBottom=function(e,i,s,l,n){void 0===s&&(s=!1),void 0===l&&(l=null),void 0===n&&(n=!1),(!t.isNullOrUndefined(e)&&e.classList.contains("e-virtual-list")||this.enableVirtualization&&t.isNullOrUndefined(e))&&(e=this.liCollections[this.skeletonCount]);var a=e&&!isNaN(parseInt(window.getComputedStyle(e).marginBottom,10))?parseInt(window.getComputedStyle(e).marginBottom,10):0;this.isUpwardScrolling=!1;var r=this.list.querySelectorAll(".e-virtual-list:not(.e-virtual-list-end)").length,o=this.list.querySelectorAll("li:not(.e-virtual-list-end)"),h=o&&o.length>0&&o[o.length-1]?o[o.length-1].getAttribute("data-value"):null,u=this.virtualListInfo&&this.virtualListInfo.startIndex?e.offsetTop+this.virtualListInfo.startIndex*(e.offsetHeight+a):e.offsetTop,p=this.list.offsetHeight,d=u-r*(e.offsetHeight+a)+(e.offsetHeight+a)-this.list.scrollTop,c=this.list.scrollTop+d-p,m=!1,f=u-r*(e.offsetHeight+a)+(e.offsetHeight+a)-this.list.scrollTop;if(f=this.fields.groupBy&&!t.isNullOrUndefined(this.fixedHeaderElement)?f-this.fixedHeaderElement.offsetHeight:f,0!==i||this.enableVirtualization){if(d>p||!(f>0&&this.list.offsetHeight>f)){var v=e?e.getAttribute("data-value"):null,g=34===l?this.getPageCount()-1:1;!this.enableVirtualization||this.isKeyBoardAction||s?this.isKeyBoardAction&&this.enableVirtualization&&h&&v===h&&35!==l&&!this.isVirtualScrolling?(this.isPreventKeyAction=!0,this.list.scrollTop+=(e.offsetHeight+a)*g,this.isPreventKeyAction=!this.isScrollerAtEnd()&&this.isPreventKeyAction,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1):this.enableVirtualization&&35===l?(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1,this.list.scrollTop=this.list.scrollHeight):(34===l&&this.enableVirtualization&&!this.isVirtualScrolling&&(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1),this.list.scrollTop=c):this.list.scrollTop=this.virtualListInfo&&this.virtualListInfo.startIndex?n&&this.virtualListInfo.startIndex?this.virtualListInfo.startIndex*this.listItemHeight+2*this.listItemHeight:this.virtualListInfo.startIndex*this.listItemHeight:0,m=this.isKeyBoardAction}}else this.list.scrollTop=0;this.isKeyBoardAction=m},s.prototype.scrollTop=function(e,i,s){void 0===s&&(s=null);var l=this.list.querySelectorAll(".e-virtual-list:not(.e-virtual-list-end)").length,n=e&&!isNaN(parseInt(window.getComputedStyle(e).marginBottom,10))?parseInt(window.getComputedStyle(e).marginBottom,10):0,a=this.virtualListInfo&&this.virtualListInfo.startIndex?e.offsetTop+this.virtualListInfo.startIndex*(e.offsetHeight+n):e.offsetTop,r=a-l*(e.offsetHeight+n)-this.list.scrollTop,o=this.list.querySelector("li.e-list-item:not(.e-virtual-list)")?this.list.querySelector("li.e-list-item:not(.e-virtual-list)").getAttribute("data-value"):null;r=this.fields.groupBy&&!t.isUndefined(this.fixedHeaderElement)?r-this.fixedHeaderElement.offsetHeight:r;var h=a-l*(e.offsetHeight+n)+(e.offsetHeight+n)-this.list.scrollTop,u=this.enableVirtualization&&"autocomplete"===this.getModuleName()&&r<=0;if(0!==i||this.enableVirtualization)if(r<0||u){var p=e?e.getAttribute("data-value"):null,d=33===s?this.getPageCount()-2:1;this.enableVirtualization&&this.isKeyBoardAction&&o&&p===o&&36!==s&&!this.isVirtualScrolling?(this.isUpwardScrolling=!0,this.isPreventKeyAction=!0,this.isKeyBoardAction=!1,this.list.scrollTop-=(e.offsetHeight+n)*d,this.isPreventKeyAction=0!==this.list.scrollTop&&this.isPreventKeyAction,this.isPreventScrollAction=!1):this.enableVirtualization&&36===s?(this.isPreventScrollAction=!1,this.isPreventKeyAction=!0,this.isKeyBoardAction=!1,this.list.scrollTo(0,0)):(33===s&&this.enableVirtualization&&!this.isVirtualScrolling&&(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1),this.list.scrollTop=this.list.scrollTop+r)}else h>0&&this.list.offsetHeight>h||(this.list.scrollTop=e.offsetTop-(this.fields.groupBy&&!t.isNullOrUndefined(this.fixedHeaderElement)?this.fixedHeaderElement.offsetHeight:0));else this.list.scrollTop=0},s.prototype.isScrollerAtEnd=function(){return this.list&&this.list.scrollTop+this.list.clientHeight>=this.list.scrollHeight},s.prototype.selectListByKey=function(e){var i,s=this.list.querySelector("li."+H.focus),l=this.value&&this.value.length?this.value.length:0;if(null!==s){if(e.preventDefault(),s.classList.contains("e-active")&&(l-=1),this.isValidLI(s)&&l<this.maximumSelectionLength){this.updateListSelection(s,e),this.addListFocus(s),"CheckBox"===this.mode?(this.updateDelimView(),this.updateDelimeter(this.delimiterChar,e),this.refreshInputHight(),this.checkPlaceholderSize(),this.enableGroupCheckBox&&!t.isNullOrUndefined(this.fields.groupBy)&&(i=s.firstElementChild.lastElementChild,this.findGroupStart(i),this.deselectHeader())):this.updateDelimeter(this.delimiterChar,e);var n=""!==this.targetElement().trim();this.makeTextBoxEmpty(),"CheckBox"!==this.mode&&this.refreshListItems(s.textContent,n),this.changeOnBlur||this.updateValueState(e,this.value,this.tempValues),this.refreshPopup()}else!this.isValidLI(s)&&l<this.maximumSelectionLength&&((i=s.firstElementChild.lastElementChild).classList.contains("e-check")?this.selectAllItem(!1,e,s):this.selectAllItem(!0,e,s));this.refreshSelection(),this.closePopupOnSelect&&this.hidePopup(e)}var a=document.getElementsByClassName("e-selectall-parent")[0];if(a&&a.classList.contains("e-item-focus")){var r=a.childNodes[0];if(r.classList.contains("e-check")){r.classList.remove("e-check");o={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"check",name:"checkSelectAll"};this.notify("checkSelectAll",o),this.selectAllItem(!1,e,s)}else{r.classList.add("e-check");var o={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"check",name:"checkSelectAll"};this.notify("checkSelectAll",o),this.selectAllItem(!0,e,s)}}this.refreshPlaceHolder()},s.prototype.refreshListItems=function(e,i){if((this.allowFiltering||"CheckBox"===this.mode&&!0===this.enableSelectionOrder||this.allowCustomValue)&&this.mainList&&this.listData){var s=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;if(this.enableVirtualization)if(this.allowCustomValue&&this.virtualCustomData&&null==e&&this.virtualCustomData&&this.viewPortInfo&&0===this.viewPortInfo.startIndex&&this.viewPortInfo.endIndex===this.itemCount)this.virtualCustomData=null,this.renderItems(this.mainData,this.fields);else if(this.allowFiltering&&i){if(this.updateInitialData(),this.onActionComplete(s,this.mainData),this.isVirtualTrackHeight=!1,this.list.getElementsByClassName("e-virtual-ddl")[0])this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight();else if(!this.list.querySelector(".e-virtual-ddl")&&this.skeletonCount>0){var l=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"});l.style.cssText=this.GetVirtualTrackHeight(),this.popupWrapper.querySelector(".e-dropdownbase").appendChild(l)}}else this.onActionComplete(this.list,this.listData);else this.onActionComplete(s,this.mainData);this.focusAtLastListItem(e),this.value&&this.value.length&&this.refreshSelection()}else!t.isNullOrUndefined(this.fields.groupBy)&&this.value&&this.value.length&&this.refreshSelection()},s.prototype.removeSelectedChip=function(e){var i,s=this.chipCollectionWrapper.querySelector("span."+Ce);if(null!==s){t.isNullOrUndefined(this.value)||(this.tempValues=(this.allowObjectBinding,this.value.slice())),null!==(i=s.nextElementSibling)&&(this.removeChipSelection(),this.addChipSelection(i,e));var l=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(s.getAttribute("data-value"))):s.getAttribute("data-value");this.removeValue(l,e),this.updateDelimeter(this.delimiterChar,e),this.makeTextBoxEmpty()}this.closePopupOnSelect&&this.hidePopup(e),this.checkPlaceholderSize()},s.prototype.moveByTop=function(e){var t,i=this.list.querySelectorAll("li."+H.li);i.length>1&&(this.removeFocus(),t=e?0:i.length-1,this.addListFocus(i[t]),this.scrollBottom(i[t],t)),this.updateAriaAttribute()},s.prototype.clickHandler=function(e){var t=e.target.className,i=document.getElementsByClassName("e-selectall-parent")[0];"e-input-filter e-input"!==t&&"e-input-group e-control-wrapper e-input-focus"!==t||!i.classList.contains("e-item-focus")||i.classList.remove("e-item-focus")},s.prototype.moveByList=function(e,i){if(this.list){var s=this.list.querySelectorAll("li."+H.li+":not(."+ge+"):not(.e-reorder-hide):not(.e-virtual-list-end)");"CheckBox"===this.mode&&this.enableGroupCheckBox&&!t.isNullOrUndefined(this.fields.groupBy)&&(s=this.list.querySelectorAll("li."+H.li+",li."+H.group+":not(."+ge+"):not(.e-reorder-hide):not(.e-virtual-list-end)"));var l=this.list.querySelector("li."+H.focus);this.enableVirtualization&&i&&!t.isNullOrUndefined(this.currentFocuedListElement)&&(l=this.getElementByValue(this.getFormattedValue(this.currentFocuedListElement.getAttribute("data-value"))));var n=-1,a=document.getElementsByClassName("e-selectall-parent")[0];if("CheckBox"===this.mode&&this.showSelectAll&&1===e&&!t.isNullOrUndefined(a)&&!a.classList.contains("e-item-focus")&&0===this.list.getElementsByClassName("e-item-focus").length&&this.liCollections.length>1)!this.focusFirstListItem&&a.classList.contains("e-item-focus")?a.classList.remove("e-item-focus"):a.classList.contains("e-item-focus")||a.classList.add("e-item-focus");else if(s.length){"CheckBox"===this.mode&&this.showSelectAll&&!t.isNullOrUndefined(a&&-1===e)&&(this.focusFirstListItem&&1!==e||!a.classList.contains("e-item-focus")?!this.focusFirstListItem||a.classList.contains("e-item-focus")||1===e&&this.list.querySelector(".e-item-focus")||a.classList.add("e-item-focus"):a.classList.remove("e-item-focus"));for(var r=0;r<s.length;r++)if(s[r]===l){n=r;break}if(e>0)n<s.length-1&&(this.removeFocus(),this.enableVirtualization&&i?this.addListFocus(s[n]):this.enableVirtualization&&s[n+1].classList.contains("e-virtual-list")?this.addListFocus(s[this.skeletonCount]):this.addListFocus(s[++n]),n>-1&&(this.updateCheck(s[n]),this.scrollBottom(s[n],n),this.currentFocuedListElement=s[n]));else if(n>0)if(this.enableVirtualization){var o=s[n-1].classList.contains("e-virtual-list"),h=i?n:n-1;!i&&o||this.removeFocus(),!i&&o||(this.addListFocus(s[h]),this.updateCheck(s[h]),this.scrollTop(s[h],n),this.currentFocuedListElement=s[h])}else this.removeFocus(),this.addListFocus(s[--n]),this.updateCheck(s[n]),this.scrollTop(s[n],n)}}var u=this.list?this.list.querySelector(".e-item-focus"):null;if(this.isDisabledElement(u)){if(0===this.list.querySelectorAll(".e-list-item:not(.e-hide-listitem):not(.e-disabled)").length||38===this.keyCode&&"CheckBox"===this.mode&&this.enableGroupCheckBox&&!t.isNullOrUndefined(this.fields.groupBy)&&u===this.list.querySelector("li.e-list-group-item"))return void this.removeFocus();0===(r=this.getIndexByValue(u.getAttribute("data-value")))&&(e=1),r===this.list.querySelectorAll(".e-list-item:not(.e-hide-listitem)").length-1&&(e=-1),this.moveByList(e)}},s.prototype.getElementByValue=function(e){for(var t,i=0,s=this.getItems();i<s.length;i++){var l=s[i];if(this.getFormattedValue(l.getAttribute("data-value"))===e){t=l;break}}return t},s.prototype.updateCheck=function(e){"CheckBox"===this.mode&&this.enableGroupCheckBox&&!t.isNullOrUndefined(this.fields.groupBy)&&(e.firstElementChild.lastElementChild.classList.contains("e-check")?e.classList.add("e-active"):e.classList.remove("e-active"))},s.prototype.moveBy=function(e,t){var i,s=this.chipCollectionWrapper.querySelectorAll("span.e-chips"),l=this.chipCollectionWrapper.querySelector("span."+Ce);null===l?e<0&&this.addChipSelection(s[s.length-1],t):e<0?null!==(i=l.previousElementSibling)&&(this.removeChipSelection(),this.addChipSelection(i,t)):(i=l.nextElementSibling,this.removeChipSelection(),null!==i&&this.addChipSelection(i,t))},s.prototype.chipClick=function(e){if(this.enabled){var i=t.closest(e.target,".e-chips");this.removeChipSelection(),this.addChipSelection(i,e)}},s.prototype.removeChipSelection=function(){if(this.chipCollectionWrapper){var e=this.chipCollectionWrapper.querySelectorAll("span.e-chips."+Ce);if(e&&e.length>0)for(var t=0;t<e.length;t++)e[t].removeAttribute("aria-live");this.removeChipFocus()}},s.prototype.addChipSelection=function(e,i){t.addClass([e],Ce),e&&e.setAttribute("aria-live","polite"),this.trigger("chipSelection",i)},s.prototype.getVirtualDataByValue=function(e){if(!t.isNullOrUndefined(this.selectedListData)){var i=this.typeOfData(this.selectedListData).typeof;if("string"===i||"number"===i||"boolean"===i)for(var s=0,l=this.selectedListData;s<l.length;s++){r=l[s];if(!t.isNullOrUndefined(r)&&r===e)return r}else for(var n=0,a=this.selectedListData;n<a.length;n++){var r=a[n];if(!t.isNullOrUndefined(r)&&t.getValue(this.fields.value?this.fields.value:"value",r)===e)return r}}return null},s.prototype.onChipRemove=function(e){if(3!==e.which&&2!==e.button&&this.enabled&&!this.readonly){var i=e.target.parentElement.getAttribute("data-value"),s=this.allowObjectBinding?this.enableVirtualization?this.getVirtualDataByValue(this.getFormattedValue(i)):this.getDataByValue(this.getFormattedValue(i)):this.getFormattedValue(i);if(this.allowCustomValue&&("false"!==i&&!1===s||!t.isNullOrUndefined(s)&&"NaN"===s.toString())&&(s=i),this.isPopupOpen()&&"CheckBox"!==this.mode&&this.hidePopup(e),this.inputFocus||this.inputElement.focus(),this.removeValue(s,e),s=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",s):s,t.isNullOrUndefined(this.findListElement(this.list,"li","data-value",s))&&this.mainList&&this.listData){var l=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.onActionComplete(l,this.mainData)}this.updateDelimeter(this.delimiterChar,e),this.placeholder&&"Never"===this.floatLabelType?(this.makeTextBoxEmpty(),this.checkPlaceholderSize()):this.inputElement.value="",e.preventDefault()}},s.prototype.makeTextBoxEmpty=function(){this.inputElement.value="",this.refreshPlaceHolder()},s.prototype.refreshPlaceHolder=function(){this.placeholder&&"Never"===this.floatLabelType?this.value&&this.value.length||!t.isNullOrUndefined(this.text)&&""!==this.text?this.inputElement.placeholder="":this.inputElement.placeholder=E(this.placeholder):(this.setFloatLabelType(),null===this.element.querySelector(".e-multiselect .e-float-text-content")&&a.Input.createSpanElement(this.overAllWrapper,this.createElement)),this.expandTextbox()},s.prototype.removeAllItems=function(e,i,s,l,n){var a=this.allowObjectBinding?this.indexOfObjectInArray(e,this.value):this.value.indexOf(e),r=this.value.slice(0);r.splice(a,1),this.setProperties({value:[].concat([],r)},!0),l.setAttribute("aria-selected","false");var o=this.hideSelectedItem?ge:H.selected;t.removeClass([l],o),this.notify("activeList",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:l,e:this,index:a}),this.invokeCheckboxSelection(l,i,s);var h=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",e):e;this.updateMainList(!0,h,n),this.updateChipStatus()},s.prototype.invokeCheckboxSelection=function(e,t,i){this.notify("updatelist",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:e,e:t}),this.updateAriaActiveDescendant(),this.value&&this.value.length!==this.mainData.length&&"CheckBox"===this.mode&&this.showSelectAll&&!this.isSelectAll&&!i&&this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"uncheck"})},s.prototype.removeValue=function(i,s,l,n){var a=this,r=this.allowObjectBinding?this.indexOfObjectInArray(i,this.value):this.value.indexOf(this.getFormattedValue(i));-1===r&&this.allowCustomValue&&!t.isNullOrUndefined(i)&&(r=this.allowObjectBinding?this.indexOfObjectInArray(i,this.value):this.value.indexOf(i.toString()));var o=s&&s.target;n=!!(n||o&&o.classList.contains("e-close-hooker"))||null;var h=this.hideSelectedItem?ge:H.selected;if(-1!==r){var u=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",i):i,p=this.virtualSelectAll?null:this.findListElement(this.list,"li","data-value",u),d=this.allowObjectBinding?i:this.getDataByValue(i),c={e:s,item:p,itemData:d,isInteracted:!!s,cancel:!1};this.trigger("removing",c,function(o){if(o.cancel)a.removeIndex++;else{a.isRemoveSelection=!!a.enableVirtualization||a.isRemoveSelection,a.currentRemoveValue=a.allowObjectBinding?t.getValue(a.fields.value?a.fields.value:"",i):i,a.virtualSelectAll=!1;var u=a.value.slice(0);if(u.splice(r,1),a.enableVirtualization&&a.selectedListData&&a.selectedListData.splice(r,1),a.setProperties({value:[].concat([],u)},!0),a.enableVirtualization){var c=0===r&&a.text.split(a.delimiterChar)&&1===a.text.split(a.delimiterChar).length?a.text.replace(a.text.split(a.delimiterChar)[r],""):0===r?a.text.replace(a.text.split(a.delimiterChar)[r]+a.delimiterChar,""):a.text.replace(a.delimiterChar+a.text.split(a.delimiterChar)[r],"");a.setProperties({text:c.toString()},!0)}if(null!==p){var m=a.allowObjectBinding?t.getValue(a.fields.value?a.fields.value:"",i):i,f=a.findListElement(a.mainList,"li","data-value",m);p.setAttribute("aria-selected","false"),t.removeClass([p],h),f&&(f.setAttribute("aria-selected","false"),t.removeClass([p,f],h)),a.notify("activeList",{module:"CheckBoxSelection",enable:"CheckBox"===a.mode,li:p,e:a,index:r}),a.invokeCheckboxSelection(p,s,n)}var v=a.allowObjectBinding?t.getValue(a.fields.value?a.fields.value:"",i):i;if(a.hideSelectedItem&&a.fields.groupBy&&p&&a.hideGroupItem(v),a.hideSelectedItem&&a.fixedHeaderElement&&a.fields.groupBy&&"CheckBox"!==a.mode&&a.isPopupOpen()&&e.prototype.scrollStop.call(a),a.updateMainList(!0,v),a.removeChip(v,n),a.updateChipStatus(),(a.value&&a.value.length?a.value.length:0)<a.maximumSelectionLength){var g=a.list.querySelectorAll("li."+H.li+":not(.e-active)");t.removeClass(g,"e-disable");var y=a.mainList.querySelectorAll("li."+H.li+":not(.e-active)");t.removeClass(y,"e-disable")}a.trigger("removed",o);var C=s&&s.currentTarget,b=!(!C||!C.classList.contains("e-selectall-parent"))||null;if(!a.changeOnBlur&&!n&&s&&l&&!b&&a.isSelectAllTarget&&a.updateValueState(s,a.value,a.tempValues),l&&(a.selectAllEventData.push(d),a.selectAllEventEle.push(p)),1===l){a.changeOnBlur||a.updateValueState(s,a.value,a.tempValues);var S={event:s,items:a.selectAllEventEle,itemData:a.selectAllEventData,isInteracted:!!s,isChecked:!1};a.trigger("selectedAll",S),a.selectAllEventData=[],a.selectAllEventEle=[]}!n||1!==l&&null!==l||a.clearAllCallback(s,n),a.isPopupOpen()&&p&&p.parentElement.classList.contains("e-reorder")&&(a.hideSelectedItem&&a.value&&Array.isArray(a.value)&&a.value.length>0&&a.totalItemsCount(),a.notify("setCurrentViewDataAsync",{module:"VirtualScroll"}))}})}},s.prototype.updateMainList=function(e,i,s){if(this.allowFiltering||"CheckBox"===this.mode){var l=s||this.findListElement(this.mainList,"li","data-value",i);l&&(e?(l.setAttribute("aria-selected","false"),t.removeClass([l],this.hideSelectedItem?ge:H.selected),"CheckBox"===this.mode&&t.removeClass([l.firstElementChild.lastElementChild],"e-check")):(l.setAttribute("aria-selected","true"),t.addClass([l],this.hideSelectedItem?ge:H.selected),"CheckBox"===this.mode&&t.addClass([l.firstElementChild.lastElementChild],"e-check")))}},s.prototype.removeChip=function(e,i){if(this.chipCollectionWrapper&&(!this.enableVirtualization||!i)){var s=this.findListElement(this.chipCollectionWrapper,"span","data-value",e);s&&t.remove(s)}},s.prototype.setWidth=function(e){t.isNullOrUndefined(e)||("number"==typeof e?this.overAllWrapper.style.width=t.formatUnit(e):"string"==typeof e&&(this.overAllWrapper.style.width=e.match(/px|%|em/)?e:t.formatUnit(e)))},s.prototype.updateChipStatus=function(){this.value&&this.value.length?(t.isNullOrUndefined(this.chipCollectionWrapper)||(this.chipCollectionWrapper.style.display=""),"Delimiter"!==this.mode&&"CheckBox"!==this.mode||this.showDelimWrapper(),this.showOverAllClear()):(t.isNullOrUndefined(this.chipCollectionWrapper)||(this.chipCollectionWrapper.style.display="none"),t.isNullOrUndefined(this.delimiterWrapper)||(this.delimiterWrapper.style.display="none"),this.hideOverAllClear())},s.prototype.indexOfObjectInArray=function(e,t){for(var i=0;i<t.length;i++){var s=function(i){var s=t[i];if(Object.keys(e).every(function(t){return s.hasOwnProperty(t)&&s[t]===e[t]}))return{value:i}}(i);if("object"==typeof s)return s.value}return-1},s.prototype.addValue=function(e,i,s){this.value||(this.value=[]);var l=this.allowObjectBinding?this.getDataByValue(e):e;if(this.allowObjectBinding&&!this.isObjectInArray(this.getDataByValue(e),this.value)||!this.allowObjectBinding&&this.value.indexOf(l)<0){if(this.setProperties({value:[].concat([],this.value,[l])},!0),this.enableVirtualization&&!this.isSelectAllLoop){var n=this.viewWrapper.innerHTML,a=void 0;n+=1===this.value.length?"":this.delimiterChar+" ",n+=a=this.getOverflowVal(this.value.length-1),a=this.viewWrapper.innerHTML,this.updateWrapperText(this.viewWrapper,n)}if(this.enableVirtualization&&"CheckBox"===this.mode){var r=[],a=(this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",this.value[this.value.length-1]):this.value[this.value.length-1],i),o=null!=this.text&&""!==this.text?this.text+this.delimiterChar+a:a;r.push(o),this.setProperties({text:r.toString()},!0)}}var h=this.findListElement(this.list,"li","data-value",e);this.removeFocus(),h&&(this.addListFocus(h),this.addListSelection(h)),"Delimiter"!==this.mode&&"CheckBox"!==this.mode&&this.addChip(i,e,s),this.hideSelectedItem&&this.fields.groupBy&&this.hideGroupItem(e),this.updateChipStatus(),this.checkMaxSelection()},s.prototype.updateListItemsState=function(e){var i=e.querySelectorAll("li."+H.li+".e-active");t.removeClass(i,"e-disable");var s=e.querySelectorAll("li."+H.li+":not(.e-active)");t.addClass(s,"e-disable")},s.prototype.checkMaxSelection=function(){var e=this.value&&this.value.length?this.value.length:0;if(0===this.maximumSelectionLength)return this.updateListItemsState(this.list),void(this.mainList&&this.updateListItemsState(this.mainList));if(e===this.maximumSelectionLength){var i=this.list.querySelectorAll("li."+H.li+".e-active");t.removeClass(i,"e-disable");var s=this.list.querySelectorAll("li."+H.li+":not(.e-active)");t.addClass(s,"e-disable")}if(e<this.maximumSelectionLength){var l=this.list.querySelectorAll("li."+H.li);t.removeClass(l,"e-disable")}},s.prototype.dispatchSelect=function(i,s,l,n,a,r,o){var h=this,u=this.listData;if(this.initStatus&&!n&&(!this.allowObjectBinding||this.allowObjectBinding&&i)){i=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",i):i;var p=r||this.getDataByValue(i),d={e:s,item:l,itemData:p,isInteracted:!!s,cancel:!1};this.trigger("select",d,function(n){if(!n.cancel){if(a&&(h.selectAllEventData.push(p),h.selectAllEventEle.push(l)),1===a){var d={event:s,items:h.selectAllEventEle,itemData:h.selectAllEventData,isInteracted:!!s,isChecked:!0};h.trigger("selectedAll",d),h.selectAllEventData=[]}h.allowCustomValue&&h.isServerRendered&&h.listData!==u&&(h.listData=u),i=h.allowObjectBinding?h.getDataByValue(i):i,h.enableVirtualization&&(t.isNullOrUndefined(h.selectedListData)?h.selectedListData=h.allowObjectBinding?[i]:[h.getDataByValue(i)]:r?Array.isArray(h.selectedListData)?h.selectedListData.push(r):h.selectedListData=[h.selectedListData,r]:Array.isArray(h.selectedListData)?h.selectedListData.push(h.allowObjectBinding?i:h.getDataByValue(i)):h.selectedListData=[h.selectedListData,h.allowObjectBinding?i:h.getDataByValue(i)]),(h.enableVirtualization&&i||!h.enableVirtualization)&&h.updateListSelectEventCallback(i,l,s,o),h.hideSelectedItem&&h.fixedHeaderElement&&h.fields.groupBy&&"CheckBox"!==h.mode&&e.prototype.scrollStop.call(h)}})}},s.prototype.addChip=function(e,t,i){this.chipCollectionWrapper&&this.getChip(e,t,i)},s.prototype.removeChipFocus=function(){var e=this.chipCollectionWrapper.querySelectorAll("span.e-chips."+Ce);if(t.removeClass(e,Ce),t.Browser.isDevice)for(var i=this.chipCollectionWrapper.querySelectorAll("span."+"e-chips-close".split(" ")[0]),s=0;s<i.length;s++)i[s].style.display="none"},s.prototype.onMobileChipInteraction=function(e){var i=t.closest(e.target,".e-chips"),s=i.querySelector("span."+"e-chips-close".split(" ")[0]);this.enabled&&!this.readonly&&(i.classList.contains(Ce)||(this.removeChipFocus(),s.style.display="",i.classList.add(Ce)),this.refreshPopup(),e.preventDefault())},s.prototype.multiCompiler=function(e){var i=!1;if("function"!=typeof e&&e)try{i=!!t.selectAll(e,document).length}catch(e){i=!1}return i},s.prototype.encodeHtmlEntities=function(e){return e.replace(/[\u00A0-\u9999<>&]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},s.prototype.getChip=function(e,i,s){var l,n=this,a={text:i,value:i},r=this.createElement("span",{className:ye,attrs:{"data-value":i,title:e,role:"option","aria-selected":"true"}}),o=this.createElement("span",{className:"e-chipcontent"}),h=this.createElement("span",{className:"e-chips-close"});if(this.mainData&&(a=this.getDataByValue(i)),this.valueTemplate&&!t.isNullOrUndefined(a)){var u=this.multiCompiler(this.valueTemplate),p=(l="function"!=typeof this.valueTemplate&&u?t.compile(t.select(this.valueTemplate,document).innerHTML.trim()):t.compile(this.valueTemplate))(a,this,"valueTemplate",this.valueTemplateId,this.isStringTemplate,null,o);p&&p.length>0&&t.append(p,o),this.renderReactTemplates()}else this.enableHtmlSanitizer?o.innerText=e:o.innerHTML=this.encodeHtmlEntities(e.toString());r.appendChild(o);var d={isInteracted:!!s,itemData:a,e:s,setClass:function(e){t.addClass([r],e)},cancel:!1};this.isPreventChange=this.isAngular&&this.preventChange,this.trigger("tagging",d,function(e){e.cancel||(t.Browser.isDevice?(r.classList.add("e-mob-chip"),t.append([h],r),h.style.display="none",t.EventHandler.add(r,"click",n.onMobileChipInteraction,n)):(t.EventHandler.add(r,"mousedown",n.chipClick,n),n.showClearButton&&r.appendChild(h)),t.EventHandler.add(h,"mousedown",n.onChipRemove,n),n.chipCollectionWrapper.appendChild(r),!n.changeOnBlur&&s&&n.updateValueState(s,n.value,n.tempValues))})},s.prototype.calcPopupWidth=function(){var e=t.formatUnit(this.popupWidth);return e.indexOf("%")>-1&&(e=(this.componentWrapper.offsetWidth*parseFloat(e)/100).toString()+"px"),this.allowResize&&this.resizeWidth?this.resizeWidth+"px":e},s.prototype.mouseIn=function(){this.enabled&&!this.readonly&&this.showOverAllClear()},s.prototype.mouseOut=function(){this.inputFocus||(this.overAllClear.style.display="none")},s.prototype.listOption=function(e,i){var s=!t.isNullOrUndefined(i.iconCss),l=t.isNullOrUndefined(i.properties)?i:i.properties;return this.listCurrentOptions=null!==i.text||null!==i.value?{fields:l,showIcon:s,ariaAttributes:{groupItemRole:"presentation"}}:{fields:{value:"text"}},t.extend(this.listCurrentOptions,this.listCurrentOptions,i,!0),"CheckBox"===this.mode&&this.notify("listoption",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,dataSource:e,fieldProperty:l}),this.listCurrentOptions},s.prototype.renderPopup=function(){var i=this;if(this.list||e.prototype.render.call(this),this.popupObj&&document.body.contains(this.popupObj.element)&&this.allowFiltering)return void this.refreshPopup();if(!this.popupObj&&!t.isNullOrUndefined(this.popupWrapper)){document.body.appendChild(this.popupWrapper);var s=this.popupWrapper.querySelector(".e-filter-parent");"CheckBox"===this.mode&&!this.allowFiltering&&s&&this.filterParent&&(s.remove(),this.filterParent=null);var l=parseInt(this.popupHeight,10);if(this.popupWrapper.style.visibility="hidden",this.headerTemplate&&(this.setHeaderTemplate(),l-=this.header.offsetHeight,this.isUpdateHeaderHeight=0!==this.header.offsetHeight),t.append([this.list],this.popupWrapper),!this.list.classList.contains(H.noData)&&this.getItems()[1]&&(this.listItemHeight=this.getItems()[1].offsetHeight+parseInt(window.getComputedStyle(this.getItems()[1]).marginBottom,10)),this.enableVirtualization&&!this.list.classList.contains(H.noData)){if(!this.list.querySelector(".e-virtual-ddl-content")&&this.list.querySelector(".e-list-parent")){var a=this.createElement("div",{className:"e-virtual-ddl-content"});a.style.cssText=this.getTransformValues(),this.list.appendChild(a).appendChild(this.list.querySelector(".e-list-parent"))}else this.list.querySelector(".e-virtual-ddl-content")&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues());if(this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+H.li),this.virtualItemCount=this.itemCount,"CheckBox"!==this.mode&&this.totalItemsCount(),this.list.querySelector(".e-virtual-ddl"))this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight();else{var r=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"});r.style.cssText=this.GetVirtualTrackHeight(),this.popupWrapper.querySelector(".e-dropdownbase").appendChild(r)}}if(this.footerTemplate&&(this.setFooterTemplate(),l-=this.footer.offsetHeight,this.isUpdateFooterHeight=0!==this.footer.offsetHeight),"CheckBox"===this.mode&&this.showSelectAll?(this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),l-=this.selectAllHeight):"CheckBox"!==this.mode||this.showSelectAll||this.headerTemplate||this.footerTemplate?"CheckBox"!==this.mode||this.showSelectAll||(this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),l=parseInt(this.popupHeight,10),this.headerTemplate&&this.header&&(l-=this.header.offsetHeight),this.footerTemplate&&this.footer&&(l-=this.footer.offsetHeight)):(this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),l=parseInt(this.popupHeight,10)),"CheckBox"===this.mode){var o={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,popupElement:this.popupWrapper};this.allowFiltering&&(this.notify("searchBox",o),l-=this.searchBoxHeight),t.addClass([this.popupWrapper],"e-checkbox")}"auto"!==this.popupHeight?(this.list.style.maxHeight=t.formatUnit(l),this.popupWrapper.style.maxHeight=t.formatUnit(this.popupHeight)):this.list.style.maxHeight=t.formatUnit(this.popupHeight),this.popupObj=new n.Popup(this.popupWrapper,{width:this.calcPopupWidth(),targetType:"relative",position:this.enableRtl?{X:"right",Y:"bottom"}:{X:"left",Y:"bottom"},relateTo:this.overAllWrapper,collision:this.enableRtl?{X:"fit",Y:"flip"}:{X:"flip",Y:"flip"},offsetY:1,enableRtl:this.enableRtl,zIndex:this.zIndex,close:function(){if(i.popupObj.element.parentElement){i.popupObj.unwireScrollEvents();var e=i.popupWrapper.querySelector(".e-input-filter");"CheckBox"===i.mode&&e&&document.activeElement===e&&e.blur(),t.detach(i.popupObj.element)}},open:function(){if(i.popupObj.resolveCollision(),!i.isFirstClick){var e=i.list.querySelector("ul");e&&("CheckBox"!==i.mode&&(i.allowFiltering||i.allowCustomValue)&&(""!==i.targetElement().trim()||""!==i.targetElement()&&i.allowCustomValue)||(i.mainList=e.cloneNode?e.cloneNode(!0):e)),i.isFirstClick=!0}i.popupObj.wireScrollEvents(),"CheckBox"!==i.mode&&(i.allowFiltering||i.allowCustomValue)&&(""!==i.targetElement().trim()||""!==i.targetElement()&&i.allowCustomValue)||i.enableVirtualization||(i.loadTemplate(),i.enableVirtualization&&"CheckBox"===i.mode&&i.UpdateSkeleton()),i.isPreventScrollAction=!0,i.setScrollPosition(),!i.list.classList.contains(H.noData)&&i.getItems()[1]&&0!==i.getItems()[1].offsetHeight&&(i.listItemHeight=i.getItems()[1].offsetHeight+parseInt(window.getComputedStyle(i.getItems()[1]).marginBottom,10),i.list.getElementsByClassName("e-virtual-ddl-content")[0]&&(i.list.getElementsByClassName("e-virtual-ddl-content")[0].style=i.getTransformValues())),i.allowFiltering&&i.notify("inputFocus",{module:"CheckBoxSelection",enable:"CheckBox"===i.mode,value:"focus"}),i.enableVirtualization&&(i.notify("bindScrollEvent",{module:"VirtualScroll",component:i.getModuleName(),enable:i.enableVirtualization}),setTimeout(function(){i.value?i.updateSelectionList():i.viewPortInfo&&i.viewPortInfo.offsets.top&&(i.list.scrollTop=i.viewPortInfo.offsets.top)},5))},targetExitViewport:function(){t.Browser.isDevice||i.hidePopup()}}),this.checkCollision(this.popupWrapper),this.popupContentElement=this.popupObj.element.querySelector(".e-content"),"CheckBox"===this.mode&&t.Browser.isDevice&&this.allowFiltering&&this.isDeviceFullScreen&&this.notify("deviceSearchBox",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),this.allowResize&&this.setResize(),this.popupObj.close(),this.popupWrapper.style.visibility=""}},s.prototype.checkCollision=function(e){"CheckBox"===this.mode&&t.Browser.isDevice&&this.allowFiltering&&this.isDeviceFullScreen||(n.isCollide(e).length>0&&(e.style.marginTop=-parseInt(getComputedStyle(e).marginTop,10)+"px"),this.popupObj.resolveCollision())},s.prototype.setHeaderTemplate=function(){var e;this.header&&this.header.remove(),this.header=this.createElement("div"),t.addClass([this.header],"e-ddl-header");var i=this.multiCompiler(this.headerTemplate),s=(e="function"!=typeof this.headerTemplate&&i?t.compile(t.select(this.headerTemplate,document).innerHTML.trim()):t.compile(this.headerTemplate))({},this,"headerTemplate",this.headerTemplateId,this.isStringTemplate,null,this.header);s&&s.length>0&&t.append(s,this.header),"CheckBox"===this.mode&&this.showSelectAll?t.prepend([this.header],this.popupWrapper):t.append([this.header],this.popupWrapper),t.EventHandler.add(this.header,"mousedown",this.onListMouseDown,this)},s.prototype.setFooterTemplate=function(){var e;this.footer&&this.footer.remove(),this.footer=this.createElement("div"),t.addClass([this.footer],"e-ddl-footer");var i=this.multiCompiler(this.footerTemplate),s=(e="function"!=typeof this.footerTemplate&&i?t.compile(t.select(this.footerTemplate,document).innerHTML.trim()):t.compile(this.footerTemplate))({},this,"footerTemplate",this.footerTemplateId,this.isStringTemplate,null,this.footer);s&&s.length>0&&t.append(s,this.footer),t.append([this.footer],this.popupWrapper),t.EventHandler.add(this.footer,"mousedown",this.onListMouseDown,this)},s.prototype.updateInitialData=function(){var e=this.selectData;this.renderItems(e,this.fields,!1,this.isClearAllAction);if(this.list.scrollTop=0,this.virtualListInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount},this.previousStartIndex=0,this.previousEndIndex=this.itemCount,this.dataSource instanceof i.DataManager?this.remoteDataCount>=0?this.totalItemCount=this.dataCount=this.remoteDataCount:this.resetList(this.dataSource):this.totalItemCount=this.dataCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.getSkeletonCount(),this.skeletonCount=0!==this.totalItemCount&&this.totalItemCount<2*this.itemCount&&(!(this.dataSource instanceof i.DataManager)||this.dataSource instanceof i.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,this.UpdateSkeleton(),this.list.getElementsByClassName("e-virtual-ddl")[0])this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight();else if(!this.list.querySelector(".e-virtual-ddl")&&this.skeletonCount>0){var t=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"});t.style.cssText=this.GetVirtualTrackHeight(),this.popupWrapper.querySelector(".e-dropdownbase").appendChild(t)}this.listData=e,this.liCollections=this.list.querySelectorAll(".e-list-item"),this.list.getElementsByClassName("e-virtual-ddl-content")[0]&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()),this.enableVirtualization&&this.notify("setGeneratedData",{module:"VirtualScroll"})},s.prototype.clearAll=function(e){if(this.enabled&&!this.readonly){var i=void 0;if(this.setDynValue=!1,this.isClearAllAction=!0,this.value&&this.value.length>0){this.allowFiltering&&(this.refreshListItems(null),"CheckBox"===this.mode&&this.targetInputElement&&(this.targetInputElement.value=""));var s=this.list&&this.list.querySelectorAll("li.e-list-item");if(s&&s.length>0)this.selectAllItems(!1,e);else for(this.removeIndex=0,i=this.value[this.removeIndex];this.removeIndex<this.value.length;i=this.value[this.removeIndex])this.removeValue(i,e,null,!0);this.selectedElementID=null,this.inputElement.removeAttribute("aria-activedescendant")}else this.clearAllCallback(e);this.checkAndResetCache(),null===this.element.querySelector(".e-multiselect .e-float-text-content")&&a.Input.createSpanElement(this.overAllWrapper,this.createElement),this.calculateWidth(),t.isNullOrUndefined(this.overAllWrapper)||t.isNullOrUndefined(this.overAllWrapper.getElementsByClassName("e-ddl-icon")[0]&&this.overAllWrapper.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType)||this.overAllWrapper.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon"),this.enableVirtualization&&(this.updateInitialData(),this.chipCollectionWrapper&&(this.chipCollectionWrapper.innerHTML=""),this.isCustomDataUpdated||this.notify("setGeneratedData",{module:"VirtualScroll"})),this.enableVirtualization&&(this.list.scrollTop=0,this.virtualListInfo=null,this.previousStartIndex=0,this.previousEndIndex=this.itemCount),this.isClearAllAction=!1}this.isClearAllItem=!0,t.EventHandler.add(document,"mouseup",this.preventSelection,this)},s.prototype.preventSelection=function(e){this.isClearAllItem&&e.stopPropagation(),this.isClearAllItem=!1,t.EventHandler.remove(document,"mouseup",this.preventSelection)},s.prototype.clearAllCallback=function(e,i){var s=this.value?this.value.slice():[];if(this.mainList&&this.listData&&(this.allowFiltering&&"CheckBox"!==this.mode||this.allowCustomValue)){var l=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.onActionComplete(l,this.mainData)}this.focusAtFirstListItem(),this.updateDelimeter(this.delimiterChar,e),"Box"===this.mode||this.inputFocus&&"CheckBox"!==this.mode||this.updateDelimView(),""!==this.inputElement.value&&(this.makeTextBoxEmpty(),this.search(null)),this.checkPlaceholderSize(),this.isPopupOpen()&&this.refreshPopup(),this.allowResize&&this.setResize(),this.inputFocus||(this.changeOnBlur&&this.updateValueState(e,this.value,s),"CheckBox"!==this.mode&&this.inputElement.focus()),"CheckBox"===this.mode&&(this.refreshPlaceHolder(),this.refreshInputHight(),this.changeOnBlur&&i&&(t.isNullOrUndefined(this.value)||0===this.value.length)&&this.updateValueState(e,this.value,this.tempValues)),this.changeOnBlur||!i||!t.isNullOrUndefined(this.value)&&0!==this.value.length||this.updateValueState(e,this.value,this.tempValues),"CheckBox"===this.mode&&this.enableGroupCheckBox&&!t.isNullOrUndefined(this.fields.groupBy)&&this.updateListItems(this.list.querySelectorAll("li.e-list-item"),this.mainList.querySelectorAll("li.e-list-item")),e.preventDefault()},s.prototype.windowResize=function(){this.refreshPopup(),this.inputFocus&&"CheckBox"!==this.mode||!this.viewWrapper||!this.viewWrapper.parentElement||this.updateDelimView()},s.prototype.resetValueHandler=function(e){if(!t.isNullOrUndefined(this.inputElement)){var i=t.closest(this.inputElement,"form");if(i&&e.target===i){var s=this.element.tagName===this.getNgDirective()?null:this.element.getAttribute("data-initial-value");this.text=s}}},s.prototype.wireEvent=function(){t.EventHandler.add(this.componentWrapper,"mousedown",this.wrapperClick,this),t.EventHandler.add(window,"resize",this.windowResize,this),t.EventHandler.add(this.inputElement,"focus",this.focusInHandler,this),t.EventHandler.add(this.inputElement,"keydown",this.onKeyDown,this),t.EventHandler.add(this.inputElement,"keyup",this.keyUp,this),"CheckBox"!==this.mode&&t.EventHandler.add(this.inputElement,"input",this.onInput,this),t.EventHandler.add(this.inputElement,"blur",this.onBlurHandler,this),t.EventHandler.add(this.componentWrapper,"mouseover",this.mouseIn,this);var e=t.closest(this.inputElement,"form");e&&t.EventHandler.add(e,"reset",this.resetValueHandler,this),t.EventHandler.add(this.componentWrapper,"mouseout",this.mouseOut,this),t.EventHandler.add(this.overAllClear,"mousedown",this.clearAll,this),t.EventHandler.add(this.inputElement,"paste",this.pasteHandler,this)},s.prototype.onInput=function(e){this.keyDownStatus?this.isValidKey=!0:this.isValidKey=!1,this.keyDownStatus=!1,t.Browser.isDevice&&"mozilla"===t.Browser.info.name&&this.search(e)},s.prototype.pasteHandler=function(e){var t=this;setTimeout(function(){t.expandTextbox(),t.search(e)})},s.prototype.performFiltering=function(e){var t=this,s={preventDefaultAction:!1,text:this.targetElement(),updateData:function(e,i,l){s.cancel||(t.isFiltered=!0,t.customFilterQuery=i,t.remoteFilterAction=!0,t.isCustomFiltering=!0,t.dataUpdater(e,i,l))},event:e,cancel:!1};this.trigger("filtering",s,function(e){t.isFilterPrevented=e.cancel,e.cancel||t.isFiltered||e.preventDefaultAction||(t.isFilterAction=!0,t.isFilteringAction=!0,t.dataSource instanceof i.DataManager&&t.allowCustomValue&&(t.isCustomRendered=!1),t.dataUpdater(t.dataSource,null,t.fields),t.isFilteringAction=!1)}),this.updatePopupHeightOnFilter()},s.prototype.search=function(e){if(this.preventSetCurrentData=!1,this.firstItem=this.dataSource&&this.dataSource.length>0?this.dataSource[0]:null,t.isNullOrUndefined(e)||(this.keyCode=e.keyCode),!this.isPopupOpen()&&this.openOnClick&&this.showPopup(e),this.openClick(e),!this.checkTextLength()||this.allowFiltering||t.isNullOrUndefined(e)||8===e.keyCode){var s=this.targetElement();if(this.allowFiltering)this.allowCustomValue&&(this.isRemoteSelection=!0),this.checkAndResetCache(),this.isRequesting=!1,""!==this.targetElement()&&this.debounceDelay>0?this.debouncedFiltering(e,this.debounceDelay):this.performFiltering(e);else if(this.allowCustomValue){var l=new i.Query;l=this.allowFiltering&&""!==s?l.where(this.fields.text,"startswith",s,this.ignoreCase,this.ignoreAccent):l,this.enableVirtualization?this.dataUpdater(this.dataSource,l,this.fields):this.dataUpdater(this.mainData,l,this.fields),this.UpdateSkeleton()}else{var n=this.list.querySelectorAll("li."+H.li+":not(.e-hide-listitem)"),a=this.typeOfData(this.listData).typeof,r=u(this.targetElement(),n,"StartsWith",this.ignoreCase);if(this.enableVirtualization&&""!==this.targetElement().trim()&&!this.allowFiltering){var o=!1;for((this.viewPortInfo.endIndex>=this.incrementalEndIndex&&this.incrementalEndIndex<=this.totalItemCount||0===this.incrementalEndIndex)&&(o=!0,this.incrementalStartIndex=0,this.incrementalEndIndex=100>this.totalItemCount?this.totalItemCount:100,this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),o=!1),(0!==this.viewPortInfo.startIndex||o)&&this.updateIncrementalView(0,this.itemCount),r=u(this.targetElement(),this.incrementalLiCollections,this.filterType,!0,this.listData,this.fields,a);t.isNullOrUndefined(r)&&this.incrementalEndIndex<this.totalItemCount&&(this.incrementalStartIndex=this.incrementalEndIndex,this.incrementalEndIndex=this.incrementalEndIndex+100>this.totalItemCount?this.totalItemCount:this.incrementalEndIndex+100,this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),o=!0,(0!==this.viewPortInfo.startIndex||o)&&this.updateIncrementalView(0,this.itemCount),r=u(this.targetElement(),this.incrementalLiCollections,this.filterType,!0,this.listData,this.fields,a),t.isNullOrUndefined(r));)if(t.isNullOrUndefined(r)&&this.incrementalEndIndex>=this.totalItemCount){this.incrementalStartIndex=0,this.incrementalEndIndex=100>this.totalItemCount?this.totalItemCount:100;break}if(r.index&&!(this.viewPortInfo.startIndex>=r.index&&r.index>=this.viewPortInfo.endIndex)){p=(h=r.index-(this.itemCount/2-2)>0?r.index-(this.itemCount/2-2):0)+this.itemCount>this.totalItemCount?this.totalItemCount:h+this.itemCount;h!==this.viewPortInfo.startIndex&&this.updateIncrementalView(h,p)}if(t.isNullOrUndefined(r.item))this.updateIncrementalView(0,this.itemCount),this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.list.scrollTop=0;else{if(this.getIndexByValue(r.item.getAttribute("data-value"))-this.skeletonCount>this.itemCount/2){var h=this.viewPortInfo.startIndex+(this.itemCount/2-2)<this.totalItemCount?this.viewPortInfo.startIndex+(this.itemCount/2-2):this.totalItemCount,p=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount;this.updateIncrementalView(h,p)}r.item=this.getElementByValue(r.item.getAttribute("data-value"))}r&&r.item&&(r.item=this.getElementByValue(r.item.getAttribute("data-value")))}r&&r.item?(this.addListFocus(r.item),this.list.scrollTop=r.item.offsetHeight*r.index):""!==this.targetElement()?this.removeFocus():this.focusAtFirstListItem()}}else this.focusAtFirstListItem();this.enableVirtualization&&this.allowFiltering&&this.getFilteringSkeletonCount()},s.prototype.preRender=function(){null===this.allowFiltering&&(this.allowFiltering="CheckBox"===this.mode),this.preventSetCurrentData=!1,this.initializeData(),this.updateDataAttribute(this.htmlAttributes),e.prototype.preRender.call(this)},s.prototype.getLocaleName=function(){return"multi-select"},s.prototype.initializeData=function(){this.mainListCollection=[],this.beforePopupOpen=!1,this.isFilterAction=!1,this.remoteFilterAction=!1,this.isFirstClick=!1,this.mobFilter=!0,this.isFiltered=!1,this.focused=!0,this.initial=!0,this.backCommand=!0,this.isCustomRendered=!1,this.isRemoteSelection=!1,this.isSelectAllTarget=!0,this.isaddNonPresentItems=!1,this.viewPortInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount}},s.prototype.updateData=function(e,i,s){var l,n="",a="Delimiter"===this.mode||"CheckBox"===this.mode,r=[],o=this.listData;if(this.enableVirtualization||(this.listData=this.mainData),t.isNullOrUndefined(this.hiddenElement)||this.enableVirtualization||(this.hiddenElement.innerHTML=""),!t.isNullOrUndefined(this.value)){for(var h,u=this.value.length,p="",d=this,c=0;c<u;c++){var m=function(o){var c=d.allowObjectBinding?t.getValue(d.fields.value?d.fields.value:"",d.value[o]):d.value[o],m=d.findListElement(t.isNullOrUndefined(d.mainList)?d.ulElement:d.mainList,"li","data-value",c);if(d.enableVirtualization&&(m=d.findListElement(t.isNullOrUndefined(d.list)?d.ulElement:d.list,"li","data-value",c)),t.isNullOrUndefined(m)&&!d.allowCustomValue&&!d.enableVirtualization&&d.listData&&d.listData.length>0)d.value.splice(o,1),o-=1,u-=1;else{if(d.listData){if(d.enableVirtualization){!a||d.isDynamicRemoteVirtualData||s||(n=d.delimiterWrapper&&""===d.delimiterWrapper.innerHTML?n:d.delimiterWrapper.innerHTML);var f=d.allowObjectBinding?t.getValue(d.fields.value?d.fields.value:"",d.value[d.value.length-1]):d.value[d.value.length-1];if(d.isRemoveSelection)n=d.text.replace(/,/g,e+" ")+e+" ",r=d.text.split(e);else{l=s&&a?d.text.replace(/,/g,e+" "):d.getTextByValue(f);var v=d.isDynamicRemoteVirtualData&&null!=f&&""!==f&&!s?d.getTextByValue(f):s?d.text:d.text&&""!==d.text?d.text+d.delimiterChar+l:l;n+=l+e+" ",r.push(v),p=d.hiddenElement.innerHTML}if(i&&i.currentTarget&&i.currentTarget.classList.contains("e-chips-close")||i&&"Backspace"===i.key){var g=i.target.parentElement.getAttribute("data-value");if("Backspace"===i.key){var y=d.hiddenElement.lastChild;y&&d.hiddenElement.removeChild(y)}else d.hiddenElement.childNodes.forEach(function(e){e.value===g&&e.parentNode.removeChild(e)});p=d.hiddenElement.innerHTML}else p+="<option selected value='"+f+"'>"+o+"</option>";return h=o,"break"}l=d.getTextByValue(c)}else l=c;n+=l+e+" ",r.push(l)}p+='<option selected value="'+c+'">'+o+"</option>",h=o}(c);if(c=h,"break"===m)break}t.isNullOrUndefined(this.hiddenElement)||(this.isRemoveSelection?(this.findListElement(this.hiddenElement,"option","value",this.currentRemoveValue)&&this.hiddenElement.removeChild(this.findListElement(this.hiddenElement,"option","value",this.currentRemoveValue)),this.isRemoveSelection=!1):this.hiddenElement.innerHTML=p)}var f=i&&i.target&&i.target.classList.contains("e-chips-close");(!this.enableVirtualization||this.enableVirtualization&&"CheckBox"!==this.mode&&!f)&&this.setProperties({text:r.toString()},!0),a&&(this.updateWrapperText(this.delimiterWrapper,n),this.delimiterWrapper.setAttribute("id",t.getUniqueID("delim_val")),this.inputElement.setAttribute("aria-describedby",this.delimiterWrapper.id));var v=i&&i.target,g=!(!v||!v.classList.contains("e-close-hooker"))||null;(!this.changeOnBlur&&i&&!g||this.isSelectAll)&&(this.isSelectAll=!1,this.updateValueState(i,this.value,this.tempValues)),this.listData=o,this.addValidInputClass()},s.prototype.initialTextUpdate=function(){if(t.isNullOrUndefined(this.text))this.setProperties({value:null},!0);else{for(var e=this.text.split(this.delimiterChar),i=[],s=0;e.length>s;s++){var l=this.getValueByText(e[s]);t.isNullOrUndefined(l)?this.allowCustomValue&&i.push(e[s]):i.push(l)}if(i&&i.length){var n=this.allowObjectBinding?this.getDataByValue(i):i;this.setProperties({value:n},!0)}}},s.prototype.renderList=function(t){!t&&this.allowCustomValue&&this.list&&(this.list.textContent===this.noRecordsTemplate||this.list.querySelector(".e-ul")&&0===this.list.querySelector(".e-ul").childElementCount)&&(t=!0),e.prototype.render.call(this,null,t),this.totalItemCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.unwireListEvents(),this.wireListEvents()},s.prototype.initialValueUpdate=function(e,s){var l=this;if(this.list){var n,a=void 0,r=void 0;if(this.chipCollectionWrapper&&(this.chipCollectionWrapper.innerHTML=""),this.removeListSelection(),!t.isNullOrUndefined(this.value))for(var o=0;!t.isNullOrUndefined(this.value[o]);o++){n=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",this.value[o]):this.value[o],r=this.findListElement(this.hideSelectedItem?this.ulElement:this.list,"li","data-value",n);var h=!1;if(this.enableVirtualization){if(a=null,null!=e&&e.length>0)for(var u=0;u<e.length;u++)if(this.isPrimitiveData&&e[u]===n||!this.isPrimitiveData&&t.getValue(this.fields.value?this.fields.value:"value",e[u])===n){a=this.isPrimitiveData?e[u]:t.getValue(this.fields.text,e[u]),this.enableVirtualization&&(t.isNullOrUndefined(this.selectedListData)?this.selectedListData=[e[u]]:(this.allowObjectBinding&&!this.isObjectInArray(e[u],this.selectedListData)||!this.allowObjectBinding)&&(Array.isArray(this.selectedListData)?this.selectedListData.push(e[u]):this.selectedListData=[this.selectedListData,e[u]]));break}t.isNullOrUndefined(a)&&this.allowCustomValue&&(!(this.dataSource instanceof i.DataManager)||this.dataSource instanceof i.DataManager&&s)?(a=this.getTextByValue(n),h=!0):!t.isNullOrUndefined(a)||this.allowCustomValue||this.dataSource instanceof i.DataManager&&!(this.dataSource instanceof i.DataManager&&s)||(this.value.splice(o,1),o-=1)}else a=this.getTextByValue(n);if(r&&"true"!==r.getAttribute("aria-selected")||r&&"true"===r.getAttribute("aria-selected")&&this.hideSelectedItem&&("Box"===this.mode||"Default"===this.mode)||this.enableVirtualization&&null!=n&&null!=a&&!h){var p=[],d=this.isDynamicRemoteVirtualData&&null!=a&&""!==a&&0===o?a:null==this.text||""===this.text||this.text.includes(a)?a:this.text+this.delimiterChar+a;p.push(d),this.setProperties({text:p.toString()},!0),this.addChip(a,n),this.addListSelection(r)}else if(!this.enableVirtualization&&n&&this.allowCustomValue||this.enableVirtualization&&n&&this.allowCustomValue&&(!(this.dataSource instanceof i.DataManager)||this.dataSource instanceof i.DataManager&&s)){var c=this.listData.length,m={};t.setValue(this.fields.text,n,m),t.setValue(this.fields.value,n,m);var f=this.popupWrapper.querySelector("."+H.noData);if(m&&this.allowObjectBinding&&this.allowCustomValue&&this.value.length>0&&"object"==typeof this.value[0]){var v=this.value.filter(function(e){return e[l.fields.value]===n});v.length>0&&(m=v[0])}this.enableVirtualization||this.addItem(m,c),this.enableVirtualization&&(this.virtualCustomSelectData&&this.virtualCustomSelectData.length>=0?this.virtualCustomSelectData.push(m):this.virtualCustomSelectData=[m]),r=r||this.findListElement(this.hideSelectedItem?this.ulElement:this.list,"li","data-value",n),this.popupWrapper.contains(f)&&(this.list.setAttribute("style",f.getAttribute("style")),this.popupWrapper.replaceChild(this.list,f),this.wireListEvents());var p=[],d=null!=this.text&&""!==this.text?this.text+this.delimiterChar+a:a;p.push(d),this.setProperties({text:p.toString()},!0),this.addChip(a,n),this.addListSelection(r)}}"CheckBox"===this.mode?(this.updateDelimView(),this.changeOnBlur&&this.updateValueState(null,this.value,this.tempValues),this.updateDelimeter(this.delimiterChar),this.refreshInputHight()):this.updateDelimeter(this.delimiterChar,null,s),"CheckBox"!==this.mode||!this.showSelectAll||!t.isNullOrUndefined(this.value)&&this.value.length||this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"uncheck"}),"Box"===this.mode||"Default"===this.mode&&this.inputFocus?this.chipCollectionWrapper.style.display="":"Delimiter"!==this.mode&&"CheckBox"!==this.mode||this.showDelimWrapper()}},s.prototype.updateActionCompleteData=function(e,i){this.value&&(!this.allowObjectBinding&&this.value.indexOf(e.getAttribute("data-value"))>-1||this.allowObjectBinding&&this.isObjectInArray(this.getDataByValue(e.getAttribute("data-value")),this.value))&&(this.mainList=this.ulElement,this.hideSelectedItem&&t.addClass([e],ge))},s.prototype.updateAddItemList=function(e,i){this.popupObj&&this.popupObj.element&&this.popupObj.element.querySelector("."+H.noData)&&e?(this.list=e,this.mainList=this.ulElement=e.querySelector("ul"),t.remove(this.popupWrapper.querySelector(".e-content")),this.popupObj=null,this.renderPopup()):this.allowCustomValue&&(this.list=e,this.mainList=this.ulElement=e.querySelector("ul"))},s.prototype.updateDataList=function(){if(this.mainList&&this.ulElement&&!(this.isFiltered||this.isFilterAction||this.targetElement().trim())){var e=this.mainList.childElementCount<this.ulElement.childElementCount,t=this.ulElement.childElementCount>0&&this.ulElement.children[0].childElementCount>0&&this.mainList.children[0]&&this.mainList.children[0].childElementCount<this.ulElement.children[0].childElementCount,i=this.itemTemplate&&this.ulElement.childElementCount>0&&!(this.ulElement.childElementCount<this.mainList.childElementCount)&&(this.ulElement.children[0].childElementCount>0||this.fields.groupBy&&this.ulElement.children[1]&&this.ulElement.children[1].childElementCount>0);(e||t||i)&&(this.mainList=this.ulElement)}},s.prototype.isValidLI=function(e){return e&&!e.classList.contains(H.disabled)&&!e.classList.contains(H.group)&&e.classList.contains(H.li)},s.prototype.updateListSelection=function(e,i,s){var l=e.getAttribute("data-value"),n=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(l)):this.getFormattedValue(l);this.allowCustomValue&&("false"!==l&&!1===n||!t.isNullOrUndefined(n)&&"NaN"===n.toString())&&(n=l),this.removeHover(),!this.value||!this.allowObjectBinding&&-1===this.value.indexOf(n)||this.allowObjectBinding&&-1===this.indexOfObjectInArray(n,this.value)?this.dispatchSelect(n,i,e,"true"===e.getAttribute("aria-selected"),s):this.removeValue(n,i,s),this.checkAndScrollParent()},s.prototype.updateListSelectEventCallback=function(e,i,s,l){var n=this;e=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",e):e;var a=l||this.getTextByValue(e);if((this.allowCustomValue||this.allowFiltering)&&!this.findListElement(this.mainList,"li","data-value",e)&&(!this.enableVirtualization||this.enableVirtualization&&this.virtualCustomData)){var r=i?i.cloneNode(!0):i,o=this.fields.value?this.fields.value:"value";this.allowCustomValue&&this.mainData.length&&"number"==typeof t.getValue(o,this.mainData[0])&&(e=isNaN(parseFloat(e.toString()))?e:parseFloat(e.toString()));var h=this.getDataByValue(e),u={newData:h,cancel:!1};this.trigger("customValueSelection",u,function(i){i.cancel||(n.enableVirtualization&&n.virtualCustomData?(n.virtualCustomSelectData&&n.virtualCustomSelectData.length>=0?n.virtualCustomSelectData.push(h):n.virtualCustomSelectData=[h],n.remoteCustomValue=!1,n.addValue(e,a,s)):(t.append([r],n.mainList),n.mainData.push(h),n.remoteCustomValue=!1,n.addValue(e,a,s)))})}else this.remoteCustomValue=!1,this.addValue(e,a,s)},s.prototype.removeListSelection=function(){var e=this.hideSelectedItem?ge:H.selected,i=this.list.querySelectorAll("."+e),s=i.length;if(i&&i.length)for(t.removeClass(i,e);s>0;)i[s-1].setAttribute("aria-selected","false"),"CheckBox"===this.mode&&i&&i.length>s-1&&t.removeClass([i[s-1].firstElementChild.lastElementChild],"e-check"),s--;if(!t.isNullOrUndefined(this.mainList)){var l=this.mainList.querySelectorAll("."+e),n=l.length;if(l&&l.length)for(t.removeClass(l,e);n>0;)l[n-1].setAttribute("aria-selected","false"),"CheckBox"===this.mode&&(i&&i.length>n-1&&t.removeClass([i[n-1].firstElementChild.lastElementChild],"e-check"),t.removeClass([l[n-1].firstElementChild.lastElementChild],"e-check")),n--}},s.prototype.removeHover=function(){var e=this.list.querySelectorAll("."+H.hover);e&&e.length&&t.removeClass(e,H.hover)},s.prototype.removeFocus=function(){if(this.list&&this.mainList){var e=this.list.querySelectorAll("."+H.focus),i=this.mainList.querySelectorAll("."+H.focus);e&&e.length&&(t.removeClass(e,H.focus),t.removeClass(i,H.focus))}},s.prototype.addListHover=function(e){this.enabled&&this.isValidLI(e)?(this.removeHover(),t.addClass([e],H.hover)):null!==e&&e.classList.contains("e-list-group-item")&&this.enableGroupCheckBox&&"CheckBox"===this.mode&&!t.isNullOrUndefined(this.fields.groupBy)&&(this.removeHover(),t.addClass([e],H.hover))},s.prototype.addListFocus=function(e){this.enabled&&(this.isValidLI(e)||this.fields.disabled&&this.isDisabledElement(e))?(this.removeFocus(),t.addClass([e],H.focus),this.updateAriaActiveDescendant()):this.enableGroupCheckBox&&"CheckBox"===this.mode&&!t.isNullOrUndefined(this.fields.groupBy)&&(t.addClass([e],H.focus),this.updateAriaActiveDescendant())},s.prototype.addListSelection=function(e,i){var s=this.hideSelectedItem?ge:H.selected;this.isValidLI(e)&&!e.classList.contains(H.hover)&&(t.addClass([e],s),this.updateMainList(!1,e.getAttribute("data-value"),i),e.setAttribute("aria-selected","true"),"CheckBox"===this.mode&&e.classList.contains("e-active")&&0===e.getElementsByClassName("e-check").length&&this.notify("updatelist",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:e,e:this}),this.notify("activeList",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:e,e:this}),this.chipCollectionWrapper&&this.removeChipSelection(),this.selectedElementID=e.id)},s.prototype.updateDelimeter=function(e,t,i){this.updateData(e,t,i)},s.prototype.onMouseClick=function(e){var i=this;if(!this.isClearAllItem){this.keyCode=null,this.scrollFocusStatus=!1,this.keyboardEvent=null;var s=e.target,l=t.closest(s,"."+H.li);if(this.enableVirtualization&&l&&l.classList.contains("e-virtual-list"))return;if(t.closest(s,"."+H.group)&&this.enableGroupCheckBox&&"CheckBox"===this.mode&&this.fields.groupBy)(s=s.classList.contains("e-list-group-item")?s.firstElementChild.lastElementChild:e.target).classList.contains("e-check")?(this.selectAllItem(!1,e),s.classList.remove("e-check"),s.classList.remove("e-stop"),t.closest(s,".e-list-group-item").classList.remove("e-active"),s.setAttribute("aria-selected","false")):(this.selectAllItem(!0,e),s.classList.remove("e-stop"),s.classList.add("e-check"),t.closest(s,".e-list-group-item").classList.add("e-active"),s.setAttribute("aria-selected","true")),this.refreshSelection(),this.checkSelectAll();else{if(this.isValidLI(l)){var n=this.value&&this.value.length?this.value.length:0;l.classList.contains("e-active")&&(n-=1),n<this.maximumSelectionLength&&(this.updateListSelection(l,e),this.checkPlaceholderSize(),this.addListFocus(l),(this.allowCustomValue||this.allowFiltering)&&this.mainList&&this.listData?"CheckBox"!==this.mode&&(this.focusAtLastListItem(l.getAttribute("data-value")),this.refreshSelection()):this.makeTextBoxEmpty()),"CheckBox"===this.mode?(this.updateDelimView(),this.value&&this.value.length>50?setTimeout(function(){i.updateDelimeter(i.delimiterChar,e)},0):this.updateDelimeter(this.delimiterChar,e),this.refreshInputHight()):this.updateDelimeter(this.delimiterChar,e),this.checkSelectAll(),this.refreshPopup(),this.allowResize&&this.setResize(),this.hideSelectedItem&&this.focusAtFirstListItem(),this.closePopupOnSelect?this.hidePopup(e):e.preventDefault();var a=""!==this.targetElement().trim();this.makeTextBoxEmpty(),this.findGroupStart(s),"CheckBox"!==this.mode&&this.refreshListItems(t.isNullOrUndefined(l)?null:l.textContent,a)}else e.preventDefault();if(this.enableVirtualization&&this.hideSelectedItem){var r=this.list.querySelectorAll("li."+H.li+":not(."+ge+"):not(.e-reorder-hide):not(.e-virtual-list)");if(r.length){var o=this.virtualListHeight>0?Math.floor(this.virtualListHeight/this.listItemHeight):0;if(r.length<o+2){var h=this.getForQuery(this.value).clone();if(h=h.skip(this.virtualItemStartIndex),this.resetList(this.dataSource,this.fields,h),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+H.li),this.virtualItemCount=this.itemCount,"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.list.querySelector(".e-virtual-ddl"))this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight();else{var u=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"});u.style.cssText=this.GetVirtualTrackHeight(),this.popupWrapper.querySelector(".e-dropdownbase").appendChild(u)}this.list.querySelector(".e-virtual-ddl-content")&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues())}}}this.refreshPlaceHolder(),this.deselectHeader()}}},s.prototype.findGroupStart=function(e){if(this.enableGroupCheckBox&&"CheckBox"===this.mode&&!t.isNullOrUndefined(this.fields.groupBy)){var i=void 0;if(this.itemTemplate&&!e.getElementsByClassName("e-frame").length)for(;!e.getElementsByClassName("e-frame").length;)e=e.parentElement;for(e.classList.contains("e-frame")&&(e=e.parentElement.parentElement),i=this.findGroupAttrtibutes(e,0,0,0,0),i=this.findGroupAttrtibutes(e,i[0],i[1],i[2],1);!e.classList.contains("e-list-group-item")&&(e.classList.contains("e-list-icon")&&(e=e.parentElement),null!=(e=e.previousElementSibling)););this.updateCheckBox(e,i[0],i[1],i[2])}},s.prototype.findGroupAttrtibutes=function(e,t,i,s,l){for(;!e.classList.contains("e-list-group-item")&&(this.fields.disabled&&this.isDisabledElement(e)||(e.classList.contains("e-list-icon")&&(e=e.parentElement),e.getElementsByClassName("e-frame")[0].classList.contains("e-check")&&e.classList.contains("e-list-item")?t++:e.classList.contains("e-list-item")&&i++,s++),null!=(e=l?e.nextElementSibling:e.previousElementSibling)););return[t,i,s]},s.prototype.updateCheckBox=function(e,i,s,l){if(null!==e&&(t.isNullOrUndefined(this.fields.disabled)||0!==l)){var n=e.getElementsByClassName("e-frame")[0];l===i?(n.classList.remove("e-stop"),n.classList.add("e-check"),t.closest(n,".e-list-group-item").classList.add("e-active"),e.setAttribute("aria-selected","true")):l===s?(n.classList.remove("e-check"),n.classList.remove("e-stop"),t.closest(n,".e-list-group-item").classList.remove("e-active"),e.setAttribute("aria-selected","false")):this.maximumSelectionLength===i-1?(n.classList.remove("e-stop"),e.setAttribute("aria-selected","true"),t.closest(n,".e-list-group-item").classList.add("e-active"),n.classList.add("e-check")):(n.classList.remove("e-check"),n.classList.add("e-stop"),t.closest(n,".e-list-group-item").classList.add("e-active"),e.setAttribute("aria-selected","false"))}},s.prototype.disableGroupHeader=function(){var e=this.list.querySelectorAll("li.e-list-group-item");if(e)for(var t=0;t<e.length;t++){for(var i=!0,s=e[t].nextElementSibling;!s.classList.contains("e-list-group-item");){if(!this.isDisabledElement(s)){i=!1;break}if(null==(s=s.nextElementSibling))break}i&&this.disableListItem(e[t])}},s.prototype.deselectHeader=function(){var e=this.value&&this.value.length?this.value.length:0,i=this.list.querySelectorAll("li.e-list-group-item:not(.e-active)");e<this.maximumSelectionLength&&t.removeClass(i,"e-disable"),e===this.maximumSelectionLength&&t.addClass(i,"e-disable")},s.prototype.onMouseOver=function(e){var i=t.closest(e.target,"."+H.li);null===i&&"CheckBox"===this.mode&&!t.isNullOrUndefined(this.fields.groupBy)&&this.enableGroupCheckBox&&(i=t.closest(e.target,"."+H.group)),this.addListHover(i)},s.prototype.onMouseLeave=function(){this.removeHover()},s.prototype.onListMouseDown=function(e){e.preventDefault(),this.scrollFocusStatus=!0},s.prototype.onDocumentClick=function(e){if("CheckBox"!==this.mode){var i=e.target;!t.isNullOrUndefined(this.popupObj)&&t.closest(i,'[id="'+this.popupObj.element.id+'"]')||this.overAllWrapper.contains(e.target)?this.scrollFocusStatus=(t.Browser.isIE||"edge"===t.Browser.info.name)&&document.activeElement===this.inputElement:this.scrollFocusStatus=!1}},s.prototype.wireListEvents=function(){t.isNullOrUndefined(this.list)||(t.EventHandler.add(document,"mousedown",this.onDocumentClick,this),t.EventHandler.add(this.list,"mousedown",this.onListMouseDown,this),t.EventHandler.add(this.list,"mouseup",this.onMouseClick,this),t.EventHandler.add(this.list,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.list,"mouseout",this.onMouseLeave,this))},s.prototype.unwireListEvents=function(){t.EventHandler.remove(document,"mousedown",this.onDocumentClick),this.list&&(t.EventHandler.remove(this.list,"mousedown",this.onListMouseDown),t.EventHandler.remove(this.list,"mouseup",this.onMouseClick),t.EventHandler.remove(this.list,"mouseover",this.onMouseOver),t.EventHandler.remove(this.list,"mouseout",this.onMouseLeave))},s.prototype.hideOverAllClear=function(){this.value&&this.value.length&&""!==this.inputElement.value||(this.overAllClear.style.display="none")},s.prototype.showOverAllClear=function(){(this.value&&this.value.length||""!==this.inputElement.value)&&this.showClearButton&&!0!==this.readonly?this.overAllClear.style.display="":this.overAllClear.style.display="none"},s.prototype.focusIn=function(){document.activeElement!==this.inputElement&&this.enabled&&this.inputElement.focus()},s.prototype.focusOut=function(){document.activeElement===this.inputElement&&this.enabled&&this.inputElement.blur()},s.prototype.showSpinner=function(){if(t.isNullOrUndefined(this.spinnerElement)){var e=this.filterParent&&this.filterParent.querySelector(".e-clear-icon.e-icons");"none"!==this.overAllClear.style.display||e?this.spinnerElement=e||this.overAllClear:(this.spinnerElement=this.createElement("span",{className:"e-chips-close e-close-hooker e-ms-spinner-icon"}),this.componentWrapper.appendChild(this.spinnerElement)),n.createSpinner({target:this.spinnerElement,width:t.Browser.isDevice?"16px":"14px"},this.createElement),t.addClass([this.spinnerElement],"e-ddl-disable-icon"),n.showSpinner(this.spinnerElement)}},s.prototype.hideSpinner=function(){t.isNullOrUndefined(this.spinnerElement)||(n.hideSpinner(this.spinnerElement),t.removeClass([this.spinnerElement],"e-ddl-disable-icon"),this.spinnerElement.classList.contains("e-ms-spinner-icon")?t.detach(this.spinnerElement):this.spinnerElement.innerHTML="",this.spinnerElement=null)},s.prototype.updateWrapperText=function(e,t){this.valueTemplate||!this.enableHtmlSanitizer?e.innerHTML=this.encodeHtmlEntities(t):e.innerText=t},s.prototype.updateDelimView=function(){if(this.delimiterWrapper&&this.hideDelimWrapper(),this.chipCollectionWrapper&&(this.chipCollectionWrapper.style.display="none"),t.isNullOrUndefined(this.viewWrapper)||(this.viewWrapper.style.display="",this.viewWrapper.style.width="",this.viewWrapper.classList.remove("e-delim-total")),this.value&&this.value.length){var e="",i=void 0,s=void 0,l=1,n=void 0,a=void 0,r=0,o=void 0;this.enableVirtualization||this.updateWrapperText(this.viewWrapper,e);var h={noRecordsTemplate:"No records found",actionFailureTemplate:"Request failed",overflowCountTemplate:"+${count} more..",totalCountTemplate:"${count} selected"},u=new t.L10n(this.getLocaleName(),h,this.locale);""===u.getConstant("actionFailureTemplate")&&(u=new t.L10n("dropdowns",h,this.locale)),""===u.getConstant("noRecordsTemplate")&&(u=new t.L10n("dropdowns",h,this.locale));var p=u.getConstant("overflowCountTemplate"),d=u.getConstant("totalCountTemplate"),c=this.createElement("span",{className:"e-remain"}),m=p.replace("${count}",this.value.length.toString());c.innerText=m,this.viewWrapper.appendChild(c),this.renderReactTemplates();var f=c.offsetWidth;if(t.remove(c),this.showDropDownIcon&&(r=this.dropIcon.offsetWidth+parseInt(window.getComputedStyle(this.dropIcon).marginRight,10)),this.checkClearIconWidth(),!t.isNullOrUndefined(this.value)&&(this.allowCustomValue||this.listData&&this.listData.length>0))for(var v=0;!t.isNullOrUndefined(this.value[v]);v++){var g=this.text&&this.text.split(this.delimiterChar);if(this.enableVirtualization?g&&(e+=0===v?"":this.delimiterChar+" ",e+=i=g[v],i=this.viewWrapper.innerHTML,this.updateWrapperText(this.viewWrapper,e)):(e+=0===v?"":this.delimiterChar+" ",e+=i=this.getOverflowVal(v),i=this.viewWrapper.innerHTML,this.updateWrapperText(this.viewWrapper,e)),n=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10)+parseInt(window.getComputedStyle(this.viewWrapper).paddingLeft,10),o=this.componentWrapper.offsetWidth-parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft,10)-parseInt(window.getComputedStyle(this.componentWrapper).paddingRight,10),n+r+this.clearIconWidth>o){for(void 0!==s&&""!==s&&(i=s,v=l+1),this.updateWrapperText(this.viewWrapper,i),a=this.value.length-v,n=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10)+parseInt(window.getComputedStyle(this.viewWrapper).paddingLeft,10);n+f+r+this.clearIconWidth>o&&0!==n&&""!==this.viewWrapper.innerHTML;){var y=[];this.viewWrapper.innerHTML=y.join(this.delimiterChar),a=this.value.length,n=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10)+parseInt(window.getComputedStyle(this.viewWrapper).paddingLeft,10)}break}n+f+r+this.clearIconWidth<=o?(s=e,l=v):0===v&&(s="",l=-1)}if(a>0){var C=o-r-this.clearIconWidth;this.viewWrapper.appendChild(this.updateRemainTemplate(c,this.viewWrapper,a,p,d,C)),this.updateRemainWidth(this.viewWrapper,C),this.updateRemainingText(c,r,a,p,d)}}else t.isNullOrUndefined(this.viewWrapper)||(this.viewWrapper.innerHTML="",this.viewWrapper.style.display="none")},s.prototype.checkClearIconWidth=function(){this.showClearButton&&(this.clearIconWidth=parseInt(window.getComputedStyle(this.overAllClear).width,10)||this.overAllClear.offsetWidth)},s.prototype.updateRemainWidth=function(e,t){e.classList.contains("e-delim-total")&&t<e.offsetWidth+parseInt(window.getComputedStyle(e).paddingLeft,10)+parseInt(window.getComputedStyle(e).paddingRight,10)&&(e.style.width=t+"px")},s.prototype.updateRemainTemplate=function(e,t,i,s,l,n){t.firstChild&&3===t.firstChild.nodeType&&""===t.firstChild.nodeValue&&t.removeChild(t.firstChild),e.innerHTML="";var a=s.replace("${count}",i.toString()),r=l.replace("${count}",i.toString());return e.innerText=t.firstChild&&3===t.firstChild.nodeType?a:r,t.firstChild&&3===t.firstChild.nodeType?t.classList.remove("e-delim-total"):(t.classList.add("e-delim-total"),this.updateRemainWidth(t,n)),e},s.prototype.updateRemainingText=function(e,t,i,s,l){var n=this.componentWrapper.offsetWidth-parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft,10)-parseInt(window.getComputedStyle(this.componentWrapper).paddingRight,10),a=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10);if(a+t>=n&&0!==a&&this.viewWrapper.firstChild&&3===this.viewWrapper.firstChild.nodeType){for(;a+t>n&&0!==a&&this.viewWrapper.firstChild&&3===this.viewWrapper.firstChild.nodeType;){var r=this.viewWrapper.firstChild.nodeValue.split(this.delimiterChar);r.pop(),this.viewWrapper.firstChild.nodeValue=r.join(this.delimiterChar),""===this.viewWrapper.firstChild.nodeValue&&this.viewWrapper.removeChild(this.viewWrapper.firstChild),i++,a=this.viewWrapper.offsetWidth}var o=n-t;this.updateRemainTemplate(e,this.viewWrapper,i,s,l,o)}},s.prototype.getOverflowVal=function(e){var i;if(this.mainData&&this.mainData.length){var s=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",this.value[e]):this.value[e];if("CheckBox"===this.mode){var l=this.listData;this.listData=this.mainData,i=this.getTextByValue(s),this.listData=l}else i=this.getTextByValue(s)}else i=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",this.value[e]):this.value[e];return i},s.prototype.unWireEvent=function(){if(t.isNullOrUndefined(this.componentWrapper)||t.EventHandler.remove(this.componentWrapper,"mousedown",this.wrapperClick),t.EventHandler.remove(window,"resize",this.windowResize),!t.isNullOrUndefined(this.inputElement)){t.EventHandler.remove(this.inputElement,"focus",this.focusInHandler),t.EventHandler.remove(this.inputElement,"keydown",this.onKeyDown),"CheckBox"!==this.mode&&t.EventHandler.remove(this.inputElement,"input",this.onInput),t.EventHandler.remove(this.inputElement,"keyup",this.keyUp);var e=t.closest(this.inputElement,"form");e&&t.EventHandler.remove(e,"reset",this.resetValueHandler),t.EventHandler.remove(this.inputElement,"blur",this.onBlurHandler)}t.isNullOrUndefined(this.componentWrapper)||(t.EventHandler.remove(this.componentWrapper,"mouseover",this.mouseIn),t.EventHandler.remove(this.componentWrapper,"mouseout",this.mouseOut)),t.isNullOrUndefined(this.overAllClear)||t.EventHandler.remove(this.overAllClear,"mousedown",this.clearAll),t.isNullOrUndefined(this.inputElement)||t.EventHandler.remove(this.inputElement,"paste",this.pasteHandler)},s.prototype.resizingWireEvent=function(){t.EventHandler.add(document,"mousemove",this.resizePopup,this),t.EventHandler.add(document,"mouseup",this.stopResizing,this),t.EventHandler.add(document,"touchmove",this.resizePopup,this),t.EventHandler.add(document,"touchend",this.stopResizing,this)},s.prototype.resizingUnWireEvent=function(){t.EventHandler.remove(document,"mousemove",this.resizePopup),t.EventHandler.remove(document,"mouseup",this.stopResizing),t.EventHandler.remove(document,"touchmove",this.resizePopup),t.EventHandler.remove(document,"touchend",this.stopResizing)},s.prototype.selectAllItem=function(e,i,s){var l;if(t.isNullOrUndefined(this.list)||(l=this.list.querySelectorAll(e?'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)':'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)')),this.value&&this.value.length&&i&&i.target&&t.closest(i.target,".e-close-hooker")&&this.allowFiltering&&(l=this.mainList.querySelectorAll(e?'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)':'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)')),this.enableGroupCheckBox&&"CheckBox"===this.mode&&!t.isNullOrUndefined(this.fields.groupBy)){var n=i?this.groupTemplate?t.closest(i.target,".e-list-group-item"):i.target:null;if(n=i&&32===i.keyCode?s:n,(n=n&&n.classList.contains("e-frame")?n.parentElement.parentElement:n)&&n.classList.contains("e-list-group-item")){var a=n.nextElementSibling;if(t.isNullOrUndefined(a))return;for(;a.classList.contains("e-list-item");){if(!this.fields.disabled||!this.isDisabledElement(a))if(e){if(!a.firstElementChild.lastElementChild.classList.contains("e-check")){var r=this.value&&this.value.length?this.value.length:0;a.classList.contains("e-active")&&(r-=1),r<this.maximumSelectionLength&&this.updateListSelection(a,i)}}else a.firstElementChild.lastElementChild.classList.contains("e-check")&&this.updateListSelection(a,i);if(null==(a=a.nextElementSibling))break}if(n.classList.contains("e-list-group-item")){var o=this.list.getElementsByClassName("e-item-focus")[0];o&&o.classList.remove("e-item-focus"),e?n.classList.add("e-active"):n.classList.remove("e-active"),n.classList.add("e-item-focus"),this.updateAriaActiveDescendant()}this.textboxValueUpdate(),this.checkPlaceholderSize(),!this.changeOnBlur&&i&&this.updateValueState(i,this.value,this.tempValues)}else this.updateValue(i,l,e)}else this.updateValue(i,l,e);this.addValidInputClass()},s.prototype.virtualSelectionAll=function(e,i,s){var l=this,n=0,a=i.length,r=this.maximumSelectionLength;if(e){this.virtualSelectAll=!0,a=this.virtualSelectAllData&&0!==this.virtualSelectAllData.length?this.virtualSelectAllData.length:a,this.listData=this.virtualSelectAllData;var o=this.createListItems(this.virtualSelectAllData.slice(0,30),this.fields).querySelectorAll("li"),h=document.createDocumentFragment();o.forEach(function(e){h.appendChild(e.cloneNode(!0))}),i.forEach(function(e){h.appendChild(e.cloneNode(!0))});var u=h.childNodes;if(this.virtualSelectAllData instanceof Array){for(;n<a&&n<=50&&n<r;){if(this.isSelectAllTarget=a===n+1,u[n]){p=this.allowObjectBinding?this.getDataByValue(u[n].getAttribute("data-value")):this.getFormattedValue(u[n].getAttribute("data-value"));if(!this.allowObjectBinding&&this.value&&this.value.indexOf(p)>=0||this.allowObjectBinding&&this.indexOfObjectInArray(p,this.value)>=0){n++;continue}this.updateListSelection(u[n],s,a-n)}else{var p=t.getValue(this.fields.value?this.fields.value:"",this.virtualSelectAllData[n]);if(p=this.allowObjectBinding?this.getDataByValue(p):p,!this.allowObjectBinding&&this.value&&this.value.indexOf(p)>=0||this.allowObjectBinding&&this.indexOfObjectInArray(p,this.value)>=0){n++;continue}this.value&&null!=p&&Array.isArray(this.value)&&(!this.allowObjectBinding&&this.value.indexOf(p)<0||this.allowObjectBinding&&!this.isObjectInArray(p,this.value))&&this.dispatchSelect(p,s,null,!1,a)}n++}a>50&&setTimeout(function(){if(l.virtualSelectAllData&&l.virtualSelectAllData.length>0&&l.virtualSelectAllData.map(function(e){if(l.value&&null!=e[l.fields.value]&&Array.isArray(l.value)&&(!l.allowObjectBinding&&l.value.indexOf(e[l.fields.value])<0||l.allowObjectBinding&&!l.isObjectInArray(e[l.fields.value],l.value))){var t=e[l.fields.value],i=e[l.fields.text].toString();l.dispatchSelect(t,s,null,!1,a,e,i)}}),l.updatedataValueItems(s),l.isSelectAllLoop=!1,l.changeOnBlur||(l.updateValueState(s,l.value,l.tempValues),l.isSelectAll=l.isSelectAll?!l.isSelectAll:l.isSelectAll),l.updateHiddenElement(!0),l.popupWrapper&&i[n-1]&&i[n-1].classList.contains("e-item-focus")){var e=document.getElementsByClassName("e-selectall-parent")[0];e&&e.classList.contains("e-item-focus")&&i[n-1].classList.remove("e-item-focus")}l.checkSelectAll()},0)}}else this.virtualSelectAllData&&this.virtualSelectAllData.length>0&&this.virtualSelectAllData.map(function(e){l.virtualSelectAll=!0,l.removeValue(l.value[n],s,l.value.length-n)}),this.updatedataValueItems(s),this.changeOnBlur||(this.updateValueState(s,this.value,this.tempValues),this.isSelectAll=this.isSelectAll?!this.isSelectAll:this.isSelectAll),this.updateHiddenElement(),this.setProperties({value:[]},!0),this.selectedListData=[],this.virtualSelectAll=!1,t.isNullOrUndefined(this.viewPortInfo.startIndex)||t.isNullOrUndefined(this.viewPortInfo.endIndex)||this.notify("setCurrentViewDataAsync",{component:this.getModuleName(),module:"VirtualScroll"});this.checkSelectAll();var d=this.list.getElementsByClassName("e-virtual-ddl")[0];d&&(d.style=this.GetVirtualTrackHeight()),this.UpdateSkeleton();var c=this.list.getElementsByClassName("e-virtual-ddl-content")[0];c&&(c.style=this.getTransformValues())},s.prototype.updateValue=function(e,s,l){var n=this,a=s.length,r={event:e,items:l?s:[],itemData:l?this.listData:[],isInteracted:!!e,isChecked:l,preventSelectEvent:!1};if(this.trigger("beforeSelectAll",r),s&&s.length||this.enableVirtualization&&!l){var o=0,h=0;if(h=this.enableGroupCheckBox?l?this.maximumSelectionLength-(this.value?this.value.length:0):s.length:l?this.maximumSelectionLength-(this.value?this.value.length:0):this.maximumSelectionLength,r.preventSelectEvent){for(var u=0;u<s.length&&u<h;u++){this.removeHover();var p=s[u].getAttribute("data-value"),d=this.getFormattedValue(p);d=this.allowObjectBinding?this.getDataByValue(d):d;var c=this.mainList?this.mainList.querySelectorAll(l?'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)':'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)')[u]:null;l?(this.value=this.value?this.value:[],(!this.allowObjectBinding&&this.value.indexOf(d)<0||this.allowObjectBinding&&!this.isObjectInArray(d,this.value))&&this.setProperties({value:[].concat([],this.value,[d])},!0),this.removeFocus(),this.addListSelection(s[u],c),this.updateChipStatus(),this.checkMaxSelection()):this.removeAllItems(d,e,!1,s[u],c),this.enableGroupCheckBox&&this.findGroupStart(s[u])}if(!l&&(this.value&&this.value.length?this.value.length:0)<this.maximumSelectionLength){var m=this.list.querySelectorAll("li."+H.li+":not(.e-active)");t.removeClass(m,"e-disable")}var f={event:e,items:l?s:[],itemData:l?this.listData:[],isInteracted:!!e,isChecked:l};this.trigger("selectedAll",f)}else if(this.enableVirtualization)this.virtualSelectAllState=l,this.virtualSelectAll=!0,this.CurrentEvent=e,this.virtualSelectAllData||this.resetList(this.dataSource,this.fields,new i.Query),this.virtualSelectAllData&&this.virtualSelectionAll(l,s,e);else{for(;o<a&&o<=50&&o<h;)this.isSelectAllTarget=a===o+1,this.updateListSelection(s[o],e,a-o),this.enableGroupCheckBox&&this.findGroupStart(s[o]),o++;a>50&&setTimeout(function(){for(;o<a&&o<h;)n.isSelectAllTarget=a===o+1,n.updateListSelection(s[o],e,a-o),n.enableGroupCheckBox&&n.findGroupStart(s[o]),o++;if(n.updatedataValueItems(e),n.changeOnBlur||(n.updateValueState(e,n.value,n.tempValues),n.isSelectAll=n.isSelectAll?!n.isSelectAll:n.isSelectAll),n.updateHiddenElement(),n.popupWrapper&&s[o-1].classList.contains("e-item-focus")){var t=document.getElementsByClassName("e-selectall-parent")[0];t&&t.classList.contains("e-item-focus")&&s[o-1].classList.remove("e-item-focus")}},0)}}this.updatedataValueItems(e),this.checkPlaceholderSize(),a<=50&&!r.preventSelectEvent&&(this.changeOnBlur||(this.updateValueState(e,this.value,this.tempValues),this.isSelectAll=this.isSelectAll?!this.isSelectAll:this.isSelectAll),(this.enableVirtualization&&this.value&&this.value.length>0||!this.enableVirtualization)&&this.updateHiddenElement())},s.prototype.updateHiddenElement=function(e){var i=this,s="",l="",n="",a=[];"CheckBox"===this.mode&&(this.value.map(function(t,r){s+='<option selected value ="'+t+'">'+r+"</option>",e||(n=i.listData?i.getTextByValue(t):t,l+=n+i.delimiterChar+" ",a.push(n))}),this.hiddenElement.innerHTML=s,e||(this.updateWrapperText(this.delimiterWrapper,l),this.setProperties({text:a.toString()},!0)),this.delimiterWrapper.setAttribute("id",t.getUniqueID("delim_val")),this.inputElement.setAttribute("aria-describedby",this.delimiterWrapper.id),this.refreshInputHight(),this.refreshPlaceHolder())},s.prototype.updatedataValueItems=function(e){this.deselectHeader(),this.textboxValueUpdate(e)},s.prototype.textboxValueUpdate=function(e){var i=e&&e.target&&(t.closest(e.target,".e-selectall-parent")||t.closest(e.target,".e-close-hooker"));"Box"===this.mode||this.isPopupOpen()||"CheckBox"===this.mode&&(this.isSelectAll||i)?this.searchWrapper.classList.remove("e-zero-size"):this.updateDelimView(),"CheckBox"===this.mode?(this.updateDelimView(),(!i&&!this.isSelectAll&&this.isSelectAllTarget||this.isSelectAll&&this.isSelectAllTarget)&&this.updateDelimeter(this.delimiterChar,e),this.refreshInputHight()):this.updateDelimeter(this.delimiterChar,e),this.refreshPlaceHolder()},s.prototype.setZIndex=function(){this.popupObj&&this.popupObj.setProperties({zIndex:this.zIndex})},s.prototype.updateDataSource=function(e){this.checkAndResetCache(),t.isNullOrUndefined(this.list)?this.renderPopup():this.resetList(this.dataSource),this.value&&this.value.length&&(this.setProperties({value:this.value}),this.refreshSelection())},s.prototype.onLoadSelect=function(){this.setDynValue=!0,this.renderPopup()},s.prototype.selectAllItems=function(s,l){var n=this;if(t.isNullOrUndefined(this.list))this.selectAllAction=function(){if("CheckBox"===n.mode&&n.showSelectAll){var e={module:"CheckBoxSelection",enable:"CheckBox"===n.mode,value:s?"check":"uncheck"};n.notify("checkSelectAll",e)}n.selectAllItem(s,l),n.selectAllAction=null},e.prototype.render.call(this);else{if(this.selectAllAction=null,"CheckBox"===this.mode&&this.showSelectAll){var a={value:s?"check":"uncheck",enable:"CheckBox"===this.mode,module:"CheckBoxSelection"};this.notify("checkSelectAll",a)}this.selectAllItem(s,l)}this.dataSource instanceof i.DataManager&&!(this.dataSource instanceof i.DataManager&&this.virtualSelectAllData)||(this.virtualSelectAll=!1)},s.prototype.getPersistData=function(){return this.addOnPersist(["value"])},s.prototype.onPropertyChanged=function(i,s){(i.dataSource&&!t.isNullOrUndefined(Object.keys(i.dataSource))||i.query&&!t.isNullOrUndefined(Object.keys(i.query)))&&(this.mainList=null,this.mainData=null,this.isFirstClick=!1,this.isDynamicDataChange=!0),"multiselect"===this.getModuleName()&&(this.isFilterAction=!1,this.setUpdateInitial(["fields","query","dataSource"],i));for(var l=0,n=Object.keys(i);l<n.length;l++){var r=n[l];switch(r){case"query":case"dataSource":"CheckBox"===this.mode&&this.showSelectAll&&(t.isNullOrUndefined(this.popupObj)||(this.popupObj.destroy(),this.popupObj=null),this.renderPopup());break;case"htmlAttributes":this.updateHTMLAttribute();break;case"showClearButton":this.updateClearButton(i.showClearButton);break;case"text":this.fields.disabled&&(this.text=this.text&&!this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text)))?this.text:null),this.updateVal(this.value,this.value,"text");break;case"value":if(this.fields.disabled&&this.removeDisabledItemsValue(this.value),this.updateVal(this.value,s.value,"value"),this.addValidInputClass(),!this.closePopupOnSelect&&this.isPopupOpen()&&this.refreshPopup(),this.isPopupOpen()&&"CheckBox"===this.mode&&this.list&&this.list.querySelector(".e-active.e-disable")){var o=this.list.querySelectorAll("li."+H.li+".e-active.e-disable");t.removeClass(o,"e-disable")}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange;break;case"width":this.setWidth(i.width),this.popupObj.setProperties({width:this.calcPopupWidth()});break;case"placeholder":this.refreshPlaceHolder();break;case"filterBarPlaceholder":this.allowFiltering&&this.notify("filterBarPlaceholder",{filterBarPlaceholder:i.filterBarPlaceholder});break;case"delimiterChar":"Box"!==this.mode&&this.updateDelimView(),this.updateData(i.delimiterChar);break;case"cssClass":this.updateOldPropCssClass(s.cssClass),this.updateCssClass(),this.calculateWidth();break;case"enableRtl":this.enableRTL(i.enableRtl),e.prototype.onPropertyChanged.call(this,i,s);break;case"allowResize":if(this.allowResize=i.allowResize,!this.allowResize&&this.popupObj){h=parseInt(this.popupHeight,10);"auto"!==this.popupHeight?(this.list.style.maxHeight=t.formatUnit(h),this.popupWrapper.style.height=t.formatUnit(this.popupHeight),this.popupWrapper.style.maxHeight=t.formatUnit(this.popupHeight)):this.list.style.maxHeight=t.formatUnit(this.popupHeight)}break;case"readonly":this.updateReadonly(i.readonly),this.hidePopup();break;case"enabled":this.hidePopup(),this.enable(i.enabled);break;case"showSelectAll":this.popupObj&&(this.popupObj.destroy(),this.popupObj=null),this.renderPopup();break;case"showDropDownIcon":this.dropDownIcon();break;case"floatLabelType":this.setFloatLabelType(),this.addValidInputClass(),null===this.element.querySelector(".e-multiselect .e-float-text-content")&&a.Input.createSpanElement(this.overAllWrapper,this.createElement),this.calculateWidth(),t.isNullOrUndefined(this.overAllWrapper)||t.isNullOrUndefined(this.overAllWrapper.getElementsByClassName("e-ddl-icon")[0]&&this.overAllWrapper.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType)||this.overAllWrapper.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon");break;case"enableSelectionOrder":break;case"selectAllText":this.notify("selectAllText",!1);break;case"popupHeight":if(this.popupObj){var h=parseInt(this.popupHeight,10);"auto"!==this.popupHeight?(this.list.style.maxHeight=t.formatUnit(h),this.popupWrapper.style.maxHeight=t.formatUnit(this.popupHeight)):this.list.style.maxHeight=t.formatUnit(this.popupHeight)}break;case"headerTemplate":case"footerTemplate":this.reInitializePoup();break;case"allowFiltering":"CheckBox"===this.mode&&this.popupObj&&this.reInitializePoup(),this.updateSelectElementData(this.allowFiltering);break;case"fields":t.isNullOrUndefined(this.fields.groupBy)&&this.removeScrollEvent();break;default:var u=this.getPropObject(r,i,s);e.prototype.onPropertyChanged.call(this,u.newProperty,u.oldProperty)}}},s.prototype.reInitializePoup=function(){this.popupObj&&(this.popupObj.destroy(),this.popupObj=null),this.renderPopup()},s.prototype.totalItemsCount=function(){var e;if(this.dataSource instanceof i.DataManager?this.remoteDataCount>=0?e=this.totalItemCount=this.dataCount=this.remoteDataCount:this.resetList(this.dataSource):e=this.dataSource&&this.dataSource.length?this.dataSource.length:0,"CheckBox"===this.mode)this.totalItemCount=0!==e?e:this.totalItemCount;else if(this.hideSelectedItem){if(this.totalItemCount=0!==e&&this.value?e-this.value.length:this.totalItemCount,this.allowCustomValue&&this.virtualCustomSelectData&&this.virtualCustomSelectData.length>0)for(var s=0;s<this.virtualCustomSelectData.length;s++)for(var l=0;l<this.value.length;l++)(this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",this.value[l]):this.value[l])===t.getValue(this.fields.value?this.fields.value:"",this.virtualCustomSelectData[s])&&(this.totalItemCount+=1)}else this.totalItemCount=0!==e?e:this.totalItemCount,this.allowCustomValue&&this.virtualCustomSelectData&&this.virtualCustomSelectData.length>0&&(this.totalItemCount+=this.virtualCustomSelectData.length)},s.prototype.presentItemValue=function(e){for(var i=[],s=0;s<this.value.length;s++){var l=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",this.value[s]):this.value[s];if(!this.findListElement(this.allowFiltering&&!t.isNullOrUndefined(this.mainList)?this.mainList:e,"li","data-value",l)){var n=this.allowObjectBinding?this.getDataByValue(this.value[s]):this.value[s];i.push(n)}}return i},s.prototype.addNonPresentItems=function(e,t,i,s){var l=this;this.dataSource.executeQuery(this.getForQuery(e)).then(function(e){e.result.length>0&&l.addItem(e.result,i.length),l.updateActionList(t,i,s)})},s.prototype.updateVal=function(e,s,l){var n=this;if(this.list)if(!(this.dataSource instanceof i.DataManager)||this.listData&&this.mainList&&this.mainData){var a=[];t.isNullOrUndefined(this.value)||this.allowCustomValue||(a=this.presentItemValue(this.ulElement));var r=a.some(function(e){return null!==e});if("value"===l&&a.length>0&&this.dataSource instanceof i.DataManager&&!t.isNullOrUndefined(this.value)&&null!=this.listData&&(!this.enableVirtualization||this.enableVirtualization&&this.valueTemplate)&&r)this.mainData=null,this.setDynValue=!0,this.isaddNonPresentItems=!0,this.addNonPresentItems(a,this.ulElement,this.listData),this.isaddNonPresentItems=!1;else{if(this.selectedListData=[],"text"===l&&(this.initialTextUpdate(),e=this.value),(t.isNullOrUndefined(this.value)||0===this.value.length)&&(this.tempValues=s),this.allowCustomValue&&("Default"===this.mode||"Box"===this.mode)&&this.isReact&&this.inputFocus&&this.isPopupOpen()&&this.mainData!==this.listData){var o=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.onActionComplete(o,this.mainData)}if(this.enableVirtualization)if(!this.enableVirtualization||this.dataSource instanceof i.DataManager){if(!this.isInitRemoteVirtualData)if(this.allowObjectBinding&&!r&&this.value&&this.value.length){for(var h=this.isPrimitiveData?"":this.fields.value,u=void 0,p=0;p<this.value.length;p++){var d=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",this.value[p]):this.value[p];u=0===p?new i.Predicate(h,"equal",d):u.or(h,"equal",d)}this.dataSource instanceof i.DataManager&&this.dataSource.executeQuery((new i.Query).where(u)).then(function(e){if(e.result.length>0){var t=e.result;n.isDynamicRemoteVirtualData=!0,setTimeout(function(){n.initialValueUpdate(t,!0),n.isDynamicRemoteVirtualData=!1,(!n.inputFocus||n.inputFocus&&"Default"!==n.mode)&&n.initialUpdate()},100)}})}else this.isDynamicRemoteVirtualData=!0,this.initialValueUpdate(this.listData,!0),this.isDynamicRemoteVirtualData=!1,this.initialUpdate()}else this.initialValueUpdate(this.dataSource,!0);else this.initialValueUpdate();"Box"===this.mode||this.inputFocus||this.updateDelimView(),this.inputFocus||this.refreshInputHight(),this.refreshPlaceHolder(),"CheckBox"!==this.mode&&this.changeOnBlur&&this.updateValueState(null,e,s),this.checkPlaceholderSize()}}else this.onLoadSelect();else this.onLoadSelect(),this.enableVirtualization&&(this.setProperties({text:""},!0),this.selectedListData=[],this.checkInitialValue());this.changeOnBlur||this.updateValueState(null,e,s)},s.prototype.addItem=function(t,i){e.prototype.addItem.call(this,t,i)},s.prototype.hidePopup=function(e){var s=this;if(this.isPopupOpen()){var l={name:"FadeOut",duration:100,delay:100};this.customFilterQuery=null;var n={popup:this.popupObj,cancel:!1,animation:l,event:e||null};this.trigger("close",n,function(e){if(!e.cancel){s.fields.groupBy&&"CheckBox"!==s.mode&&s.fixedHeaderElement&&(t.remove(s.fixedHeaderElement),s.fixedHeaderElement=null),s.beforePopupOpen=!1,s.overAllWrapper.classList.remove("e-icon-anim");var l="CheckBox"===s.mode?s.targetElement():null;if(s.popupObj.hide(new t.Animation(e.animation)),t.attributes(s.inputElement,{"aria-expanded":"false"}),s.inputElement.removeAttribute("aria-owns"),s.inputElement.removeAttribute("aria-activedescendant"),s.allowFiltering&&s.notify("inputFocus",{module:"CheckBoxSelection",enable:"CheckBox"===s.mode,value:"clear"}),s.popupObj.hide(),t.removeClass([document.body,s.popupObj.element],"e-popup-full-page"),t.EventHandler.remove(s.list,"keydown",s.onKeyDown),"CheckBox"===s.mode&&s.showSelectAll&&t.EventHandler.remove(s.popupObj.element,"click",s.clickHandler),s.list&&s.list.parentElement&&s.allowResize){s.resizer&&s.list.parentElement.contains(s.resizer)&&s.list.parentElement.removeChild(s.resizer),s.list.parentElement.classList.contains("e-resize")&&s.list.parentElement.classList.remove("e-resize"),s.list.parentElement.style.boxSizing="",s.list.parentElement.style.paddingBottom="";var n=parseInt(s.popupHeight,10);s.list.style.maxHeight=t.formatUnit(n),"auto"!==s.popupHeight.toString().toLowerCase()&&s.initialPopupHeight>=parseInt(s.popupHeight.toString(),10)-2&&(s.list.parentElement.style.height=t.formatUnit(s.popupHeight)),s.list.parentElement.style.maxHeight=t.formatUnit(s.popupHeight)}s.resizer&&(t.EventHandler.remove(s.resizer,"mousedown",s.startResizing),s.resizer.remove()),s.enableVirtualization&&"CheckBox"===s.mode&&s.value&&s.value.length>0&&s.enableSelectionOrder&&(s.viewPortInfo.startIndex=s.virtualItemStartIndex=0,s.viewPortInfo.endIndex=s.virtualItemEndIndex=s.viewPortInfo.startIndex>0?s.viewPortInfo.endIndex:s.itemCount,s.virtualListInfo=s.viewPortInfo,s.previousStartIndex=0,s.previousEndIndex=s.itemCount);var a=void 0;s.dataSource instanceof i.DataManager?s.remoteDataCount>=0?s.totalItemCount=s.dataCount=s.remoteDataCount:s.resetList(s.dataSource):a=s.dataSource&&s.dataSource.length?s.dataSource.length:0,s.enableVirtualization&&(s.allowFiltering||s.allowCustomValue)&&(s.targetElement()||l)&&s.totalItemCount!==a&&(s.checkAndResetCache(),s.updateInitialData()),s.virtualCustomData&&s.viewPortInfo&&0===s.viewPortInfo.startIndex&&s.viewPortInfo.endIndex===s.itemCount&&s.renderItems(s.mainData,s.fields),s.virtualCustomData=null,s.isVirtualTrackHeight=!1}})}},s.prototype.showPopup=function(i){var s=this;if(this.enabled){this.firstItem=this.dataSource&&this.dataSource.length>0?this.dataSource[0]:null;var l={cancel:!1};this.trigger("beforeOpen",l,function(l){if(!l.cancel){if(!s.ulElement)return s.beforePopupOpen=!0,"CheckBox"===s.mode&&t.Browser.isDevice&&s.allowFiltering&&s.isDeviceFullScreen&&s.notify("popupFullScreen",{module:"CheckBoxSelection",enable:"CheckBox"===s.mode}),void e.prototype.render.call(s,i);"CheckBox"===s.mode&&t.Browser.isDevice&&s.allowFiltering&&s.isDeviceFullScreen&&s.notify("popupFullScreen",{module:"CheckBoxSelection",enable:"CheckBox"===s.mode});var n=s.ulElement.querySelectorAll("li.e-list-item").length,a=s.ulElement.querySelectorAll("li."+H.li+"."+ge).length;if(n>0&&n===a&&a===s.mainData.length&&(""===s.targetElement()||!s.allowCustomValue))return void(s.beforePopupOpen=!1);if(s.onPopupShown(i),s.enableVirtualization&&s.listData&&s.listData.length&&(t.isNullOrUndefined(s.value)||"dropdownlist"!==s.getModuleName()&&"combobox"!==s.getModuleName()||s.removeHover(),s.beforePopupOpen||(s.hideSelectedItem&&s.value&&Array.isArray(s.value)&&s.value.length>0&&s.totalItemsCount(),s.preventSetCurrentData||t.isNullOrUndefined(s.viewPortInfo.startIndex)||t.isNullOrUndefined(s.viewPortInfo.endIndex)||s.notify("setCurrentViewDataAsync",{component:s.getModuleName(),module:"VirtualScroll"}))),s.enableVirtualization&&!s.allowFiltering&&null!=s.selectedValueInfo&&s.selectedValueInfo.startIndex>0&&null!=s.value&&s.notify("dataProcessAsync",{module:"VirtualScroll",isOpen:!0}),s.enableVirtualization)s.updatevirtualizationList();else if(s.value&&s.value.length)for(var r=void 0,o=(s.getItems(),0),h=s.value;o<h.length;o++){var u=h[o],p=s.allowObjectBinding?t.getValue(s.fields.value?s.fields.value:"",u):u;(r=s.getElementByValue(p))&&s.addListSelection(r)}s.allowResize&&s.setResize(),s.preventSetCurrentData=!0}})}},s.prototype.selectAll=function(e){this.isSelectAll=!0,this.selectAllItems(e)},s.prototype.getRightIconsWidth=function(){for(var e=0,t=this.overAllWrapper.querySelectorAll(".e-input-group-icon, .e-clear-icon"),i=0;i<t.length;i++)e+=t[i].offsetWidth;return e},s.prototype.updateFloatLabelOverflowWidth=function(){var e=this.overAllWrapper,t=e.querySelector(".e-float-text"),i=e.clientWidth-this.getRightIconsWidth();t&&i&&(t.style.width=i+"px")},s.prototype.getModuleName=function(){return"multiselect"},s.prototype.clear=function(){var e=this;this.selectAll(!1),this.value&&this.value.length?setTimeout(function(){e.setProperties({value:null},!0)},0):this.setProperties({value:null},!0),this.checkAndResetCache(),this.enableVirtualization&&(this.updateInitialData(),this.chipCollectionWrapper&&(this.chipCollectionWrapper.innerHTML=""),this.isCustomDataUpdated||this.notify("setGeneratedData",{module:"VirtualScroll"}),this.list.scrollTop=0,this.virtualListInfo=null,this.previousStartIndex=0,this.previousEndIndex=this.itemCount)},s.prototype.render=function(){!t.isNullOrUndefined(this.value)&&this.value.length>0&&(this.value=this.value.slice()),this.setDynValue=this.initStatus=!1,this.isSelectAll=!1,this.selectAllEventEle=[],this.searchWrapper=this.createElement("span",{className:"e-searcher "+("Box"===this.mode?"e-multiselect-box":"")}),this.viewWrapper=this.createElement("span",{className:"e-delim-view e-delim-values"}),this.viewWrapper.style.display="none",this.overAllClear=this.createElement("span",{className:"e-chips-close e-close-hooker"}),this.overAllClear.style.display="none",this.componentWrapper=this.createElement("div",{className:"e-multi-select-wrapper"}),this.overAllWrapper=this.createElement("div",{className:"e-multiselect e-input-group e-control-wrapper"}),"CheckBox"===this.mode&&t.addClass([this.overAllWrapper],"e-checkbox"),t.Browser.isDevice&&this.componentWrapper.classList.add("e-mob-wrapper"),this.setWidth(this.width),this.overAllWrapper.appendChild(this.componentWrapper),this.popupWrapper=this.createElement("div",{id:this.element.id+"_popup",className:"e-ddl e-popup e-multi-select-list-wrapper"}),this.popupWrapper.setAttribute("aria-label",this.element.id),this.popupWrapper.setAttribute("role","dialog"),"Delimiter"===this.mode||"CheckBox"===this.mode?(this.delimiterWrapper=this.createElement("span",{className:"e-delim-values"}),this.delimiterWrapper.style.display="none",this.componentWrapper.appendChild(this.delimiterWrapper)):(this.chipCollectionWrapper=this.createElement("span",{className:"e-chips-collection"}),this.chipCollectionWrapper.style.display="none","Default"===this.mode?this.chipCollectionWrapper.setAttribute("id",t.getUniqueID("chip_default")):"Box"===this.mode&&this.chipCollectionWrapper.setAttribute("id",t.getUniqueID("chip_box")),this.componentWrapper.appendChild(this.chipCollectionWrapper)),"Box"!==this.mode&&this.componentWrapper.appendChild(this.viewWrapper),this.componentWrapper.appendChild(this.searchWrapper),this.showClearButton&&!t.Browser.isDevice?this.componentWrapper.appendChild(this.overAllClear):this.componentWrapper.classList.add("e-close-icon-hide"),this.dropDownIcon(),this.inputElement=this.createElement("input",{className:"e-dropdownbase",attrs:{spellcheck:"false",type:"text",autocomplete:"off",tabindex:"0",role:"combobox"}}),"Default"!==this.mode&&"Box"!==this.mode||this.inputElement.setAttribute("aria-describedby",this.chipCollectionWrapper.id),t.isNullOrUndefined(this.inputElement)||(t.attributes(this.inputElement,{"aria-expanded":"false"}),this.inputElement.hasAttribute("aria-label")||this.inputElement.setAttribute("aria-label",this.getModuleName())),this.element.tagName!==this.getNgDirective()&&(this.element.style.display="none"),this.element.tagName===this.getNgDirective()?(this.element.appendChild(this.overAllWrapper),this.searchWrapper.appendChild(this.inputElement)):(this.element.parentElement.insertBefore(this.overAllWrapper,this.element),this.searchWrapper.appendChild(this.inputElement),this.searchWrapper.appendChild(this.element),this.element.removeAttribute("tabindex")),"Never"!==this.floatLabelType?v(this.overAllWrapper,this.searchWrapper,this.element,this.inputElement,this.value,this.floatLabelType,this.placeholder):"Never"===this.floatLabelType&&this.refreshPlaceHolder(),this.addValidInputClass(),this.element.style.opacity="";var e=this.element.getAttribute("id")?this.element.getAttribute("id"):t.getUniqueID("ej2_dropdownlist");this.element.id=e,this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",class:"e-multi-hidden",tabindex:"-1",multiple:""}}),this.componentWrapper.appendChild(this.hiddenElement),this.validationAttribute(this.element,this.hiddenElement),"CheckBox"!==this.mode&&this.hideOverAllClear(),!t.isNullOrUndefined(t.closest(this.element,"fieldset"))&&t.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.updateFloatLabelOverflowWidth(),this.wireEvent(),this.enable(this.enabled),this.enableRTL(this.enableRtl),this.enableVirtualization&&this.updateVirtualizationProperties(this.itemCount,this.allowFiltering,"CheckBox"===this.mode),this.listItemHeight=this.getListHeight(),this.getSkeletonCount(),this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=this.viewPortInfo.startIndex>0?this.viewPortInfo.endIndex:this.itemCount,this.checkInitialValue(),this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),null===this.element.querySelector(".e-multiselect .e-float-text-content")&&a.Input.createSpanElement(this.overAllWrapper,this.createElement),this.calculateWidth(),t.isNullOrUndefined(this.overAllWrapper)||t.isNullOrUndefined(this.overAllWrapper.getElementsByClassName("e-ddl-icon")[0]&&this.overAllWrapper.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType)||this.overAllWrapper.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon"),this.renderComplete()},s.prototype.setResize=function(){var e=this;if(this.list&&this.list.parentElement&&t.isNullOrUndefined(this.list.parentElement.querySelector(".e-resizer-right.e-icons"))&&(this.resizer=this.createElement("div",{id:this.element.id+"_resize-popup",className:"e-resizer-right e-icons"})),"CheckBox"===this.mode&&this.showSelectAll&&this.selectAllHeight&&0!==this.selectAllHeight&&(this.storedSelectAllHeight=this.selectAllHeight),this.list&&this.list.parentElement){this.list.parentElement.classList.add("e-resize"),this.initialPopupHeight=this.list.parentElement.clientHeight,"auto"!==this.popupHeight.toString().toLowerCase()&&this.initialPopupHeight>=parseInt(this.popupHeight.toString(),10)-2&&(this.list.parentElement.style.height="100%"),this.list.parentElement.style.boxSizing="border-box";var i="CheckBox"===this.mode&&this.searchBoxHeight?this.searchBoxHeight+16+(this.showSelectAll?this.storedSelectAllHeight:0):16;if(this.footer){var s=this.list.style.maxHeight,l=this.list.parentElement.style.maxHeight;setTimeout(function(){var t=Math.round(e.footer.getBoundingClientRect().height),n=(parseInt(l,10)-t).toString()+"px";s=(parseInt(n,10)-2).toString()+"px",t>0&&(e.list.parentElement.style.paddingBottom=(parseInt(l,10)-parseInt(s,10)+i).toString()+"px")},1)}else this.list.parentElement.style.paddingBottom=i+"px";if(this.list.parentElement.appendChild(this.resizer),this.list.parentElement.style.width=this.resizeWidth+"px",this.list.parentElement.style.height=this.resizeHeight+"px",this.list.parentElement.style.maxHeight=this.resizeHeight+"px",this.list.style.maxHeight=this.resizeHeight+"px",this.headerTemplate){var n=this.list.parentElement.querySelector(".e-ddl-header");n&&n.offsetHeight&&(this.headerTemplateHeight=n.offsetHeight),this.resizeHeight?this.list.style.maxHeight=this.resizeHeight-this.headerTemplateHeight-16+"px":this.list.style.maxHeight=parseInt(this.list.style.maxHeight,10)-16+"px"}}this.resizer&&(t.EventHandler.add(this.resizer,"mousedown",this.startResizing,this),t.EventHandler.add(this.resizer,"touchstart",this.startResizing,this))},s.prototype.startResizing=function(e){this.isResizing=!0,this.trigger("resizeStart",e);var t=e instanceof MouseEvent?e.clientX:e.touches[0].clientX,i=e instanceof MouseEvent?e.clientY:e.touches[0].clientY;this.list&&this.list.parentElement&&(this.originalWidth=this.list.parentElement.offsetWidth,this.originalHeight=this.list.parentElement.offsetHeight,this.originalMouseX=t,this.originalMouseY=i),this.resizingWireEvent(),e&&e.preventDefault()},s.prototype.resizePopup=function(e){if(this.isResizing){this.trigger("resizing",e);var t=e instanceof MouseEvent?e.clientX:e.touches[0].clientX,i=e instanceof MouseEvent?e.clientY:e.touches[0].clientY,s=t-this.originalMouseX,l=i-this.originalMouseY;if(this.resizeWidth=Math.max(this.originalWidth+s,100),this.resizeHeight=Math.max(this.originalHeight+l,130),this.list&&this.list.parentElement){var n=parseInt(window.getComputedStyle(this.list.parentElement).minWidth,10),a=parseInt(window.getComputedStyle(this.list.parentElement).minHeight,10);n=n||100,a=a||120,this.resizeWidth=Math.max(this.originalWidth+s,n),this.resizeHeight=Math.max(this.originalHeight+l,a),this.list.parentElement.style.width=this.resizeWidth+"px",this.list.parentElement.style.height=this.resizeHeight+"px",this.list.parentElement.style.maxHeight=this.resizeHeight+"px",this.list.style.maxHeight=this.resizeHeight+"px",this.headerTemplate&&(this.list.style.maxHeight=this.resizeHeight-this.headerTemplateHeight-16+"px"),this.fixedHeaderElement&&this.ulElement&&(this.fixedHeaderElement.style.width=this.ulElement.offsetWidth+"px")}e&&e.preventDefault()}},s.prototype.stopResizing=function(e){this.isResizing&&(this.isResizing=!1,this.trigger("resizeStop",e),this.resizingUnWireEvent()),e&&e.preventDefault()},s.prototype.getListHeight=function(){var e=this.createElement("div",{className:"e-dropdownbase"}),i=this.createElement("li",{className:"e-list-item"}),s=t.formatUnit(this.popupHeight);e.style.height=parseInt(s,10).toString()+"px",e.appendChild(i),document.body.appendChild(e),this.virtualListHeight=e.getBoundingClientRect().height;var l=Math.ceil(i.getBoundingClientRect().height)+parseInt(window.getComputedStyle(i).marginBottom,10);return e.remove(),l},s.prototype.removeDisabledItemsValue=function(e){if(e){for(var t=[],i=0,s=0;s<e.length;s++){var l=e[s];"object"==typeof l&&(l=JSON.parse(JSON.stringify(l))[this.fields.value]),null==l||this.isDisabledItemByIndex(this.getIndexByValue(l))||(t[i++]=e[s])}this.value=t.length>0?t:null}},s.prototype.checkInitialValue=function(){var s=this;this.fields.disabled&&this.removeDisabledItemsValue(this.value);var l=this.dataSource instanceof Array?this.dataSource.length>0:!t.isNullOrUndefined(this.dataSource);if((!this.value||!this.value.length)&&t.isNullOrUndefined(this.text)&&!l&&"SELECT"===this.element.tagName&&this.element.options.length>0){for(var n=this.element.options,a=[],r="",o=0,h=n.length;o<h;o++){var u=n[o];if(!t.isNullOrUndefined(u.getAttribute("selected")))if(u.getAttribute("value")){f=this.allowObjectBinding?this.getDataByValue(u.getAttribute("value")):u.getAttribute("value");a.push(f)}else r+=u.text+this.delimiterChar}a.length>0?this.setProperties({value:a},!0):""!==r&&this.setProperties({text:r},!0),(a.length>0||""!==r)&&(this.refreshInputHight(),this.refreshPlaceHolder())}if((this.value&&this.value.length||!t.isNullOrUndefined(this.text))&&(this.list||e.prototype.render.call(this)),this.fields.disabled&&(this.text=this.text&&!this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text)))?this.text:null),t.isNullOrUndefined(this.text)||!t.isNullOrUndefined(this.value)&&0!==this.value.length||this.initialTextUpdate(),this.value&&this.value.length){var p;if(this.enableVirtualization){for(var d=this.isPrimitiveData?"":this.fields.value,c=void 0,m=0;m<this.value.length;m++){var f=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",this.value[m]):this.value[m];c=0===m?new i.Predicate(d,"equal",f):c.or(d,"equal",f)}this.dataSource instanceof i.DataManager?this.dataSource.executeQuery((new i.Query).where(c)).then(function(e){e.result.length>0&&(p=e.result,s.initStatus=!1,s.isInitRemoteVirtualData=!0,setTimeout(function(){s.initialValueUpdate(p,!0),s.initialUpdate(),s.isInitRemoteVirtualData=!1},100),s.initStatus=!0)}):p=new i.DataManager(this.dataSource).executeLocal((new i.Query).where(c))}this.dataSource instanceof i.DataManager?this.setInitialValue=function(){s.initStatus=!1,s.enableVirtualization&&(!s.enableVirtualization||s.dataSource instanceof i.DataManager)||s.initialValueUpdate(p),s.initialUpdate(),s.setInitialValue=null,s.initStatus=!0}:(this.initialValueUpdate(p,!0),this.initialUpdate()),this.updateTempValue()}else this.initialUpdate();this.initStatus=!0,this.checkAutoFocus(),t.isNullOrUndefined(this.text)||this.element.setAttribute("data-initial-value",this.text)},s.prototype.checkAutoFocus=function(){this.element.hasAttribute("autofocus")&&this.inputElement.focus()},s.prototype.updatevirtualizationList=function(){if(this.value&&this.value.length){for(var e=void 0,i=0,s=this.value;i<s.length;i++){var l=s[i],n=this.allowObjectBinding?t.getValue(this.fields.value?this.fields.value:"",l):l;(e=this.getElementByValue(n))&&this.addListSelection(e)}if(this.enableVirtualization&&this.hideSelectedItem){var a=this.list.querySelectorAll("li."+H.li+":not(."+ge+"):not(.e-reorder-hide):not(.e-virtual-list)");if(a.length){var r=this.virtualListHeight>0?Math.floor(this.virtualListHeight/this.listItemHeight):0;if(a.length<r+2){var o=this.getForQuery(this.value).clone();o=o.skip(this.viewPortInfo.startIndex),this.resetList(this.dataSource,this.fields,o)}}}}},s.prototype.setFloatLabelType=function(){y(this.overAllWrapper,this.componentWrapper,this.searchWrapper,this.inputElement,this.value,this.floatLabelType,this.placeholder),"Never"!==this.floatLabelType&&v(this.overAllWrapper,this.searchWrapper,this.element,this.inputElement,this.value,this.floatLabelType,this.placeholder)},s.prototype.addValidInputClass=function(){t.isNullOrUndefined(this.overAllWrapper)||(!t.isNullOrUndefined(this.value)&&this.value.length||"Always"===this.floatLabelType?t.addClass([this.overAllWrapper],"e-valid-input"):t.removeClass([this.overAllWrapper],"e-valid-input"))},s.prototype.dropDownIcon=function(){this.showDropDownIcon?(this.dropIcon=this.createElement("span",{className:"e-input-group-icon e-ddl-icon"}),this.componentWrapper.appendChild(this.dropIcon),t.addClass([this.componentWrapper],["e-down-icon"])):t.isNullOrUndefined(this.dropIcon)||(this.dropIcon.parentElement.removeChild(this.dropIcon),t.removeClass([this.componentWrapper],["e-down-icon"]))},s.prototype.initialUpdate=function(){"Box"===this.mode||this.setDynValue&&"Default"===this.mode&&this.inputFocus||this.updateDelimView(),this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=this.itemCount,this.updateCssClass(),this.updateHTMLAttribute(),this.updateReadonly(this.readonly),this.refreshInputHight(),this.checkPlaceholderSize()},s.prototype.disableItem=function(e){if(this.fields.disabled){this.list||this.renderList();var i=-1;if(this.liCollections&&this.liCollections.length>0&&this.listData&&this.fields.disabled){if("string"==typeof e)i=this.getIndexByValue(e);else if("object"==typeof e){if(e instanceof HTMLLIElement){for(l=0;l<this.liCollections.length;l++)if(this.liCollections[l]===e){i=this.getIndexByValue(e.getAttribute("data-value"));break}}else for(var s=JSON.parse(JSON.stringify(e))[this.fields.value],l=0;l<this.listData.length;l++)if(JSON.parse(JSON.stringify(this.listData[l]))[this.fields.value]===s){i=this.getIndexByValue(s);break}}else i=e;if(i<this.liCollections.length&&i>-1&&!JSON.parse(JSON.stringify(this.listData[i]))[this.fields.disabled]){var n=this.liCollections[i];if(n){this.disableListItem(n);var a=JSON.parse(JSON.stringify(this.listData[i]));if(a[this.fields.disabled]=!0,this.listData[i]=a,n.classList.contains(H.focus)&&this.removeFocus(),n.classList.contains(ge)||n.classList.contains(H.selected)){var r=this.value;this.removeDisabledItemsValue(this.value),this.updateVal(this.value,r,"value")}"CheckBox"===this.mode&&this.enableGroupCheckBox&&!t.isNullOrUndefined(this.fields.groupBy)&&this.disableGroupHeader()}}}}},s.prototype.destroy=function(){this.isReact&&this.clearTemplate(),t.isNullOrUndefined(this.popupObj)||(this.popupObj.hide(),this.popupObj.destroy()),this.notify("destroy",{}),this.unwireListEvents(),this.unWireEvent();var i=["readonly","aria-disabled","placeholder","aria-label","aria-expanded"],s=i.length;if(!t.isNullOrUndefined(this.inputElement))for(;s>0;)this.inputElement.removeAttribute(i[s-1]),s--;for(t.isNullOrUndefined(this.element)||(this.element.removeAttribute("data-initial-value"),this.element.style.display="block"),this.overAllWrapper&&this.overAllWrapper.parentElement&&(this.overAllWrapper.parentElement.tagName===this.getNgDirective()?t.remove(this.overAllWrapper):(this.overAllWrapper.parentElement.insertBefore(this.element,this.overAllWrapper),t.remove(this.overAllWrapper))),this.popupWrapper&&this.popupWrapper.parentElement&&this.popupWrapper.parentElement.remove();this.searchWrapper&&this.searchWrapper.firstChild;)this.searchWrapper.removeChild(this.searchWrapper.firstChild);this.searchWrapper&&this.searchWrapper.parentElement&&this.searchWrapper.parentElement.remove(),this.viewWrapper&&this.viewWrapper.parentElement&&this.viewWrapper.parentElement.remove(),this.overAllClear&&this.overAllClear.parentElement&&this.overAllClear.parentElement.remove(),this.delimiterWrapper&&this.delimiterWrapper.parentElement&&this.delimiterWrapper.parentElement.remove();var l=this.overAllWrapper.querySelector("select.e-multi-hidden");for(l&&l.parentElement&&l.parentElement.remove();this.componentWrapper&&this.componentWrapper.firstChild;)this.componentWrapper.removeChild(this.componentWrapper.firstChild);for(this.componentWrapper&&this.componentWrapper.parentElement&&(this.componentWrapper.removeAttribute("class"),this.componentWrapper.parentElement.remove());this.popupWrapper&&this.popupWrapper.firstChild;)this.popupWrapper.removeChild(this.popupWrapper.firstChild);if(this.inputElement)for(var n=["readonly","aria-disabled","placeholder","aria-labelledby","aria-expanded","autocomplete","aria-readonly","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-label","aria-hidden","tabindex","aria-controls","aria-describedby","size","role","type","class"],a=0;a<n.length;a++)this.inputElement.removeAttribute(n[a]);this.inputElement&&this.inputElement.remove(),this.list=null,this.popupObj=null,this.mainData=null,this.filterParent=null,this.ulElement=null,this.componentWrapper=null,this.overAllClear=null,this.overAllWrapper=null,this.hiddenElement=null,this.searchWrapper=null,this.viewWrapper=null,this.chipCollectionWrapper=null,this.targetInputElement=null,this.popupWrapper=null,this.inputElement=null,this.delimiterWrapper=null,this.liCollections=null,this.popupContentElement=null,this.header=null,this.mainList=null,this.mainListCollection=null,this.footer=null,this.selectAllEventEle=null,e.prototype.destroy.call(this)},fe([t.Complex({text:null,value:null,iconCss:null,groupBy:null,disabled:null},P)],s.prototype,"fields",void 0),fe([t.Property(!1)],s.prototype,"enablePersistence",void 0),fe([t.Property(null)],s.prototype,"groupTemplate",void 0),fe([t.Property("No records found")],s.prototype,"noRecordsTemplate",void 0),fe([t.Property("Request failed")],s.prototype,"actionFailureTemplate",void 0),fe([t.Property("None")],s.prototype,"sortOrder",void 0),fe([t.Property(!0)],s.prototype,"enabled",void 0),fe([t.Property(!0)],s.prototype,"enableHtmlSanitizer",void 0),fe([t.Property(!1)],s.prototype,"enableVirtualization",void 0),fe([t.Property([])],s.prototype,"dataSource",void 0),fe([t.Property(null)],s.prototype,"query",void 0),fe([t.Property("StartsWith")],s.prototype,"filterType",void 0),fe([t.Property(1e3)],s.prototype,"zIndex",void 0),fe([t.Property(!1)],s.prototype,"ignoreAccent",void 0),fe([t.Property()],s.prototype,"locale",void 0),fe([t.Property(!1)],s.prototype,"enableGroupCheckBox",void 0),fe([t.Property(null)],s.prototype,"cssClass",void 0),fe([t.Property("100%")],s.prototype,"width",void 0),fe([t.Property("300px")],s.prototype,"popupHeight",void 0),fe([t.Property("100%")],s.prototype,"popupWidth",void 0),fe([t.Property(null)],s.prototype,"placeholder",void 0),fe([t.Property(null)],s.prototype,"filterBarPlaceholder",void 0),fe([t.Property({})],s.prototype,"htmlAttributes",void 0),fe([t.Property(null)],s.prototype,"valueTemplate",void 0),fe([t.Property(null)],s.prototype,"headerTemplate",void 0),fe([t.Property(null)],s.prototype,"footerTemplate",void 0),fe([t.Property(null)],s.prototype,"itemTemplate",void 0),fe([t.Property(null)],s.prototype,"allowFiltering",void 0),fe([t.Property(300)],s.prototype,"debounceDelay",void 0),fe([t.Property(!0)],s.prototype,"isDeviceFullScreen",void 0),fe([t.Property(!0)],s.prototype,"changeOnBlur",void 0),fe([t.Property(!1)],s.prototype,"allowCustomValue",void 0),fe([t.Property(!0)],s.prototype,"showClearButton",void 0),fe([t.Property(1e3)],s.prototype,"maximumSelectionLength",void 0),fe([t.Property(!1)],s.prototype,"readonly",void 0),fe([t.Property(!1)],s.prototype,"allowResize",void 0),fe([t.Property(null)],s.prototype,"text",void 0),fe([t.Property(null)],s.prototype,"value",void 0),fe([t.Property(!1)],s.prototype,"allowObjectBinding",void 0),fe([t.Property(!0)],s.prototype,"hideSelectedItem",void 0),fe([t.Property(!0)],s.prototype,"closePopupOnSelect",void 0),fe([t.Property("Default")],s.prototype,"mode",void 0),fe([t.Property(",")],s.prototype,"delimiterChar",void 0),fe([t.Property(!0)],s.prototype,"ignoreCase",void 0),fe([t.Property(!1)],s.prototype,"showDropDownIcon",void 0),fe([t.Property("Never")],s.prototype,"floatLabelType",void 0),fe([t.Property(!1)],s.prototype,"showSelectAll",void 0),fe([t.Property("Select All")],s.prototype,"selectAllText",void 0),fe([t.Property("Unselect All")],s.prototype,"unSelectAllText",void 0),fe([t.Property(!0)],s.prototype,"enableSelectionOrder",void 0),fe([t.Property(!0)],s.prototype,"openOnClick",void 0),fe([t.Property(!1)],s.prototype,"addTagOnBlur",void 0),fe([t.Event()],s.prototype,"change",void 0),fe([t.Event()],s.prototype,"removing",void 0),fe([t.Event()],s.prototype,"removed",void 0),fe([t.Event()],s.prototype,"beforeSelectAll",void 0),fe([t.Event()],s.prototype,"selectedAll",void 0),fe([t.Event()],s.prototype,"beforeOpen",void 0),fe([t.Event()],s.prototype,"open",void 0),fe([t.Event()],s.prototype,"close",void 0),fe([t.Event()],s.prototype,"blur",void 0),fe([t.Event()],s.prototype,"focus",void 0),fe([t.Event()],s.prototype,"chipSelection",void 0),fe([t.Event()],s.prototype,"resizeStop",void 0),fe([t.Event()],s.prototype,"resizing",void 0),fe([t.Event()],s.prototype,"resizeStart",void 0),fe([t.Event()],s.prototype,"filtering",void 0),fe([t.Event()],s.prototype,"tagging",void 0),fe([t.Event()],s.prototype,"customValueSelection",void 0),s=fe([t.NotifyPropertyChanges],s)}(U),Se=function(){function e(e){this.activeLi=[],this.activeEle=[],this.parent=e,this.removeEventListener(),this.addEventListener()}return e.prototype.getModuleName=function(){return"CheckBoxSelection"},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("updatelist",this.listSelection,this),this.parent.on("listoption",this.listOption,this),this.parent.on("selectAll",this.setSelectAll,this),this.parent.on("checkSelectAll",this.checkSelectAll,this),this.parent.on("searchBox",this.setSearchBox,this),this.parent.on("blur",this.onBlurHandler,this),this.parent.on("targetElement",this.targetElement,this),this.parent.on("deviceSearchBox",this.setDeviceSearchBox,this),this.parent.on("inputFocus",this.getFocus,this),this.parent.on("reOrder",this.setReorder,this),this.parent.on("activeList",this.getActiveList,this),this.parent.on("selectAllText",this.setLocale,this),this.parent.on("filterBarPlaceholder",this.setPlaceholder,this),t.EventHandler.add(document,"mousedown",this.onDocumentClick,this),this.parent.on("addItem",this.checboxCreate,this),this.parent.on("popupFullScreen",this.setPopupFullScreen,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updatelist",this.listSelection),this.parent.off("listoption",this.listOption),this.parent.off("selectAll",this.setSelectAll),this.parent.off("checkSelectAll",this.checkSelectAll),this.parent.off("searchBox",this.setSearchBox),this.parent.off("blur",this.onBlurHandler),this.parent.off("targetElement",this.targetElement),this.parent.off("deviceSearchBox",this.setDeviceSearchBox),this.parent.off("inputFocus",this.getFocus),this.parent.off("reOrder",this.setReorder),this.parent.off("activeList",this.getActiveList),this.parent.off("selectAllText",this.setLocale),this.parent.off("filterBarPlaceholder",this.setPlaceholder),this.parent.off("addItem",this.checboxCreate),this.parent.off("popupFullScreen",this.setPopupFullScreen))},e.prototype.listOption=function(e){var i=this;if(t.isNullOrUndefined(this.parent.listCurrentOptions.itemCreated))this.parent.listCurrentOptions.itemCreated=function(e){i.checboxCreate(e)};else{var s=this.parent.listCurrentOptions.itemCreated;this.parent.listCurrentOptions.itemCreated=function(e){i.checboxCreate(e),s.apply(i,[e])}}},e.prototype.setPlaceholder=function(e){a.Input.setPlaceholder(e.filterBarPlaceholder,this.filterInput)},e.prototype.checboxCreate=function(e){var i;if(i=t.isNullOrUndefined(e.item)?e:e.item,this.parent.enableGroupCheckBox||"e-list-group-item "!==i.className&&"e-list-group-item"!==i.className){var s=r.createCheckBox(this.parent.createElement,!0),l=t.select("div.e-icons",i);return i.insertBefore(s,i.childNodes[t.isNullOrUndefined(l)?0:1]),t.select(".e-frame",s),this.parent.enableGroupCheckBox&&this.parent.popupWrapper.classList.add("e-multiselect-group"),i}return i},e.prototype.setSelectAll=function(){this.parent.showSelectAll?(t.isNullOrUndefined(this.checkAllParent)&&(this.checkAllParent=this.parent.createElement("div",{className:"e-selectall-parent"}),this.selectAllSpan=this.parent.createElement("span",{className:"e-all-text"}),this.selectAllSpan.textContent="",this.checkAllParent.appendChild(this.selectAllSpan),this.setLocale(),this.checboxCreate(this.checkAllParent),this.parent.headerTemplate&&(t.isNullOrUndefined(this.parent.filterParent)?t.append([this.checkAllParent],this.parent.popupWrapper):t.append([this.checkAllParent],this.parent.filterParent)),this.parent.headerTemplate||(t.isNullOrUndefined(this.parent.filterParent)?t.prepend([this.checkAllParent],this.parent.popupWrapper):this.parent.filterParent.parentNode.insertBefore(this.checkAllParent,this.parent.filterParent.nextSibling)),t.EventHandler.add(this.checkAllParent,"mousedown",this.clickHandler,this)),this.parent.list.classList.contains("e-nodata")||this.parent.listData&&this.parent.listData.length<=1&&!this.parent.enableVirtualization&&!this.parent.isDynamicDataChange||this.parent.isDynamicDataChange&&this.parent.listData&&this.parent.listData.length<=1?this.checkAllParent.style.display="none":this.checkAllParent.style.display="block",this.parent.selectAllHeight=this.checkAllParent.getBoundingClientRect().height):t.isNullOrUndefined(this.checkAllParent)||(this.checkAllParent.parentElement.removeChild(this.checkAllParent),this.checkAllParent=null)},e.prototype.destroy=function(){this.removeEventListener(),t.EventHandler.remove(document,"mousedown",this.onDocumentClick),this.checkAllParent=null,this.clearIconElement=null,this.filterInput=null,this.filterInputObj=null,this.checkWrapper=null,this.selectAllSpan=null},e.prototype.listSelection=function(e){var i;if(t.isNullOrUndefined(e.e)){var s=e.li.querySelector(".e-checkbox-wrapper");i=s?s.childNodes[1]:e.li.lastElementChild.childNodes[1]}else{e.li.querySelector(".e-checkbox-wrapper .e-frame");i=t.isNullOrUndefined(e.e.target)?e.li.querySelector(".e-checkbox-wrapper").childNodes[1]:e.e.target.classList.contains("e-frame")&&(!this.parent.showSelectAll||this.checkAllParent&&!this.checkAllParent.contains(e.e.target))?e.e.target:e.li.querySelector(".e-checkbox-wrapper").childNodes[1]}if((this.parent.itemTemplate||this.parent.enableGroupCheckBox)&&(i=e.li.firstElementChild.childNodes[1]),t.isNullOrUndefined(i)||(this.checkWrapper=t.closest(i,".e-checkbox-wrapper")),!t.isNullOrUndefined(this.checkWrapper)){var l=t.select(".e-frame",this.checkWrapper);this.validateCheckNode(this.checkWrapper,l.classList.contains("e-check"),e.li,e.e,!1)}},e.prototype.validateCheckNode=function(e,t,i,s,l){this.changeState(e,t?"uncheck":"check",s,!0,l)},e.prototype.clickHandler=function(e){var i;i=e.currentTarget.classList.contains(this.checkAllParent.className)||e.currentTarget.classList.value===this.checkAllParent.className?e.currentTarget.firstElementChild.lastElementChild:e.currentTarget,this.checkWrapper=t.closest(i,".e-checkbox-wrapper");if(!t.isNullOrUndefined(this.checkWrapper)){var s=t.select(".e-frame",this.checkWrapper);this.validateCheckNode(this.checkWrapper,s.classList.contains("e-check"),null,e,!0)}e.preventDefault()},e.prototype.changeState=function(e,i,s,l,n){var a=e.getElementsByClassName("e-frame")[0];"check"!==i||a.classList.contains("e-check")?"uncheck"===i&&(a.classList.contains("e-check")||a.classList.contains("e-stop"))?(t.removeClass([a],["e-check","e-stop"]),n&&(this.parent.selectAllItems(!1,s),this.setLocale())):"indeterminate"!==i||a.classList.contains("e-stop")||(t.removeClass([a],["e-check"]),a.classList.add("e-stop"),n&&(this.parent.selectAllItems(!1,s),this.setLocale())):(a.classList.remove("e-stop"),a.classList.add("e-check"),n&&(this.parent.selectAllItems(!0,s),this.setLocale(!0)))},e.prototype.setSearchBox=function(e){if(t.isNullOrUndefined(this.parent.filterParent)){this.parent.filterParent=this.parent.createElement("span",{className:"e-filter-parent"}),this.filterInput=this.parent.createElement("input",{attrs:{type:"text"},className:"e-input-filter"}),this.parent.element.parentNode.insertBefore(this.filterInput,this.parent.element);var i=!1;return t.Browser.isDevice&&this.parent.isDeviceFullScreen&&(i=!0,this.parent.mobFilter=!1),this.filterInputObj=a.Input.createInput({element:this.filterInput,buttons:i?["e-input-group-icon e-back-icon e-icons","e-input-group-icon e-clear-icon e-icons"]:["e-input-group-icon e-clear-icon e-icons"],properties:{placeholder:this.parent.filterBarPlaceholder}},this.parent.createElement),t.isNullOrUndefined(this.parent.cssClass)||(-1!==this.parent.cssClass.split(" ").indexOf("e-outline")?t.addClass([this.filterInputObj.container],"e-outline"):-1!==this.parent.cssClass.split(" ").indexOf("e-filled")&&t.addClass([this.filterInputObj.container],"e-filled")),t.append([this.filterInputObj.container],this.parent.filterParent),t.prepend([this.parent.filterParent],e.popupElement),t.attributes(this.filterInput,{"aria-disabled":"false",role:"combobox",autocomplete:"off",autocapitalize:"off",spellcheck:"false","aria-label":"multiselect","aria-expanded":"true","aria-controls":e.popupElement.id}),this.clearIconElement=this.filterInput.parentElement.querySelector(".e-clear-icon"),!t.Browser.isDevice&&this.clearIconElement&&(t.EventHandler.add(this.clearIconElement,"mousedown",this.clearText,this),this.clearIconElement.style.visibility="hidden"),t.EventHandler.add(this.filterInput,"input",this.parent.onInput,this.parent),t.EventHandler.add(this.filterInput,"keyup",this.parent.keyUp,this.parent),t.EventHandler.add(this.filterInput,"keydown",this.parent.onKeyDown,this.parent),t.EventHandler.add(this.filterInput,"blur",this.onBlurHandler,this),t.EventHandler.add(this.filterInput,"paste",this.parent.pasteHandler,this.parent),this.parent.searchBoxHeight=this.filterInputObj.container.parentElement.getBoundingClientRect().height,this.filterInputObj}},e.prototype.clickOnBackIcon=function(e){this.parent.hidePopup(),t.removeClass([document.body,this.parent.popupObj.element],"e-popup-full-page"),this.parent.inputElement.focus()},e.prototype.clearText=function(e){this.parent.targetInputElement.value="",this.parent.allowFiltering&&""===this.parent.targetInputElement.value&&this.parent.search(null),this.parent.refreshListItems(null),this.parent.refreshPopup(),this.clearIconElement.style.visibility="hidden",this.filterInput.focus(),(!this.parent.enableVirtualization||this.parent.enableVirtualization&&(t.isNullOrUndefined(this.parent.value)||this.parent.value&&0===this.parent.value.length))&&this.setReorder(e),this.boundPreventListSelection=this.preventListSelection.bind(this),this.parent.popupWrapper.addEventListener("mouseup",this.boundPreventListSelection,!0),e.preventDefault()},e.prototype.preventListSelection=function(e){e.stopPropagation(),this.parent.popupWrapper.removeEventListener("mouseup",this.boundPreventListSelection,!0),this.boundPreventListSelection=null},e.prototype.setDeviceSearchBox=function(){this.parent.popupObj.element.classList.add("e-ddl-device"),this.parent.popupObj.element.classList.add("e-ddl-device-filter"),this.parent.popupObj.position={X:0,Y:0},this.parent.popupObj.dataBind(),this.setSearchBoxPosition(),this.backIconElement=this.filterInputObj.container.querySelector(".e-back-icon"),this.clearIconElement=this.filterInputObj.container.querySelector(".e-clear-icon"),this.clearIconElement.style.visibility="hidden",t.EventHandler.add(this.backIconElement,"click",this.clickOnBackIcon,this),t.EventHandler.add(this.clearIconElement,"click",this.clearText,this)},e.prototype.setSearchBoxPosition=function(){var e=this.filterInput.parentElement.getBoundingClientRect().height,i=0,s=0,l=0;this.checkAllParent&&(i=this.checkAllParent.getBoundingClientRect().height),this.parent.header&&(l=this.parent.header.getBoundingClientRect().height),this.parent.footer&&(s=this.parent.footer.getBoundingClientRect().height),this.parent.popupObj.element.style.maxHeight="100%",this.parent.popupObj.element.style.width="100%",this.parent.list.style.maxHeight=window.innerHeight-e-i-l-s+"px",this.parent.list.style.height=window.innerHeight-e-i-l-s+"px";var n=this.filterInput.parentElement.querySelector(".e-clear-icon");t.detach(this.filterInput),n.parentElement.insertBefore(this.filterInput,n)},e.prototype.setPopupFullScreen=function(){this.parent&&this.parent.popupObj&&(t.attributes(this.parent.popupObj.element,{style:"left:0px;right:0px;top:0px;bottom:0px;"}),t.addClass([document.body,this.parent.popupObj.element],"e-popup-full-page"),this.parent.popupObj.element.style.maxHeight="100%",this.parent.popupObj.element.style.width="100%")},e.prototype.targetElement=function(){return t.isNullOrUndefined(this.clearIconElement)||(this.parent.targetInputElement=this.filterInput,this.clearIconElement.style.visibility=""===this.parent.targetInputElement.value?"hidden":"visible"),this.parent.targetInputElement.value},e.prototype.onBlurHandler=function(e){if(!this.parent.element.classList.contains("e-listbox")){var i=void 0;if(this.parent.keyAction)return;if(t.Browser.isIE&&(i=!t.isNullOrUndefined(e)&&e.target),t.Browser.isIE||(i=!t.isNullOrUndefined(e)&&e.relatedTarget),this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&this.parent.popupObj.element.contains(i)&&!t.Browser.isIE&&this.filterInput)return void this.filterInput.focus();if(this.parent.scrollFocusStatus&&this.filterInput)return e.preventDefault(),this.filterInput.focus(),void(this.parent.scrollFocusStatus=!1);this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&!this.parent.popupObj.element.classList.contains("e-popup-close")&&(this.parent.inputFocus=!1,this.parent.updateValueState(e,this.parent.value,this.parent.tempValues),this.parent.dispatchEvent(this.parent.hiddenElement,"change")),this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&!this.parent.popupObj.element.classList.contains("e-popup-close")&&(this.parent.inputFocus=!1,this.parent.overAllWrapper.classList.remove("e-input-focus"),this.parent.trigger("blur"),this.parent.focused=!0),this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&!this.parent.popupObj.element.classList.contains("e-popup-close")&&!t.Browser.isDevice&&this.parent.hidePopup()}},e.prototype.onDocumentClick=function(e){if("listbox"!==this.parent.getLocaleName()){var i=e.target;!t.isNullOrUndefined(this.parent.popupObj)&&t.closest(i,'[id="'+this.parent.popupObj.element.id+'"]')&&(this.filterInput&&""!==this.filterInput.value||e.preventDefault()),!t.isNullOrUndefined(this.parent.popupObj)&&t.closest(i,'[id="'+this.parent.popupObj.element.id+'"]')||t.isNullOrUndefined(this.parent.overAllWrapper)||this.parent.overAllWrapper.contains(e.target)?this.parent.scrollFocusStatus=(t.Browser.isIE||"edge"===t.Browser.info.name)&&document.activeElement===this.filterInput:(this.parent.overAllWrapper.classList.contains(H.focus)||this.parent.isPopupOpen())&&(this.parent.inputFocus=!1,this.parent.scrollFocusStatus=!1,this.parent.hidePopup(),this.parent.onBlurHandler(e,!0),this.parent.focused=!0),t.isNullOrUndefined(this.parent.overAllWrapper)||this.parent.overAllWrapper.contains(e.target)||!this.parent.overAllWrapper.classList.contains("e-input-focus")||this.parent.isPopupOpen()||(t.Browser.isIE?this.parent.onBlurHandler():this.parent.onBlurHandler(e)),this.filterInput===i&&this.filterInput.focus()}},e.prototype.getFocus=function(e){if(this.parent.overAllWrapper.classList.remove("e-input-focus"),this.parent.keyAction&&"clear"!==e.value&&"focus"!==e.value)return void(this.parent.keyAction=!1);"focus"===e.value&&(this.filterInput.focus(),this.parent.removeFocus(),t.EventHandler.remove(this.parent.list,"keydown",this.parent.onKeyDown)),"clear"===e.value&&(this.filterInput.value="",this.clearIconElement.style.visibility="hidden")},e.prototype.checkSelectAll=function(e){"check"===e.value&&(this.changeState(this.checkAllParent,e.value,null,null,!1),this.setLocale(!0)),"uncheck"===e.value&&(this.changeState(this.checkAllParent,e.value,null,null,!1),this.setLocale()),"indeterminate"===e.value&&(this.changeState(this.checkAllParent,e.value,null,null,!1),this.setLocale())},e.prototype.setLocale=function(e){if("Select All"!==this.parent.selectAllText||"Unselect All"!==this.parent.unSelectAllText){var i=e?this.parent.unSelectAllText:this.parent.selectAllText;this.selectAllSpan.textContent="";for(var s=t.compile(i),l=e?"unSelectAllText":"selectAllText",n=0,a=s({},this.parent,l,null,!this.parent.isStringTemplate);n<a.length;n++){var r=a[n];this.selectAllSpan.textContent=r.textContent}}else{var o={selectAllText:"Select All",unSelectAllText:"Unselect All"},h=new t.L10n(this.parent.getLocaleName(),{},this.parent.locale);""===h.getConstant("selectAllText")&&(h=new t.L10n("dropdowns",o,this.parent.locale)),t.isNullOrUndefined(this.selectAllSpan)||(this.selectAllSpan.textContent=e?h.getConstant("unSelectAllText"):h.getConstant("selectAllText"))}},e.prototype.getActiveList=function(e){e.li.classList.contains("e-active")?this.activeLi.push(e.li.cloneNode(!0)):this.activeLi.splice(e.index,1)},e.prototype.setReorder=function(e){if(this.parent.enableSelectionOrder&&!t.isNullOrUndefined(this.parent.value)){var i=this.parent.ulElement.querySelectorAll("li.e-active").length,s=void 0,l=this.parent.createElement("ul",{className:"e-list-parent e-ul e-reorder"});if(i>0)if(this.parent.ulElement.querySelectorAll("li.e-active").forEach(function(e){l.appendChild(e)}),s=this.parent.ulElement.querySelectorAll("li.e-active"),t.addClass(s,"e-reorder-hide"),this.parent.enableVirtualization){var n=this.parent.list.querySelector(".e-virtual-ddl-content");t.prepend([l],n)}else t.prepend([l],this.parent.list);this.parent.focusAtFirstListItem()}},e}(),Ee=function(){var e=function(t,i){return(e=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])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),xe=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(l=e[r])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},Ie=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ee(i,e),xe([t.Property("Multiple")],i.prototype,"mode",void 0),xe([t.Property(!1)],i.prototype,"showCheckbox",void 0),xe([t.Property(!1)],i.prototype,"showSelectAll",void 0),xe([t.Property("Left")],i.prototype,"checkboxPosition",void 0),i}(t.ChildProperty),we=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ee(i,e),xe([t.Property([])],i.prototype,"items",void 0),xe([t.Property("Right")],i.prototype,"position",void 0),i}(t.ChildProperty),Oe=function(e){function l(t,i){var s=e.call(this,t,i)||this;return s.isValidKey=!1,s.isBackSpace=!1,s.isDataSourceUpdate=!1,s.keyDownStatus=!1,s}Ee(l,e),o=l,l.prototype.addItem=function(t,s){e.prototype.addItem.call(this,t,s),this.allowFiltering&&""!==this.filterInput.value&&this.filteringAction(this.jsonData,new i.Query,this.fields)},l.prototype.render=function(){if(this.isAngular&&this.allowFiltering){var i=this.element,s=i.cloneNode(!0);i.parentNode.replaceChild(s,i),this.element=s,t.setValue("ej2_instances",[this],this.element)}this.inputString="",this.initLoad=!0,this.isCustomFiltering=!1,this.initialSelectedOptions=this.value,this.inputFormName=this.element.getAttribute("name"),e.prototype.render.call(this),this.setEnabled(),this.renderComplete()},l.prototype.initWrapper=function(){var e=this.createElement("select",{className:"e-hidden-select",attrs:{multiple:""}});e.style.visibility="hidden",this.list.classList.add("e-listbox-wrapper"),this.list.querySelector(".e-list-parent").setAttribute("role","presentation");for(var i=this.list.querySelectorAll(".e-list-group-item"),s=0;s<i.length;s++)i[s].removeAttribute("tabindex"),i[s].setAttribute("role","option");this.itemTemplate&&this.list.classList.add("e-list-template"),this.list.classList.add("e-wrapper"),this.list.classList.add("e-lib"),"EJS-LISTBOX"===this.element.tagName?(this.element.setAttribute("tabindex","0"),this.initLoad&&this.element.appendChild(this.list)):(this.initLoad&&this.element.parentElement&&this.element.parentElement.insertBefore(this.list,this.element),this.list.insertBefore(this.element,this.list.firstChild),this.element.style.display="none"),this.list.insertBefore(e,this.list.firstChild),this.list.getElementsByClassName("e-list-item")[0]&&this.list.getElementsByClassName("e-list-item")[0].classList.remove(H.focus),this.itemTemplate&&this.renderReactTemplates(),t.removeClass([this.list],[H.content,H.root]),this.validationAttribute(this.element,e),this.list.setAttribute("role","listbox"),t.attributes(this.list,{role:"listbox","aria-label":"listbox","aria-multiselectable":"Multiple"===this.selectionSettings.mode?"true":"false"}),this.updateSelectionSettings()},l.prototype.updateSelectionSettings=function(){if(this.selectionSettings.showCheckbox&&this.selectionSettings.showSelectAll&&this.liCollections.length){var e=new t.L10n(this.getModuleName(),{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.locale);if(this.showSelectAll=!0,this.selectAllText=e.getConstant("selectAllText"),this.unSelectAllText=e.getConstant("unSelectAllText"),this.popupWrapper=this.list,this.checkBoxSelectionModule.checkAllParent=null,this.filterParent)if(this.filterParent.parentNode){var i=this.filterParent.querySelector("input.e-input-filter");i.classList.contains("e-input-focus")||i.classList.contains("e-valid-input")||0!==this.selectedListItemCount||(this.filterParent=null),this.selectedListItemCount>0&&this.showSelectAll&&(this.filterParent=null)}else this.filterParent=null;this.notify("selectAll",{})}},l.prototype.initDraggable=function(){var e=this;this.ulElement&&(this.ulElement.id=this.element.id+"_parent"),this.allowDragAndDrop&&new s.Sortable(this.ulElement,{scope:this.scope,itemClass:"e-list-item",beforeDragStart:this.triggerDragStart.bind(this),drag:this.triggerDrag.bind(this),beforeDrop:this.beforeDragEnd.bind(this),drop:this.dragEnd.bind(this),placeHolder:function(){return e.createElement("span",{className:"e-placeholder"})},helper:function(t){var i=e.list.cloneNode(),s=t.sender.cloneNode(!0);i.appendChild(s);var l=e.getItems()[0];return i.style.width=l.offsetWidth+"px",i.style.height=l.offsetHeight+"px",(e.value&&e.value.length)>1&&e.isSelected(s)&&s.appendChild(e.createElement("span",{className:"e-list-badge",innerHTML:e.value.length+""})),i.style.zIndex=n.getZindexPartial(e.element)+"",i}})},l.prototype.updateActionCompleteData=function(e,t,i){this.jsonData.splice(null===i?this.jsonData.length:i,0,t)},l.prototype.initToolbar=function(){var e=this.toolbarSettings.position,i=this.element.getAttribute("data-value");if(this.toolbarSettings.items=t.isNullOrUndefined(this.toolbarSettings.items)?[]:this.toolbarSettings.items,this.toolbarSettings.items.length){var s=this.createElement("div",{className:"e-listbox-tool",attrs:{role:"toolbar"}}),l=this.createElement("div",{className:"e-listboxtool-wrapper e-lib e-"+e.toLowerCase()});this.list.parentElement.insertBefore(l,this.list),l.appendChild("Right"===e?this.list:s),l.appendChild("Right"===e?s:this.list),this.createButtons(s),this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName())),this.scope?document.querySelector(this.scope).setAttribute("data-value",this.element.id):this.updateToolBarState()}var n=this.element.getAttribute("data-value");i&&n&&i!==n?(this.tBListBox=t.getComponent(document.getElementById(i),this.getModuleName()),this.tBListBox.updateToolBarState()):n?(this.tBListBox=t.getComponent(document.getElementById(n),this.getModuleName()),this.tBListBox.updateToolBarState()):this.refreshing&&this.updateToolBarState()},l.prototype.createButtons=function(e){var i,s,l,n=this,a=new t.L10n(this.getModuleName(),{moveUp:"Move Up",moveDown:"Move Down",moveTo:"Move To",moveFrom:"Move From",moveAllTo:"Move All To",moveAllFrom:"Move All From"},this.locale);this.toolbarSettings.items.forEach(function(t){l=a.getConstant(t),s=n.createElement("button",{attrs:{type:"button","data-value":t,title:l,"aria-label":l}}),e.appendChild(s),(i=new r.Button({iconCss:"e-icons e-"+t.toLowerCase()},s)).createElement=n.createElement})},l.prototype.validationAttribute=function(t,i){this.inputFormName&&t.setAttribute("name",this.inputFormName),e.prototype.validationAttribute.call(this,t,i),i.required=t.required,t.required=!1},l.prototype.setHeight=function(){(this.toolbarSettings.items.length?this.list.parentElement:this.list).style.height=t.formatUnit(this.height),this.allowFiltering&&this.height.toString().indexOf("%")>0?t.addClass([this.list],"e-filter-list"):t.removeClass([this.list],"e-filter-list")},l.prototype.setCssClass=function(){var e=this.toolbarSettings.items.length?this.list.parentElement:this.list;this.cssClass&&t.addClass([e],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.enableRtl&&t.addClass([this.list],"e-rtl")},l.prototype.setEnable=function(){var e=this.toolbarSettings.items.length?this.list.parentElement:this.list;this.enabled?t.removeClass([e],s.cssClass.disabled):t.addClass([e],s.cssClass.disabled)},l.prototype.showSpinner=function(){this.spinner||(this.spinner=this.createElement("div",{className:"e-listbox-wrapper"})),this.spinner.style.height=t.formatUnit(this.height),this.element.parentElement&&this.element.parentElement.insertBefore(this.spinner,this.element.nextSibling),n.createSpinner({target:this.spinner},this.createElement),n.showSpinner(this.spinner)},l.prototype.hideSpinner=function(){this.spinner.querySelector(".e-spinner-pane")&&n.hideSpinner(this.spinner),this.spinner.parentElement&&t.detach(this.spinner)},l.prototype.onInput=function(){this.isDataSourceUpdate=!1,this.keyDownStatus?this.isValidKey=!0:this.isValidKey=!1,this.keyDownStatus=!1,this.refreshClearIcon()},l.prototype.clearText=function(){this.filterInput.value="",this.refreshClearIcon();var e=document.createEvent("KeyboardEvent");this.isValidKey=!0,this.KeyUp(e)},l.prototype.refreshClearIcon=function(){this.filterInput.parentElement.querySelector("."+Ae.clearIcon)&&(this.filterInput.parentElement.querySelector("."+Ae.clearIcon).style.visibility=""===this.filterInput.value?"hidden":"visible")},l.prototype.onActionComplete=function(i,s,l){var n,a,r,o=this;if(this.allowFiltering&&this.list.getElementsByClassName("e-filter-parent")[0]&&(n=this.list.getElementsByClassName("e-filter-parent")[0].cloneNode(!0)),0===s.length){var h=i.childNodes[0];h&&i.removeChild(h)}if(this.allowFiltering&&(a=this.list.getElementsByClassName("e-input-filter")[0])&&(r=a.selectionStart),e.prototype.onActionComplete.call(this,i,s,l),this.initWrapper(),this.allowFiltering&&!t.isNullOrUndefined(n)){this.list.insertBefore(n,this.list.firstElementChild),this.filterParent=this.list.getElementsByClassName("e-filter-parent")[0],this.filterWireEvents(n);var u=n.querySelector(".e-input-filter");u&&(u.addEventListener("focus",function(){n.childNodes[0].classList.contains("e-input-focus")||n.childNodes[0].classList.add("e-input-focus")}),u.addEventListener("blur",function(){n.childNodes[0].classList.contains("e-input-focus")&&n.childNodes[0].classList.remove("e-input-focus")}))}if(this.setSelection(this.value,!0,!1,!this.isRendered),this.initDraggable(),this.mainList=this.ulElement,this.initLoad)this.jsonData=[],t.extend(this.jsonData,s,[]),this.initToolbarAndStyles(),this.wireEvents(),this.showCheckbox&&this.setCheckboxPosition(),this.allowFiltering&&this.setFiltering();else if(this.isDataSourceUpdate&&(this.jsonData=[],t.extend(this.jsonData,s,[]),this.isDataSourceUpdate=!1),this.allowFiltering){if(a=this.list.getElementsByClassName("e-input-filter")[0],t.isNullOrUndefined(a))return;a.selectionStart=r,a.selectionEnd=r,(""!==a.value||""===a.value&&this.isBackSpace)&&(a.focus(),setTimeout(function(){o.isBackSpace=!1}))}if(this.toolbarSettings.items.length&&this.scope&&this.scope.indexOf("#")>-1&&!t.isNullOrUndefined(l)){var p=this.scope.replace("#","");t.getComponent(document.getElementById(p),this.getModuleName()).initToolbar()}this.initLoad=!1},l.prototype.initToolbarAndStyles=function(){this.initToolbar(),this.setCssClass(),this.setEnable(),this.setHeight()},l.prototype.triggerDragStart=function(e){var i,s=this,l=t.extend(this.getDragArgs(e),{dragSelected:!0},{cancel:!1});t.Browser.isIos&&(this.list.style.overflow="hidden"),this.trigger("dragStart",l,function(l){s.allowDragAll=l.dragSelected,s.allowDragAll||(i=s.ulElement.getElementsByClassName("e-list-badge")[0])&&t.detach(i),l.cancel&&(e.cancel=!0)})},l.prototype.triggerDrag=function(e){var t,i,s=this,l=10;if(this.itemTemplate&&e.target)if(e.target&&e.target.closest(".e-list-item"))l=e.target.closest(".e-list-item").scrollHeight;else{var n=e.element.querySelector(".e-list-item");n&&(l=n.scrollHeight)}var a,r=e.event;this.stopTimer(),e.target&&(e.target.classList.contains("e-listbox-wrapper")||e.target.classList.contains("e-list-item")||e.target.classList.contains("e-filter-parent")||e.target.classList.contains("e-input-group")||e.target.closest(".e-list-item"))&&(a=e.target.classList.contains("e-list-item")||e.target.classList.contains("e-filter-parent")||e.target.classList.contains("e-input-group")||e.target.closest(".e-list-item")?e.target.closest(".e-listbox-wrapper"):e.target,(t=this.allowFiltering?a.querySelector(".e-list-parent"):a)&&((i=t.getBoundingClientRect()).y+t.offsetHeight-(r.clientY+36)<1?this.timer=window.setInterval(function(){s.setScrollDown(t,l,!0)},70):r.clientY-36-i.y<1&&(this.timer=window.setInterval(function(){s.setScrollDown(t,l,!1)},70)))),null!==e.target&&this.trigger("drag",this.getDragArgs(e))},l.prototype.setScrollDown=function(e,t,i){e.scrollTop=i?e.scrollTop+t:e.scrollTop-t},l.prototype.stopTimer=function(){window.clearInterval(this.timer)},l.prototype.beforeDragEnd=function(e){this.stopTimer();var i=[];this.dragValue=this.getFormattedValue(e.droppedElement.getAttribute("data-value")),this.value.indexOf(this.dragValue)>-1?e.items=this.getDataByValues(this.value):e.items=this.getDataByValues([this.dragValue]),t.extend(i,e.items),this.trigger("beforeDrop",e),JSON.stringify(e.items)!==JSON.stringify(i)&&(this.customDraggedItem=e.items)},l.prototype.dragEnd=function(e){var i,s,l,n,a,r,o=this,h=this.getFormattedValue(e.droppedElement.getAttribute("data-value")),u=this.getComponent(e.droppedElement),p=this.getDragArgs({target:e.droppedElement},!0),d={previousData:this.dataSource},c={previousData:u.dataSource},m=t.extend({},p,{target:e.target,source:{previousData:this.dataSource},previousIndex:e.previousIndex,currentIndex:e.currentIndex});if(u!==this){L=t.extend(d,{currentData:this.listData});m=t.extend(m,{source:L,destination:c})}t.Browser.isIos&&(this.list.style.overflow="");var f=this.getComponent(e.target);if(f&&0===f.listData.length){var v=f.ulElement.childNodes[0];v&&f.allowDragAndDrop&&f.ulElement.removeChild(v)}if(u===this){var g=this.ulElement;i=[].slice.call(this.listData),s=[].slice.call(this.liCollections),l=[].slice.call(this.jsonData),r=[].slice.call(this.sortedData);var y=e.currentIndex,C=e.currentIndex=this.getCurIdx(this,e.currentIndex),b=i.indexOf(this.getDataByValue(h)),S=l.indexOf(this.getDataByValue(h)),E=r.indexOf(this.getDataByValue(h));i.splice(C,0,i.splice(b,1)[0]),r.splice(y,0,r.splice(E,1)[0]),l.splice(C,0,l.splice(S,1)[0]),s.splice(C,0,s.splice(b,1)[0]),this.allowDragAll&&(a=this.value&&Array.prototype.indexOf.call(this.value,h)>-1?this.value:[h],t.isNullOrUndefined(this.customDraggedItem)||(a=[],this.customDraggedItem.forEach(function(e){a.push(t.getValue(o.fields.value,e))})),a.forEach(function(e){if(e!==h){var t=i.indexOf(o.getDataByValue(e)),n=l.indexOf(o.getDataByValue(e)),a=r.indexOf(o.getDataByValue(e));t>C&&C++,l.splice(C,0,l.splice(n,1)[0]),i.splice(C,0,i.splice(t,1)[0]),r.splice(y,0,r.splice(a,1)[0]),s.splice(C,0,s.splice(t,1)[0]),g.insertBefore(o.getItems()[o.getIndexByValue(e)],g.getElementsByClassName("e-placeholder")[0])}})),this.listData=i,this.jsonData=l,this.sortedData=r,this.liCollections=s}else{var x,I=[].slice.call(this.liCollections),w=e.currentIndex=this.getCurIdx(u,e.currentIndex),O=u.ulElement;i=[].slice.call(u.listData),s=[].slice.call(u.liCollections),l=[].slice.call(u.jsonData),r=[].slice.call(u.sortedData),a=this.value&&Array.prototype.indexOf.call(this.value,h)>-1&&this.allowDragAll?this.value:[h],t.isNullOrUndefined(this.customDraggedItem)||(a=[],this.customDraggedItem.forEach(function(e){a.push(t.getValue(o.fields.value,e))}));var A=[].slice.call(this.listData),D=[].slice.call(this.sortedData);if(a.forEach(function(t){n=o.getDataByValue(t);var a=o.listData.indexOf(n),u=o.jsonData.indexOf(n),p=o.sortedData.indexOf(n);A.splice(a,1),o.jsonData.splice(u,1),D.splice(p,1),o.listData=A,o.sortedData=D;var d=t===h?e.currentIndex:w;if(i.splice(d,0,n),l.splice(d,0,n),r.splice(d,0,n),s.splice(d,0,I.splice(a,1)[0]),t)x=o.getItems()[o.getIndexByValue(t)];else for(var c=o.getItems(),m=0;m<c.length;m++)if(null===c[m].getAttribute("data-value")&&c[m].classList.contains("e-list-item")){x=c[m];break}x||(x=e.helper),o.removeSelected(o,t===h?[e.droppedElement]:[x]),O.insertBefore(x,O.getElementsByClassName("e-placeholder")[0]),w++}),this.fields.groupBy){N=this.renderItems(this.listData,this.fields);this.updateListItems(N,this.ulElement),this.setSelection()}if("None"!==u.sortOrder||this.selectionSettings.showCheckbox!==u.selectionSettings.showCheckbox||u.fields.groupBy||u.itemTemplate||this.itemTemplate){var k=t.getComponent(O,"sortable"),N=u.renderItems(i,u.fields);u.updateListItems(N,O),this.setSelection(),k.placeHolderElement&&O.appendChild(k.placeHolderElement),O.appendChild(e.helper),u.setSelection()}this.liCollections=I,u.liCollections=s,u.jsonData=t.extend([],[],l,!1),u.listData=t.extend([],[],i,!1),"None"===u.sortOrder&&(u.sortedData=t.extend([],[],r,!1)),0===this.listData.length&&this.l10nUpdate()}if(this===u){var L=t.extend(d,{currentData:i});m=t.extend(m,{source:L})}else{var T=t.extend(c,{currentData:i});m=t.extend(m,{destination:T})}t.isNullOrUndefined(this.customDraggedItem)||(m.items=this.customDraggedItem),this.trigger("drop",m);var B=m.elements;if(B.length)for(var V=0;V<B.length;V++)B[V].classList.remove("e-grabbed");this.toolbarSettings.items.length>0?this.updateToolBarState():this.tBListBox&&this.tBListBox.toolbarSettings.items.length>0&&this.tBListBox.updateToolBarState()},l.prototype.updateListItems=function(e,t){t.innerHTML="",t.append.apply(t,e.childNodes)},l.prototype.removeSelected=function(e,i){e.selectionSettings.showCheckbox?i.forEach(function(e){e.getElementsByClassName("e-frame")[0].classList.remove("e-check")}):t.removeClass(i,s.cssClass.selected)},l.prototype.getCurIdx=function(e,t){return e.fields.groupBy&&(t-=[].slice.call(e.ulElement.children).slice(0,t).filter(function(e){return e.classList.contains(s.cssClass.group)}).length),t},l.prototype.getComponent=function(e){var i,s="EJS-LISTBOX"===this.element.tagName?t.closest(e,".e-listbox"):t.closest(e,".e-listbox-wrapper")&&t.closest(e,".e-listbox-wrapper").querySelector(".e-listbox");return s&&(i=t.getComponent(s,this.getModuleName())),i},l.prototype.setEnabled=function(){this.element.setAttribute("aria-disabled",this.enabled?"false":"true")},l.prototype.listOption=function(i,s){return this.listCurrentOptions=e.prototype.listOption.call(this,i,s),this.listCurrentOptions=t.extend({},this.listCurrentOptions,{itemCreated:this.triggerBeforeItemRender.bind(this)},!0),this.notify("listoption",{module:"CheckBoxSelection"}),this.listCurrentOptions},l.prototype.triggerBeforeItemRender=function(e){e.item.setAttribute("tabindex","-1"),this.trigger("beforeItemRender",{element:e.item,item:e.curData})},l.prototype.requiredModules=function(){var e=[];return this.selectionSettings.showCheckbox&&e.push({member:"CheckBoxSelection",args:[this]}),e},l.prototype.enableItems=function(e,i,l){var n=this;void 0===i&&(i=!0);var a;if(e.forEach(function(e){var r=e;(a=n.findListElement(n.list,"li","data-value",l?r:n.getValueByText(r)))&&(i?(t.removeClass([a],s.cssClass.disabled),a.removeAttribute("aria-disabled")):(t.addClass([a],s.cssClass.disabled),a.setAttribute("aria-disabled","true")))}),this.allowFiltering&&this.filterInput&&""!==this.filterInput.value&&this.toolbarSettings.items.length>0){var r=!1;this.ulElement.childNodes.forEach(function(e){e.classList.contains("e-disabled")||(r=!0)}),r||(this.list.parentElement.getElementsByClassName("e-listbox-tool")[0].querySelector('[data-value="moveAllTo"]').disabled=!0)}},l.prototype.selectItems=function(e,i,l){void 0===i&&(i=!0),i&&!this.selectionSettings.showCheckbox&&"Single"===this.selectionSettings.mode&&this.getSelectedItems().forEach(function(e){e.classList.remove("e-active"),e.removeAttribute("aria-selected"),t.removeClass([e],s.cssClass.selected)}),this.setSelection(e,i,!l),this.updateSelectedOptions();for(var n=[],a=0;a<e.length;a++)for(var r=this.list.querySelectorAll('[aria-selected="true"]'),o=0;o<r.length;o++)e[a]===this.getFormattedValue(r[o].getAttribute("data-value"))&&n.push(r[o]);this.triggerChange(n,null)},l.prototype.selectAll=function(e){void 0===e&&(e=!0),this.selectAllItems(e)},l.prototype.addItems=function(t,s){e.prototype.addItem.call(this,t,s),this.allowFiltering&&""!==this.filterInput.value&&this.filteringAction(this.jsonData,new i.Query,this.fields)},l.prototype.removeItems=function(e,t){this.removeItem(e,t)},l.prototype.removeItem=function(e,i){var s=this,l=[],n=this.list.querySelectorAll("."+H.li);if(e){e=e instanceof Array?e:[e];var a=this.fields,r=void 0,o={},h=[];t.extend(h,[],this.jsonData);for(var u=[],p=[],d=0;d<h.length;d++)o[h[d]instanceof Object?h[d][a.value]:h[d].toString()]=d;for(var c=0;c<e.length;c++)if(r=e[c]instanceof Object?e[c][a.value]:e[c].toString(),Object.prototype.hasOwnProperty.call(o,r)){var m=o[r];l.push(n[m]),u.push(m),p.push(m)}u.sort(function(e,t){return t-e}).forEach(function(e){s.listData.splice(e,1),s.jsonData.splice(e,1)});for(var f=p.length-1;f>=0;f--)this.updateLiCollection(p[f])}else i=i||0,l.push(n[i]),this.listData.splice(i,1),this.jsonData.splice(i,1),this.updateLiCollection(i);for(d=0;d<l.length;d++)this.ulElement.removeChild(l[d]);0===this.listData.length&&this.l10nUpdate(),this.listData.length!==this.sortedData.length&&(this.sortedData=this.listData),this.value=[],this.updateToolBarState()},l.prototype.getDataByValues=function(e){for(var t=[],i=0;i<e.length;i++)t.push(this.getDataByValue(e[i]));return t},l.prototype.moveUp=function(e){var t=e?this.getElemByValue(e):this.getSelectedItems();this.moveUpDown(!0,!1,t)},l.prototype.moveDown=function(e){var t=e?this.getElemByValue(e):this.getSelectedItems();this.moveUpDown(!1,!1,t)},l.prototype.moveTop=function(e){var t=e?this.getElemByValue(e):this.getSelectedItems();this.moveUpDown(null,!1,t,!0)},l.prototype.moveBottom=function(e){var t=e?this.getElemByValue(e):this.getSelectedItems();this.moveUpDown(!0,!1,t,!1,!0)},l.prototype.moveTo=function(e,i,s){var l=e?this.getElemByValue(e):this.getSelectedItems(),n=s?t.getComponent(s,o):this.getScopedListBox();this.moveData(this,n,!1,l,i)},l.prototype.moveAllTo=function(e,i){if(this.toolbarAction="moveAllTo",this.listData.length>0){var s=e?t.getComponent(e,o):this.getScopedListBox();this.moveAllData(this,s,!1,i)}},l.prototype.getDataList=function(){return this.jsonData},l.prototype.getSortedList=function(){var e,t;if(e=t=this.sortedData,this.fields.groupBy){e=[];for(var i=0;i<t.length;i++)t[i].isHeader||e.push(t[i])}return e},l.prototype.getElemByValue=function(e){for(var t=[],i=0;i<e.length;i++)t.push(this.ulElement.querySelector('[data-value ="'+e[i]+'"]'));return t},l.prototype.updateLiCollection=function(e){var t=[].slice.call(this.liCollections);t.splice(e,1),this.liCollections=t},l.prototype.selectAllItems=function(e,t){var i=this;if([].slice.call(this.getItems()).forEach(function(t){if(!t.classList.contains(s.cssClass.disabled))if(i.selectionSettings.showCheckbox){var l=t.getElementsByClassName("e-check")[0];(!l&&e||l&&!e)&&(i.notify("updatelist",{li:t,module:"listbox"}),i.maximumSelectionLength>=i.list.querySelectorAll(".e-list-item span.e-check").length&&i.checkMaxSelection())}else e?t.classList.add(s.cssClass.selected):t.classList.remove(s.cssClass.selected)}),this.updateSelectedOptions(),this.allowFiltering&&this.selectionSettings.showCheckbox){var l=this.list.getElementsByTagName("li"),n=0;if(e){var a=this;for(n=0;n<l.length;n++)!function(){var e=a.getFormattedValue(l[n].getAttribute("data-value"));a.value.some(function(t){return t===e})||a.value.push(a.getFormattedValue(l[n].getAttribute("data-value")))}()}else{var r=this;for(n=0;n<l.length;n++)!function(){var e=r.getFormattedValue(l[n].getAttribute("data-value"));r.value=r.value.filter(function(t){return t!==e})}()}document.querySelectorAll("ul").length<2&&this.updateMainList()}this.triggerChange(this.getSelectedItems(),t)},l.prototype.updateMainList=function(){var e=this.mainList.querySelectorAll(".e-list-item"),t=this.ulElement.querySelectorAll(".e-list-item"),i=e.length,s=t.length;if(this.selectionSettings.showCheckbox||document.querySelectorAll("ul").length>1||i!==s){var l=0,n=0,a=0;for(l;l<i;){if(this.value)for(n;n<this.value.length;n++)e[l].getAttribute("data-value")===this.value[n]&&a++;!a&&this.selectionSettings.showCheckbox&&e[l].getElementsByClassName("e-frame")[0].classList.remove("e-check"),document.querySelectorAll("ul").length>1&&a&&i!==s?(this.mainList.removeChild(this.mainList.getElementsByTagName("li")[l]),l=0):l++,a=0,n=0}}},l.prototype.wireEvents=function(){var e=t.closest(this.element,"form"),i="EJS-LISTBOX"===this.element.tagName?this.element:this.list;t.EventHandler.add(this.list,"click",this.clickHandler,this),t.EventHandler.add(i,"keydown",this.keyDownHandler,this),t.EventHandler.add(i,"focusout",this.focusOutHandler,this),this.wireToolbarEvent(),this.selectionSettings.showCheckbox&&t.EventHandler.remove(document,"mousedown",this.checkBoxSelectionModule.onDocumentClick),(this.fields.groupBy||this.element.querySelector("select>optgroup"))&&t.EventHandler.remove(this.list,"scroll",this.setFloatingHeader),e&&t.EventHandler.add(e,"reset",this.formResetHandler,this),window.addEventListener("resize",this.resizeHandler.bind(this))},l.prototype.wireToolbarEvent=function(){this.toolbarSettings.items.length&&t.EventHandler.add(this.getToolElem(),"click",this.toolbarClickHandler,this)},l.prototype.unwireEvents=function(){var e=t.closest(this.element,"form"),i="EJS-LISTBOX"===this.element.tagName?this.element:this.list;t.EventHandler.remove(this.list,"click",this.clickHandler),t.EventHandler.remove(i,"keydown",this.keyDownHandler),t.EventHandler.remove(i,"focusout",this.focusOutHandler),this.allowFiltering&&this.clearFilterIconElem&&t.EventHandler.remove(this.clearFilterIconElem,"click",this.clearText),this.toolbarSettings.items.length&&t.EventHandler.remove(this.getToolElem(),"click",this.toolbarClickHandler),e&&t.EventHandler.remove(e,"reset",this.formResetHandler),window.removeEventListener("resize",this.resizeHandler.bind(this))},l.prototype.clickHandler=function(e){var i=t.closest(e.target,".e-list-item");t.isNullOrUndefined(i)||this.selectHandler(e)},l.prototype.checkSelectAll=function(){for(var e=0,t=this.list.querySelectorAll("li."+H.li),i=0;i<t.length;i++)t[i].classList.contains("e-disabled")||e++;var s=this.getSelectedItems().length;this.selectedListItemCount=s,this.showSelectAll&&e&&this.notify("checkSelectAll",{module:"CheckBoxSelection",value:e===s?"check":0===s?"uncheck":"indeterminate"})},l.prototype.getQuery=function(e){var t=e?e.clone():this.query?this.query.clone():new i.Query;if(this.allowFiltering){var s=""===this.inputString?"contains":this.filterType,l=this.typeOfData(this.dataSource).typeof;if(null===l&&(l=this.typeOfData(this.jsonData).typeof),(this.dataSource instanceof i.DataManager||"string"!==l)&&"number"!==l){var n=this.fields.text?this.fields.text:"";t.where(n,s,this.inputString,this.ignoreCase,this.ignoreAccent)}else t.where("",s,this.inputString,this.ignoreCase,this.ignoreAccent)}else t=e||(this.query?this.query:new i.Query);return t},l.prototype.setFiltering=function(){var e;if(this.initLoad||t.isNullOrUndefined(this.filterParent))return this.filterParent=this.createElement("span",{className:Ae.filterParent}),this.filterInput=this.createElement("input",{attrs:{type:"text"},className:Ae.filterInput}),this.element.parentNode.insertBefore(this.filterInput,this.element),e=a.Input.createInput({element:this.filterInput,buttons:[Ae.filterBarClearIcon],properties:{placeholder:this.filterBarPlaceholder}},this.createElement),t.append([e.container],this.filterParent),t.prepend([this.filterParent],this.list),t.attributes(this.filterInput,{"aria-disabled":"false","aria-label":"search list item",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",role:"textbox"}),this.height.toString().indexOf("%")<0?t.addClass([this.list],"e-filter-list"):this.height.toString().indexOf("%")>0&&(this.ulElement.style.height=this.ulElement.offsetHeight-this.filterParent.offsetHeight+"px"),this.inputString=this.filterInput.value,this.filterWireEvents(),e},l.prototype.filterWireEvents=function(e){e&&(this.filterInput=e.querySelector(".e-input-filter")),this.clearFilterIconElem=this.filterInput.parentElement.querySelector("."+Ae.clearIcon),this.clearFilterIconElem&&(t.EventHandler.add(this.clearFilterIconElem,"click",this.clearText,this),e||(this.clearFilterIconElem.style.visibility="hidden")),t.EventHandler.add(this.filterInput,"input",this.onInput,this),t.EventHandler.add(this.filterInput,"keyup",this.KeyUp,this),t.EventHandler.add(this.filterInput,"keydown",this.onKeyDown,this)},l.prototype.selectHandler=function(e,i){var l,n=!0,a=t.closest(e.target,".e-list-item"),r=[a];if(a&&a.parentElement){if(l=[].slice.call(a.parentElement.children).indexOf(a),this.selectionSettings.showCheckbox?n=!a.getElementsByClassName("e-frame")[0].classList.contains("e-check"):(e.ctrlKey||e.metaKey||t.Browser.isDevice)&&this.isSelected(a)?(a.classList.remove(s.cssClass.selected),a.removeAttribute("aria-selected"),n=!1):"Multiple"===this.selectionSettings.mode&&(e.ctrlKey||e.metaKey||t.Browser.isDevice)||(this.getSelectedItems().forEach(function(e){e.removeAttribute("aria-selected")}),t.removeClass(this.getSelectedItems(),s.cssClass.selected)),e.shiftKey&&!this.selectionSettings.showCheckbox&&"Single"!==this.selectionSettings.mode?r=[].slice.call(a.parentElement.children).slice(Math.min(l,this.prevSelIdx),Math.max(l,this.prevSelIdx)+1).filter(function(e){return e.classList.contains("e-list-item")}):this.prevSelIdx=[].slice.call(a.parentElement.children).indexOf(a),n?(this.selectionSettings.showCheckbox||t.addClass(r,s.cssClass.selected),r.forEach(function(e){e.setAttribute("aria-selected","true")}),this.list.setAttribute("aria-activedescendant",a.id)):r.forEach(function(e){e.setAttribute("aria-selected","false")}),i||!(this.maximumSelectionLength>(this.value&&this.value.length))&&n||!(this.maximumSelectionLength>=(this.value&&this.value.length))&&n||this.maximumSelectionLength<(this.value&&this.value.length)||this.notify("updatelist",{li:a,e:e,module:"listbox"}),this.allowFiltering&&!i){var o=this.getFormattedValue(a.getAttribute("data-value"));if(n){var h=[];t.extend(h,this.value),h.push(o),this.value=h}else this.value=this.value.filter(function(e){return e!==o});document.querySelectorAll("ul").length<2&&this.updateMainList()}this.updateSelectedOptions(),this.triggerChange(this.getSelectedItems(),e),this.list&&this.checkMaxSelection()}},l.prototype.triggerChange=function(e,t){this.trigger("change",{elements:e,items:this.getDataByElements(e),value:this.value,event:t})},l.prototype.getDataByElems=function(e){for(var t=[],i=e.length,s=0;s<i;s++){var l=e[s].getAttribute("data-value"),n=this.getFormattedValue(l);t.push(this.getDataByValue(n))}return t},l.prototype.getDataByElements=function(e){var i,s=[],l=0;if(!t.isNullOrUndefined(this.listData)){var n=this.typeOfData(this.listData).typeof;if("string"===n||"number"===n||"boolean"===n)for(var a=0,r=this.listData;a<r.length;a++){for(var o=r[a],h=l,u=e.length;h<u;h++)if(i=this.getFormattedValue(e[h].getAttribute("data-value")),!t.isNullOrUndefined(o)&&o===i){l=h,s.push(o);break}if(e.length===s.length)break}else for(var p=0,d=this.listData;p<d.length;p++){for(var o=d[p],h=l,u=e.length;h<u;h++)if(i=this.getFormattedValue(e[h].getAttribute("data-value")),!t.isNullOrUndefined(o)&&t.getValue(this.fields.value?this.fields.value:"value",o)===i){l=h,s.push(o);break}if(e.length===s.length)break}return s}return null},l.prototype.checkMaxSelection=function(){var e=this.list.querySelectorAll(".e-list-item span.e-check").length;if(this.selectionSettings.showCheckbox){var t=0,i=this.list.getElementsByClassName("e-list-item");for(t;t<i.length;t++)i[t].querySelector(".e-frame.e-check")||(e===this.maximumSelectionLength?i[t].classList.add("e-disable"):i[t].classList.contains("e-disable")&&i[t].classList.remove("e-disable"))}},l.prototype.toolbarClickHandler=function(e){var i=t.closest(e.target,"button");if(i){if(this.toolbarAction=i.getAttribute("data-value"),i.disabled)return;switch(this.toolbarAction){case"moveUp":this.moveUpDown(!0);break;case"moveDown":this.moveUpDown();break;case"moveTo":this.moveItemTo();break;case"moveFrom":this.moveItemFrom();break;case"moveAllTo":this.moveAllItemTo();break;case"moveAllFrom":this.moveAllItemFrom();break;default:this.trigger("actionBegin",{cancel:!1,items:this.getDataByElems(this.getSelectedItems()),eventName:this.toolbarAction})}}},l.prototype.moveUpDown=function(e,t,i,l,n){var a=this,r=this.getSelectedItems();if(i&&(r=i),!(e&&this.isSelected(this.ulElement.firstElementChild)||!e&&this.isSelected(this.ulElement.lastElementChild))||i){var o=this.getDataByElems(r),h={cancel:!1,items:o,eventName:this.toolbarAction};this.trigger("actionBegin",h),h.cancel||((e?r:r.reverse()).forEach(function(t){var i=Array.prototype.indexOf.call(a.ulElement.querySelectorAll(".e-list-item"),t),r=Array.prototype.indexOf.call(a.ulElement.children,t);l?(s.moveTo(a.ulElement,a.ulElement,[r],0),a.changeData(r,0,i,t)):n?(s.moveTo(a.ulElement,a.ulElement,[r],a.ulElement.querySelectorAll(".e-list-item").length),a.changeData(r,a.ulElement.querySelectorAll(".e-list-item").length,i,t)):(s.moveTo(a.ulElement,a.ulElement,[r],e?r-1:r+2),a.changeData(r,e?r-1:r+1,e?i-1:i+1,t))}),this.trigger("actionComplete",{items:o,eventName:this.toolbarAction}),r[0].focus(),!t&&this.toolbarSettings.items.length&&this.getToolElem().querySelector("[data-value="+(e?"moveUp":"moveDown")+"]").focus(),this.updateToolBarState())}},l.prototype.moveItemTo=function(){this.moveData(this,this.getScopedListBox())},l.prototype.moveItemFrom=function(){this.moveData(this.getScopedListBox(),this)},l.prototype.moveData=function(e,i,l,n,a){var r=[],o=[],h=[],u=[],p=[].slice.call(e.listData),d=[].slice.call(i.listData),c=[].slice.call(e.sortedData),m=[].slice.call(i.sortedData),f=[].slice.call(e.liCollections),v=[],g=[].slice.call(i.liCollections),y=[],C=[],b=e.getSelectedItems();n&&(b=n);var S="None"!==i.sortOrder||i.selectionSettings.showCheckbox!==e.selectionSettings.showCheckbox||i.fields.groupBy||i.itemTemplate||e.itemTemplate;if(e.value=[],b.length){this.removeSelected(e,b);var E,x=Array.prototype.slice.call(e.ulElement.children),I=Array.prototype.slice.call(e.ulElement.querySelectorAll(".e-list-item")),w=e.listData,O=e.sortedData,A=e.jsonData,D={};if(b.length>199)for(var k=0,N=e.listData;k<N.length;k++){var L=N[k];if(!t.isNullOrUndefined(L)){var T=e.getFormattedValue(t.getValue(e.fields.value?e.fields.value:"value",L));D[T]=L}}b.forEach(function(t){if(b.length<200)E=e.getDataByElems([t])[0];else{var i=t.getAttribute("data-value"),s=e.getFormattedValue(i);E=D[s]}r.push(x.indexOf(t)),v.push(I.indexOf(t)),o.push(w.indexOf(E)),u.push(O.indexOf(E)),h.push(A.indexOf(E))}),"None"!==this.sortOrder?u.forEach(function(t){y.push(e.sortedData[t])}):h.forEach(function(t){y.push(e.jsonData[t])});var B={cancel:!1,items:y,eventName:this.toolbarAction};if(e.trigger("actionBegin",B),B.cancel)return;var V=[];if(v.sort(function(e,t){return e-t}).reverse().forEach(function(e){V.push(f.splice(e,1)[0])}),e.liCollections=f,a){var P=g.splice(0,a);i.liCollections=P.concat(V.reverse()).concat(g)}else i.liCollections=g.concat(V.reverse());if(0===i.listData.length){var H=i.ulElement.childNodes[0];H&&i.ulElement.removeChild(H)}if(o.sort(function(e,t){return t-e}).forEach(function(e){p.splice(e,1)[0]}),u.sort(function(e,t){return t-e}).forEach(function(e){c.splice(e,1)[0]}),h.slice().reverse().forEach(function(t){C.push(e.jsonData.splice(t,1)[0])}),S)if(e.fields.groupBy){W=e.renderItems(p,e.fields);e.updateListItems(W,e.ulElement)}else b.forEach(function(e){t.detach(e)});else s.moveTo(e.ulElement,i.ulElement,r,a),e.trigger("actionComplete",{items:y,eventName:this.toolbarAction});i.mainList.childElementCount!==i.jsonData.length&&(i.mainList=i.ulElement);var U=[].slice.call(i.jsonData);m=[].slice.call(i.sortedData),this.selectNextList(b,v,o,e),l&&this.list.focus(),e.listData=p,e.sortedData=c,a=a||d.length;for(var F=y.length-1;F>=0;F--)d.splice(a,0,y[F]),U.splice(a,0,y[F]),m.splice(a,0,y[F]);if(i.listData=d,i.jsonData=U,i.sortedData=m,S){var W=i.renderItems(d,i.fields);i.updateListItems(W,i.ulElement),i.setSelection(),e.trigger("actionComplete",{items:y,eventName:this.toolbarAction})}e.updateSelectedOptions(),0===e.listData.length&&e.l10nUpdate()}if(1===e.value.length&&e.getSelectedItems().length&&(e.value[0]=e.getFormattedValue(e.getSelectedItems()[0].getAttribute("data-value"))),e.liCollections.length===e.ulElement.querySelectorAll(".e-disabled").length&&this.toolbarAction){var q=this.list.parentElement.getElementsByClassName("e-listbox-tool")[0],M="moveFrom"===this.toolbarAction?"moveAllFrom":"moveAllTo";q&&(q.querySelector('[data-value="'+M+'"]').disabled=!0)}},l.prototype.selectNextList=function(e,t,i,l){var n,a,r=l.ulElement.querySelectorAll(".e-list-item").length,o=-1;1===e.length&&r&&!l.selectionSettings.showCheckbox&&(a=r<=t[0]?r-1:t[0],n=l.ulElement.querySelectorAll(".e-list-item")[a],(o=l.getValidIndex(n,a,r===i[0]?38:40))>-1&&l.ulElement.querySelectorAll(".e-list-item")[o].classList.add(s.cssClass.selected))},l.prototype.moveAllItemTo=function(){this.moveAllData(this,this.getScopedListBox())},l.prototype.moveAllItemFrom=function(){this.moveAllData(this.getScopedListBox(),this)},l.prototype.moveAllData=function(e,t,i,l){var n=[].slice.call(t.listData),a=[].slice.call(t.jsonData),r="None"!==t.sortOrder||t.selectionSettings.showCheckbox!==e.selectionSettings.showCheckbox||t.fields.groupBy||t.itemTemplate||e.itemTemplate,o=[],h=[],u=[];this.removeSelected(e,e.getSelectedItems());var p=[].slice.call(e.listData),d={cancel:!1,items:p,eventName:this.toolbarAction};if(e.trigger("actionBegin",d),!d.cancel){if(0===t.listData.length){var c=t.ulElement.childNodes[0];c&&t.ulElement.removeChild(c)}e.listData.length>0&&(u=Array.apply(null,{length:e.ulElement.childElementCount}).map(Number.call,Number));for(var m=e.ulElement.childNodes,f=e.ulElement.childElementCount,v=[],g=0;g<f;g++){var y=m[g];y.classList.contains("e-disabled")?(o.push(y),null!=this.sortOrder?h.push(e.sortedData[g]):h.push(e.listData[g])):v.push(g)}u=v,s.moveTo(e.ulElement,t.ulElement,u,l),e.trigger("actionComplete",{items:p,eventName:this.toolbarAction}),i&&this.list.focus(),l=l||n.length;for(g=0;g<u.length;g++)null!=this.sortOrder?n.splice(l+g,0,e.sortedData[u[g]]):n.splice(l+g,0,e.listData[u[g]]);for(g=0;g<u.length;g++)a.splice(l+g,0,e.jsonData[u[g]]);var C=[];o.length>0?(e.liCollections=o,C=[].slice.call(e.liCollections)):(C=[].slice.call(e.liCollections),e.liCollections=[]);var b=[].slice.call(t.liCollections);if(l){var S=b.splice(0,l);t.liCollections=S.concat(C).concat(b)}else t.liCollections=b.concat(C);e.value=[];for(var E=(n=(n=n.filter(function(e){return void 0!==e})).filter(function(e){return!0!==e.isHeader})).filter(function(e){return-1===t.jsonData.indexOf(e)}),g=0;g<E.length;g++)t.jsonData.splice(l+g,0,E[g]);if(t.listData=n,e.listData.length===e.jsonData.length)e.listData=e.sortedData=e.jsonData=h;else if(e.allowFiltering){var x=[];if(o.length>0){for(g=0;g<o.length;g++)x.push(e.getDataByValue(o[g].getAttribute("data-value")));e.listData=e.listData.filter(function(e){return!x.some(function(t){return e===t})})}for(g=0;g<e.listData.length;g++)for(var I=0;I<e.jsonData.length;I++)e.listData[g]===e.jsonData[I]&&e.jsonData.splice(I,1);o.length>0?(e.listData=x,e.sortedData=[]):e.listData=e.sortedData=[]}if(r){var w=t.renderItems(n,t.fields);t.updateListItems(w,t.ulElement)}else t.sortedData=n;e.updateSelectedOptions(),o.length>0&&(this.list.parentElement.getElementsByClassName("e-listbox-tool")[0].querySelector('[data-value="'+this.toolbarAction+'"]').disabled=!0),0===e.listData.length&&0===o.length&&e.l10nUpdate()}},l.prototype.changeData=function(e,t,i,s){var l=[].slice.call(this.listData),n=[].slice.call(this.jsonData),a=[].slice.call(this.sortedData),r=Array.prototype.indexOf.call(this.jsonData,this.getDataByElems([s])[0]),o=Array.prototype.indexOf.call(this.sortedData,this.getDataByElems([s])[0]),h=[].slice.call(this.liCollections);l.splice(t,0,l.splice(e,1)[0]),n.splice(i,0,n.splice(r,1)[0]),a.splice(t,0,a.splice(o,1)[0]),h.splice(t,0,h.splice(e,1)[0]),this.listData=l,this.jsonData=n,this.liCollections=h,this.sortedData=a},l.prototype.getSelectedItems=function(){var e=[];return this.selectionSettings.showCheckbox?[].slice.call(this.ulElement.getElementsByClassName("e-check")).forEach(function(i){e.push(t.closest(i,".e-list-item"))}):e=[].slice.call(this.ulElement.getElementsByClassName(s.cssClass.selected)),e},l.prototype.getScopedListBox=function(){var e,i=this;return this.scope&&[].slice.call(document.querySelectorAll(this.scope)).forEach(function(s){t.getComponent(s,i.getModuleName())&&(e=t.getComponent(s,i.getModuleName()))}),e},l.prototype.getGrabbedItems=function(e){for(var t=!1,i=0;i<this.value.length;i++)if(this.value[i]===this.getFormattedValue(e.target.getAttribute("data-value"))){t=!0;break}if(t)for(i=0;i<this.value.length;i++)for(var s=this.list.querySelectorAll('[aria-selected="true"]'),l=0;l<s.length;l++)this.value[i]===this.getFormattedValue(s[l].getAttribute("data-value"))&&s[l].classList.add("e-grabbed");return this.isAngular?Array.prototype.slice.call(this.element.getElementsByClassName("e-list-parent")[0].querySelectorAll(".e-grabbed")):Array.prototype.slice.call(this.element.nextElementSibling.querySelectorAll(".e-grabbed"))},l.prototype.getDragArgs=function(e,t){var i=this.getGrabbedItems(e);return i.length?t&&i.push(e.target):i=[e.target],{elements:i,event:e.event,items:this.getDataByElems(i)}},l.prototype.onKeyDown=function(e){this.keyDownHandler(e),e.stopPropagation()},l.prototype.keyDownHandler=function(e){if([32,35,36,37,38,39,40,65].indexOf(e.keyCode)>-1&&(!this.allowFiltering||this.allowFiltering&&e.target!==this.filterInput)){if(e.target&&e.target.className.indexOf("e-edit-template")>-1)return;if(e.preventDefault(),32===e.keyCode&&this.ulElement.children.length)this.selectHandler({target:this.ulElement.getElementsByClassName("e-focused")[0],ctrlKey:e.ctrlKey,shiftKey:e.shiftKey});else if(65===e.keyCode&&e.ctrlKey&&"Multiple"===this.selectionSettings.mode)this.selectAll();else if((38===e.keyCode||40===e.keyCode)&&e.ctrlKey&&e.shiftKey)this.moveUpDown(38===e.keyCode,!0);else if(!this.toolbarSettings.items.length&&!this.tBListBox||39!==e.keyCode&&37!==e.keyCode||!e.ctrlKey)37!==e.keyCode&&39!==e.keyCode&&"KeyA"!==e.code&&this.upDownKeyHandler(e);else{var t=this.tBListBox||this.getScopedListBox();39===e.keyCode?e.shiftKey?this.moveAllData(this,t,!0):this.moveData(this,t,!0):e.shiftKey?this.moveAllData(t,this,!0):this.moveData(t,this,!0)}}else this.allowFiltering&&(40!==e.keyCode&&38!==e.keyCode||this.upDownKeyHandler(e))},l.prototype.upDownKeyHandler=function(e){var i=this.ulElement,l=40===e.keyCode||36===e.keyCode?0:i.childElementCount-1,n=i.getElementsByClassName("e-focused")[0]||i.getElementsByClassName(s.cssClass.selected)[0];if(n){if(35!==e.keyCode&&36!==e.keyCode&&(l=Array.prototype.indexOf.call(i.children,n),40===e.keyCode?l++:l--,l<0||l>i.childElementCount-1))return;t.removeClass([n],"e-focused")}var a=i.children[l];if(a){if(-1===(l=this.getValidIndex(a,l,e.keyCode)))return void t.addClass([n],"e-focused");if(i.children[l].focus(),i.children[l].classList.add("e-focused"),e.ctrlKey&&(this.selectionSettings.showCheckbox||!e.shiftKey||36!==e.keyCode&&35!==e.keyCode)||this.selectHandler({target:i.children[l],ctrlKey:e.ctrlKey,shiftKey:e.shiftKey},!0),this.selectionSettings.showCheckbox&&e.ctrlKey&&e.shiftKey&&(36===e.keyCode||35===e.keyCode))for(var r=Array.prototype.indexOf.call(i.children,n),o="Home"===e.code?0:r,h="Home"===e.code?r:i.children.length-1,u=o;u<=h;u++){var p=i.children[u];this.notify("updatelist",{li:p,e:{target:this.ulElement.getElementsByClassName("e-focused")[0],ctrlKey:e.ctrlKey,shiftKey:e.shiftKey},module:"listbox"})}}},l.prototype.KeyUp=function(e){var s=this;if(this.allowFiltering&&e.ctrlKey&&65===e.keyCode)return void e.preventDefault();var l=e.code&&e.keyCode>=96&&e.keyCode<=105?String.fromCharCode(e.keyCode-48):String.fromCharCode(e.keyCode),n=l.match(/\w/),a=l.match(/[A-Za-z0-9\u00C0-\u024F ]/);if(t.isNullOrUndefined(n)&&t.isNullOrUndefined(a)||(this.isValidKey=!0),this.isBackSpace=8===e.keyCode,this.isValidKey=8===e.keyCode||46===e.keyCode||this.isValidKey,this.isValidKey&&(this.isValidKey=!1,e.keyCode,this.allowFiltering)){var r={preventDefaultAction:!1,text:this.targetElement(),updateData:function(e,t,i){r.cancel||(s.isFiltered=!0,s.remoteFilterAction=!0,s.preventDefActionFilter=r.preventDefaultAction,s.dataUpdater(e,t,i),s.preventDefActionFilter=!1)},event:e,cancel:!1};this.trigger("filtering",r,function(e){s.isDataFetched=!1,e.cancel||""!==s.filterInput.value&&s.isFiltered||(s.preventDefActionFilter=!1,e.cancel||s.isCustomFiltering||e.preventDefaultAction||(s.inputString=s.filterInput.value,s.filteringAction(s.jsonData,new i.Query,s.fields),s.toolbarSettings.items.length>0&&s.updateToolBarState()),s.isFiltered||s.isCustomFiltering||e.preventDefaultAction||s.dataUpdater(s.jsonData,new i.Query,s.fields))})}},l.prototype.filter=function(e,t,i){this.isCustomFiltering=!0,this.filteringAction(e,t,i)},l.prototype.filteringAction=function(e,t,i){this.resetList(e,i,t)},l.prototype.targetElement=function(){return this.targetInputElement=this.list.getElementsByClassName("e-input-filter")[0],t.isNullOrUndefined(this.targetInputElement)?null:this.targetInputElement.value},l.prototype.dataUpdater=function(e,t,i){if(this.isDataFetched=!1,this.targetElement()&&""===this.targetElement().trim()){var s=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.remoteCustomValue=!1,this.isAngular&&this.itemTemplate&&(s=this.renderItems(this.listData,i)),this.onActionComplete(s,this.jsonData),this.notify("reOrder",{module:"CheckBoxSelection",enable:this.selectionSettings.showCheckbox,e:this})}else this.resetList(e,i,t)},l.prototype.focusOutHandler=function(){var e=this.list.getElementsByClassName("e-focused")[0];e&&e.classList.remove("e-focused"),this.allowFiltering&&this.refreshClearIcon()},l.prototype.resizeHandler=function(){!this.list||this.cssClass&&this.cssClass.indexOf("e-horizontal-listbox")>-1||this.list.getElementsByClassName("e-filter-parent").length>0&&this.allowFiltering&&this.ulElement.style.setProperty("height","calc(100% - "+this.filterParent.offsetHeight+"px)","important")},l.prototype.getValidIndex=function(e,t,i){var l=this.ulElement;return(e.classList.contains("e-disabled")||e.classList.contains(s.cssClass.group))&&(40===i||36===i?t++:t--),t<0||t===l.childElementCount?-1:(((e=l.childNodes[t]).classList.contains("e-disabled")||e.classList.contains(s.cssClass.group))&&(t=this.getValidIndex(e,t,i)),t)},l.prototype.updateSelectedOptions=function(){var e=this,i=[],s=[];if(t.extend(s,this.value),this.getSelectedItems().forEach(function(t){t.classList.contains("e-grabbed")||i.push(e.getFormattedValue(t.getAttribute("data-value")))}),this.mainList.childElementCount===this.ulElement.childElementCount)if(this.allowFiltering&&this.selectionSettings.showCheckbox){for(var l=0;l<i.length;l++)s.indexOf(i[l])>-1||s.push(i[l]);this.setProperties({value:s},!0)}else this.setProperties({value:i},!0);this.updateSelectTag(),this.updateToolBarState(),this.tBListBox&&this.tBListBox.updateToolBarState()},l.prototype.clearSelection=function(e){var t=this;if(void 0===e&&(e=this.value),this.selectionSettings.showCheckbox){var i;this.getSelectedItems().forEach(function(s){i=t.getFormattedValue(s.getAttribute("data-value")),e.indexOf(i)<0&&(s.getElementsByClassName("e-check")[0].classList.remove("e-check"),s.removeAttribute("aria-selected"))})}},l.prototype.setSelection=function(e,t,i,l){var n=this;void 0===e&&(e=this.value),void 0===t&&(t=!0),void 0===i&&(i=!1),void 0===l&&(l=!0);var a,r;e&&e.forEach(function(e){var o;if("string"==typeof(o=i?n.getValueByText(e):e))if(-1!==o.indexOf("\n")){var h=CSS.escape(o);a=n.list.querySelector('[data-value="'+h+'"]')}else o=o.split("\\").join("\\\\"),a=n.list.querySelector('[data-value="'+o.replace(/"/g,'\\"')+'"]');else a=n.list.querySelector('[data-value="'+o+'"]');a&&(r=n.selectionSettings.showCheckbox&&!a.classList.contains("e-disabled")?a.getElementsByClassName("e-frame")[0].classList.contains("e-check"):a.classList.contains("e-selected"),(!t&&r||t&&!r&&a)&&(n.selectionSettings.showCheckbox&&!a.classList.contains("e-disabled")?(n.notify("updatelist",{li:a,module:"listbox"}),l&&a.focus()):t&&!a.classList.contains("e-disabled")?(a.classList.add(s.cssClass.selected),a.setAttribute("aria-selected","true"),l&&a.focus()):(a.classList.remove(s.cssClass.selected),a.removeAttribute("aria-selected"))))}),this.updateSelectTag()},l.prototype.updateSelectTag=function(){var e=this.getSelectTag(),i="";if(!t.isNullOrUndefined(e)){if(e.innerHTML="",this.value){for(var s=0,l=this.value.length;s<l;s++)i+="<option selected>"+this.value[s]+"</option>";e.innerHTML+=i;for(var s=0,l=e.childNodes.length;s<l;s++)e.childNodes[s].setAttribute("value",this.value[s].toString())}this.checkSelectAll()}},l.prototype.checkDisabledState=function(e){return t.isNullOrUndefined(e.ulElement)?!(!t.isNullOrUndefined(this.dataSource)&&t.isNullOrUndefined(this.dataSource.length)):e.ulElement.querySelectorAll(".e-disabled").length>0?e.liCollections.length===e.ulElement.querySelectorAll(".e-disabled").length:0===e.ulElement.querySelectorAll("."+s.cssClass.li).length},l.prototype.updateToolBarState=function(){var e=this;if(this.toolbarSettings.items.length){var t=this.getScopedListBox(),i=this.list.parentElement.getElementsByClassName("e-listbox-tool")[0];this.toolbarSettings.items.forEach(function(s){var l=i.querySelector('[data-value="'+s+'"]');switch(s){case"moveAllTo":l.disabled=e.checkDisabledState(e);break;case"moveAllFrom":l.disabled=e.checkDisabledState(t);break;case"moveFrom":l.disabled=!t.value||!t.value.length;break;case"moveUp":l.disabled=!(e.value&&e.value.length&&!e.isSelected(e.ulElement.children[0]));break;case"moveDown":l.disabled=!(e.value&&e.value.length&&!e.isSelected(e.ulElement.children[e.ulElement.childElementCount-1]));break;default:l.disabled=!e.value||!e.value.length}})}},l.prototype.setCheckboxPosition=function(){var e=this.list;this.initLoad||"Left"!==this.selectionSettings.checkboxPosition||e.classList.remove("e-right"),"Right"===this.selectionSettings.checkboxPosition&&e.classList.add("e-right")},l.prototype.showCheckbox=function(e){var i=0,s=this.list.lastElementChild.querySelectorAll("li"),l=this.list.lastElementChild.getElementsByClassName("e-list-item").length;if(e){if(this.ulElement=this.renderItems(this.listData,this.fields),this.mainList=this.ulElement,this.list.removeChild(this.list.getElementsByTagName("ul")[0]),this.list.appendChild(this.ulElement),this.selectionSettings.showSelectAll&&!this.list.getElementsByClassName("e-selectall-parent")[0]){var n=new t.L10n(this.getModuleName(),{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.locale);this.showSelectAll=!0,this.selectAllText=n.getConstant("selectAllText"),this.unSelectAllText=n.getConstant("unSelectAllText"),this.popupWrapper=this.list,this.checkBoxSelectionModule.checkAllParent=null,this.notify("selectAll",{}),this.checkSelectAll()}}else{for(this.list.getElementsByClassName("e-selectall-parent")[0]&&this.list.removeChild(this.list.getElementsByClassName("e-selectall-parent")[0]),i;i<l;i++)s[i].classList.contains("e-list-item")&&s[i].removeChild(s[i].getElementsByClassName("e-checkbox-wrapper")[0]),s[i].hasAttribute("aria-selected")&&s[i].removeAttribute("aria-selected");this.mainList=this.ulElement}this.value=[]},l.prototype.isSelected=function(e){return!t.isNullOrUndefined(e)&&(e.classList.contains(s.cssClass.selected)||null!==e.querySelector(".e-check"))},l.prototype.getSelectTag=function(){return this.list.getElementsByClassName("e-hidden-select")[0]},l.prototype.getToolElem=function(){return this.list.parentElement.getElementsByClassName("e-listbox-tool")[0]},l.prototype.formResetHandler=function(){this.value=this.initialSelectedOptions},l.prototype.getModuleName=function(){return"listbox"},l.prototype.getPersistData=function(){return this.addOnPersist(["value"])},l.prototype.getLocaleName=function(){return"listbox"},l.prototype.destroy=function(){this.unwireEvents(),"EJS-LISTBOX"===this.element.tagName?this.element.innerHTML="":(this.element.style.display="inline-block",this.toolbarSettings.items.length&&(this.list.parentElement.parentElement.insertBefore(this.list,this.list.parentElement),t.detach(this.list.nextElementSibling)),this.list.parentElement.insertBefore(this.element,this.list)),e.prototype.destroy.call(this),this.enableRtlElements=[],this.liCollections=null,this.list=null,this.ulElement=null,this.mainList=null,this.spinner=null,this.rippleFun=null,this.itemTemplate&&this.clearTemplate()},l.prototype.onPropertyChanged=function(i,l){var n=this.toolbarSettings.items.length?this.list.parentElement:this.list;e.prototype.onPropertyChanged.call(this,i,l),this.setUpdateInitial(["fields","query","dataSource"],i);for(var r=0,o=Object.keys(i);r<o.length;r++)switch(o[r]){case"cssClass":l.cssClass&&t.removeClass([n],l.cssClass.split(" ")),i.cssClass&&t.addClass([n],i.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":i.enableRtl?this.list.classList.add("e-rtl"):this.list.classList.remove("e-rtl");break;case"value":t.removeClass(this.list.querySelectorAll("."+s.cssClass.selected),s.cssClass.selected),this.clearSelection(this.value),this.setSelection();break;case"height":this.setHeight();break;case"enabled":this.setEnable();break;case"allowDragAndDrop":i.allowDragAndDrop?this.initDraggable():this.ulElement.classList.contains("e-sortable")&&t.getComponent(this.ulElement,"sortable").destroy();break;case"allowFiltering":this.allowFiltering?this.setFiltering():(this.list.removeChild(this.list.getElementsByClassName("e-filter-parent")[0]),this.filterParent=null,t.removeClass([this.list],"e-filter-list"));break;case"filterBarPlaceholder":this.allowFiltering&&this.filterInput&&a.Input.setPlaceholder(i.filterBarPlaceholder,this.filterInput);break;case"scope":this.allowDragAndDrop&&(t.getComponent(this.ulElement,"sortable").scope=i.scope),this.toolbarSettings.items.length&&(l.scope&&(t.getComponent(document.querySelector(l.scope),this.getModuleName()).tBListBox=null),i.scope&&(t.getComponent(document.querySelector(i.scope),this.getModuleName()).tBListBox=this));break;case"toolbarSettings":var h=void 0,u=i.toolbarSettings.position,p=this.getToolElem();u&&(t.removeClass([n],["e-right","e-left"]),n.classList.add("e-"+u.toLowerCase()),"Left"===u?n.insertBefore(p,this.list):n.appendChild(p)),i.toolbarSettings.items&&(l.toolbarSettings.items=t.isNullOrUndefined(l.toolbarSettings.items)?[]:l.toolbarSettings.items,l.toolbarSettings&&l.toolbarSettings.items.length&&((h=this.list.parentElement).parentElement.insertBefore(this.list,h),t.detach(h)),this.initToolbarAndStyles(),this.wireToolbarEvent());break;case"selectionSettings":var d=i.selectionSettings.showSelectAll,c=i.selectionSettings.showCheckbox;if(!t.isNullOrUndefined(d)){if(this.showSelectAll=d,this.showSelectAll){var m=new t.L10n(this.getModuleName(),{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.locale);this.checkBoxSelectionModule.checkAllParent=null,this.showSelectAll=!0,this.selectAllText=m.getConstant("selectAllText"),this.unSelectAllText=m.getConstant("selectAllText"),this.popupWrapper=this.list}this.notify("selectAll",{}),this.checkSelectAll()}t.isNullOrUndefined(c)||this.showCheckbox(c),this.selectionSettings.showCheckbox&&this.setCheckboxPosition();break;case"dataSource":this.isDataSourceUpdate=!0,this.jsonData=[].slice.call(this.dataSource)}};var o;return xe([t.Property("")],l.prototype,"cssClass",void 0),xe([t.Property([])],l.prototype,"value",void 0),xe([t.Property("")],l.prototype,"height",void 0),xe([t.Property(!0)],l.prototype,"enabled",void 0),xe([t.Property(!1)],l.prototype,"enablePersistence",void 0),xe([t.Property(!1)],l.prototype,"allowDragAndDrop",void 0),xe([t.Property(1e3)],l.prototype,"maximumSelectionLength",void 0),xe([t.Property(!1)],l.prototype,"allowFiltering",void 0),xe([t.Property("")],l.prototype,"scope",void 0),xe([t.Property(!0)],l.prototype,"ignoreCase",void 0),xe([t.Property(null)],l.prototype,"filterBarPlaceholder",void 0),xe([t.Property("None")],l.prototype,"sortOrder",void 0),xe([t.Event()],l.prototype,"beforeItemRender",void 0),xe([t.Event()],l.prototype,"filtering",void 0),xe([t.Event()],l.prototype,"select",void 0),xe([t.Event()],l.prototype,"change",void 0),xe([t.Event()],l.prototype,"beforeDrop",void 0),xe([t.Event()],l.prototype,"dragStart",void 0),xe([t.Event()],l.prototype,"drag",void 0),xe([t.Event()],l.prototype,"drop",void 0),xe([t.Event()],l.prototype,"dataBound",void 0),xe([t.Property(null)],l.prototype,"groupTemplate",void 0),xe([t.Property("Request failed")],l.prototype,"actionFailureTemplate",void 0),xe([t.Property(1e3)],l.prototype,"zIndex",void 0),xe([t.Property(!1)],l.prototype,"ignoreAccent",void 0),xe([t.Complex({},we)],l.prototype,"toolbarSettings",void 0),xe([t.Complex({},Ie)],l.prototype,"selectionSettings",void 0),l=o=xe([t.NotifyPropertyChanges],l)}(U),Ae={backIcon:"e-input-group-icon e-back-icon e-icons",filterBarClearIcon:"e-input-group-icon e-clear-icon e-icons",filterInput:"e-input-filter",filterParent:"e-filter-parent",clearIcon:"e-clear-icon"},De=function(){var e=function(t,i){return(e=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])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),ke=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(l=e[r])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},Ne=function(e){function s(t,i){return e.call(this,t,i)||this}return De(s,e),s.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"minLength":this.minLength=e.minLength;break;case"suffixText":this.suffixText=e.suffixText;break;case"allowSpaces":this.allowSpaces=e.allowSpaces;break;case"mentionChar":this.mentionChar=e.mentionChar;break;case"showMentionChar":this.showMentionChar=e.showMentionChar;break;case"requireLeadingSpace":this.requireLeadingSpace=e.requireLeadingSpace;break;case"cssClass":this.updateCssClass(e.cssClass,t.cssClass)}},s.prototype.updateCssClass=function(e,i){t.isNullOrUndefined(i)||(i=i.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),this.setCssClass(e,[this.inputElement],i),this.popupObj&&this.setCssClass(e,[this.popupObj.element],i)},s.prototype.setCssClass=function(e,i,s){t.isNullOrUndefined(s)||""===s||t.removeClass(i,s.split(" ")),t.isNullOrUndefined(e)||""===e||t.addClass(i,e.split(" "))},s.prototype.initializeData=function(){this.isSelected=!1,this.isFiltered=!1,this.beforePopupOpen=!1,this.initRemoteRender=!1,this.isListResetted=!1,this.isPopupOpen=!1,this.isCollided=!1,this.lineBreak=!1,this.isRTE=!1,this.keyEventName="mousedown"},s.prototype.preRender=function(){this.initializeData(),e.prototype.preRender.call(this)},s.prototype.render=function(){var e="string"==typeof this.target;this.inputElement=t.isNullOrUndefined(this.target)?this.element:this.checkAndUpdateInternalComponent(e?document.querySelector(this.target):this.target),this.isContentEditable(this.inputElement)&&(this.inputElement.hasAttribute("contenteditable")||this.inputElement.setAttribute("contenteditable","true"),t.addClass([this.inputElement],["e-mention"]),t.isNullOrUndefined(this.target)&&t.addClass([this.inputElement],["e-editable-element"])),this.inputElement.setAttribute("role","textbox"),this.inputElement.setAttribute("aria-label","mention"),this.queryString=this.elementValue(),this.wireEvent()},s.prototype.wireEvent=function(){t.EventHandler.add(this.inputElement,"keyup",this.onKeyUp,this),this.bindCommonEvent()},s.prototype.unWireEvent=function(){t.EventHandler.remove(this.inputElement,"keyup",this.onKeyUp),this.unBindCommonEvent()},s.prototype.bindCommonEvent=function(){t.Browser.isDevice||this.inputElement.addEventListener("keydown",this.keyDownHandler.bind(this),!this.isRTE)},s.prototype.hideSpinner=function(){this.hideWaitingSpinner()},s.prototype.hideWaitingSpinner=function(){t.isNullOrUndefined(this.spinnerElement)||n.hideSpinner(this.spinnerElement),t.isNullOrUndefined(this.spinnerTemplate)||t.isNullOrUndefined(this.spinnerTemplateElement)||t.detach(this.spinnerTemplateElement)},s.prototype.checkAndUpdateInternalComponent=function(e){if(!this.isVue&&e.classList.contains("e-richtexteditor"))return e.querySelector(".e-content");if(this.isVue&&"TEXTAREA"===e.nodeName&&e.classList.contains("e-rte-hidden")){var t=e.parentElement;if(t&&t.classList.contains("e-richtexteditor"))return t.querySelector(".e-content")}return e&&e.parentElement&&e.parentElement.classList.contains("e-rte-content")&&(this.isRTE=!0,this.keyEventName="click"),e},s.prototype.showWaitingSpinner=function(){t.isNullOrUndefined(this.popupObj)||(t.isNullOrUndefined(this.spinnerTemplate)&&t.isNullOrUndefined(this.spinnerElement)&&(this.spinnerElement=this.popupObj.element,n.createSpinner({target:this.spinnerElement,width:t.Browser.isDevice?"16px":"14px"},this.createElement),n.showSpinner(this.spinnerElement)),t.isNullOrUndefined(this.spinnerTemplate)||this.setSpinnerTemplate())},s.prototype.keyDownHandler=function(e){var t=!0;switch(e.keyCode){case 38:e.action=e.altKey?"hide":"up";break;case 40:e.action=e.altKey?"open":"down";break;case 33:e.action="pageUp";break;case 34:e.action="pageDown";break;case 36:e.action="home";break;case 35:e.action="end";break;case 9:e.action=e.shiftKey?"close":"tab";break;case 27:e.action="escape";break;case 32:e.action="space";break;case 13:e.action="enter";break;default:t=!1}t&&this.keyActionHandler(e)},s.prototype.keyActionHandler=function(e){var i="down"===e.action||"up"===e.action||"pageUp"===e.action||"pageDown"===e.action||"home"===e.action||"end"===e.action,s="tab"===e.action||"close"===e.action;if(void 0!==this.list||this.isRequested||s||"escape"===e.action||"space"===e.action||this.mentionChar.charCodeAt(0)!==this.getLastLetter(this.getTextRange()).charCodeAt(0)||this.renderList(),!(t.isNullOrUndefined(this.list)||!t.isNullOrUndefined(this.liCollections)&&i&&0===this.liCollections.length||this.isRequested))switch("escape"===e.action&&e.preventDefault(),this.isSelected="escape"!==e.action&&this.isSelected,e.action){case"down":case"up":this.isUpDownKey=!0,this.updateUpDownAction(e);break;case"tab":if(this.isPopupOpen){e.preventDefault();var l=this.list.querySelector("."+H.selected);l&&(this.isSelected=!0,this.setSelection(l,e)),this.isPopupOpen&&this.hidePopup(e)}break;case"enter":this.isPopupOpen&&(e.preventDefault(),this.popupObj&&this.popupObj.element.contains(this.selectedLI)&&this.updateSelectedItem(this.selectedLI,e,!1,!0));break;case"escape":this.isPopupOpen&&this.hidePopup(e)}},s.prototype.updateUpDownAction=function(e){if(!this.fields.disabled||!this.list||0!==this.list.querySelectorAll(".e-list-item:not(.e-disabled)").length){var i=this.list.querySelector("."+H.focus);if(this.isSelectFocusItem(i))this.setSelection(i,e);else if(!t.isNullOrUndefined(this.liCollections)){var s=this.list.querySelector("."+H.selected);if(!t.isNullOrUndefined(s)){var l=this.getFormattedValue(s.getAttribute("data-value"));this.activeIndex=this.getIndexByValue(l)}var n="down"===e.action?this.activeIndex+1:this.activeIndex-1,a=0;a="down"===e.action&&t.isNullOrUndefined(this.activeIndex)?0:this.liCollections.length-1,n=n<0?this.liCollections.length-1:n===this.liCollections.length?0:n;var r=t.isNullOrUndefined(this.activeIndex)?this.liCollections[a]:this.liCollections[n];t.isNullOrUndefined(r)||this.setSelection(r,e)}for(var o,n=0;n<this.liCollections.length;n++)if(this.liCollections[n].classList.contains(H.focus)||this.liCollections[n].classList.contains(H.selected)){o=n;break}null!=o&&this.isDisabledElement(this.liCollections[o])&&this.updateUpDownAction(e),this.isPopupOpen&&e.preventDefault()}},s.prototype.isSelectFocusItem=function(e){return!t.isNullOrUndefined(e)},s.prototype.unBindCommonEvent=function(){t.Browser.isDevice||this.inputElement.removeEventListener("keydown",this.keyDownHandler.bind(this),!this.isRTE)},s.prototype.onKeyUp=function(e){var i;if(this.isUpDownKey&&this.isPopupOpen&&229===e.keyCode)return void(this.isUpDownKey=!1);this.isTyped="Enter"!==e.code&&"Space"!==e.code&&"ArrowDown"!==e.code&&"ArrowUp"!==e.code;var s=!(!document.activeElement.parentElement||!document.activeElement.parentElement.querySelector(".e-rte-image"));document.activeElement===this.inputElement||s||this.inputElement.focus(),this.isContentEditable(this.inputElement)&&(this.range=this.getCurrentRange(),this.range&&(i=this.range.startContainer.textContent.split("")));var l=this.getTextRange(),n=new RegExp(this.mentionChar.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\s"),a=!l||!n.test(l),r=this.getLastLetter(l),o=l?l.charAt(Math.max(0,l.indexOf(this.mentionChar)-1)):"";this.allowSpaces||(a&&l&&l.includes(this.mentionChar)&&""!==l.split(this.mentionChar).pop()&&(!this.requireLeadingSpace||this.requireLeadingSpace&&(" "===o||0===l.indexOf(this.mentionChar)))&&(r=this.mentionChar+l.split(this.mentionChar).pop()),!this.requireLeadingSpace&&r&&r.includes(this.mentionChar)&&(r=this.mentionChar+r.split(this.mentionChar).pop()));var h=this.mentionChar.toString()+this.mentionChar.toString(),u=new RegExp(this.mentionChar.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),p=new RegExp("[a-zA-Z]","g");if("Shift"!==e.key&&37!==e.keyCode&&39!==e.keyCode){if(this.beforePopupOpen&&this.isPopupOpen&&r===h)return void this.hidePopup();if(!l||!r||!r.includes(this.mentionChar)&&!this.requireLeadingSpace&&!this.allowSpaces||"Enter"===e.code||27===e.keyCode||r.match(u)&&r.match(u).length>1||this.isContentEditable(this.inputElement)&&this.range.startContainer&&this.range.startContainer.previousElementSibling&&"BR"!==this.range.startContainer.previousElementSibling.tagName&&this.range.startContainer.textContent.split("").length>0&&(1===i.length||-1===i[i.length-2].indexOf("")||1===this.range.startContainer.nodeType))return void(a&&this.isPopupOpen&&this.allowSpaces&&l&&""!==l.trim()&&p.test(l)&&-1!==l.indexOf(this.mentionChar)&&!this.isMatchedText()&&l.length>1&&" "!==l.replace(/\u00A0/g," ").charAt(l.length-2)&&this.list&&this.list.querySelectorAll("ul").length>0&&"Enter"!==e.code?(this.queryString=l.substring(l.lastIndexOf(this.mentionChar)+1).replace(" "," "),this.searchLists(e)):this.requireLeadingSpace&&(!this.isPopupOpen||this.allowSpaces&&r||"ArrowDown"===e.code||"ArrowUp"===e.code)?"Backspace"!==e.key&&"Delete"!==e.key||!this.range||this.range.startOffset===this.range.endOffset||this.range.deleteContents():(this.hidePopup(),this.lineBreak=!0));r.includes(this.mentionChar)&&(this.queryString=this.requireLeadingSpace?r.replace(this.mentionChar,""):r.substring(r.lastIndexOf(this.mentionChar)+1).trim()),this.mentionChar.charCodeAt(0)!==r.charCodeAt(0)||""===this.queryString||38===e.keyCode||40===e.keyCode||8===e.keyCode||this.lineBreak?(this.requireLeadingSpace?0===r.indexOf(this.mentionChar):r.includes(this.mentionChar))&&!this.isPopupOpen&&8!==e.keyCode&&(!this.popupObj||t.isNullOrUndefined(this.target)&&!document.body.contains(this.popupObj.element)||!t.isNullOrUndefined(this.target)&&document.body.contains(this.popupObj.element))?(this.initRemoteRender&&this.list&&this.list.classList.contains("e-nodata")&&this.searchLists(e),this.resetList(this.dataSource,this.fields),t.isNullOrUndefined(this.list)&&this.initValue(),!this.isPopupOpen&&38!==e.keyCode&&40!==e.keyCode&&this.queryString.length>=this.minLength&&(this.didPopupOpenByTypingInitialChar=!0,this.showPopup(),this.initRemoteRender&&0===this.list.querySelectorAll("li").length&&this.showWaitingSpinner(),this.lineBreak=!1)):this.allowSpaces&&""!==this.queryString&&l&&""!==l.trim()&&l.replace(" "," ").lastIndexOf(" ")<l.length-1&&38!==e.keyCode&&40!==e.keyCode&&8!==e.keyCode&&(this.mentionChar.charCodeAt(0)===r.charCodeAt(0)||this.liCollections&&this.liCollections.length>0)?(this.queryString=l.substring(l.lastIndexOf(this.mentionChar)+1).replace(" "," "),this.searchLists(e)):""===this.queryString&&this.isPopupOpen&&38!==e.keyCode&&40!==e.keyCode&&this.mentionChar.charCodeAt(0)===r.charCodeAt(0)&&(this.searchLists(e),this.isListResetted||this.resetList(this.dataSource,this.fields)):(this.searchLists(e),!this.isPopupOpen&&this.queryString.length>=this.minLength&&(this.isContentEditable(this.inputElement)?this.isContentEditable(this.inputElement)&&this.range&&this.range.startContainer!==this.inputElement&&9!==e.keyCode&&this.showPopup():this.showPopup())),this.isListResetted=!1}},s.prototype.isMatchedText=function(){for(var e=!1,t=0;t<(this.liCollections&&this.liCollections.length);t++)this.getTextRange()&&this.getTextRange().substring(this.getTextRange().lastIndexOf(this.mentionChar)+1).replace(" "," ").trim()===this.liCollections[t].getAttribute("data-value").toLowerCase()&&(e=!0);return e},s.prototype.getCurrentRange=function(){return this.range=this.inputElement.ownerDocument.getSelection().rangeCount>0&&this.inputElement.ownerDocument.getSelection().getRangeAt(0),this.range},s.prototype.performFiltering=function(e){var t=this,i={preventDefaultAction:!1,text:this.queryString,updateData:function(e,s,l){i.cancel||(t.isFiltered=!0,t.filterAction(e,s,l))},cancel:!1};this.trigger("filtering",i,function(e){e.cancel||t.isFiltered||e.preventDefaultAction||t.filterAction(t.dataSource,null,t.fields)})},s.prototype.searchLists=function(i){if(this.isDataFetched=!1,t.isNullOrUndefined(this.list)&&(e.prototype.render.call(this),this.unWireListEvents(),this.wireListEvents()),"mousedown"!==i.type&&(40===i.keyCode||38===i.keyCode))return this.queryString=""===this.queryString?null:this.queryString,this.beforePopupOpen=!0,void this.resetList(this.dataSource,this.fields);this.isSelected=!1,this.activeIndex=null,""!==this.queryString&&this.debounceDelay>0?this.debouncedFiltering(i,this.debounceDelay):this.performFiltering(i)},s.prototype.filterAction=function(e,t,i){this.beforePopupOpen=!0,this.queryString.length>=this.minLength?(this.resetList(e,i,t),this.isListResetted=!0):(this.isPopupOpen&&this.hidePopup(),this.beforePopupOpen=!1),this.setDataIndex(),this.renderReactTemplates()},s.prototype.onActionComplete=function(i,s,l,n){if(e.prototype.onActionComplete.call(this,i,s,l),this.isActive){t.isNullOrUndefined(i)||(t.attributes(i,{id:this.inputElement.id+"_options",role:"listbox","aria-hidden":"false"}),this.isRTE&&this.cssClass&&this.cssClass.indexOf("e-slash-menu")>-1&&(i.id=this.inputElement.id+"_slash_menu_options"));var a=this.fields.disabled?i.querySelector("."+H.li+":not(.e-disabled)"):i.querySelector("."+H.li);if(a){a.classList.add(H.selected),this.selectedLI=a;var r=this.getFormattedValue(a.getAttribute("data-value"));this.selectEventCallback(a,this.getDataByValue(r),r,!0)}this.beforePopupOpen&&this.isPopupOpen&&(t.isNullOrUndefined(this.popupObj.element)||this.popupObj.element.remove(),this.renderPopup())}},s.prototype.setDataIndex=function(){for(var e=0;this.liCollections&&e<this.liCollections.length;e++)this.liCollections[e].setAttribute("data-index",e.toString())},s.prototype.listOption=function(i,s){var l=this,n=e.prototype.listOption.call(this,i,s);if(t.isNullOrUndefined(n.itemCreated))n.itemCreated=function(e){l.highlight&&(l.inputElement.tagName===l.getNgDirective()&&l.itemTemplate?setTimeout(function(){c(e.item,l.queryString,l.ignoreCase,l.filterType)},0):c(e.item,l.queryString,l.ignoreCase,l.filterType))};else{var a=n.itemCreated;n.itemCreated=function(e){l.highlight&&c(e.item,l.queryString,l.ignoreCase,l.filterType),a.apply(l,[e])}}return n},s.prototype.elementValue=function(){return this.isContentEditable(this.inputElement)?this.inputElement.textContent.replace(this.mentionChar,""):this.inputElement.value.replace(this.mentionChar,"")},s.prototype.getQuery=function(e){var s=e?e.clone():this.query?this.query.clone():new i.Query,l=""!==this.queryString||t.isNullOrUndefined(this.elementValue())?this.filterType:"equal",n=""!==this.queryString||t.isNullOrUndefined(this.elementValue())?this.queryString:this.elementValue();if(this.isFiltered)return s;if(null!==this.queryString&&""!==this.queryString){var a=this.typeOfData(this.dataSource).typeof;if((this.dataSource instanceof i.DataManager||"string"!==a)&&"number"!==a){var r=t.isNullOrUndefined(this.fields.text)?"":this.fields.text;s.where(r,l,n,this.ignoreCase,this.ignoreAccent)}else s.where("",l,n,this.ignoreCase,this.ignoreAccent)}if(!t.isNullOrUndefined(this.suggestionCount)){if(25!==this.suggestionCount)for(var o=0;o<s.queries.length;o++)"onTake"===s.queries[o].fn&&s.queries.splice(o,1);s.take(this.suggestionCount)}return s},s.prototype.renderHightSearch=function(){if(this.highlight)for(var e=0;e<this.liCollections.length;e++)this.ulElement.querySelector(".e-active")||(f(this.liCollections[e]),c(this.liCollections[e],this.queryString,this.ignoreCase,this.filterType))},s.prototype.getTextRange=function(){var e;if(this.isContentEditable(this.inputElement)){if(this.range){var i=this.range.startContainer;if(!t.isNullOrUndefined(i)){var s=i.textContent,l=this.range.startOffset;s&&l>=0&&(e=s.substring(0,l))}}}else{var n=this.inputElement;if(!t.isNullOrUndefined(n)){var a=n.selectionStart;n.value&&a>=0&&(e=n.value.substring(0,a))}}return e},s.prototype.getLastLetter=function(e){if(t.isNullOrUndefined(e))return"";var i=(e.indexOf("")>-1?e.replace(/\u200B/g,"").replace(/\u00A0/g," "):e.replace(/\u00A0/g," ")).split(/\s+/);return i[i.length-1].trim()},s.prototype.isContentEditable=function(e){return e&&"INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName},s.prototype.showPopup=function(){this.beforePopupOpen=!0,document.activeElement!==this.inputElement&&this.inputElement.focus(),this.queryString=this.didPopupOpenByTypingInitialChar?this.queryString:"",this.didPopupOpenByTypingInitialChar=!1,this.isContentEditable(this.inputElement)&&(this.range=this.getCurrentRange()),this.isTyped||this.resetList(this.dataSource,this.fields),t.isNullOrUndefined(this.list)&&this.initValue(),this.renderPopup(),t.attributes(this.inputElement,{"aria-activedescendant":this.selectedElementID}),null==this.selectedElementID&&this.inputElement.removeAttribute("aria-activedescendant")},s.prototype.hidePopup=function(e){this.removeSelection(),this.closePopup(0,e)},s.prototype.closePopup=function(e,i){var s=this;if(this.popupObj&&document.body.contains(this.popupObj.element)&&this.beforePopupOpen){t.EventHandler.remove(document,"mousedown",this.onDocumentClick),this.inputElement.removeAttribute("aria-owns"),this.inputElement.removeAttribute("aria-activedescendant"),this.beforePopupOpen=!1;var l={name:"FadeOut",duration:100,delay:e||0},n={popup:this.popupObj,cancel:!1,animation:l,event:i||null};this.trigger("closed",n,function(e){!e.cancel&&s.popupObj&&(s.isPopupOpen?s.popupObj.hide(new t.Animation(e.animation)):s.destroyPopup())})}},s.prototype.renderPopup=function(){var e=this,i={cancel:!1};this.trigger("beforeOpen",i,function(i){if(i.cancel)e.beforePopupOpen=!1;else{var s;if(t.isNullOrUndefined(e.target)?s=e.createElement("div",{id:e.inputElement.id+"_popup",className:"e-mention e-popup "+(null!=e.cssClass?e.cssClass:"")}):(s=e.element,null!=e.cssClass&&t.addClass([s],e.cssClass.split(" "))),e.isRTE&&e.cssClass&&e.cssClass.indexOf("e-slash-menu")>-1?s.id=e.inputElement.id+"_slash_menu_popup":t.isNullOrUndefined(e.target)||(s.id=e.inputElement.id+"_popup"),e.listHeight=t.formatUnit(e.popupHeight),!t.isNullOrUndefined(e.list.querySelector("li"))&&!e.initRemoteRender){var l=e.list.querySelector("."+H.focus);if(!t.isNullOrUndefined(l)){e.selectedLI=l;var a=e.getFormattedValue(l.getAttribute("data-value"));e.selectEventCallback(l,e.getDataByValue(a),a,!0)}}if(t.append([e.list],s),e.inputElement.parentElement){var r=e.inputElement.parentElement.closest(".e-richtexteditor");r&&s.firstElementChild&&s.firstElementChild.childElementCount>0&&(s.firstElementChild.setAttribute("aria-owns",r.id),t.addClass([s],"e-rte-elements"))}e.popupObj&&document.body.contains(e.popupObj.element)&&(document.contains(s)||!t.isNullOrUndefined(e.target))||document.body.appendChild(s);var o;s.style.visibility="hidden",e.setHeight(s);e.initializePopup(s,0,0),e.checkCollision(s),s.style.visibility="visible";var h=s.parentElement.offsetWidth-s.offsetWidth,u=s.offsetHeight;t.addClass([s],["e-mention","e-popup","e-popup-close"]),t.isNullOrUndefined(e.list)||(e.unWireListEvents(),e.wireListEvents()),e.selectedElementID=e.selectedLI?e.selectedLI.id:null,t.attributes(e.inputElement,{"aria-owns":e.inputElement.id+"_options","aria-activedescendant":e.selectedElementID}),null==e.selectedElementID&&e.inputElement.removeAttribute("aria-activedescendant");var p={name:"FadeIn",duration:100};e.beforePopupOpen=!0;var d={popup:e.popupObj,cancel:!1,animation:p};e.trigger("opened",d,function(i){if(i.cancel)e.beforePopupOpen=!1,e.destroyPopup();else{if(e.renderReactTemplates(),e.popupObj&&e.popupObj.show(new t.Animation(i.animation),1e3===e.zIndex?e.inputElement:null),t.isNullOrUndefined(e.getTriggerCharPosition()))return;o=e.getCoordinates(e.inputElement,e.getTriggerCharPosition()),e.isCollided?(e.collision.length>0&&e.collision.indexOf("right")>-1&&-1===e.collision.indexOf("bottom")?s.style.cssText="top: ".concat(o.top.toString(),"px;\n left: ").concat(h.toString(),"px;\nposition: absolute;\n display: block;"):e.collision&&e.collision.length>0&&e.collision.indexOf("bottom")>-1&&-1===e.collision.indexOf("right")?(s.style.left=t.formatUnit(o.left),s.style.top=t.formatUnit(o.top-parseInt(u.toString(),10))):e.collision&&e.collision.length>0&&e.collision.indexOf("bottom")>-1&&e.collision.indexOf("right")>-1?(s.style.left=t.formatUnit(h),s.style.top=t.formatUnit(o.top-parseInt(u.toString(),10))):(s.style.left=t.formatUnit(o.left),s.style.top=t.formatUnit(o.top-parseInt(e.popupHeight.toString(),10))),e.isCollided=!1,e.collision=[]):s.style.cssText="top: ".concat(o.top.toString(),"px;\n left: ").concat(o.left.toString(),"px;\nposition: absolute;\n display: block;"),s.style.width="100%"===e.popupWidth||t.isNullOrUndefined(e.popupWidth)?"auto":t.formatUnit(e.popupWidth),e.setHeight(s),s.style.zIndex=1e3===e.zIndex?n.getZindexPartial(s).toString():e.zIndex.toString()}})}})},s.prototype.setHeight=function(e){"auto"!==this.popupHeight&&this.list?(this.list.style.maxHeight=(parseInt(this.listHeight,10)-2).toString()+"px",e.style.maxHeight=t.formatUnit(this.popupHeight)):e.style.height="auto"},s.prototype.checkCollision=function(e){if(!t.Browser.isDevice||t.Browser.isDevice&&"mention"!==this.getModuleName()){var i=this.getCoordinates(this.inputElement,this.getTriggerCharPosition());this.collision=n.isCollide(e,null,i.left,i.top),this.collision.length>0&&(e.style.marginTop=-parseInt(getComputedStyle(e).marginTop,10)+"px",this.isCollided=!0),this.popupObj.resolveCollision()}},s.prototype.getTriggerCharPosition=function(){var e,t=this.getTextRange();if(void 0!==t&&null!==t){e=0;var i=t.lastIndexOf(this.mentionChar);i>=e&&(e=i)}return e||0},s.prototype.initializePopup=function(e,i,s){var l=this;this.popupObj=new n.Popup(e,{width:this.setWidth(),targetType:"relative",relateTo:this.inputElement,collision:{X:"flip",Y:"flip"},offsetY:i,enableRtl:this.enableRtl,offsetX:s,position:{X:"left",Y:"bottom"},actionOnScroll:"hide",zIndex:this.zIndex,close:function(){l.destroyPopup()},open:function(){t.EventHandler.add(document,"mousedown",l.onDocumentClick,l),l.isPopupOpen=!0,l.setDataIndex()}})},s.prototype.setWidth=function(){var e=t.formatUnit(this.popupWidth);return e.indexOf("%")>-1&&(e=(this.inputElement.offsetWidth*parseFloat(e)/100).toString()+"px"),e},s.prototype.destroyPopup=function(){this.isPopupOpen=!1,this.popupObj.destroy(),t.isNullOrUndefined(this.target)?t.detach(this.popupObj.element):(this.popupObj.element.innerHTML="",this.popupObj.element.removeAttribute("style"),this.popupObj.element.removeAttribute("aria-disabled")),this.list.classList.contains("e-nodata")&&(this.list=null)},s.prototype.onDocumentClick=function(e){var i=e.target;!t.isNullOrUndefined(this.popupObj)&&t.closest(i,"#"+this.popupObj.element.id)||this.hidePopup(e)},s.prototype.getCoordinates=function(e,i){var s,l,n,a,r,o,h,u=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing"];if(this.isContentEditable(this.inputElement)){var p=this.getTriggerCharPosition();a=this.range,n=document.createRange(),this.getTextRange()&&-1!==this.getTextRange().lastIndexOf(this.mentionChar)?(n.setStart(a.startContainer,p),n.setEnd(a.startContainer,p)):(n.setStart(a.startContainer,a.startOffset),n.setEnd(a.startContainer,a.endOffset)),this.isTyped=!1,n.collapse(!1),h=0===n.getBoundingClientRect().top?n.startContainer.getClientRects()[0]:n.getBoundingClientRect()}else s=this.createElement("div",{className:"e-form-mirror-div"}),document.body.appendChild(s),o=getComputedStyle(e),s.style.position="absolute",s.style.visibility="hidden",u.forEach(function(e){s.style[e]=o[e]}),s.textContent=e.value.substring(0,i),"INPUT"===this.inputElement.nodeName&&(s.textContent=s.textContent.replace(/\s/g," ")),(l=this.createElement("span")).textContent=e.value.substring(i)||".",s.appendChild(l),h=e.getBoundingClientRect();var d=h.top,c=h.left,m=document.querySelectorAll("iframe");if(m.length>0)for(S=0;S<m.length;S++){var f=m[S];if(f.contentDocument&&f.contentDocument.contains(e)){var v=f.getBoundingClientRect();d+=v.top,c+=v.left}}var g=document.documentElement,y=(window.pageXOffset||g.scrollLeft)-(g.clientLeft||0),C=(window.pageYOffset||g.scrollTop)-(g.clientTop||0),b=0;if(!t.isNullOrUndefined(n)&&0===n.getBoundingClientRect().top)for(var S=0;S<this.range.startContainer.childNodes.length;S++)if(this.range.startContainer.childNodes[S].nodeType!==Node.TEXT_NODE&&""!==this.range.startContainer.childNodes[S].textContent.trim())b+=this.range.startContainer.childNodes[S].getClientRects()[0].width;else if(""!==this.range.startContainer.childNodes[S].textContent){var E=document.createElement("span");E.innerHTML=this.range.startContainer.childNodes[S].nodeValue,document.body.appendChild(E);var x=E.offsetWidth;document.body.removeChild(E),b+=x}return this.isContentEditable(this.inputElement)?r=this.collision&&this.collision.length>0&&this.collision.indexOf("right")>-1&&-1===this.collision.indexOf("bottom")?{top:d+C+parseInt(getComputedStyle(this.inputElement).fontSize,10),left:c+y+b}:{top:d+C+parseInt(getComputedStyle(this.inputElement).fontSize,10)-(this.isCollided?10:0),left:c+y+b}:(r={top:d+C+l.offsetTop+parseInt(o.borderTopWidth,10)+parseInt(o.fontSize,10)+3-e.scrollTop-(this.isCollided?10:0),left:c+y+l.offsetLeft+parseInt(o.borderLeftWidth,10)},document.body.removeChild(s)),r},s.prototype.initValue=function(){this.isDataFetched=!1,this.renderList(),this.dataSource instanceof i.DataManager?this.initRemoteRender=!0:this.updateValues()},s.prototype.updateValues=function(){var e=this.list.querySelector("."+H.focus);t.isNullOrUndefined(e)||this.setSelection(e,null)},s.prototype.renderList=function(){e.prototype.render.call(this),this.unWireListEvents(),this.wireListEvents()},s.prototype.wireListEvents=function(){t.EventHandler.add(this.list,this.keyEventName,this.onMouseClick,this),t.EventHandler.add(this.list,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.list,"mouseout",this.onMouseLeave,this)},s.prototype.unWireListEvents=function(){t.EventHandler.remove(this.list,this.keyEventName,this.onMouseClick),t.EventHandler.remove(this.list,"mouseover",this.onMouseOver),t.EventHandler.remove(this.list,"mouseout",this.onMouseLeave)},s.prototype.onMouseClick=function(e){var i=e.target,s=t.closest(i,"."+H.li);if(this.isValidLI(s)&&!this.isDisabledElement(s)){this.isSelected=!0,this.setSelection(s,e);this.closePopup(100,e),this.inputElement.focus(),this.isRTE||e.preventDefault()}},s.prototype.updateSelectedItem=function(e,i,s,l){var n=this;this.removeSelection(),e.classList.add(H.selected),this.removeHover();var a=this.getFormattedValue(e.getAttribute("data-value")),r=this.getDataByValue(a);if(s||t.isNullOrUndefined(i)||"down"===i.action||"up"===i.action)this.selectEventCallback(e,r,a),l&&this.setSelectOptions(e,i);else{var o=this.detachChanges(r);this.isSelected=!0;var h={e:i,item:e,itemData:o,isInteracted:!!i,cancel:!1};this.trigger("select",h,function(t){t.cancel?(e.classList.remove(H.selected),n.isSelected=!1,n.isSelectCancel=!0):(n.selectEventCallback(e,r,a),l&&n.setSelectOptions(e,i))})}},s.prototype.setSelection=function(e,t){this.isValidLI(e)&&(!e.classList.contains(H.selected)||this.isPopupOpen&&this.isSelected&&e.classList.contains(H.selected))?this.updateSelectedItem(e,t,!1,!0):this.setSelectOptions(e,t)},s.prototype.setSelectOptions=function(e,i){this.list&&this.removeHover(),this.previousSelectedLI=t.isNullOrUndefined(this.selectedLI)?null:this.selectedLI,this.selectedLI=e,this.isPopupOpen&&!t.isNullOrUndefined(this.selectedLI)&&this.setScrollPosition(i),(!i||38!==i.keyCode&&40!==i.keyCode)&&(t.isNullOrUndefined(i)||this.setValue(i))},s.prototype.setScrollPosition=function(e){if(t.isNullOrUndefined(e))this.scrollBottom(!0);else switch(e.action){case"pageDown":case"down":case"end":this.scrollBottom();break;default:this.scrollTop()}},s.prototype.scrollBottom=function(e){if(!t.isNullOrUndefined(this.selectedLI)){var i=this.list.offsetHeight,s=this.selectedLI.offsetTop+this.selectedLI.offsetHeight-this.list.scrollTop,l=this.list.scrollTop+s-i;l=e?l+2*parseInt(getComputedStyle(this.list).paddingTop,10):l;var n=this.selectedLI.offsetTop+this.selectedLI.offsetHeight-this.list.scrollTop;0===this.activeIndex?this.list.scrollTop=0:(s>i||!(n>0&&this.list.offsetHeight>n))&&(this.list.scrollTop=l)}},s.prototype.scrollTop=function(){if(!t.isNullOrUndefined(this.selectedLI)){var e=t.isNullOrUndefined(this.fields.groupBy)||t.isNullOrUndefined(this.fixedHeaderElement)?this.selectedLI.offsetTop-this.list.scrollTop:this.selectedLI.offsetTop-(this.list.scrollTop+this.fixedHeaderElement.offsetHeight);e=this.fields.groupBy&&e;var i=this.selectedLI.offsetTop+this.selectedLI.offsetHeight-this.list.scrollTop;0===this.activeIndex?this.list.scrollTop=0:e<0?this.list.scrollTop=this.list.scrollTop+e:i>0&&this.list.offsetHeight>i||(this.list.scrollTop=this.selectedLI.offsetTop)}},s.prototype.selectEventCallback=function(e,i,s,l){this.previousItemData=t.isNullOrUndefined(this.itemData)?null:this.itemData,this.item=e,this.itemData=i;var n=this.list.querySelector("."+H.focus);n&&t.removeClass([n],H.focus),l&&t.addClass([e],H.selected),e.setAttribute("aria-selected","true"),this.activeIndex=this.getIndexByValue(s)},s.prototype.detachChanges=function(e){return"string"==typeof e||"boolean"==typeof e||"number"==typeof e?Object.defineProperties({},{value:{value:e,enumerable:!0},text:{value:e,enumerable:!0}}):e},s.prototype.setValue=function(e){return this.isReact?(t.isNullOrUndefined(this.displayTemplate)?this.updateMentionValue(e):this.setDisplayTemplate(e),!0):(t.isNullOrUndefined(this.displayTemplate)||this.setDisplayTemplate(),this.updateMentionValue(e),!0)},s.prototype.updateMentionValue=function(e){var i,s,l,n,a=this.getItemData(),r="string"==typeof this.suffixText?this.suffixText:"",o=this.inputElement.ownerDocument.getSelection(),h=this.getTriggerCharPosition();if(this.isSelectCancel)return void(this.isSelectCancel=!1);if(null!==a.text&&(i=this.mentionVal(a.text)),this.isContentEditable(this.inputElement)){s=this.getTriggerCharPosition()+this.mentionChar.length,this.range&&this.range.startContainer.textContent.trim()!==this.mentionChar&&(s=this.range.endOffset),n=this.range,l=document.createRange(),this.getTextRange()&&-1!==this.getTextRange().lastIndexOf(this.mentionChar)||this.getTextRange()&&this.getTextRange().trim()===this.mentionChar?(l.setStart(n.startContainer,h),l.setEnd(n.startContainer,s)):""!==n.commonAncestorContainer.textContent.trim()&&!t.isNullOrUndefined(n.commonAncestorContainer.textContent.trim())&&this.getTextRange()&&-1!==this.getTextRange().lastIndexOf(this.mentionChar)?(l.setStart(n.startContainer,n.startOffset-1),l.setEnd(n.startContainer,n.endOffset-1)):(l.setStart(n.startContainer,n.startOffset),l.setEnd(n.startContainer,n.endOffset)),this.isTyped=!1,l.deleteContents(),l.startContainer.parentElement.normalize();var u=this.createElement("div");u.innerHTML=i;for(var p=document.createDocumentFragment(),d=void 0,c=void 0;d=u.firstChild;)c=p.appendChild(d);if(l.insertNode(p),c&&(l=l.cloneRange(),this.isRTE&&3===c.nodeType?l.setStart(c,c.textContent.length):l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l)),this.isPopupOpen&&this.hidePopup(),!t.isNullOrUndefined(e.pointerType)&&"mouse"===e.pointerType){var m=new CustomEvent("content-changed",{detail:{click:!0}});this.inputElement.dispatchEvent(m)}this.onChangeEvent(e)}else{var f=this.inputElement,v=this.getTextRange().substring(h+this.mentionChar.length,this.getTextRange().length);i+=r,s=h+this.mentionChar.length,s+=v.length,f.value=f.value.substring(0,h)+i+f.value.substring(s,f.value.length),f.selectionStart=h+i.length,f.selectionEnd=h+i.length,this.isPopupOpen&&this.hidePopup(),this.onChangeEvent(e)}},s.prototype.mentionVal=function(e){var i=this.showMentionChar?this.mentionChar:"";return t.isNullOrUndefined(this.displayTemplate)||t.isNullOrUndefined(this.displayTempElement)||(e=this.displayTempElement.innerHTML),this.isContentEditable(this.inputElement)?t.Browser.isAndroid?'<span contenteditable="true" class="e-mention-chip">'+i+e+"</span>".concat("string"==typeof this.suffixText?this.suffixText:"​"):"mozilla"===t.Browser.info.name?'<span><span contenteditable="false" class="e-mention-chip">'+i+e+"</span></span>".concat("string"==typeof this.suffixText?this.suffixText:"​"):'<span contenteditable="false" class="e-mention-chip">'+i+e+"</span>".concat("string"==typeof this.suffixText?this.suffixText:"​"):i+e},s.prototype.setDisplayTemplate=function(e){var i=this;this.isReact&&(this.clearTemplate(["displayTemplate"]),this.displayTempElement&&(t.detach(this.displayTempElement),this.displayTempElement=null)),this.displayTempElement||(this.displayTempElement=this.createElement("div")),this.isReact||(this.displayTempElement.innerHTML="");var s=t.compile(this.displayTemplate)(this.itemData,this,"displayTemplate",this.displayTemplateId,this.isStringTemplate,null,this.displayTempElement);s&&s.length>0&&t.append(s,this.displayTempElement),this.isReact?this.renderTemplates(function(){i.updateMentionValue(e)}):this.renderTemplates()},s.prototype.renderTemplates=function(e){this.renderReactTemplates(e)},s.prototype.setSpinnerTemplate=function(){var e=this;this.isReact&&(this.clearTemplate(["spinnerTemplate"]),this.spinnerTemplateElement&&(t.detach(this.spinnerTemplateElement),this.spinnerTemplateElement=null)),this.spinnerTemplateElement||(this.spinnerTemplateElement=this.createElement("div")),this.isReact||(this.spinnerTemplateElement.innerHTML="");var i=t.compile(this.spinnerTemplate)(null,this,"spinnerTemplate",this.spinnerTemplateId,this.isStringTemplate,null,this.spinnerTemplateElement);if(i&&i.length>0)for(var s=0;s<i.length;s++)this.spinnerTemplateElement.appendChild(i[s]);this.isReact?this.renderTemplates(function(){e.popupObj.element.appendChild(e.spinnerTemplateElement)}):(this.renderTemplates(),this.popupObj.element.appendChild(this.spinnerTemplateElement))},s.prototype.onChangeEvent=function(e){this.isSelected=!1;var t,i=this.detachMentionChanges(this.itemData);t="string"==typeof this.previousItemData||"boolean"==typeof this.previousItemData||"number"==typeof this.previousItemData?Object.defineProperties({},{value:{value:this.previousItemData,enumerable:!0},text:{value:this.previousItemData,enumerable:!0}}):this.previousItemData;var s={e:e,item:this.item,itemData:i,previousItem:this.previousSelectedLI,previousItemData:t,isInteracted:!!e,value:this.item.innerHTML,element:this.inputElement};this.trigger("change",s)},s.prototype.detachMentionChanges=function(e){return"string"==typeof e||"boolean"==typeof e||"number"==typeof e?Object.defineProperties({},{value:{value:e,enumerable:!0},text:{value:e,enumerable:!0}}):e},s.prototype.getItemData=function(){var e=this.fields,i=null;i=this.itemData;var s,l;return t.isNullOrUndefined(i)||(s=t.getValue(e.value,i),l=t.getValue(e.text,i)),{value:t.isNullOrUndefined(i)||t.isUndefined(s)?i:s,text:t.isNullOrUndefined(i)||t.isUndefined(s)?i:l}},s.prototype.removeSelection=function(){if(this.list){var e=this.list.querySelectorAll("."+H.selected);e.length&&(t.removeClass(e,H.selected),e[0].removeAttribute("aria-selected"))}},s.prototype.onMouseOver=function(e){var i=t.closest(e.target,"."+H.li);this.setHover(i)},s.prototype.setHover=function(e){this.isValidLI(e)&&!e.classList.contains(H.hover)&&(this.removeHover(),t.addClass([e],H.hover))},s.prototype.removeHover=function(){if(this.list){var e=this.list.querySelectorAll("."+H.hover);e&&e.length&&t.removeClass(e,H.hover)}},s.prototype.isValidLI=function(e){return e&&e.hasAttribute("role")&&"option"===e.getAttribute("role")},s.prototype.onMouseLeave=function(){this.removeHover()},s.prototype.search=function(e,i,s){this.isContentEditable(this.inputElement)&&(this.range=this.getCurrentRange());var l=this.getTextRange();this.queryString=e;var n=this.getLastLetter(l);if((!this.ignoreCase||e!==n&&e!==n.toLowerCase())&&(this.ignoreCase||e!==n))return void(this.isPopupOpen&&this.hidePopup());this.resetList(this.dataSource,this.fields),t.isNullOrUndefined(this.list)?(this.renderList(),this.renderPopup()):this.isPopupOpen||this.renderPopup(),this.popupObj.element.style.left=t.formatUnit(i),this.popupObj.element.style.top=t.formatUnit(s)},s.prototype.disableItem=function(e){if(this.fields.disabled){this.list||this.renderList();var t=-1;if(this.liCollections&&this.liCollections.length>0&&this.listData&&this.fields.disabled){if("string"==typeof e)t=this.getIndexByValue(e);else if("object"==typeof e){if(e instanceof HTMLLIElement){for(s=0;s<this.liCollections.length;s++)if(this.liCollections[s]===e){t=this.getIndexByValue(e.getAttribute("data-value"));break}}else for(var i=JSON.parse(JSON.stringify(e))[this.fields.value],s=0;s<this.listData.length;s++)if(JSON.parse(JSON.stringify(this.listData[s]))[this.fields.value]===i){t=this.getIndexByValue(i);break}}else t=e;if(t<this.liCollections.length&&t>-1&&!JSON.parse(JSON.stringify(this.listData[t]))[this.fields.disabled]){var l=this.liCollections[t];if(l){this.disableListItem(l);var n=JSON.parse(JSON.stringify(this.listData[t]));n[this.fields.disabled]=!0,this.listData[t]=n,this.dataSource=this.listData}}}}},s.prototype.destroy=function(){this.hidePopup(),this.unWireEvent(),this.list&&this.unWireListEvents(),this.inputElement&&!this.inputElement.classList.contains("e-"+this.getModuleName())||(this.previousSelectedLI=null,this.item=null,this.selectedLI=null,this.popupObj=null,e.prototype.destroy.call(this))},s.prototype.getLocaleName=function(){return"mention"},s.prototype.getNgDirective=function(){return"EJS-MENTION"},s.prototype.getModuleName=function(){return"mention"},ke([t.Property(null)],s.prototype,"cssClass",void 0),ke([t.Property("@")],s.prototype,"mentionChar",void 0),ke([t.Property(!1)],s.prototype,"showMentionChar",void 0),ke([t.Property(!1)],s.prototype,"allowSpaces",void 0),ke([t.Property(null)],s.prototype,"suffixText",void 0),ke([t.Property(25)],s.prototype,"suggestionCount",void 0),ke([t.Property(0)],s.prototype,"minLength",void 0),ke([t.Property("None")],s.prototype,"sortOrder",void 0),ke([t.Property(!0)],s.prototype,"ignoreCase",void 0),ke([t.Property(!0)],s.prototype,"requireLeadingSpace",void 0),ke([t.Property(!1)],s.prototype,"highlight",void 0),ke([t.Property()],s.prototype,"locale",void 0),ke([t.Property("auto")],s.prototype,"popupWidth",void 0),ke([t.Property("300px")],s.prototype,"popupHeight",void 0),ke([t.Property(300)],s.prototype,"debounceDelay",void 0),ke([t.Property(null)],s.prototype,"displayTemplate",void 0),ke([t.Property(null)],s.prototype,"itemTemplate",void 0),ke([t.Property("No records found")],s.prototype,"noRecordsTemplate",void 0),ke([t.Property(null)],s.prototype,"spinnerTemplate",void 0),ke([t.Property()],s.prototype,"target",void 0),ke([t.Property([])],s.prototype,"dataSource",void 0),ke([t.Property(null)],s.prototype,"query",void 0),ke([t.Property("Contains")],s.prototype,"filterType",void 0),ke([t.Complex({text:null,value:null,iconCss:null,groupBy:null},P)],s.prototype,"fields",void 0),ke([t.Event()],s.prototype,"actionBegin",void 0),ke([t.Event()],s.prototype,"actionComplete",void 0),ke([t.Event()],s.prototype,"actionFailure",void 0),ke([t.Event()],s.prototype,"change",void 0),ke([t.Event()],s.prototype,"beforeOpen",void 0),ke([t.Event()],s.prototype,"opened",void 0),ke([t.Event()],s.prototype,"closed",void 0),ke([t.Event()],s.prototype,"select",void 0),ke([t.Event()],s.prototype,"filtering",void 0),ke([t.Event()],s.prototype,"created",void 0),ke([t.Event()],s.prototype,"destroyed",void 0),s=ke([t.NotifyPropertyChanges],s)}(U);return j.Inject(T),ae.Inject(T),he.Inject(T),be.Inject(Se,T),Oe.Inject(Se),e.AutoComplete=he,e.CheckBoxSelection=Se,e.ComboBox=ae,e.DropDownBase=U,e.DropDownList=j,e.DropDownTree=ie,e.FieldSettings=P,e.Fields=ee,e.ListBox=Oe,e.Mention=Ne,e.MultiSelect=be,e.Search=u,e.SelectionSettings=Ie,e.ToolbarSettings=we,e.TreeSettings=te,e.VirtualScroll=T,e.createFloatLabel=v,e.dropDownBaseClasses=H,e.dropDownListClasses=q,e.encodePlaceholder=E,e.escapeCharRegExp=p,e.floatLabelBlur=S,e.floatLabelFocus=b,e.highlightSearch=c,e.incrementalSearch=h,e.removeFloating=y,e.resetIncrementalSearchValues=d,e.revertHighlightSearch=f,e.setPlaceHolder=C,e.updateFloatLabelState=g,e}({},ej.base,ej.data,ej.lists,ej.notifications,ej.popups,ej.inputs,ej.buttons,ej.navigations),this.ejs=ej;
|
|
11
11
|
//# sourceMappingURL=ej2-dropdowns.min.js.map
|