@syncfusion/ej2-inputs 34.2.7 → 34.2.8

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.
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * filename: ej2-inputs.umd.min.js
3
- * version : 34.2.7
3
+ * version : 34.2.8
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
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-splitbuttons"),require("@syncfusion/ej2-buttons")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-popups","@syncfusion/ej2-splitbuttons","@syncfusion/ej2-buttons"],e):e((t=t||self).ej={},t.ej2Base,t.ej2Popups,t.ej2Splitbuttons,t.ej2Buttons)}(this,function(o,E,h,I,F){"use strict";var n,V,M,p={RTL:"e-rtl",DISABLE:"e-disabled",INPUT:"e-input",TEXTAREA:"e-multi-line-input",INPUTGROUP:"e-input-group",FLOATINPUT:"e-float-input",FLOATLINE:"e-float-line",FLOATTEXT:"e-float-text",FLOATTEXTCONTENT:"e-float-text-content",CLEARICON:"e-clear-icon",CLEARICONHIDE:"e-clear-icon-hide",LABELTOP:"e-label-top",LABELBOTTOM:"e-label-bottom",NOFLOATLABEL:"e-no-float-label",INPUTCUSTOMTAG:"e-input-custom-tag",FLOATCUSTOMTAG:"e-float-custom-tag"},D=["title","style","class"],W="e-input-focus";function z(i){q(i.floatLabelType,i.element);function t(){var t,e;((e=Q((t=i).element)).classList.contains("e-input-group")||e.classList.contains("e-outline")||e.classList.contains("e-filled"))&&e.classList.add("e-input-focus"),"Never"!==t.floatLabelType&&setTimeout(function(){n.calculateWidth(t.element,e)},80)}function e(){var t,e;((e=Q((t=i).element)).classList.contains("e-input-group")||e.classList.contains("e-outline")||e.classList.contains("e-filled"))&&e.classList.remove("e-input-focus"),"Never"!==t.floatLabelType&&setTimeout(function(){n.calculateWidth(t.element,e)},80)}function s(){q(i.floatLabelType,i.element)}i.element.addEventListener("focus",t),i.element.addEventListener("blur",e),i.element.addEventListener("input",s),i.element.__eventHandlers.inputFocusHandler=t,i.element.__eventHandlers.inputBlurHandler=e,i.element.__eventHandlers.inputHandler=s}function q(t,e){var i=e.value,e=e.parentElement,s=e&&e.parentElement;""===i||E.isNullOrUndefined(i)?"Always"!==t&&(e&&e.classList.contains("e-input-group")?e.classList.remove("e-valid-input"):s&&s.classList.contains("e-input-group")&&s.classList.remove("e-valid-input")):e&&e.classList.contains("e-input-group")?e.classList.add("e-valid-input"):s&&s.classList.contains("e-input-group")&&s.classList.add("e-valid-input")}function j(){var t=Q(this).getElementsByClassName("e-float-text")[0];E.isNullOrUndefined(t)||(E.addClass([t],p.LABELTOP),t.classList.contains(p.LABELBOTTOM)&&E.removeClass([t],p.LABELBOTTOM))}function _(){var t=Q(this);(t.getElementsByTagName("textarea")[0]?""===t.getElementsByTagName("textarea")[0].value:""===t.getElementsByTagName("input")[0].value)&&(t=t.getElementsByClassName("e-float-text")[0],E.isNullOrUndefined(t)||(t.classList.contains(p.LABELTOP)&&E.removeClass([t],p.LABELTOP),E.addClass([t],p.LABELBOTTOM)))}function X(t){t.addEventListener("focus",j),t.addEventListener("blur",_)}function K(t){E.isNullOrUndefined(t)||(t.removeEventListener("focus",j),t.removeEventListener("blur",_))}function Y(t,e,i){var s,i=E.isNullOrUndefined(i)?E.createElement:i,n=("Auto"===t.floatLabelType&&X(t.element),E.isNullOrUndefined(e.container)?(e.container=it(t,p.FLOATINPUT,p.FLOATCUSTOMTAG,"div",i),e.container.classList.add(p.INPUTGROUP),t.element.parentNode&&t.element.parentNode.insertBefore(e.container,t.element)):(E.isNullOrUndefined(t.customTag)||e.container.classList.add(p.FLOATCUSTOMTAG),e.container.classList.add(p.FLOATINPUT)),i("span",{className:p.FLOATLINE})),i=i("label",{className:p.FLOATTEXT});E.isNullOrUndefined(t.element.id)||""===t.element.id||(i.id="label_"+t.element.id.replace(/ /g,"_"),E.attributes(t.element,{"aria-labelledby":i.id})),E.isNullOrUndefined(t.element.placeholder)||""===t.element.placeholder||(i.innerText=st(t.element.placeholder),t.element.removeAttribute("placeholder")),E.isNullOrUndefined(t.properties)||E.isNullOrUndefined(t.properties.placeholder)||""===t.properties.placeholder||(i.innerText=st(t.properties.placeholder)),i.innerText||e.container.classList.add(p.NOFLOATLABEL),(e.container.classList.contains("e-float-icon-left")?((s=e.container.querySelector(".e-input-in-wrap")).appendChild(t.element),s.appendChild(n),s):(e.container.appendChild(t.element),e.container.appendChild(n),e.container)).appendChild(i),$(t.element.value,i),"Always"===t.floatLabelType&&(i.classList.contains(p.LABELBOTTOM)&&E.removeClass([i],p.LABELBOTTOM),E.addClass([i],p.LABELTOP)),"Auto"===t.floatLabelType?(s=function(){et(t.element,t.floatLabelType)},t.element.addEventListener("input",n=function(){et(t.element,t.floatLabelType)}),t.element.addEventListener("blur",s),t.element.__eventHandlers.floatInputHandler=n,t.element.__eventHandlers.floatBlurHandler=s):Z(t),E.isNullOrUndefined(t.element.getAttribute("id"))||i.setAttribute("for",t.element.getAttribute("id"))}function Z(t){var e,i;E.isNullOrUndefined(t.element)||E.isNullOrUndefined(t.element.__eventHandlers)||E.isNullOrUndefined(t.element.__eventHandlers.floatInputHandler)||E.isNullOrUndefined(t.element.__eventHandlers.floatBlurHandler)||(e=t.element.__eventHandlers.floatInputHandler,i=t.element.__eventHandlers.floatBlurHandler,t.element.removeEventListener("input",e),t.element.removeEventListener("blur",i),t.element.__eventHandlers.floatInputHandler=null,t.element.__eventHandlers.floatBlurHandler=null)}function G(t,e){"Always"===t&&e.classList.contains("e-outline")&&e.classList.add("e-valid-input")}function J(t,e,i){E.isNullOrUndefined(e)||(t&&!i?E.removeClass([e],p.CLEARICONHIDE):E.addClass([e],p.CLEARICONHIDE))}function $(t,e,i){void 0===i&&(i=null),t?(E.addClass([e],p.LABELTOP),e.classList.contains(p.LABELBOTTOM)&&E.removeClass([e],p.LABELBOTTOM)):null!=i&&i===document.activeElement||(e.classList.contains(p.LABELTOP)&&E.removeClass([e],p.LABELTOP),E.addClass([e],p.LABELBOTTOM))}function Q(t){t=E.isNullOrUndefined(t.parentNode)?t:t.parentNode;return t=t&&t.classList.contains("e-input-in-wrap")?t.parentNode:t}function tt(s,n,t){function e(){J(s.value,n)}function i(){J(s.value,n,s.readOnly)}function a(){var t,e;t=s,e=n,setTimeout(function(){E.isNullOrUndefined(e)||(E.addClass([e],p.CLEARICONHIDE),e=!E.isNullOrUndefined(t)&&t.classList.contains("e-combobox")?null:e)},200)}var l;void 0!==V&&!V||(n.addEventListener("click",l=function(t){var e,i;t=t,i=n,(e=s).classList.contains(p.DISABLE)||e.readOnly||(t.preventDefault(),e!==document.activeElement&&e.focus(),e.value="",E.addClass([i],p.CLEARICONHIDE))}),s.__eventHandlers.clearClickHandler=l);s.addEventListener("input",e),s.addEventListener("focus",i),s.addEventListener("blur",a),s.__eventHandlers.clearInputHandler=e,s.__eventHandlers.clearFocusHandler=i,s.__eventHandlers.clearBlurHandler=a}function et(t,e){Q(t).classList.contains(p.FLOATINPUT)&&"Auto"===e&&(e=Q(t).getElementsByClassName("e-float-text")[0],$(t.value,e,t))}function it(t,e,i,s,n){var a,n=E.isNullOrUndefined(n)?E.createElement:n;return E.isNullOrUndefined(t.customTag)?a=n(s,{className:e}):(a=n(t.customTag,{className:e})).classList.add(i),a.classList.add("e-control-wrapper"),a}function st(t){var e;return null==t||""===t?"":(e={"&amp;":"&","&quot;":'"',"&#39;":"'","&lt;":"<","&gt;":">","&eacute;":"é"},t.replace(/&[a-zA-Z#0-9]+;/g,function(t){return e[t]||t}))}function nt(t,e,i){E.isNullOrUndefined(i)||""===i||E.removeClass(e,i.split(" ")),E.isNullOrUndefined(t)||""===t||E.addClass(e,t.split(" "))}function at(t,e,i){var s,n,a,l;"multiselect"!==i&&t&&e&&!M.has(t)&&(M.set(t,s=function(){document.documentElement.contains(e)?at(t,e,i):(window.removeEventListener("resize",s),M.delete(t))}),window.addEventListener("resize",s)),("multiselect"===i||function(t){if(!t)return;var e=t;for(;e&&e!==document.body;){if("none"===window.getComputedStyle(e).display)return;e=e.parentElement}return 1}(t))&&(n="multiselect"===i?t:t.clientWidth-parseInt(getComputedStyle(t,null).getPropertyValue("padding-left"),10),"multiselect"!==i&&t&&e&&(a=0,l=e.getElementsByClassName("e-input-group-icon"),Array.from(l).forEach(function(t){a+=t.clientWidth+parseInt(getComputedStyle(t,null).getPropertyValue("margin-right"),10)}),n+=a-parseInt(getComputedStyle(t,null).getPropertyValue("padding-left"),10)),!E.isNullOrUndefined(e))&&!E.isNullOrUndefined(e.getElementsByClassName("e-float-text-content")[0])&&(e.getElementsByClassName("e-float-text-content")[0].classList.contains("e-float-text-overflow")&&e.getElementsByClassName("e-float-text-content")[0].classList.remove("e-float-text-overflow"),n<e.getElementsByClassName("e-float-text-content")[0].clientWidth||n===e.getElementsByClassName("e-float-text-content")[0].clientWidth)&&e.getElementsByClassName("e-float-text-content")[0].classList.add("e-float-text-overflow")}function lt(t,e,i){t=st(t);var s,n,a=Q(e);a.classList.contains(p.FLOATINPUT)?E.isNullOrUndefined(t)||""===t?(a.classList.add(p.NOFLOATLABEL),(s=a.getElementsByClassName("e-float-text-content")[0])&&s.children[0]?s.children[0].textContent="":(n=a.getElementsByClassName(p.FLOATTEXT)[0],E.isNullOrUndefined(n)||(n.textContent=""))):((s=a.getElementsByClassName("e-float-text-content")[0])&&s.children[0]?s.children[0].textContent=t:-1!==["textbox","numerictextbox","textarea","combobox","datepicker","daterangepicker","datetimepicker","maskedtextbox"].indexOf(i)&&s?s.textContent=t:(n=a.getElementsByClassName(p.FLOATTEXT)[0],E.isNullOrUndefined(n)||(n.textContent=t)),a.classList.remove(p.NOFLOATLABEL),e.removeAttribute("placeholder")):E.isNullOrUndefined(t)||""===t?e.removeAttribute("placeholder"):E.attributes(e,{placeholder:t})}function rt(t,e,i){t?E.attributes(e,{readonly:""}):e.removeAttribute("readonly"),E.isNullOrUndefined(i)||et(e,i)}function ot(t,e){t?E.addClass(e,p.RTL):E.removeClass(e,p.RTL)}function ht(t,e,i,s){var n={disabled:"","aria-disabled":"true"},a=!E.isNullOrUndefined(s);t?(e.classList.remove(p.DISABLE),dt(n,e),a&&E.removeClass([s],p.DISABLE)):(e.classList.add(p.DISABLE),ut(n,e),a&&E.addClass([s],p.DISABLE)),E.isNullOrUndefined(i)||et(e,i)}function pt(t,e,i,s,n){var a,n=E.isNullOrUndefined(n)?E.createElement:n;t?i.clearButton=(t=e,e=i,s=s,n=n,n=(E.isNullOrUndefined(n)?E.createElement:n)("span",{className:p.CLEARICON}),a=e.container,E.isNullOrUndefined(s)?(e.container.classList.contains(p.FLOATINPUT)?e.container.querySelector("."+p.FLOATTEXT):t).insertAdjacentElement("afterend",n):a.appendChild(n),E.addClass([n],p.CLEARICONHIDE),tt(t,n),n.setAttribute("aria-label","close"),n):(E.remove(i.clearButton),i.clearButton=null)}function dt(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i],a=Q(e);"disabled"===n&&e.classList.remove(p.DISABLE),"disabled"===n&&a.classList.contains(p.INPUTGROUP)&&a.classList.remove(p.DISABLE),"placeholder"===n&&a.classList.contains(p.FLOATINPUT)?a.getElementsByClassName(p.FLOATTEXT)[0].textContent="":e.removeAttribute(n)}}function ut(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i],a=Q(e);"disabled"===n&&e.classList.add(p.DISABLE),"disabled"===n&&a.classList.contains(p.INPUTGROUP)&&a.classList.add(p.DISABLE),"placeholder"===n&&a.classList.contains(p.FLOATINPUT)?a.getElementsByClassName(p.FLOATTEXT)[0].textContent=t[""+n]:e.setAttribute(n,t[""+n])}}function ct(t,e){t.classList.contains("e-outline")&&t.getElementsByClassName("e-float-text")[0]&&((e=e("span",{className:p.FLOATTEXTCONTENT})).innerHTML=t.getElementsByClassName("e-float-text")[0].innerHTML,t.getElementsByClassName("e-float-text")[0].innerHTML="",t.getElementsByClassName("e-float-text")[0].appendChild(e))}function mt(t,e,i){var s=[],n=(s.push(i),E.isNullOrUndefined(i)?e.querySelectorAll(".e-input-group-icon"):s);if(t&&0<n.length)for(var a=0;a<n.length;a++)n[parseInt(a.toString(),10)].addEventListener("mousedown",ft,!1),n[parseInt(a.toString(),10)].addEventListener("mouseup",vt,!1);else if(0<n.length)for(a=0;a<n.length;a++)n[parseInt(a.toString(),10)].removeEventListener("mousedown",ft,this),n[parseInt(a.toString(),10)].removeEventListener("mouseup",vt,this)}function ft(){for(var t,e,i=this.parentElement;!i.classList.contains("e-input-group");)i=i.parentElement;e=this,(t=i).classList.contains("e-disabled")||t.querySelector("input").readOnly||e.classList.add("e-input-btn-ripple")}function vt(){var t=this;setTimeout(function(){t.classList.remove("e-input-btn-ripple")},500)}function gt(t,e){e=e("span",{className:t});return e.classList.add("e-input-group-icon"),e}function yt(t,e,i,s){var s=E.isNullOrUndefined(s)?E.createElement:s,t=gt(t,s),n=(e.classList.add("e-float-icon-left"),e.querySelector(".e-input-in-wrap"));if(E.isNullOrUndefined(n)){n=s("span",{className:"e-input-in-wrap"}),i.parentNode.insertBefore(n,i);var a=e.querySelectorAll(i.tagName+" ~ *");n.appendChild(i);for(var l=0;l<a.length;l++){var r=a[parseInt(l.toString(),10)],o=n.parentElement;r.classList.contains("e-float-line")&&(o&&o.classList.contains("e-filled")||!o)||n.appendChild(r)}}return n.parentNode.insertBefore(t,n),mt(!0,e,t),t}function bt(t,e,i){t=gt(t,E.isNullOrUndefined(i)?E.createElement:i);return(e.classList.contains("e-float-icon-left")?e.querySelector(".e-input-in-wrap"):e).appendChild(t),mt(!0,e,t),t}function Ct(t,e){"hidden"===e.type?t.classList.add("e-hidden"):t.classList.contains("e-hidden")&&t.classList.remove("e-hidden")}function Et(t){var e=t;return e=E.isNullOrUndefined(t)||""===t?e:t.replace(/\s+/g," ").trim()}n=o.Input||(o.Input={}),V=!0,M=new Map,n.createInput=function(t,e){t.element.__eventHandlers={};var i=E.isNullOrUndefined(e)?E.createElement:e,s={container:null,buttons:[],clearButton:null};if(t.floatLabelType,V=t.bindClearAction,E.isNullOrUndefined(t.floatLabelType)||"Never"===t.floatLabelType?(s.container=it(t,p.INPUTGROUP,p.INPUTCUSTOMTAG,"span",i),t.element.parentNode.insertBefore(s.container,t.element),E.addClass([t.element],p.INPUT),s.container.appendChild(t.element)):Y(t,s,i),z(t),E.isNullOrUndefined(t.properties)||E.isNullOrUndefined(t.properties.showClearButton)||!t.properties.showClearButton||(pt(t.properties.showClearButton,t.element,s,!0,i),s.clearButton.setAttribute("role","button"),s.container.classList.contains(p.FLOATINPUT)&&E.addClass([s.container],p.INPUTGROUP)),!E.isNullOrUndefined(t.buttons))for(var n=0;n<t.buttons.length;n++)s.buttons.push(bt(t.buttons[n],s.container,i));return E.isNullOrUndefined(t.element)||"TEXTAREA"!==t.element.tagName||E.addClass([s.container],p.TEXTAREA),Ct(s.container,t.element),ct((s=function(t,e){if(!E.isNullOrUndefined(t.properties))for(var i=0,s=Object.keys(t.properties);i<s.length;i++)switch(s[i]){case"cssClass":nt(t.properties.cssClass,[e.container]),G(t.floatLabelType,e.container);break;case"enabled":ht(t.properties.enabled,t.element,t.floatLabelType,e.container);break;case"enableRtl":ot(t.properties.enableRtl,[e.container]);break;case"placeholder":lt(t.properties.placeholder,t.element);break;case"readonly":rt(t.properties.readonly,t.element)}return e}(t,s)).container,i),s},n.bindInitialEvent=z,n.wireFloatingEvents=X,n.wireClearBtnEvents=tt,n.destroy=function(t,e){void 0===e&&(e=null),l=t,E.isNullOrUndefined(l.element)||E.isNullOrUndefined(l.element.__eventHandlers)||E.isNullOrUndefined(l.element.__eventHandlers.inputFocusHandler)||E.isNullOrUndefined(l.element.__eventHandlers.inputBlurHandler)||E.isNullOrUndefined(l.element.__eventHandlers.inputHandler)||(i=l.element.__eventHandlers.inputFocusHandler,s=l.element.__eventHandlers.inputBlurHandler,a=l.element.__eventHandlers.inputHandler,l.element.removeEventListener("focus",i),l.element.removeEventListener("blur",s),l.element.removeEventListener("input",a),l.element.__eventHandlers.inputFocusHandler=null,l.element.__eventHandlers.inputBlurHandler=null,l.element.__eventHandlers.inputHandler=null),"Auto"===t.floatLabelType&&Z(t),t.properties.showClearButton&&(i=t.element,s=e,E.isNullOrUndefined(i)||E.isNullOrUndefined(i.__eventHandlers)||(E.isNullOrUndefined(i.__eventHandlers.clearClickHandler)||(n=i.__eventHandlers.clearClickHandler,void 0!==V&&!V||E.isNullOrUndefined(s)||s.removeEventListener("click",n),i.__eventHandlers.clearClickHandler=null),E.isNullOrUndefined(i.__eventHandlers.clearInputHandler))||E.isNullOrUndefined(i.__eventHandlers.clearFocusHandler)||E.isNullOrUndefined(i.__eventHandlers.clearBlurHandler)||(s=i.__eventHandlers.clearInputHandler,n=i.__eventHandlers.clearFocusHandler,a=i.__eventHandlers.clearBlurHandler,i.removeEventListener("input",s),i.removeEventListener("focus",n),i.removeEventListener("blur",a),i.__eventHandlers.clearInputHandler=null,i.__eventHandlers.clearFocusHandler=null,i.__eventHandlers.clearBlurHandler=null)),E.isNullOrUndefined(t.buttons)||mt(!1,null,t.buttons),K(t.element);var i,s,n,a,l=M.get(t.element);l&&(window.removeEventListener("resize",l),M.delete(t.element)),E.isNullOrUndefined(t.element)||(delete t.element.__eventHandlers,t.element.classList.contains(p.INPUT)&&t.element.classList.remove(p.INPUT))},n.setValue=function(t,e,i,s){e.value=t,"Never"!==i&&at(e,e.parentElement),E.isNullOrUndefined(i)||"Auto"!==i||et(e,i),!E.isNullOrUndefined(s)&&s&&(t=Q(e),E.isNullOrUndefined(t)||(s=t.getElementsByClassName(p.CLEARICON)[0],E.isNullOrUndefined(s))||(e.value&&!E.isNullOrUndefined(t)&&t.classList.contains("e-input-focus")?E.removeClass([s],p.CLEARICONHIDE):E.addClass([s],p.CLEARICONHIDE))),q(i,e)},n.setCssClass=nt,n.calculateWidth=at,n.setWidth=function(t,e){"number"==typeof t?e.style.width=E.formatUnit(t):"string"==typeof t&&(e.style.width=t.match(/px|%|em/)?t:E.formatUnit(t)),at(e.firstChild,e)},n.setPlaceholder=lt,n.setReadonly=rt,n.setEnableRtl=ot,n.setEnabled=ht,n.setClearButton=pt,n.removeAttributes=dt,n.addAttributes=ut,n.removeFloating=function(t){var e,i,s,t=t.container;!E.isNullOrUndefined(t)&&t.classList.contains(p.FLOATINPUT)&&(e=t.querySelector("textarea")?t.querySelector("textarea"):t.querySelector("input"),i=t.querySelector("."+p.FLOATTEXT).textContent,s=null!==t.querySelector(".e-clear-icon"),E.detach(t.querySelector("."+p.FLOATLINE)),E.detach(t.querySelector("."+p.FLOATTEXT)),E.classList(t,[p.INPUTGROUP],[p.FLOATINPUT]),K(e),E.attributes(e,{placeholder:i}),e.classList.add(p.INPUT),s||"INPUT"!==e.tagName||e.removeAttribute("required"))},n.addFloating=function(t,e,i,s){var n,a,s=E.isNullOrUndefined(s)?E.createElement:s,l=E.closest(t,"."+p.INPUTGROUP),r=l.tagName,r={element:t,floatLabelType:e,customTag:"DIV"!==r&&"SPAN"!==r?r:null,properties:{placeholder:i}};"Never"!==e?(i=l.querySelector(".e-clear-icon"),n={container:l},t.classList.remove(p.INPUT),Y(r,n,s),ct(n.container,s),at(r.element,n.container),s=l.classList.contains("e-float-icon-left"),E.isNullOrUndefined(i)&&(i=(s?l.querySelector(".e-input-in-wrap"):l).querySelector(".e-input-group-icon")),E.isNullOrUndefined(i)?s&&(i=l.querySelector(".e-input-group-icon")):(n=l.querySelector("."+p.FLOATLINE),a=l.querySelector("."+p.FLOATTEXT),(s=s?l.querySelector(".e-input-in-wrap"):l).insertBefore(t,i),s.insertBefore(n,i),s.insertBefore(a,i))):Z(r),G(e,t.parentElement)},n.createSpanElement=ct,n.setRipple=function(t,e){for(var i=0;i<e.length;i++)mt(t,e[parseInt(i.toString(),10)].container)},n.addIcon=function(t,e,i,s,n){if(e="string"==typeof e?e.split(","):e,"append"===t.toLowerCase())for(var a=0,l=e;a<l.length;a++)bt(l[a],i,n);else for(var r=0,o=e;r<o.length;r++)yt(o[r],i,s,n);i.getElementsByClassName("e-input-group-icon")[0]&&i.getElementsByClassName("e-float-text-overflow")[0]&&i.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon")},n.prependSpan=yt,n.appendSpan=bt,n.validateInputType=Ct,n.updateHTMLAttributesToElement=function(t,e){if(!E.isNullOrUndefined(t))for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i];D.indexOf(n)<0&&e.setAttribute(n,t[""+n])}},n.updateCssClass=function(t,e,i){nt(Et(t),[i],Et(e))},n.getInputValidClassList=Et,n.updateHTMLAttributesToWrapper=function(t,e){if(!E.isNullOrUndefined(t))for(var i=0,s=Object.keys(t);i<s.length;i++){var n,a=s[i];-1<D.indexOf(a)&&("class"===a?""!==(n=this.getInputValidClassList(t[""+a]))&&E.addClass([e],n.split(" ")):"style"===a?(n=e.getAttribute(a),n=E.isNullOrUndefined(n)?t[""+a]:n+t[""+a],e.setAttribute(a,n)):e.setAttribute(a,t[""+a]))}},n.isBlank=function(t){return!t||/^\s*$/.test(t)};xt=function(t,e){return(xt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var xt,St,Tt=function(t,e){function i(){this.constructor=t}xt(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},t=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},Pt="e-input-group-icon",Ot="e-spin-up",wt="e-error",Lt="increment",kt="decrement",At=new RegExp("^(-)?(\\d*)$"),Nt="e-input-focus",Ht=["title","style","class"],Bt=0,Rt=(St=E.Component,Tt(e,St),e.prototype.preRender=function(){this.isPrevFocused=!1,this.decimalSeparator=".",this.intRegExp=new RegExp("/^(-)?(d*)$/"),this.isCalled=!1;var t=E.getValue("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),E.removeClass([this.cloneElement],["e-control","e-numerictextbox","e-lib"]),this.angularTagName=null,this.formEle=E.closest(this.element,"form"),"EJS-NUMERICTEXTBOX"===this.element.tagName){this.angularTagName=this.element.tagName;for(var e=this.createElement("input"),i=0;i<this.element.attributes.length;i++){var s=this.element.attributes[i].nodeName;"id"!==s&&"class"!==s?(e.setAttribute(this.element.attributes[i].nodeName,this.element.attributes[i].nodeValue),e.innerHTML=this.element.innerHTML):"class"===s&&e.setAttribute(s,this.element.className.split(" ").filter(function(t){return 0!==t.indexOf("ng-")}).join(" "))}this.element.hasAttribute("name")&&this.element.removeAttribute("name"),this.element.classList.remove("e-control","e-numerictextbox"),this.element.appendChild(e),this.element=e,E.setValue("ej2_instances",t,this.element)}E.attributes(this.element,{role:"spinbutton",tabindex:"0",autocomplete:"off"});t={incrementTitle:"Increment value",decrementTitle:"Decrement value",placeholder:this.placeholder};this.l10n=new E.L10n("numerictextbox",t,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.element.hasAttribute("id")||this.element.setAttribute("id",E.getUniqueID("numerictextbox")),this.isValidState=!0,this.inputStyle=null,this.inputName=null,this.cultureInfo={},this.initCultureInfo(),this.initCultureFunc(),this.prevValue=this.value,this.updateHTMLAttrToElement(),this.checkAttributes(!1),this.formEle&&(this.inputEleValue=this.value),this.validateMinMax(),this.validateStep(),null===this.placeholder&&this.updatePlaceholder()},e.prototype.render=function(){"input"===this.element.tagName.toLowerCase()&&(this.createWrapper(),this.showSpinButton&&this.spinBtnCreation(),this.setElementWidth(this.width),this.container.classList.contains("e-input-group")||this.container.classList.add("e-input-group"),this.changeValue(null===this.value||isNaN(this.value)?null:this.strictMode?this.trimValue(this.value):this.value),this.wireEvents(),null===this.value||isNaN(this.value)||this.decimals&&this.setProperties({value:this.roundNumber(this.value,this.decimals)},!0),(this.element.getAttribute("value")||this.value)&&(this.element.setAttribute("value",this.element.value),this.hiddenInput.setAttribute("value",this.hiddenInput.value)),this.elementPrevValue=this.element.value,this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),this.element.hasAttribute("aria-labelledby")||this.element.hasAttribute("placeholder")||this.element.hasAttribute("aria-label")||this.element.setAttribute("aria-label","numerictextbox"),!E.isNullOrUndefined(E.closest(this.element,"fieldset"))&&E.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.updateFloatLabelOverflowWidth(),this.createPrependTemplate(),this.createAppendTemplate(),this.renderComplete())},e.prototype.checkAttributes=function(t){for(var e=0,i=t?E.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["value","min","max","step","disabled","readonly","style","name","placeholder"];e<i.length;e++){var s,n,a,l=i[e];if(!E.isNullOrUndefined(this.element.getAttribute(l)))switch(l){case"disabled":(E.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.enabled||t)&&(s="disabled"!==this.element.getAttribute(l)&&""!==this.element.getAttribute(l)&&"true"!==this.element.getAttribute(l),this.setProperties({enabled:s},!t));break;case"readonly":(E.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.readonly||t)&&(s="readonly"===this.element.getAttribute(l)||""===this.element.getAttribute(l)||"true"===this.element.getAttribute(l),this.setProperties({readonly:s},!t));break;case"placeholder":(E.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"value":(E.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.value||t)&&(n=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(l)),this.setProperties(E.setValue(l,n,{}),!t));break;case"min":!E.isNullOrUndefined(this.numericOptions)&&void 0!==this.numericOptions.min&&!t||null===(n=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(l)))||isNaN(n)||this.setProperties(E.setValue(l,n,{}),!t);break;case"max":!E.isNullOrUndefined(this.numericOptions)&&void 0!==this.numericOptions.max&&!t||null===(a=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(l)))||isNaN(a)||this.setProperties(E.setValue(l,a,{}),!t);break;case"step":!E.isNullOrUndefined(this.numericOptions)&&void 0!==this.numericOptions.step&&!t||null===(a=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(l)))||isNaN(a)||this.setProperties(E.setValue(l,a,{}),!t);break;case"style":this.inputStyle=this.element.getAttribute(l);break;case"name":this.inputName=this.element.getAttribute(l);break;default:var r=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(l));(null===r||isNaN(r))&&"value"!==l||this.setProperties(E.setValue(l,r,{}),!0)}}},e.prototype.updatePlaceholder=function(){this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0)},e.prototype.initCultureFunc=function(){this.instance=new E.Internationalization(this.locale)},e.prototype.initCultureInfo=function(){this.cultureInfo.format=this.format,null!==E.getValue("currency",this)&&(E.setValue("currency",this.currency,this.cultureInfo),this.setProperties({currencyCode:this.currency},!0))},e.prototype.createWrapper=function(){var t=this.cssClass,t=(E.isNullOrUndefined(this.cssClass)||""===this.cssClass||(t=this.getNumericValidClassList(this.cssClass)),o.Input.createInput({element:this.element,floatLabelType:this.floatLabelType,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:t,enableRtl:this.enableRtl,showClearButton:this.showClearButton,enabled:this.enabled}},this.createElement));this.inputWrapper=t,this.container=t.container,this.container.setAttribute("class","e-control-wrapper e-numeric "+this.container.getAttribute("class")),this.updateHTMLAttrToWrapper(),this.readonly&&E.attributes(this.element,{"aria-readonly":"true"}),this.hiddenInput=this.createElement("input",{attrs:{type:"text","data-validateHidden":"true","aria-label":"hidden",class:"e-numeric-hidden"}}),this.inputName=null!==this.inputName?this.inputName:this.element.id,this.element.removeAttribute("name"),this.isAngular&&"EJS-NUMERICTEXTBOX"===this.angularTagName&&0<this.cloneElement.id.length?E.attributes(this.hiddenInput,{name:this.cloneElement.id}):E.attributes(this.hiddenInput,{name:this.inputName}),this.container.insertBefore(this.hiddenInput,this.container.childNodes[1]),this.updateDataAttribute(!1),null!==this.inputStyle&&E.attributes(this.container,{style:this.inputStyle})},e.prototype.updateDataAttribute=function(t){var e={};if(t)e=this.htmlAttributes;else for(var i=0;i<this.element.attributes.length;i++)e[this.element.attributes[i].name]=this.element.getAttribute(this.element.attributes[i].name);for(var s=0,n=Object.keys(e);s<n.length;s++){var a=n[s];0===a.indexOf("data")&&this.hiddenInput.setAttribute(a,e[""+a])}},e.prototype.updateHTMLAttrToElement=function(){if(!E.isNullOrUndefined(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var i=e[t];Ht.indexOf(i)<0&&this.element.setAttribute(i,this.htmlAttributes[""+i])}},e.prototype.updateCssClass=function(t,e){o.Input.setCssClass(this.getNumericValidClassList(t),[this.container],this.getNumericValidClassList(e))},e.prototype.getNumericValidClassList=function(t){var e=t;return e=E.isNullOrUndefined(t)||""===t?e:t.replace(/\s+/g," ").trim()},e.prototype.updateHTMLAttrToWrapper=function(){if(!E.isNullOrUndefined(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var i,s=e[t];-1<Ht.indexOf(s)&&("class"===s?""!==(i=this.getNumericValidClassList(this.htmlAttributes[""+s]))&&E.addClass([this.container],i.split(" ")):"style"===s?(i=this.container.getAttribute(s),i=E.isNullOrUndefined(i)?this.htmlAttributes[""+s]:i+this.htmlAttributes[""+s],this.container.setAttribute(s,i)):this.container.setAttribute(s,this.htmlAttributes[""+s]))}},e.prototype.setElementWidth=function(t){E.isNullOrUndefined(t)||("number"==typeof t?this.container.style.width=E.formatUnit(t):"string"==typeof t&&(this.container.style.width=t.match(/px|%|em/)?t:E.formatUnit(t)))},e.prototype.spinBtnCreation=function(){this.spinDown=o.Input.appendSpan(Pt+" e-spin-down",this.container,this.createElement),E.attributes(this.spinDown,{title:this.l10n.getConstant("decrementTitle")}),this.spinUp=o.Input.appendSpan(Pt+" "+Ot,this.container,this.createElement),E.attributes(this.spinUp,{title:this.l10n.getConstant("incrementTitle")}),this.wireSpinBtnEvents()},e.prototype.validateMinMax=function(){"number"==typeof this.min&&!isNaN(this.min)||this.setProperties({min:-Number.MAX_VALUE},!0),"number"==typeof this.max&&!isNaN(this.max)||this.setProperties({max:Number.MAX_VALUE},!0),null!==this.decimals&&(this.min!==-Number.MAX_VALUE&&this.setProperties({min:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.min))},!0),this.max!==Number.MAX_VALUE)&&this.setProperties({max:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.max))},!0),this.setProperties({min:this.min>this.max?this.max:this.min},!0),this.min!==-Number.MAX_VALUE&&E.attributes(this.element,{"aria-valuemin":this.min.toString()}),this.max!==Number.MAX_VALUE&&E.attributes(this.element,{"aria-valuemax":this.max.toString()})},e.prototype.formattedValue=function(t,e){return this.instance.getNumberFormat({maximumFractionDigits:t,minimumFractionDigits:t,useGrouping:!1})(e)},e.prototype.validateStep=function(){null!==this.decimals&&this.setProperties({step:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.step))},!0)},e.prototype.action=function(t,e){this.isInteract=!0;var i=this.isFocused?this.instance.getNumberParser({format:"n"})(this.element.value):this.value;this.changeValue(this.performAction(i,this.step,t)),this.raiseChangeEvent(e)},e.prototype.checkErrorClass=function(){this.isValidState?E.removeClass([this.container],wt):E.addClass([this.container],wt),E.attributes(this.element,{"aria-invalid":this.isValidState?"false":"true"})},e.prototype.bindClearEvent=function(){this.showClearButton&&E.EventHandler.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this)},e.prototype.resetHandler=function(t){t.preventDefault(),this.inputWrapper.clearButton.classList.contains("e-clear-icon-hide")&&!this.inputWrapper.container.classList.contains("e-static-clear")||this.clear(t),this.isInteract=!0,this.raiseChangeEvent(t)},e.prototype.clear=function(t){var e,i;this.prevValue=this.instance.getNumberParser({format:"n"})(this.element.value),this.setProperties({value:null},!0),this.setElementValue(""),this.hiddenInput.value="",E.closest(this.element,"form")&&(e=this.element.nextElementSibling,(i=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),e.dispatchEvent(i))},e.prototype.resetFormHandler=function(){"EJS-NUMERICTEXTBOX"===this.element.tagName?this.updateValue(null):this.updateValue(this.inputEleValue)},e.prototype.setSpinButton=function(){E.isNullOrUndefined(this.spinDown)||E.attributes(this.spinDown,{title:this.l10n.getConstant("decrementTitle"),"aria-label":this.l10n.getConstant("decrementTitle")}),E.isNullOrUndefined(this.spinUp)||E.attributes(this.spinUp,{title:this.l10n.getConstant("incrementTitle"),"aria-label":this.l10n.getConstant("incrementTitle")})},e.prototype.wireEvents=function(){E.EventHandler.add(this.element,"focus",this.focusHandler,this),E.EventHandler.add(this.element,"blur",this.focusOutHandler,this),E.EventHandler.add(this.element,"keydown",this.keyDownHandler,this),E.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),E.EventHandler.add(this.element,"input",this.inputHandler,this),E.EventHandler.add(this.element,"keypress",this.keyPressHandler,this),E.EventHandler.add(this.element,"change",this.changeHandler,this),E.EventHandler.add(this.element,"paste",this.pasteHandler,this),this.enabled&&(this.bindClearEvent(),this.formEle)&&E.EventHandler.add(this.formEle,"reset",this.resetFormHandler,this),this.resizeHandler=this.windowResize.bind(this),window.addEventListener("resize",this.resizeHandler)},e.prototype.wireSpinBtnEvents=function(){E.EventHandler.add(this.spinUp,E.Browser.touchStartEvent,this.mouseDownOnSpinner,this),E.EventHandler.add(this.spinDown,E.Browser.touchStartEvent,this.mouseDownOnSpinner,this),E.EventHandler.add(this.spinUp,E.Browser.touchEndEvent,this.mouseUpOnSpinner,this),E.EventHandler.add(this.spinDown,E.Browser.touchEndEvent,this.mouseUpOnSpinner,this),E.EventHandler.add(this.spinUp,E.Browser.touchMoveEvent,this.touchMoveOnSpinner,this),E.EventHandler.add(this.spinDown,E.Browser.touchMoveEvent,this.touchMoveOnSpinner,this)},e.prototype.unwireEvents=function(){E.EventHandler.remove(this.element,"focus",this.focusHandler),E.EventHandler.remove(this.element,"blur",this.focusOutHandler),E.EventHandler.remove(this.element,"keyup",this.keyUpHandler),E.EventHandler.remove(this.element,"input",this.inputHandler),E.EventHandler.remove(this.element,"keydown",this.keyDownHandler),E.EventHandler.remove(this.element,"keypress",this.keyPressHandler),E.EventHandler.remove(this.element,"change",this.changeHandler),E.EventHandler.remove(this.element,"paste",this.pasteHandler),this.formEle&&E.EventHandler.remove(this.formEle,"reset",this.resetFormHandler),this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null)},e.prototype.unwireSpinBtnEvents=function(){E.EventHandler.remove(this.spinUp,E.Browser.touchStartEvent,this.mouseDownOnSpinner),E.EventHandler.remove(this.spinDown,E.Browser.touchStartEvent,this.mouseDownOnSpinner),E.EventHandler.remove(this.spinUp,E.Browser.touchEndEvent,this.mouseUpOnSpinner),E.EventHandler.remove(this.spinDown,E.Browser.touchEndEvent,this.mouseUpOnSpinner),E.EventHandler.remove(this.spinUp,E.Browser.touchMoveEvent,this.touchMoveOnSpinner),E.EventHandler.remove(this.spinDown,E.Browser.touchMoveEvent,this.touchMoveOnSpinner)},e.prototype.updatePrependTemplate=function(){this.removePrependTemplate(),this.createPrependTemplate()},e.prototype.updateAppendTemplate=function(){this.removeAppendTemplate(),this.createAppendTemplate()},e.prototype.templateComplier=function(e){if(e)try{return"function"!=typeof e&&E.selectAll(e,document).length?E.compile(E.select(e,document).innerHTML.trim()):E.compile(e)}catch(t){return E.compile(e)}},e.prototype.createPrependTemplate=function(){var t,e;E.isNullOrUndefined(this.prependTemplate)||(t=this.container,this.prependedElement=this.createElement("div",{className:"e-prepend-template"}),this.iconTemplateFunction=this.templateComplier(this.prependTemplate),(e=this.iconTemplateFunction(null,this,"template",this.element.id+"Template",this.isStringTemplate,null,this.prependedElement))&&(e=[].slice.call(e),E.append(e,this.prependedElement)),e=t.querySelector("input"),t.classList.add("e-prepend-wrapper"),e?t.insertBefore(this.prependedElement,e):t.insertBefore(this.prependedElement,t.firstChild),this.handleFloatLabel(),this.renderReactTemplates())},e.prototype.createAppendTemplate=function(){var t,e;E.isNullOrUndefined(this.appendTemplate)||(t=this.container,this.appendedElement=this.createElement("div",{className:"e-append-template"}),this.iconTemplateFunction=this.templateComplier(this.appendTemplate),(e=this.iconTemplateFunction(null,this,"template",this.element.id+"Template",this.isStringTemplate,null,this.appendedElement))&&(e=[].slice.call(e),E.append(e,this.appendedElement)),t.classList.add("e-append-wrapper"),e=t.querySelector(".e-spin-down"),this.showSpinButton&&e?t.insertBefore(this.appendedElement,e):t.appendChild(this.appendedElement),this.handleFloatLabel(),this.renderReactTemplates())},e.prototype.handleFloatLabel=function(){var t=this.container.querySelector(".e-float-text");t&&"Auto"===this.floatLabelType&&setTimeout(function(){t&&this.prependedElement&&!this.enableRtl?(t.style.marginLeft=this.prependedElement.offsetWidth+"px",t.style.marginRight="0"):t&&this.prependedElement&&this.enableRtl&&(t.style.marginRight=this.prependedElement.offsetWidth+"px",t.style.marginLeft="0"),t&&t.classList.contains("e-label-bottom")&&(t.style.width=this.element.offsetWidth+"px")}.bind(this),5)},e.prototype.removePrependTemplate=function(){E.isNullOrUndefined(this.prependedElement)||(E.detach(this.prependedElement),this.prependedElement=null)},e.prototype.removeAppendTemplate=function(){E.isNullOrUndefined(this.appendedElement)||(E.detach(this.appendedElement),this.appendedElement=null)},e.prototype.changeHandler=function(t){t.stopPropagation(),this.element.value.length||this.setProperties({value:null},!0);var e=this.instance.getNumberParser({format:"n"})(this.element.value);this.updateValue(e,t)},e.prototype.raiseChangeEvent=function(t){var e;this.inputValue=E.isNullOrUndefined(this.inputValue)||isNaN(this.inputValue)?null:this.inputValue,this.prevValue===this.value&&this.prevValue===this.inputValue||(e={},this.changeEventArgs={value:this.value,previousValue:this.prevValue,isInteracted:this.isInteract,isInteraction:this.isInteract,event:t},t&&(this.changeEventArgs.event=t),void 0===this.changeEventArgs.event&&(this.changeEventArgs.isInteracted=!1,this.changeEventArgs.isInteraction=!1),E.merge(e,this.changeEventArgs),this.prevValue=this.value,this.isInteract=!1,this.elementPrevValue=this.element.value,this.preventChange=!1,this.trigger("change",e))},e.prototype.pasteHandler=function(){var t,e=this;this.enabled&&!this.readonly&&(t=this.element.value,setTimeout(function(){e.numericRegex().test(e.element.value)||e.setElementValue(t)}))},e.prototype.preventHandler=function(){var a=this,l=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);setTimeout(function(){var t,e,i,s,n;0<a.element.selectionStart&&(t=a.element.selectionStart,e=a.element.selectionStart-1,i=a.element.value.split(""),s=E.getNumericObject(a.locale),n=(s=E.getValue("decimal",s)).charCodeAt(0)," "===a.element.value[e]&&0<a.element.selectionStart&&!l?(E.isNullOrUndefined(a.prevVal)?a.element.value=a.element.value.trim():0!=e?a.element.value=a.prevVal:0==e&&(a.element.value=a.element.value.trim()),a.element.setSelectionRange(e,e)):isNaN(parseFloat(a.element.value[a.element.selectionStart-1]))&&45!==a.element.value[a.element.selectionStart-1].charCodeAt(0)?(i.indexOf(a.element.value[a.element.selectionStart-1])!==i.lastIndexOf(a.element.value[a.element.selectionStart-1])&&a.element.value[a.element.selectionStart-1].charCodeAt(0)===n||a.element.value[a.element.selectionStart-1].charCodeAt(0)!==n)&&(a.element.value=a.element.value.substring(0,e)+a.element.value.substring(t,a.element.value.length),a.element.setSelectionRange(e,e),isNaN(parseFloat(a.element.value[a.element.selectionStart-1])))&&0<a.element.selectionStart&&a.element.value.length&&a.preventHandler():isNaN(parseFloat(a.element.value[a.element.selectionStart-2]))&&1<a.element.selectionStart&&45!==a.element.value[a.element.selectionStart-2].charCodeAt(0)&&(i.indexOf(a.element.value[a.element.selectionStart-2])!==i.lastIndexOf(a.element.value[a.element.selectionStart-2])&&a.element.value[a.element.selectionStart-2].charCodeAt(0)===n||a.element.value[a.element.selectionStart-2].charCodeAt(0)!==n)&&(a.element.setSelectionRange(e,e),a.nextEle=a.element.value[a.element.selectionStart],a.cursorPosChanged=!0,a.preventHandler()),!0===a.cursorPosChanged&&a.element.value[a.element.selectionStart]===a.nextEle&&isNaN(parseFloat(a.element.value[a.element.selectionStart-1]))&&(a.element.setSelectionRange(a.element.selectionStart+1,a.element.selectionStart+1),a.cursorPosChanged=!1,a.nextEle=null),""===a.element.value.trim()&&a.element.setSelectionRange(0,0),0<a.element.selectionStart&&(45===a.element.value[a.element.selectionStart-1].charCodeAt(0)&&1<a.element.selectionStart&&(E.isNullOrUndefined(a.prevVal)||(a.element.value=a.prevVal),a.element.setSelectionRange(a.element.selectionStart,a.element.selectionStart)),a.element.value[a.element.selectionStart-1]===s)&&0===a.decimals&&a.validateDecimalOnType&&(a.element.value=a.element.value.substring(0,e)+a.element.value.substring(t,a.element.value.length)),a.prevVal=a.element.value)})},e.prototype.keyUpHandler=function(){var t,e;this.enabled&&!this.readonly&&(!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)||!E.Browser.isDevice||this.preventHandler(),t=null===(t=this.instance.getNumberParser({format:"n"})(this.element.value))||isNaN(t)?null:t,this.hiddenInput.value=t||0===t?t.toString():null,E.closest(this.element,"form"))&&(t=this.element.nextElementSibling,(e=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),t.dispatchEvent(e))},e.prototype.inputHandler=function(t){var e,i;this.enabled&&!this.readonly&&(e=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform),(-1<navigator.userAgent.toLowerCase().indexOf("firefox")||e)&&E.Browser.isDevice&&this.preventHandler(),this.isAngular&&this.element.value!==E.getValue("decimal",E.getNumericObject(this.locale))&&this.element.value!==E.getValue("minusSign",E.getNumericObject(this.locale))&&this.numericRegex().test(this.element.value)&&(e=this.instance.getNumberParser({format:"n"})(this.element.value),e=isNaN(e)?null:e,this.localChange({value:e}),this.preventChange=!0),this.isVue)&&(e=this.instance.getNumberParser({format:"n"})(this.element.value),i=this.instance.getNumberParser({format:"n"})(this.elementPrevValue),t={event:t,value:null===(e=!new RegExp("[^0-9]+$").test(this.element.value)&&(-1===this.elementPrevValue.indexOf(".")&&-1===this.elementPrevValue.indexOf("-")||"0"!==this.element.value[this.element.value.length-1])?e:this.value)||isNaN(e)?null:e,previousValue:null===i||isNaN(i)?null:i},this.preventChange=!0,this.elementPrevValue=this.element.value,this.trigger("input",t))},e.prototype.keyDownHandler=function(t){if(!this.readonly)switch(t.keyCode){case 38:t.preventDefault(),this.action(Lt,t);break;case 40:t.preventDefault(),this.action(kt,t)}},e.prototype.performAction=function(t,e,i){null!==t&&!isNaN(t)||(t=0);i=this.correctRounding(t,e,i===Lt?t+e:t-e);return this.strictMode?this.trimValue(i):i},e.prototype.correctRounding=function(t,e,i){var s=new RegExp("[,.](.*)"),n=s.test(t.toString()),a=s.test(e.toString());return n||a?(n=n?s.exec(t.toString())[0].length:0,t=a?s.exec(e.toString())[0].length:0,a=Math.max(n,t),this.roundValue(i,a)):i},e.prototype.roundValue=function(t,e){e=e||0;e=Math.pow(10,e);return t*=e,Math.round(t)/e},e.prototype.updateValue=function(t,e){e&&(this.isInteract=!0),null===t||isNaN(t)||this.decimals&&(t=this.roundNumber(t,this.decimals)),this.inputValue=t,this.isVue&&this.element&&this.element.hasAttribute("modelvalue")&&this.isDynamicChange||this.changeValue(null===t||isNaN(t)?null:this.strictMode?this.trimValue(t):t),this.isDynamicChange||this.raiseChangeEvent(e)},e.prototype.updateCurrency=function(t,e){E.setValue(t,e,this.cultureInfo),this.updateValue(this.value)},e.prototype.changeValue=function(t){var e;t||0===t?(e=this.getNumberOfDecimals(t),this.setProperties({value:this.roundNumber(t,e)},!0)):this.setProperties({value:t=null},!0),this.modifyText(),this.strictMode||this.validateState()},e.prototype.modifyText=function(){var t,e;this.value||0===this.value?(t=this.formatNumber(),e=this.isFocused?t:this.instance.getNumberFormat(this.cultureInfo)(this.value),this.setElementValue(e),E.attributes(this.element,{"aria-valuenow":t}),E.isNullOrUndefined(this.hiddenInput)||(this.hiddenInput.value=this.value.toString(),null!==this.value&&this.serverDecimalSeparator&&(this.hiddenInput.value=this.hiddenInput.value.replace(".",this.serverDecimalSeparator)))):(this.setElementValue(""),this.element.removeAttribute("aria-valuenow"),this.hiddenInput.value=null)},e.prototype.setElementValue=function(t,e){o.Input.setValue(t,e||this.element,this.floatLabelType,this.showClearButton)},e.prototype.validateState=function(){this.isValidState=!0,!this.value&&0!==this.value||(this.isValidState=!(this.value>this.max||this.value<this.min)),this.checkErrorClass()},e.prototype.getNumberOfDecimals=function(t){var e=new RegExp("[eE][-+]?([0-9]+)"),i=t.toString(),t=(e.test(i)&&(/[eE]/.test(i)?"."===(i=t.toFixed(20).replace(/0+$/,"")).charAt(i.length-1)&&(i=i.slice(0,i.length-1)):(e=e.exec(i),E.isNullOrUndefined(e)||(i=t.toFixed(Math.min(parseInt(e[1],10),20))))),i.split(".")[1]),e=t&&t.length?t.length:0;return e=null!==this.decimals?e<this.decimals?e:this.decimals:e},e.prototype.formatNumber=function(){var t=this.getNumberOfDecimals(this.value);return this.instance.getNumberFormat({maximumFractionDigits:t,minimumFractionDigits:t,useGrouping:!1})(this.value)},e.prototype.trimValue=function(t){return t>this.max?this.max:t<this.min?this.min:t},e.prototype.roundNumber=function(t,e){var i=t,e=e||0,s=i.toString().split("e"),s=(i=Math.round(Number(s[0]+"e"+(s[1]?Number(s[1])+e:e)))).toString().split("e");return i=Number(s[0]+"e"+(s[1]?Number(s[1])-e:-e)),isNaN(i)&&(i=t),Number(i.toFixed(e))},e.prototype.cancelEvent=function(t){return t.preventDefault(),!1},e.prototype.keyPressHandler=function(t){if(!this.enabled||this.readonly)return!0;if(!E.Browser.isDevice&&"11.0"===E.Browser.info.version&&13===t.keyCode)return e=this.instance.getNumberParser({format:"n"})(this.element.value),this.updateValue(e,t),!0;if(0===t.which||t.metaKey||t.ctrlKey||8===t.keyCode||13===t.keyCode)return!0;var e=String.fromCharCode(t.which),i=E.getValue("decimal",E.getNumericObject(this.locale)),s="NumpadDecimal"===t.code&&e!==i;s&&(e=i);i=(i=this.element.value).substring(0,this.element.selectionStart)+e+i.substring(this.element.selectionEnd);return this.numericRegex().test(i)?(s&&(e=this.element.selectionStart+1,this.element.value=i,this.element.setSelectionRange(e,e),t.preventDefault(),t.stopPropagation()),!0):(t.preventDefault(),t.stopPropagation(),!1)},e.prototype.numericRegex=function(){var t=E.getNumericObject(this.locale),t=E.getValue("decimal",t),e="*";return"."===t&&(t="\\"+t),0===this.decimals&&this.validateDecimalOnType?At:(this.decimals&&this.validateDecimalOnType&&(e="{0,"+this.decimals+"}"),new RegExp("^\\s*(-)?(((\\d+("+t+"\\d"+e+")?)|("+t+"\\d"+e+")))?$"))},e.prototype.mouseWheel=function(t){var e;this.allowMouseWheel&&(t.preventDefault(),t.wheelDelta?e=t.wheelDelta/120:t.detail&&(e=-t.detail/3),0<e?this.action(Lt,t):e<0&&this.action(kt,t),this.cancelEvent(t))},e.prototype.windowResize=function(){this.updateFloatLabelOverflowWidth()},e.prototype.focusHandler=function(t){var e,i,s=this;clearTimeout(Bt),this.focusEventArgs={event:t,value:this.value,container:this.container},this.trigger("focus",this.focusEventArgs),this.enabled&&!this.readonly&&(this.isFocused=!0,"Never"!==this.floatLabelType&&this.inputWrapper&&this.inputWrapper.container&&(t=this.inputWrapper.container.querySelector(".e-float-text"))&&t.removeAttribute("style"),this.prevValue=this.value,!this.value&&0!==this.value||(e=this.formatNumber(),this.setElementValue(e),this.isPrevFocused)||(E.Browser.isDevice||"11.0"!==E.Browser.info.version?(t=E.Browser.isDevice&&E.Browser.isIos?600:0,Bt=setTimeout(function(){s.element.setSelectionRange(0,e.length)},t)):this.element.setSelectionRange(0,e.length)),!E.Browser.isDevice&&this.allowMouseWheel&&E.EventHandler.add(this.element,"mousewheel DOMMouseScroll",this.mouseWheel,this),i=this.container.querySelector(".e-float-text"),"Auto"===this.floatLabelType)&&(this.prependTemplate||this.appendTemplate)&&i&&setTimeout(function(){i&&(i.style.width="auto")}.bind(this),5)},e.prototype.focusOutHandler=function(t){var e,i,s,n,a=this;this.blurEventArgs={event:t,value:this.value,container:this.container},this.trigger("blur",this.blurEventArgs),this.enabled&&!this.readonly&&(this.isPrevFocused?(t.preventDefault(),E.Browser.isDevice&&(e=this.element.value,this.element.focus(),this.isPrevFocused=!1,i=this.element,setTimeout(function(){a.setElementValue(e,i)},200))):(this.isFocused=!1,this.element.value.length||this.setProperties({value:null},!0),t=this.instance.getNumberParser({format:"n"})(this.element.value),this.updateValue(t),E.Browser.isDevice||E.EventHandler.remove(this.element,"mousewheel DOMMouseScroll",this.mouseWheel)),this.updateFloatLabelOverflowWidth(),s=this.container.querySelector(".e-float-text"),"Auto"===this.floatLabelType&&(this.prependTemplate||this.appendTemplate)&&s&&setTimeout(function(){s&&this.prependedElement&&!this.enableRtl?s.style.marginLeft=this.prependedElement.offsetWidth+"px":s&&this.prependedElement&&this.enableRtl&&(s.style.marginRight=this.prependedElement.offsetWidth+"px"),s&&s.classList.contains("e-label-bottom")&&(s.style.width=this.element.offsetWidth+"px")}.bind(this),5),E.closest(this.element,"form"))&&(t=this.element.nextElementSibling,(n=document.createEvent("FocusEvent")).initEvent("focusout",!1,!0),t.dispatchEvent(n))},e.prototype.mouseDownOnSpinner=function(t){var e,i,s=this;this.isFocused&&(this.isPrevFocused=!0,t.preventDefault()),this.getElementData(t)&&(this.getElementData(t),e=t.currentTarget,i=e.classList.contains(Ot)?Lt:kt,E.EventHandler.add(e,"mouseleave",this.mouseUpClick,this),this.timeOut=setInterval(function(){s.isCalled=!0,s.action(i,t)},150),E.EventHandler.add(document,"mouseup",this.mouseUpClick,this))},e.prototype.touchMoveOnSpinner=function(t){var e;("touchmove"===t.type?(e=t.touches).length&&document.elementFromPoint(e[0].pageX,e[0].pageY):document.elementFromPoint(t.clientX,t.clientY)).classList.contains(Pt)||clearInterval(this.timeOut)},e.prototype.mouseUpOnSpinner=function(t){var e,i;this.prevValue=this.value,this.isPrevFocused&&(this.element.focus(),E.Browser.isDevice||(this.isPrevFocused=!1)),E.Browser.isDevice||t.preventDefault(),this.getElementData(t)&&(i=(e=t.currentTarget).classList.contains(Ot)?Lt:kt,E.EventHandler.remove(e,"mouseleave",this.mouseUpClick),this.isCalled||this.action(i,t),this.isCalled=!1,E.EventHandler.remove(document,"mouseup",this.mouseUpClick),E.closest(this.element,"form"))&&(e=this.element.nextElementSibling,(i=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),e.dispatchEvent(i))},e.prototype.getElementData=function(t){return!(t.which&&3===t.which||t.button&&2===t.button||!this.enabled||this.readonly||(clearInterval(this.timeOut),0))},e.prototype.floatLabelTypeUpdate=function(){o.Input.removeFloating(this.inputWrapper);var t=this.hiddenInput;this.hiddenInput.remove(),o.Input.addFloating(this.element,this.floatLabelType,this.placeholder,this.createElement),this.container.insertBefore(t,this.container.childNodes[1])},e.prototype.mouseUpClick=function(t){t.stopPropagation(),clearInterval(this.timeOut),this.isCalled=!1,this.spinUp&&E.EventHandler.remove(this.spinUp,"mouseleave",this.mouseUpClick),this.spinDown&&E.EventHandler.remove(this.spinDown,"mouseleave",this.mouseUpClick)},e.prototype.increment=function(t){void 0===t&&(t=this.step),this.isInteract=!1,this.changeValue(this.performAction(this.value,t,Lt)),this.raiseChangeEvent()},e.prototype.decrement=function(t){void 0===t&&(t=this.step),this.isInteract=!1,this.changeValue(this.performAction(this.value,t,kt)),this.raiseChangeEvent()},e.prototype.destroy=function(){this.unwireEvents(),this.removePrependTemplate(),this.removeAppendTemplate(),this.clearTemplate(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),E.detach(this.hiddenInput),this.showSpinButton&&(this.unwireSpinBtnEvents(),E.detach(this.spinUp),E.detach(this.spinDown));for(var t=["aria-labelledby","role","autocomplete","aria-readonly","aria-disabled","autocapitalize","spellcheck","aria-autocomplete","tabindex","aria-valuemin","aria-valuemax","aria-valuenow","aria-invalid"],e=0;e<t.length;e++)this.element.removeAttribute(t[e]);this.element.classList.remove("e-input"),this.container.insertAdjacentElement("afterend",this.element),E.detach(this.container),this.spinUp=null,this.spinDown=null,this.container=null,this.hiddenInput=null,this.changeEventArgs=null,this.blurEventArgs=null,this.focusEventArgs=null,this.inputWrapper=null,o.Input.destroy({element:this.element,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),"EJS-NUMERICTEXTBOX"===this.element.tagName&&E.setValue("ej2_instances",null,this.element),St.prototype.destroy.call(this)},e.prototype.getText=function(){return this.element.value},e.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.element.focus(),E.addClass([this.container],[Nt]))},e.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.element.blur(),E.removeClass([this.container],[Nt]))},e.prototype.getPersistData=function(){return this.addOnPersist(["value"])},e.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i];switch(n){case"width":this.setElementWidth(t.width),o.Input.calculateWidth(this.element,this.container);break;case"cssClass":this.updateCssClass(t.cssClass,e.cssClass);break;case"enabled":o.Input.setEnabled(t.enabled,this.element),this.bindClearEvent();break;case"enableRtl":o.Input.setEnableRtl(t.enableRtl,[this.container]),this.handleFloatLabel();break;case"readonly":o.Input.setReadonly(t.readonly,this.element),this.readonly?E.attributes(this.element,{"aria-readonly":"true"}):this.element.removeAttribute("aria-readonly");break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.updateDataAttribute(!0),this.checkAttributes(!0),o.Input.validateInputType(this.container,this.element);break;case"placeholder":o.Input.setPlaceholder(t.placeholder,this.element,this.getModuleName()),o.Input.calculateWidth(this.element,this.container);break;case"step":this.step=t.step,this.validateStep();break;case"showSpinButton":this.updateSpinButton(t);break;case"showClearButton":this.updateClearButton(t);break;case"floatLabelType":this.floatLabelType=t.floatLabelType,this.floatLabelTypeUpdate();break;case"value":this.isAngular&&this.formEle&&e.value===t.value&&(this.preventChange=!0),this.isDynamicChange=(this.isAngular||this.isVue)&&this.preventChange,this.updateValue(t.value),this.isDynamicChange&&(this.preventChange=!1,this.isDynamicChange=!1);break;case"min":case"max":E.setValue(n,E.getValue(n,t),this),this.validateMinMax(),this.updateValue(this.value);break;case"strictMode":this.strictMode=t.strictMode,this.updateValue(this.value),this.validateState();break;case"locale":this.initCultureFunc(),this.l10n.setLocale(this.locale),this.setSpinButton(),this.updatePlaceholder(),o.Input.setPlaceholder(this.placeholder,this.element),this.updateValue(this.value);break;case"currency":var a=E.getValue(n,t);this.setProperties({currencyCode:a},!0),this.updateCurrency(n,a);break;case"currencyCode":a=E.getValue(n,t);this.setProperties({currency:a},!0),this.updateCurrency("currency",a);break;case"format":E.setValue(n,E.getValue(n,t),this),this.initCultureInfo(),this.updateValue(this.value);break;case"decimals":this.decimals=t.decimals,this.updateValue(this.value);break;case"allowMouseWheel":this.allowMouseWheel&&this.isFocused&&E.EventHandler.add(this.element,"mousewheel DOMMouseScroll",this.mouseWheel,this);break;case"prependTemplate":this.updatePrependTemplate();break;case"appendTemplate":this.updateAppendTemplate()}}},e.prototype.updateClearButton=function(t){o.Input.setClearButton(t.showClearButton,this.element,this.inputWrapper,void 0,this.createElement),this.bindClearEvent()},e.prototype.updateSpinButton=function(t){t.showSpinButton?this.spinBtnCreation():(E.detach(this.spinUp),E.detach(this.spinDown))},e.prototype.getRightIconsWidth=function(){for(var t=0,e=this.inputWrapper.container.querySelectorAll(".e-input-group-icon, .e-clear-icon"),i=0;i<e.length;i++)t+=e[i].offsetWidth;return t},e.prototype.updateFloatLabelOverflowWidth=function(){var t=this.inputWrapper.container,e=t.querySelector(".e-float-text-overflow")||t.querySelector(".e-float-text"),t=t.clientWidth-this.getRightIconsWidth();!e||!t||this.cssClass&&-1!==this.cssClass.split(" ").indexOf("e-outline")||(e.style.width=t+"px")},e.prototype.getModuleName=function(){return"numerictextbox"},t([E.Property("")],e.prototype,"cssClass",void 0),t([E.Property(null)],e.prototype,"value",void 0),t([E.Property(-Number.MAX_VALUE)],e.prototype,"min",void 0),t([E.Property(Number.MAX_VALUE)],e.prototype,"max",void 0),t([E.Property(1)],e.prototype,"step",void 0),t([E.Property(null)],e.prototype,"width",void 0),t([E.Property(null)],e.prototype,"placeholder",void 0),t([E.Property({})],e.prototype,"htmlAttributes",void 0),t([E.Property(!0)],e.prototype,"showSpinButton",void 0),t([E.Property(!1)],e.prototype,"readonly",void 0),t([E.Property(!0)],e.prototype,"enabled",void 0),t([E.Property(!1)],e.prototype,"showClearButton",void 0),t([E.Property(!1)],e.prototype,"enablePersistence",void 0),t([E.Property("n2")],e.prototype,"format",void 0),t([E.Property(null)],e.prototype,"decimals",void 0),t([E.Property(null)],e.prototype,"currency",void 0),t([E.Property(null)],e.prototype,"currencyCode",void 0),t([E.Property(!0)],e.prototype,"strictMode",void 0),t([E.Property(!1)],e.prototype,"validateDecimalOnType",void 0),t([E.Property(!0)],e.prototype,"allowMouseWheel",void 0),t([E.Property("Never")],e.prototype,"floatLabelType",void 0),t([E.Property(null)],e.prototype,"prependTemplate",void 0),t([E.Property(null)],e.prototype,"appendTemplate",void 0),t([E.Event()],e.prototype,"created",void 0),t([E.Event()],e.prototype,"destroyed",void 0),t([E.Event()],e.prototype,"change",void 0),t([E.Event()],e.prototype,"focus",void 0),t([E.Event()],e.prototype,"blur",void 0),t([E.NotifyPropertyChanges],e));function e(t,e){e=St.call(this,t,e)||this;return e.preventChange=!1,e.isDynamicChange=!1,e.numericOptions=t,e}var Ut="e-error",It="e-input-group",Ft="e-float-input",Vt="e-utility-mask",Mt="e-label-top",Dt="e-label-bottom",Wt={0:"[0-9]",9:"[0-9 ]","#":"[0-9 +-]",L:"[A-Za-z]","?":"[A-Za-z ]","&":"[^ ]+",C:"[^]+",A:"[A-Za-z0-9]",a:"[A-Za-z0-9 ]"};function zt(){if(E.attributes(this.element,{role:"textbox",autocomplete:"off",autocapitalize:"off",spellcheck:"false","aria-live":"assertive"}),this.mask){for(var t=this.mask.split("]"),e=0;e<t.length;e++)if("\\"===t[e][t[e].length-1]){t[e]=t[e]+"]";for(var i=t[e].split("["),s=0;s<i.length;s++)"\\"===i[s][i[s].length-1]&&(i[s]=i[s]+"["),Gt.call(this,i[s])}else if(1<(i=t[e].split("[")).length)for(var n=!1,s=0;s<i.length;s++)"\\"===i[s]?(this.customRegExpCollec.push("["),this.hiddenMask+=i[s]+"["):""===i[s]?n=!0:""!==i[s]&&n||s===i.length-1?(this.customRegExpCollec.push("["+i[s]+"]"),this.hiddenMask+=this.promptChar,n=!1):Gt.call(this,i[s]);else Gt.call(this,i[0]);if(this.escapeMaskValue=this.hiddenMask,this.promptMask=this.hiddenMask.replace(/[09?LCAa#&]/g,this.promptChar),!E.isNullOrUndefined(this.customCharacters))for(e=0;e<this.promptMask.length;e++)E.isNullOrUndefined(this.customCharacters[this.promptMask[e]])||(this.promptMask=this.promptMask.replace(new RegExp(this.promptMask[e],"g"),this.promptChar));if(this.hiddenMask.match(new RegExp(/\\/)))for(e=0;e<this.hiddenMask.length;e++){var a,s=1<=e?e:0;s-=a=this.hiddenMask.length-this.promptMask.length,0<e&&"\\"!==this.hiddenMask[e-1]&&(">"===this.hiddenMask[e]||"<"===this.hiddenMask[e]||"|"===this.hiddenMask[e])&&(this.promptMask=this.promptMask.substring(0,s)+this.promptMask.substring(e+1-a,this.promptMask.length),this.escapeMaskValue=this.escapeMaskValue.substring(0,s)+this.escapeMaskValue.substring(e+1-a,this.escapeMaskValue.length)),"\\"===this.hiddenMask[e]&&(this.promptMask=this.promptMask.substring(0,s)+this.hiddenMask[e+1]+this.promptMask.substring(e+2-a,this.promptMask.length),this.escapeMaskValue=this.escapeMaskValue.substring(0,s)+this.escapeMaskValue[e+1]+this.escapeMaskValue.substring(e+2-a,this.escapeMaskValue.length))}else this.promptMask=this.promptMask.replace(/[>|<]/g,""),this.escapeMaskValue=this.hiddenMask.replace(/[>|<]/g,"");E.attributes(this.element,{"aria-invalid":"false"})}}function qt(){b.call(this,this.promptMask),Ce.call(this,this.value)}function jt(){E.EventHandler.add(this.element,"keydown",re,this),E.EventHandler.add(this.element,"keypress",de,this),E.EventHandler.add(this.element,"keyup",ce,this),E.EventHandler.add(this.element,"input",le,this),E.EventHandler.add(this.element,"focus",Qt,this),E.EventHandler.add(this.element,"blur",ie,this),E.EventHandler.add(this.element,"paste",se,this),E.EventHandler.add(this.element,"cut",ne,this),E.EventHandler.add(this.element,"drop",ae,this),E.EventHandler.add(this.element,"mousedown",Jt,this),E.EventHandler.add(this.element,"mouseup",$t,this),this.enabled&&(Xt.call(this),this.formElement)&&E.EventHandler.add(this.formElement,"reset",Yt,this)}function _t(){E.EventHandler.remove(this.element,"keydown",re),E.EventHandler.remove(this.element,"keypress",de),E.EventHandler.remove(this.element,"keyup",ce),E.EventHandler.remove(this.element,"input",le),E.EventHandler.remove(this.element,"focus",Qt),E.EventHandler.remove(this.element,"blur",ie),E.EventHandler.remove(this.element,"paste",se),E.EventHandler.remove(this.element,"cut",ne),E.EventHandler.remove(this.element,"drop",ae),E.EventHandler.remove(this.element,"mousedown",Jt),E.EventHandler.remove(this.element,"mouseup",$t),this.formElement&&E.EventHandler.remove(this.formElement,"reset",Yt)}function Xt(){this.showClearButton&&E.EventHandler.add(this.inputObj.clearButton,"mousedown touchstart",Kt,this)}function Kt(t){t.preventDefault(),this.inputObj.clearButton.classList.contains("e-clear-icon-hide")&&!this.inputObj.container.classList.contains("e-static-clear")||(function(t){var e=this.element.value;b.call(this,this.promptMask),this.redoCollec.unshift({value:this.promptMask,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),ue.call(this,t,e),this.element.setSelectionRange(0,0)}.call(this,t),this.value="")}function Yt(){"EJS-MASKEDTEXTBOX"===this.element.tagName?b.call(this,this.promptMask):this.value=this.initInputValue}function Zt(t){return t.value}function d(t,e){var i="",s=0,n=!1,a=!E.isNullOrUndefined(e)||E.isNullOrUndefined(t)||E.isNullOrUndefined(this)?e:t.value;if(a!==this.promptMask)for(var l=0;l<this.customRegExpCollec.length;l++)n=n&&!1,">"!==this.customRegExpCollec[s]&&"<"!==this.customRegExpCollec[s]&&"|"!==this.customRegExpCollec[s]&&"\\"!==this.customRegExpCollec[s]||(--l,n=!0),n||a[l]!==this.promptChar&&!E.isNullOrUndefined(this.customRegExpCollec[s])&&(this._callPasteHandler||!E.isNullOrUndefined(this.regExpCollec[this.customRegExpCollec[s]])&&!this.maskedRegExp.includes(this.customRegExpCollec[s])||2<this.customRegExpCollec[s].length&&"["===this.customRegExpCollec[s][0]&&"]"===this.customRegExpCollec[s][this.customRegExpCollec[s].length-1]||!E.isNullOrUndefined(this.customCharacters)&&!E.isNullOrUndefined(this.customCharacters[this.customRegExpCollec[s]]))&&""!==a&&(i+=a[l]),++s;return i=null===this.mask||""===this.mask&&void 0!==this.value?a:i}function Gt(t){for(var e=0;e<t.length;e++)this.hiddenMask+=t[e],"\\"!==t[e]?this.customRegExpCollec.push(t[e]):"\\"!==t[e]||E.isNullOrUndefined(this.regExpCollec[t[e+1]])||this.maskedRegExp.push(t[e+1])}function Jt(){this.isClicked=!0}function $t(){this.isClicked=!1}function Qt(t){var e,i=this,s=this.element,n=0,a=d.call(this,s),l=!1,r=!1,o={selectionStart:s.selectionStart,event:t,value:this.value,maskedValue:s.value,container:E.isNullOrUndefined(this.inputObj)?this.inputObj:this.inputObj.container,selectionEnd:s.selectionEnd},h=(this.isClicked||te.call(this,o,s),"Never"!==this.floatLabelType&&this.inputObj&&this.inputObj.container&&(e=this.inputObj.container.querySelector(".e-float-text"))&&e.removeAttribute("style"),this.inputObj.container.querySelector(".e-float-text"));if(h&&"Auto"===this.floatLabelType&&(this.prependTemplate||this.appendTemplate)&&setTimeout(function(){h&&(h.style.width="auto")}.bind(this),5),this.mask&&(null!==a&&""!==a||"Always"===this.floatLabelType||null===this.placeholder||""===this.placeholder||(s.value=this.promptMask),setTimeout(function(){if(s.selectionStart===i.promptMask.length||s.value[s.selectionStart]===i.promptChar)l=!0;else for(var t=s.selectionStart;t<i.promptMask.length;t++){if(s.value[t]===i.promptChar){l=!0;break}if(s.value[t]!==i.promptMask[t]){l=!1;break}}}),setTimeout(function(){var t=s.selectionStart-1;if(t==i.promptMask.length-1||s.value[t]===i.promptChar)r=!0;else for(var e=t;0<=e;e--){if(s.value[e]===i.promptChar){r=!0;break}if(s.value[e]!==i.promptMask[e]){r=!1;break}}}),this.isClicked||"Always"!==this.floatLabelType&&(null===a||""===a)&&null!==this.placeholder&&""!==this.placeholder)){for(n=0;n<this.promptMask.length;n++)if(s.value[n]===this.promptChar){setTimeout(function(){(l||r)&&(s.selectionEnd=n,s.selectionStart=n),o={selectionStart:s.selectionStart,event:t,value:i.value,maskedValue:s.value,container:E.isNullOrUndefined(i.inputObj)?i.inputObj:i.inputObj.container,selectionEnd:s.selectionEnd},te.call(i,o,s)},110);break}E.isNullOrUndefined(s.value.match(ee(this.promptChar)))&&(o={selectionStart:s.selectionStart,event:t,value:this.value,maskedValue:s.value,container:E.isNullOrUndefined(this.inputObj)?this.inputObj:this.inputObj.container,selectionEnd:s.selectionEnd},te.call(this,o,s)),this.isClicked=!1}}function te(t,e){this.trigger("focus",t,function(t){e.selectionStart=t.selectionStart,e.selectionEnd=t.selectionEnd})}function ee(t){return E.isNullOrUndefined(t)?t:t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function ie(t){this.blurEventArgs={event:t,value:this.value,maskedValue:this.element.value,container:E.isNullOrUndefined(this.inputObj)?this.inputObj:this.inputObj.container},this.trigger("blur",this.blurEventArgs),this.updateFloatLabelOverflowWidth();var e=this.inputObj.container.querySelector(".e-float-text");"Auto"===this.floatLabelType&&(this.prependTemplate||this.appendTemplate)&&e&&setTimeout(function(){e&&this.prependedElement&&!this.enableRtl?e.style.marginLeft=this.prependedElement.offsetWidth+"px":e&&this.prependedElement&&this.enableRtl&&(e.style.marginRight=this.prependedElement.offsetWidth+"px"),e&&(e.style.width=this.element.offsetWidth+"px")}.bind(this),5),this.mask&&(this.isFocus=!1,this.placeholder)&&this.element.value===this.promptMask&&"Always"!==this.floatLabelType&&(b.call(this,""),t=this.element.parentNode.querySelector(".e-float-text"),"Auto"===this.floatLabelType)&&!E.isNullOrUndefined(t)&&t.classList.contains(Mt)&&E.removeClass([t],Mt)}function se(s){var n,a,l,r=this;this.mask&&!this.readonly&&(n=this.element.selectionStart,a=this.element.selectionEnd,l=this.element.value,b.call(this,""),this._callPasteHandler=!0,setTimeout(function(){var t=r.element.value.replace(/ /g,""),e=(0<r.redoCollec.length&&r.redoCollec[0].value===r.element.value&&(t=d.call(r,r.element)),b.call(r,l),r.element.selectionStart=n,r.element.selectionEnd=a,0);for(r.maskKeyPress=!0;fe.call(r,t[e],!1,null),++e<t.length;);if(r.maskKeyPress=!1,r._callPasteHandler=!1,r.element.value===l){var i=0;for(r.maskKeyPress=!0;fe.call(r,t[i],!1,null),++i<t.length;);r.maskKeyPress=!1}else ue.call(r,s,l)},1))}function ne(t){var e,i,s,n,a=this;this.mask&&!this.readonly&&(e=this.element.value,i=this.element.selectionStart,s=this.element.selectionEnd,this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),n=this.element.value.substring(0,i)+this.promptMask.substring(i,s)+this.element.value.substring(s),setTimeout(function(){b.call(a,n),a.element.selectionStart=a.element.selectionEnd=i,a.element.value!==e&&ue.call(a,t,null)},0))}function ae(t){t.preventDefault()}function le(t){if(!0!==E.Browser.isIE||""!==this.element.value||"Never"!==this.floatLabelType)if(E.extend(t,{ctrlKey:!1,keyCode:229}),this.mask){if(""===this.element.value&&this.redoCollec.unshift({value:this.promptMask,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),1===this.element.value.length&&(this.element.value=this.element.value+this.promptMask,this.element.setSelectionRange(1,1)),this._callPasteHandler||E.Browser.isDevice||pe.call(this,t),this.element.value.length>this.promptMask.length){for(var e=this.element.selectionStart,i=this.element.value.length-this.promptMask.length,s=this.element.value.substring(e-i,e),n=(this.maskKeyPress=!1,0);fe.call(this,s[n],t.ctrlKey,t),++n<s.length;);this.element.value!==this.preEleVal&&ue.call(this,t,null)}i=d.call(this,this.element);this.prevValue=i,""===(this.value=i)&&(b.call(this,this.promptMask),this.element.setSelectionRange(0,0))}}function re(t){var e,i;this.mask&&!this.readonly&&(229!==t.keyCode&&(!t.ctrlKey||89!==t.keyCode&&90!==t.keyCode||t.preventDefault(),pe.call(this,t)),e=this.element.value,!t.ctrlKey||89!==t.keyCode&&90!==t.keyCode||(i=void 0,90===t.keyCode&&0<this.undoCollec.length&&e!==this.undoCollec[this.undoCollec.length-1].value?(i=this.undoCollec[this.undoCollec.length-1],this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),b.call(this,i.value),this.element.selectionStart=i.startIndex,this.element.selectionEnd=i.endIndex,this.undoCollec.splice(this.undoCollec.length-1,1)):89===t.keyCode&&0<this.redoCollec.length&&e!==this.redoCollec[0].value&&(i=this.redoCollec[0],this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),b.call(this,i.value),this.element.selectionStart=i.startIndex,this.element.selectionEnd=i.endIndex,this.redoCollec.splice(0,1))))}function oe(){var t,e=this.element.selectionStart,i=this.element.selectionEnd;0<this.redoCollec.length?(t=this.redoCollec[0],b.call(this,t.value),t.startIndex-e==1?(this.element.selectionStart=t.startIndex,this.element.selectionEnd=t.endIndex):(this.element.selectionStart=e+1,this.element.selectionEnd=i+1)):(b.call(this,this.promptMask),this.element.selectionStart=this.element.selectionEnd=e)}function he(t,e,i){return"input"===i.type&&(t=!1,e=this.element.value,b.call(this,this.promptMask),Ce.call(this,e)),t}function pe(t){var e,i=!1,s=!1,n=(this.element.value.length<this.promptMask.length&&(e=this.element.value,i=he.call(this,i=!0,e,t),oe.call(this)),this.element.value.length>=this.promptMask.length&&"input"===t.type&&(i=he.call(this,i,e,t)),this.element.selectionStart),a=this.element.selectionEnd,l=this.element.selectionStart,r=this.element.selectionEnd,o=this.hiddenMask.replace(/[>|\\<]/g,""),h=o[l-1],p=this.element.selectionEnd;if(i||8===t.keyCode||46===t.keyCode){this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:r});var d=!1,u=this.element.value;if(0<l||(8===t.keyCode||46===t.keyCode)&&l<this.element.value.length&&this.element.selectionEnd-l!==this.element.value.length){var c=l;l!==r?(l=r,46===t.keyCode&&(d=!0)):46===t.keyCode?++c:--c;for(var m=l;8===t.keyCode||i||d?c<m:m<c;8===t.keyCode||i||d?m--:m++)for(var f=l;8===t.keyCode||i||d?0<f:f<this.element.value.length;8===t.keyCode||i||d?f--:f++){var v,g,y=void 0;(8===t.keyCode||d)&&(n!==a&&n!==l||n===a)||i?(h=o[f-1],y=l-1):(h=o[f],y=l,++l),this.element.value[y];if(E.isNullOrUndefined(this.regExpCollec[""+h])&&!E.isNullOrUndefined(this.customCharacters)&&E.isNullOrUndefined(this.customCharacters[""+h])&&this.hiddenMask[y]!==this.promptChar&&"["!==this.customRegExpCollec[y][0]&&"]"!==this.customRegExpCollec[y][this.customRegExpCollec[y].length-1]||this.promptMask[y]!==this.promptChar&&E.isNullOrUndefined(this.customCharacters)?(this.element.selectionStart=this.element.selectionEnd=y,t.preventDefault(),46!==t.keyCode||d||++this.element.selectionStart):(v=this.element.value,g=this.promptChar,g=v.substring(0,y)+g+v.substring(l,v.length),b.call(this,g),t.preventDefault(),46!==t.keyCode||d||y++,this.element.selectionStart=this.element.selectionEnd=y,s=!0),l=this.element.selectionStart,!s&&8===t.keyCode||d||!s&&46!==t.keyCode?y=l-1:(y=l,s=!1),v=this.element.value[y],n!==a&&this.element.selectionStart===n||this.promptMask[y]===this.promptChar||v!==this.promptMask[y]&&this.promptMask[y]!==this.promptChar&&!E.isNullOrUndefined(this.customCharacters))break}}46===t.keyCode&&d&&s&&(this.element.selectionStart=this.element.selectionEnd=p),0===this.element.selectionStart&&this.element.selectionEnd===this.element.value.length&&(b.call(this,this.promptMask),t.preventDefault(),this.element.selectionStart=this.element.selectionEnd=l),this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),this.element.value!==u&&ue.call(this,t,e)}}function de(t){var e,i;this.mask&&!this.readonly&&(e=this.element.value,(!t.ctrlKey&&!t.metaKey||(t.ctrlKey||t.metaKey)&&"KeyA"!==t.code&&"KeyY"!==t.code&&"KeyZ"!==t.code&&"KeyX"!==t.code&&"KeyC"!==t.code&&"KeyV"!==t.code)&&(this.maskKeyPress=!0,(i="Spacebar"===(i=t.key)?String.fromCharCode(t.keyCode):i)?1===i.length&&(fe.call(this,i,t.ctrlKey,t),t.preventDefault()):(this.isIosInvalid=!0,fe.call(this,String.fromCharCode(t.keyCode),t.ctrlKey,t),t.preventDefault(),this.isIosInvalid=!1),32===t.keyCode)&&" "===i&&" "===this.promptChar&&(this.element.selectionStart=this.element.selectionEnd=this.element.selectionStart-i.length),this.element.value!==e)&&ue.call(this,t,e)}function ue(t,e){var i,s=this.isProtectedOnChange;E.isNullOrUndefined(this.changeEventArgs)||this.isInitial||(this.changeEventArgs={value:this.element.value,maskedValue:this.element.value,isInteraction:!(i={}),isInteracted:!1},this.mask&&(this.changeEventArgs.value=d.call(this,this.element)),E.isNullOrUndefined(t)||(this.changeEventArgs.isInteracted=!0,this.changeEventArgs.isInteraction=!0,this.changeEventArgs.event=t),this.isProtectedOnChange=!0,this.value=this.changeEventArgs.value,this.isProtectedOnChange=s,E.merge(i,this.changeEventArgs),this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",i)),this.preEleVal=this.element.value,this.prevValue=d.call(this,this.element)}function ce(t){var e,i,s,n,a,l,r,o;this.mask&&!this.readonly?(s=void 0,this.maskKeyPress||229!==t.keyCode?be.call(this):(a=void 0,1===this.element.value.length&&(this.element.value=this.element.value+this.promptMask,this.element.setSelectionRange(1,1)),this.element.value.length>this.promptMask.length&&(i=this.element.selectionStart,e=this.element.value.length-this.promptMask.length,i=this.element.value.substring(i-e,i),0<this.undoCollec.length?(s=this.undoCollec[this.undoCollec.length-1],n=this.element.selectionStart,a=s.value,r=s.value.substring(n-e,n),s=this.redoCollec[0],i=i.trim(),(l=E.Browser.isAndroid&&""===i)||r===i||s.value.substring(n-e,n)===i?l&&ge.call(this,t,n-1,this.element.selectionEnd-1,i,t.ctrlKey,!1):fe.call(this,i,t.ctrlKey,t)):(a=this.promptMask,fe.call(this,i,t.ctrlKey,t)),this.maskKeyPress=!1,ue.call(this,t,a))),r=d.call(this,this.element),(0!==this.element.selectionStart||this.promptMask!==this.element.value||""!==r||""===r&&this.value!==r)&&(this.prevValue=r,this.value=r)):ue.call(this,t),0===this.element.selectionStart&&0===this.element.selectionEnd&&(o=this.element,setTimeout(function(){o.setSelectionRange(0,0)},0))}function me(t){this.maskKeyPress||!function(t){var e;1<t.length&&this.promptMask.length+t.length<this.element.value.length&&(e=this.redoCollec[0].value.substring(0,this.redoCollec[0].startIndex)+t+this.redoCollec[0].value.substring(this.redoCollec[0].startIndex,this.redoCollec[0].value.length),b.call(this,e),this.element.selectionStart=this.element.selectionEnd=this.redoCollec[0].startIndex+t.length),this.element.selectionStart=this.element.selectionStart-t.length,this.element.selectionEnd=this.element.selectionEnd-t.length}.call(this,t)}function fe(t,e,i){if(me.call(this,t),!E.isNullOrUndefined(this)&&!E.isNullOrUndefined(t))for(var s,n=d=this.element.selectionStart,a=!1,l=this.element.value,r=!1,o=!1,h=0;h<t.length;h++){var p=t[h],d=this.element.selectionStart;if(this.maskKeyPress||n!==d||(d+=h),!this.maskKeyPress||d<this.promptMask.length){for(var u,c,m=d;m<this.promptMask.length;m++){var f=this.escapeMaskValue[d];"\\"===this.hiddenMask[d]&&this.hiddenMask[d+1]===t&&(o=!0),(E.isNullOrUndefined(this.regExpCollec[""+f])&&(E.isNullOrUndefined(this.customCharacters)||!E.isNullOrUndefined(this.customCharacters)&&E.isNullOrUndefined(this.customCharacters[""+f]))&&this.hiddenMask[d]!==this.promptChar&&"["!==this.customRegExpCollec[d][0]&&"]"!==this.customRegExpCollec[d][this.customRegExpCollec[d].length-1]||this.promptMask[d]!==this.promptChar&&E.isNullOrUndefined(this.customCharacters)||this.promptChar===f&&this.escapeMaskValue===this.mask)&&(this.element.selectionStart=this.element.selectionEnd=d+1,d=this.element.selectionStart,f=this.hiddenMask[d])}if(E.isNullOrUndefined(this.customCharacters)||E.isNullOrUndefined(this.customCharacters[""+f]))(!E.isNullOrUndefined(this.regExpCollec[""+f])&&p.match(new RegExp(this.regExpCollec[""+f]))&&this.promptMask[d]===this.promptChar||this.promptMask[d]===this.promptChar&&"["===this.customRegExpCollec[d][0]&&"]"===this.customRegExpCollec[d][this.customRegExpCollec[d].length-1]&&p.match(new RegExp(this.customRegExpCollec[d])))&&(a=!0);else for(var v=this.customCharacters[""+f].split(","),m=0;m<v.length;m++)if(p.match(new RegExp("["+v[m]+"]"))){a=!0;break}(!this.maskKeyPress||d<this.hiddenMask.length)&&a?(0===h&&(this.maskKeyPress?this.undoCollec.push({value:l,startIndex:d,endIndex:d}):(u=this.element.selectionStart,c=this.element.selectionEnd,0<this.redoCollec.length?(s=this.redoCollec[0].value,b.call(this,s),this.undoCollec.push(this.redoCollec[0])):(this.undoCollec.push({value:this.promptMask,startIndex:d,endIndex:d}),s=this.promptMask,b.call(this,s)),this.element.selectionStart=u,this.element.selectionEnd=c)),d=this.element.selectionStart,ve.call(this,i,d,p,s,o),r=!0,h===t.length-1&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),a=!1):(d=this.element.selectionStart,ge.call(this,i,d,n,t,e,r)),h!==t.length-1||a||(!E.Browser.isAndroid||E.Browser.isAndroid&&d<this.promptMask.length)&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd})}else 1!==t.length||e||E.isNullOrUndefined(i)||ye.call(this)}}function ve(t,e,i,s,n){this.hiddenMask.length>this.promptMask.length&&(i=function(t,e){var i,s,n=e,a=0;for(s=0;s<this.hiddenMask.length;s++)if("\\"===this.hiddenMask[s]&&(i=n.substring(0,s)+"\\"+n.substring(s,n.length)),">"!==this.hiddenMask[s]&&"<"!==this.hiddenMask[s]&&"|"!==this.hiddenMask[s]||(this.hiddenMask[s]!==n[s]&&(i=n.substring(0,s)+this.hiddenMask[s]+n.substring(s,n.length)),++a),i){if(i[s]===this.promptChar&&s>this.element.selectionStart||this.element.value.indexOf(this.promptChar)<0&&this.element.selectionStart+a===s){a=0;break}n=i}for(;0<=s&&i;){if(0===s||"\\"!==i[s-1]){if(">"===i[s]){t=t.toUpperCase();break}if("<"===i[s]){t=t.toLowerCase();break}if("|"===i[s])break}--s}return t}.call(this,i,this.element.value)),n||(i=(n=this.element.value).substring(0,e)+i+n.substring(e+1,n.length),b.call(this,i),this.element.selectionStart=this.element.selectionEnd=e+1)}function ge(t,e,i,s,n,a){var l;this.maskKeyPress||(l=this.element.value,e>=this.promptMask.length?b.call(this,l.substring(0,e)):(i===e?b.call(this,l.substring(0,e)+l.substring(e+1,l.length)):this.promptMask.length===this.element.value.length?b.call(this,l.substring(0,e)+l.substring(e,l.length)):b.call(this,l.substring(0,i)+l.substring(i+1,l.length)),this.element.selectionStart=this.element.selectionEnd=a||this.element.value[i]!==this.promptChar?e:i),ye.call(this)),1!==s.length||n||E.isNullOrUndefined(t)||ye.call(this)}function ye(){var t=this,e=this.element.parentNode,i=200;e.classList.contains(It)||e.classList.contains(Ft)?E.addClass([e],Ut):E.addClass([this.element],Ut),!0===this.isIosInvalid&&(i=400),E.attributes(this.element,{"aria-invalid":"true"}),setTimeout(function(){t.maskKeyPress||be.call(t)},i)}function be(){var t=this.element.parentNode;E.isNullOrUndefined(t)||E.removeClass([t],Ut),E.removeClass([this.element],Ut),E.attributes(this.element,{"aria-invalid":"false"})}function Ce(t){if(this.mask&&void 0!==t&&(void 0===this.prevValue||this.prevValue!==t)){if(this.maskKeyPress=!0,b.call(this,this.promptMask),""===t||null===t&&"Never"===this.floatLabelType&&this.placeholder||(this.element.selectionStart=0,this.element.selectionEnd=0),null!==t)for(var e=0;e<t.length;e++)fe.call(this,t[e],!1,null);var i=d.call(this,this.element),i=(this.prevValue=i,this.value=i,ue.call(this,null,null),this.maskKeyPress=!1,this.element.parentNode.querySelector(".e-float-text"));this.element.value===this.promptMask&&"Auto"===this.floatLabelType&&this.placeholder&&!E.isNullOrUndefined(i)&&i.classList.contains(Mt)&&!this.isFocus&&(E.removeClass([i],Mt),E.addClass([i],Dt),b.call(this,""))}(null===this.mask||""===this.mask&&void 0!==this.value)&&b.call(this,this.value)}function b(t,e){!this.isFocus&&"Auto"===this.floatLabelType&&this.placeholder&&E.isNullOrUndefined(this.value)&&(t="");var i=d.call(this,e||this.element,t);null===i||""===i?(o.Input.setValue(t,e||this.element,this.floatLabelType,!1),this.showClearButton&&this.inputObj.clearButton.classList.add("e-clear-icon-hide")):o.Input.setValue(t,e||this.element,this.floatLabelType,this.showClearButton)}function Ee(t){E.addClass([t.element],Vt);t={element:t.element,mask:t.mask,promptMask:"",hiddenMask:"",escapeMaskValue:"",promptChar:t.promptChar?1<t.promptChar.length?t.promptChar=t.promptChar[0]:t.promptChar:"_",value:t.value||null,regExpCollec:Wt,customRegExpCollec:[],customCharacters:t.customCharacters,undoCollec:[],redoCollec:[],maskKeyPress:!1,prevValue:""};return zt.call(t),t}function xe(t){var e;return e=!E.isNullOrUndefined(t)&&t.element.classList.contains(Vt)?Ee(t):e}function Se(){}Te=function(t,e){return(Te=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Te,Pe,Tt=function(t,e){function i(){this.constructor=t}Te(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},t=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},Oe="e-input-focus",we=["title","style","class"],Tt=(Pe=E.Component,Tt(i,Pe),i.prototype.getModuleName=function(){return"maskedtextbox"},i.prototype.preRender=function(){this.promptMask="",this.hiddenMask="",this.escapeMaskValue="",this.regExpCollec=Wt,this.customRegExpCollec=[],this.maskedRegExp=[],this.undoCollec=[],this.redoCollec=[],this.changeEventArgs={},this.focusEventArgs={},this.blurEventArgs={},this.maskKeyPress=!1,this.isFocus=!1,this.isInitial=!1,this.isIosInvalid=!1;var t=E.getValue("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),E.removeClass([this.cloneElement],["e-control","e-maskedtextbox","e-lib"]),this.angularTagName=null,this.formElement=E.closest(this.element,"form"),"EJS-MASKEDTEXTBOX"===this.element.tagName){this.angularTagName=this.element.tagName;for(var e=this.createElement("input"),i=0;i<this.element.attributes.length;i++)e.setAttribute(this.element.attributes[i].nodeName,this.element.attributes[i].nodeValue),e.innerHTML=this.element.innerHTML;this.element.hasAttribute("id")&&this.element.removeAttribute("id"),this.element.hasAttribute("name")&&this.element.removeAttribute("name"),this.element.classList.remove("e-control","e-maskedtextbox"),this.element.classList.add("e-mask-container"),this.element.appendChild(e),this.element=e,E.setValue("ej2_instances",t,this.element)}this.updateHTMLAttrToElement(),this.checkHtmlAttributes(!1),this.formElement&&(this.initInputValue=this.value)},i.prototype.getPersistData=function(){return this.addOnPersist(["value"])},i.prototype.render=function(){"input"===this.element.tagName.toLowerCase()&&("Never"===this.floatLabelType&&E.addClass([this.element],"e-input"),this.createWrapper(),this.updateHTMLAttrToWrapper(),""===this.element.name&&this.element.setAttribute("name",this.element.id),this.isInitial=!0,this.resetMaskedTextBox(),this.isInitial=!1,this.setMaskPlaceholder(!0,!1),this.setWidth(this.width),this.preEleVal=this.element.value,E.Browser.isDevice||"11.0"!==E.Browser.info.version&&"edge"!==E.Browser.info.name||this.element.blur(),E.Browser.isDevice&&E.Browser.isIos&&this.element.blur(),(this.element.getAttribute("value")||this.value)&&this.element.setAttribute("value",this.element.value),!E.isNullOrUndefined(E.closest(this.element,"fieldset"))&&E.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.element.hasAttribute("aria-labelledby")||this.element.hasAttribute("placeholder")||this.element.hasAttribute("aria-label")||this.element.setAttribute("aria-label","maskedtextbox"),this.updateFloatLabelOverflowWidth(),this.createPrependTemplate(),this.createAppendTemplate(),this.renderComplete())},i.prototype.updateHTMLAttrToElement=function(){if(!E.isNullOrUndefined(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var i=e[t];we.indexOf(i)<0&&this.element.setAttribute(i,this.htmlAttributes[""+i])}},i.prototype.updateCssClass=function(t,e){o.Input.setCssClass(this.getValidClassList(t),[this.inputObj.container],this.getValidClassList(e))},i.prototype.getValidClassList=function(t){var e=t;return e=E.isNullOrUndefined(t)||""===t?e:t.replace(/\s+/g," ").trim()},i.prototype.updateHTMLAttrToWrapper=function(){if(!E.isNullOrUndefined(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var i,s=e[t];-1<we.indexOf(s)&&("class"===s?""!==(i=this.htmlAttributes[""+s].replace(/\s+/g," ").trim())&&E.addClass([this.inputObj.container],i.split(" ")):"style"===s?(i=this.inputObj.container.getAttribute(s),i=E.isNullOrUndefined(i)?this.htmlAttributes[""+s]:i+this.htmlAttributes[""+s],this.inputObj.container.setAttribute(s,i)):this.inputObj.container.setAttribute(s,this.htmlAttributes[""+s]))}},i.prototype.resetMaskedTextBox=function(){this.promptMask="",this.hiddenMask="",this.escapeMaskValue="",this.customRegExpCollec=[],this.undoCollec=[],this.redoCollec=[],this.promptChar&&1<this.promptChar.length&&(this.promptChar=this.promptChar[0]),zt.call(this),qt.call(this),(null===this.mask||""===this.mask&&void 0!==this.value)&&b.call(this,this.value);var t=d.call(this,this.element);this.prevValue=t,this.value=t,this.isInitial||_t.call(this),jt.call(this)},i.prototype.setMaskPlaceholder=function(t,e){(e||this.placeholder)&&(o.Input.setPlaceholder(this.placeholder,this.element,this.getModuleName()),this.element.value===this.promptMask&&t&&"Always"!==this.floatLabelType||this.element.value===this.promptMask&&"Never"===this.floatLabelType)&&b.call(this,"")},i.prototype.setWidth=function(t){E.isNullOrUndefined(t)||("number"==typeof t?(this.inputObj.container.style.width=E.formatUnit(t),this.element.style.width=E.formatUnit(t)):"string"==typeof t&&(t=t.match(/px|%|em/)?t:E.formatUnit(t),this.inputObj.container.style.width=t,this.element.style.width=t))},i.prototype.checkHtmlAttributes=function(t){for(var e=0,i=t?E.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly"];e<i.length;e++){var s,n=i[e];if(!E.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"placeholder":(E.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"disabled":(E.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.enabled||t)&&(s="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n),this.setProperties({enabled:s},!t));break;case"value":(E.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.value||t)&&this.setProperties({value:this.element.value},!t);break;case"readonly":(E.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.readonly||t)&&(s="readonly"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n),this.setProperties({readonly:s},!t))}}},i.prototype.createWrapper=function(){var t=this.cssClass;E.isNullOrUndefined(this.cssClass)||""===this.cssClass||(t=this.getValidClassList(this.cssClass)),this.inputObj=o.Input.createInput({element:this.element,floatLabelType:this.floatLabelType,properties:{enableRtl:this.enableRtl,cssClass:t,enabled:this.enabled,readonly:this.readonly,placeholder:this.placeholder,showClearButton:this.showClearButton}},this.createElement),this.inputObj.container.setAttribute("class","e-control-wrapper e-mask "+this.inputObj.container.getAttribute("class"))},i.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"value":t.value!==e.value&&(Ce.call(this,this.value),this.placeholder&&!this.isFocus&&this.setMaskPlaceholder(!1,!1),""===this.value)&&null!=e.value&&(this.element.selectionStart=0,this.element.selectionEnd=0);break;case"placeholder":this.setMaskPlaceholder(!0,!0);break;case"width":this.setWidth(t.width),o.Input.calculateWidth(this.element,this.inputObj.container);break;case"cssClass":this.updateCssClass(t.cssClass,e.cssClass);break;case"enabled":o.Input.setEnabled(t.enabled,this.element,this.floatLabelType,this.inputObj.container);break;case"readonly":o.Input.setReadonly(t.readonly,this.element);break;case"enableRtl":o.Input.setEnableRtl(t.enableRtl,[this.inputObj.container]),this.handleFloatLabel();break;case"customCharacters":this.customCharacters=t.customCharacters,this.resetMaskedTextBox();break;case"showClearButton":o.Input.setClearButton(t.showClearButton,this.element,this.inputObj,void 0,this.createElement),Xt.call(this);break;case"floatLabelType":this.floatLabelType=t.floatLabelType,o.Input.removeFloating(this.inputObj),o.Input.addFloating(this.element,this.floatLabelType,this.placeholder,this.createElement);break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.checkHtmlAttributes(!0);break;case"prependTemplate":this.updatePrependTemplate();break;case"appendTemplate":this.updateAppendTemplate();break;case"mask":var n=this.value;this.mask=t.mask,this.maskedRegExp=[],this.updateValue(n);break;case"promptChar":1<t.promptChar.length&&(t.promptChar=t.promptChar[0]),t.promptChar?this.promptChar=t.promptChar:this.promptChar="_";n=this.element.value.replace(new RegExp("["+e.promptChar+"]","g"),this.promptChar);this.promptMask===this.element.value&&(n=this.promptMask.replace(new RegExp("["+e.promptChar+"]","g"),this.promptChar)),this.promptMask=this.promptMask.replace(new RegExp("["+e.promptChar+"]","g"),this.promptChar),this.undoCollec=this.redoCollec=[],b.call(this,n)}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange},i.prototype.updatePrependTemplate=function(){this.removePrependTemplate(),this.createPrependTemplate()},i.prototype.updateAppendTemplate=function(){this.removeAppendTemplate(),this.createAppendTemplate()},i.prototype.templateComplier=function(e){if(e)try{return"function"!=typeof e&&E.selectAll(e,document).length?E.compile(E.select(e,document).innerHTML.trim()):E.compile(e)}catch(t){return E.compile(e)}},i.prototype.createPrependTemplate=function(){var t,e;E.isNullOrUndefined(this.prependTemplate)||(t=this.inputObj.container,this.prependedElement=this.createElement("div",{className:"e-prepend-template"}),this.iconTemplateFunction=this.templateComplier(this.prependTemplate),(e=this.iconTemplateFunction(null,this,"template",this.element.id+"Template",this.isStringTemplate,null,this.prependedElement))&&(e=[].slice.call(e),E.append(e,this.prependedElement)),e=t.querySelector("input"),t.classList.add("e-prepend-wrapper"),e?t.insertBefore(this.prependedElement,e):t.insertBefore(this.prependedElement,t.firstChild),this.handleFloatLabel(),this.renderReactTemplates())},i.prototype.createAppendTemplate=function(){var t,e;E.isNullOrUndefined(this.appendTemplate)||(t=this.inputObj.container,this.appendedElement=this.createElement("div",{className:"e-append-template"}),this.iconTemplateFunction=this.templateComplier(this.appendTemplate),(e=this.iconTemplateFunction(null,this,"template",this.element.id+"Template",this.isStringTemplate,null,this.appendedElement))&&(e=[].slice.call(e),E.append(e,this.appendedElement)),t.classList.add("e-append-wrapper"),t.appendChild(this.appendedElement),this.handleFloatLabel(),this.renderReactTemplates())},i.prototype.handleFloatLabel=function(){var t=this.inputObj.container.querySelector(".e-float-text");t&&"Auto"===this.floatLabelType&&setTimeout(function(){t&&this.prependedElement&&!this.enableRtl?(t.style.marginLeft=this.prependedElement.offsetWidth+"px",t.style.marginRight="0"):t&&this.prependedElement&&this.enableRtl&&(t.style.marginRight=this.prependedElement.offsetWidth+"px",t.style.marginLeft="0"),t&&t.classList.contains("e-label-bottom")&&(t.style.width=this.element.offsetWidth+"px")}.bind(this),5)},i.prototype.removePrependTemplate=function(){E.isNullOrUndefined(this.prependedElement)||(E.detach(this.prependedElement),this.prependedElement=null)},i.prototype.removeAppendTemplate=function(){E.isNullOrUndefined(this.appendedElement)||(E.detach(this.appendedElement),this.appendedElement=null)},i.prototype.updateValue=function(t){this.resetMaskedTextBox(),Ce.call(this,t)},i.prototype.getMaskedValue=function(){return Zt.call(this,this.element)},i.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.isFocus=!0,this.element.focus(),E.addClass([this.inputObj.container],[Oe]))},i.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.isFocus=!1,this.element.blur(),E.removeClass([this.inputObj.container],[Oe]))},i.prototype.getRightIconsWidth=function(){for(var t=0,e=this.inputObj.container.querySelectorAll(".e-input-group-icon, .e-clear-icon"),i=0;i<e.length;i++)t+=e[i].offsetWidth;return t},i.prototype.updateFloatLabelOverflowWidth=function(){var t=this.inputObj.container,e=t.querySelector(".e-float-text-overflow")||t.querySelector(".e-float-text"),t=t.clientWidth-this.getRightIconsWidth();!e||!t||this.cssClass&&-1!==this.cssClass.split(" ").indexOf("e-outline")||(e.style.width=t+"px")},i.prototype.destroy=function(){_t.call(this),this.removePrependTemplate(),this.removeAppendTemplate(),this.clearTemplate(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]);for(var t=["aria-labelledby","role","autocomplete","aria-readonly","aria-disabled","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-invalid"],e=0;e<t.length;e++)this.element.removeAttribute(t[e]);this.element.classList.remove("e-input"),this.inputObj&&(this.inputObj.container.insertAdjacentElement("afterend",this.element),E.detach(this.inputObj.container)),this.blurEventArgs=null,o.Input.destroy({element:this.element,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),this.changeEventArgs=null,this.inputObj=null,"EJS-MASKEDTEXTBOX"===this.element.tagName&&E.setValue("ej2_instances",null,this.element),Pe.prototype.destroy.call(this)},t([E.Property(null)],i.prototype,"cssClass",void 0),t([E.Property(null)],i.prototype,"width",void 0),t([E.Property(null)],i.prototype,"placeholder",void 0),t([E.Property("Never")],i.prototype,"floatLabelType",void 0),t([E.Property({})],i.prototype,"htmlAttributes",void 0),t([E.Property(!0)],i.prototype,"enabled",void 0),t([E.Property(!1)],i.prototype,"readonly",void 0),t([E.Property(!1)],i.prototype,"showClearButton",void 0),t([E.Property(!1)],i.prototype,"enablePersistence",void 0),t([E.Property(null)],i.prototype,"mask",void 0),t([E.Property("_")],i.prototype,"promptChar",void 0),t([E.Property(null)],i.prototype,"value",void 0),t([E.Property(null)],i.prototype,"customCharacters",void 0),t([E.Property(null)],i.prototype,"prependTemplate",void 0),t([E.Property(null)],i.prototype,"appendTemplate",void 0),t([E.Event()],i.prototype,"created",void 0),t([E.Event()],i.prototype,"destroyed",void 0),t([E.Event()],i.prototype,"change",void 0),t([E.Event()],i.prototype,"focus",void 0),t([E.Event()],i.prototype,"blur",void 0),t([E.NotifyPropertyChanges],i));function i(t,e){e=Pe.call(this,t,e)||this;return e.initInputValue="",e.preventChange=!1,e.isClicked=!1,e.maskOptions=t,e}Le=function(t,e){return(Le=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Le,ke,t=function(t,e){function i(){this.constructor=t}Le(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},s=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},Ae=(ke=E.ChildProperty,t(Ne,ke),s([E.Property("None")],Ne.prototype,"placement",void 0),s([E.Property(10)],Ne.prototype,"largeStep",void 0),s([E.Property(1)],Ne.prototype,"smallStep",void 0),s([E.Property(!1)],Ne.prototype,"showSmallTicks",void 0),s([E.Property(null)],Ne.prototype,"format",void 0),Ne);function Ne(){return null!==ke&&ke.apply(this,arguments)||this}He=E.ChildProperty,t(Re,He),s([E.Property(null)],Re.prototype,"color",void 0),s([E.Property(null)],Re.prototype,"start",void 0),s([E.Property(null)],Re.prototype,"end",void 0);var He,Be=Re;function Re(){return null!==He&&He.apply(this,arguments)||this}Ue=E.ChildProperty,t(Fe,Ue),s([E.Property(!1)],Fe.prototype,"enabled",void 0),s([E.Property(null)],Fe.prototype,"minStart",void 0),s([E.Property(null)],Fe.prototype,"minEnd",void 0),s([E.Property(null)],Fe.prototype,"maxStart",void 0),s([E.Property(null)],Fe.prototype,"maxEnd",void 0),s([E.Property(!1)],Fe.prototype,"startHandleFixed",void 0),s([E.Property(!1)],Fe.prototype,"endHandleFixed",void 0);var Ue,Ie=Fe;function Fe(){return null!==Ue&&Ue.apply(this,arguments)||this}Ve=E.ChildProperty,t(De,Ve),s([E.Property("")],De.prototype,"cssClass",void 0),s([E.Property("Before")],De.prototype,"placement",void 0),s([E.Property("Focus")],De.prototype,"showOn",void 0),s([E.Property(!1)],De.prototype,"isVisible",void 0),s([E.Property(null)],De.prototype,"format",void 0);var Ve,Me=De;function De(){return null!==Ve&&Ve.apply(this,arguments)||this}var We,ze=1e-10,qe="e-slider",je="e-rtl",_e="e-slider-input",Xe="e-control-wrapper",Ke="e-handle",Ye="e-range",Ze="e-slider-button",Ge="e-first-button",Je="e-second-button",$e="e-scale",Qe="e-tick",ti="e-large",ei="e-tick-value",ii="e-slider-tooltip",si="e-slider-hover",ni="e-handle-first",ai="e-handle-second",li="e-disabled",ri="e-slider-container",oi="e-slider-horizontal-before",hi="e-slider-horizontal-after",pi="e-slider-vertical-before",di="e-slider-vertical-after",ui="e-material-tooltip-open",ci="e-tooltip-active",mi="e-material-slider",fi="e-slider-track",vi="e-slider-horizantal-color",gi="e-slider-vertical-color",yi="e-handle-focused",bi="e-vertical",Ci="e-horizontal",Ei="e-handle-start",xi="e-material-tooltip-start",a="e-tab-handle",Si="e-button-icon",Ti="e-small-size",Pi="e-tick-pos",Oi="e-first-tick",wi="e-last-tick",Li="e-slider-btn",ki="e-tab-track",Ai="e-tab-range",Ni="e-handle-active",Hi="e-material-handle",Bi="e-material-range",Ri="e-material-default",Ui="e-material-tooltip-show",Ii="e-material-tooltip-hide",Fi="e-read-only",Vi="e-limits",Mi="e-limit-bar",Di="e-limit-first",Wi="e-limit-second",zi="e-drag-horizontal",qi="e-drag-vertical",ji=(We=E.Component,t(l,We),l.prototype.preRender=function(){this.l10n=new E.L10n("slider",{incrementTitle:"Increase",decrementTitle:"Decrease"},this.locale),this.isElementFocused=!1,this.tickElementCollection=[],this.tooltipFormatInfo={},this.ticksFormatInfo={},this.initCultureInfo(),this.initCultureFunc(),this.formChecker()},l.prototype.formChecker=function(){var t=E.closest(this.element,"form");t?(this.isForm=!0,E.isNullOrUndefined(this.formResetValue)||this.setProperties({value:this.formResetValue},!0),this.formResetValue=this.value,"Range"!==this.type||!E.isNullOrUndefined(this.formResetValue)&&"object"==typeof this.formResetValue?E.isNullOrUndefined(this.formResetValue)&&(this.formResetValue=parseFloat(E.formatUnit(this.min))):this.formResetValue=[parseFloat(E.formatUnit(this.min)),parseFloat(E.formatUnit(this.max))],this.formElement=t):this.isForm=!1},l.prototype.initCultureFunc=function(){this.internationalization=new E.Internationalization(this.locale)},l.prototype.initCultureInfo=function(){this.tooltipFormatInfo.format=E.isNullOrUndefined(this.tooltip.format)?null:this.tooltip.format,this.ticksFormatInfo.format=E.isNullOrUndefined(this.ticks.format)?null:this.ticks.format},l.prototype.formatString=function(t,e){var i,s=null,n=null;return!t&&0!==t||(s=this.formatNumber(t),i=this.numberOfDecimals(t),n=this.internationalization.getNumberFormat(e)(this.makeRoundNumber(t,i))),{elementVal:s,formatString:n}},l.prototype.formatNumber=function(t){var e=this.numberOfDecimals(t);return this.internationalization.getNumberFormat({maximumFractionDigits:e,minimumFractionDigits:e,useGrouping:!1})(t)},l.prototype.numberOfDecimals=function(t){t=t.toString().split(".")[1];return t&&t.length?t.length:0},l.prototype.makeRoundNumber=function(t,e){return Number(t.toFixed(e||0))},l.prototype.render=function(){var t=this;this.initialize(),this.initRender(),this.wireEvents(),this.setZindex(),this.renderComplete(),"EJS-SLIDER"===this.element.tagName&&"none"===this.getTheme(this.sliderContainer)&&setTimeout(function(){t.refresh()},0)},l.prototype.initialize=function(){E.addClass([this.element],qe),this.setCSSClass()},l.prototype.setElementWidth=function(t){E.isNullOrUndefined(t)||E.isNullOrUndefined(this.sliderContainer)||("number"==typeof t?this.sliderContainer.style.width=E.formatUnit(t):"string"==typeof t&&(this.sliderContainer.style.width=t.match(/px|%|em/)?t:E.formatUnit(t)))},l.prototype.setCSSClass=function(t){t&&E.removeClass([this.element],t.split(" ")),this.cssClass&&E.addClass([this.element],this.cssClass.split(" "))},l.prototype.setEnabled=function(){this.enabled?(E.removeClass([this.sliderContainer],[li]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.remove(li),this.wireEvents()):(E.addClass([this.sliderContainer],[li]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.add(li),this.unwireEvents())},l.prototype.getTheme=function(t){return window.getComputedStyle(t,":after").getPropertyValue("content").replace(/['"]+/g,"")},l.prototype.secureRandom=function(){var t=new Uint32Array(1);return window.crypto.getRandomValues(t),t[0]/4294967296},l.prototype.initRender=function(){this.sliderContainer=this.createElement("div",{className:ri+" "+Xe}),this.element.parentNode.insertBefore(this.sliderContainer,this.element),this.sliderContainer.appendChild(this.element),this.sliderTrack=this.createElement("div",{className:fi}),this.element.appendChild(this.sliderTrack),this.setElementWidth(this.width),this.element.tabIndex=-1,this.getThemeInitialization(),this.setHandler(),this.createRangeBar(),this.limits.enabled&&this.createLimitBar(),this.setOrientClass(),this.hiddenInput=this.createElement("input",{attrs:{type:"hidden",value:E.isNullOrUndefined(this.value)?E.isNullOrUndefined(this.min)?"0":this.min.toString():this.value.toString(),name:this.element.getAttribute("name")||this.element.getAttribute("id")||"_"+(1e3*this.secureRandom()).toFixed(0)+"slider",class:_e}}),this.hiddenInput.tabIndex=-1,this.sliderContainer.appendChild(this.hiddenInput),this.showButtons&&this.setButtons(),this.setEnableRTL(),"Range"===this.type?this.rangeValueUpdate():this.value=E.isNullOrUndefined(this.value)?E.isNullOrUndefined(this.min)?0:parseFloat(E.formatUnit(this.min.toString())):this.value,this.previousVal="Range"!==this.type?this.checkHandleValue(parseFloat(E.formatUnit(this.value.toString()))):[this.checkHandleValue(parseFloat(E.formatUnit(this.value[0].toString()))),this.checkHandleValue(parseFloat(E.formatUnit(this.value[1].toString())))],this.previousChanged=this.previousVal,E.isNullOrUndefined(this.element.hasAttribute("name"))||this.element.removeAttribute("name"),this.setValue(),this.limits.enabled&&this.setLimitBar(),"None"!==this.ticks.placement&&this.renderScale(),this.tooltip.isVisible&&this.renderTooltip(),this.enabled?E.removeClass([this.sliderContainer],[li]):E.addClass([this.sliderContainer],[li]),this.readonly?E.addClass([this.sliderContainer],[Fi]):E.removeClass([this.sliderContainer],[Fi])},l.prototype.getThemeInitialization=function(){this.isMaterial="material"===this.getTheme(this.sliderContainer)||"material-dark"===this.getTheme(this.sliderContainer),this.isMaterial3="Material3"===this.getTheme(this.sliderContainer)||"Material3-dark"===this.getTheme(this.sliderContainer),this.isBootstrap="bootstrap"===this.getTheme(this.sliderContainer)||"bootstrap-dark"===this.getTheme(this.sliderContainer),this.isBootstrap4="bootstrap4"===this.getTheme(this.sliderContainer),this.isTailwind="tailwind"===this.getTheme(this.sliderContainer)||"tailwind-dark"===this.getTheme(this.sliderContainer),this.isTailwind3="tailwind3"===this.getTheme(this.sliderContainer)||"tailwind3-dark"===this.getTheme(this.sliderContainer),this.isBootstrap5="bootstrap5"===this.getTheme(this.sliderContainer),this.isFluent="FluentUI"===this.getTheme(this.sliderContainer),this.isFluent2="fluent2"===this.getTheme(this.sliderContainer),this.isBootstrap5Dot3="bootstrap5.3"===this.getTheme(this.sliderContainer),this.isMaterialTooltip=(this.isMaterial||this.isMaterial3)&&"Range"!==this.type&&this.tooltip.isVisible},l.prototype.createRangeBar=function(){"Default"!==this.type&&(this.rangeBar=this.createElement("div",{attrs:{class:Ye}}),this.element.appendChild(this.rangeBar),this.drag)&&"Range"===this.type&&("Horizontal"===this.orientation?this.rangeBar.classList.add(zi):this.rangeBar.classList.add(qi))},l.prototype.createLimitBar=function(){var t="Range"!==this.type?Mi:Di;t+=" "+Vi,this.limitBarFirst=this.createElement("div",{attrs:{class:t}}),this.element.appendChild(this.limitBarFirst),"Range"===this.type&&(this.limitBarSecond=this.createElement("div",{attrs:{class:Wi+" "+Vi}}),this.element.appendChild(this.limitBarSecond))},l.prototype.setOrientClass=function(){"Vertical"!==this.orientation?(this.sliderContainer.classList.remove(bi),this.sliderContainer.classList.add(Ci),this.firstHandle.setAttribute("aria-orientation","horizontal"),"Range"===this.type&&this.secondHandle.setAttribute("aria-orientation","horizontal")):(this.sliderContainer.classList.remove(Ci),this.sliderContainer.classList.add(bi),this.firstHandle.setAttribute("aria-orientation","vertical"),"Range"===this.type&&this.secondHandle.setAttribute("aria-orientation","vertical"))},l.prototype.setAriaAttributes=function(t){var i=this,e=this.min,s=this.max;!E.isNullOrUndefined(this.customValues)&&0<this.customValues.length&&(e=this.customValues[0],s=this.customValues[this.customValues.length-1]),"Range"!==this.type?E.attributes(t,{"aria-valuemin":E.isNullOrUndefined(e)?"0":e.toString(),"aria-valuemax":E.isNullOrUndefined(s)?"100":s.toString()}):(!E.isNullOrUndefined(this.customValues)&&0<this.customValues.length?[[E.isNullOrUndefined(e)?"":e.toString(),1<this.value.length&&!E.isNullOrUndefined(this.customValues[this.value[1]])?this.customValues[this.value[1]].toString():""],[0<this.value.length&&!E.isNullOrUndefined(this.customValues[this.value[0]])?this.customValues[this.value[0]].toString():"",E.isNullOrUndefined(s)?"":s.toString()]]:[[E.isNullOrUndefined(e)?"":e.toString(),1<this.value.length&&!E.isNullOrUndefined(this.value[1])?this.value[1].toString():""],[0<this.value.length&&!E.isNullOrUndefined(this.value[0])?this.value[0].toString():"",E.isNullOrUndefined(s)?"":s.toString()]]).forEach(function(t,e){e=0===e?i.firstHandle:i.secondHandle;e&&E.attributes(e,{"aria-valuemin":t[0],"aria-valuemax":t[1]})})},l.prototype.createSecondHandle=function(){this.secondHandle=this.createElement("div",{attrs:{class:Ke,role:"slider",tabIndex:"0","aria-label":"slider"}}),this.secondHandle.classList.add(ai),this.element.appendChild(this.secondHandle)},l.prototype.createFirstHandle=function(){this.firstHandle=this.createElement("div",{attrs:{class:Ke,role:"slider",tabIndex:"0","aria-label":"slider"}}),this.firstHandle.classList.add(ni),this.element.appendChild(this.firstHandle),this.isMaterialTooltip&&(this.materialHandle=this.createElement("div",{attrs:{class:Ke+" "+Hi}}),this.element.appendChild(this.materialHandle))},l.prototype.wireFirstHandleEvt=function(t){t?(E.EventHandler.remove(this.firstHandle,"mousedown touchstart",this.handleFocus),E.EventHandler.remove(this.firstHandle,"transitionend",this.transitionEnd),E.EventHandler.remove(this.firstHandle,"mouseenter touchenter",this.handleOver),E.EventHandler.remove(this.firstHandle,"mouseleave touchend",this.handleLeave)):(E.EventHandler.add(this.firstHandle,"mousedown touchstart",this.handleFocus,this),E.EventHandler.add(this.firstHandle,"transitionend",this.transitionEnd,this),E.EventHandler.add(this.firstHandle,"mouseenter touchenter",this.handleOver,this),E.EventHandler.add(this.firstHandle,"mouseleave touchend",this.handleLeave,this))},l.prototype.wireSecondHandleEvt=function(t){t?(E.EventHandler.remove(this.secondHandle,"mousedown touchstart",this.handleFocus),E.EventHandler.remove(this.secondHandle,"transitionend",this.transitionEnd),E.EventHandler.remove(this.secondHandle,"mouseenter touchenter",this.handleOver),E.EventHandler.remove(this.secondHandle,"mouseleave touchend",this.handleLeave)):(E.EventHandler.add(this.secondHandle,"mousedown touchstart",this.handleFocus,this),E.EventHandler.add(this.secondHandle,"transitionend",this.transitionEnd,this),E.EventHandler.add(this.secondHandle,"mouseenter touchenter",this.handleOver,this),E.EventHandler.add(this.secondHandle,"mouseleave touchend",this.handleLeave,this))},l.prototype.handleStart=function(){"Range"!==this.type&&(this.firstHandle.classList[0===this.handlePos1?"add":"remove"](Ei),this.isMaterialTooltip)&&(this.materialHandle.classList[0===this.handlePos1?"add":"remove"](Ei),this.tooltipElement)&&this.tooltipElement.classList[0===this.handlePos1?"add":"remove"](xi)},l.prototype.transitionEnd=function(t){"transform"!==t.propertyName&&(this.handleStart(),this.enableAnimation||(this.getHandle().style.transition="none"),"Default"!==this.type&&(this.rangeBar.style.transition="none"),(this.isMaterial||this.isMaterial3)&&this.tooltip.isVisible&&"Default"===this.type&&(this.tooltipElement.style.transition=this.transition.handle),this.tooltipToggle(this.getHandle()),this.closeTooltip())},l.prototype.handleFocusOut=function(){this.firstHandle.classList.contains(yi)&&this.firstHandle.classList.remove(yi),"Range"===this.type&&this.secondHandle.classList.contains(yi)&&this.secondHandle.classList.remove(yi)},l.prototype.handleFocus=function(t){this.focusSliderElement(),this.sliderBarClick(t),(t.currentTarget===this.firstHandle?(this.firstHandle.classList.add(yi),this.firstHandle):(this.secondHandle.classList.add(yi),this.secondHandle)).classList.add(a),E.EventHandler.add(document,"mousemove touchmove",this.sliderBarMove,this),E.EventHandler.add(document,"mouseup touchend",this.sliderBarUp,this)},l.prototype.handleOver=function(t){this.tooltip.isVisible&&"Hover"===this.tooltip.showOn&&this.tooltipToggle(t.currentTarget),"Default"===this.type&&this.tooltipToggle(this.getHandle())},l.prototype.handleLeave=function(t){!this.tooltip.isVisible||"Hover"!==this.tooltip.showOn||t.currentTarget.classList.contains(yi)||t.currentTarget.classList.contains(a)||this.closeTooltip()},l.prototype.setHandler=function(){this.createFirstHandle(),"Range"===this.type&&this.createSecondHandle()},l.prototype.setEnableRTL=function(){this.enableRtl&&"Vertical"!==this.orientation?E.addClass([this.sliderContainer],je):E.removeClass([this.sliderContainer],je);var t="Vertical"!==this.orientation?this.horDir:this.verDir;this.enableRtl?this.horDir="right":this.horDir="left",this.verDir="bottom",t!==("Vertical"!==this.orientation?this.horDir:this.verDir)&&"Horizontal"===this.orientation&&(E.setStyleAttribute(this.firstHandle,{right:"",left:"auto"}),"Range"===this.type)&&E.setStyleAttribute(this.secondHandle,{top:"",left:"auto"}),this.setBarColor()},l.prototype.tooltipValue=function(){var e,i=this,t={value:this.value,text:""};this.initialTooltip&&(this.initialTooltip=!1,this.setTooltipContent(),t.text=e="function"==typeof this.tooltipObj.content?this.tooltipObj.content():this.tooltipObj.content,this.trigger("tooltipChange",t,function(t){i.addTooltipClass(t.text),e!==t.text&&(i.customAriaText=t.text,i.enableHtmlSanitizer?t.text=E.SanitizeHtmlHelper.sanitize(t.text.toString()):t.text=t.text.toString(),i.tooltipObj.content=E.initializeCSPTemplate(function(){return t.text}),i.setAriaAttrValue(i.firstHandle),"Range"===i.type)&&i.setAriaAttrValue(i.secondHandle)}),this.isMaterialTooltip)&&this.setPreviousVal("change",this.value)},l.prototype.setTooltipContent=function(){var t=this.formatContent(this.tooltipFormatInfo,!1);this.tooltipObj.content=E.initializeCSPTemplate(function(){return t})},l.prototype.formatContent=function(t,e){var i="",s=this.handleVal1,n=this.handleVal2;return!E.isNullOrUndefined(this.customValues)&&0<this.customValues.length&&(s=this.customValues[this.handleVal1],n=this.customValues[this.handleVal2]),e?"Range"===this.type?i=this.enableRtl&&"Vertical"!==this.orientation?E.isNullOrUndefined(this.tooltip)||E.isNullOrUndefined(this.tooltip.format)?n.toString()+" - "+s.toString():this.formatString(n,t).elementVal+" - "+this.formatString(s,t).elementVal:E.isNullOrUndefined(this.tooltip)||E.isNullOrUndefined(this.tooltip.format)?s.toString()+" - "+n.toString():this.formatString(s,t).elementVal+" - "+this.formatString(n,t).elementVal:E.isNullOrUndefined(s)||(i=E.isNullOrUndefined(this.tooltip)||E.isNullOrUndefined(this.tooltip.format)?s.toString():this.formatString(s,t).elementVal):"Range"===this.type?i=this.enableRtl&&"Vertical"!==this.orientation?E.isNullOrUndefined(t.format)?n.toString()+" - "+s.toString():this.formatString(n,t).formatString+" - "+this.formatString(s,t).formatString:E.isNullOrUndefined(t.format)?s.toString()+" - "+n.toString():this.formatString(s,t).formatString+" - "+this.formatString(n,t).formatString:E.isNullOrUndefined(s)||(i=E.isNullOrUndefined(t.format)?s.toString():this.formatString(s,t).formatString),i},l.prototype.addTooltipClass=function(t){var e;this.isMaterialTooltip&&(t=t.toString().length,this.tooltipElement?(e=4<t?{oldCss:Ri,newCss:Bi}:{oldCss:Bi,newCss:Ri},this.tooltipElement.classList.remove(e.oldCss),this.tooltipElement.classList.contains(e.newCss)||(this.tooltipElement.classList.add(e.newCss),this.tooltipElement.style.transform=4<t?"scale(1)":this.getTooltipTransformProperties(this.previousTooltipClass).rotate)):(e=4<t?Bi:Ri,this.tooltipObj.cssClass=ii+" "+e))},l.prototype.tooltipPlacement=function(){return"Horizontal"===this.orientation?"Before"===this.tooltip.placement?"TopCenter":"BottomCenter":"Before"===this.tooltip.placement?"LeftCenter":"RightCenter"},l.prototype.tooltipBeforeOpen=function(t){this.tooltipElement=t.element,this.tooltip.cssClass&&E.addClass([this.tooltipElement],this.tooltip.cssClass.split(" ").filter(function(t){return t})),t.target.removeAttribute("aria-describedby"),this.isMaterialTooltip&&(this.tooltipElement.firstElementChild.classList.add(Ii),this.handleStart(),this.setTooltipTransform())},l.prototype.tooltipCollision=function(t){if(this.isBootstrap||this.isBootstrap4||(this.isMaterial||this.isMaterial3)&&!this.isMaterialTooltip){var e=this.isBootstrap4?3:6;switch(t){case"TopCenter":this.tooltipObj.setProperties({offsetY:-e},!1);break;case"BottomCenter":this.tooltipObj.setProperties({offsetY:e},!1);break;case"LeftCenter":this.tooltipObj.setProperties({offsetX:-e},!1);break;case"RightCenter":this.tooltipObj.setProperties({offsetX:e},!1)}}},l.prototype.materialTooltipEventCallBack=function(t){this.sliderBarClick(t),E.EventHandler.add(document,"mousemove touchmove",this.sliderBarMove,this),E.EventHandler.add(document,"mouseup touchend",this.sliderBarUp,this)},l.prototype.wireMaterialTooltipEvent=function(t){this.isMaterialTooltip&&(t?E.EventHandler.remove(this.tooltipElement,"mousedown touchstart",this.materialTooltipEventCallBack):E.EventHandler.add(this.tooltipElement,"mousedown touchstart",this.materialTooltipEventCallBack,this))},l.prototype.tooltipPositionCalculation=function(t){var e;switch(t){case"TopCenter":e=oi;break;case"BottomCenter":e=hi;break;case"LeftCenter":e=pi;break;case"RightCenter":e=di}return e},l.prototype.getTooltipTransformProperties=function(t){var e;return this.tooltipElement&&(e="Horizontal"===this.orientation?this.tooltipElement.clientHeight+14-this.tooltipElement.clientHeight/2:this.tooltipElement.clientWidth+14-this.tooltipElement.clientWidth/2,e="Horizontal"===this.orientation?t===oi?{rotate:"rotate(45deg)",translate:"translateY("+e+"px)"}:{rotate:"rotate(225deg)",translate:"translateY("+-e+"px)"}:t===pi?{rotate:"rotate(-45deg)",translate:"translateX("+e+"px)"}:{rotate:"rotate(-225deg)",translate:"translateX("+-e+"px)"}),e},l.prototype.openMaterialTooltip=function(){var t,e=this;this.isMaterialTooltip&&(this.refreshTooltip(this.firstHandle),(t=this.tooltipElement.firstElementChild).classList.remove(Ii),t.classList.add(Ui),this.firstHandle.style.cursor="default",this.tooltipElement.style.transition=this.scaleTransform,this.tooltipElement.classList.add(ui),this.materialHandle.style.transform="scale(0)",4<t.innerText.length?this.tooltipElement.style.transform="scale(1)":this.tooltipElement.style.transform=this.getTooltipTransformProperties(this.previousTooltipClass).rotate,"Default"===this.type?setTimeout(function(){e.tooltipElement&&(e.tooltipElement.style.transition=e.transition.handle)},2500):setTimeout(function(){e.tooltipElement&&(e.tooltipElement.style.transition="none")},2500))},l.prototype.closeMaterialTooltip=function(){var t,e=this;this.isMaterialTooltip&&(t=this.tooltipElement.firstElementChild,this.tooltipElement.style.transition=this.scaleTransform,t.classList.remove(Ui),t.classList.add(Ii),this.firstHandle.style.cursor="-webkit-grab",this.firstHandle.style.cursor="grab",this.materialHandle&&(this.materialHandle.style.transform="scale(1)"),this.tooltipElement.classList.remove(ui),this.setTooltipTransform(),this.tooltipTarget=void 0,setTimeout(function(){e.tooltipElement&&(e.tooltipElement.style.transition="none")},2500))},l.prototype.checkTooltipPosition=function(t){var e=this.tooltipPositionCalculation(t.collidedPosition);void 0!==this.tooltipCollidedPosition&&this.tooltipCollidedPosition===t.collidedPosition&&t.element.classList.contains(e)||(this.isMaterialTooltip&&(void 0!==e&&(t.element.classList.remove(this.previousTooltipClass),t.element.classList.add(e),this.previousTooltipClass=e),t.element.style.transform)&&t.element.classList.contains(ui)&&t.element.firstElementChild.innerText.length<=4&&(t.element.style.transform=this.getTooltipTransformProperties(this.previousTooltipClass).rotate),this.tooltipCollidedPosition=t.collidedPosition),this.isMaterialTooltip&&this.tooltipElement&&-1!==this.tooltipElement.style.transform.indexOf("translate")&&this.setTooltipTransform()},l.prototype.setTooltipTransform=function(){var t=this.getTooltipTransformProperties(this.previousTooltipClass);E.isNullOrUndefined(this.tooltipElement)||(4<this.tooltipElement.firstElementChild.innerText.length?this.tooltipElement.style.transform=t.translate+" scale(0.01)":this.tooltipElement.style.transform=t.translate+" "+t.rotate+" scale(0.01)")},l.prototype.renderTooltip=function(){this.tooltipObj=new h.Tooltip({showTipPointer:this.isBootstrap||this.isMaterial||this.isMaterial3||this.isBootstrap4||this.isTailwind||this.isTailwind3||this.isBootstrap5||this.isFluent||this.isFluent2||this.isBootstrap5Dot3,cssClass:ii,height:this.isMaterial||this.isMaterial3?30:"auto",animation:{open:{effect:"None"},close:{effect:"FadeOut",duration:500}},opensOn:"Custom",beforeOpen:this.tooltipBeforeOpen.bind(this),beforeCollision:this.checkTooltipPosition.bind(this),beforeClose:this.tooltipBeforeClose.bind(this),enableHtmlSanitizer:this.enableHtmlSanitizer}),this.tooltipObj.appendTo(this.firstHandle),this.initializeTooltipProps()},l.prototype.initializeTooltipProps=function(){var t="Auto"===this.tooltip.showOn?"Hover":this.tooltip.showOn;this.setProperties({tooltip:{showOn:t}},!0),this.tooltipObj.position=this.tooltipPlacement(),this.tooltipCollision(this.tooltipObj.position),[this.firstHandle,this.rangeBar,this.secondHandle].forEach(function(t){E.isNullOrUndefined(t)||(t.style.transition="none")}),this.isMaterialTooltip&&(this.sliderContainer.classList.add(mi),this.tooltipValue(),this.tooltipObj.animation.close.effect="None",this.tooltipObj.open(this.firstHandle))},l.prototype.tooltipBeforeClose=function(){this.tooltipElement=void 0,this.tooltipCollidedPosition=void 0},l.prototype.setButtons=function(){this.firstBtn=this.createElement("div",{className:Ze+" "+Ge}),this.firstBtn.appendChild(this.createElement("span",{className:Si})),(this.isTailwind||this.isTailwind3)&&this.firstBtn.querySelector("span").classList.add("e-icons"),this.firstBtn.tabIndex=-1,this.secondBtn=this.createElement("div",{className:Ze+" "+Je}),this.secondBtn.appendChild(this.createElement("span",{className:Si})),(this.isTailwind||this.isTailwind3)&&this.secondBtn.querySelector("span").classList.add("e-icons"),this.secondBtn.tabIndex=-1,this.sliderContainer.classList.add(Li),this.sliderContainer.appendChild(this.firstBtn),this.sliderContainer.appendChild(this.secondBtn),this.sliderContainer.appendChild(this.element),this.buttonTitle()},l.prototype.buttonTitle=function(){var t=this.enableRtl&&"Vertical"!==this.orientation,e=(this.l10n.setLocale(this.locale),this.l10n.getConstant("decrementTitle")),i=this.l10n.getConstant("incrementTitle");E.attributes(t?this.secondBtn:this.firstBtn,{"aria-label":e,title:e}),E.attributes(t?this.firstBtn:this.secondBtn,{"aria-label":i,title:i})},l.prototype.buttonFocusOut=function(){(this.isMaterial||this.isMaterial3)&&this.getHandle().classList.remove("e-large-thumb-size")},l.prototype.repeatButton=function(t){var e,i=this.handleValueUpdate(),s=this.enableRtl&&"Vertical"!==this.orientation;t.target.parentElement.classList.contains(Ge)||t.target.classList.contains(Ge)?e=s?this.add(i,parseFloat(this.step.toString()),!0):this.add(i,parseFloat(this.step.toString()),!1):(t.target.parentElement.classList.contains(Je)||t.target.classList.contains(Je))&&(e=s?this.add(i,parseFloat(this.step.toString()),!1):this.add(i,parseFloat(this.step.toString()),!0)),(e=this.limits.enabled?this.getLimitCorrectedValues(e):e)>=this.min&&e<=this.max&&(this.changeHandleValue(e,t),this.tooltipToggle(this.getHandle()))},l.prototype.repeatHandlerMouse=function(t){t.preventDefault(),"mousedown"!==t.type&&"touchstart"!==t.type||(this.buttonClick(t),this.repeatInterval=setInterval(this.repeatButton.bind(this),180,t))},l.prototype.materialChange=function(){this.getHandle().classList.contains("e-large-thumb-size")||this.getHandle().classList.add("e-large-thumb-size")},l.prototype.focusHandle=function(){this.getHandle().classList.contains(a)||this.getHandle().classList.add(a)},l.prototype.repeatHandlerUp=function(t){this.changeEvent("changed",t),this.closeTooltip(),clearInterval(this.repeatInterval),this.getHandle().focus()},l.prototype.customTickCounter=function(t){var e=4;return e=!E.isNullOrUndefined(this.customValues)&&0<this.customValues.length&&(4<t&&(e=3),7<t&&(e=2),14<t&&(e=1),28<t)?0:e},l.prototype.renderScale=function(){var t="Vertical"===this.orientation?"v":"h",e=(this.ul=this.createElement("ul",{className:$e+" e-"+t+"-scale "+Qe+"-"+this.ticks.placement.toLowerCase(),attrs:{role:"presentation","aria-hidden":"true"}}),this.ul.style.zIndex="-1",E.Browser.isAndroid&&"h"==t&&this.ul.classList.add(Pi),this.ticks.smallStep),i=(this.ticks.showSmallTicks?e<=0&&(e=parseFloat(E.formatUnit(this.step))):e=0<this.ticks.largeStep?this.ticks.largeStep:parseFloat(E.formatUnit(this.max))-parseFloat(E.formatUnit(this.min)),parseFloat(E.formatUnit(this.min))),s=parseFloat(E.formatUnit(this.max)),n=parseFloat(E.formatUnit(e)),a=!E.isNullOrUndefined(this.customValues)&&0<this.customValues.length&&this.customValues.length-1,l=this.customTickCounter(a),r=!E.isNullOrUndefined(this.customValues)&&0<this.customValues.length?a*l+a:Math.abs((s-i)/n),o=(this.element.appendChild(this.ul),parseFloat(this.min.toString())),h=("v"==t&&(o=parseFloat(this.max.toString())),0),p=100/r;p===1/0&&(p=5);for(var d=0,u=!E.isNullOrUndefined(this.customValues)&&0<this.customValues.length?this.customValues.length-1:0,c=0;d<=r;d++){var m,f,v,g=this.createElement("li",{attrs:{class:Qe,role:"presentation","aria-hidden":"true"}}),y=(!E.isNullOrUndefined(this.customValues)&&0<this.customValues.length?(m=d%(l+1)==0)&&("h"==t?(o=this.customValues[c],c++):(o=this.customValues[u],u--),g.setAttribute("title",o.toString())):(g.setAttribute("title",o.toString()),m=0===this.numberOfDecimals(this.max)&&0===this.numberOfDecimals(this.min)&&0===this.numberOfDecimals(this.step)?(v="h"==t?(o-parseFloat(this.min.toString()))%this.ticks.largeStep:Math.abs(o-parseFloat(this.max.toString()))%this.ticks.largeStep,Math.abs(v)<ze||Math.abs(this.ticks.largeStep-v)<ze):(f=this.ticks.largeStep,C=o,v="h"==t?(C-i)%f:Math.abs(C-parseFloat(s.toString()))%f,Math.abs(v)<ze||Math.abs(f-v)<ze)),m&&g.classList.add(ti),"h"==t?g.style.width=p+"%":g.style.height=p+"%",m?"Both"===this.ticks.placement?2:1:0);if(m)for(var b=0;b<y;b++)this.createTick(g,o);else E.isNullOrUndefined(this.customValues)&&this.formatTicksValue(g,o);this.ul.appendChild(g),this.tickElementCollection.push(g);var C=void 0;E.isNullOrUndefined(this.customValues)&&(C=this.numberOfDecimals(e)>this.numberOfDecimals(o)?this.numberOfDecimals(e):this.numberOfDecimals(o),o="h"==t||this.min>this.max?this.makeRoundNumber(o+e,C):this.makeRoundNumber(o-e,C),h=this.makeRoundNumber(h+e,C))}this.ticksAlignment(t,p)},l.prototype.ticksAlignment=function(t,e,i){void 0===i&&(i=!0),this.firstChild=this.ul.firstElementChild,this.lastChild=this.ul.lastElementChild,this.firstChild.classList.add(Oi),this.lastChild.classList.add(wi),this.sliderContainer.classList.add($e+"-"+this.ticks.placement.toLowerCase()),"h"===t?(this.firstChild.style.width=e/2+"%",this.lastChild.style.width=e/2+"%"):(this.firstChild.style.height=e/2+"%",this.lastChild.style.height=e/2+"%");t={ticksWrapper:this.ul,tickElements:this.tickElementCollection};i&&this.trigger("renderedTicks",t),this.scaleAlignment()},l.prototype.createTick=function(t,e){var i=this.createElement("span",{className:ei+" "+Qe+"-"+this.ticks.placement.toLowerCase(),attrs:{role:"presentation","aria-hidden":"true"}});t.appendChild(i),E.isNullOrUndefined(this.customValues)?this.formatTicksValue(t,e,i):this.enableHtmlSanitizer?i.innerHTML=E.SanitizeHtmlHelper.sanitize(e.toString()):i.innerHTML=e.toString()},l.prototype.formatTicksValue=function(e,t,i){var s=this,n=this.formatNumber(t),n=E.isNullOrUndefined(this.ticks)||E.isNullOrUndefined(this.ticks.format)?n:this.formatString(t,this.ticksFormatInfo).formatString;this.trigger("renderingTicks",{value:t,text:n,tickElement:e},function(t){e.setAttribute("title",t.text.toString()),i&&(s.enableHtmlSanitizer?i.innerHTML=E.SanitizeHtmlHelper.sanitize(t.text.toString()):i.innerHTML=t.text.toString())})},l.prototype.scaleAlignment=function(){this.tickValuePosition(),"Vertical"===this.orientation?this.element.getBoundingClientRect().width<=15?this.sliderContainer.classList.add(Ti):this.sliderContainer.classList.remove(Ti):this.element.getBoundingClientRect().height<=15?this.sliderContainer.classList.add(Ti):this.sliderContainer.classList.remove(Ti)},l.prototype.tickValuePosition=function(){this.firstChild=this.element.querySelector("ul").children[0];for(var t,e,i=this.firstChild.getBoundingClientRect(),s=this.ticks.smallStep,s=Math.abs(parseFloat(E.formatUnit(this.max))-parseFloat(E.formatUnit(this.min)))/s,n=(0<this.firstChild.children.length&&(t=this.firstChild.children[0].getBoundingClientRect()),[this.sliderContainer.querySelectorAll("."+Qe+"."+ti+" ."+ei)]),a="Both"===this.ticks.placement?[].slice.call(n[0],2):[].slice.call(n[0],1),l="Vertical"===this.orientation?2*i.height:2*i.width,r=0;r<this.firstChild.children.length;r++)"Vertical"===this.orientation?this.firstChild.children[r].style.top=-t.height/2+"px":this.enableRtl?this.firstChild.children[r].style.left=(l-this.firstChild.children[r].getBoundingClientRect().width)/2+"px":this.firstChild.children[r].style.left=-t.width/2+"px";for(r=0;r<a.length;r++)e=a[r].getBoundingClientRect(),"Vertical"===this.orientation?E.setStyleAttribute(a[r],{top:(l-e.height)/2+"px"}):E.setStyleAttribute(a[r],{left:(l-e.width)/2+"px"});this.enableRtl&&this.lastChild.children.length&&0!=s&&(this.lastChild.children[0].style.left=-this.lastChild.getBoundingClientRect().width/2+"px","Both"===this.ticks.placement)&&(this.lastChild.children[1].style.left=-this.lastChild.getBoundingClientRect().width/2+"px"),0==s&&("Horizontal"===this.orientation&&(this.enableRtl?(this.firstChild.classList.remove(wi),this.firstChild.style.right=this.firstHandle.style.right,this.firstChild.children[0].style.left=this.firstChild.getBoundingClientRect().width/2+2+"px","Both"===this.ticks.placement&&(this.firstChild.children[1].style.left=this.firstChild.getBoundingClientRect().width/2+2+"px")):(this.firstChild.classList.remove(wi),this.firstChild.style.left=this.firstHandle.style.left)),"Vertical"===this.orientation)&&this.firstChild.classList.remove(wi)},l.prototype.setAriaAttrValue=function(t){var e=!E.isNullOrUndefined(this.ticks)&&!E.isNullOrUndefined(this.ticks.format),i=e?this.formatContent(this.tooltipFormatInfo,!1):this.formatContent(this.ticksFormatInfo,!1),e=e?this.formatContent(this.ticksFormatInfo,!0):this.formatContent(this.tooltipFormatInfo,!0),s=2===(i=this.customAriaText||i).split(" - ").length?i.split(" - "):[i,i];this.setAriaAttributes(t),"Range"!==this.type?E.attributes(t,{"aria-valuenow":e,"aria-valuetext":i}):this.enableRtl?t===this.firstHandle?E.attributes(t,{"aria-valuenow":e.split(" - ")[1],"aria-valuetext":s[1]}):E.attributes(t,{"aria-valuenow":e.split(" - ")[0],"aria-valuetext":s[0]}):t===this.firstHandle?E.attributes(t,{"aria-valuenow":e.split(" - ")[0],"aria-valuetext":s[0]}):E.attributes(t,{"aria-valuenow":e.split(" - ")[1],"aria-valuetext":s[1]})},l.prototype.handleValueUpdate=function(){var t="Range"!==this.type||1===this.activeHandle?this.handleVal1:this.handleVal2;return t},l.prototype.getLimitCorrectedValues=function(t){return t=("MinRange"===this.type||"Default"===this.type||1===this.activeHandle?this.getLimitValueAndPosition(t,this.limits.minStart,this.limits.minEnd):this.getLimitValueAndPosition(t,this.limits.maxStart,this.limits.maxEnd))[0]},l.prototype.focusSliderElement=function(){this.isElementFocused||(this.element.focus(),this.isElementFocused=!0)},l.prototype.buttonClick=function(t){this.focusSliderElement();var e,i=this.enableRtl&&"Vertical"!==this.orientation,s=this.handleValueUpdate();40===t.keyCode||37===t.keyCode||t.currentTarget.classList.contains(Ge)?e=i?this.add(s,parseFloat(this.step.toString()),!0):this.add(s,parseFloat(this.step.toString()),!1):38===t.keyCode||39===t.keyCode||t.currentTarget.classList.contains(Je)?e=i?this.add(s,parseFloat(this.step.toString()),!1):this.add(s,parseFloat(this.step.toString()),!0):33===t.keyCode||t.currentTarget.classList.contains(Ge)?e=i?this.add(s,parseFloat(this.ticks.largeStep.toString()),!1):this.add(s,parseFloat(this.ticks.largeStep.toString()),!0):34===t.keyCode||t.currentTarget.classList.contains(Je)?e=i?this.add(s,parseFloat(this.ticks.largeStep.toString()),!0):this.add(s,parseFloat(this.ticks.largeStep.toString()),!1):36===t.keyCode?e=parseFloat((this.min<this.max?this.min:this.max).toString()):35===t.keyCode&&(e=parseFloat((this.min<this.max?this.max:this.min).toString())),this.limits.enabled&&(e=this.getLimitCorrectedValues(e)),this.changeHandleValue(e,t),!this.isMaterial&&!this.isMaterial3||this.tooltip.isVisible||this.getHandle().classList.contains(a)||this.materialChange(),this.tooltipToggle(this.getHandle()),this.getHandle().focus(),this.focusHandle(),t.currentTarget.classList.contains(Ge)&&E.EventHandler.add(this.firstBtn,"mouseup touchend",this.buttonUp,this),t.currentTarget.classList.contains(Je)&&E.EventHandler.add(this.secondBtn,"mouseup touchend",this.buttonUp,this)},l.prototype.tooltipToggle=function(t){this.isMaterialTooltip?this.tooltipElement.classList.contains(ui)?this.refreshTooltip(this.firstHandle):this.openMaterialTooltip():this.tooltipElement?this.refreshTooltip(t):this.openTooltip(t)},l.prototype.buttonUp=function(t){t.currentTarget.classList.contains(Ge)&&E.EventHandler.remove(this.firstBtn,"mouseup touchend",this.buttonUp),t.currentTarget.classList.contains(Je)&&E.EventHandler.remove(this.secondBtn,"mouseup touchend",this.buttonUp)},l.prototype.setRangeBar=function(){"Horizontal"!==this.orientation||E.isNullOrUndefined(this.rangeBar)?E.isNullOrUndefined(this.rangeBar)||("MinRange"===this.type?(this.rangeBar.style.bottom=this.min>this.max?this.handlePos1+"px":"0px",E.setStyleAttribute(this.rangeBar,{height:E.isNullOrUndefined(this.handlePos1)?0:this.min>this.max?this.element.clientHeight-this.handlePos1+"px":this.handlePos1+"px"})):(this.rangeBar.style.bottom=this.min>this.max?this.handlePos2+"px":this.handlePos1+"px",E.setStyleAttribute(this.rangeBar,{height:this.min>this.max?this.handlePos1-this.handlePos2+"px":this.handlePos2-this.handlePos1+"px"}))):"MinRange"===this.type?(this.enableRtl?this.rangeBar.style.right="0px":this.rangeBar.style.left="0px",E.setStyleAttribute(this.rangeBar,{width:E.isNullOrUndefined(this.handlePos1)?0:this.handlePos1+"px"})):(this.enableRtl?this.rangeBar.style.right=this.handlePos1+"px":this.rangeBar.style.left=this.handlePos1+"px",E.setStyleAttribute(this.rangeBar,{width:this.handlePos2-this.handlePos1+"px"}))},l.prototype.checkValidValueAndPos=function(t){return t=this.checkHandleValue(t),t=this.checkHandlePosition(t)},l.prototype.setLimitBarPositions=function(t,e,i,s){"Horizontal"===this.orientation?(this.enableRtl?this.limitBarFirst.style.right=t+"px":this.limitBarFirst.style.left=t+"px",this.limitBarFirst.style.width=e-t+"px"):(this.limitBarFirst.style.bottom=(this.min<this.max?t:e)+"px",this.limitBarFirst.style.height=(this.min<this.max?e-t:t-e)+"px"),"Range"===this.type&&("Horizontal"===this.orientation?(this.enableRtl?this.limitBarSecond.style.right=i+"px":this.limitBarSecond.style.left=i+"px",this.limitBarSecond.style.width=s-i+"px"):(this.limitBarSecond.style.bottom=(this.min<this.max?i:s)+"px",this.limitBarSecond.style.height=(this.min<this.max?s-i:i-s)+"px"))},l.prototype.setLimitBar=function(){var t,e,i,s;"Default"===this.type||"MinRange"===this.type?(t=this.getLimitValueAndPosition(this.limits.minStart,this.limits.minStart,this.limits.minEnd,!0)[0],t=this.checkValidValueAndPos(t),e=this.getLimitValueAndPosition(this.limits.minEnd,this.limits.minStart,this.limits.minEnd,!0)[0],e=this.checkValidValueAndPos(e),this.setLimitBarPositions(t,e)):"Range"===this.type&&(t=this.getLimitValueAndPosition(this.limits.minStart,this.limits.minStart,this.limits.minEnd,!0)[0],t=this.checkValidValueAndPos(t),e=this.getLimitValueAndPosition(this.limits.minEnd,this.limits.minStart,this.limits.minEnd,!0)[0],e=this.checkValidValueAndPos(e),i=this.getLimitValueAndPosition(this.limits.maxStart,this.limits.maxStart,this.limits.maxEnd,!0)[0],i=this.checkValidValueAndPos(i),s=this.getLimitValueAndPosition(this.limits.maxEnd,this.limits.maxStart,this.limits.maxEnd,!0)[0],s=this.checkValidValueAndPos(s),this.setLimitBarPositions(t,e,i,s))},l.prototype.getLimitValueAndPosition=function(t,e,i,s){return E.isNullOrUndefined(e)&&(e=this.min<this.max?this.min:this.max,E.isNullOrUndefined(t))&&s&&(t=e),E.isNullOrUndefined(i)&&(i=this.min<this.max?this.max:this.min,E.isNullOrUndefined(t))&&s&&(t=i),[t=i<(t=t<e?e:t)?i:t,this.checkHandlePosition(t)]},l.prototype.setValue=function(){var t;!E.isNullOrUndefined(this.customValues)&&0<this.customValues.length&&(this.min=0,this.max=this.customValues.length-1,this.setBarColor()),this.setAriaAttributes(this.firstHandle),this.handleVal1=E.isNullOrUndefined(this.value)?this.checkHandleValue(parseFloat(this.min.toString())):this.checkHandleValue(parseFloat(this.value.toString())),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.preHandlePos1=this.handlePos1,E.isNullOrUndefined(this.activeHandle)&&(this.activeHandle="Range"===this.type?2:1),"Default"===this.type||"MinRange"===this.type?(this.limits.enabled&&(t=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd),this.handleVal1=t[0],this.handlePos1=t[1],this.preHandlePos1=this.handlePos1),this.setHandlePosition(null),this.handleStart(),this.value=this.handleVal1,this.setAriaAttrValue(this.firstHandle),this.changeEvent("changed",null)):this.validateRangeValue(),"Default"!==this.type&&this.setRangeBar(),this.limits.enabled&&this.setLimitBar()},l.prototype.rangeValueUpdate=function(){null!==this.value&&"object"==typeof this.value||(this.value=[parseFloat(E.formatUnit(this.min)),parseFloat(E.formatUnit(this.max))])},l.prototype.validateRangeValue=function(){this.rangeValueUpdate(),this.setRangeValue()},l.prototype.modifyZindex=function(){"Range"!==this.type||E.isNullOrUndefined(this.firstHandle)||E.isNullOrUndefined(this.secondHandle)?this.isMaterialTooltip&&this.tooltipElement&&(this.tooltipElement.style.zIndex=h.getZindexPartial(this.element)+""):1===this.activeHandle?(this.firstHandle.style.zIndex=this.zIndex+4+"",this.secondHandle.style.zIndex=this.zIndex+3+""):(this.firstHandle.style.zIndex=this.zIndex+3+"",this.secondHandle.style.zIndex=this.zIndex+4+"")},l.prototype.setHandlePosition=function(t){var e=this,i=1===this.activeHandle?this.handlePos1:this.handlePos2,s=this.isMaterialTooltip?[this.firstHandle,this.materialHandle]:[this.getHandle()];this.handleStart(),s.forEach(function(t){E.isNullOrUndefined(t)||("Horizontal"===e.orientation?e.enableRtl?t.style.right=i+"px":t.style.left=i+"px":t.style.bottom=i+"px")}),this.changeEvent("change",t)},l.prototype.getHandle=function(){return 1===this.activeHandle?this.firstHandle:this.secondHandle},l.prototype.setRangeValue=function(){this.updateRangeValue(),this.activeHandle=1,this.setHandlePosition(null),this.activeHandle=2,this.setHandlePosition(null),this.activeHandle=1},l.prototype.changeEvent=function(t,e){var i,s="change"===t?this.previousVal:this.previousChanged;"Range"!==this.type?(this.setProperties({value:this.handleVal1},!0),s===this.value||this.isMaterialTooltip&&this.initialTooltip||(this.trigger(t,this.changeEventArgs(t,e)),this.initialTooltip=!0,this.setPreviousVal(t,this.value)),this.setAriaAttrValue(this.firstHandle)):(i=this.value=[this.handleVal1,this.handleVal2],this.setProperties({value:i},!0),(s.length===this.value.length&&this.value[0]!==s[0]||this.value[1]!==s[1])&&(this.initialTooltip=!1,this.trigger(t,this.changeEventArgs(t,e)),this.initialTooltip=!0,this.setPreviousVal(t,this.value)),this.setAriaAttrValue(this.getHandle())),this.hiddenInput.value=this.value.toString()},l.prototype.changeEventArgs=function(t,e){t=this.tooltip.isVisible&&this.tooltipObj&&this.initialTooltip?(this.tooltipValue(),{value:this.value,previousValue:"change"===t?this.previousVal:this.previousChanged,action:t,text:"function"==typeof this.tooltipObj.content?this.tooltipObj.content():this.tooltipObj.content,isInteracted:!E.isNullOrUndefined(e)}):{value:this.value,previousValue:"change"===t?this.previousVal:this.previousChanged,action:t,text:E.isNullOrUndefined(this.ticksFormatInfo.format)?this.value.toString():"Range"!==this.type?this.formatString(this.value,this.ticksFormatInfo).formatString:this.formatString(this.value[0],this.ticksFormatInfo).formatString+" - "+this.formatString(this.value[1],this.ticksFormatInfo).formatString,isInteracted:!E.isNullOrUndefined(e)};return t},l.prototype.setPreviousVal=function(t,e){"change"===t?this.previousVal=e:this.previousChanged=e},l.prototype.updateRangeValue=function(){var t=this.value.toString().split(",").map(Number);this.enableRtl&&"Vertical"!==this.orientation||this.rtl?this.value=[t[1],t[0]]:this.value=[t[0],t[1]],this.enableRtl&&"Vertical"!==this.orientation?(this.handleVal1=this.checkHandleValue(this.value[1]),this.handleVal2=this.checkHandleValue(this.value[0])):(this.handleVal1=this.checkHandleValue(this.value[0]),this.handleVal2=this.checkHandleValue(this.value[1])),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.handlePos2=this.checkHandlePosition(this.handleVal2),this.min<this.max&&this.handlePos1>this.handlePos2&&(this.handlePos1=this.handlePos2,this.handleVal1=this.handleVal2),this.min>this.max&&this.handlePos1<this.handlePos2&&(this.handlePos2=this.handlePos1,this.handleVal2=this.handleVal1),this.preHandlePos1=this.handlePos1,this.preHandlePos2=this.handlePos2,this.limits.enabled&&(this.activeHandle=1,t=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd),this.handleVal1=t[0],this.handlePos1=t[1],this.preHandlePos1=this.handlePos1,this.activeHandle=2,t=this.getLimitValueAndPosition(this.handleVal2,this.limits.maxStart,this.limits.maxEnd),this.handleVal2=t[0],this.handlePos2=t[1],this.preHandlePos2=this.handlePos2)},l.prototype.checkHandlePosition=function(t){return t=100*(t-parseFloat(E.formatUnit(this.min)))/(parseFloat(E.formatUnit(this.max))-parseFloat(E.formatUnit(this.min))),t="Horizontal"===this.orientation?this.element.getBoundingClientRect().width*(t/100):this.element.getBoundingClientRect().height*(t/100),t=parseFloat(E.formatUnit(this.max))===parseFloat(E.formatUnit(this.min))?"Horizontal"===this.orientation?this.element.getBoundingClientRect().width:this.element.getBoundingClientRect().height:t},l.prototype.checkHandleValue=function(t){var e;return this.min===this.max?parseFloat(E.formatUnit(this.max)):(t<(e=this.tempStartEnd()).start?t=e.start:t>e.end&&(t=e.end),t)},l.prototype.reposition=function(){var t=this;E.isNullOrUndefined(this.firstHandle)||(this.firstHandle.style.transition="none"),"Default"===this.type||E.isNullOrUndefined(this.rangeBar)||(this.rangeBar.style.transition="none"),"Range"!==this.type||E.isNullOrUndefined(this.secondHandle)||(this.secondHandle.style.transition="none"),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.handleVal2&&(this.handlePos2=this.checkHandlePosition(this.handleVal2)),"Horizontal"===this.orientation?(this.enableRtl?this.firstHandle.style.right=this.handlePos1+"px":this.firstHandle.style.left=this.handlePos1+"px",this.isMaterialTooltip&&!E.isNullOrUndefined(this.materialHandle)&&(this.enableRtl?this.materialHandle.style.right=this.handlePos1+"px":this.materialHandle.style.left=this.handlePos1+"px"),"MinRange"!==this.type||E.isNullOrUndefined(this.rangeBar)?"Range"!==this.type||E.isNullOrUndefined(this.secondHandle)||E.isNullOrUndefined(this.rangeBar)||(this.enableRtl?(this.secondHandle.style.right=this.handlePos2+"px",this.rangeBar.style.right=this.handlePos1+"px"):(this.secondHandle.style.left=this.handlePos2+"px",this.rangeBar.style.left=this.handlePos1+"px"),E.setStyleAttribute(this.rangeBar,{width:this.handlePos2-this.handlePos1+"px"})):(this.enableRtl?this.rangeBar.style.right="0px":this.rangeBar.style.left="0px",E.setStyleAttribute(this.rangeBar,{width:E.isNullOrUndefined(this.handlePos1)?0:this.handlePos1+"px"}))):(this.firstHandle.style.bottom=this.handlePos1+"px",this.isMaterialTooltip&&(this.materialHandle.style.bottom=this.handlePos1+"px"),"MinRange"===this.type?(this.rangeBar.style.bottom=this.min>this.max?this.handlePos1+"px":"0px",E.setStyleAttribute(this.rangeBar,{height:E.isNullOrUndefined(this.handlePos1)?0:this.min>this.max?this.element.clientHeight-this.handlePos1+"px":this.handlePos1+"px"})):"Range"===this.type&&(this.secondHandle.style.bottom=this.handlePos2+"px",this.rangeBar.style.bottom=this.min>this.max?this.handlePos2+"px":this.handlePos1+"px",E.setStyleAttribute(this.rangeBar,{height:this.min>this.max?this.handlePos1-this.handlePos2+"px":this.handlePos2-this.handlePos1+"px"}))),this.limits.enabled&&this.setLimitBar(),"None"!==this.ticks.placement&&this.ul&&(this.removeElement(this.ul),this.ul=void 0,this.renderScale()),this.handleStart(),this.tooltip.isVisible||setTimeout(function(){E.isNullOrUndefined(t.firstHandle)||(t.firstHandle.style.transition=t.scaleTransform),"Range"!==t.type||E.isNullOrUndefined(t.secondHandle)||(t.secondHandle.style.transition=t.scaleTransform)}),this.refreshTooltip(this.tooltipTarget),this.setBarColor()},l.prototype.changeHandleValue=function(t,e){var i=null;1===this.activeHandle?this.limits.enabled&&this.limits.startHandleFixed||(this.handleVal1=this.checkHandleValue(t),this.handlePos1=this.checkHandlePosition(this.handleVal1),"Range"===this.type&&(this.handlePos1>this.handlePos2&&this.min<this.max||this.handlePos1<this.handlePos2&&this.min>this.max)&&(this.handlePos1=this.handlePos2,this.handleVal1=this.handleVal2),this.handlePos1!==this.preHandlePos1&&(i=this.preHandlePos1=this.handlePos1)):this.limits.enabled&&this.limits.endHandleFixed||(this.handleVal2=this.checkHandleValue(t),this.handlePos2=this.checkHandlePosition(this.handleVal2),"Range"===this.type&&(this.handlePos2<this.handlePos1&&this.min<this.max||this.handlePos2>this.handlePos1&&this.min>this.max)&&(this.handlePos2=this.handlePos1,this.handleVal2=this.handleVal1),this.handlePos2!==this.preHandlePos2&&(i=this.preHandlePos2=this.handlePos2)),this.modifyZindex(),null!==i&&("Default"!==this.type&&this.setRangeBar(),this.setHandlePosition(e))},l.prototype.tempStartEnd=function(){return this.min>this.max?{start:this.max,end:this.min}:{start:this.min,end:this.max}},l.prototype.xyToPosition=function(t){var e,i;if(this.min===this.max)return 100;"Horizontal"===this.orientation?(e=t.x-this.element.getBoundingClientRect().left,i=this.element.offsetWidth/100,this.val=e/i):(e=t.y-this.element.getBoundingClientRect().top,i=this.element.offsetHeight/100,this.val=100-e/i);t=this.stepValueCalculation(this.val);return t<0?t=0:100<t&&(t=100),this.enableRtl&&"Vertical"!==this.orientation&&(t=100-t),"Horizontal"===this.orientation?this.element.getBoundingClientRect().width*(t/100):this.element.getBoundingClientRect().height*(t/100)},l.prototype.stepValueCalculation=function(t){0===this.step&&(this.step=1);var e=parseFloat(E.formatUnit(this.step))/((parseFloat(E.formatUnit(this.max))-parseFloat(E.formatUnit(this.min)))/100),i=t%Math.abs(e);return 0!=i&&(i<e/2?t-=i:t+=Math.abs(e)-i),t},l.prototype.add=function(t,e,i){var s=Math.pow(10,3),i=i?(Math.round(t*s)+Math.round(e*s))/s:(Math.round(t*s)-Math.round(e*s))/s;return i},l.prototype.positionToValue=function(t){var e=parseFloat(E.formatUnit(this.max))-parseFloat(E.formatUnit(this.min)),t="Horizontal"===this.orientation?t/this.element.getBoundingClientRect().width*e:t/this.element.getBoundingClientRect().height*e;return this.add(t,parseFloat(this.min.toString()),!0)},l.prototype.sliderBarClick=function(t){t.preventDefault(),"mousedown"===t.type||"mouseup"===t.type||"click"===t.type?i={x:t.clientX,y:t.clientY}:"touchend"!==t.type&&"touchstart"!==t.type||(i={x:t.changedTouches[0].clientX,y:t.changedTouches[0].clientY});var e,i=this.xyToPosition(i),s=this.positionToValue(i),n=(("Range"===this.type&&(this.min<this.max&&this.handlePos2-i<i-this.handlePos1||this.min>this.max&&this.handlePos1-i>i-this.handlePos2)?(this.activeHandle=2,this.limits.enabled&&this.limits.endHandleFixed||(this.limits.enabled&&(s=(n=this.getLimitValueAndPosition(s,this.limits.maxStart,this.limits.maxEnd))[0],i=n[1]),this.secondHandle.classList.add(Ni),this.handlePos2=this.preHandlePos2=i,this.handleVal2=s),this.modifyZindex(),this.secondHandle):(this.activeHandle=1,this.limits.enabled&&this.limits.startHandleFixed||(this.limits.enabled&&(s=(n=this.getLimitValueAndPosition(s,this.limits.minStart,this.limits.minEnd))[0],i=n[1]),this.firstHandle.classList.add(Ni),this.handlePos1=this.preHandlePos1=i,this.handleVal1=s),this.modifyZindex(),this.firstHandle)).focus(),this.isMaterialTooltip&&this.tooltipElement.classList.add(ci),this.element.querySelector("."+a)),i=(n&&this.getHandle()!==n&&n.classList.remove(a),1===this.activeHandle?this.firstHandle:this.secondHandle);"click"!==t.type&&"mousedown"!==t.type||t.target!==i||(n=t.clientX,e=t.clientY,document.elementFromPoint(n,e)),this.checkRepeatedValue(s)&&(n=(this.isMaterial||this.isMaterial3)&&this.tooltip.isVisible?this.transitionOnMaterialTooltip:this.transition,this.getHandle().style.transition=n.handle,"Default"!==this.type&&(this.rangeBar.style.transition=n.rangeBar),this.setHandlePosition(t),this.isMaterialTooltip&&(this.initialTooltip=!1),t.target!==i&&this.changeEvent("changed",t),"Default"!==this.type)&&this.setRangeBar()},l.prototype.handleValueAdjust=function(t,e,i){1===i?(this.handleVal1=e,this.handleVal2=this.handleVal1+this.minDiff):2===i&&(this.handleVal2=e,this.handleVal1=this.handleVal2-this.minDiff),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.handlePos2=this.checkHandlePosition(this.handleVal2)},l.prototype.dragRangeBarMove=function(t){var e,i,s;"touchmove"!==t.type&&t.preventDefault(),this.rangeBarDragged=!0,this.rangeBar.style.transition="none",this.firstHandle.style.transition="none",this.secondHandle.style.transition="none",e=("mousemove"===t.type?(i=(e=[t.clientX,t.clientY])[0],e):(i=(e=[t.changedTouches[0].clientX,t.changedTouches[0].clientY])[0],e))[1],this.limits.enabled&&this.limits.startHandleFixed||this.limits.enabled&&this.limits.endHandleFixed||(s=this.enableRtl?{x:i+this.secondPartRemain,y:e+this.secondPartRemain}:{x:i-this.firstPartRemain,y:e+this.secondPartRemain},this.min>this.max?(this.handlePos2=this.xyToPosition(s),this.handleVal2=this.positionToValue(this.handlePos2)):(this.handlePos1=this.xyToPosition(s),this.handleVal1=this.positionToValue(this.handlePos1)),s=this.enableRtl?{x:i-this.firstPartRemain,y:e-this.firstPartRemain}:{x:i+this.secondPartRemain,y:e-this.firstPartRemain},this.min>this.max?(this.handlePos1=this.xyToPosition(s),this.handleVal1=this.positionToValue(this.handlePos1)):(this.handlePos2=this.xyToPosition(s),this.handleVal2=this.positionToValue(this.handlePos2)),this.limits.enabled&&(i=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd),this.handleVal1=i[0],this.handlePos1=i[1],this.handleVal1===this.limits.minEnd&&this.handleValueAdjust(this.handleVal1,this.limits.minEnd,1),this.handleVal1===this.limits.minStart&&this.handleValueAdjust(this.handleVal1,this.limits.minStart,1),i=this.getLimitValueAndPosition(this.handleVal2,this.limits.maxStart,this.limits.maxEnd),this.handleVal2=i[0],this.handlePos2=i[1],this.handleVal2===this.limits.maxStart&&this.handleValueAdjust(this.handleVal2,this.limits.maxStart,2),this.handleVal2===this.limits.maxEnd)&&this.handleValueAdjust(this.handleVal2,this.limits.maxEnd,2),this.handleVal2===(this.min>this.max?this.min:this.max)&&this.handleValueAdjust(this.handleVal2,this.min>this.max?this.min:this.max,2),this.handleVal1===(this.min>this.max?this.max:this.min)&&this.handleValueAdjust(this.handleVal1,this.min>this.max?this.max:this.min,1)),this.activeHandle=1,this.setHandlePosition(t),this.activeHandle=2,this.setHandlePosition(t),this.tooltipToggle(this.rangeBar),this.setRangeBar()},l.prototype.sliderBarUp=function(t){this.changeEvent("changed",t),this.handleFocusOut(),this.firstHandle.classList.remove(Ni),"Range"===this.type&&(this.initialTooltip=!1,this.secondHandle.classList.remove(Ni)),this.closeTooltip(),(this.isMaterial||this.isMaterial3)&&(this.getHandle().classList.remove("e-large-thumb-size"),this.isMaterialTooltip)&&this.tooltipElement.classList.remove(ci),E.EventHandler.remove(document,"mousemove touchmove",this.sliderBarMove),E.EventHandler.remove(document,"mouseup touchend",this.sliderBarUp)},l.prototype.sliderBarMove=function(t){"touchmove"!==t.type&&t.preventDefault(),s="mousemove"===t.type?{x:t.clientX,y:t.clientY}:{x:t.changedTouches[0].clientX,y:t.changedTouches[0].clientY};var e,i,s=this.xyToPosition(s),n=this.positionToValue(s);s=Math.round(s),"Range"!==this.type&&1===this.activeHandle&&(this.limits.enabled&&this.limits.startHandleFixed||(this.limits.enabled&&(s=(e=this.getLimitValueAndPosition(n,this.limits.minStart,this.limits.minEnd))[1],n=e[0]),this.handlePos1=s,this.handleVal1=n),this.firstHandle.classList.add(Ni)),"Range"===this.type&&(1===this.activeHandle?(this.firstHandle.classList.add(Ni),this.limits.enabled&&this.limits.startHandleFixed||((this.min<this.max&&s>this.handlePos2||this.min>this.max&&s<this.handlePos2)&&(s=this.handlePos2,n=this.handleVal2),s!==this.preHandlePos1&&(this.limits.enabled&&(n=(i=this.getLimitValueAndPosition(n,this.limits.minStart,this.limits.minEnd))[0],s=i[1]),this.handlePos1=this.preHandlePos1=s,this.handleVal1=n,this.activeHandle=1))):2===this.activeHandle&&(this.secondHandle.classList.add(Ni),this.limits.enabled&&this.limits.endHandleFixed||((this.min<this.max&&s<this.handlePos1||this.min>this.max&&s>this.handlePos1)&&(s=this.handlePos1,n=this.handleVal1),s!==this.preHandlePos2&&(this.limits.enabled&&(n=(i=this.getLimitValueAndPosition(n,this.limits.maxStart,this.limits.maxEnd))[0],s=i[1]),this.handlePos2=this.preHandlePos2=s,this.handleVal2=n,this.activeHandle=2)))),this.checkRepeatedValue(n)&&(this.getHandle().style.transition=this.scaleTransform,"Default"!==this.type&&(this.rangeBar.style.transition="none"),this.setHandlePosition(t),!this.isMaterial&&!this.isMaterial3||this.tooltip.isVisible||this.getHandle().classList.contains(a)||this.materialChange(),this.tooltipToggle(this.getHandle()),"Default"!==this.type)&&this.setRangeBar()},l.prototype.dragRangeBarUp=function(t){this.rangeBarDragged?this.isDragComplete=!0:(this.focusSliderElement(),this.sliderBarClick(t)),this.changeEvent("changed",t),this.closeTooltip(),E.EventHandler.remove(document,"mousemove touchmove",this.dragRangeBarMove),E.EventHandler.remove(document,"mouseup touchend",this.dragRangeBarUp),this.rangeBarDragged=!1},l.prototype.checkRepeatedValue=function(t){if("Range"===this.type){if(t===(this.enableRtl&&"Vertical"!==this.orientation?1===this.activeHandle?this.previousVal[1]:this.previousVal[0]:1===this.activeHandle?this.previousVal[0]:this.previousVal[1]))return 0}else if(t===this.previousVal)return 0;return 1},l.prototype.refreshTooltip=function(t){this.tooltip.isVisible&&this.tooltipObj&&(this.tooltipValue(),t)&&(this.tooltipObj.refresh(t),this.tooltipTarget=t)},l.prototype.openTooltip=function(t){this.tooltip.isVisible&&this.tooltipObj&&!this.isMaterialTooltip&&(this.tooltipValue(),this.tooltipObj.open(t),this.tooltipTarget=t)},l.prototype.closeTooltip=function(){this.tooltip.isVisible&&this.tooltipObj&&"Always"!==this.tooltip.showOn&&!this.isMaterialTooltip&&(this.tooltipValue(),this.tooltipObj.close(),this.tooltipTarget=void 0)},l.prototype.keyDown=function(t){switch(t.keyCode){case 37:case 38:case 39:case 40:case 33:case 34:case 36:case 35:t.preventDefault(),this.buttonClick(t)}},l.prototype.wireButtonEvt=function(t){t?(E.EventHandler.remove(this.firstBtn,"mouseleave touchleave",this.buttonFocusOut),E.EventHandler.remove(this.secondBtn,"mouseleave touchleave",this.buttonFocusOut),E.EventHandler.remove(this.firstBtn,"mousedown touchstart",this.repeatHandlerMouse),E.EventHandler.remove(this.firstBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp),E.EventHandler.remove(this.secondBtn,"mousedown touchstart",this.repeatHandlerMouse),E.EventHandler.remove(this.secondBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp),E.EventHandler.remove(this.firstBtn,"focusout",this.sliderFocusOut),E.EventHandler.remove(this.secondBtn,"focusout",this.sliderFocusOut)):(E.EventHandler.add(this.firstBtn,"mouseleave touchleave",this.buttonFocusOut,this),E.EventHandler.add(this.secondBtn,"mouseleave touchleave",this.buttonFocusOut,this),E.EventHandler.add(this.firstBtn,"mousedown touchstart",this.repeatHandlerMouse,this),E.EventHandler.add(this.firstBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp,this),E.EventHandler.add(this.secondBtn,"mousedown touchstart",this.repeatHandlerMouse,this),E.EventHandler.add(this.secondBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp,this),E.EventHandler.add(this.firstBtn,"focusout",this.sliderFocusOut,this),E.EventHandler.add(this.secondBtn,"focusout",this.sliderFocusOut,this))},l.prototype.rangeBarMousedown=function(t){var e,i,s;t.preventDefault(),this.focusSliderElement(),"Range"===this.type&&this.drag&&t.target===this.rangeBar&&(s=i=void 0,"mousedown"===t.type?(i=(e=[t.clientX,t.clientY])[0],s=e[1]):"touchstart"===t.type&&(i=(e=[t.changedTouches[0].clientX,t.changedTouches[0].clientY])[0],s=e[1]),"Horizontal"===this.orientation?(this.firstPartRemain=i-this.rangeBar.getBoundingClientRect().left,this.secondPartRemain=this.rangeBar.getBoundingClientRect().right-i):(this.firstPartRemain=s-this.rangeBar.getBoundingClientRect().top,this.secondPartRemain=this.rangeBar.getBoundingClientRect().bottom-s),this.minDiff=this.handleVal2-this.handleVal1,this.tooltipToggle(this.rangeBar),(t=this.element.querySelector("."+a))&&t.classList.remove(a),E.EventHandler.add(document,"mousemove touchmove",this.dragRangeBarMove,this),E.EventHandler.add(document,"mouseup touchend",this.dragRangeBarUp,this))},l.prototype.elementClick=function(t){this.isDragComplete?this.isDragComplete=!1:(t.preventDefault(),this.focusSliderElement(),this.sliderBarClick(t),this.focusHandle())},l.prototype.wireEvents=function(){this.onresize=this.reposition.bind(this),window.addEventListener("resize",this.onresize),this.enabled&&!this.readonly&&(E.EventHandler.add(this.element,"click",this.elementClick,this),"Range"===this.type&&this.drag&&E.EventHandler.add(this.rangeBar,"mousedown touchstart",this.rangeBarMousedown,this),E.EventHandler.add(this.sliderContainer,"keydown",this.keyDown,this),E.EventHandler.add(this.sliderContainer,"keyup",this.keyUp,this),E.EventHandler.add(this.element,"focusout",this.sliderFocusOut,this),E.EventHandler.add(this.sliderContainer,"mouseover mouseout touchstart touchend",this.hover,this),this.wireFirstHandleEvt(!1),"Range"===this.type&&this.wireSecondHandleEvt(!1),this.showButtons&&this.wireButtonEvt(!1),this.wireMaterialTooltipEvent(!1),this.isForm)&&E.EventHandler.add(this.formElement,"reset",this.formResetHandler,this)},l.prototype.unwireEvents=function(){E.EventHandler.remove(this.element,"click",this.elementClick),"Range"===this.type&&this.drag&&E.EventHandler.remove(this.rangeBar,"mousedown touchstart",this.rangeBarMousedown),E.EventHandler.remove(this.sliderContainer,"keydown",this.keyDown),E.EventHandler.remove(this.sliderContainer,"keyup",this.keyUp),E.EventHandler.remove(this.element,"focusout",this.sliderFocusOut),E.EventHandler.remove(this.sliderContainer,"mouseover mouseout touchstart touchend",this.hover),this.wireFirstHandleEvt(!0),"Range"===this.type&&this.wireSecondHandleEvt(!0),this.showButtons&&this.wireButtonEvt(!0),this.wireMaterialTooltipEvent(!0),E.EventHandler.remove(this.element,"reset",this.formResetHandler)},l.prototype.formResetHandler=function(){this.setProperties({value:this.formResetValue},!0),this.setValue()},l.prototype.keyUp=function(t){var e;9===t.keyCode&&t.target.classList.contains(Ke)&&(this.focusSliderElement(),t.target.classList.contains(a)||(this.element.querySelector("."+a)&&this.element.querySelector("."+a).classList.remove(a),t.target.classList.add(a),(e=t.target.parentElement)===this.element&&(e.querySelector("."+fi).classList.add(ki),"Range"!==this.type&&"MinRange"!==this.type||e.querySelector("."+Ye).classList.add(Ai)),"Range"===this.type&&((e=t.target.previousSibling)&&e.classList.contains(Ke)?this.activeHandle=2:this.activeHandle=1),this.getHandle().focus(),this.tooltipToggle(this.getHandle()))),this.closeTooltip(),this.changeEvent("changed",t)},l.prototype.hover=function(t){E.isNullOrUndefined(t)||("mouseover"===t.type||"touchmove"===t.type||"mousemove"===t.type||"pointermove"===t.type||"touchstart"===t.type?this.sliderContainer.classList.add(si):(this.sliderContainer.classList.remove(si),t=t.currentTarget,this.tooltip.isVisible&&"Always"!==this.tooltip.showOn&&this.tooltipObj&&this.isMaterialTooltip&&!t.classList.contains(yi)&&!t.classList.contains(a)&&this.closeMaterialTooltip()))},l.prototype.sliderFocusOut=function(t){t.relatedTarget!==this.secondHandle&&t.relatedTarget!==this.firstHandle&&t.relatedTarget!==this.element&&t.relatedTarget!==this.firstBtn&&t.relatedTarget!==this.secondBtn&&(this.closeMaterialTooltip(),this.closeTooltip(),this.element.querySelector("."+a)&&this.element.querySelector("."+a).classList.remove(a),this.element.querySelector("."+ki)&&(this.element.querySelector("."+ki).classList.remove(ki),"Range"!==this.type&&"MinRange"!==this.type||!this.element.querySelector("."+Ai)||this.element.querySelector("."+Ai).classList.remove(Ai)),this.hiddenInput.focus(),this.hiddenInput.blur(),this.isElementFocused=!1)},l.prototype.removeElement=function(t){t.parentNode&&t.parentNode.removeChild(t)},l.prototype.changeSliderType=function(t,e){this.isMaterialTooltip&&this.materialHandle&&(this.sliderContainer.classList.remove(mi),this.removeElement(this.materialHandle),this.materialHandle=void 0),this.removeElement(this.firstHandle),this.firstHandle=void 0,"Default"!==t&&("Range"===t&&(this.removeElement(this.secondHandle),this.secondHandle=void 0),this.removeElement(this.rangeBar),this.rangeBar=void 0),this.tooltip.isVisible&&!E.isNullOrUndefined(this.tooltipObj)&&(this.tooltipObj.destroy(),this.tooltipElement=void 0,this.tooltipCollidedPosition=void 0),this.limits.enabled&&("MinRange"===t||"Default"===t?E.isNullOrUndefined(this.limitBarFirst)||(this.removeElement(this.limitBarFirst),this.limitBarFirst=void 0):E.isNullOrUndefined(this.limitBarSecond)||(this.removeElement(this.limitBarSecond),this.limitBarSecond=void 0)),this.activeHandle=1,this.getThemeInitialization(),"Range"===this.type&&this.rangeValueUpdate(),this.createRangeBar(),this.limits.enabled&&this.createLimitBar(),this.setHandler(),this.setOrientClass(),this.wireFirstHandleEvt(!this.enabled),"Range"===this.type&&this.wireSecondHandleEvt(!this.enabled),this.setValue(),this.tooltip.isVisible&&(this.renderTooltip(),this.wireMaterialTooltipEvent(!1)),this.setBarColor(),"tooltip"!==e&&this.updateConfig(),this.readonly&&(this.sliderContainer.classList.remove(Fi),this.setReadOnly())},l.prototype.changeRtl=function(){var t;this.enableRtl||"Range"!==this.type||(this.value=[this.handleVal2,this.handleVal1]),this.updateConfig(),this.tooltip.isVisible&&this.tooltipObj.refresh(this.firstHandle),this.showButtons&&(t=this.enableRtl&&"Vertical"!==this.orientation,E.attributes(t?this.secondBtn:this.firstBtn,{"aria-label":"Decrease",title:"Decrease"}),E.attributes(t?this.firstBtn:this.secondBtn,{"aria-label":"Increase",title:"Increase"}))},l.prototype.changeOrientation=function(){this.changeSliderType(this.type,"null")},l.prototype.updateConfig=function(){this.setEnableRTL(),this.setValue(),this.tooltip.isVisible&&this.refreshTooltip(this.tooltipTarget),"None"!==this.ticks.placement&&this.ul&&(this.removeElement(this.ul),this.ul=void 0,this.renderScale()),this.limitsPropertyChange()},l.prototype.limitsPropertyChange=function(){this.limits.enabled?(E.isNullOrUndefined(this.limitBarFirst)&&"Range"!==this.type&&this.createLimitBar(),E.isNullOrUndefined(this.limitBarFirst)&&E.isNullOrUndefined(this.limitBarSecond)&&"Range"===this.type&&this.createLimitBar(),this.setLimitBar(),this.setValue()):(E.isNullOrUndefined(this.limitBarFirst)||E.detach(this.limitBarFirst),E.isNullOrUndefined(this.limitBarSecond)||E.detach(this.limitBarSecond))},l.prototype.getPersistData=function(){return this.addOnPersist(["value"])},l.prototype.destroy=function(){We.prototype.destroy.call(this),this.unwireEvents(),window.removeEventListener("resize",this.onresize),E.removeClass([this.sliderContainer],[li]),this.firstHandle.removeAttribute("aria-orientation"),"Range"===this.type&&this.secondHandle.removeAttribute("aria-orientation"),this.sliderContainer.parentNode&&this.sliderContainer.parentNode.insertBefore(this.element,this.sliderContainer),E.detach(this.sliderContainer),this.tooltip.isVisible&&this.tooltipObj.destroy(),this.element.innerHTML="",this.hiddenInput=null,this.sliderContainer=null,this.sliderTrack=null,this.rangeBar=null,this.firstHandle=null,this.secondHandle=null,this.tickElementCollection=null,this.ul=null,this.firstBtn=null,this.secondBtn=null,this.materialHandle=null,this.tooltipObj=null,this.tooltipTarget=null,this.limitBarFirst=null,this.limitBarSecond=null,this.firstChild=null,this.lastChild=null,this.tooltipElement=null},l.prototype.onPropertyChanged=function(t,e){for(var i=this,s=0,n=Object.keys(t);s<n.length;s++){var a,l=n[s];switch(l){case"cssClass":this.setCSSClass(e.cssClass);break;case"value":t&&e&&(a=E.isNullOrUndefined(t.value)?"Range"===this.type?[this.min,this.max]:this.min:t.value,this.setProperties({value:a},!0),E.isNullOrUndefined(e.value)||e.value.toString()===a.toString()||(this.setValue(),this.refreshTooltip(this.tooltipTarget),"Range"===this.type&&(E.isNullOrUndefined(t.value)||e.value[1]===a[1]?this.activeHandle=1:this.activeHandle=2)));break;case"min":case"step":case"max":this.setMinMaxValue();break;case"tooltip":E.isNullOrUndefined(t.tooltip)||E.isNullOrUndefined(e.tooltip)||(this.initialTooltip=!0,this.setTooltip(l),this.showButtons)||this.wireEvents();break;case"type":E.isNullOrUndefined(e)||!Object.keys(e).length||E.isNullOrUndefined(e.type)||(this.changeSliderType(e.type,l),this.setZindex());break;case"enableRtl":e.enableRtl!==t.enableRtl&&"Vertical"!==this.orientation&&(this.rtl=e.enableRtl,this.changeRtl());break;case"limits":this.limitsPropertyChange();break;case"orientation":this.changeOrientation();break;case"ticks":E.isNullOrUndefined(this.sliderContainer.querySelector("."+$e))||(E.detach(this.ul),Array.prototype.forEach.call(this.sliderContainer.classList,function(t){t.match(/e-scale-/)&&i.sliderContainer.classList.remove(t)})),"None"!==this.ticks.placement&&(this.renderScale(),this.setZindex());break;case"locale":this.showButtons&&this.buttonTitle();break;case"showButtons":t.showButtons?(this.setButtons(),this.reposition(),this.enabled&&!this.readonly&&this.wireButtonEvt(!1)):this.firstBtn&&this.secondBtn&&(this.sliderContainer.removeChild(this.firstBtn),this.sliderContainer.removeChild(this.secondBtn),this.sliderContainer.classList.remove(Li),this.firstBtn=void 0,this.secondBtn=void 0,this.reposition());break;case"enabled":this.setEnabled();break;case"readonly":this.setReadOnly();break;case"customValues":this.setValue(),this.reposition();break;case"colorRange":this.reposition();break;case"width":this.setElementWidth(t.width),this.setMinMaxValue(),this.limits&&this.limitsPropertyChange()}}},l.prototype.setReadOnly=function(){this.readonly?(this.unwireEvents(),this.sliderContainer.classList.add(Fi)):(this.wireEvents(),this.sliderContainer.classList.remove(Fi))},l.prototype.setMinMaxValue=function(){var e=this;this.setValue(),this.refreshTooltip(this.tooltipTarget),E.isNullOrUndefined(this.sliderContainer.querySelector("."+$e))||this.ul&&(E.detach(this.ul),Array.prototype.forEach.call(this.sliderContainer.classList,function(t){t.match(/e-scale-/)&&e.sliderContainer.classList.remove(t)})),"None"!==this.ticks.placement&&(this.renderScale(),this.setZindex())},l.prototype.setZindex=function(){this.zIndex=6,E.isNullOrUndefined(this.ticks)||"None"===this.ticks.placement||E.isNullOrUndefined(this.ul)||E.isNullOrUndefined(this.element)||(this.ul.style.zIndex=this.zIndex+-7+"",this.element.style.zIndex=this.zIndex+2+""),this.isMaterial||this.isMaterial3||E.isNullOrUndefined(this.ticks)||"Both"!==this.ticks.placement||(this.element.style.zIndex=this.zIndex+2+""),E.isNullOrUndefined(this.firstHandle)||(this.firstHandle.style.zIndex=this.zIndex+3+""),"Range"!==this.type||E.isNullOrUndefined(this.secondHandle)||(this.secondHandle.style.zIndex=this.zIndex+4+"")},l.prototype.setTooltip=function(t){this.changeSliderType(this.type,t)},l.prototype.setBarColor=function(){for(var t,e,i=this.sliderTrack.lastElementChild;i;)this.sliderTrack.removeChild(i),i=this.sliderTrack.lastElementChild;for(var s,n,a,l=0;l<this.colorRange.length;l++)E.isNullOrUndefined(this.colorRange[l].start)||E.isNullOrUndefined(this.colorRange[l].end)||this.colorRange[l].end>this.colorRange[l].start&&(this.colorRange[l].start<this.min&&(this.colorRange[l].start=this.min),this.colorRange[l].end>this.max&&(this.colorRange[l].end=this.max),s=this.checkHandlePosition(this.colorRange[l].start),n=this.checkHandlePosition(this.colorRange[l].end),(a=this.createElement("div")).style.backgroundColor=this.colorRange[l].color,a.style.border="1px solid "+this.colorRange[l].color,"Horizontal"===this.orientation?(e=vi,t=this.enableRtl?E.isNullOrUndefined(this.customValues)?this.checkHandlePosition(this.max)-this.checkHandlePosition(this.colorRange[l].end):this.checkHandlePosition(this.customValues.length-this.colorRange[l].end-1):this.checkHandlePosition(this.colorRange[l].start),a.style.width=n-s+"px",a.style.left=t+"px"):(e=gi,t=this.checkHandlePosition(this.colorRange[l].start),a.style.height=n-s+"px",a.style.bottom=t+"px"),a.classList.add(e),this.sliderTrack.appendChild(a))},l.prototype.getModuleName=function(){return"slider"},s([E.Property(null)],l.prototype,"value",void 0),s([E.Property(null)],l.prototype,"customValues",void 0),s([E.Property(1)],l.prototype,"step",void 0),s([E.Property(null)],l.prototype,"width",void 0),s([E.Property(0)],l.prototype,"min",void 0),s([E.Property(100)],l.prototype,"max",void 0),s([E.Property(!1)],l.prototype,"readonly",void 0),s([E.Property("Default")],l.prototype,"type",void 0),s([E.Collection([{}],Be)],l.prototype,"colorRange",void 0),s([E.Complex({},Ae)],l.prototype,"ticks",void 0),s([E.Complex({},Ie)],l.prototype,"limits",void 0),s([E.Property(!0)],l.prototype,"enabled",void 0),s([E.Complex({},Me)],l.prototype,"tooltip",void 0),s([E.Property(!1)],l.prototype,"showButtons",void 0),s([E.Property(!0)],l.prototype,"enableAnimation",void 0),s([E.Property("Horizontal")],l.prototype,"orientation",void 0),s([E.Property("")],l.prototype,"cssClass",void 0),s([E.Property(!0)],l.prototype,"enableHtmlSanitizer",void 0),s([E.Event()],l.prototype,"created",void 0),s([E.Event()],l.prototype,"change",void 0),s([E.Event()],l.prototype,"changed",void 0),s([E.Event()],l.prototype,"renderingTicks",void 0),s([E.Event()],l.prototype,"renderedTicks",void 0),s([E.Event()],l.prototype,"tooltipChange",void 0),s([E.NotifyPropertyChanges],l));function l(t,e){t=We.call(this,t,e)||this;return t.horDir="left",t.verDir="bottom",t.transition={handle:"left .4s cubic-bezier(.25, .8, .25, 1), right .4s cubic-bezier(.25, .8, .25, 1), top .4s cubic-bezier(.25, .8, .25, 1) , bottom .4s cubic-bezier(.25, .8, .25, 1)",rangeBar:"all .4s cubic-bezier(.25, .8, .25, 1)"},t.transitionOnMaterialTooltip={handle:"left 1ms ease-out, right 1ms ease-out, bottom 1ms ease-out, top 1ms ease-out",rangeBar:"left 1ms ease-out, right 1ms ease-out, bottom 1ms ease-out, width 1ms ease-out, height 1ms ease-out"},t.scaleTransform="transform .4s cubic-bezier(.25, .8, .25, 1)",t.customAriaText=null,t.drag=!0,t.isDragComplete=!1,t.initialTooltip=!0,t}_i=function(t,e){return(_i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var _i,Xi,Ki,t=function(t,e){function i(){this.constructor=t}_i(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},s=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},Yi={EMAIL:new RegExp("^[A-Za-z0-9._%+-]{1,}@[A-Za-z0-9._%+-]{1,}([.]{1}[a-zA-Z0-9]{2,}|[.]{1}[a-zA-Z0-9]{2,4}[.]{1}[a-zA-Z0-9]{2,4})$"),URL:/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/m,DATE_ISO:new RegExp("^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$"),DIGITS:new RegExp("^[0-9]*$"),PHONE:new RegExp("^[+]?[0-9]{9,13}$"),CREDITCARD:new RegExp("^\\d{13,16}$")},Zi=((Zi=o.ErrorOption||(o.ErrorOption={}))[Zi.Message=0]="Message",Zi[Zi.Label=1]="Label",Xi=E.Base,t(r,Xi),(Ki=r).prototype.addRules=function(t,e){t&&(this.rules.hasOwnProperty(t)?E.extend(this.rules[""+t],e,{}):this.rules[""+t]=e)},r.prototype.removeRules=function(t,e){if(t||e){if(this.rules[""+t]&&!e)delete this.rules[""+t];else if(!E.isNullOrUndefined(this.rules[""+t]&&e))for(var i=0;i<e.length;i++)delete this.rules[""+t][e[parseInt(i.toString(),10)]]}else this.rules={}},r.prototype.validate=function(e){var t=Object.keys(this.rules);if(e&&t.length)return this.validateRules(e),-1!==t.indexOf(e)&&0===this.errorRules.filter(function(t){return t.name===e}).length;this.errorRules=[];for(var i=0,s=t;i<s.length;i++){var n=s[i];this.validateRules(n)}return 0===this.errorRules.length},r.prototype.reset=function(){this.element.reset(),this.clearForm()},r.prototype.getInputElement=function(t){return this.inputElement=E.select('[name="'+t+'"]',this.element),this.inputElement},r.prototype.destroy=function(){this.reset(),this.unwireEvents(),this.rules={};for(var t=0,e=E.selectAll("."+this.errorClass+", ."+this.validClass,this.element);t<e.length;t++){var i=e[t];E.detach(i)}Xi.prototype.destroy.call(this),this.infoElement=null,E.onIntlChange.off("notifyExternalChange",this.afterLocalization)},r.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)"locale"===s[i]&&this.localeFunc()},r.prototype.localeFunc=function(){for(var t=0,e=Object.keys(this.defaultMessages);t<e.length;t++){var i=e[t],s=(this.l10n.setLocale(this.locale),this.l10n.getConstant(i));this.localyMessage[""+i]=s}},r.prototype.getModuleName=function(){return"formvalidator"},r.prototype.afterLocalization=function(t){this.locale=t.locale,this.localeFunc()},r.prototype.refresh=function(){this.unwireEvents(),this.inputElements=E.selectAll(this.selectQuery,this.element),this.wireEvents()},r.prototype.clearForm=function(){this.errorRules=[],this.validated=[];for(var t=0,e=E.selectAll(this.selectQuery,this.element);t<e.length;t++){var i=e[t],s=(i.removeAttribute("aria-invalid"),i.parentElement),n=s.parentElement;(s.classList.contains("e-control-wrapper")||s.classList.contains("e-wrapper")||i.classList.contains("e-input")&&s.classList.contains("e-input-group")?s:null!=n&&(n.classList.contains("e-control-wrapper")||n.classList.contains("e-wrapper"))?n:i).classList.remove(this.errorClass),0<i.name.length&&(this.getInputElement(i.name),this.getErrorElement(i.name),this.hideMessage(i.name)),(s.classList.contains("e-control-wrapper")||s.classList.contains("e-wrapper")||i.classList.contains("e-input")&&s.classList.contains("e-input-group")?s:null!=n&&(n.classList.contains("e-control-wrapper")||n.classList.contains("e-wrapper"))?n:i).classList.remove(this.validClass)}},r.prototype.createHTML5Rules=function(){for(var t=["required","validateHidden","regex","rangeLength","maxLength","minLength","dateIso","digits","pattern","data-val-required","type","data-validation","min","max","range","equalTo","data-val-minlength-min","data-val-equalto-other","data-val-maxlength-max","data-val-range-min","data-val-regex-pattern","data-val-length-max","data-val-creditcard","data-val-phone"],e=["hidden","email","url","date","number","tel"],i=0,s=this.inputElements;i<s.length;i++){for(var n=s[i],a={},l=0,r=t;l<r.length;l++){var o=r[l];if(null!==n.getAttribute(o))switch(o){case"required":this.defRule(n,a,o,n.required);break;case"data-validation":o=n.getAttribute(o),this.defRule(n,a,o,!0);break;case"type":-1!==e.indexOf(n.type)&&this.defRule(n,a,n.type,!0);break;case"rangeLength":case"range":this.defRule(n,a,o,JSON.parse(n.getAttribute(o)));break;case"equalTo":var h=n.getAttribute(o);this.defRule(n,a,o,h);break;default:"true"===n.getAttribute("data-val")?this.annotationRule(n,a,o,n.getAttribute(o)):this.defRule(n,a,o,n.getAttribute(o))}}0!==Object.keys(a).length&&this.addRules(n.name,a)}},r.prototype.annotationRule=function(t,e,i,s){var n=i.split("-"),a=["required","creditcard","phone","maxlength","minlength","range","regex","equalto"],l=n[n.length-1],n=n[n.length-2];if(-1!==a.indexOf(l))switch(l){case"required":this.defRule(t,e,"required",s);break;case"creditcard":this.defRule(t,e,"creditcard",s);break;case"phone":this.defRule(t,e,"tel",s)}else if(-1!==a.indexOf(n))switch(n){case"maxlength":this.defRule(t,e,"maxLength",s);break;case"minlength":this.defRule(t,e,"minLength",s);break;case"range":var r=t.getAttribute("data-val-range-min"),o=t.getAttribute("data-val-range-max");this.defRule(t,e,"range",[r,o]);break;case"equalto":r=t.getAttribute(i).split(".");this.defRule(t,e,"equalTo",r[r.length-1]);break;case"regex":this.defRule(t,e,"regex",s)}},r.prototype.defRule=function(t,e,i,s){var n,a=t.getAttribute("data-"+i+"-message"),l=t.getAttribute("data-val-"+i);this.rules[t.name]&&"validateHidden"!==i&&"hidden"!==i&&(this.getInputElement(t.name),n=this.getErrorMessage(this.rules[t.name][""+i],i)),a?s=[s,a]:l?s=[s,l]:n&&(s=[s,n]),e[""+i]=s},r.prototype.wireEvents=function(){for(var t=0,e=this.inputElements;t<e.length;t++){var i=e[t];Ki.isCheckable(i)?E.EventHandler.add(i,"click",this.clickHandler,this):"SELECT"===i.tagName?E.EventHandler.add(i,"change",this.changeHandler,this):(E.EventHandler.add(i,"focusout",this.focusOutHandler,this),E.EventHandler.add(i,"keyup",this.keyUpHandler,this))}E.EventHandler.add(this.element,"submit",this.submitHandler,this),E.EventHandler.add(this.element,"reset",this.resetHandler,this)},r.prototype.unwireEvents=function(){for(var t=0,e=this.inputElements;t<e.length;t++){var i=e[t];E.EventHandler.clearEvents(i)}E.EventHandler.remove(this.element,"submit",this.submitHandler),E.EventHandler.remove(this.element,"reset",this.resetHandler)},r.prototype.focusOutHandler=function(t){this.trigger("focusout",t);t=t.target;this.rules[t.name]&&(this.rules[t.name][this.required]||0<t.value.length?this.validate(t.name):-1===this.validated.indexOf(t.name)&&this.validated.push(t.name))},r.prototype.keyUpHandler=function(t){this.trigger("keyup",t);var e=t.target;(9!==t.which||this.rules[e.name]&&(!this.rules[e.name]||this.rules[e.name][this.required]))&&-1!==this.validated.indexOf(e.name)&&this.rules[e.name]&&-1===[16,17,18,20,35,36,37,38,39,40,45,144,225].indexOf(t.which)&&this.validate(e.name)},r.prototype.clickHandler=function(t){this.trigger("click",t);t=t.target;"submit"!==t.type?this.validate(t.name):null!==t.getAttribute("formnovalidate")&&(this.allowSubmit=!0)},r.prototype.changeHandler=function(t){this.trigger("change",t);t=t.target;this.validate(t.name)},r.prototype.submitHandler=function(t){this.trigger("submit",t),this.allowSubmit||this.validate()?this.allowSubmit=!1:t.preventDefault()},r.prototype.resetHandler=function(){this.clearForm()},r.prototype.validateRules=function(t){if(this.rules[""+t]){var e=Object.keys(this.rules[""+t]),i=!1,s=!1,n=e.indexOf("validateHidden"),a=e.indexOf("hidden");if(this.getInputElement(t),-1!==n&&(s=!0),!(i=-1!==a?!0:i)||s){-1!==n&&e.splice(n,1),-1!==a&&e.splice(a-1,1),this.getErrorElement(t);for(var l=0,r=e;l<r.length;l++){var o=r[l],h=this.getErrorMessage(this.rules[""+t][""+o],o),p={name:t,message:h},h={inputName:t,element:this.inputElement,message:h};if(!this.isValid(t,o)&&!this.inputElement.classList.contains(this.ignore)){this.removeErrorRules(t),this.errorRules.push(p),this.inputElement.setAttribute("aria-invalid","true"),this.inputElement.setAttribute("aria-describedby",this.inputElement.id+"-info");var d=this.inputElement.parentElement,u=d.parentElement;(d.classList.contains("e-control-wrapper")||d.classList.contains("e-wrapper")||this.inputElement.classList.contains("e-input")&&d.classList.contains("e-input-group")?(d.classList.add(this.errorClass),d):null!=u&&(u.classList.contains("e-control-wrapper")||u.classList.contains("e-wrapper"))?(u.classList.add(this.errorClass),u):(this.inputElement.classList.add(this.errorClass),this.inputElement)).classList.remove(this.validClass),this.infoElement?this.showMessage(p):this.createErrorElement(t,p.message,this.inputElement),h.errorElement=this.infoElement,h.status="failure",(d.classList.contains("e-control-wrapper")||d.classList.contains("e-wrapper")||this.inputElement.classList.contains("e-input")&&d.classList.contains("e-input-group")?(d.classList.add(this.errorClass),d):null!=u&&(u.classList.contains("e-control-wrapper")||u.classList.contains("e-wrapper"))?(u.classList.add(this.errorClass),u):(this.inputElement.classList.add(this.errorClass),this.inputElement)).classList.remove(this.validClass),this.optionalValidationStatus(t,h),this.trigger("validationComplete",h),"required"===o&&this.inputElement.setAttribute("aria-required","true");break}this.hideMessage(t),h.status="success",this.trigger("validationComplete",h)}}}},r.prototype.optionalValidationStatus=function(t,e){this.rules[""+t][this.required]||this.inputElement.value.length||E.isNullOrUndefined(this.infoElement)||(this.infoElement.innerHTML=this.inputElement.value,this.infoElement.setAttribute("aria-invalid","false"),e.status="",this.hideMessage(t))},r.prototype.isValid=function(t,e){var i=this.rules[""+t][""+e],i=i instanceof Array&&"string"==typeof i[1]?i[0]:i,s=this.rules[""+t][""+e],n="min"!==e&&"max"!==e||!this.rules[""+t].date||"string"!=typeof this.rules[""+t].date?null:this.rules[""+t].date,i={value:this.inputElement.value,param:i,element:this.inputElement,formElement:this.element,format:n,culture:this.locale};return this.trigger("validationBegin",i),!i.param&&"required"===e||(s&&"function"==typeof s[0]?s[0].call(this,{element:this.inputElement,value:this.inputElement.value}):Ki.isCheckable(this.inputElement)?"required"!==e||0<E.selectAll('input[name="'+t+'"]:checked',this.element).length:Ki.checkValidator[""+e](i))},r.prototype.getErrorMessage=function(t,e){var i=(a=this.inputElement.getAttribute("data-"+e+"-message")?this.inputElement.getAttribute("data-"+e+"-message"):t instanceof Array&&"string"==typeof t[1]?t[1]:(0!==Object.keys(this.localyMessage).length?this.localyMessage:this.defaultMessages)[""+e]).match(/{(\d)}/g);if(!E.isNullOrUndefined(i))for(var s=0;s<i.length;s++)var n=t instanceof Array?t[parseInt(s.toString(),10)]:t,a=a.replace(i[parseInt(s.toString(),10)],n);return a},r.prototype.createErrorElement=function(t,e,i){var s,e=E.createElement(this.errorElement,{className:this.errorClass,innerHTML:e,attrs:{for:t}});this.errorOption===o.ErrorOption.Message&&(e.classList.remove(this.errorClass),e.classList.add("e-message"),e=E.createElement(this.errorContainer,{className:this.errorClass,innerHTML:e.outerHTML})),e.id=this.inputElement.name+"-info",this.element.querySelector('[data-valmsg-for="'+i.id+'"]')?this.element.querySelector('[data-valmsg-for="'+i.id+'"]').appendChild(e):!0===i.hasAttribute("data-msg-containerid")?(i=i.getAttribute("data-msg-containerid"),E.select("#"+i,this.element).appendChild(e)):null!=this.customPlacement?this.customPlacement.call(this,this.inputElement,e):(s=(i=this.inputElement.parentElement).parentElement,i.classList.contains("e-control-wrapper")||i.classList.contains("e-wrapper")?s.insertBefore(e,i.nextSibling):s.classList.contains("e-control-wrapper")||s.classList.contains("e-wrapper")?s.parentElement.insertBefore(e,s.nextSibling):i.insertBefore(e,this.inputElement.nextSibling)),e.style.display="block",this.getErrorElement(t),this.validated.push(t),this.checkRequired(t)},r.prototype.getErrorElement=function(t){return this.infoElement=E.select(this.errorElement+"."+this.errorClass,this.inputElement.parentElement),this.infoElement||(this.infoElement=E.select(this.errorElement+"."+this.errorClass+'[for="'+t+'"]',this.element)),this.infoElement},r.prototype.removeErrorRules=function(t){for(var e=0;e<this.errorRules.length;e++)this.errorRules[parseInt(e.toString(),10)].name===t&&this.errorRules.splice(e,1)},r.prototype.showMessage=function(t){this.infoElement.style.display="block",this.infoElement.innerHTML=t.message,this.checkRequired(t.name)},r.prototype.hideMessage=function(t){var e;this.infoElement&&(this.infoElement.style.display="none",this.removeErrorRules(t),e=(t=this.inputElement.parentElement).parentElement,(t.classList.contains("e-control-wrapper")||t.classList.contains("e-wrapper")||this.inputElement.classList.contains("e-input")&&t.classList.contains("e-input-group")?(t.classList.add(this.validClass),t):null!=e&&(e.classList.contains("e-control-wrapper")||e.classList.contains("e-wrapper"))?(e.classList.add(this.validClass),e):(this.inputElement.classList.add(this.validClass),this.inputElement)).classList.remove(this.errorClass),this.inputElement.setAttribute("aria-invalid","false"))},r.prototype.checkRequired=function(t){this.rules[""+t][this.required]||this.inputElement.value.length||E.isNullOrUndefined(this.infoElement)||(this.infoElement.innerHTML=this.inputElement.value,this.infoElement.setAttribute("aria-invalid","false"),this.hideMessage(t))},r.isCheckable=function(t){t=t.getAttribute("type");return t&&("checkbox"===t||"radio"===t||"submit"===t)},r.checkValidator={required:function(t){return isNaN(Date.parse(t.value))?0<t.value.toString().length:!isNaN(new Date(t.value).getTime())},email:function(t){return Yi.EMAIL.test(t.value)},url:function(t){return Yi.URL.test(t.value)},dateIso:function(t){return Yi.DATE_ISO.test(t.value)},tel:function(t){return Yi.PHONE.test(t.value)},creditcard:function(t){return Yi.CREDITCARD.test(t.value)},number:function(t){return!isNaN(Number(t.value))&&-1===String(t.value).indexOf(" ")},digits:function(t){return Yi.DIGITS.test(t.value)},maxLength:function(t){return t.value.length<=Number(t.param)},minLength:function(t){return t.value.length>=Number(t.param)},rangeLength:function(t){var e=t.param;return t.value.length>=e[0]&&t.value.length<=e[1]},range:function(t){var e=t.param;return!isNaN(Number(t.value))&&Number(t.value)>=e[0]&&Number(t.value)<=e[1]},date:function(t){var e,i;return E.isNullOrUndefined(t.param)||"string"!=typeof t.param||""===t.param?!isNaN(new Date(t.value).getTime()):(i=t.culture&&""!==t.culture?new E.Internationalization(t.culture):new E.Internationalization,e={format:t.param.toString(),type:"dateTime",skeleton:"yMd"},i=i.parseDate(t.value,e),!E.isNullOrUndefined(i)&&i instanceof Date&&!isNaN(+i))},max:function(t){var e,i,s;return isNaN(Number(t.value))?t.format&&""!==t.format?(s=t.culture&&""!==t.culture?new E.Internationalization(t.culture):new E.Internationalization,e={format:t.format.toString(),type:"dateTime",skeleton:"yMd"},i=s.parseDate(t.value,e),s="string"==typeof t.param?s.parseDate(JSON.parse(JSON.stringify(t.param)),e):t.param,new Date(i).getTime()<=new Date(s).getTime()):new Date(t.value).getTime()<=new Date(JSON.parse(JSON.stringify(t.param))).getTime():+t.value<=+t.param},min:function(t){var e,i,s;return isNaN(Number(t.value))?-1!==t.value.indexOf(",")?(s=t.value.replace(/,/g,""),parseFloat(s)>=Number(t.param)):t.format&&""!==t.format?(s=t.culture&&""!==t.culture?new E.Internationalization(t.culture):new E.Internationalization,e={format:t.format.toString(),type:"dateTime",skeleton:"yMd"},i=s.parseDate(t.value,e),s="string"==typeof t.param?s.parseDate(JSON.parse(JSON.stringify(t.param)),e):t.param,new Date(i).getTime()>=new Date(s).getTime()):new Date(t.value).getTime()>=new Date(JSON.parse(JSON.stringify(t.param))).getTime():+t.value>=+t.param},regex:function(t){return new RegExp(t.param).test(t.value)},equalTo:function(t){var e=t.formElement.querySelector("#"+t.param);return t.param=e.value,t.param===t.value}},s([E.Property("")],r.prototype,"locale",void 0),s([E.Property("e-hidden")],r.prototype,"ignore",void 0),s([E.Property()],r.prototype,"rules",void 0),s([E.Property("e-error")],r.prototype,"errorClass",void 0),s([E.Property("e-valid")],r.prototype,"validClass",void 0),s([E.Property("label")],r.prototype,"errorElement",void 0),s([E.Property("div")],r.prototype,"errorContainer",void 0),s([E.Property(o.ErrorOption.Label)],r.prototype,"errorOption",void 0),s([E.Event()],r.prototype,"focusout",void 0),s([E.Event()],r.prototype,"keyup",void 0),s([E.Event()],r.prototype,"click",void 0),s([E.Event()],r.prototype,"change",void 0),s([E.Event()],r.prototype,"submit",void 0),s([E.Event()],r.prototype,"validationBegin",void 0),s([E.Event()],r.prototype,"validationComplete",void 0),s([E.Event()],r.prototype,"customPlacement",void 0),Ki=s([E.NotifyPropertyChanges],r));function r(t,e){e=Xi.call(this,e,t)||this;if(e.validated=[],e.errorRules=[],e.allowSubmit=!1,e.required="required",e.infoElement=null,e.inputElement=null,e.selectQuery="input:not([type=reset]):not([type=button]), select, textarea",e.localyMessage={},e.defaultMessages={required:"This field is required.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateIso:"Please enter a valid date ( ISO ).",creditcard:"Please enter valid card number",number:"Please enter a valid number.",digits:"Please enter only digits.",maxLength:"Please enter no more than {0} characters.",minLength:"Please enter at least {0} characters.",rangeLength:"Please enter a value between {0} and {1} characters long.",range:"Please enter a value between {0} and {1}.",max:"Please enter a value less than or equal to {0}.",min:"Please enter a value greater than or equal to {0}.",regex:"Please enter a correct value.",tel:"Please enter a valid phone number.",pattern:"Please enter a correct pattern value.",equalTo:"Please enter the valid match text"},void 0===e.rules&&(e.rules={}),e.l10n=new E.L10n("formValidator",e.defaultMessages,e.locale),e.locale&&e.localeFunc(),E.onIntlChange.on("notifyExternalChange",e.afterLocalization,e),t="string"==typeof t?E.select(t,document):t,null!=e.element)return e.element.setAttribute("novalidate",""),e.inputElements=E.selectAll(e.selectQuery,e.element),e.createHTML5Rules(),e.wireEvents(),e}Gi=function(t,e){return(Gi=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Gi,Ji,t=function(t,e){function i(){this.constructor=t}Gi(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},s=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},$i="e-file-select",Qi="e-file-drop",ts="e-upload-files",es="e-upload-file-list",c="e-file-status",is="e-file-name",ss="e-file-type",ns="e-file-size",m="e-file-remove-btn",u="e-file-delete-btn",as="e-spinner-pane",f="e-file-abort-btn",ls="e-file-reload-btn",rs="e-upload-drag-hover",os="e-upload-progress-wrap",hs="e-upload-progress-bar",ps="e-progress-bar-text",v="e-upload-progress",ds="e-upload-success",g="e-upload-fails",us="e-file-container",cs="e-validation-fails",ms="e-disabled",fs="e-rtl-container",vs="e-clear-icon-focus",y="e-file-pause-btn",gs="e-file-play-btn",ys="e-restrict-retry",bs=["title","style","class"],Cs="e-form-upload",Es="e-hidden-file-input",xs="e-file-invalid",Ss=(Ji=E.ChildProperty,t(Ts,Ji),s([E.Property("")],Ts.prototype,"name",void 0),s([E.Property(null)],Ts.prototype,"size",void 0),s([E.Property("")],Ts.prototype,"type",void 0),Ts);function Ts(){return null!==Ji&&Ji.apply(this,arguments)||this}Ps=E.ChildProperty,t(ws,Ps),s([E.Property("Browse...")],ws.prototype,"browse",void 0),s([E.Property("Upload")],ws.prototype,"upload",void 0),s([E.Property("Clear")],ws.prototype,"clear",void 0);var Ps,Os=ws;function ws(){return null!==Ps&&Ps.apply(this,arguments)||this}Ls=E.ChildProperty,t(As,Ls),s([E.Property("")],As.prototype,"saveUrl",void 0),s([E.Property("")],As.prototype,"removeUrl",void 0),s([E.Property(0)],As.prototype,"chunkSize",void 0),s([E.Property(3)],As.prototype,"retryCount",void 0),s([E.Property(500)],As.prototype,"retryAfterDelay",void 0);var Ls,ks=As;function As(){return null!==Ls&&Ls.apply(this,arguments)||this}Ns=E.Component,t(C,Ns),C.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"allowedExtensions":this.setExtensions(this.allowedExtensions),this.clearAll();break;case"enabled":this.setControlStatus();break;case"multiple":this.setMultipleSelection();break;case"enableRtl":this.setRTL(),this.reRenderFileList();break;case"buttons":this.buttons.browse=E.isNullOrUndefined(this.buttons.browse)?"":this.buttons.browse,this.buttons.clear=E.isNullOrUndefined(this.buttons.clear)?"":this.buttons.clear,this.buttons.upload=E.isNullOrUndefined(this.buttons.upload)?"":this.buttons.upload,this.renderButtonTemplates();break;case"dropArea":this.unBindDropEvents(),this.updateDropArea();break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.checkHTMLAttributes(!0);break;case"files":this.renderPreLoadFiles();break;case"directoryUpload":this.updateDirectoryAttributes();break;case"template":this.isReact?this.reRenderFileList():this.clearAll();break;case"minFileSize":case"maxFileSize":case"autoUpload":case"sequentialUpload":this.clearAll();break;case"locale":this.l10n.setLocale(this.locale),this.setLocalizedTexts(),this.preLocaleObj=E.getValue("currentLocale",this.l10n);break;case"cssClass":this.setCSSClass(e.cssClass)}},C.prototype.setLocalizedTexts=function(){E.isNullOrUndefined(this.template)&&("string"==typeof this.buttons.browse&&(this.browseButton.innerText="Browse..."===this.buttons.browse?this.localizedTexts("Browse"):this.buttons.browse,this.browseButton.setAttribute("title",this.browseButton.innerText),this.uploadWrapper)&&!E.isNullOrUndefined(this.uploadWrapper.querySelector("."+Qi))&&(this.uploadWrapper.querySelector("."+Qi).innerHTML=this.localizedTexts("dropFilesHint")),this.updateFileList())},C.prototype.getKeyValue=function(t){for(var e,i=0,s=Object.keys(this.preLocaleObj);i<s.length;i++){var n=s[i];this.preLocaleObj[""+n]===t&&(e=n)}return e},C.prototype.updateFileList=function(){if(0<this.fileList.length&&!E.isNullOrUndefined(this.uploadWrapper.querySelector("."+ts)))for(var t=0;t<this.fileList.length;t++)this.fileList[t].querySelector(".e-file-status").innerHTML=this.localizedTexts(this.getKeyValue(this.filesData[t].status)),this.filesData[t].status=this.localizedTexts(this.getKeyValue(this.filesData[t].status)),this.fileList[t].classList.contains(ds)&&this.fileList[t].querySelector(".e-icons").setAttribute("title",this.localizedTexts("delete")),this.fileList[t].querySelector(".e-file-play-btn")&&this.fileList[t].querySelector(".e-icons").setAttribute("title",this.localizedTexts("resume")),this.fileList[t].querySelector(".e-file-remove-btn")&&this.fileList[t].querySelector(".e-icons").setAttribute("title",this.localizedTexts("remove")),this.fileList[t].querySelector(".e-file-reload-btn")&&this.fileList[t].querySelector(".e-icons").setAttribute("title",this.localizedTexts("retry")),this.autoUpload||(this.uploadButton.innerText="Upload"===this.buttons.upload?this.localizedTexts("Upload"):this.buttons.upload,this.uploadButton.setAttribute("title",this.localizedTexts("Upload")),this.clearButton.innerText="Clear"===this.buttons.clear?this.localizedTexts("Clear"):this.buttons.clear,this.clearButton.setAttribute("title",this.localizedTexts("Clear")))},C.prototype.reRenderFileList=function(){this.listParent&&(E.detach(this.listParent),this.listParent=null,this.fileList=[],this.internalCreateFileList(this.filesData),this.actionButtons)&&(this.removeActionButtons(),this.renderActionButtons(),this.checkActionButtonStatus())},C.prototype.preRender=function(){this.localeText={Browse:"Browse...",Clear:"Clear",Upload:"Upload",invalidFileName:"File Name is not allowed",dropFilesHint:"Or drop files here",invalidMaxFileSize:"File size is too large",invalidMinFileSize:"File size is too small",invalidFileType:"File type is not allowed",uploadFailedMessage:"File failed to upload",uploadSuccessMessage:"File uploaded successfully",removedSuccessMessage:"File removed successfully",removedFailedMessage:"Unable to remove file",inProgress:"Uploading",readyToUploadMessage:"Ready to upload",abort:"Abort",remove:"Remove",cancel:"Cancel",delete:"Delete file",pauseUpload:"File upload paused",pause:"Pause",resume:"Resume",retry:"Retry",fileUploadCancel:"File upload canceled",invalidFileSelection:"Invalid files selected",totalFiles:"Total files",size:"Size"},this.l10n=new E.L10n("uploader",this.localeText,this.locale),this.preLocaleObj=E.getValue("currentLocale",this.l10n),this.formRendered(),this.updateHTMLAttrToElement(),this.checkHTMLAttributes(!1);var t=E.getValue("ej2_instances",this.element);if("EJS-UPLOADER"===this.element.tagName){for(var e=this.createElement("input",{attrs:{type:"file"}}),i=0;i<this.element.attributes.length;i++)"id"!==this.element.attributes[i].nodeName?e.setAttribute(this.element.attributes[i].nodeName,this.element.attributes[i].nodeValue):"id"===this.element.attributes[i].nodeName&&e.setAttribute(this.element.attributes[i].nodeName,E.getUniqueID("uploader")),e.innerHTML=this.element.innerHTML;e.hasAttribute("name")||e.setAttribute("name","UploadFiles"),this.element.appendChild(e),this.element=e,E.setValue("ej2_instances",t,this.element)}t[0].isPureReactComponent&&(E.isNullOrUndefined(t[0].props.name)?!E.isNullOrUndefined(t[0].props.id)&&E.isNullOrUndefined(t[0].props.name)?this.element.setAttribute("name",t[0].props.id):this.element.setAttribute("name","UploadFiles"):this.element.setAttribute("name",t[0].props.name)),E.isNullOrUndefined(this.element.getAttribute("name"))&&(E.isNullOrUndefined(this.element.getAttribute("id"))||""===this.element.getAttribute("id")?this.element.setAttribute("name","UploadFiles"):this.element.setAttribute("name",this.element.getAttribute("id"))),this.element.hasAttribute("type")||this.element.setAttribute("type","file"),this.updateDirectoryAttributes(),this.keyConfigs={enter:"enter"},this.element.hasAttribute("tabindex")&&(this.tabIndex=this.element.getAttribute("tabindex")),this.browserName=E.Browser.info.name,this.uploaderName=this.element.getAttribute("name")},C.prototype.formRendered=function(){var t=E.closest(this.element,"form");if(!E.isNullOrUndefined(t))for(;t&&t!==document.documentElement;t=t.parentElement)"FORM"===t.tagName&&(this.isForm=!0,(this.formElement=t).setAttribute("enctype","multipart/form-data"),t.setAttribute("encoding","multipart/form-data"))},C.prototype.getPersistData=function(){return this.addOnPersist(["filesData"])},C.prototype.getModuleName=function(){return"uploader"},C.prototype.updateDirectoryAttributes=function(){this.directoryUpload?(this.element.setAttribute("directory","true"),this.element.setAttribute("webkitdirectory","true")):(this.element.removeAttribute("directory"),this.element.removeAttribute("webkitdirectory"))},C.prototype.render=function(){this.renderBrowseButton(),this.initializeUpload(),this.updateHTMLAttrToWrapper(),this.wireEvents(),this.setMultipleSelection(),this.setExtensions(this.allowedExtensions),this.setRTL(),this.renderPreLoadFiles(),this.setControlStatus(),this.setCSSClass()},C.prototype.renderBrowseButton=function(){this.browseButton=this.createElement("button",{className:"e-css e-btn",attrs:{type:"button"}}),this.browseButton.setAttribute("tabindex",this.tabIndex),"string"==typeof this.buttons.browse?(this.browseButton.textContent="Browse..."===this.buttons.browse?this.localizedTexts("Browse"):this.buttons.browse,this.browseButton.setAttribute("title",this.browseButton.innerText)):this.browseButton.appendChild(this.buttons.browse),this.element.setAttribute("aria-label","Uploader")},C.prototype.renderActionButtons=function(){this.element.setAttribute("tabindex","-1"),this.actionButtons=this.createElement("div",{className:"e-upload-actions"}),this.uploadButton=this.createElement("button",{className:"e-file-upload-btn e-css e-btn e-flat e-primary",attrs:{type:"button",tabindex:this.btnTabIndex,"aria-label":this.localizedTexts("Upload")}}),this.clearButton=this.createElement("button",{className:"e-file-clear-btn e-css e-btn e-flat",attrs:{type:"button",tabindex:this.btnTabIndex,"aria-label":this.localizedTexts("Clear")}}),this.actionButtons.appendChild(this.clearButton),this.actionButtons.appendChild(this.uploadButton),this.renderButtonTemplates(),this.uploadWrapper.appendChild(this.actionButtons),this.browseButton.blur(),this.isPreloadFiles||this.uploadButton.focus(),this.wireActionButtonEvents()},C.prototype.serverActionButtonsEventBind=function(t){t&&!this.isForm&&(this.browseButton.blur(),this.actionButtons=t,this.uploadButton=this.actionButtons.querySelector(".e-file-upload-btn"),this.clearButton=this.actionButtons.querySelector(".e-file-clear-btn"),this.uploadButton.focus(),this.unwireActionButtonEvents(),this.wireActionButtonEvents(),this.checkActionButtonStatus())},C.prototype.wireActionButtonEvents=function(){E.EventHandler.add(this.uploadButton,"click",this.uploadButtonClick,this),E.EventHandler.add(this.clearButton,"click",this.clearButtonClick,this)},C.prototype.unwireActionButtonEvents=function(){E.EventHandler.remove(this.uploadButton,"click",this.uploadButtonClick),E.EventHandler.remove(this.clearButton,"click",this.clearButtonClick)},C.prototype.removeActionButtons=function(){this.actionButtons&&(this.unwireActionButtonEvents(),E.detach(this.actionButtons),this.actionButtons=null)},C.prototype.renderButtonTemplates=function(){var t;"string"==typeof this.buttons.browse?(this.browseButton.textContent="Browse..."===this.buttons.browse?this.localizedTexts("Browse"):this.buttons.browse,this.browseButton.setAttribute("title",this.browseButton.textContent)):(this.browseButton.innerHTML="",this.browseButton.appendChild(this.buttons.browse)),this.uploadButton&&(t=E.isNullOrUndefined(this.buttons.upload)?"Upload":this.buttons.upload,this.buttons.upload=t,"string"==typeof this.buttons.upload?(this.uploadButton.textContent="Upload"===this.buttons.upload?this.localizedTexts("Upload"):this.buttons.upload,this.uploadButton.setAttribute("title",this.uploadButton.textContent)):(this.uploadButton.innerHTML="",this.uploadButton.appendChild(this.buttons.upload))),this.clearButton&&(t=E.isNullOrUndefined(this.buttons.clear)?"Clear":this.buttons.clear,this.buttons.clear=t,"string"==typeof this.buttons.clear?(this.clearButton.textContent="Clear"===this.buttons.clear?this.localizedTexts("Clear"):this.buttons.clear,this.clearButton.setAttribute("title",this.clearButton.textContent)):(this.clearButton.innerHTML="",this.clearButton.appendChild(this.buttons.clear)))},C.prototype.initializeUpload=function(){this.element.setAttribute("tabindex","-1");var t=this.createElement("span",{className:$i});this.element.parentElement.insertBefore(t,this.element),this.dropAreaWrapper=this.createElement("div",{className:"e-file-select-wrap"}),this.element.parentElement.insertBefore(this.dropAreaWrapper,this.element),t.appendChild(this.element),this.dropAreaWrapper.appendChild(this.browseButton),this.dropAreaWrapper.appendChild(t),this.uploadWrapper=this.createElement("div",{className:"e-upload e-control-wrapper"}),this.dropAreaWrapper.parentElement.insertBefore(this.uploadWrapper,this.dropAreaWrapper),this.uploadWrapper.appendChild(this.dropAreaWrapper),this.setDropArea()},C.prototype.renderPreLoadFiles=function(){if(this.files.length)if(this.enablePersistence&&this.filesData.length)this.internalCreateFileList(this.filesData);else if(!E.isNullOrUndefined(this.files[0].size)){this.isPreloadFiles=!0;var t=[].slice.call(this.files),e=[];this.multiple||(this.clearData(),t=[t[0]]);for(var i=0,s=t;i<s.length;i++){var n=s[i],n={name:n.name+"."+n.type.split(".")[n.type.split(".").length-1],rawFile:"",size:n.size,status:this.localizedTexts("uploadSuccessMessage"),type:n.type,validationMessages:{minSize:"",maxSize:""},statusCode:"2"};e.push(n),this.filesData.push(n)}this.internalCreateFileList(e),this.autoUpload||!this.listParent||this.actionButtons||this.isForm&&!this.allowUpload()||!this.showFileList||this.renderActionButtons(),this.checkActionButtonStatus(),this.sequentialUpload&&(this.count=this.filesData.length-1),this.isPreloadFiles=!1}},C.prototype.checkActionButtonStatus=function(){var t;this.actionButtons&&(0<(t=this.uploadWrapper.querySelectorAll("."+cs).length+this.uploadWrapper.querySelectorAll(".e-upload-fails:not(.e-upload-progress)").length+this.uploadWrapper.querySelectorAll("span."+ds).length+this.uploadWrapper.querySelectorAll("span."+v).length)&&t===this.uploadWrapper.querySelectorAll("li").length?this.uploadButton.setAttribute("disabled","disabled"):this.uploadButton.removeAttribute("disabled"))},C.prototype.setDropArea=function(){var t=this.dropAreaWrapper.querySelector(".e-file-drop");if(this.dropArea){this.dropZoneElement="string"!=typeof this.dropArea?this.dropArea:E.select(this.dropArea,document);for(var e=this.element,i=!1;e.parentNode;)(e=e.parentNode)===this.dropZoneElement&&(i=!0,t?t.innerHTML=this.localizedTexts("dropFilesHint"):this.createDropTextHint());!i&&t&&E.remove(t),e=null}else E.isNullOrUndefined(this.uploaderOptions)||void 0!==this.uploaderOptions.dropArea||(this.createDropTextHint(),this.dropZoneElement=this.uploadWrapper,this.setProperties({dropArea:this.uploadWrapper},!0));this.bindDropEvents()},C.prototype.updateDropArea=function(){var t;this.dropArea?this.setDropArea():(this.dropZoneElement=null,(t=this.dropAreaWrapper.querySelector(".e-file-drop"))&&E.remove(t))},C.prototype.createDropTextHint=function(){var t=this.createElement("span",{className:Qi});t.innerHTML=this.localizedTexts("dropFilesHint"),this.dropAreaWrapper.appendChild(t)},C.prototype.updateHTMLAttrToElement=function(){if(!E.isNullOrUndefined(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var i=e[t];bs.indexOf(i)<0&&this.element.setAttribute(i,this.htmlAttributes[""+i])}},C.prototype.updateHTMLAttrToWrapper=function(){if(!E.isNullOrUndefined(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var i,s=e[t];-1<bs.indexOf(s)&&("class"===s?""!==(i=this.htmlAttributes[""+s].replace(/\s+/g," ").trim())&&E.addClass([this.uploadWrapper],i.split(" ")):"style"===s?(i=this.uploadWrapper.getAttribute(s),i=E.isNullOrUndefined(i)?this.htmlAttributes[""+s]:i+this.htmlAttributes[""+s],this.uploadWrapper.setAttribute(s,i)):this.uploadWrapper.setAttribute(s,this.htmlAttributes[""+s]))}},C.prototype.setMultipleSelection=function(){var t;this.multiple&&!this.element.hasAttribute("multiple")?((t=document.createAttribute("multiple")).value="multiple",this.element.setAttributeNode(t)):this.multiple||this.element.removeAttribute("multiple")},C.prototype.checkAutoUpload=function(t){this.autoUpload?(this.sequentialUpload?this.sequenceUpload(t):this.upload(t),this.removeActionButtons()):this.actionButtons||this.renderActionButtons(),this.checkActionButtonStatus()},C.prototype.sequenceUpload=function(t){var e;this.filesData.length-t.length!=0&&"1"===this.filesData[this.filesData.length-t.length-1].statusCode||((this.multiple||this.count<0)&&++this.count,e=!this.showFileList,"object"==typeof this.filesData[this.count]?(this.isFirstFileOnSelection=!1,this.upload(this.filesData[this.count],e),"0"===this.filesData[this.count].statusCode&&this.multiple&&this.sequenceUpload(t)):--this.count)},C.prototype.setCSSClass=function(t){var e=t,t=(E.isNullOrUndefined(t)||(e=t.replace(/\s+/g," ").trim()),E.isNullOrUndefined(t)||""===e||E.removeClass([this.uploadWrapper],e.split(" ")),this.cssClass);E.isNullOrUndefined(this.cssClass)||""===this.cssClass||(t=this.cssClass.replace(/\s+/g," ").trim()),E.isNullOrUndefined(this.cssClass)||""===t||E.addClass([this.uploadWrapper],t.split(-1<t.indexOf(",")?",":" "))},C.prototype.wireEvents=function(){E.EventHandler.add(this.browseButton,"click",this.browseButtonClick,this),E.EventHandler.add(this.element,"change",this.onSelectFiles,this),this.documentClickHandler=this.removeFocus.bind(this),E.EventHandler.add(document,"click",this.documentClickHandler),this.keyboardModule=new E.KeyboardEvents(this.uploadWrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.isForm&&E.EventHandler.add(this.formElement,"reset",this.resetForm,this)},C.prototype.unWireEvents=function(){E.EventHandler.remove(this.browseButton,"click",this.browseButtonClick),E.EventHandler.remove(this.element,"change",this.onSelectFiles),this.documentClickHandler&&(E.EventHandler.remove(document,"click",this.documentClickHandler),this.documentClickHandler=null),this.isForm&&E.EventHandler.remove(this.formElement,"reset",this.resetForm),this.keyboardModule&&this.keyboardModule.destroy()},C.prototype.resetForm=function(){this.clearAll()},C.prototype.keyActionHandler=function(t){var e,i,s=t.target;"enter"===t.action&&(t.target===this.clearButton?this.clearButtonClick():t.target===this.uploadButton?this.uploadButtonClick():t.target===this.browseButton?this.browseButtonClick():s.classList.contains(y)?((e=this.getCurrentMetaData(null,t)).file.statusCode="4",e.file.status=this.localizedTexts("pauseUpload"),this.abortUpload(e,!1)):s.classList.contains(gs)?this.resumeUpload(this.getCurrentMetaData(null,t),t):s.classList.contains(ls)?(e=this.getCurrentMetaData(null,t),E.isNullOrUndefined(e)?(i=t.target.parentElement,i=this.filesData[this.fileList.indexOf(i)],this.retry(i)):(e.file.statusCode="1",e.file.status=this.localizedTexts("readyToUploadMessage"),this.chunkUpload(e.file))):(this.removeFiles(t),s.classList.contains(f)||this.browseButton.focus()),t.preventDefault(),t.stopPropagation())},C.prototype.getCurrentMetaData=function(t,e){var i,s;s=E.isNullOrUndefined(t)?(e=e.target.parentElement,this.filesData[this.fileList.indexOf(e)]):t;for(var n=0;n<this.uploadMetaData.length;n++)this.uploadMetaData[n].file.name===s.name&&(i=this.uploadMetaData[n]);return i},C.prototype.removeFocus=function(){this.uploadWrapper&&this.listParent&&this.listParent.querySelector("."+vs)&&(document.activeElement.blur(),this.listParent.querySelector("."+vs).classList.remove(vs))},C.prototype.browseButtonClick=function(){this.element.click()},C.prototype.uploadButtonClick=function(){this.sequentialUpload?this.sequenceUpload(this.filesData):this.upload(this.filesData)},C.prototype.clearButtonClick=function(){this.clearAll(),this.sequentialUpload&&(this.count=-1),this.actionCompleteCount=0},C.prototype.bindDropEvents=function(){this.dropZoneElement&&(E.EventHandler.add(this.dropZoneElement,"drop",this.dropElement,this),E.EventHandler.add(this.dropZoneElement,"dragover",this.dragHover,this),E.EventHandler.add(this.dropZoneElement,"dragleave",this.onDragLeave,this),E.EventHandler.add(this.dropZoneElement,"paste",this.onPasteFile,this),E.EventHandler.add(this.dropZoneElement,"dragenter",this.onDragEnter,this))},C.prototype.unBindDropEvents=function(){this.dropZoneElement&&(E.EventHandler.remove(this.dropZoneElement,"drop",this.dropElement),E.EventHandler.remove(this.dropZoneElement,"dragover",this.dragHover),E.EventHandler.remove(this.dropZoneElement,"dragleave",this.onDragLeave),E.EventHandler.remove(this.dropZoneElement,"paste",this.onPasteFile),E.EventHandler.remove(this.dropZoneElement,"dragenter",this.onDragEnter))},C.prototype.onDragEnter=function(t){this.enabled&&(this.dropZoneElement.classList.add(rs),this.dragCounter=this.dragCounter+1,t.preventDefault(),t.stopPropagation())},C.prototype.onDragLeave=function(){this.enabled&&(this.dragCounter=this.dragCounter-1,this.dragCounter||this.dropZoneElement.classList.remove(rs))},C.prototype.dragHover=function(t){this.enabled&&("Default"!==this.dropEffect&&(t.dataTransfer.dropEffect=this.dropEffect.toLowerCase()),t.preventDefault(),t.stopPropagation())},C.prototype.dropElement=function(t){this.dragCounter=0,this.dropZoneElement.classList.remove(rs),this.onSelectFiles(t),t.preventDefault(),t.stopPropagation()},C.prototype.onPasteFile=function(t){var e=t.clipboardData.items;if("paste"===t.type&&"msie"!==this.browserName&&"edge"!==this.browserName&&"safari"!==this.browserName&&(this.element.files=t.clipboardData.files),1===e.length||this.multiple)for(var i=0;i<e.length;i++){var s=[].slice.call(e)[i];E.isNullOrUndefined(s.getAsFile())||"file"!==s.kind&&!s.type.match("^image/")||this.renderSelectedFiles(t,[s.getAsFile()],!1,!0)}},C.prototype.getSelectedFiles=function(t){for(var e=[],i=this.fileList[t],s=this.getFilesData(),n=+i.getAttribute("data-files-count"),a=0,l=0;l<t;l++)a+=+this.fileList[l].getAttribute("data-files-count");for(var r=a;r<a+n;r++)e.push(s[r]);return i=null,e},C.prototype.removeFiles=function(t){var e,i,s,n;this.enabled&&(e=t.target.parentElement,s=this.fileList.indexOf(e),i=this.fileList[s],s=(n=this.isFormUpload())?this.getSelectedFiles(s):this.getFilesInArray(this.filesData[s]),E.isNullOrUndefined(s)||(t.target.classList.contains(f)&&!n?(s[0].statusCode="5",E.isNullOrUndefined(i)||(n=i.querySelector("."+f),h.createSpinner({target:n,width:"20px"}),h.showSpinner(n)),this.sequentialUpload&&this.uploadSequential(),i.classList.contains(ys)||this.checkActionComplete(!0)):E.closest(t.target,"."+as)||this.remove(s,!1,!1,!0,t),this.isForm&&i&&i.classList.contains(xs)&&(this.element.value=""),this.checkActionButtonStatus(),this.actionButtons&&this.clearButton&&this.uploadWrapper&&1===(n=this.uploadWrapper.querySelectorAll(".e-upload-progress-bar.e-upload-progress:not(.e-upload-success):not(.e-upload-fails)")).length&&e.contains(n[0])&&this.clearButton.hasAttribute("disabled")&&this.clearButton.removeAttribute("disabled"),i=null))},C.prototype.removeFilesData=function(t,e){var i;e?this.showFileList||(i=this.filesData.indexOf(t),this.filesData.splice(i,1)):(e=this.getLiElement(t),E.isNullOrUndefined(e)||(this.element.value="",(t=e.querySelector(".e-icons"))&&E.EventHandler.remove(t,"click",this.removeFiles),E.detach(e),i=this.fileList.indexOf(e),this.fileList.splice(i,1),this.filesData.splice(i,1),0!==this.fileList.length||E.isNullOrUndefined(this.listParent)||(E.detach(this.listParent),this.listParent=null,this.removeActionButtons()),this.sequentialUpload&&i<=this.count&&--this.count))},C.prototype.removeUploadedFile=function(i,t,s,e){var n=this,a=i,l=new E.Ajax(this.asyncSettings.removeUrl,"POST",!0,null),r=(l.emitError=!1,new FormData);l.beforeSend=function(e){t.currentRequest=l.httpRequest,s?n.removingEventCallback(t,r,a,i):n.trigger("removing",t,function(t){t.cancel?e.cancel=!0:n.removingEventCallback(t,r,a,i)})},l.onLoad=function(t){return n.removeCompleted(t,a,e),{}},l.onError=function(t){return n.removeFailed(t,a,e),{}},l.send(r)},C.prototype.removingEventCallback=function(t,e,i,s){var n=this.element.getAttribute("name"),s=this.getLiElement(s);E.isNullOrUndefined(s)||E.isNullOrUndefined(s.querySelector("."+u))&&E.isNullOrUndefined(s.querySelector("."+m))||(s=s.querySelector("."+u)?s.querySelector("."+u):s.querySelector("."+m),h.createSpinner({target:s,width:"20px"}),h.showSpinner(s)),t.postRawFile&&!E.isNullOrUndefined(i.rawFile)&&""!==i.rawFile?e.append(n,i.rawFile,i.name):e.append(n,i.name),this.updateFormData(e,t.customFormData)},C.prototype.updateFormData=function(i,s){if(0<s.length&&s[0])for(var t=0;t<s.length;t++)!function(t){var e=s[t],t=Object.keys(e).map(function(t){return e[""+t]});i.append(Object.keys(e)[0],t)}(t)},C.prototype.updateCustomheader=function(i,s){if(0<s.length&&s[0])for(var t=0;t<s.length;t++)!function(t){var e=s[t],t=Object.keys(e).map(function(t){return e[""+t]});i.setRequestHeader(Object.keys(e)[0],t)}(t)},C.prototype.removeCompleted=function(t,e,i){var s=t&&t.currentTarget?this.getResponse(t):null,n=t.target;4===n.readyState&&200<=n.status&&n.status<=299?(n={e:t,response:s,operation:"remove",file:this.updateStatus(e,this.localizedTexts("removedSuccessMessage"),"2")},this.trigger("success",n),this.removeFilesData(e,i),s=this.uploadedFilesData.indexOf(e),this.uploadedFilesData.splice(s,1),this.trigger("change",{files:this.uploadedFilesData})):this.removeFailed(t,e,i)},C.prototype.removeFailed=function(t,e,i){var t={e:t,response:t&&t.currentTarget?this.getResponse(t):null,operation:"remove",file:this.updateStatus(e,this.localizedTexts("removedFailedMessage"),"0")},s=(i||(i=this.filesData.indexOf(e),(i=this.fileList[i])&&(i.classList.remove(ds),i.classList.add(g),s=i.querySelector("."+c))&&(s.classList.remove(ds),s.classList.add(g)),i=null,this.checkActionButtonStatus()),this.trigger("failure",t),this.getLiElement(e));E.isNullOrUndefined(s)||E.isNullOrUndefined(s.querySelector("."+u))||(i=s.querySelector("."+u),h.hideSpinner(i),E.detach(s.querySelector(".e-spinner-pane")))},C.prototype.getFilesFromFolder=function(e){this.filesEntries=[];var n=this.multiple?e.dataTransfer.items:[e.dataTransfer.items[0]];if(this.checkDirectoryUpload(n))for(var a=this,t=0;t<n.length;t++)!function(t){var i,s=n[t].webkitGetAsEntry();s.isFile?(i=[],s.file(function(t){var e=s.fullPath;i.push({path:e,file:t})}),a.renderSelectedFiles(e,i,!0)):s.isDirectory&&a.traverseFileTree(s,e)}(t)},C.prototype.checkDirectoryUpload=function(t){for(var e=0;t&&e<t.length;e++)if(t[e].webkitGetAsEntry().isDirectory)return!0;return!1},C.prototype.traverseFileTree=function(t,e){t.isFile?this.filesEntries.push(t):t.isDirectory&&(t=t.createReader(),this.readFileFromDirectory(t,e))},C.prototype.readFileFromDirectory=function(i,s){var n=this;i.readEntries(function(t){for(var e=0;e<t.length;e++)n.traverseFileTree(t[e],s);n.pushFilesEntries(s),t.length&&n.readFileFromDirectory(i)})},C.prototype.pushFilesEntries=function(s){for(var n=this,a=[],t=this,e=0;e<this.filesEntries.length;e++)!function(i){t.filesEntries[i].file(function(t){var e;n.filesEntries.length&&(e=n.filesEntries[i].fullPath,a.push({path:e,file:t}),i===n.filesEntries.length-1)&&(n.filesEntries=[],n.renderSelectedFiles(s,a,!0))})}(e)},C.prototype.onSelectFiles=function(t){var e,i;this.enabled&&("drop"===t.type?this.directoryUpload?this.getFilesFromFolder(t):(i=this.sortFilesList=t.dataTransfer.files,"msie"!==this.browserName&&"edge"!==this.browserName&&"safari"!==this.browserName&&(this.element.files=i),0<i.length&&(e=this.multiple?this.sortFileList(i):[i[0]],this.renderSelectedFiles(t,e))):(e=[].slice.call(t.target.files),this.renderSelectedFiles(t,e)),this.isAngular||this.isReact)&&t.stopPropagation()},C.prototype.getBase64=function(s){return new Promise(function(t,e){var i=new FileReader;i.readAsDataURL(s),i.onload=function(){return t(i.result)},i.onerror=function(t){return e(t)}})},C.prototype.renderSelectedFiles=function(t,e,i,s){var n=this,a={event:t,cancel:!(this.base64String=[]),filesData:[],isModified:!1,modifiedFilesData:[],progressInterval:"",isCanceled:!1,currentRequest:null,customFormData:null};if(e.length<1)a.isCanceled=!0,this.trigger("selected",a);else{this.flag=!0;var l=[];this.multiple||(this.clearData(!0),e=[e[this.actionCompleteCount=0]]);for(var r=0;r<e.length;r++){var o=i?e[r].file:e[r];this.updateInitialFileDetails(t,e,o,r,l,i,s)}if(a.filesData=l,!E.isNullOrUndefined(this.allowedExtensions)&&-1<this.allowedExtensions.indexOf("*")&&(this.allTypes=!0),this.enableHtmlSanitizer)for(r=0;r<l.length;r++){for(var h=E.SanitizeHtmlHelper.beforeSanitize(),h=E.SanitizeHtmlHelper.serializeValue(h,l[parseInt(r.toString(),10)].name),p=l[parseInt(r.toString(),10)].name,d=!1,u=0;u<p.length;u++)if(127<p.charCodeAt(u)){d=!0;break}var c=/<([a-z][a-z0-9]*)\b[^>]*>(.*?)<\/\1>/i.test(p);h===l[parseInt(r.toString(),10)].name||d&&!c||(h=e[parseInt(r.toString(),10)].name.replace(/[\u00A0-\u9999<>\\&]/g,function(t){return"&#"+t.charCodeAt(0)+";"}),l[parseInt(r.toString(),10)].name=h,l[parseInt(r.toString(),10)].status=this.localizedTexts("invalidFileName"),l[parseInt(r.toString(),10)].statusCode="0")}this.allTypes||(l=this.checkExtension(l)),this.trigger("selected",a,function(t){n._internalRenderSelect(t,l)})}},C.prototype.updateInitialFileDetails=function(t,e,i,s,n,a,l){a={name:a?e[s].path.substring(1,e[s].path.length):l?E.getUniqueID(i.name.substring(0,i.name.lastIndexOf(".")))+"."+this.getFileType(i.name):this.directoryUpload?e[s].webkitRelativePath:i.name,rawFile:i,size:i.size,status:this.localizedTexts("readyToUploadMessage"),type:this.getFileType(i.name),validationMessages:this.validatedFileSize(i.size),statusCode:"1",id:E.getUniqueID(i.name.substring(0,i.name.lastIndexOf(".")))+"."+this.getFileType(i.name)};l&&(a.fileSource="paste"),a.status=""!==a.validationMessages.minSize?this.localizedTexts("invalidMinFileSize"):""!==a.validationMessages.maxSize?this.localizedTexts("invalidMaxFileSize"):a.status,""===a.validationMessages.minSize&&""===a.validationMessages.maxSize||(a.statusCode="0",this.checkActionComplete(!0)),n.push(a)},C.prototype._internalRenderSelect=function(t,e){if(!t.cancel){if(this.selectedFiles=this.selectedFiles.concat(e),this.btnTabIndex=this.disableKeyboardNavigation?"-1":"0",this.showFileList){if(t.isModified&&0<t.modifiedFilesData.length){for(var i=0;i<t.modifiedFilesData.length;i++)for(var s=0;s<e.length;s++)t.modifiedFilesData[i].id===e[s].id&&(t.modifiedFilesData[i].rawFile=e[s].rawFile);var n=this.allTypes?t.modifiedFilesData:this.checkExtension(t.modifiedFilesData);this.updateSortedFileList(n),this.filesData=this.filesData.concat(n),this.isForm&&!this.allowUpload()||this.checkAutoUpload(n)}else{if(this.internalCreateFileList(e),this.autoUpload&&this.sequenceUpload&&this.sequentialUpload&&0<this.filesData.length&&"2"!==this.filesData[this.filesData.length-1].statusCode&&"0"!==this.filesData[this.filesData.length-1].statusCode)return void(this.filesData=this.filesData.concat(e));this.filesData=this.filesData.concat(e),this.isForm&&!this.allowUpload()||this.checkAutoUpload(e)}E.isNullOrUndefined(t.progressInterval)||""===t.progressInterval||(this.progressInterval=t.progressInterval)}else this.filesData=this.filesData.concat(e),this.autoUpload&&this.upload(this.filesData,!0);this.raiseActionComplete(),this.isFirstFileOnSelection=!0}},C.prototype.allowUpload=function(){var t=!1;return t=this.isForm&&!E.isNullOrUndefined(this.asyncSettings.saveUrl)&&""!==this.asyncSettings.saveUrl?!0:t},C.prototype.isFormUpload=function(){var t=!1;return t=!this.isForm||!E.isNullOrUndefined(this.asyncSettings.saveUrl)&&""!==this.asyncSettings.saveUrl||!E.isNullOrUndefined(this.asyncSettings.removeUrl)&&""!==this.asyncSettings.removeUrl?t:!0},C.prototype.clearData=function(t){if(!E.isNullOrUndefined(this.listParent)){for(var e=this.listParent.querySelectorAll(".e-icons"),i=0;i<e.length;i++)E.EventHandler.remove(e[i],"click",this.removeFiles);E.detach(this.listParent),this.listParent=null}"msie"===this.browserName||t||(this.element.value=""),this.isFormUpload()&&this.uploadWrapper.querySelector("."+$i)&&((t=this.uploadWrapper.querySelector("."+$i).querySelector("."+Es))&&this.uploadWrapper.querySelector("."+$i).removeChild(t),t=null),this.fileList.length=0,this.filesData.length=0,this.removeActionButtons()},C.prototype.updateSortedFileList=function(t){var e=this.createElement("div",{id:"clonewrapper"}),i=-1;if(this.listParent){for(var s=0;s<this.listParent.querySelectorAll("li").length;s++){var n=this.listParent.querySelectorAll("li")[s];e.appendChild(n.cloneNode(!0)),n=null}this.removeActionButtons();var a=[].slice.call(e.childNodes);this.createParentUL();for(var l=0;l<t.length;l++){for(var r=0;r<this.filesData.length;r++)this.filesData[r].name===t[l].name&&(this.listParent.appendChild(a[r]),E.EventHandler.add(a[r].querySelector(".e-icons"),"click",this.removeFiles,this),this.fileList.push(a[r]),i=l);i!==l&&this.internalCreateFileList([t[l]])}e.innerHTML="",a.length=0}else this.internalCreateFileList(t)},C.prototype.isBlank=function(t){return!t||/^\s*$/.test(t)},C.prototype.checkGenericExtension=function(t,e){var i=[];switch(t.toLowerCase()){case"image/*":i.push("jpg","jpeg","png","gif","bmp","tiff","svg","webp","heic");break;case"audio/*":i.push("mp3","wav","aac","flac","ogg","m4a");break;case"video/*":i.push("mp4","mov","avi","mkv","flv","wmv","webm","mpeg");break;case"application/*":i.push("doc","docx","xls","xlsx","ppt","pptx","zip","rar","7z","tar","pdf");break;case"text/*":i.push("txt","csv","html","css","js","json","xml","md")}return i.includes(e.toLowerCase())},C.prototype.checkExtension=function(t){var e=t;if(!this.isBlank(this.allowedExtensions)){for(var i=[],s=0,n=E.isNullOrUndefined(i)?[""]:this.allowedExtensions.split(",");s<n.length;s++){var a=n[s];i.push(a.trim().toLocaleLowerCase())}for(var l=0;l<t.length;l++){var r=-1!==t[l].type.indexOf(".")?t[l].type.replace(".",""):t[l].type;-1!==i[0].indexOf("/*")?this.checkGenericExtension(i[0],r)||(t[l].status=this.localizedTexts("invalidFileType"),t[l].statusCode="0"):-1===i.indexOf(("."+r).toLocaleLowerCase())&&(t[l].status=this.localizedTexts("invalidFileType"),t[l].statusCode="0")}}return e},C.prototype.validatedFileSize=function(t){var e="",i="";return t<this.minFileSize?e=this.localizedTexts("invalidMinFileSize"):i=t>this.maxFileSize?this.localizedTexts("invalidMaxFileSize"):e="",{minSize:e,maxSize:i}},C.prototype.isPreLoadFile=function(t){for(var e=!1,i=0;i<this.files.length;i++)this.files[i].name===t.name.slice(0,t.name.lastIndexOf("."))&&this.files[i].type===t.type&&(e=!0);return e},C.prototype.createCustomfileList=function(t){this.createParentUL();for(var e=0,i=t;e<i.length;e++){var s=i[e],n=this.createElement("li",{className:es,attrs:{"data-file-name":s.name}}),a=(this.uploadTemplateFn=this.templateComplier(this.template),this.uploadTemplateFn(s,this,"template",this.element.id+"Template",this.isStringTemplate,null,n)),a=(a&&(a=[].slice.call(a),E.append(a,n)),t.indexOf(s)),l={element:n,fileInfo:s,index:a,isPreload:this.isPreLoadFile(s)},a={element:n,fileInfo:s,index:a,isPreload:this.isPreLoadFile(s)};this.trigger("rendering",l),this.trigger("fileListRendering",a),this.listParent.appendChild(n),this.fileList.push(n),0}this.renderReactTemplates()},C.prototype.createParentUL=function(){E.isNullOrUndefined(this.listParent)&&(this.listParent=this.createElement("ul",{className:ts}),this.uploadWrapper.appendChild(this.listParent))},C.prototype.formFileList=function(t,e){for(var i,s=this.createElement("li",{className:es}),n=(s.setAttribute("data-files-count",t.length+""),this.createElement("span",{className:us})),a=0,l=t;a<l.length;a++){var r=l[a],o=this.createElement("span",{className:is}),h=(o.innerHTML=this.getFileNameOnly(r.name),this.createElement("span",{className:ss})),p=this.getFileType(r.name);h.innerHTML="."+p,p||h.classList.add("e-hidden"),this.enableRtl?((p=this.createElement("span",{className:fs})).appendChild(h),p.appendChild(o),n.appendChild(p)):(n.appendChild(o),n.appendChild(h)),this.truncateName(o),i=this.formValidateFileInfo(r,s)}s.appendChild(n),this.setListToFileInfo(t,s);var d=this.listParent.querySelectorAll("li").length,u=this.createElement("span"),u=(s.classList.contains(xs)?(u.classList.add(c),u.classList.add(xs),u.innerText=1<t.length?this.localizedTexts("invalidFileSelection"):i):(u.classList.add(1<t.length?"e-file-information":ns),u.innerText=1<t.length?this.localizedTexts("totalFiles")+": "+t.length+" , "+this.localizedTexts("size")+": "+this.bytesToSize(this.getFileSize(t)):this.bytesToSize(t[0].size),this.createFormInput(t)),n.appendChild(u),E.isNullOrUndefined(s.querySelector(".e-icons"))&&(u=this.createElement("span",{className:"e-icons",attrs:{tabindex:this.btnTabIndex}}),"msie"===this.browserName&&u.classList.add("e-msie"),u.setAttribute("title",this.localizedTexts("remove")),s.appendChild(n),s.appendChild(u),E.EventHandler.add(u,"click",this.removeFiles,this),u.classList.add(m)),{element:s,fileInfo:this.mergeFileInfo(t,s),index:d,isPreload:this.isPreLoadFile(this.mergeFileInfo(t,s))}),d={element:s,fileInfo:this.mergeFileInfo(t,s),index:d,isPreload:this.isPreLoadFile(this.mergeFileInfo(t,s))};this.trigger("rendering",u),this.trigger("fileListRendering",d),this.listParent.appendChild(s),this.fileList.push(s)},C.prototype.formValidateFileInfo=function(t,e){var i=t.status,s=this.validatedFileSize(t.size),s=(""===s.minSize&&""===s.maxSize||(this.addInvalidClass(e),i=""!==s.minSize?this.localizedTexts("invalidMinFileSize"):""!==s.maxSize?this.localizedTexts("invalidMaxFileSize"):i),this.checkExtension(this.getFilesInArray(t))[0].status);return s===this.localizedTexts("invalidFileType")&&(this.addInvalidClass(e),i=s),i},C.prototype.addInvalidClass=function(t){t.classList.add(xs)},C.prototype.createFormInput=function(t){if("safari"!==this.browserName){var e=this.element.cloneNode(!0);e.classList.add(Es);for(var i=0,s=t;i<s.length;i++)s[i].input=e;e.setAttribute("id",E.getUniqueID("hiddenUploader")),e.setAttribute("name",this.uploaderName),this.uploadWrapper.querySelector("."+$i).appendChild(e),"msie"!==this.browserName&&"edge"!==this.browserName&&(this.element.value="")}},C.prototype.getFileSize=function(t){for(var e=0,i=0,s=t;i<s.length;i++)e+=s[i].size;return e},C.prototype.mergeFileInfo=function(t,e){for(var i={name:"",rawFile:"",size:0,status:"",type:"",validationMessages:{minSize:"",maxSize:""},statusCode:"1",list:e},s=[],n="",a=0,l=t;a<l.length;a++){var r=l[a];s.push(r.name),n=r.type}return i.name=s.join(", "),i.size=this.getFileSize(t),i.type=n,i.status=this.statusForFormUpload(t,e),i},C.prototype.statusForFormUpload=function(t,e){for(var i=!0,s=0,n=t;s<n.length;s++){var a=n[s],l=a.status,r=this.validatedFileSize(a.size),r=(""===r.minSize&&""===r.maxSize||(i=!1,l=""!==r.minSize?this.localizedTexts("invalidMinFileSize"):""!==r.maxSize?this.localizedTexts("invalidMaxFileSize"):l),this.checkExtension(this.getFilesInArray(a))[0].status);r===this.localizedTexts("invalidFileType")&&(i=!1,l=r)}return l=i?this.localizedTexts("totalFiles")+": "+t.length+" , "+this.localizedTexts("size")+": "+this.bytesToSize(this.getFileSize(t)):(e.classList.add(xs),1<t.length?this.localizedTexts("invalidFileSelection"):l)},C.prototype.formCustomFileList=function(t,e){this.createParentUL();var i=this.createElement("li",{className:es}),s=(i.setAttribute("data-files-count",t.length+""),this.setListToFileInfo(t,i),this.mergeFileInfo(t,i)),n=(i.setAttribute("data-file-name",s.name),this.uploadTemplateFn=this.templateComplier(this.template),this.uploadTemplateFn(s,this,"template",this.element.id+"Template",this.isStringTemplate,null,i)),n=(n&&(n=[].slice.call(n),E.append(n,i)),this.listParent.querySelectorAll("li").length),t=(i.classList.contains(xs)||this.createFormInput(t),{element:i,fileInfo:s,index:n,isPreload:this.isPreLoadFile(s)}),n={element:i,fileInfo:s,index:n,isPreload:this.isPreLoadFile(s)};this.trigger("rendering",t),this.trigger("fileListRendering",n),this.listParent.appendChild(i),this.fileList.push(i),this.renderReactTemplates()},C.prototype.createFileList=function(t){this.filesData=this.filesData&&0<this.filesData.length?this.filesData.concat(t):t,this.internalCreateFileList(t)},C.prototype.internalCreateFileList=function(t){if(this.createParentUL(),""===this.template||E.isNullOrUndefined(this.template))if(this.isFormUpload())this.uploadWrapper.classList.add(Cs),this.formFileList(t,this.element.files);else for(var e=0,i=t;e<i.length;e++){var s=i[e],n=this.createElement("li",{className:es,attrs:{"data-file-name":s.name,"data-files-count":"1"}}),a=this.createElement("span",{className:us}),l=this.createElement("span",{className:is,attrs:{title:s.name}}),r=(l.innerHTML=this.getFileNameOnly(s.name),this.createElement("span",{className:ss})),o=this.getFileType(s.name),o=(r.innerHTML="."+o,o||r.classList.add("e-hidden"),this.enableRtl?((o=this.createElement("span",{className:fs})).appendChild(r),o.appendChild(l),a.appendChild(o)):(a.appendChild(l),a.appendChild(r)),this.createElement("span",{className:ns})),r=(o.innerHTML=this.bytesToSize(s.size),a.appendChild(o),this.createElement("span",{className:c})),o=(a.appendChild(r),r.innerHTML=s.status,n.appendChild(a),this.createElement("span",{className:" e-icons",attrs:{tabindex:this.btnTabIndex}})),a=("msie"===this.browserName&&o.classList.add("e-msie"),o.setAttribute("title",this.localizedTexts("remove")),n.appendChild(o),E.EventHandler.add(o,"click",this.removeFiles,this),"2"===s.statusCode?(r.classList.add(ds),o.classList.add(u),o.setAttribute("title",this.localizedTexts("delete")),o.setAttribute("aria-label",this.localizedTexts("delete"))):"1"!==s.statusCode&&(r.classList.remove(ds),r.classList.add(cs)),this.autoUpload&&"1"===s.statusCode&&""!==this.asyncSettings.saveUrl&&(r.innerHTML=""),o.classList.contains(u)||(o.classList.add(m),o.setAttribute("aria-label",this.localizedTexts("remove"))),t.indexOf(s)),r={element:n,fileInfo:s,index:a,isPreload:this.isPreLoadFile(s)},o={element:n,fileInfo:s,index:a,isPreload:this.isPreLoadFile(s)},a=(this.trigger("rendering",r),this.trigger("fileListRendering",o),this.listParent.appendChild(n),this.fileList.push(n),this.truncateName(l),this.flag);this.isPreLoadFile(s)&&(this.flag=!1,this.checkActionComplete(!0),this.flag=a),n=null}else this.isFormUpload()?(this.uploadWrapper.classList.add(Cs),this.formCustomFileList(t,this.element.files)):this.createCustomfileList(t)},C.prototype.getSlicedName=function(t){var e=t.textContent;t.dataset.tail=e.slice(e.length-10)},C.prototype.setListToFileInfo=function(t,e){for(var i=0,s=t;i<s.length;i++)s[i].list=e},C.prototype.truncateName=function(t){("edge"!==this.browserName&&t.offsetWidth<t.scrollWidth||t.offsetWidth+1<t.scrollWidth)&&this.getSlicedName(t)},C.prototype.getFileType=function(t){var e,i=t.lastIndexOf(".");return(e=0<=i?t.substring(i+1):e)||""},C.prototype.getFileNameOnly=function(t){var e=this.getFileType(t);return t.split("."+e)[0]},C.prototype.setInitialAttributes=function(){var t;this.initialAttr.accept&&this.element.setAttribute("accept",this.initialAttr.accept),this.initialAttr.disabled&&this.element.setAttribute("disabled","disabled"),this.initialAttr.multiple&&(t=document.createAttribute("multiple"),this.element.setAttributeNode(t))},C.prototype.filterfileList=function(t){for(var e,i=[],s=0;s<t.length;s++)e=this.getLiElement(t[s]),(E.isNullOrUndefined(e)||e.classList.contains(ds))&&(this.showFileList||"File uploaded successfully"===t[s].status)||i.push(t[s]);return e=null,i},C.prototype.updateStatus=function(t,e,i,s){return void 0===s&&(s=!0),""===e||E.isNullOrUndefined(e)||""===i||E.isNullOrUndefined(i)||(t.status=e,t.statusCode=i),s&&(i=this.getLiElement(t),E.isNullOrUndefined(i)||E.isNullOrUndefined(i.querySelector("."+c))||""===e||E.isNullOrUndefined(e)||(i.querySelector("."+c).textContent=e),i=null),t},C.prototype.getLiElement=function(t){for(var e,i=0;i<this.filesData.length;i++)E.isNullOrUndefined(t)||(E.isNullOrUndefined(this.filesData[i].id)||E.isNullOrUndefined(t.id)?this.filesData[i].name!==t.name:this.filesData[i].name!==t.name||this.filesData[i].id!==t.id)||(e=i);return this.fileList[e]},C.prototype.createProgressBar=function(t){var e=this.createElement("span",{className:os}),i=this.createElement("progressbar",{className:hs,attrs:{value:"0",max:"100"}}),s=this.createElement("span",{className:"e-progress-inner-wrap"}),n=(i.style.width="0%",this.createElement("span",{className:ps}));n.textContent="0%",s.appendChild(i),e.appendChild(s),e.appendChild(n),t.querySelector("."+us).appendChild(e)},C.prototype.updateProgressbar=function(t,e){var i;isNaN(Math.round(t.loaded/t.total*100))||E.isNullOrUndefined(e.querySelector("."+hs))||!E.isNullOrUndefined(this.progressInterval)&&""!==this.progressInterval&&0!=(i=Math.round(t.loaded/t.total*100)%parseInt(this.progressInterval,10))&&100!=i||this.changeProgressValue(e,Math.round(t.loaded/t.total*100).toString()+"%")},C.prototype.changeProgressValue=function(t,e){t.querySelector("."+hs).style.width=e,t.querySelector("."+ps).textContent=e},C.prototype.uploadInProgress=function(t,e,i,s){var n=this.getLiElement(e);E.isNullOrUndefined(n)&&!i||(E.isNullOrUndefined(n)?this.cancelUploadingFile(e,t,s):("5"===e.statusCode&&this.cancelUploadingFile(e,t,s,n),0<n.querySelectorAll("."+os).length||!n.querySelector("."+c)||(n.querySelector("."+c).classList.add(v),this.createProgressBar(n),this.updateProgressBarClasses(n,v),n.querySelector("."+c).classList.remove(g)),this.updateProgressbar(t,n),i=n.querySelector("."+m),E.isNullOrUndefined(i)||(i.classList.add(f,v),i.setAttribute("title",this.localizedTexts("abort")),i.classList.remove(m))),s={e:t,operation:"upload",file:this.updateStatus(e,this.localizedTexts("inProgress"),"3")},this.trigger("progress",s))},C.prototype.cancelUploadingFile=function(n,t,a,l){var r=this;"5"===n.statusCode&&this.trigger("canceling",{event:t,fileData:n,cancel:!1,customFormData:[],currentRequest:null},function(e){var t,i,s;e.cancel?(n.statusCode="3",E.isNullOrUndefined(l)||(t=l.querySelector("."+f),E.isNullOrUndefined(t))||(h.hideSpinner(t),E.detach(l.querySelector(".e-spinner-pane")))):(a.emitError=!1,a.httpRequest.abort(),t=new FormData,"5"===n.statusCode&&(i=r.element.getAttribute("name"),t.append(i,n.name),t.append("cancel-uploading",n.name),r.updateFormData(t,e.customFormData),(s=new E.Ajax(r.asyncSettings.removeUrl,"POST",!0,null)).emitError=!1,s.beforeSend=function(t){e.currentRequest&&r.updateCustomheader(s.httpRequest,e.currentRequest)},s.onLoad=function(t){return r.removecanceledFile(t,n),{}},s.send(t)))})},C.prototype.removecanceledFile=function(t,e){var i,s=this.getLiElement(e);E.isNullOrUndefined(s)||s.querySelector("."+ls)||E.isNullOrUndefined(s.querySelector("."+f))||(this.updateStatus(e,this.localizedTexts("fileUploadCancel"),"5"),this.renderFailureState(t,e,s),i=s.querySelector("."+m),E.isNullOrUndefined(s)||(h.hideSpinner(i),E.isNullOrUndefined(s.querySelector(".e-spinner-pane")))||E.detach(s.querySelector(".e-spinner-pane")),i=t&&t.currentTarget?this.getResponse(t):null,this.trigger("success",{event:t,response:i,operation:"cancel",file:e}))},C.prototype.renderFailureState=function(t,e,i){var s=this,n=(this.updateProgressBarClasses(i,g),this.removeProgressbar(i,"failure"),E.isNullOrUndefined(i.querySelector(".e-file-status"))||i.querySelector(".e-file-status").classList.add(g),i.querySelector("."+f));E.isNullOrUndefined(n)||(n.classList.remove(f,v),n.classList.add(m),n.setAttribute("title",this.localizedTexts("remove")),this.pauseButton=this.createElement("span",{className:"e-icons e-file-reload-btn",attrs:{tabindex:this.btnTabIndex}}),n.parentElement.insertBefore(this.pauseButton,n),this.pauseButton.setAttribute("title",this.localizedTexts("retry")),this.pauseButton.setAttribute("aria-label",this.localizedTexts("retry")),i.querySelector("."+ls).addEventListener("click",function(t){s.reloadcanceledFile(t,e,i,!1)},!1))},C.prototype.reloadcanceledFile=function(t,e,i,s){e.statusCode="1",e.status=this.localizedTexts("readyToUploadMessage"),s||(E.isNullOrUndefined(i.querySelector("."+c))||i.querySelector("."+c).classList.remove(g),E.isNullOrUndefined(i.querySelector("."+ls))||E.detach(i.querySelector("."+ls)),this.pauseButton=null),E.isNullOrUndefined(i)||i.classList.add(ys),this.upload([e])},C.prototype.uploadComplete=function(t,e,i){var s=t.target;4===s.readyState&&200<=s.status&&s.status<=299?(s=this.getLiElement(e),E.isNullOrUndefined(s)&&(!i||E.isNullOrUndefined(i))&&this.showFileList||(E.isNullOrUndefined(s)||(this.updateProgressBarClasses(s,ds),this.removeProgressbar(s,"success"),i=s.querySelector("."+f),E.isNullOrUndefined(i))||(i.classList.add(u),i.setAttribute("title",this.localizedTexts("delete")),i.setAttribute("aria-label",this.localizedTexts("delete")),i.classList.remove(f),i.classList.remove(v)),this.raiseSuccessEvent(t,e))):this.uploadFailed(t,e)},C.prototype.getResponse=function(t){t=t.currentTarget;return{readyState:t.readyState,statusCode:t.status,statusText:t.statusText,headers:t.getAllResponseHeaders(),withCredentials:t.withCredentials}},C.prototype.raiseSuccessEvent=function(t,e){var i=this,s=t&&t.currentTarget?this.getResponse(t):null,n=this.localizedTexts("uploadSuccessMessage"),t={e:t,response:s,operation:"upload",file:this.updateStatus(e,n,"2",!1),statusText:n},s=this.getLiElement(e);E.isNullOrUndefined(s)||(n=s.querySelector("."+as),E.isNullOrUndefined(n))||(h.hideSpinner(s),E.detach(n)),this.trigger("success",t,function(t){i.updateStatus(e,t.statusText,"2"),i.multiple?i.uploadedFilesData.push(e):i.uploadedFilesData=[e],i.trigger("change",{file:i.uploadedFilesData}),i.checkActionButtonStatus(),0<i.fileList.length?i.getLiElement(e).classList.contains(ys)?i.getLiElement(e).classList.remove(ys):(i.uploadSequential(),i.checkActionComplete(!0)):i.showFileList||i.checkActionComplete(!0)})},C.prototype.uploadFailed=function(t,e){var i=this,s=this.getLiElement(e),n=t&&t.currentTarget?this.getResponse(t):null,a=this.localizedTexts("uploadFailedMessage"),n={e:t,response:n,operation:"upload",file:this.updateStatus(e,a,"0",!1),statusText:a};E.isNullOrUndefined(s)||this.renderFailureState(t,e,s),this.trigger("failure",n,function(t){i.updateStatus(e,t.statusText,"0"),i.checkActionButtonStatus(),i.uploadSequential(),i.checkActionComplete(!0)})},C.prototype.uploadSequential=function(){this.sequentialUpload&&(this.autoUpload?this.checkAutoUpload(this.filesData):this.uploadButtonClick())},C.prototype.checkActionComplete=function(t){t?++this.actionCompleteCount:--this.actionCompleteCount,this.raiseActionComplete()},C.prototype.raiseActionComplete=function(){var t;this.filesData.length===this.actionCompleteCount&&this.flag&&(this.flag=!1,(t={fileData:[]}).fileData=this.getSelectedFileStatus(this.selectedFiles),this.trigger("actionComplete",t))},C.prototype.getSelectedFileStatus=function(t){for(var e=[],i=0,s=0;s<t.length;s++)for(var n=t[s],a=0;a<this.filesData.length;a++)if(this.filesData[a].name===n.name&&this.filesData[a].status===n.status){e[i]=this.filesData[a],++i;break}return e},C.prototype.updateProgressBarClasses=function(t,e){t=t.querySelector("."+hs);E.isNullOrUndefined(t)||(t.classList.add(e),this.actionButtons&&this.clearButton&&this.uploadWrapper&&("e-upload-progress"!==e||this.clearButton.hasAttribute("disabled")?"e-upload-success"!==e&&"e-upload-fails"!==e||0!==this.uploadWrapper.querySelectorAll(".e-upload-progress-bar.e-upload-progress:not(.e-upload-success):not(.e-upload-fails)").length||!this.clearButton.hasAttribute("disabled")||this.clearButton.removeAttribute("disabled"):this.clearButton.setAttribute("disabled","disabled")))},C.prototype.removeProgressbar=function(t,e){var i=this;E.isNullOrUndefined(t.querySelector("."+os))||(this.progressAnimation=new E.Animation({duration:1250}),this.progressAnimation.animate(t.querySelector("."+os),{name:"FadeOut"}),this.progressAnimation.animate(t.querySelector("."+ps),{name:"FadeOut"}),setTimeout(function(){i.animateProgressBar(t,e)},750))},C.prototype.animateProgressBar=function(t,e){"success"===e?(t.classList.add(ds),E.isNullOrUndefined(t.querySelector("."+c))||(t.querySelector("."+c).classList.remove(v),this.progressAnimation.animate(t.querySelector("."+c),{name:"FadeIn"}),t.querySelector("."+c).classList.add(ds))):E.isNullOrUndefined(t.querySelector("."+c))||(t.querySelector("."+c).classList.remove(v),this.progressAnimation.animate(t.querySelector("."+c),{name:"FadeIn"}),t.querySelector("."+c).classList.add(g)),t.querySelector("."+os)&&E.detach(t.querySelector("."+os))},C.prototype.setExtensions=function(t){""===t||E.isNullOrUndefined(t)?this.element.removeAttribute("accept"):this.element.setAttribute("accept",t)},C.prototype.templateComplier=function(e){if(e)try{return"function"!=typeof e&&E.selectAll(e,document).length?E.compile(E.select(e,document).innerHTML.trim()):E.compile(e)}catch(t){return E.compile(e)}},C.prototype.setRTL=function(){this.enableRtl?E.addClass([this.uploadWrapper],"e-rtl"):E.removeClass([this.uploadWrapper],"e-rtl")},C.prototype.localizedTexts=function(t){return this.l10n.setLocale(this.locale),this.l10n.getConstant(t)},C.prototype.setControlStatus=function(){this.enabled?(this.uploadWrapper.classList.contains(ms)&&this.uploadWrapper.classList.remove(ms),!E.isNullOrUndefined(this.browseButton)&&this.element.hasAttribute("disabled")&&(this.element.removeAttribute("disabled"),this.browseButton.removeAttribute("disabled")),!E.isNullOrUndefined(this.clearButton)&&this.clearButton.hasAttribute("disabled")&&this.clearButton.removeAttribute("disabled"),!E.isNullOrUndefined(this.uploadButton)&&this.uploadButton.hasAttribute("disabled")&&this.uploadButton.hasAttribute("disabled")):(this.uploadWrapper.classList.add(ms),this.element.setAttribute("disabled","disabled"),this.browseButton.setAttribute("disabled","disabled"),E.isNullOrUndefined(this.clearButton)||this.clearButton.setAttribute("disabled","disabled"),E.isNullOrUndefined(this.uploadButton)||this.uploadButton.setAttribute("disabled","disabled"))},C.prototype.checkHTMLAttributes=function(t){for(var e=0,i=t?E.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["accept","multiple","disabled"];e<i.length;e++){var s,n=i[e];if(!E.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"accept":(E.isNullOrUndefined(this.uploaderOptions)||void 0===this.uploaderOptions.allowedExtensions||t)&&(this.setProperties({allowedExtensions:this.element.getAttribute("accept")},!t),this.initialAttr.accept=this.allowedExtensions);break;case"multiple":(E.isNullOrUndefined(this.uploaderOptions)||void 0===this.uploaderOptions.multiple||t)&&(s="multiple"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n),this.setProperties({multiple:s},!t),this.initialAttr.multiple=!0);break;case"disabled":(E.isNullOrUndefined(this.uploaderOptions)||void 0===this.uploaderOptions.enabled||t)&&(s="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n),this.setProperties({enabled:s},!t),this.initialAttr.disabled=!0)}}},C.prototype.chunkUpload=function(t,e,i){var s=Math.min(this.asyncSettings.chunkSize,t.size),n=t.rawFile.slice(0,s);this.sendRequest(t,{chunkIndex:0,blob:n,file:t,start:0,end:s,retryCount:0,request:null},e,i)},C.prototype.sendRequest=function(i,s,e,t){var n=this,a=new FormData,l=i.rawFile.slice(s.start,s.end),l=(a.append(this.uploaderName,l,i.name),a.append("chunk-index",s.chunkIndex.toString()),a.append("chunkIndex",s.chunkIndex.toString()),Math.max(Math.ceil(i.size/this.asyncSettings.chunkSize),1)),r=(a.append("total-chunk",l.toString()),a.append("totalChunk",l.toString()),new E.Ajax({url:this.asyncSettings.saveUrl,type:"POST",async:!0,contentType:null})),o=(r.emitError=!1,r.onLoad=function(t){return n.chunkUploadComplete(t,s,e),{}},r.onUploadProgress=function(t){return n.chunkUploadInProgress(t,s,e),{}},{fileData:i,customFormData:[],cancel:!1,chunkSize:0===this.asyncSettings.chunkSize?null:this.asyncSettings.chunkSize});r.beforeSend=function(e){o.currentRequest=r.httpRequest,o.currentChunkIndex=s.chunkIndex,0===o.currentChunkIndex?n.trigger("uploading",o,function(t){n.uploadingEventCallback(a,t,e,i)}):n.trigger("chunkUploading",o,function(t){n.uploadingEventCallback(a,t,e,i)})},r.onError=function(t){return n.chunkUploadFailed(t,s,e),{}},r.send(a),s.request=r},C.prototype.uploadingEventCallback=function(t,e,i,s){e.cancel?this.eventCancelByArgs(i,e,s):this.updateFormData(t,e.customFormData)},C.prototype.eventCancelByArgs=function(t,e,i){var s,n=this;t.cancel=!0,"5"!==e.fileData.statusCode&&(e.fileData.statusCode="5",e.fileData.status=this.localizedTexts("fileUploadCancel"),(s=this.getLiElement(e.fileData))&&(E.isNullOrUndefined(s.querySelector("."+c))||(s.querySelector("."+c).innerHTML=this.localizedTexts("fileUploadCancel"),s.querySelector("."+c).classList.add(g)),this.pauseButton=this.createElement("span",{className:"e-icons e-file-reload-btn",attrs:{tabindex:this.btnTabIndex}}),(t=s.querySelector("."+m))&&t.parentElement.insertBefore(this.pauseButton,t),this.pauseButton.setAttribute("title",this.localizedTexts("retry")),this.pauseButton.addEventListener("click",function(t){n.reloadcanceledFile(t,i,s)},!1),this.checkActionButtonStatus()),s=null)},C.prototype.checkChunkUpload=function(){return!(this.asyncSettings.chunkSize<=0||E.isNullOrUndefined(this.asyncSettings.chunkSize))},C.prototype.chunkUploadComplete=function(t,n,a){var l,r=this,o=t.target;if(4===o.readyState&&200<=o.status&&o.status<300){var e=t&&t.currentTarget?this.getResponse(t):null,i=Math.max(Math.ceil(n.file.size/this.asyncSettings.chunkSize),1),e={event:t,file:n.file,chunkIndex:n.chunkIndex,totalChunk:i,chunkSize:this.asyncSettings.chunkSize,response:e};if(this.trigger("chunkSuccess",e),!E.isNullOrUndefined(a)&&a||(l=this.getLiElement(n.file)),this.updateMetaData(n),n.end===n.file.size&&(n.file.statusCode="3"),"5"===n.file.statusCode){e={event:t,fileData:n.file,cancel:!1,customFormData:[],currentRequest:null};this.trigger("canceling",e,function(e){var t,i,s;e.cancel?(n.file.statusCode="3",t=l.querySelector("."+f),E.isNullOrUndefined(l)||E.isNullOrUndefined(t)||(h.hideSpinner(t),E.detach(l.querySelector(".e-spinner-pane"))),r.sendNextRequest(n)):(n.request.emitError=!1,o.abort(),t=new FormData,i=r.element.getAttribute("name"),t.append(i,n.file.name),t.append("cancel-uploading",n.file.name),t.append("cancelUploading",n.file.name),r.updateFormData(t,e.customFormData),(s=new E.Ajax(r.asyncSettings.removeUrl,"POST",!0,null)).emitError=!1,s.beforeSend=function(t){Array.isArray(e.currentRequest)&&r.updateCustomheader(s.httpRequest,e.currentRequest)},s.onLoad=function(t){return r.removeChunkFile(t,n,a),{}},s.send(t))})}else{if(i-1===n.chunkIndex&&i>n.chunkIndex)return 0<=(e=this.pausedData.indexOf(n))&&this.pausedData.splice(e,1),E.isNullOrUndefined(this.template)&&(E.isNullOrUndefined(a)||!a)&&l&&(l&&!E.isNullOrUndefined(l.querySelector("."+y))&&E.detach(l.querySelector("."+y)),this.removeChunkProgressBar(n)),void this.raiseSuccessEvent(t,n.file);"4"!==n.file.statusCode&&this.sendNextRequest(n)}}else this.chunkUploadFailed(t,n);l=null},C.prototype.sendNextRequest=function(t){t.start=t.end,t.end+=this.asyncSettings.chunkSize,t.end=Math.min(t.end,t.file.size),t.chunkIndex+=1,this.sendRequest(t.file,t)},C.prototype.removeChunkFile=function(t,e,i){var s,n;E.isNullOrUndefined(this.template)&&E.isNullOrUndefined(i)&&!i&&(n=s=(i=this.getLiElement(e.file)).querySelector("."+f),this.updateStatus(e.file,this.localizedTexts("fileUploadCancel"),"5"),this.updateProgressBarClasses(i,g),this.removeProgressbar(i,"failure"),s&&(s.classList.remove(f),s.classList.add(m),s.setAttribute("title",this.localizedTexts("remove"))),(e=i.querySelector("."+y))&&(e.classList.add(ls),e.classList.remove(y),e.setAttribute("title",this.localizedTexts("retry"))),E.isNullOrUndefined(i)||E.isNullOrUndefined(s)||E.isNullOrUndefined(i.querySelector(".e-spinner-pane"))||(h.hideSpinner(n),E.detach(i.querySelector(".e-spinner-pane"))))},C.prototype.pauseUpload=function(t,e,i){t.file.statusCode="4",t.file.status=this.localizedTexts("pause"),this.updateMetaData(t);e={event:e||null,file:t.file,chunkIndex:t.chunkIndex,chunkCount:Math.round(t.file.size/this.asyncSettings.chunkSize),chunkSize:this.asyncSettings.chunkSize};this.abortUpload(t,i,e),this.sequentialUpload&&this.uploadSequential()},C.prototype.abortUpload=function(t,e,i){"4"!==t.file.statusCode&&(t.request.emitError=!1,t.request.httpRequest.abort());var s=this.getLiElement(t.file);E.isNullOrUndefined(this.template)&&(E.isNullOrUndefined(e)||!e)&&s&&((e=s.querySelector("."+y)).classList.remove(y),e.classList.add(gs),e.setAttribute("title",this.localizedTexts("resume")),e.nextElementSibling.classList.add(m),e.nextElementSibling.classList.remove(f),e.nextElementSibling.setAttribute("title",this.localizedTexts("remove")));for(var n=0;n<this.pausedData.length;n++)this.pausedData[n].file.name===t.file.name&&this.pausedData.splice(n,1);this.pausedData.push(t),this.trigger("pausing",i)},C.prototype.resumeUpload=function(t,e,i){var s,n=this.getLiElement(t.file),n=(E.isNullOrUndefined(n)||(s=n.querySelector("."+gs)),E.isNullOrUndefined(s)||!E.isNullOrUndefined(i)&&i||(s.classList.remove(gs),s.classList.add(y),s.setAttribute("title",this.localizedTexts("pause")),s.nextElementSibling.classList.remove(m),s.nextElementSibling.classList.add(f),s.nextElementSibling.setAttribute("title",this.localizedTexts("abort"))),t.file.status=this.localizedTexts("inProgress"),t.file.statusCode="3",this.updateMetaData(t),{event:e||null,file:t.file,chunkIndex:t.chunkIndex,chunkCount:Math.round(t.file.size/this.asyncSettings.chunkSize),chunkSize:this.asyncSettings.chunkSize});this.trigger("resuming",n);for(var a=0;a<this.pausedData.length;a++)this.pausedData[a].end===this.pausedData[a].file.size?this.chunkUploadComplete(e,t,i):this.pausedData[a].file.name===t.file.name&&(this.pausedData[a].start=this.pausedData[a].end,this.pausedData[a].end=this.pausedData[a].end+this.asyncSettings.chunkSize,this.pausedData[a].end=Math.min(this.pausedData[a].end,this.pausedData[a].file.size),this.pausedData[a].chunkIndex=this.pausedData[a].chunkIndex+1,this.sendRequest(this.pausedData[a].file,this.pausedData[a],i))},C.prototype.updateMetaData=function(t){-1===this.uploadMetaData.indexOf(t)||this.uploadMetaData.splice(this.uploadMetaData.indexOf(t),1),this.uploadMetaData.push(t)},C.prototype.removeChunkProgressBar=function(t){var t=this.getLiElement(t.file);E.isNullOrUndefined(t)||(this.updateProgressBarClasses(t,ds),this.removeProgressbar(t,"success"),t=t.querySelector("."+f),E.isNullOrUndefined(t))||(t.classList.add(u),t.setAttribute("title",this.localizedTexts("delete")),t.classList.remove(f,v))},C.prototype.chunkUploadFailed=function(i,s,n){var a,l=this,t=Math.max(Math.ceil(s.file.size/this.asyncSettings.chunkSize),1),r=(!E.isNullOrUndefined(this.template)||!E.isNullOrUndefined(n)&&n||(a=this.getLiElement(s.file)),i&&i.currentTarget?this.getResponse(i):null),t={event:i,file:s.file,chunkIndex:s.chunkIndex,totalChunk:t,chunkSize:this.asyncSettings.chunkSize,cancel:!1,response:r};this.trigger("chunkFailure",t,function(t){var e;t.cancel||(s.retryCount<l.asyncSettings.retryCount?setTimeout(function(){l.retryRequest(a,s,n)},l.asyncSettings.retryAfterDelay):(E.isNullOrUndefined(a)||(t=a.querySelector("."+y)?a.querySelector("."+y):a.querySelector("."+gs),E.isNullOrUndefined(t)||(t.classList.add(ls),t.classList.remove(y,gs)),l.updateProgressBarClasses(a,g),l.removeProgressbar(a,"failure"),a.querySelector(".e-icons").classList.remove(v),(t=a.querySelector("."+f)?a.querySelector("."+f):a.querySelector("."+m)).classList.remove(f),E.isNullOrUndefined(a.querySelector("."+y))||E.detach(a.querySelector("."+y)),0<s.start?(t.classList.add(u),t.setAttribute("title",l.localizedTexts("delete"))):(t.classList.add(m),t.setAttribute("title",l.localizedTexts("remove")))),s.retryCount=0,e=s.file,t=l.localizedTexts("uploadFailedMessage"),t={e:i,response:r,operation:"upload",file:l.updateStatus(e,t,"0",!1),statusText:t},l.trigger("failure",t,function(t){l.updateStatus(e,t.statusText,"0"),l.uploadSequential(),l.checkActionComplete(!0)})))}),a=null},C.prototype.retryRequest=function(t,e,i){E.isNullOrUndefined(this.template)&&(E.isNullOrUndefined(i)||!i)&&t&&this.updateProgressBarClasses(t,g),e&&(e.retryCount+=1,this.sendRequest(e.file,e))},C.prototype.checkPausePlayAction=function(t){var e=t.target,i=t.target.parentElement,i=this.fileList.indexOf(i),i=this.filesData[i],i=this.getCurrentMetaData(i);e.classList.contains(y)?this.pauseUpload(i,t):e.classList.contains(gs)?this.resumeUpload(i,t):e.classList.contains(ls)&&(i.file.status===this.localizedTexts("fileUploadCancel")?this.retryUpload(i,!1):this.retryUpload(i,!0))},C.prototype.retryUpload=function(t,e){e?(t.end=t.end+this.asyncSettings.chunkSize,t.start=t.start+this.asyncSettings.chunkSize,this.sendRequest(t.file,t)):(t.file.statusCode="1",t.file.status=this.localizedTexts("readyToUploadMessage"),this.chunkUpload(t.file)),this.getLiElement(t.file).classList.add(ys)},C.prototype.chunkUploadInProgress=function(t,e,i){var s,n,a=this;"4"===e.file.statusCode||("4"!==e.file.statusCode&&"5"!==e.file.statusCode&&(e.file.statusCode="3",e.file.status=this.localizedTexts("inProgress")),this.updateMetaData(e),s=this.getLiElement(e.file),E.isNullOrUndefined(s))||(n=s.querySelector("."+ls),E.isNullOrUndefined(n)||(n.classList.add(y),n.setAttribute("title",this.localizedTexts("pause")),n.classList.remove(ls)),E.isNullOrUndefined(s)||(0<s.querySelectorAll("."+os).length||(n=s.querySelector("."+c),E.isNullOrUndefined(this.template)&&(n.classList.add(v),n.classList.remove(g),this.createProgressBar(s),this.updateProgressBarClasses(s,v)),n=s.querySelector("."+m)?s.querySelector("."+m):s.querySelector("."+u),E.isNullOrUndefined(n))||(n.classList.add(f),n.setAttribute("title",this.localizedTexts("abort")),n.classList.remove(m)),!isNaN(Math.round(t.loaded/t.total*100))&&E.isNullOrUndefined(this.template)&&"4"!==e.file.statusCode&&(n=void 0,t=Math.ceil(e.file.size/this.asyncSettings.chunkSize)-1,this.asyncSettings.chunkSize)&&t&&(n=Math.round(e.chunkIndex/t*100),this.changeProgressValue(s,n.toString()+"%")),0===e.chunkIndex&&this.checkActionButtonStatus()),E.isNullOrUndefined(s.querySelector("."+y))&&E.isNullOrUndefined(this.template)&&E.isNullOrUndefined(s.querySelector("."+u))&&(this.pauseButton=this.createElement("span",{className:"e-icons e-file-pause-btn",attrs:{tabindex:this.btnTabIndex}}),"msie"===this.browserName&&this.pauseButton.classList.add("e-msie"),(t=s.querySelector("."+f)).parentElement.insertBefore(this.pauseButton,t),this.pauseButton.setAttribute("title",this.localizedTexts("pause")),this.pauseButton.addEventListener("click",function(t){a.checkPausePlayAction(t)},!1)))},C.prototype.bytesToSize=function(t){var e=-1;if(!t)return"0.0 KB";for(;e++,99<(t/=1024););return 2<=e&&(t*=1024,e=1),Math.max(t,0).toFixed(1)+" "+["KB","MB"][e]},C.prototype.sortFileList=function(t){for(var e=t=t||this.sortFilesList,i=[],s=0;s<e.length;s++)i.push(e[s].name);for(var n=[],a=0,l=i.sort();a<l.length;a++)for(var r=l[a],s=0;s<e.length;s++)r===e[s].name&&n.push(e[s]);return n},C.prototype.destroy=function(){this.element.value=null,this.clearTemplate(),this.clearAll(),this.unWireEvents(),this.unBindDropEvents(),this.multiple&&this.element.removeAttribute("multiple"),this.enabled||this.element.removeAttribute("disabled"),this.element.removeAttribute("accept"),this.setInitialAttributes();for(var t=0,e=["aria-label","directory","webkitdirectory","tabindex"];t<e.length;t++)this.element.removeAttribute(e[t]);E.isNullOrUndefined(this.uploadWrapper)||(this.uploadWrapper.parentElement.appendChild(this.element),E.detach(this.uploadWrapper)),this.fileList=[],this.filesData=[],this.fileList.length=0,this.filesData.length=0,this.uploadWrapper=null,this.browseButton=null,this.listParent=null,this.dropAreaWrapper=null,this.dropZoneElement=null,this.actionButtons=null,this.pauseButton=null,this.formElement=null,this.dropArea=null,this.keyboardModule=null,this.clearButton=null,this.uploadButton=null,"EJS-UPLOADER"===this.element.tagName&&E.setValue("ej2_instances",null,this.element),Ns.prototype.destroy.call(this)},C.prototype.upload=function(t,e){var i,s=this;t=t||this.filesData,this.sequentialUpload&&(this.isFirstFileOnSelection||e)?this.sequenceUpload(t):(i=this.getFilesInArray(t),this.trigger("beforeUpload",{customFormData:[],currentRequest:null,cancel:!1},function(t){t.cancel||(s.customFormDatas=t.customFormData&&0<t.customFormData.length?t.customFormData:s.customFormDatas,s.uploadFiles(i,e))}))},C.prototype.getFilesInArray=function(t){var e=[];return t&&(t instanceof Array?e=t:e.push(t)),e},C.prototype.serverReadFileBase64=function(a,l,r){var o=this;return new Promise(function(i,s){var n,t=o.fileStreams[a].rawFile;try{var e=new FileReader;e.onload=(n=e,function(){try{var t=n.result,e=t?t.split(";base64,")[1]:null;i(e)}catch(t){s(t)}}),e.readAsDataURL(t.slice(l,l+r))}catch(t){s(t)}})},C.prototype.uploadFileCount=function(t){var e=this.filesData;return e&&0!==e.length?e.length:-1},C.prototype.getFileRead=function(t,e){var i=this.filesData;return i&&0!==i.length?(i=i[t],t=this.newFileRef++,this.fileStreams[t]=i,t):-1},C.prototype.uploadFiles=function(t,e){var i,s=[];if(""!==this.asyncSettings.saveUrl&&!E.isNullOrUndefined(this.asyncSettings.saveUrl)){s=!e||E.isNullOrUndefined(e)?this.multiple?this.filterfileList(t):((i=[]).push(t[0]),this.filterfileList(i)):t;for(var n=0;n<s.length;n++)this.uploadFilesRequest(s,n,e)}},C.prototype.uploadFilesRequest=function(i,s,e){var t,n=this,a=this.checkChunkUpload(),l=new E.Ajax(this.asyncSettings.saveUrl,"POST",!0,null),r=(l.emitError=!1,{fileData:i[s],customFormData:[],cancel:!1}),o=new FormData;l.beforeSend=function(e){r.currentRequest=l.httpRequest,n.trigger("uploading",r,function(t){t.cancel&&n.eventCancelByArgs(e,t,i[s]),n.customFormDatas&&0<n.customFormDatas.length&&n.updateFormData(o,n.customFormDatas),n.updateFormData(o,t.customFormData)})},"1"===i[s].statusCode&&(t=this.element.getAttribute("name"),o.append(t,i[s].rawFile,i[s].name),a&&i[s].size>this.asyncSettings.chunkSize?this.chunkUpload(i[s],e,s):(l.onLoad=function(t){return r.cancel||n.uploadComplete(t,i[s],e),{}},l.onUploadProgress=function(t){return r.cancel||n.uploadInProgress(t,i[s],e,l),{}},l.onError=function(t){return n.uploadFailed(t,i[s]),{}},l.send(o)))},C.prototype.spliceFiles=function(t){for(var e=this.fileList[t],i=this.getFilesData(),e=+e.getAttribute("data-files-count"),s=0,n=0;n<t;n++)s+=+this.fileList[n].getAttribute("data-files-count");for(var a=s+e-1;s<=a;a--)i.splice(a,1)},C.prototype.remove=function(l,a,r,t,o){var h=this,p=(E.isNullOrUndefined(t)&&(t=!0),{event:o,cancel:!1,filesData:[],customFormData:[],postRawFile:t,currentRequest:null});this.trigger("beforeRemove",{cancel:!1,customFormData:[],currentRequest:null},function(t){if(!t.cancel)if(h.isFormUpload())p.filesData=l,h.trigger("removing",p,function(t){if(!t.cancel)for(var e=!1,i=void 0,s=0,n=h.getFilesInArray(l);s<n.length;s++){var a=n[s];-1<(i=e?i:h.fileList.indexOf(a.list))&&((a=E.isNullOrUndefined(a.input)?null:a.input)&&E.detach(a),h.spliceFiles(i),E.detach(h.fileList[i]),h.fileList.splice(i,1),e=!0,i=-1)}});else if(h.isForm&&(E.isNullOrUndefined(h.asyncSettings.removeUrl)||""===h.asyncSettings.removeUrl))p.filesData=h.getFilesData(),h.trigger("removing",p,function(t){t.cancel||h.clearAll()});else for(var t=[],e=((l=E.isNullOrUndefined(l)?h.filesData:l)instanceof Array?t=l:t.push(l),p.filesData=t,h.asyncSettings.removeUrl),i=""!==e&&!E.isNullOrUndefined(e),s=0,n=t;s<n.length;s++)!function(e){var t=h.uploadedFilesData.indexOf(e);("2"===e.statusCode||"4"===e.statusCode||"0"===e.statusCode&&-1!==t)&&i?h.removeUploadedFile(e,p,r,a):r?h.removeFilesData(e,a):h.trigger("removing",p,function(t){t.cancel||h.removeFilesData(e,a)}),o&&!o.target.classList.contains(m)&&h.checkActionComplete(!1)}(n[s])})},C.prototype.clearAll=function(){var t,e=this;E.isNullOrUndefined(this.listParent)?("msie"!==this.browserName&&(this.element.value=""),this.filesData=[]):(t={cancel:!1,filesData:this.filesData},this.trigger("clearing",t,function(t){t.cancel||(e.clearData(),e.actionCompleteCount=0,e.count=-1)}))},C.prototype.getFilesData=function(t){return E.isNullOrUndefined(t)?this.filesData:this.getSelectedFiles(t)},C.prototype.pause=function(t,e){t=t||this.filesData;t=this.getFilesInArray(t);this.pauseUploading(t,e)},C.prototype.pauseUploading=function(t,e){for(var i=this.getFiles(t),s=0;s<i.length;s++)"3"===i[s].statusCode&&this.pauseUpload(this.getCurrentMetaData(i[s],null),null,e)},C.prototype.getFiles=function(t){var e=[];return E.isNullOrUndefined(t)||t instanceof Array?e=t:e.push(t),e},C.prototype.resume=function(t,e){t=t||this.filesData;t=this.getFilesInArray(t);this.resumeFiles(t,e)},C.prototype.resumeFiles=function(t,e){for(var i=this.getFiles(t),s=0;s<i.length;s++)"4"===i[s].statusCode&&this.resumeUpload(this.getCurrentMetaData(i[s],null),null,e)},C.prototype.retry=function(t,e,i){t=t||this.filesData;t=this.getFilesInArray(t);this.sequentialUpload&&this.isFirstFileOnSelection&&(this.isFirstFileOnSelection=!1),this.retryFailedFiles(t,e,i)},C.prototype.retryFailedFiles=function(t,e,i){for(var s,n=this.getFiles(t),a=0;a<n.length;a++)"5"!==n[a].statusCode&&"0"!==n[a].statusCode||(0<this.asyncSettings.chunkSize&&this.getCurrentMetaData(n[a],null)?this.retryUpload(this.getCurrentMetaData(n[a],null),e):(s=void 0,i||(s=this.fileList[this.filesData.indexOf(n[a])]),this.reloadcanceledFile(null,n[a],s,i)))},C.prototype.cancel=function(t){t=t||this.filesData;t=this.getFilesInArray(t);this.cancelUpload(t)},C.prototype.cancelUpload=function(t){var e=this.getFiles(t);if(0<this.asyncSettings.chunkSize)for(var i,s=0;s<e.length;s++)"3"===e[s].statusCode&&((i=this.getCurrentMetaData(e[s],null)).file.statusCode="5",i.file.status=this.localizedTexts("fileUploadCancel"),this.updateMetaData(i),this.showHideUploadSpinner(e[s]));else for(s=0;s<e.length;s++)"3"===e[s].statusCode&&(e[s].statusCode="5",e[s].status=this.localizedTexts("fileUploadCancel"),this.showHideUploadSpinner(e[s]))},C.prototype.showHideUploadSpinner=function(t){var t=this.getLiElement(t);!E.isNullOrUndefined(t)&&E.isNullOrUndefined(this.template)&&(t=t.querySelector("."+f),h.createSpinner({target:t,width:"20px"}),h.showSpinner(t))},s([E.Complex({saveUrl:"",removeUrl:""},ks)],C.prototype,"asyncSettings",void 0),s([E.Property(!1)],C.prototype,"sequentialUpload",void 0),s([E.Property({})],C.prototype,"htmlAttributes",void 0),s([E.Property("")],C.prototype,"cssClass",void 0),s([E.Property(!0)],C.prototype,"enabled",void 0),s([E.Property(null)],C.prototype,"template",void 0),s([E.Property(!0)],C.prototype,"multiple",void 0),s([E.Property(!0)],C.prototype,"autoUpload",void 0),s([E.Property(!0)],C.prototype,"enableHtmlSanitizer",void 0),s([E.Complex({},Os)],C.prototype,"buttons",void 0),s([E.Property("")],C.prototype,"allowedExtensions",void 0),s([E.Property(0)],C.prototype,"minFileSize",void 0),s([E.Property(3e7)],C.prototype,"maxFileSize",void 0),s([E.Property(null)],C.prototype,"dropArea",void 0),s([E.Collection([{}],Ss)],C.prototype,"files",void 0),s([E.Property(!0)],C.prototype,"showFileList",void 0),s([E.Property(!1)],C.prototype,"directoryUpload",void 0),s([E.Property("Default")],C.prototype,"dropEffect",void 0),s([E.Event()],C.prototype,"created",void 0),s([E.Event()],C.prototype,"actionComplete",void 0),s([E.Event()],C.prototype,"rendering",void 0),s([E.Event()],C.prototype,"beforeUpload",void 0),s([E.Event()],C.prototype,"fileListRendering",void 0),s([E.Event()],C.prototype,"selected",void 0),s([E.Event()],C.prototype,"uploading",void 0),s([E.Event()],C.prototype,"success",void 0),s([E.Event()],C.prototype,"failure",void 0),s([E.Event()],C.prototype,"removing",void 0),s([E.Event()],C.prototype,"beforeRemove",void 0),s([E.Event()],C.prototype,"clearing",void 0),s([E.Event()],C.prototype,"progress",void 0),s([E.Event()],C.prototype,"change",void 0),s([E.Event()],C.prototype,"chunkSuccess",void 0),s([E.Event()],C.prototype,"chunkFailure",void 0),s([E.Event()],C.prototype,"chunkUploading",void 0),s([E.Event()],C.prototype,"canceling",void 0),s([E.Event()],C.prototype,"pausing",void 0),s([E.Event()],C.prototype,"resuming",void 0);var Ns,t=s([E.NotifyPropertyChanges],C);function C(t,e){e=Ns.call(this,t,e)||this;return e.initialAttr={accept:null,multiple:!1,disabled:!1},e.uploadedFilesData=[],e.base64String=[],e.isForm=!1,e.allTypes=!1,e.pausedData=[],e.uploadMetaData=[],e.tabIndex="0",e.btnTabIndex="0",e.disableKeyboardNavigation=!1,e.count=-1,e.actionCompleteCount=0,e.flag=!0,e.selectedFiles=[],e.uploaderName="UploadFiles",e.fileStreams=[],e.newFileRef=0,e.isFirstFileOnSelection=!1,e.dragCounter=0,e.fileList=[],e.filesData=[],e.uploaderOptions=t,e}Hs=function(t,e){return(Hs=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Hs,Bs,s=function(t,e){function i(){this.constructor=t}Hs(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},x=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},Rs="e-apply",Us="e-cancel",Is="e-current",Fs="e-ctrl-btn",Vs="e-switch-ctrl-btn",Ms="e-disabled",Ds="e-value-switch-btn",Ws="e-handler",zs="e-hide-hex-value",qs="e-hide-opacity",js="e-hide-switchable-value",_s="e-hide-value",Xs="e-hide-valueswitcher",Ks="e-hsv-color",Ys="e-hsv-container",Zs="e-selected-value",Gs="e-mode-switch-btn",Js="e-nocolor-item",$s="e-opacity-value",Qs="e-palette",tn="e-color-palette",en="e-color-picker",sn="e-preview-container",nn="e-previous",an="e-show-value",ln="e-selected",rn="e-split-preview",on="e-tile",hn=["#000000","#f44336","#e91e63","#9c27b0","#673ab7","#2196f3","#03a9f4","#00bcd4","#009688","#ffeb3b","#ffffff","#ffebee","#fce4ec","#f3e5f5","#ede7f6","#e3f2fd","#e1f5fe","#e0f7fa","#e0f2f1","#fffde7","#f2f2f2","#ffcdd2","#f8bbd0","#e1bee7","#d1c4e9","#bbdefb","#b3e5fc","#b2ebf2","#b2dfdb","#fff9c4","#e6e6e6","#ef9a9a","#f48fb1","#ce93d8","#b39ddb","#90caf9","#81d4fa","#80deea","#80cbc4","#fff59d","#cccccc","#e57373","#f06292","#ba68c8","#9575cd","#64b5f6","#4fc3f7","#4dd0e1","#4db6ac","#fff176","#b3b3b3","#ef5350","#ec407a","#ab47bc","#7e57c2","#42a5f5","#29b6f6","#26c6da","#26a69a","#ffee58","#999999","#e53935","#d81b60","#8e24aa","#5e35b1","#1e88e5","#039be5","#00acc1","#00897b","#fdd835","#808080","#d32f2f","#c2185b","#7b1fa2","#512da8","#1976d2","#0288d1","#0097a7","#00796b","#fbc02d","#666666","#c62828","#ad1457","#6a1b9a","#4527a0","#1565c0","#0277bd","#00838f","#00695c","#f9a825","#4d4d4d","#b71c1c","#880e4f","#4a148c","#311b92","#0d47a1","#01579b","#006064","#004d40","#f57f17"],s=(Bs=E.Component,s(S,Bs),S.prototype.preRender=function(){var t=this.element;this.formElement=E.closest(this.element,"form"),this.formElement&&E.EventHandler.add(this.formElement,"reset",this.formResetHandler,this);this.l10n=new E.L10n("colorpicker",{Apply:"Apply",Cancel:"Cancel",ModeSwitcher:"Switch Mode",RecentColors:"Recent colors",CurrentColor:"Current",PreviousColor:"Previous"},this.locale),t.getAttribute("ejs-for")&&!t.getAttribute("name")&&t.setAttribute("name",t.id)},S.prototype.render=function(){this.initWrapper(),this.inline?this.createWidget():this.createSplitBtn(),this.enableOpacity||E.addClass([this.container.parentElement],qs),this.renderComplete()},S.prototype.initWrapper=function(){var t=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper"}),e=(this.element.parentNode.insertBefore(t,this.element),t.appendChild(this.element),E.attributes(this.element,{tabindex:"-1",spellcheck:"false","aria-label":"colorpicker"}),this.container=this.createElement("div",{className:"e-container"}),this.getWrapper().appendChild(this.container),this.value?this.roundValue(this.value).toLowerCase():"#008000ff"),i=(e=this.noColor&&"Palette"===this.mode&&""===this.value?"":e).slice(0,7);E.isNullOrUndefined(this.initialInputValue)&&(this.initialInputValue=i),this.element.value=i,this.enableOpacity?this.setProperties({value:e},!0):this.setProperties({value:i},!0),this.enableRtl&&t.classList.add("e-rtl"),this.cssClass&&E.addClass([t],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.tileRipple=E.rippleEffect(this.container,{selector:"."+on}),this.ctrlBtnRipple=E.rippleEffect(this.container,{selector:".e-btn"})},S.prototype.getWrapper=function(){return this.element.parentElement},S.prototype.createWidget=function(){"Palette"===this.mode?(this.createPalette(),this.inline||this.firstPaletteFocus()):(this.createPicker(),this.inline||this.getDragHandler().focus()),this.isRgb=!0,this.createInput(),this.createCtrlBtn(),this.disabled||this.wireEvents(),this.inline&&this.disabled&&this.toggleDisabled(!0),E.Browser.isDevice&&this.refreshPopupPos()},S.prototype.createSplitBtn=function(){var e=this,t=this.createElement("button",{className:"e-split-colorpicker"}),i=(this.getWrapper().appendChild(t),this.splitBtn=new I.SplitButton({iconCss:"e-selected-color",target:this.container,disabled:this.disabled,enableRtl:this.enableRtl,createPopupOnClick:this.createPopupOnClick,open:this.onOpen.bind(this),click:function(){var t=new MouseEvent("click",{bubbles:!0,cancelable:!1});e.trigger("change",{currentValue:{hex:e.value.slice(0,7),rgba:e.convertToRgbString(e.hexToRgb(e.value))},previousValue:{hex:null,rgba:null},value:e.value,event:t})}}),this.splitBtn.createElement=this.createElement,this.isAngular&&(this.splitBtn.isAngular=this.isAngular),this.splitBtn.appendTo(t),this.splitBtn.element.setAttribute("aria-label","colorpicker"),this.createElement("span",{className:rn})),t=(E.select(".e-selected-color",t).appendChild(i),i.style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value)),this.getPopupEle());E.addClass([t],"e-colorpicker-popup"),this.cssClass&&(i=this.cssClass.replace(/\s+/g," ").trim().split(" "),t&&E.addClass([t],i),this.splitBtn&&this.splitBtn.activeElem&&this.splitBtn.activeElem[0]&&E.addClass([this.splitBtn.activeElem[0]],i),this.splitBtn&&this.splitBtn.activeElem&&this.splitBtn.activeElem[1]&&E.addClass([this.splitBtn.activeElem[1]],i),this.splitBtn)&&this.splitBtn.element&&this.splitBtn.element.parentElement&&E.addClass([this.splitBtn.element.parentElement],i),E.Browser.isDevice&&!this.createPopupOnClick&&((i=this.getPopupInst()).relateTo=document.body,i.position={X:"center",Y:"center"},i.targetType="container",i.collision={X:"fit",Y:"fit"},i.offsetY=4,t.style.zIndex=h.getZindexPartial(this.splitBtn.element).toString()),this.bindCallBackEvent()},S.prototype.onOpen=function(){var t;this.trigger("open",{element:this.container}),E.Browser.isDevice||(t=this.getPopupInst(),0<h.isCollide(t.element).length&&(t.collision={X:"flip",Y:"fit"},t.position={X:"right",Y:"bottom"},t.targetType="container"))},S.prototype.getPopupInst=function(){return E.getInstance(this.getPopupEle(),h.Popup)},S.prototype.bindCallBackEvent=function(){var a=this;this.splitBtn.beforeOpen=function(s){var n=new I.Deferred;return a.trigger("beforeOpen",s,function(t){var e,i;t.cancel||((e=a.getPopupEle()).style.top=E.formatUnit(0+pageYOffset),e.style.left=E.formatUnit(0+pageXOffset),e.style.display="block",a.createWidget(),e.style.display="",E.Browser.isDevice&&(a.createPopupOnClick&&((i=a.getPopupInst()).relateTo=document.body,i.position={X:"center",Y:"center"},i.targetType="container",i.collision={X:"fit",Y:"fit"},i.offsetY=4,e.style.zIndex=h.getZindexPartial(a.splitBtn.element).toString()),a.modal=a.createElement("div"),a.modal.className="e-"+a.getModuleName()+" e-modal",a.modal.style.display="none",(i=a.getAppendToElement()).insertBefore(a.modal,e),i.className+=" e-colorpicker-overflow",a.modal.style.display="block",a.modal.style.zIndex=(Number(e.style.zIndex)-1).toString())),s.cancel=t.cancel,n.resolve(t)}),n},this.splitBtn.beforeClose=function(e){var t,i=new I.Deferred;return E.isNullOrUndefined(e.event)?i.resolve(e):(t={element:a.container,event:e.event,cancel:!1},a.trigger("beforeClose",t,function(t){E.Browser.isDevice&&e.event.target===a.modal&&(t.cancel=!0),t.cancel||(a.onPopupClose(),"keydown"===e.event.type&&27===e.event.keyCode&&a.splitBtn.element.focus()),e.cancel=t.cancel,i.resolve(t)})),i}},S.prototype.getAppendToElement=function(){if(this.isAngular){var t=this.element.closest(".cdk-overlay-pane"),e=this.element.closest("[popover]");if(t&&e)return t}return document.body},S.prototype.onPopupClose=function(){var t;this.unWireEvents(),this.destroyOtherComp(),this.container.style.width="",E.select("."+rn,this.splitBtn.element).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value)),this.container.innerHTML="",E.removeClass([this.container],[en,tn]),E.Browser.isDevice&&this.modal&&(t=this.getAppendToElement(),E.removeClass([t],"e-colorpicker-overflow"),this.modal.style.display="none",this.modal.outerHTML="",this.modal=null)},S.prototype.createPalette=function(){if(E.classList(this.container,[tn],[en]),this.presetColors){var t=this.createElement("div",{className:"e-custom-palette"}),e=(this.appendElement(t),Object.keys(this.presetColors));if(1===e.length)this.appendPalette(this.presetColors[e[0]],e[0],t);else for(var i=0,s=e.length;i<s;i++)this.appendPalette(this.presetColors[e[i]],e[i],t);10<E.selectAll(".e-row",t).length&&E.addClass([t],"e-palette-group")}else this.appendPalette(hn,"default");"Palette"===this.mode&&!this.modeSwitcher&&this.noColor&&this.setNoColor(),this.showRecentColors&&this.recentColors&&0<this.recentColors.length&&this.renderRecentColor();var n=parseInt(getComputedStyle(this.container).borderBottomWidth,10);this.container.style.width=E.formatUnit(this.container.children[0].offsetWidth+n+n),this.rgb=this.hexToRgb(this.roundValue(this.value)),this.hsv=this.rgbToHsv.apply(this,this.rgb)},S.prototype.renderRecentColor=function(){var i=this,t=this.container.querySelector(".e-clr-pal-rec-wpr"),t=(t&&E.detach(t),this.createElement("div",{className:"e-clr-pal-rec-wpr"})),e=this.container.querySelector(".e-switch-ctrl-btn"),e=(e?this.container.insertBefore(t,e):this.container.appendChild(t),this.createElement("label",{className:"e-recent-clr-span"}));if(e.textContent=this.l10n.getConstant("RecentColors"),t.appendChild(e),0<this.recentColors.length){for(this.recentColors=this.recentColors.filter(function(t,e){return i.recentColors.indexOf(t)===e});10<this.recentColors.length;)this.recentColors.pop();this.appendPalette(this.recentColors,"recent-color",t)}},S.prototype.firstPaletteFocus=function(){E.select("."+ln,this.container.children[0])||E.selectAll("."+Qs,this.container)[0].focus()},S.prototype.appendPalette=function(t,e,i){var s,n,a,l=this.createElement("div",{className:Qs,attrs:{tabindex:"0",role:"grid"}});"recent-color"===e&&l.classList.add("e-recent-palette"),i?i.appendChild(l):this.appendElement(l);for(var r=0,o=t.length;r<o;r++)0!==r&&r%this.columns!=0||(s=this.createElement("div",{className:"e-row",attrs:{role:"row"}}),l.appendChild(s)),a=this.roundValue(t[r]).toLowerCase(),n=this.createElement("span",{className:on,attrs:{role:"gridcell","aria-label":a,"aria-selected":"false"}}),this.trigger("beforeTileRender",{element:n,presetName:e,value:t[r]}),s.appendChild(n),this.value===a&&"recent-color"!==e&&(this.addTileSelection(n),l.focus()),n.style.backgroundColor=this.convertToRgbString(this.hexToRgb(a))},S.prototype.setNoColor=function(){var e=this.container.querySelector(".e-row").children[0];e.classList.add(Js),this.value||(e.classList.add(ln),E.closest(e,"."+Qs).focus()),["aria-selected","aria-label"].forEach(function(t){e.removeAttribute(t)}),e.style.backgroundColor=""},S.prototype.appendElement=function(t,e){e=this.container.children[e=void 0===e?0:e];e?this.container.insertBefore(t,e):this.container.appendChild(t)},S.prototype.addTileSelection=function(t){t&&(t.classList.add(ln),t.setAttribute("aria-selected","true"))},S.prototype.createPicker=function(){E.classList(this.container,[en],[tn]);var t=this.createElement("div",{className:Ys}),e=(this.appendElement(t),t.appendChild(this.createElement("div",{className:Ks})),this.createElement("span",{className:Ws,attrs:{tabindex:"0"}}));t.appendChild(e),null!==this.value&&""!==this.value||(this.value="#008000ff"),this.rgb=this.hexToRgb(this.value),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.setHsvContainerBg(),this.setHandlerPosition(),this.createSlider(),this.createDragTooltip()},S.prototype.setHsvContainerBg=function(t){void 0===t&&(t=this.hsv[0]),this.getHsvContainer().style.backgroundColor=this.convertToRgbString(this.hsvToRgb(t,100,100,1))},S.prototype.getHsvContainer=function(){return E.select("."+Ys,this.container)},S.prototype.setHandlerPosition=function(){var t=this.getDragHandler(),e=E.select("."+Ks,this.container);this.enableRtl?t.style.left=E.formatUnit((e.offsetWidth-t.offsetWidth/2.5)*Math.abs(100-this.hsv[1])/100):t.style.left=E.formatUnit((e.offsetWidth-t.offsetWidth/2.5)*this.hsv[1]/100),t.style.top=E.formatUnit((e.offsetHeight-t.offsetHeight/2.5)*(100-this.hsv[2])/100)},S.prototype.createSlider=function(){var t=this.createElement("div",{className:"e-slider-preview"}),e=(this.appendElement(t,1),this.createPreview(t),this.createElement("div",{className:"e-colorpicker-slider"})),t=(t.insertBefore(e,t.children[0]),this.createElement("div",{className:"e-hue-slider"}));e.appendChild(t),this.hueSlider=new ji({value:this.hsv[0],min:0,max:359,enableRtl:this.enableRtl,enabled:!this.disabled,change:this.hueChange.bind(this)}),this.hueSlider.createElement=this.createElement,this.hueSlider.appendTo(t),this.enableOpacity&&(t=this.createElement("div",{className:"e-opacity-slider"}),e.appendChild(t),this.createOpacitySlider(t))},S.prototype.createOpacitySlider=function(t){this.opacitySlider=new ji({value:100*this.rgb[3],min:0,max:100,enableRtl:this.enableRtl,enabled:!this.disabled,change:this.opacityChange.bind(this)}),this.opacitySlider.createElement=this.createElement,this.opacitySlider.appendTo(t);var e=this.createElement("div",{className:"e-opacity-empty-track"});t.appendChild(e),this.updateOpacitySliderBg()},S.prototype.updateOpacitySliderBg=function(){var t=this.enableRtl?"to left":"to right",e=E.select(".e-opacity-empty-track",this.opacitySlider.element);e&&(e.style.background="linear-gradient("+t+", rgba("+this.rgb.slice(0,3)+", 0) 0%, "+this.convertToRgbString(this.rgb.slice(0,3))+" 100%)")},S.prototype.hueChange=function(t){this.hsv[0]=t.value,this.setHsvContainerBg(),this.convertToOtherFormat()},S.prototype.opacityChange=function(t){var t=t.value,e=this.rgbToHex(this.rgb),i=(this.hsv[3]=t/100,this.rgb[3]=t/100,this.rgbToHex(this.rgb)),t=(this.updateOpacityInput(t),this.convertToRgbString(this.rgb));this.updatePreview(t),this.triggerEvent(i,e,t)},S.prototype.updateOpacityInput=function(t){var e;this.enableOpacity&&!this.getWrapper().classList.contains(_s)&&((e=E.getInstance(E.select("."+$s,this.container),Rt)).value=t,e.dataBind())},S.prototype.createPreview=function(t){var e=this.createElement("div",{className:sn}),t=(t.appendChild(e),this.createElement("span",{className:"e-preview "+Is,attrs:{title:this.l10n.getConstant("CurrentColor")}})),i=(e.appendChild(t),this.convertToRgbString(this.rgb));t.style.backgroundColor=i,t=this.createElement("span",{className:"e-preview "+nn,attrs:{title:this.l10n.getConstant("PreviousColor")}}),e.appendChild(t),t.style.backgroundColor=i},S.prototype.isPicker=function(){return!this.container.classList.contains(tn)},S.prototype.getPopupEle=function(){return this.container.parentElement},S.prototype.createNumericInput=function(t,e,i,s){var n=this,e=new Rt({value:e,placeholder:i,min:0,max:s,format:"###.##",showSpinButton:!1,floatLabelType:"Always",enableRtl:this.enableRtl,enabled:!this.disabled,readonly:!this.isPicker(),change:function(t){t.event&&n.inputHandler(t.event)}});e.createElement=this.createElement,e.appendTo(t)},S.prototype.createInput=function(){var t=this.isPicker(),e=this.getWrapper();if(t&&!e.classList.contains(_s)||!t&&e.classList.contains(an)){var i=this.createElement("div",{className:Zs}),s=(t?this.appendElement(i,2):this.appendElement(i,1),this.createElement("div",{className:"e-input-container"}));if(i.appendChild(s),e.classList.contains(Xs)||this.appendValueSwitchBtn(i),e.classList.contains(zs)||(t=this.createElement("input",{className:"e-hex",attrs:{maxlength:"7",spellcheck:"false","aria-label":"HEX"}}),s.appendChild(t),o.Input.createInput({element:t,floatLabelType:"Always",properties:{placeholder:"HEX",enableRtl:this.enableRtl,enabled:!this.disabled,readonly:!this.isPicker()}},this.createElement),o.Input.setValue(this.value.slice(0,7),t),t.addEventListener("input",this.inputHandler.bind(this))),!e.classList.contains(js)){for(var n=void 0,a=void 0,a=this.isRgb?(n="RGB",this.rgb):(n="HSV",this.hsv),l=["rh","gs","bv"],r=0;r<3;r++)this.createNumericInput(s.appendChild(this.createElement("input",{className:"e-"+l[r]+"-value"})),a[r],n[r],255);this.enableOpacity&&this.appendOpacityValue(s)}}},S.prototype.appendOpacityValue=function(t){this.createNumericInput(t.appendChild(this.createElement("input",{className:$s})),100*this.rgb[3],"A",100)},S.prototype.appendValueSwitchBtn=function(t){var e=this.createElement("button",{className:"e-icons e-css e-btn e-flat e-icon-btn "+Ds,attrs:{title:"Toggle format"}});t.appendChild(e),this.isPicker()&&!this.getWrapper().classList.contains(js)&&e.addEventListener("click",this.formatSwitchHandler.bind(this))},S.prototype.createCtrlBtn=function(){var t,e;(this.modeSwitcher||this.showButtons)&&(this.l10n.setLocale(this.locale),e=this.createElement("div",{className:Vs}),this.container.appendChild(e),this.showButtons&&(t=this.createElement("div",{className:Fs}),e.appendChild(t),e=this.l10n.getConstant("Apply"),t.appendChild(this.createElement("button",{innerHTML:e,className:"e-btn e-css e-flat e-primary e-small "+Rs,attrs:{title:e}})),e=this.l10n.getConstant("Cancel"),t.appendChild(this.createElement("button",{innerHTML:e,className:"e-btn e-css e-flat e-small "+Us,attrs:{title:e}}))),this.modeSwitcher)&&this.appendModeSwitchBtn()},S.prototype.appendModeSwitchBtn=function(){var t=this.createElement("button",{className:"e-icons e-btn e-flat e-icon-btn "+Gs,attrs:{title:this.l10n.getConstant("ModeSwitcher")}});E.select("."+Vs,this.container).insertBefore(t,E.select("."+Fs,this.container))},S.prototype.createDragTooltip=function(){var e=this,t=new h.Tooltip({opensOn:"Custom",showTipPointer:!1,cssClass:"e-color-picker-tooltip",htmlAttributes:{title:"tooltip"},beforeOpen:function(t){e.tooltipEle=t.element},animation:{open:{effect:"None"},close:{effect:"None"}}});t.createElement=this.createElement,t.appendTo(this.container),t.open(this.container),this.tooltipEle.style.zIndex=h.getZindexPartial(this.tooltipEle).toString(),this.tooltipEle.setAttribute("aria-label","colorpicker-tooltip"),E.select(".e-tip-content",this.tooltipEle).appendChild(this.createElement("div",{className:"e-tip-transparent"}))},S.prototype.getTooltipInst=function(){return E.getInstance(this.container,h.Tooltip)},S.prototype.setTooltipOffset=function(t){this.getTooltipInst().offsetY=t},S.prototype.toggleDisabled=function(e){e?this.getWrapper().classList.add(Ms):this.getWrapper().classList.remove(Ms),this.showButtons&&[].slice.call(E.selectAll(".e-btn",this.container)).forEach(function(t){e?E.attributes(t,{disabled:""}):t.removeAttribute("disabled")})},S.prototype.convertToRgbString=function(t){return t.length?4===t.length?"rgba("+t.join()+")":"rgb("+t.join()+")":""},S.prototype.convertToHsvString=function(t){return 4===t.length?"hsva("+t.join()+")":"hsv("+t.join()+")"},S.prototype.updateHsv=function(){this.hsv[1]=100<this.hsv[1]?100:this.hsv[1],this.hsv[2]=100<this.hsv[2]?100:this.hsv[2],this.setHandlerPosition()},S.prototype.convertToOtherFormat=function(t,e){void 0===t&&(t=!1);var i=this.rgbToHex(this.rgb),s=(this.rgb=this.hsvToRgb.apply(this,this.hsv),this.rgbToHex(this.rgb)),n=this.convertToRgbString(this.rgb);this.updatePreview(n),this.updateInput(s),this.triggerEvent(s,i,n,t,e)},S.prototype.updateInput=function(t){var e=this.getWrapper();e.classList.contains(_s)||(e.classList.contains(zs)||o.Input.setValue(t.substr(0,7),E.select(".e-hex",this.container)),e.classList.contains(js))||(this.isRgb?this.updateValue(this.rgb,!1):this.updateValue(this.hsv,!1))},S.prototype.updatePreview=function(t){this.enableOpacity&&this.updateOpacitySliderBg(),E.select(".e-tip-transparent",this.tooltipEle).style.backgroundColor=t,E.select("."+sn+" ."+Is,this.container).style.backgroundColor=t,E.select("."+sn+" ."+nn,this.container).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value))},S.prototype.getDragHandler=function(){return E.select("."+Ws,this.container)},S.prototype.removeTileSelection=function(){[].slice.call(E.selectAll("."+ln,this.container)).forEach(function(t){t.classList.remove(ln),t.setAttribute("aria-selected","false")})},S.prototype.convertRgbToNumberArray=function(t){return t.slice(t.indexOf("(")+1,t.indexOf(")")).split(",").map(function(t,e){return 3!==e?parseInt(t,10):parseFloat(t)})},S.prototype.getValue=function(t,e){var i,s;return t=t||this.value,e=e?e.toLowerCase():"hex","r"===t[0]?(i=this.convertRgbToNumberArray(t),"hex"===e||"hexa"===e?(s=this.rgbToHex(i),"hex"===e?s.slice(0,7):s):"hsv"===e?this.convertToHsvString(this.rgbToHsv.apply(this,i.slice(0,3))):"hsva"===e?this.convertToHsvString(this.rgbToHsv.apply(this,i)):"null"):"h"===t[0]?(i=this.hsvToRgb.apply(this,this.convertRgbToNumberArray(t)),"rgba"===e?this.convertToRgbString(i):"hex"===e||"hexa"===e?(s=this.rgbToHex(i),"hex"===e?s.slice(0,7):s):"rgb"===e?this.convertToRgbString(i.slice(0,3)):"null"):(t=this.roundValue(t),s=this.hexToRgb(t),"rgb"!==e&&"hsv"!==e||(s=s.slice(0,3)),"rgba"===e||"rgb"===e?this.convertToRgbString(s):"hsva"===e||"hsv"===e?this.convertToHsvString(this.rgbToHsv.apply(this,s)):"hex"===e?t.slice(0,7):"a"===e?s[3].toString():"null")},S.prototype.toggle=function(){this.container.parentElement.classList.contains("e-popup-close")?this.splitBtn.toggle():this.closePopup(null)},S.prototype.getModuleName=function(){return"colorpicker"},S.prototype.getPersistData=function(){return this.addOnPersist(["value"])},S.prototype.wireEvents=function(){var t;this.isPicker()?(t=this.getDragHandler(),E.EventHandler.add(t,"keydown",this.pickerKeyDown,this),(t=E.select("."+Fs,this.container))&&E.EventHandler.add(t,"keydown",this.ctrlBtnKeyDown,this),E.EventHandler.add(this.getHsvContainer(),"mousedown touchstart",this.handlerDown,this),(this.modeSwitcher||this.showButtons)&&this.addCtrlSwitchEvent(),E.EventHandler.add(E.select("."+nn,this.container),"click",this.previewHandler,this)):(E.EventHandler.add(this.container,"click",this.paletteClickHandler,this),E.EventHandler.add(this.container,"keydown",this.paletteKeyDown,this))},S.prototype.formResetHandler=function(){this.value=this.initialInputValue,E.attributes(this.element,{value:this.initialInputValue})},S.prototype.addCtrlSwitchEvent=function(){var t=E.select("."+Vs,this.container);t&&E.EventHandler.add(t,"click",this.btnClickHandler,this)},S.prototype.ctrlBtnKeyDown=function(t){13===t.keyCode&&(E.select("."+Rs,this.container)&&(t=this.rgbToHex(this.rgb),this.triggerChangeEvent(t)),this.splitBtn.element.focus())},S.prototype.pickerKeyDown=function(t){switch(t.keyCode){case 39:this.handlerDragPosition(1,this.enableRtl?-1:1,t);break;case 37:this.handlerDragPosition(1,this.enableRtl?1:-1,t);break;case 38:this.handlerDragPosition(2,1,t);break;case 40:this.handlerDragPosition(2,-1,t);break;case 13:t.preventDefault();var e=this.rgbToHex(this.rgb);this.enterKeyHandler(e)}},S.prototype.enterKeyHandler=function(t){this.triggerChangeEvent(t),!this.inline&&this.splitBtn&&this.splitBtn.element.focus()},S.prototype.closePopup=function(t){var e=this,t={element:this.container,event:t,cancel:!1};this.trigger("beforeClose",t,function(t){t.cancel||(e.splitBtn.toggle(),e.onPopupClose())})},S.prototype.triggerChangeEvent=function(t,e){var i=t.slice(0,7);this.trigger("change",{currentValue:{hex:i,rgba:this.convertToRgbString(this.rgb)},event:e,previousValue:{hex:this.value.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(this.value))},value:this.enableOpacity?t:i}),this.showRecentColors&&(this.recentColors.unshift(i),this.inline)&&this.renderRecentColor(),this.enableOpacity?this.setProperties({value:t},!0):this.setProperties({value:i},!0),this.element.value=i||"#000000"},S.prototype.handlerDragPosition=function(t,e,i){i.preventDefault(),this.hsv[t]+=e*(i.ctrlKey?1:3),this.hsv[t]<0&&(this.hsv[t]=0),this.updateHsv(),this.convertToOtherFormat(!0,i)},S.prototype.handlerDown=function(t){t.preventDefault(),"mousedown"===t.type?(this.clientX=Math.abs(t.pageX-pageXOffset),this.clientY=Math.abs(t.pageY-pageYOffset),this.setTooltipOffset(8)):(this.clientX=Math.abs(t.changedTouches[0].pageX-pageXOffset),this.clientY=Math.abs(t.changedTouches[0].pageY-pageYOffset),this.setTooltipOffset(-8)),this.setHsv(this.clientX,this.clientY),this.getDragHandler().style.transition="left .4s cubic-bezier(.25, .8, .25, 1), top .4s cubic-bezier(.25, .8, .25, 1)",this.updateHsv(),this.convertToOtherFormat(!1,t),this.getDragHandler().focus(),E.EventHandler.add(document,"mousemove touchmove",this.handlerMove,this),E.EventHandler.add(document,"mouseup touchend",this.handlerEnd,this)},S.prototype.handlerMove=function(t){"touchmove"!==t.type&&t.preventDefault(),i="mousemove"===t.type?(e=Math.abs(t.pageX-pageXOffset),Math.abs(t.pageY-pageYOffset)):(e=Math.abs(t.changedTouches[0].pageX-pageXOffset),Math.abs(t.changedTouches[0].pageY-pageYOffset)),this.setHsv(e,i);var e,i,s=this.getDragHandler();this.updateHsv(),this.convertToOtherFormat(!1,t),this.getTooltipInst().refresh(s),this.tooltipEle.style.transform||(8<Math.abs(this.clientX-e)||8<Math.abs(this.clientY-i))&&(E.select("."+Ks,this.container).style.cursor="pointer",s.style.transition="none",this.inline||(this.tooltipEle.style.zIndex=(parseInt(this.getPopupEle().style.zIndex,10)+1).toString()),this.tooltipEle.style.transform="rotate(45deg)",s.classList.add("e-hide-handler"))},S.prototype.setHsv=function(t,e){var i=E.select("."+Ks,this.container),s=i.getBoundingClientRect();t=this.enableRtl?t>s.right?0:Math.abs(t-s.right):t>s.left?Math.abs(t-s.left):0,e=e>s.top?Math.abs(e-s.top):0,this.hsv[2]=Math.round(10*Number(100*(i.offsetHeight-Math.max(0,Math.min(i.offsetHeight,e-i.offsetTop)))/i.offsetHeight))/10,this.hsv[1]=Math.round(10*Number(100*Math.max(0,Math.min(i.offsetWidth,t-i.offsetLeft))/i.offsetWidth))/10},S.prototype.handlerEnd=function(t){"touchend"!==t.type&&t.preventDefault(),E.EventHandler.remove(document,"mousemove touchmove",this.handlerMove),E.EventHandler.remove(document,"mouseup touchend",this.handlerEnd);var e=this.getDragHandler();E.select("."+Ks,this.container).style.cursor="",this.tooltipEle.style.transform&&(this.tooltipEle.style.transform="",e.classList.remove("e-hide-handler")),this.inline||this.showButtons||this.closePopup(t)},S.prototype.btnClickHandler=function(t){var e=t.target;E.closest(e,"."+Gs)?(t.stopPropagation(),this.switchToPalette()):(e.classList.contains(Rs)||e.classList.contains(Us))&&this.ctrlBtnClick(e,t)},S.prototype.switchToPalette=function(){this.trigger("beforeModeSwitch",{element:this.container,mode:"Palette"}),this.unWireEvents(),this.destroyOtherComp(),E.detach(E.select(".e-slider-preview",this.container)),this.getWrapper().classList.contains(_s)||E.remove(E.select("."+Zs,this.container)),E.detach(this.getHsvContainer()),this.createPalette(),this.firstPaletteFocus(),this.createInput(),this.refreshPopupPos(),this.element.parentElement&&this.element.parentElement.parentElement&&this.element.parentElement.parentElement.classList.contains("e-ie-ddb-popup")&&this.refreshImageEditorPopupPos(),this.wireEvents(),this.trigger("onModeSwitch",{element:this.container,mode:"Palette"})},S.prototype.refreshImageEditorPopupPos=function(){var t,e;E.Browser.isDevice&&((t=this.getPopupEle()).style.left=E.formatUnit(0+pageXOffset),t.style.top=E.formatUnit(0+pageYOffset),e=document.querySelector("#"+this.element.parentElement.parentElement.id.split("-popup")[0]))&&t.parentElement.ej2_instances[0].refreshPosition(e)},S.prototype.refreshPopupPos=function(){var t;this.inline||((t=this.getPopupEle()).style.left=E.formatUnit(0+pageXOffset),t.style.top=E.formatUnit(0+pageYOffset),this.getPopupInst().refreshPosition(this.splitBtn.element.parentElement))},S.prototype.formatSwitchHandler=function(){this.isRgb?(this.updateValue(this.hsv,!0,3,[360,100,100]),this.isRgb=!1):(this.updateValue(this.rgb,!0,2),this.isRgb=!0)},S.prototype.updateValue=function(t,e,i,s){for(var n,a=["e-rh-value","e-gs-value","e-bv-value"],l=0,r=a.length;l<r;l++)(n=E.getInstance(E.select("."+a[l],this.container),Rt)).value=Math.round(t[l]),e&&(n.placeholder=a[l].substr(i,1).toUpperCase(),n.max=s?s[l]:255),n.dataBind()},S.prototype.previewHandler=function(t){var e=t.target,i=this.rgbToHex(this.rgb),e=(this.rgb=this.convertRgbToNumberArray(e.style.backgroundColor),this.rgb[3]||(this.rgb[3]=1),this.rgbToHex(this.rgb)),s=this.rgbToHsv.apply(this,this.rgb);s[0]!==this.hsv[0]&&(this.hueSlider.setProperties({value:s[0]},!0),this.hueSlider.refresh()),this.setHsvContainerBg(s[0]),this.enableOpacity&&s[3]!==this.hsv[3]&&(this.opacitySlider.setProperties({value:100*s[3]},!0),this.opacitySlider.refresh(),this.updateOpacitySliderBg()),this.hsv=s,this.setHandlerPosition(),this.updateInput(e),E.select("."+sn+" ."+Is,this.container).style.backgroundColor=this.convertToRgbString(this.rgb),this.triggerEvent(e,i,this.convertToRgbString(this.rgb),!1,t)},S.prototype.paletteClickHandler=function(t){t.preventDefault();var e,i,s=t.target;s.classList.contains(on)?(this.removeTileSelection(),this.addTileSelection(s),s.classList.contains(Js)?this.noColorTile():(e=s.getAttribute("aria-label"),i=this.rgbToHex(this.rgb),this.rgb=this.hexToRgb(this.roundValue(e)),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.getWrapper().classList.contains(an)&&this.updateInput(e),this.triggerEvent(e,i,this.convertToRgbString(this.rgb),!1,t)),this.inline||this.showButtons||this.closePopup(t)):E.closest(s,"."+Gs)?this.switchToPicker():s.classList.contains(Rs)||s.classList.contains(Us)?this.ctrlBtnClick(s,t):this.getWrapper().classList.contains(an)&&E.closest(s,"."+Ds)&&this.formatSwitchHandler()},S.prototype.noColorTile=function(t){void 0===t&&(t=!1);var e=this.rgbToHex(this.rgb);this.rgb=[],this.hsv=[],this.triggerEvent("",e,"",t)},S.prototype.switchToPicker=function(){var t=this.getWrapper(),t=(this.trigger("beforeModeSwitch",{element:this.container,mode:"Picker"}),this.unWireEvents(),[].slice.call(E.selectAll("."+Qs,this.container)).forEach(function(t){E.detach(t)}),this.container.querySelector(".e-clr-pal-rec-wpr")&&E.detach(this.container.querySelector(".e-clr-pal-rec-wpr")),t.classList.contains(an)&&E.detach(E.select("."+Zs,this.container)),this.container.style.width="",E.select(".e-custom-palette",this.container));this.presetColors&&E.remove(t),this.createPicker(),this.getDragHandler().focus(),this.createInput(),this.refreshPopupPos(),this.element.parentElement&&this.element.parentElement.parentElement&&this.element.parentElement.parentElement.classList.contains("e-ie-ddb-popup")&&this.refreshImageEditorPopupPos(),this.wireEvents(),this.trigger("onModeSwitch",{element:this.container,mode:"Picker"})},S.prototype.ctrlBtnClick=function(t,e){var i;t.classList.contains(Rs)&&(i=this.rgbToHex(this.rgb),this.triggerChangeEvent(i,e)),!this.inline&&this.splitBtn?(this.closePopup(e),this.splitBtn.element.focus()):t.classList.contains(Us)&&(i={element:this.container,event:e,cancel:!1},this.trigger("beforeClose",i))},S.prototype.paletteKeyDown=function(t){var e=t.target;if(e.classList.contains(Qs)){var i,s,n=[].slice.call(E.selectAll("."+on,e)),a=n.filter(function(t){return t.classList.contains("e-selected")}).pop();switch(!t.altKey&&t.keyCode){case 39:t.preventDefault(),s=(!a||!(!this.enableRtl&&n.indexOf(a)===n.length-1||this.enableRtl&&0===n.indexOf(a)))&&a?this.tilePosition(n,a,this.enableRtl?-1:1):this.enableRtl?n.length-1:0,n[s]&&(i=n[s]),this.keySelectionChanges(i);break;case 37:t.preventDefault(),s=(!a||!(!this.enableRtl&&0===n.indexOf(a)||this.enableRtl&&n.indexOf(a)===n.length-1))&&a?this.tilePosition(n,a,this.enableRtl?1:-1):this.enableRtl?0:n.length-1,n[s]&&(i=n[s]),this.keySelectionChanges(i);break;case 38:t.preventDefault(),i=n[s=a?this.tilePosition(n,a,-this.columns):0]||n[s-this.columns],this.keySelectionChanges(i);break;case 40:t.preventDefault(),i=n[s=a?this.tilePosition(n,a,this.columns):n.length-1]||n[s=(s%=n.length)+n[n.length-1].parentElement.childElementCount],this.keySelectionChanges(i);break;case 13:t.preventDefault(),a&&(s=a.getAttribute("aria-label"),this.enterKeyHandler(s||""))}}},S.prototype.keySelectionChanges=function(t){var e;this.removeTileSelection(),this.addTileSelection(t),t.classList.contains(Js)?this.noColorTile(!0):(t=t.getAttribute("aria-label"),e=this.rgbToHex(this.rgb),this.rgb=this.hexToRgb(t),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.getWrapper().classList.contains(an)&&this.updateInput(t),this.triggerEvent(t,e,this.convertToRgbString(this.rgb),!0))},S.prototype.tilePosition=function(t,e,i){var s=(t=Array.prototype.slice.call(t)).length,n=this.columns-t[s-1].parentElement.childElementCount,t=t.indexOf(e);return(t+=i)<0?t+=s+n:t%=s+n,t},S.prototype.inputHandler=function(t){var e,i,s=t.target;if(s.value.length)switch(E.select(".e-float-text",s.parentElement).textContent){case"HEX":var n="";if(9!==(n="#"===s.value[0]&&5!==s.value.length||"#"!==s.value[0]&&4!==s.value.length?this.roundValue(s.value):n).length)return;i=this.rgbToHex(this.rgb),this.rgb=this.hexToRgb(n+n.substr(-2)),this.inputValueChange(this.rgbToHsv.apply(this,this.rgb),i,s.value,t);break;case"R":this.rgb[0]!==Number(s.value)&&(i=this.rgbToHex(this.rgb),this.rgb[0]=Number(s.value),e=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(e,i,null,t));break;case"G":this.rgb[1]!==Number(s.value)&&(i=this.rgbToHex(this.rgb),this.rgb[1]=Number(s.value),e=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(e,i,null,t));break;case"B":this.rgb[2]!==Number(s.value)&&(i=this.rgbToHex(this.rgb),this.rgb[2]=Number(s.value),e=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(e,i,null,t));break;case"H":this.hueSlider.value=Number(s.value);break;case"S":this.hsv[1]!==Number(s.value)&&(this.hsv[1]=Number(s.value),this.updateHsv(),this.convertToOtherFormat(!1,t));break;case"V":this.hsv[2]!==Number(s.value)&&(this.hsv[2]=Number(s.value),this.updateHsv(),this.convertToOtherFormat(!1,t));break;case"A":this.opacitySlider.value=Number(s.value)}},S.prototype.inputValueChange=function(t,e,i,s){t[0]!==this.hsv[0]&&(this.hueSlider.setProperties({value:t[0]},!0),this.hueSlider.refresh(),this.setHsvContainerBg(t[0])),this.hsv=t;t=this.rgbToHex(this.rgb),this.setHandlerPosition(),this.updateInput(i||t),i=this.convertToRgbString(this.rgb);this.updatePreview(i),this.triggerEvent(t,e,i,!1,s)},S.prototype.triggerEvent=function(t,e,i,s,n){void 0===s&&(s=!1);var a=t.slice(0,7);E.isNullOrUndefined(n)&&(n=new MouseEvent("click",{bubbles:!0,cancelable:!1})),this.showButtons||s?this.trigger("select",{currentValue:{hex:a,rgba:i},event:n,previousValue:{hex:e.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(e))}}):(this.trigger("change",{currentValue:{hex:a,rgba:i},event:n,previousValue:{hex:this.value.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(this.value))},value:t}),this.showRecentColors&&(this.recentColors.unshift(a),this.inline)&&this.renderRecentColor(),this.enableOpacity?this.setProperties({value:t},!0):this.setProperties({value:a},!0),this.element.value=a||"#000000")},S.prototype.destroy=function(){var e=this,t=this.getWrapper();Bs.prototype.destroy.call(this),["tabindex","spellcheck"].forEach(function(t){e.element.removeAttribute(t)}),this.inline?(this.unWireEvents(),this.destroyOtherComp()):(this.isPopupOpen()&&(this.unWireEvents(),this.destroyOtherComp()),delete this.splitBtn.beforeClose,delete this.splitBtn.beforeOpen,delete this.splitBtn.click,delete this.splitBtn.open,this.splitBtn.destroy(),this.splitBtn=null),this.tileRipple(),this.tileRipple=null,this.ctrlBtnRipple(),this.ctrlBtnRipple=null,this.element.nextElementSibling&&E.detach(this.element.nextElementSibling),t&&(t.parentElement.insertBefore(this.element,t),E.detach(t)),this.container=null,this.formElement&&E.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},S.prototype.destroyOtherComp=function(){if(this.isPicker()){for(var t=E.closest(this.hueSlider.element,".e-color-picker").querySelectorAll(".e-numerictextbox"),e=0;e<t.length;e++)E.getInstance(t[e],Rt).destroy();this.hueSlider.destroy(),this.enableOpacity&&(this.opacitySlider.destroy(),this.opacitySlider=null),this.hueSlider=null;var i=this.getTooltipInst();i.close(),i.destroy(),this.tooltipEle=null}},S.prototype.isPopupOpen=function(){return this.getPopupEle().classList.contains("e-popup-open")},S.prototype.unWireEvents=function(){var t;this.isPicker()?(t=this.getDragHandler(),E.EventHandler.remove(t,"keydown",this.pickerKeyDown),(t=E.select("."+Fs,this.container))&&E.EventHandler.remove(t,"keydown",this.ctrlBtnKeyDown),E.EventHandler.remove(this.getHsvContainer(),"mousedown touchstart",this.handlerDown),(this.modeSwitcher||this.showButtons)&&E.EventHandler.remove(E.select("."+Vs,this.container),"click",this.btnClickHandler),E.EventHandler.remove(E.select("."+nn,this.container),"click",this.previewHandler)):(E.EventHandler.remove(this.container,"click",this.paletteClickHandler),E.EventHandler.remove(this.container,"keydown",this.paletteKeyDown))},S.prototype.roundValue=function(t){if(!t)return"";var e=(t="#"!==t[0]?"#"+t:t).length;if(4===e&&(t+="f",e=5),5===e){for(var i="",s=1,n=t.length;s<n;s++)i+=t.charAt(s)+t.charAt(s);t="#"+i,e=9}return 7===e&&(t+="ff"),t},S.prototype.hexToRgb=function(t){if(!t)return[];9!==(t=t.trim()).length&&(t=this.roundValue(t));var e=Number((parseInt(t.slice(-2),16)/255).toFixed(2)),t=(t=t.slice(1,7),parseInt(t,16)),i=[];return i.push(t>>16&255),i.push(t>>8&255),i.push(255&t),i.push(e),i},S.prototype.rgbToHsv=function(t,e,i,s){if(this.rgb&&!this.rgb.length)return[];t/=255,e/=255,i/=255;var n,a=Math.max(t,e,i),l=Math.min(t,e,i),r=a,o=a-l,h=0===a?0:o/a;if(a===l)n=0;else{switch(a){case t:n=(e-i)/o+(e<i?6:0);break;case e:n=(i-t)/o+2;break;case i:n=(t-e)/o+4}n/=6}l=[Math.round(360*n),Math.round(1e3*h)/10,Math.round(1e3*r)/10];return E.isNullOrUndefined(s)||l.push(s),l},S.prototype.hsvToRgb=function(t,e,i,s){var n,a,l;if(i/=100,0===(e/=100))return n=a=l=i,[Math.round(255*n),Math.round(255*a),Math.round(255*l),s];t/=60;var r=Math.floor(t),t=t-r,o=i*(1-e),h=i*(1-e*t),p=i*(1-e*(1-t));switch(r){case 0:n=i,a=p,l=o;break;case 1:n=h,a=i,l=o;break;case 2:n=o,a=i,l=p;break;case 3:n=o,a=h,l=i;break;case 4:n=p,a=o,l=i;break;default:n=i,a=o,l=h}e=[Math.round(255*n),Math.round(255*a),Math.round(255*l)];return E.isNullOrUndefined(s)||e.push(s),e},S.prototype.rgbToHex=function(t){return t.length?"#"+this.hex(t[0])+this.hex(t[1])+this.hex(t[2])+(E.isNullOrUndefined(t[3])?"":0!==t[3]?(Math.round(255*t[3])+65536).toString(16).substr(-2):"00"):""},S.prototype.hex=function(t){return("0"+t.toString(16)).slice(-2)},S.prototype.changeModeSwitcherProp=function(t){var e=E.select("."+Vs,this.container);t?e?this.appendModeSwitchBtn():(this.createCtrlBtn(),this.isPicker()&&!this.disabled&&this.addCtrlSwitchEvent()):e&&(this.showButtons?E.detach(E.select("."+Gs,e)):E.remove(e))},S.prototype.changeShowBtnProps=function(t){var e=E.select("."+Vs,this.container);t?(e&&E.remove(e),this.createCtrlBtn(),this.isPicker()&&!this.disabled&&this.addCtrlSwitchEvent()):this.modeSwitcher?E.detach(E.select("."+Fs,e)):E.remove(e)},S.prototype.changeValueProp=function(t){this.isPicker()?(this.rgb=this.hexToRgb(t),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.setHandlerPosition(),E.detach(E.closest(this.hueSlider.element,".e-slider-preview")),this.createSlider(),this.setHsvContainerBg(),this.updateInput(t),4===this.rgb.length&&this.updateOpacityInput(100*this.rgb[3])):(this.removeTileSelection(),(t=this.container.querySelector('span[aria-label="'+this.roundValue(t)+'"]'))&&this.addTileSelection(t))},S.prototype.setInputEleProps=function(){E.remove(E.select("."+Zs,this.container)),this.createInput()},S.prototype.changeDisabledProp=function(t){this.isPicker()&&(this.hueSlider.enabled=!t,this.opacitySlider.enabled=!t,this.setInputEleProps()),t?(this.toggleDisabled(!0),this.unWireEvents()):(this.toggleDisabled(!1),this.wireEvents())},S.prototype.changeCssClassProps=function(t,e){var i=this.getWrapper(),s=this.getPopupEle();e&&(E.removeClass([i,s],e.split(" ")),this.splitBtn&&this.splitBtn.activeElem&&this.splitBtn.activeElem[0]&&this.splitBtn.activeElem[1]&&E.removeClass([this.splitBtn.activeElem[0],this.splitBtn.activeElem[1]],e.split(" ")),this.splitBtn)&&this.splitBtn.element&&this.splitBtn.element.parentElement&&E.removeClass([this.splitBtn.element.parentElement],e.split(" ")),t&&(E.addClass([i,s],t.replace(/\s+/g," ").trim().split(" ")),this.splitBtn&&this.splitBtn.activeElem&&this.splitBtn.activeElem[0]&&this.splitBtn.activeElem[1]&&E.addClass([this.splitBtn.activeElem[0],this.splitBtn.activeElem[1]],t.replace(/\s+/g," ").trim().split(" ")),this.splitBtn)&&this.splitBtn.element&&this.splitBtn.element.parentElement&&E.addClass([this.splitBtn.element.parentElement],t.replace(/\s+/g," ").trim().split(" "))},S.prototype.changeRtlProps=function(t){t?E.addClass([this.getWrapper()],"e-rtl"):E.removeClass([this.getWrapper()],"e-rtl")},S.prototype.changePaletteProps=function(){E.detach(this.container.children[0]),this.container.style.width="",this.createPalette()},S.prototype.changeOpacityProps=function(t){var e=this.getWrapper();t?(E.removeClass([this.container.parentElement],qs),this.createOpacitySlider(E.select(".e-colorpicker-slider",this.container).appendChild(this.createElement("div",{className:"e-opacity-slider"}))),e.classList.contains(_s)||e.classList.contains(js)||this.appendOpacityValue(E.select(".e-input-container",this.container))):(E.addClass([this.container.parentElement],qs),this.opacitySlider.destroy(),E.remove(this.opacitySlider.element),this.opacitySlider=null,e.classList.contains(_s)||e.classList.contains(js)||E.remove(E.select("."+$s,this.container).parentElement))},S.prototype.onPropertyChanged=function(s,n){var t,e,a=this;if(E.isNullOrUndefined(s.value)||(9===(t=this.roundValue(s.value)).length?(this.element.value=this.roundValue(t).slice(0,7),(e=this.splitBtn&&E.select("."+rn,this.splitBtn.element))&&(e.style.backgroundColor=this.convertToRgbString(this.hexToRgb(s.value)))):this.noColor&&"Palette"===this.mode&&""===this.value?(e=this.splitBtn&&E.select("."+rn,this.splitBtn.element)).style.backgroundColor="":this.value=n.value),!this.inline&&E.isNullOrUndefined(s.inline))if(this.splitBtn.setProperties(I.getModel(s,["disabled","enableRtl"])),!this.isPopupOpen())return this.changeCssClassProps(s.cssClass,n.cssClass),void this.changeRtlProps(s.enableRtl);for(var l=this,i=0,r=Object.keys(s);i<r.length;i++)!function(t){switch(t){case"inline":s.inline?(l.getWrapper().appendChild(l.container),l.splitBtn.destroy(),E.detach(l.element.nextElementSibling),l.container.children.length||l.createWidget()):(l.destroyOtherComp(),l.unWireEvents(),l.container.innerHTML="",l.createSplitBtn());break;case"cssClass":l.changeCssClassProps(s.cssClass,n.cssClass);var e=(e=s.cssClass.split(" ").concat(n.cssClass.split(" "))).reduce(function(t,e){return t.indexOf(e)<0&&t.push(e),t},[]),i=0;e.forEach(function(t){0!==i||t!==_s&&t!==Xs&&t!==an&&t!==zs&&t!==js||(E.select("."+Zs,a.container)&&E.remove(E.select("."+Zs,a.container)),a.createInput(),i++)});break;case"enableRtl":l.isPicker()&&(l.hueSlider.enableRtl=s.enableRtl,l.enableOpacity&&(l.opacitySlider.enableRtl=s.enableRtl),l.setInputEleProps()),l.changeRtlProps(s.enableRtl);break;case"disabled":l.changeDisabledProp(s.disabled);break;case"value":l.value!==n.value&&l.changeValueProp(s.value);break;case"showButtons":l.changeShowBtnProps(s.showButtons);break;case"mode":"Picker"===s.mode?l.switchToPicker():l.switchToPalette();break;case"modeSwitcher":l.changeModeSwitcherProp(s.modeSwitcher);break;case"columns":case"presetColors":l.isPicker()||l.changePaletteProps();break;case"noColor":s.noColor?"Palette"!==l.mode||l.modeSwitcher||l.setNoColor():l.changePaletteProps();break;case"enableOpacity":l.changeOpacityProps(s.enableOpacity);break;case"showRecentColors":s.showRecentColors||(e=l.container.querySelector(".e-clr-pal-rec-wpr"))&&E.detach(e),l.recentColors=[]}}(r[i])},S.prototype.focusIn=function(){this.element.parentElement.focus()},x([E.Property("#008000ff")],S.prototype,"value",void 0),x([E.Property("")],S.prototype,"cssClass",void 0),x([E.Property(!1)],S.prototype,"disabled",void 0),x([E.Property("Picker")],S.prototype,"mode",void 0),x([E.Property(!0)],S.prototype,"modeSwitcher",void 0),x([E.Property(null)],S.prototype,"presetColors",void 0),x([E.Property(!0)],S.prototype,"showButtons",void 0),x([E.Property(10)],S.prototype,"columns",void 0),x([E.Property(!1)],S.prototype,"inline",void 0),x([E.Property(!1)],S.prototype,"noColor",void 0),x([E.Property(!1)],S.prototype,"enablePersistence",void 0),x([E.Property(!0)],S.prototype,"enableOpacity",void 0),x([E.Property(!1)],S.prototype,"createPopupOnClick",void 0),x([E.Property(!1)],S.prototype,"showRecentColors",void 0),x([E.Event()],S.prototype,"select",void 0),x([E.Event()],S.prototype,"change",void 0),x([E.Event()],S.prototype,"beforeTileRender",void 0),x([E.Event()],S.prototype,"beforeOpen",void 0),x([E.Event()],S.prototype,"open",void 0),x([E.Event()],S.prototype,"beforeClose",void 0),x([E.Event()],S.prototype,"beforeModeSwitch",void 0),x([E.Event()],S.prototype,"onModeSwitch",void 0),x([E.Event()],S.prototype,"created",void 0),x([E.NotifyPropertyChanges],S));function S(t,e){t=Bs.call(this,t,e)||this;return t.recentColors=[],t}pn=function(t,e){return(pn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var pn,dn,x=function(t,e){function i(){this.constructor=t}pn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},T=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},x=(dn=E.Component,x(P,dn),P.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"floatLabelType":o.Input.removeFloating(this.textboxWrapper),o.Input.addFloating(this.respectiveElement,this.floatLabelType,this.placeholder);break;case"enabled":o.Input.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container),this.bindClearEvent();break;case"width":o.Input.setWidth(t.width,this.textboxWrapper.container);break;case"maxLength":this.maxLength&&this.element.setAttribute("maxlength",this.maxLength.toString());break;case"value":var n=this.isProtectedOnChange;this.isProtectedOnChange=!0,o.Input.isBlank(this.value)||(this.value=this.value.toString()),this.isProtectedOnChange=n,o.Input.setValue(this.value,this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value),this.inputPreviousValue=this.respectiveElement.value,(this.isAngular||this.isVue)&&!0===this.preventChange?(this.previousValue=this.isAngular?this.value:this.previousValue,this.preventChange=!1):(E.isNullOrUndefined(this.isAngular)||!this.isAngular||this.isAngular&&!this.preventChange||this.isAngular&&E.isNullOrUndefined(this.preventChange))&&this.raiseChangeEvent();break;case"htmlAttributes":this.updateHTMLAttributesToElement(),this.updateHTMLAttributesToWrapper(),this.checkAttributes(!0),this.multiline&&!E.isNullOrUndefined(this.textarea)?o.Input.validateInputType(this.textboxWrapper.container,this.textarea):o.Input.validateInputType(this.textboxWrapper.container,this.element);break;case"readonly":o.Input.setReadonly(this.readonly,this.respectiveElement);break;case"type":"TEXTAREA"!==this.respectiveElement.tagName&&(this.respectiveElement.setAttribute("type",this.type),o.Input.validateInputType(this.textboxWrapper.container,this.element),this.raiseChangeEvent());break;case"showClearButton":o.Input.setClearButton(this.showClearButton,this.respectiveElement,this.textboxWrapper),this.bindClearEvent();break;case"enableRtl":o.Input.setEnableRtl(this.enableRtl,[this.textboxWrapper.container]),this.handleFloatLabel();break;case"placeholder":o.Input.setPlaceholder(this.placeholder,this.respectiveElement,this.getModuleName()),o.Input.calculateWidth(this.respectiveElement,this.textboxWrapper.container);break;case"autocomplete":"on"!==this.autocomplete&&""!==this.autocomplete?this.respectiveElement.autocomplete=this.autocomplete:this.removeAttributes(["autocomplete"]);break;case"cssClass":o.Input.updateCssClass(t.cssClass,e.cssClass,this.textboxWrapper.container);break;case"locale":this.globalize=new E.Internationalization(this.locale),this.l10n.setLocale(this.locale);n=""===this.l10n.getConstant("placeholder")?this.placeholder:this.l10n.getConstant("placeholder");this.setProperties({placeholder:n},!0),o.Input.setPlaceholder(this.placeholder,this.respectiveElement);break;case"prependTemplate":this.updatePrependTemplate();break;case"appendTemplate":this.updateAppendTemplate()}},P.prototype.getModuleName=function(){return"textbox"},P.prototype.preRender=function(){if(this.cloneElement=this.element.cloneNode(!0),this.formElement=E.closest(this.element,"form"),E.isNullOrUndefined(this.formElement)||(this.isForm=!0),"EJS-TEXTBOX"===this.element.tagName){for(var t=E.getValue("ej2_instances",this.element),e=this.multiline?this.createElement("textarea"):this.createElement("input"),i=0;i<this.element.attributes.length;i++)"id"!==(n=this.element.attributes[i].nodeName)&&"class"!==n?(e.setAttribute(n,this.element.attributes[i].nodeValue),e.innerHTML=this.element.innerHTML,"name"===n&&this.element.removeAttribute("name")):"class"===n&&e.setAttribute(n,this.element.className.split(" ").filter(function(t){return 0!==t.indexOf("ng-")}).join(" "));this.element.appendChild(e),this.element=e,E.setValue("ej2_instances",t,this.element)}this.updateHTMLAttributesToElement(),this.checkAttributes(!1),!E.isNullOrUndefined(this.textboxOptions)&&void 0!==this.textboxOptions.value||""===this.element.value||this.setProperties({value:this.element.value},!0),"TEXTAREA"!==this.element.tagName&&this.element.setAttribute("type",this.type),("text"===this.type||"INPUT"===this.element.tagName&&this.multiline&&this.isReact)&&this.element.setAttribute("role","textbox"),this.globalize=new E.Internationalization(this.locale);t={placeholder:this.placeholder};if(this.l10n=new E.L10n("textbox",t,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.element.hasAttribute("id")||this.element.setAttribute("id",E.getUniqueID("textbox")),this.element.hasAttribute("name")||this.element.setAttribute("name",this.element.getAttribute("id")),this.maxLength&&this.element.setAttribute("maxlength",this.maxLength.toString()),"INPUT"===this.element.tagName&&this.multiline){this.isHiddenInput=!0,this.textarea=this.createElement("textarea"),this.element.parentNode.insertBefore(this.textarea,this.element),this.element.setAttribute("type","hidden"),this.textarea.setAttribute("name",this.element.getAttribute("name")),this.element.removeAttribute("name"),this.textarea.setAttribute("role",this.element.getAttribute("role")),this.element.removeAttribute("role"),this.textarea.setAttribute("id",E.getUniqueID("textarea"));for(var s=["placeholder","disabled","value","readonly","type","autocomplete"],i=0;i<this.element.attributes.length;i++){var n=this.element.attributes[i].nodeName;this.element.hasAttribute(n)&&D.indexOf(n)<0&&"id"!==n&&"type"!==n&&"e-mappinguid"!==n&&(this.textarea.setAttribute(n,this.element.attributes[i].nodeValue),s.indexOf(n)<0)&&(this.element.removeAttribute(n),i--)}}},P.prototype.checkAttributes=function(t){for(var e=0,i=t?E.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly","type","autocomplete"];e<i.length;e++){var s,n,a=i[e];if(!E.isNullOrUndefined(this.element.getAttribute(a)))switch(a){case"disabled":(E.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.enabled||t)&&(s="disabled"!==this.element.getAttribute(a)&&""!==this.element.getAttribute(a)&&"true"!==this.element.getAttribute(a),this.setProperties({enabled:s},!t));break;case"readonly":(E.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.readonly||t)&&(s="readonly"===this.element.getAttribute(a)||""===this.element.getAttribute(a)||"true"===this.element.getAttribute(a),this.setProperties({readonly:s},!t));break;case"placeholder":(E.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"autocomplete":(E.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.autocomplete||t)&&(n="off"===this.element.autocomplete?"off":"on",this.setProperties({autocomplete:n},!t));break;case"value":(E.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.value||t)&&""!==this.element.value&&this.setProperties({value:this.element.value},!t);break;case"type":(E.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.type||t)&&this.setProperties({type:this.element.type},!t)}}},P.prototype.render=function(){var t=this.cssClass;E.isNullOrUndefined(this.cssClass)||""===this.cssClass||(t=o.Input.getInputValidClassList(this.cssClass)),this.respectiveElement=this.isHiddenInput?this.textarea:this.element,this.textboxWrapper=o.Input.createInput({element:this.respectiveElement,floatLabelType:this.floatLabelType,properties:{enabled:this.enabled,enableRtl:this.enableRtl,cssClass:t,readonly:this.readonly,placeholder:this.placeholder,showClearButton:this.showClearButton}}),this.updateHTMLAttributesToWrapper(),this.isHiddenInput&&this.respectiveElement.parentNode.insertBefore(this.element,this.respectiveElement),this.wireEvents(),E.isNullOrUndefined(this.value)||(o.Input.setValue(this.value,this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value)),E.isNullOrUndefined(this.value)||(this.initialValue=this.value,this.setInitialValue()),"on"!==this.autocomplete&&""!==this.autocomplete?this.respectiveElement.autocomplete=this.autocomplete:E.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.autocomplete||this.removeAttributes(["autocomplete"]),this.previousValue=this.value,this.inputPreviousValue=this.value,this.respectiveElement.defaultValue=this.respectiveElement.value,o.Input.setWidth(this.width,this.textboxWrapper.container),!E.isNullOrUndefined(E.closest(this.element,"fieldset"))&&E.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.element.hasAttribute("aria-labelledby")||this.element.hasAttribute("placeholder")||this.element.hasAttribute("aria-label")||this.element.setAttribute("aria-label","textbox"),this.createPrependTemplate(),this.createAppendTemplate(),this.multiline&&"Auto"===this.floatLabelType&&(this.prependTemplate||this.appendTemplate)&&void 0!==window.ResizeObserver&&new window.ResizeObserver(function(t){for(var e=0,i=t;e<i.length;e++){var s=i[e],n=s.target&&s.target.parentElement?s.target.parentElement.querySelector(".e-float-text.e-label-bottom"):null;n&&n.classList.contains("e-label-bottom")?n.style.width=s.contentRect.width+"px":n&&n.classList.contains("e-label-top")&&(n.style.width="auto")}}).observe(this.textarea),this.renderComplete()},P.prototype.updateHTMLAttributesToWrapper=function(){o.Input.updateHTMLAttributesToWrapper(this.htmlAttributes,this.textboxWrapper.container)},P.prototype.updateHTMLAttributesToElement=function(){o.Input.updateHTMLAttributesToElement(this.htmlAttributes,this.respectiveElement||(this.multiline&&!E.isNullOrUndefined(this.textarea)?this.textarea:this.element))},P.prototype.setInitialValue=function(){this.isAngular||this.respectiveElement.setAttribute("value",this.initialValue)},P.prototype.updatePrependTemplate=function(){this.removePrependTemplate(),this.createPrependTemplate()},P.prototype.updateAppendTemplate=function(){this.removeAppendTemplate(),this.createAppendTemplate()},P.prototype.templateComplier=function(e){if(e)try{return"function"!=typeof e&&E.selectAll(e,document).length?E.compile(E.select(e,document).innerHTML.trim()):E.compile(e)}catch(t){return E.compile(e)}},P.prototype.createPrependTemplate=function(){var t,e;E.isNullOrUndefined(this.prependTemplate)||(t=this.textboxWrapper.container,this.prependedElement=this.createElement("div",{className:"e-prepend-template"}),this.iconTemplateFunction=this.templateComplier(this.prependTemplate),(e=this.iconTemplateFunction(null,this,"template",this.element.id+"Template",this.isStringTemplate,null,this.prependedElement))&&(e=[].slice.call(e),E.append(e,this.prependedElement)),e=t.querySelector("input"),t.classList.add("e-prepend-wrapper"),e?t.insertBefore(this.prependedElement,e):t.insertBefore(this.prependedElement,t.firstChild),this.handleFloatLabel(),this.renderReactTemplates())},P.prototype.createAppendTemplate=function(){var t,e;E.isNullOrUndefined(this.appendTemplate)||(t=this.textboxWrapper.container,this.appendedElement=this.createElement("div",{className:"e-append-template"}),this.iconTemplateFunction=this.templateComplier(this.appendTemplate),(e=this.iconTemplateFunction(null,this,"template",this.element.id+"Template",this.isStringTemplate,null,this.appendedElement))&&(e=[].slice.call(e),E.append(e,this.appendedElement)),t.classList.add("e-append-wrapper"),t.appendChild(this.appendedElement),this.handleFloatLabel(),this.renderReactTemplates())},P.prototype.handleFloatLabel=function(){var t=this.textboxWrapper.container.querySelector(".e-float-text");t&&"Auto"===this.floatLabelType&&setTimeout(function(){t&&this.prependedElement&&!this.enableRtl?(t.style.marginLeft=this.prependedElement.offsetWidth+"px",t.style.marginRight="0"):t&&this.prependedElement&&this.enableRtl&&(t.style.marginRight=this.prependedElement.offsetWidth+"px",t.style.marginLeft="0"),t&&t.classList.contains("e-label-bottom")&&(t.style.width=this.element.offsetWidth+"px")}.bind(this),5)},P.prototype.removePrependTemplate=function(){E.isNullOrUndefined(this.prependedElement)||(E.detach(this.prependedElement),this.prependedElement=null)},P.prototype.removeAppendTemplate=function(){E.isNullOrUndefined(this.appendedElement)||(E.detach(this.appendedElement),this.appendedElement=null)},P.prototype.wireEvents=function(){E.EventHandler.add(this.respectiveElement,"focus",this.focusHandler,this),E.EventHandler.add(this.respectiveElement,"blur",this.focusOutHandler,this),E.EventHandler.add(this.respectiveElement,"keydown",this.keydownHandler,this),E.EventHandler.add(this.respectiveElement,"input",this.inputHandler,this),E.EventHandler.add(this.respectiveElement,"change",this.changeHandler,this),this.isForm&&E.EventHandler.add(this.formElement,"reset",this.resetForm,this),this.bindClearEvent(),!E.isNullOrUndefined(this.textboxWrapper.container.querySelector(".e-float-text"))&&"Auto"===this.floatLabelType&&this.textboxWrapper.container.classList.contains("e-autofill")&&this.textboxWrapper.container.classList.contains("e-outline")&&E.EventHandler.add(this.textboxWrapper.container.querySelector(".e-float-text"),"animationstart",this.animationHandler,this)},P.prototype.animationHandler=function(){this.textboxWrapper.container.classList.add("e-valid-input");var t=this.textboxWrapper.container.querySelector(".e-float-text");E.isNullOrUndefined(t)||(t.classList.add("e-label-top"),t.classList.contains("e-label-bottom")&&t.classList.remove("e-label-bottom"))},P.prototype.resetValue=function(t){var e=this.isProtectedOnChange;this.isProtectedOnChange=!0,null!=(this.value=t)||!this.textboxWrapper.container.classList.contains("e-valid-input")||"Always"===this.floatLabelType&&this.textboxWrapper.container.classList.contains("e-outline")||this.textboxWrapper.container.classList.remove("e-valid-input"),this.isProtectedOnChange=e},P.prototype.resetForm=function(){var t;this.isAngular?this.resetValue(""):this.resetValue(this.initialValue),E.isNullOrUndefined(this.textboxWrapper)||(t=this.textboxWrapper.container.querySelector(".e-float-text"),E.isNullOrUndefined(t))||"Always"===this.floatLabelType||(E.isNullOrUndefined(this.initialValue)||""===this.initialValue?(t.classList.add("e-label-bottom"),t.classList.remove("e-label-top")):""!==this.initialValue&&(t.classList.add("e-label-top"),t.classList.remove("e-label-bottom")))},P.prototype.focusHandler=function(t){t={container:this.textboxWrapper.container,event:t,value:this.value};this.trigger("focus",t),"Auto"===this.floatLabelType&&(this.prependTemplate||this.appendTemplate)&&setTimeout(function(){var t=this.textboxWrapper?this.textboxWrapper.container.querySelector(".e-float-text"):null;t&&(t.style.width="auto")}.bind(this),5)},P.prototype.focusOutHandler=function(t){null===this.previousValue&&null===this.value&&""===this.respectiveElement.value||this.previousValue===this.value||this.raiseChangeEvent(t,!0);t={container:this.textboxWrapper.container,event:t,value:this.value};this.trigger("blur",t),"Auto"===this.floatLabelType&&(this.prependTemplate||this.appendTemplate)&&setTimeout(function(){var t=this.textboxWrapper?this.textboxWrapper.container.querySelector(".e-float-text.e-label-bottom"):null;t&&(t.style.width=this.multiline?this.textarea.offsetWidth:this.element.offsetWidth+"px")}.bind(this),5)},P.prototype.keydownHandler=function(t){var e=t.ctrlKey&&90===t.keyCode;(13===t.keyCode||9===t.keyCode||e)&&(null!==this.previousValue&&""!==this.previousValue||null!==this.value&&""!==this.value||""!==this.respectiveElement.value)&&this.setProperties({value:this.respectiveElement.value},!0)},P.prototype.inputHandler=function(t){var e={event:t,value:this.respectiveElement.value,previousValue:this.inputPreviousValue,container:this.textboxWrapper.container};this.inputPreviousValue=this.respectiveElement.value,this.isAngular&&(this.localChange({value:this.respectiveElement.value}),this.preventChange=!0),this.isVue&&(this.preventChange=!0),this.trigger("input",e),t.stopPropagation()},P.prototype.changeHandler=function(t){this.setProperties({value:this.respectiveElement.value},!0),this.previousValue!==this.value&&this.raiseChangeEvent(t,!0),t.stopPropagation()},P.prototype.raiseChangeEvent=function(t,e){t={event:t,value:this.value,previousValue:this.previousValue,container:this.textboxWrapper.container,isInteraction:e||!1,isInteracted:e||!1};this.preventChange=!1,this.trigger("change",t),this.previousValue=this.value,"INPUT"===this.element.tagName&&this.multiline&&"mozilla"===E.Browser.info.name&&(this.element.value=this.respectiveElement.value)},P.prototype.bindClearEvent=function(){this.showClearButton&&(this.enabled?E.EventHandler.add(this.textboxWrapper.clearButton,"mousedown touchstart",this.resetInputHandler,this):E.EventHandler.remove(this.textboxWrapper.clearButton,"mousedown touchstart",this.resetInputHandler))},P.prototype.resetInputHandler=function(t){var e;t.preventDefault(),this.textboxWrapper.clearButton.classList.contains("e-clear-icon-hide")&&!this.textboxWrapper.container.classList.contains("e-static-clear")||(o.Input.setValue("",this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value),this.setProperties({value:this.respectiveElement.value},!0),e={event:t,value:this.respectiveElement.value,previousValue:this.inputPreviousValue,container:this.textboxWrapper.container},this.trigger("input",e),this.inputPreviousValue=this.respectiveElement.value,this.raiseChangeEvent(t,!0),E.closest(this.element,"form")&&(e=this.element,(t=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),e.dispatchEvent(t)))},P.prototype.unWireEvents=function(){E.EventHandler.remove(this.respectiveElement,"focus",this.focusHandler),E.EventHandler.remove(this.respectiveElement,"blur",this.focusOutHandler),E.EventHandler.remove(this.respectiveElement,"keydown",this.keydownHandler),E.EventHandler.remove(this.respectiveElement,"input",this.inputHandler),E.EventHandler.remove(this.respectiveElement,"change",this.changeHandler),this.isForm&&E.EventHandler.remove(this.formElement,"reset",this.resetForm),!E.isNullOrUndefined(this.textboxWrapper.container.querySelector(".e-float-text"))&&"Auto"===this.floatLabelType&&this.textboxWrapper.container.classList.contains("e-outline")&&this.textboxWrapper.container.classList.contains("e-autofill")&&E.EventHandler.remove(this.textboxWrapper.container.querySelector(".e-float-text"),"animationstart",this.animationHandler)},P.prototype.destroy=function(){this.unWireEvents(),this.removePrependTemplate(),this.removeAppendTemplate(),this.clearTemplate(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),"INPUT"===this.element.tagName&&this.multiline&&(E.detach(this.textboxWrapper.container.getElementsByTagName("textarea")[0]),this.respectiveElement=this.element,this.element.removeAttribute("type")),this.respectiveElement.value=this.respectiveElement.defaultValue,this.respectiveElement.classList.remove("e-input"),this.removeAttributes(["aria-disabled","aria-readonly","aria-labelledby"]),E.isNullOrUndefined(this.textboxWrapper)||(this.textboxWrapper.container.insertAdjacentElement("afterend",this.respectiveElement),E.detach(this.textboxWrapper.container)),this.textboxWrapper=null,o.Input.destroy({element:this.respectiveElement,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),"EJS-TEXTBOX"===this.element.tagName&&E.setValue("ej2_instances",null,this.element),dn.prototype.destroy.call(this)},P.prototype.addIcon=function(t,e){o.Input.addIcon(t,e,this.textboxWrapper.container,this.respectiveElement,this.createElement);var t=this.textboxWrapper.container,e=t.querySelector("span.e-icons"),t=t.querySelector("label");e&&t&&(e=this.element.parentElement.offsetWidth-e.offsetWidth,t.style.width=e+"px")},P.prototype.getPersistData=function(){return this.addOnPersist(["value"])},P.prototype.addAttributes=function(t){for(var e=0,i=Object.keys(t);e<i.length;e++){var s=i[e];"disabled"===s?(this.setProperties({enabled:!1},!0),o.Input.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container)):"readonly"===s?(this.setProperties({readonly:!0},!0),o.Input.setReadonly(this.readonly,this.respectiveElement)):"class"===s?this.respectiveElement.classList.add(t[""+s]):"placeholder"===s?(this.setProperties({placeholder:t[""+s]},!0),o.Input.setPlaceholder(this.placeholder,this.respectiveElement)):("rows"===s&&this.respectiveElement.tagName,this.respectiveElement.setAttribute(s,t[""+s]))}},P.prototype.removeAttributes=function(t){for(var e=0,i=t;e<i.length;e++){var s=i[e];"disabled"===s?(this.setProperties({enabled:!0},!0),o.Input.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container)):"readonly"===s?(this.setProperties({readonly:!1},!0),o.Input.setReadonly(this.readonly,this.respectiveElement)):"placeholder"===s?(this.setProperties({placeholder:null},!0),o.Input.setPlaceholder(this.placeholder,this.respectiveElement)):this.respectiveElement.removeAttribute(s)}},P.prototype.focusIn=function(){document.activeElement!==this.respectiveElement&&this.enabled&&(this.respectiveElement.focus(),this.textboxWrapper.container.classList.contains("e-input-group")||this.textboxWrapper.container.classList.contains("e-outline")||this.textboxWrapper.container.classList.contains("e-filled"))&&E.addClass([this.textboxWrapper.container],[W])},P.prototype.focusOut=function(){document.activeElement===this.respectiveElement&&this.enabled&&(this.respectiveElement.blur(),this.textboxWrapper.container.classList.contains("e-input-group")||this.textboxWrapper.container.classList.contains("e-outline")||this.textboxWrapper.container.classList.contains("e-filled"))&&E.removeClass([this.textboxWrapper.container],[W])},T([E.Property("text")],P.prototype,"type",void 0),T([E.Property(!1)],P.prototype,"readonly",void 0),T([E.Property("")],P.prototype,"value",void 0),T([E.Property("Never")],P.prototype,"floatLabelType",void 0),T([E.Property("")],P.prototype,"cssClass",void 0),T([E.Property(null)],P.prototype,"placeholder",void 0),T([E.Property("on")],P.prototype,"autocomplete",void 0),T([E.Property({})],P.prototype,"htmlAttributes",void 0),T([E.Property(!1)],P.prototype,"multiline",void 0),T([E.Property(!0)],P.prototype,"enabled",void 0),T([E.Property(!1)],P.prototype,"showClearButton",void 0),T([E.Property(!1)],P.prototype,"enablePersistence",void 0),T([E.Property(null)],P.prototype,"width",void 0),T([E.Property(null)],P.prototype,"maxLength",void 0),T([E.Property(null)],P.prototype,"prependTemplate",void 0),T([E.Property(null)],P.prototype,"appendTemplate",void 0),T([E.Event()],P.prototype,"created",void 0),T([E.Event()],P.prototype,"destroyed",void 0),T([E.Event()],P.prototype,"change",void 0),T([E.Event()],P.prototype,"blur",void 0),T([E.Event()],P.prototype,"focus",void 0),T([E.Event()],P.prototype,"input",void 0),T([E.NotifyPropertyChanges],P));function P(t,e){e=dn.call(this,t,e)||this;return e.previousValue=null,e.isHiddenInput=!1,e.isForm=!1,e.inputPreviousValue=null,e.textboxOptions=t,e}un=function(t,e){return(un=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var un,cn,T=function(t,e){function i(){this.constructor=t}un(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},O=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},mn="e-auto-width",fn="e-resize-x",vn="e-resize-y",gn="e-resize-xy",yn="e-resize-none",T=(cn=E.Component,T(w,cn),w.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"floatLabelType":o.Input.removeFloating(this.textareaWrapper),o.Input.addFloating(this.element,this.floatLabelType,this.placeholder),"Never"===this.floatLabelType&&this.element.removeAttribute("aria-labelledby");break;case"enabled":o.Input.setEnabled(this.enabled,this.element,this.floatLabelType,this.textareaWrapper.container),this.bindClearEvent(),this.enabled||"None"===this.resizeMode?this.element.classList.add(this.getCurrentResizeClass(this.resizeMode)):(this.element.classList.remove(this.getCurrentResizeClass(this.resizeMode)),this.element.classList.add(yn));break;case"width":"None"!==this.resizeMode&&"Vertical"!==this.resizeMode?(this.setElementWidth(t.width),this.textareaWrapper.container.classList.add(mn)):(this.textareaWrapper.container.classList.contains(mn)&&this.textareaWrapper.container.classList.remove(mn),o.Input.setWidth(t.width,this.textareaWrapper.container));break;case"value":var n=this.isProtectedOnChange;this.isProtectedOnChange=!0,o.Input.isBlank(this.value)||(this.value=this.value.toString()),this.isProtectedOnChange=n,o.Input.setValue(this.value,this.element,this.floatLabelType,this.showClearButton),this.inputPreviousValue=this.element.value,(this.isAngular||this.isVue)&&!0===this.preventChange?(this.previousValue=this.isAngular?this.value:this.previousValue,this.preventChange=!1):(E.isNullOrUndefined(this.isAngular)||!this.isAngular||this.isAngular&&!this.preventChange||this.isAngular&&E.isNullOrUndefined(this.preventChange))&&this.raiseChangeEvent();break;case"htmlAttributes":this.updateHTMLAttributesToElement(),this.updateHTMLAttributesToWrapper(),this.checkAttributes(!0),o.Input.validateInputType(this.textareaWrapper.container,this.element);break;case"readonly":o.Input.setReadonly(this.readonly,this.element),this.readonly?this.element.setAttribute("aria-readonly","true"):this.element.removeAttribute("aria-readonly");break;case"showClearButton":o.Input.setClearButton(this.showClearButton,this.element,this.textareaWrapper),this.bindClearEvent();break;case"enableRtl":o.Input.setEnableRtl(this.enableRtl,[this.textareaWrapper.container]),this.handleAdornmentFloatLabel();break;case"placeholder":o.Input.setPlaceholder(this.placeholder,this.element,this.getModuleName()),o.Input.calculateWidth(this.element,this.textareaWrapper.container);break;case"cssClass":o.Input.updateCssClass(t.cssClass,e.cssClass,this.textareaWrapper.container);break;case"locale":this.globalize=new E.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),o.Input.setPlaceholder(this.placeholder,this.element);break;case"rows":this.rows&&this.element.setAttribute("rows",this.rows.toString());break;case"cols":this.cols&&(this.element.setAttribute("cols",this.cols.toString()),null==this.width)&&this.textareaWrapper.container.classList.add(mn);break;case"maxLength":this.maxLength&&this.element.setAttribute("maxlength",this.maxLength.toString());break;case"resizeMode":this.enabled&&(this.element.classList.contains(this.getCurrentResizeClass(e.resizeMode))&&this.element.classList.remove(this.getCurrentResizeClass(e.resizeMode)),this.element.classList.add(this.getCurrentResizeClass(this.resizeMode)),!this.element.style.width||"None"!==this.resizeMode&&"Vertical"!==this.resizeMode?(n=this.element.offsetWidth,this.element.style.width=n+"px",this.textareaWrapper.container.style.width&&(this.textareaWrapper.container.style.width="")):o.Input.setWidth(this.element.style.width,this.textareaWrapper.container),this.setWrapperWidth());break;case"prependTemplate":this.handleAdornmentDirection(),this.updatePrependTemplate();break;case"appendTemplate":this.handleAdornmentDirection(!0),this.updateAppendTemplate();break;case"adornmentFlow":case"adornmentOrientation":this.handleAdornmentDirection(),this.updatePrependTemplate(),this.updateAppendTemplate()}},w.prototype.preRender=function(){if(this.formElement=E.closest(this.element,"form"),E.isNullOrUndefined(this.formElement)||(this.isForm=!0),"EJS-TEXTAREA"===this.element.tagName||"EJS-SMARTTEXTAREA"===this.element.tagName){for(var t=E.getValue("ej2_instances",this.element),e=this.createElement("textarea"),i=0;i<this.element.attributes.length;i++){var s=this.element.attributes[i].nodeName;"id"!==s&&"class"!==s?(e.setAttribute(s,this.element.attributes[i].nodeValue),e.innerHTML=this.element.innerHTML,"name"===s&&this.element.removeAttribute("name")):"class"===s&&e.setAttribute(s,this.element.className.split(" ").filter(function(t){return 0!==t.indexOf("ng-")}).join(" "))}this.element.appendChild(e),this.element=e,E.setValue("ej2_instances",t,this.element)}this.updateHTMLAttributesToElement(),this.checkAttributes(!1),!E.isNullOrUndefined(this.textareaOptions)&&void 0!==this.textareaOptions.value||""===this.element.value||this.setProperties({value:this.element.value},!0),this.globalize=new E.Internationalization(this.locale);t={placeholder:this.placeholder};this.l10n=new E.L10n("textarea",t,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.element.hasAttribute("id")||this.element.setAttribute("id",E.getUniqueID("textbox")),this.element.hasAttribute("name")||this.element.setAttribute("name",this.element.getAttribute("id")),this.rows&&this.element.setAttribute("rows",this.rows.toString()),this.cols&&this.element.setAttribute("cols",this.cols.toString()),this.maxLength&&this.element.setAttribute("maxlength",this.maxLength.toString()),!this.element.style.resize&&this.enabled&&this.element.classList.add(this.getCurrentResizeClass(this.resizeMode)),this.enabled&&this.element.setAttribute("aria-multiline","true")},w.prototype.render=function(){var t=this.cssClass;E.isNullOrUndefined(this.cssClass)||""===this.cssClass||(t=o.Input.getInputValidClassList(this.cssClass)),this.textareaWrapper=o.Input.createInput({element:this.element,floatLabelType:this.floatLabelType,properties:{enabled:this.enabled,enableRtl:this.enableRtl,cssClass:t,readonly:this.readonly,placeholder:this.placeholder,showClearButton:this.showClearButton}}),this.updateHTMLAttributesToWrapper(),this.wireEvents(),E.isNullOrUndefined(this.value)||""===this.value||o.Input.setValue(this.value,this.element,this.floatLabelType,this.showClearButton),E.isNullOrUndefined(this.value)||""===this.value||(this.initialValue=this.value,this.isAngular)||this.element.setAttribute("value",this.initialValue),this.previousValue=this.value,this.inputPreviousValue=this.value,this.element.defaultValue=this.element.value,o.Input.setWidth(this.width,this.textareaWrapper.container),this.setWrapperWidth(),this.updateFloatLabelOverflowWidth(),this.handleAdornmentDirection(),this.createPrependTemplate(),this.createAppendTemplate(),this.renderComplete(),"Auto"===this.floatLabelType&&(this.prependTemplate||this.appendTemplate)&&void 0!==window.ResizeObserver&&new window.ResizeObserver(function(t){for(var e=0,i=t;e<i.length;e++){var s=i[e],n=s.target&&s.target.parentElement?s.target.parentElement.querySelector(".e-float-text"):null;n&&n.classList.contains("e-label-bottom")?n.style.width=s.contentRect.width+"px":n&&n.classList.contains("e-label-top")&&(n.style.width="auto")}}).observe(this.element)},w.prototype.updatePrependTemplate=function(){this.removePrependTemplate(),this.createPrependTemplate()},w.prototype.updateAppendTemplate=function(){this.removeAppendTemplate(),this.createAppendTemplate()},w.prototype.templateComplier=function(e){if(e)try{return"function"!=typeof e&&E.selectAll(e,document).length?E.compile(E.select(e,document).innerHTML.trim()):E.compile(e)}catch(t){return E.compile(e)}},w.prototype.createPrependTemplate=function(){var t,e;E.isNullOrUndefined(this.prependTemplate)||(t=this.textareaWrapper.container,this.prependedElement=this.createElement("div",{className:"e-prepend-template"}),this.iconTemplateFn=this.templateComplier(this.prependTemplate),(e=this.iconTemplateFn(null,this,"template",this.element.id+"Template",this.isStringTemplate,null,this.prependedElement))&&(e=[].slice.call(e),E.append(e,this.prependedElement)),e=t.querySelector("textarea"),t.classList.add("e-prepend-wrapper"),e?t.insertBefore(this.prependedElement,e):t.insertBefore(this.prependedElement,t.firstChild),this.handleAdornmentFloatLabel(),this.renderReactTemplates())},w.prototype.createAppendTemplate=function(){var t,e;E.isNullOrUndefined(this.appendTemplate)||(t=this.textareaWrapper.container,this.appendedElement=this.createElement("div",{className:"e-append-template"}),this.iconTemplateFn=this.templateComplier(this.appendTemplate),(e=this.iconTemplateFn(null,this,"template",this.element.id+"Template",this.isStringTemplate,null,this.appendedElement))&&(e=[].slice.call(e),E.append(e,this.appendedElement)),t.classList.add("e-append-wrapper"),t.appendChild(this.appendedElement),this.renderReactTemplates())},w.prototype.handleAdornmentDirection=function(t){var e=this.textareaWrapper.container.querySelector(".e-float-text");e&&"Auto"===this.floatLabelType&&!t&&(e.style.marginLeft="0",e.style.marginRight="0",e.style.marginTop="0"),"Vertical"===this.adornmentFlow&&(this.appendTemplate||this.prependTemplate)?(this.textareaWrapper.container.classList.add("e-adornment-flow-vertical"),this.textareaWrapper.container.classList.remove("e-adornment-flow-horizontal")):(this.appendTemplate||this.prependTemplate)&&(this.textareaWrapper.container.classList.add("e-adornment-flow-horizontal"),this.textareaWrapper.container.classList.remove("e-adornment-flow-vertical")),"Vertical"===this.adornmentOrientation&&(this.appendTemplate||this.prependTemplate)?(this.textareaWrapper.container.classList.add("e-adornment-orientation-vertical"),this.textareaWrapper.container.classList.remove("e-adornment-orientation-horizontal")):(this.appendTemplate||this.prependTemplate)&&(this.textareaWrapper.container.classList.add("e-adornment-orientation-horizontal"),this.textareaWrapper.container.classList.remove("e-adornment-orientation-vertical"))},w.prototype.handleAdornmentFloatLabel=function(){var t=this.textareaWrapper.container.querySelector(".e-float-text");t&&"Auto"===this.floatLabelType&&setTimeout(function(){t&&this.prependedElement&&"Vertical"!==this.adornmentFlow&&!this.enableRtl?(t.style.marginLeft=this.prependedElement.offsetWidth+"px",t.style.marginRight="0"):t&&this.prependedElement&&"Vertical"!==this.adornmentFlow&&this.enableRtl&&(t.style.marginRight=this.prependedElement.offsetWidth+"px",t.style.marginLeft="0"),"Vertical"===this.adornmentFlow&&"Vertical"===this.adornmentOrientation&&t&&this.prependedElement&&(t.style.marginTop=this.prependedElement.offsetHeight+"px"),"Vertical"===this.adornmentFlow&&"Horizontal"===this.adornmentOrientation&&t&&this.prependedElement&&(t.style.marginTop=this.prependedElement.offsetHeight+"px")}.bind(this),10)},w.prototype.removePrependTemplate=function(){E.isNullOrUndefined(this.prependedElement)||(E.detach(this.prependedElement),this.prependedElement=null)},w.prototype.removeAppendTemplate=function(){E.isNullOrUndefined(this.appendedElement)||(E.detach(this.appendedElement),this.appendedElement=null)},w.prototype.getModuleName=function(){return"textarea"},w.prototype.getPersistData=function(){return this.addOnPersist(["value"])},w.prototype.checkAttributes=function(t){for(var e=0,i=t?E.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly"];e<i.length;e++){var s,n=i[e];if(!E.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"disabled":(E.isNullOrUndefined(this.textareaOptions)||void 0===this.textareaOptions.enabled||t)&&(s="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n),this.setProperties({enabled:s},!t));break;case"readonly":(E.isNullOrUndefined(this.textareaOptions)||void 0===this.textareaOptions.readonly||t)&&(s="readonly"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n),this.setProperties({readonly:s},!t));break;case"placeholder":(E.isNullOrUndefined(this.textareaOptions)||void 0===this.textareaOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"value":(E.isNullOrUndefined(this.textareaOptions)||void 0===this.textareaOptions.value||t)&&""!==this.element.value&&this.setProperties({value:this.element.value},!t)}}},w.prototype.wireEvents=function(){E.EventHandler.add(this.element,"focus",this.focusHandler,this),E.EventHandler.add(this.element,"blur",this.focusOutHandler,this),E.EventHandler.add(this.element,"keydown",this.keydownHandler,this),E.EventHandler.add(this.element,"input",this.inputHandler,this),E.EventHandler.add(this.element,"change",this.changeHandler,this),this.isForm&&E.EventHandler.add(this.formElement,"reset",this.resetForm,this),this.bindClearEvent(),this.resizeHandler=this.windowResize.bind(this),window.addEventListener("resize",this.resizeHandler)},w.prototype.unWireEvents=function(){E.EventHandler.remove(this.element,"focus",this.focusHandler),E.EventHandler.remove(this.element,"blur",this.focusOutHandler),E.EventHandler.remove(this.element,"keydown",this.keydownHandler),E.EventHandler.remove(this.element,"input",this.inputHandler),E.EventHandler.remove(this.element,"change",this.changeHandler),this.isForm&&E.EventHandler.remove(this.formElement,"reset",this.resetForm),this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null)},w.prototype.destroy=function(){this.unWireEvents(),this.removePrependTemplate(),this.removeAppendTemplate(),this.clearTemplate(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),this.element.value=this.element.defaultValue,this.element.classList.remove("e-input",fn,vn,gn,yn),this.textareaWrapper.container.style.width.includes("%")&&E.EventHandler.remove(this.element,"mousemove",this.onMouseMove),this.removeAttributes(["aria-disabled","aria-readonly","aria-labelledby","aria-multiline"]),E.isNullOrUndefined(this.textareaWrapper)||(this.textareaWrapper.container.insertAdjacentElement("afterend",this.element),E.detach(this.textareaWrapper.container)),this.textareaWrapper=null,o.Input.destroy({element:this.element,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),this.formElement=null,"EJS-TEXTAREA"!==this.element.tagName&&"EJS-SMARTTEXTAREA"!==this.element.tagName||E.setValue("ej2_instances",null,this.element),cn.prototype.destroy.call(this)},w.prototype.windowResize=function(){this.updateFloatLabelOverflowWidth()},w.prototype.focusHandler=function(t){var e,t={container:this.textareaWrapper.container,event:t,value:this.value};"Never"!==this.floatLabelType&&this.textareaWrapper&&this.textareaWrapper.container&&(e=this.textareaWrapper.container.querySelector(".e-float-text"))&&e.removeAttribute("style"),this.trigger("focus",t),"Auto"===this.floatLabelType&&(this.prependTemplate||this.appendTemplate)&&setTimeout(function(){var t=this.textareaWrapper?this.textareaWrapper.container.querySelector(".e-float-text"):null;t&&(t.style.width="auto")}.bind(this),5)},w.prototype.focusOutHandler=function(t){null===this.previousValue&&null===this.value||this.previousValue===this.value||this.raiseChangeEvent(t,!0);t={container:this.textareaWrapper.container,event:t,value:this.value};this.updateFloatLabelOverflowWidth(),this.handleAdornmentFloatLabel(),this.trigger("blur",t)},w.prototype.keydownHandler=function(t){13!==t.keyCode&&9!==t.keyCode||!(null!==this.previousValue&&""!==this.previousValue||null!==this.value&&""!==this.value||""!==this.element.value)||this.setProperties({value:this.element.value},!0)},w.prototype.inputHandler=function(t){var e={event:t,value:this.element.value,previousValue:this.inputPreviousValue,container:this.textareaWrapper.container};this.inputPreviousValue=this.element.value,this.isAngular&&(this.localChange({value:this.element.value}),this.preventChange=!0),this.isVue&&(this.preventChange=!0),this.trigger("input",e),t.stopPropagation()},w.prototype.changeHandler=function(t){this.setProperties({value:this.element.value},!0),this.previousValue!==this.value&&this.raiseChangeEvent(t,!0),t.stopPropagation()},w.prototype.raiseChangeEvent=function(t,e){t={event:t,value:this.value,previousValue:this.previousValue,container:this.textareaWrapper.container,isInteraction:e||!1,isInteracted:e||!1};this.preventChange=!1,this.trigger("change",t),this.previousValue=this.value},w.prototype.updateHTMLAttributesToWrapper=function(){o.Input.updateHTMLAttributesToWrapper(this.htmlAttributes,this.textareaWrapper.container)},w.prototype.updateHTMLAttributesToElement=function(){o.Input.updateHTMLAttributesToElement(this.htmlAttributes,this.element)},w.prototype.bindClearEvent=function(){this.showClearButton&&(this.enabled?E.EventHandler.add(this.textareaWrapper.clearButton,"mousedown touchstart",this.resetInputHandler,this):E.EventHandler.remove(this.textareaWrapper.clearButton,"mousedown touchstart",this.resetInputHandler))},w.prototype.resetInputHandler=function(t){t.preventDefault(),this.textareaWrapper.clearButton.classList.contains("e-clear-icon-hide")&&!this.textareaWrapper.container.classList.contains("e-static-clear")||(o.Input.setValue("",this.element,this.floatLabelType,this.showClearButton),this.setProperties({value:this.element.value},!0));var e={event:t,value:this.element.value,previousValue:this.inputPreviousValue,container:this.textareaWrapper.container};this.trigger("input",e),this.inputPreviousValue=this.element.value,this.raiseChangeEvent(t,!0),E.closest(this.element,"form")&&(e=this.element,(t=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),e.dispatchEvent(t))},w.prototype.addAttributes=function(t){for(var e=0,i=Object.keys(t);e<i.length;e++){var s=i[e];"disabled"===s?(this.setProperties({enabled:!1},!0),o.Input.setEnabled(this.enabled,this.element,this.floatLabelType,this.textareaWrapper.container)):"readonly"===s?(this.setProperties({readonly:!0},!0),o.Input.setReadonly(this.readonly,this.element)):"class"===s?this.element.classList.add(t[""+s]):"placeholder"===s?(this.setProperties({placeholder:t[""+s]},!0),o.Input.setPlaceholder(this.placeholder,this.element)):this.element.setAttribute(s,t[""+s])}},w.prototype.removeAttributes=function(t){for(var e=0,i=t;e<i.length;e++){var s=i[e];"disabled"===s?(this.setProperties({enabled:!0},!0),o.Input.setEnabled(this.enabled,this.element,this.floatLabelType,this.textareaWrapper.container)):"readonly"===s?(this.setProperties({readonly:!1},!0),o.Input.setReadonly(this.readonly,this.element)):"placeholder"===s?(this.setProperties({placeholder:null},!0),o.Input.setPlaceholder(this.placeholder,this.element)):this.element.removeAttribute(s)}},w.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.element.focus(),this.textareaWrapper.container.classList.contains("e-input-group")||this.textareaWrapper.container.classList.contains("e-outline")||this.textareaWrapper.container.classList.contains("e-filled"))&&E.addClass([this.textareaWrapper.container],[W])},w.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.element.blur(),this.textareaWrapper.container.classList.contains("e-input-group")||this.textareaWrapper.container.classList.contains("e-outline")||this.textareaWrapper.container.classList.contains("e-filled"))&&E.removeClass([this.textareaWrapper.container],[W])},w.prototype.setWrapperWidth=function(){this.enabled&&("None"!==this.resizeMode&&"Vertical"!==this.resizeMode||this.cols||this.element.getAttribute("cols"))?("None"===this.resizeMode||"Vertical"===this.resizeMode||this.textareaWrapper.container.style.width.includes("%")||this.setElementWidth(this.textareaWrapper.container.style.width),this.textareaWrapper.container.style.width.includes("%")||(this.textareaWrapper.container.classList.add(mn),this.textareaWrapper.container.style.width=""),this.textareaWrapper.container.style.width.includes("%")&&E.EventHandler.add(this.element,"mousemove",this.onMouseMove,this)):this.textareaWrapper.container.classList.contains(mn)&&this.textareaWrapper.container.classList.remove(mn)},w.prototype.onMouseMove=function(){var e,i=this;"auto"!==this.textareaWrapper.container.style.width&&(e=this.element.style.width,setTimeout(function(){var t=i.element.style.width;e!==t&&(i.textareaWrapper.container.style.width="auto")},5))},w.prototype.resetForm=function(){var t;this.isAngular?this.resetValue(""):this.resetValue(this.initialValue),E.isNullOrUndefined(this.textareaWrapper)||(t=this.textareaWrapper.container.querySelector(".e-float-text"),E.isNullOrUndefined(t))||"Always"===this.floatLabelType||(E.isNullOrUndefined(this.initialValue)||""===this.initialValue?(t.classList.add("e-label-bottom"),t.classList.remove("e-label-top")):""!==this.initialValue&&(t.classList.add("e-label-top"),t.classList.remove("e-label-bottom")))},w.prototype.resetValue=function(t){var e=this.isProtectedOnChange;this.isProtectedOnChange=!0,null!=(this.value=t)||!this.textareaWrapper.container.classList.contains("e-valid-input")||"Always"===this.floatLabelType&&this.textareaWrapper.container.classList.contains("e-outline")||this.textareaWrapper.container.classList.remove("e-valid-input"),this.isProtectedOnChange=e},w.prototype.setElementWidth=function(t){"number"==typeof t?this.element.style.width=E.formatUnit(t):"string"==typeof t&&(this.element.style.width=t.match(/px|%|em/)?t:E.formatUnit(t))},w.prototype.getCurrentResizeClass=function(t){return"None"===t?yn:"Both"===t?gn:"Horizontal"===t?fn:vn},w.prototype.getRightIconsWidth=function(){for(var t=0,e=this.textareaWrapper.container.querySelectorAll(".e-input-group-icon, .e-clear-icon"),i=0;i<e.length;i++)t+=e[i].offsetWidth;return t},O([E.Property(!(w.prototype.updateFloatLabelOverflowWidth=function(){var e=this.textareaWrapper.container,t=e.querySelector(".e-float-text-overflow")||e.querySelector(".e-float-text"),i=e.clientWidth-this.getRightIconsWidth();!t||!i||this.cssClass&&-1!==this.cssClass.split(" ").indexOf("e-outline")||this.prependTemplate&&this.appendTemplate?"Auto"===this.floatLabelType&&(this.prependTemplate||this.appendTemplate)&&setTimeout(function(){var t=e?e.querySelector(".e-float-text.e-label-bottom"):null;t&&(t.style.width=this.element.offsetWidth+"px")}.bind(this),10):t.style.width=i+"px"}))],w.prototype,"readonly",void 0),O([E.Property("")],w.prototype,"value",void 0),O([E.Property("Never")],w.prototype,"floatLabelType",void 0),O([E.Property("")],w.prototype,"cssClass",void 0),O([E.Property(null)],w.prototype,"placeholder",void 0),O([E.Property({})],w.prototype,"htmlAttributes",void 0),O([E.Property(!0)],w.prototype,"enabled",void 0),O([E.Property(!1)],w.prototype,"showClearButton",void 0),O([E.Property(!1)],w.prototype,"enablePersistence",void 0),O([E.Property(null)],w.prototype,"width",void 0),O([E.Property("Both")],w.prototype,"resizeMode",void 0),O([E.Property(null)],w.prototype,"maxLength",void 0),O([E.Property(null)],w.prototype,"cols",void 0),O([E.Property(null)],w.prototype,"rows",void 0),O([E.Property(null)],w.prototype,"prependTemplate",void 0),O([E.Property(null)],w.prototype,"appendTemplate",void 0),O([E.Property("Horizontal")],w.prototype,"adornmentFlow",void 0),O([E.Property("Horizontal")],w.prototype,"adornmentOrientation",void 0),O([E.Event()],w.prototype,"created",void 0),O([E.Event()],w.prototype,"destroyed",void 0),O([E.Event()],w.prototype,"change",void 0),O([E.Event()],w.prototype,"blur",void 0),O([E.Event()],w.prototype,"focus",void 0),O([E.Event()],w.prototype,"input",void 0),O([E.NotifyPropertyChanges],w));function w(t,e){e=cn.call(this,t,e)||this;return e.previousValue=null,e.isForm=!1,e.inputPreviousValue=null,e.textareaOptions=t,e}Cn.createStyledDiv=function(e,t){var i=document.createElement("div"),s={position:"absolute",left:-9999,top:0,zIndex:-2e3},n=(this.properties.forEach(function(t){s[""+t]=getComputedStyle(e)[t]}),Object.keys(s).forEach(function(t){i.style[""+t]=s[""+t]}),e.offsetWidth-e.clientWidth);return i.style.width=e.clientWidth+n+"px",i.innerHTML=t,e&&e.parentNode&&e.parentNode.insertBefore(i,e.nextSibling),i},Cn.createCaretMarker=function(t,e){t=this.createStyledDiv(t,e),e=t.ownerDocument.getElementById("caret-position-marker"),e={left:e.offsetLeft,top:e.offsetTop,height:e.offsetHeight};return t&&t.parentNode&&t.parentNode.removeChild(t),e},Cn.escapeHtml=function(t){return t.replace(/<|>|`|"|&/g,"?").replace(/\r\n|\r|\n/g,"<br/>")},Cn.getCaretPosition=function(t){var e=t.selectionStart||0,i=t.value.slice(0,e),s=t.value.slice(e),i='<span style="position: relative; display: inline;">'+this.escapeHtml(i)+"</span>",s=(i=(i+='<span id="caret-position-marker" style="position: relative; display: inline;">|</span>')+('<span style="position: relative; display: inline;">'+this.escapeHtml(s)+"</span>"),this.createCaretMarker(t,i));return s.pos=e,s},Cn.adjustScrollToCaretPosition=function(t){var e=this.getCaretPosition(t),i=parseFloat(window.getComputedStyle(t).lineHeight);e.top>t.clientHeight+t.scrollTop-i&&(t.scrollTop=e.top-t.clientHeight+i)},Cn.getTextAreaPosition=function(t){var e=window.getComputedStyle(t),i=this.getCaretPosition(t);return{top:i.top+parseFloat(e.borderTopWidth)+t.offsetTop-t.scrollTop,left:i.left+parseFloat(e.borderLeftWidth)+t.offsetLeft-t.scrollLeft-.25,height:i.height,elemStyle:e}},Cn.insertCharacter=function(t,e){var i=t.selectionStart,s=t.selectionEnd;t.value=t.value.substring(0,i)+e+t.value.substring(s),i+=e.length,t.setSelectionRange(i,i)},Cn.properties=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopWidth","boxSizing","fontFamily","fontSize","fontWeight","height","letterSpacing","lineHeight","marginBottom","marginLeft","marginRight","marginTop","outlineWidth","overflow","overflowX","overflowY","paddingBottom","paddingLeft","paddingRight","paddingTop","textAlign","textOverflow","textTransform","whiteSpace","wordBreak","wordWrap","width"];var bn=Cn;function Cn(){}En=function(t,e){return(En=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var En,xn,O=function(t,e){function i(){this.constructor=t}En(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},Sn=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},Tn=function(a,l,r,o){return new(r=r||Promise)(function(t,e){function i(t){try{n(o.next(t))}catch(t){e(t)}}function s(t){try{n(o.throw(t))}catch(t){e(t)}}function n(e){e.done?t(e.value):new r(function(t){t(e.value)}).then(i,s)}n((o=o.apply(a,l||[])).next())})},Pn=function(s,n){var a,l,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(i){return function(t){var e=[i,t];if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,l&&(r=2&e[0]?l.return:e[0]?l.throw||((r=l.return)&&r.call(l),0):l.next)&&!(r=r.call(l,e[1])).done)return r;switch(l=0,(e=r?[2&e[0],r.value]:e)[0]){case 0:case 1:r=e;break;case 4:return o.label++,{value:e[1],done:!1};case 5:o.label++,l=e[1],e=[0];continue;case 7:e=o.ops.pop(),o.trys.pop();continue;default:if(!(r=0<(r=o.trys).length&&r[r.length-1])&&(6===e[0]||2===e[0])){o=0;continue}if(3===e[0]&&(!r||e[1]>r[0]&&e[1]<r[3]))o.label=e[1];else if(6===e[0]&&o.label<r[1])o.label=r[1],r=e;else{if(!(r&&o.label<r[2])){r[2]&&o.ops.pop(),o.trys.pop();continue}o.label=r[2],o.ops.push(e)}}e=n.call(s,o)}catch(t){e=[6,t],l=0}finally{a=r=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}},On=((On=o.ChatMessageRole||(o.ChatMessageRole={})).System="system",On.User="user",On.Assistant="assistant",O(L,xn=T),L.prototype.render=function(){var t,e;xn.prototype.render.call(this),this.element instanceof HTMLTextAreaElement&&(this.textArea=this.element,(t=E.createElement("smart-textarea")).classList.add("e-smart-textarea"),this.textArea.after(t),"None"!==this.showSuggestionOnPopup&&(e="Enable"===this.showSuggestionOnPopup?"false":"true",this.textArea.setAttribute("data-inline-suggestions",e)),this.suggestionDisplay=new(this.shouldShowInlineSuggestions(this.textArea)?wn:kn)(this,t,this.textArea))},L.prototype.wireEvents=function(){var t=this;xn.prototype.wireEvents.call(this),E.EventHandler.add(this.element,"keyup",this.handleKeyUp,this),E.EventHandler.add(this.element,"keydown",this.handleKeyDown,this),E.EventHandler.add(this.element,"mousedown",this.removeExistingOrPendingSuggestion,this),E.EventHandler.add(this.element,"focusout",this.removeExistingOrPendingSuggestion,this),this.element.addEventListener("scroll",function(){return t.suggestionDisplay.reject()},{passive:!0})},L.prototype.unWireEvents=function(){var t=this;xn.prototype.unWireEvents.call(this),E.EventHandler.remove(this.element,"keyup",this.handleKeyUp),E.EventHandler.remove(this.element,"keydown",this.handleKeyDown),E.EventHandler.remove(this.element,"mousedown",this.removeExistingOrPendingSuggestion),E.EventHandler.remove(this.element,"focusout",this.removeExistingOrPendingSuggestion),this.element.removeEventListener("scroll",function(){return t.suggestionDisplay.reject()})},L.prototype.keydownHandler=function(){},L.prototype.shouldShowInlineSuggestions=function(t){t=t.getAttribute("data-inline-suggestions");return t?"true"===t.toLowerCase():!("ontouchstart"in window)},L.prototype.handleKeyDown=function(t){switch(t.key){case"Tab":this.suggestionDisplay.isShowing()&&(this.suggestionDisplay.accept(),t.preventDefault());break;case"Alt":case"Control":case"Shift":case"Command":break;default:this.suggestionDisplay.isShowing()&&this.suggestionDisplay.currentSuggestion.startsWith(t.key)?(bn.insertCharacter(this.textArea,t.key),t.preventDefault(),this.suggestionDisplay.show(this.suggestionDisplay.currentSuggestion.substring(t.key.length)),bn.adjustScrollToCaretPosition(this.textArea)):this.removeExistingOrPendingSuggestion()}},L.prototype.handleKeyUp=function(){var t=this;this.suggestionDisplay.isShowing()||(clearTimeout(this.typingDebounceTimeout),this.typingDebounceTimeout=setTimeout(function(){return t.handleTypingPaused()},350))},L.prototype.handleTypingPaused=function(){return Tn(this,void 0,void 0,function(){return Pn(this,function(t){switch(t.label){case 0:return document.activeElement!==this.textArea?[2]:this.textArea.selectionStart!==this.textArea.selectionEnd||this.textArea.selectionStart!==this.textArea.value.length&&"\n"!==this.textArea.value[this.textArea.selectionStart]?[3,2]:[4,this.requestSuggestionAsync()];case 1:t.sent(),t.label=2;case 2:return[2]}})})},L.prototype.removeExistingOrPendingSuggestion=function(){clearTimeout(this.typingDebounceTimeout),this.pendingSuggestionAbort&&(this.pendingSuggestionAbort.abort(),this.pendingSuggestionAbort=null),this.suggestionDisplay.reject()},L.prototype.createSuggestionPrompt=function(t,e){var i="Predict what text the user in the given ROLE would insert at the cursor position indicated by ^^^.\nOnly give predictions for which you have an EXTREMELY high confidence that the user would insert that EXACT text.\nDo not make up new information. If you are not sure, just reply with NO_PREDICTION.\n\nRULES:\n1. Reply with OK:, then in square brackets the predicted text, then END_INSERTION, and no other output.\n2. When a specific value or quantity cannot be inferred and would need to be provided, use the word NEED_INFO.\n3. If there is not enough information to predict any words that the user would type next, just reply with the word NO_PREDICTION.\n4. NEVER invent new information. If you can not be sure what the user is about to type, ALWAYS stop the prediction with END_INSERTION.",s=this.UserPhrases;if(s&&0<s.length){i+="\nAlways try to use variations on the following phrases as part of the predictions:\n";for(var n=0,a=s;n<a.length;n++)i+="- "+a[n]+"\n"}return{messages:[{role:o.ChatMessageRole.System,content:i},{role:o.ChatMessageRole.User,content:"ROLE: Family member sending a text\nUSER_TEXT: Hey, it is a nice day - the weather is ^^^"},{role:o.ChatMessageRole.Assistant,content:"OK:[great!]END_INSERTION"},{role:o.ChatMessageRole.User,content:"ROLE: Customer service assistant\nUSER_TEXT: You can find more information on^^^\n\nAlternatively, phone us."},{role:o.ChatMessageRole.Assistant,content:"OK:[ our website at NEED_INFO]END_INSERTION"},{role:o.ChatMessageRole.User,content:"ROLE: Casual\nUSER_TEXT: Oh I see!\n\nWell sure thing, we can"},{role:o.ChatMessageRole.Assistant,content:"OK:[ help you out with that!]END_INSERTION"},{role:o.ChatMessageRole.User,content:"ROLE: Storyteller\nUSER_TEXT: Sir Digby Chicken Caesar, also know^^^"},{role:o.ChatMessageRole.Assistant,content:"OK:[n as NEED_INFO]END_INSERTION"},{role:o.ChatMessageRole.User,content:"ROLE: Customer support agent\nUSER_TEXT: Goodbye for now.^^^"},{role:o.ChatMessageRole.Assistant,content:"NO_PREDICTION END_INSERTION"},{role:o.ChatMessageRole.User,content:"ROLE: Pirate\nUSER_TEXT: Have you found^^^"},{role:o.ChatMessageRole.Assistant,content:"OK:[ the treasure, me hearties?]END_INSERTION"},{role:o.ChatMessageRole.User,content:"ROLE: "+this.userRole+"\nUSER_TEXT: "+t+"^^^"+e}],temperature:0,maxTokens:400,stopSequences:["END_INSERTION","NEED_INFO"],frequencyPenalty:0,presencePenalty:0}},L.prototype.requestSuggestionAsync=function(){return Tn(this,void 0,void 0,function(){var e,i,s,n,a;return Pn(this,function(t){switch(t.label){case 0:return this.pendingSuggestionAbort?(this.pendingSuggestionAbort.abort(),[2]):(this.pendingSuggestionAbort=new AbortController,e={textAreaValue:this.textArea.value,cursorPosition:this.textArea.selectionStart},i={textBefore:e.textAreaValue.substring(0,e.cursorPosition),textAfter:e.textAreaValue.substring(e.cursorPosition)},n=this.createSuggestionPrompt(i.textBefore,i.textAfter),"function"!=typeof this.aiSuggestionHandler?[3,2]:[4,this.aiSuggestionHandler(n)]);case 1:n=t.sent(),s=this.validateSuggestion(n,i.textBefore),t.label=2;case 2:if(s&&e.textAreaValue===this.textArea.value&&e.cursorPosition===this.textArea.selectionStart){if(s.endsWith(" ")||(s+=" "),a={text:s,cancel:!1},this.trigger("beforeSuggestionInsert",a),a.cancel)return[2];this.suggestionDisplay.show(a.text)}return[2]}})})},L.prototype.validateSuggestion=function(t,e){var i;return"string"!=typeof t||t.length<=5||0!==t.indexOf("OK:[")?"":(i=(t=0<(i=this.indexOfAny(t,[".","?","!"]))&&t.length>i+1&&" "===t[i+1]?t.substring(0,i+1):t).substring(4).replace(/[\]\s]+$/,""),0<e.length&&" "===e[e.length-1]?i.replace(/^\s+/,""):i)},L.prototype.indexOfAny=function(t,e){for(var i=0;i<t.length;i++)if(-1!==e.indexOf(t[""+i]))return i;return-1},L.prototype.getModuleName=function(){return"smarttextarea"},L.prototype.destroy=function(){xn.prototype.destroy.call(this),this.textArea=null,this.suggestionDisplay=null,this.typingDebounceTimeout=null},Sn([E.Event()],L.prototype,"beforeSuggestionInsert",void 0),Sn([E.Event()],L.prototype,"afterSuggestionInsert",void 0),Sn([E.Property("")],L.prototype,"userRole",void 0),Sn([E.Property([])],L.prototype,"UserPhrases",void 0),Sn([E.Property()],L.prototype,"aiSuggestionHandler",void 0),Sn([E.Property("None")],L.prototype,"showSuggestionOnPopup",void 0),L);function L(t,e){return xn.call(this,t,e)||this}Object.defineProperty(Ln.prototype,"value",{get:function(){var t=this.originalValueProperty.get.call(this.textArea);return this.isShowing()?t.substring(0,this.suggestionStartPos)+t.substring(this.suggestionEndPos):t},set:function(t){this.originalValueProperty.set.call(this.textArea,t)},enumerable:!0,configurable:!0}),Ln.prototype.getOriginalValueProperty=function(t,e){for(;t;){var i=Object.getOwnPropertyDescriptor(t,e);if(i)return i;t=Object.getPrototypeOf(t)}throw new Error("Property "+e+" not found on object or its prototype chain")},Object.defineProperty(Ln.prototype,"valueIncludingSuggestion",{get:function(){return this.originalValueProperty.get.call(this.textArea)},set:function(t){this.originalValueProperty.set.call(this.textArea,t)},enumerable:!0,configurable:!0}),Ln.prototype.isShowing=function(){return null!==this.suggestionStartPos},Ln.prototype.show=function(t){this.latestSuggestionText=t,this.suggestionStartPos=this.textArea.selectionStart,this.suggestionEndPos=this.suggestionStartPos+t.length,this.textArea.setAttribute("data-suggestion-visible",""),this.valueIncludingSuggestion=this.valueIncludingSuggestion.substring(0,this.suggestionStartPos)+t+this.valueIncludingSuggestion.substring(this.suggestionStartPos),this.textArea.setSelectionRange(this.suggestionStartPos,this.suggestionEndPos),this.virtualCaret||(this.virtualCaret=new Nn(this.owner,this.textArea)),this.virtualCaret.show()},Object.defineProperty(Ln.prototype,"currentSuggestion",{get:function(){return this.latestSuggestionText},enumerable:!0,configurable:!0}),Ln.prototype.accept=function(){var t=this.currentSuggestion;this.textArea.setSelectionRange(this.suggestionEndPos,this.suggestionEndPos),this.suggestionStartPos=null,this.suggestionEndPos=null,this.virtualCaret&&this.virtualCaret.hide(),this.textArea.removeAttribute("data-suggestion-visible"),bn.adjustScrollToCaretPosition(this.textArea),this.smartTextArea.trigger("afterSuggestionInsert",{insertedText:t})},Ln.prototype.reject=function(){var t,e;this.isShowing()&&(t=this.textArea.selectionStart,e=this.textArea.selectionEnd,this.valueIncludingSuggestion=this.valueIncludingSuggestion.substring(0,this.suggestionStartPos)+this.valueIncludingSuggestion.substring(this.suggestionEndPos),this.suggestionStartPos===t&&this.suggestionEndPos===e&&this.textArea.setSelectionRange(t,t),this.suggestionStartPos=null,this.suggestionEndPos=null,this.textArea.removeAttribute("data-suggestion-visible"),this.virtualCaret)&&this.virtualCaret.hide()};var wn=Ln;function Ln(t,e,i){this.smartTextArea=t,this.owner=e,this.textArea=i,this.latestSuggestionText="",this.suggestionStartPos=null,this.suggestionEndPos=null,this.virtualCaret=null,this.originalValueProperty=this.getOriginalValueProperty(i,"value")}Object.defineProperty(An.prototype,"currentSuggestion",{get:function(){return this.latestSuggestionText},enumerable:!0,configurable:!0}),An.prototype.show=function(t){this.latestSuggestionText=t,this.suggestionPrefixElement.textContent=" "!==t[0]?this.getPrefixText(this.textArea,20):"",this.suggestionTextElement.textContent=t;var t=bn.getTextAreaPosition(this.textArea),e=this.suggestionElement.style,t=(e.minWidth=null,this.suggestionElement.classList.add("smart-textarea-suggestion-overlay-visible"),e.zIndex=this.textArea.style.zIndex+1,e.top=t.top+"px",t.left-this.suggestionPrefixElement.offsetWidth),t=((!e.left||10<Math.abs(parseFloat(e.left)-t))&&(e.left=t+"px"),this.showing=!0,window.getComputedStyle(this.suggestionElement)),i=parseFloat(t.lineHeight),s=parseFloat(t.paddingTop),t=parseFloat(t.paddingBottom),s=Math.round((this.suggestionElement.offsetHeight-s-t)/i),i=(2<s&&(t=this.suggestionElement.offsetWidth,e.minWidth="calc(min(70vw, "+s*t/2+"px))"),this.suggestionElement.getBoundingClientRect());i.right>document.body.clientWidth-20&&(e.left="calc("+(parseFloat(e.left)-(i.right-document.body.clientWidth))+"px - 2rem)")},An.prototype.accept=function(){var t;this.showing&&(t=this.currentSuggestion,bn.insertCharacter(this.textArea,t),bn.adjustScrollToCaretPosition(this.textArea),this.hide(),this.smartTextArea.trigger("afterSuggestionInsert",{insertedText:t}))},An.prototype.reject=function(){this.hide()},An.prototype.hide=function(){this.showing&&(this.showing=!1,this.suggestionElement.classList.remove("smart-textarea-suggestion-overlay-visible"))},An.prototype.isShowing=function(){return this.showing},An.prototype.handleSuggestionClicked=function(t){t.preventDefault(),t.stopImmediatePropagation(),this.accept()},An.prototype.getPrefixText=function(t,e){for(var i=t.value,s=t.selectionStart,n=s-1;s-e<n;n--)if(n<0||/\s/.test(i[""+n]))return i.substring(n+1,s);return""};var kn=An;function An(t,e,i){var s=this,t=(this.latestSuggestionText="",this.showing=!1,this.smartTextArea=t,this.textArea=i,this.suggestionElement=document.createElement("div"),this.suggestionElement.classList.add("smart-textarea-suggestion-overlay"),this.suggestionElement.addEventListener("mousedown",function(t){return s.handleSuggestionClicked(t)}),this.suggestionElement.addEventListener("touchend",function(t){return s.handleSuggestionClicked(t)}),this.suggestionPrefixElement=document.createElement("span"),this.suggestionTextElement=document.createElement("span"),this.suggestionElement.appendChild(this.suggestionPrefixElement),this.suggestionElement.appendChild(this.suggestionTextElement),this.suggestionPrefixElement.style.opacity="0.3",window.getComputedStyle(this.textArea));this.suggestionElement.style.font=t.font,this.suggestionElement.style.marginTop=1.4*parseFloat(t.fontSize)+"px",e.appendChild(this.suggestionElement)}Hn.prototype.show=function(){var t=bn.getTextAreaPosition(this.textArea),e=this.caretDiv.style;e.display="block",e.top=t.top+"px",e.left=t.left+"px",e.height=t.height+"px",e.zIndex=this.textArea.style.zIndex,e.backgroundColor=t.elemStyle.caretColor},Hn.prototype.hide=function(){this.caretDiv.style.display="none"};var Nn=Hn;function Hn(t,e){this.textArea=e,this.caretDiv=document.createElement("div"),this.caretDiv.classList.add("smart-textarea-caret"),t.appendChild(this.caretDiv)}Bn=function(t,e){return(Bn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Bn,Rn,O=function(t,e){function i(){this.constructor=t}Bn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},Sn=(Rn=E.Component,O(k,Rn),k.prototype.initialize=function(t,e){this.clearArray=[],this.element=t,this.canvasContext=this.element.getContext("2d"),this.canvasContext.canvas.tabIndex=-1,e&&(this.dotnetRef=e,this.isBlazor=!0,this.signatureValue)&&this.loadPersistedSignature(),this.setHTMLProperties(),E.isNullOrUndefined(this.signatureValue)&&this.updateSnapCollection(!0),this.wireEvents(),this.isBlazor||this.trigger("created",null)},k.prototype.wireEvents=function(){!E.isNullOrUndefined(this.pointColl)||this.isReadOnly||this.disabled?this.pointColl&&(E.EventHandler.add(this.canvasContext.canvas,"mousemove touchmove",this.mouseMoveHandler,this),E.EventHandler.add(this.canvasContext.canvas,"mouseup touchend",this.mouseUpHandler,this),E.EventHandler.add(document,"mouseup",this.mouseUpHandler,this)):(E.EventHandler.add(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler,this),E.EventHandler.add(this.canvasContext.canvas,"keydown",this.keyboardHandler,this),this.boundResizeHandler=this.resizeHandler.bind(this),window.addEventListener("resize",this.boundResizeHandler))},k.prototype.unwireEvents=function(t){"mouseup"===t||"touchend"===t?(this.canvasContext&&(E.EventHandler.remove(this.canvasContext.canvas,"mousemove touchmove",this.mouseMoveHandler),E.EventHandler.remove(this.canvasContext.canvas,"mouseup touchend",this.mouseUpHandler)),E.EventHandler.remove(document,"mouseup",this.mouseUpHandler)):(this.canvasContext&&(E.EventHandler.remove(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler),E.EventHandler.remove(this.canvasContext.canvas,"keydown",this.keyboardHandler)),this.boundResizeHandler&&(window.removeEventListener("resize",this.boundResizeHandler),this.boundResizeHandler=null))},k.prototype.setHTMLProperties=function(){150===this.element.height&&300===this.element.width&&0!==this.element.offsetHeight&&0!==this.element.offsetWidth?(this.element.height=this.element.offsetHeight,this.element.width=this.element.offsetWidth,this.isResponsive=!0):this.element.height===this.element.offsetHeight-1&&this.element.width===this.element.offsetWidth-1||0===this.element.offsetHeight||0===this.element.offsetWidth||(this.element.height=this.element.offsetHeight,this.element.width=this.element.offsetWidth),this.canvasContext.fillStyle=this.strokeColor,this.tempCanvas=this.createElement("canvas",{className:"e-"+this.getModuleName()+"-temp"}),this.tempContext=this.tempCanvas.getContext("2d"),this.tempCanvas.width=this.element.width,this.tempCanvas.height=this.element.height,this.backgroundImage?(this.canvasContext.canvas.style.backgroundImage="url("+this.backgroundImage+")",this.canvasContext.canvas.style.backgroundRepeat="no-repeat",this.saveWithBackground&&this.setBackgroundImage(this.backgroundImage,"temp")):this.backgroundColor&&(this.canvasContext.canvas.style.backgroundColor=this.backgroundColor)},k.prototype.mouseDownHandler=function(t){1!==t.buttons&&2!==t.buttons&&"touchstart"!==t.type||("touchstart"===t.type&&(t.preventDefault(),t.stopPropagation()),this.beginStroke(t),this.wireEvents())},k.prototype.mouseMoveHandler=function(t){1!==t.buttons&&2!==t.buttons&&"touchmove"!==t.type||("touchmove"===t.type&&(t.preventDefault(),t.stopPropagation()),this.interval?this.updateStrokeWithThrottle(t):this.updateStroke(t))},k.prototype.mouseUpHandler=function(t){"touchstart"===t.type&&(t.preventDefault(),t.stopPropagation()),this.endDraw(),this.updateSnapCollection(),this.unwireEvents(t.type),this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","mouseUp"):this.trigger("change",{actionName:"strokeUpdate"}),this.signatureValue=this.snapColl[this.incStep];for(var e=0;e<this.signPointsColl.length;e++)this.signRatioPointsColl.push({x:this.signPointsColl[e].x/this.canvasContext.canvas.width,y:this.signPointsColl[e].y/this.canvasContext.canvas.height});this.signPointsColl=[]},k.prototype.keyboardHandler=function(t){var e=this,i={fileName:"Signature",type:"Png",cancel:!1};switch(t.key){case"Delete":this.clear();break;case t.ctrlKey&&"s":this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","beforeSave"):this.trigger("beforeSave",i,function(t){i.cancel||e.save(t.type,t.fileName)}),t.preventDefault(),t.stopImmediatePropagation();break;case t.ctrlKey&&"z":this.undo();break;case t.ctrlKey&&"y":this.redo()}},k.prototype.resizeHandler=function(){var t,e=this;if(this.isResponsive&&this.canRedraw&&this.canvasContext&&this.element){this.canvasContext.canvas.width=this.element.offsetWidth,this.canvasContext.canvas.height=this.element.offsetHeight,this.canvasContext.scale(1,1),this.canvasContext.fillStyle=this.strokeColor;for(var i=(this.minStrokeWidth+this.maxStrokeWidth)/2,s=0;s<this.signRatioPointsColl.length;s++)this.arcDraw(this.signRatioPointsColl[s].x*this.canvasContext.canvas.width,this.signRatioPointsColl[s].y*this.canvasContext.canvas.height,i);this.signPointsColl=[],this.canvasContext.closePath(),this.canvasContext.fill()}else this.canvasContext&&this.element&&((t=new Image).src=this.snapColl[this.incStep],t.onload=function(){e.canvasContext.clearRect(0,0,e.element.width,e.element.height),e.canvasContext.drawImage(t,0,0,e.element.width,e.element.height)})},k.prototype.beginStroke=function(t){this.internalRefresh(),this.updateStroke(t)},k.prototype.updateStroke=function(t){t=this.createPoint(t);this.addPoint(t)},k.prototype.updateStrokeWithThrottle=function(t){var e=Date.now(),i=this.interval-(e-this.previous);this.storedArgs=t,i<=0||i>this.interval?(this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.previous=e,this.updateStroke(this.storedArgs),this.timeout||(this.storedArgs=null)):this.timeout||(this.timeout=window.setTimeout(this.delay.bind(this),i))},k.prototype.delay=function(){this.previous=Date.now(),this.timeout=null,this.updateStroke(this.storedArgs),this.timeout||(this.storedArgs=null)},k.prototype.createPoint=function(t){var e=this.canvasContext.canvas.getBoundingClientRect();return"mousedown"===t.type||"mousemove"===t.type?this.point(t.clientX-e.left,t.clientY-e.top,(new Date).getTime()):this.point(t.touches[0].clientX-e.left,t.touches[0].clientY-e.top,(new Date).getTime())},k.prototype.point=function(t,e,i){return this.pointX=t,this.pointY=e,this.time=i||(new Date).getTime(),{x:this.pointX,y:this.pointY,time:this.time}},k.prototype.addPoint=function(t){var e=this.pointColl,i=0<e.length&&e[e.length-1],s=!!i&&this.distanceTo(i)<=this.minDistance;i&&s||(e.push(t),2<e.length&&(3===e.length&&e.unshift(e[0]),i=this.calculateCurveControlPoints(e[0],e[1],e[2]).controlPoint2,s=this.calculateCurveControlPoints(e[1],e[2],e[3]).controlPoint1,this.startPoint=e[1],this.controlPoint1=i,this.controlPoint2=s,this.endPoint=e[2],this.startDraw(),e.shift()))},k.prototype.startDraw=function(){var t=this.pointVelocityCalc(this.startPoint),e=(t=this.velocity*t+(1-this.velocity)*this.lastVelocity,Math.max(this.maxStrokeWidth/(1+t),this.minStrokeWidth));this.curveDraw(this.lastWidth,e),this.lastVelocity=t,this.lastWidth=e},k.prototype.endDraw=function(){var t,e;E.isNullOrUndefined(this.pointColl)||(t=2<this.pointColl.length,e=this.pointColl[0],!t&&e&&this.strokeDraw(e))},k.prototype.curveDraw=function(t,e){var i,s,n,a,l,r,o,h,p=this.canvasContext,d=e-t,e=this.bezierLengthCalc(),u=2*Math.ceil(e);for(p.beginPath(),i=0;i<u;i++)o=(h=(r=(l=1-(s=i/u))*l)*l)*this.startPoint.x,o=(o=(o+=3*r*s*this.controlPoint1.x)+3*l*(n=s*s)*this.controlPoint2.x)+(a=n*s)*this.endPoint.x,h=h*this.startPoint.y,h=(h=(h+=3*r*s*this.controlPoint1.y)+3*l*n*this.controlPoint2.y)+a*this.endPoint.y,r=Math.min(t+a*d,this.maxStrokeWidth),this.arcDraw(o,h,r);p.closePath(),p.fill(),this.isSignatureEmpty=!1},k.prototype.strokeDraw=function(t){var e=this.canvasContext,i=(this.minStrokeWidth+this.maxStrokeWidth)/2;e.beginPath(),this.arcDraw(t.x,t.y,i),e.closePath(),e.fill(),this.isSignatureEmpty=!1},k.prototype.arcDraw=function(t,e,i){this.signPointsColl.push({x:t,y:e});var s=this.canvasContext;s.moveTo(t,e),s.arc(t,e,i,0,2*Math.PI,!1)},k.prototype.calculateCurveControlPoints=function(t,e,i){var s=t.x-e.x,n=t.y-e.y,a=e.x-i.x,l=e.y-i.y,r=(t.x+e.x)/2,t=(t.y+e.y)/2,o=(e.x+i.x)/2,i=(e.y+i.y)/2,s=Math.sqrt(s*s+n*n),n=Math.sqrt(a*a+l*l),a=n/(s+n),l=o+(r-o)*a,s=i+(t-i)*a,n=e.x-l,a=e.y-s;return{controlPoint1:this.point(r+n,t+a,0),controlPoint2:this.point(o+n,i+a,0)}},k.prototype.bezierLengthCalc=function(){for(var t,e,i,s,n,a,l=0,r=0;r<=10;r++)t=this.bezierPointCalc(e=r/10,this.startPoint.x,this.controlPoint1.x,this.controlPoint2.x,this.endPoint.x),e=this.bezierPointCalc(e,this.startPoint.y,this.controlPoint1.y,this.controlPoint2.y,this.endPoint.y),0<r&&(n=t-i,a=e-s,l+=Math.sqrt(n*n+a*a)),i=t,s=e;return l},k.prototype.bezierPointCalc=function(t,e,i,s,n){return e*(1-t)*(1-t)*(1-t)+3*i*(1-t)*(1-t)*t+3*s*(1-t)*t*t+n*t*t*t},k.prototype.pointVelocityCalc=function(t){return this.time!==t.time?this.distanceTo(t)/(this.time-t.time):0},k.prototype.distanceTo=function(t){return Math.sqrt(Math.pow(this.pointX-t.x,2)+Math.pow(this.pointY-t.y,2))},k.prototype.isRead=function(t){t?E.EventHandler.remove(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler):this.disabled||E.EventHandler.add(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler,this)},k.prototype.enableOrDisable=function(t){(this.disabled=t)?(this.canvasContext.canvas.style.filter="opacity(0.5)",this.isRead(!0)):(this.canvasContext.canvas.style.filter="",this.isRead(!1))},k.prototype.updateSnapCollection=function(t){var e,i;E.isNullOrUndefined(this.incStep)?(this.incStep=-1,this.incStep++,this.snapColl=[],this.clearArray=[]):this.incStep++,this.incStep<this.snapColl.length&&(this.snapColl.length=this.incStep),0<this.incStep?(i=(e=this.createElement("canvas",{className:"e-"+this.getModuleName()+"-wrapper"})).getContext("2d"),this.canvasContext&&(e.width=this.canvasContext.canvas.width,e.height=this.canvasContext.canvas.height,i.drawImage(this.canvasContext.canvas,0,0,e.width,e.height),this.snapColl.push(e.toDataURL()))):this.snapColl.push(this.canvasContext.canvas.toDataURL()),t&&this.clearArray.push(this.incStep)},k.prototype.setBackgroundImage=function(t,e){var i=this,s=new Image;s.crossOrigin="anonymous",s.src=t,"temp"===e?s.onload=function(){i.tempContext.globalCompositeOperation="source-over",i.tempContext.drawImage(s,0,0,i.element.width,i.element.height)}:(s.onload=function(){i.canvasContext.globalCompositeOperation="source-over",i.canvasContext.drawImage(s,0,0,i.element.width,i.element.height),i.updateSnapCollection(),i.saveBackground(!0)},this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height))},k.prototype.setBackgroundColor=function(t){var e,i,s=this.canvasContext;for(s.strokeStyle=t,e=1;e<=s.canvas.width;e++)for(i=1;i<=s.canvas.height;i++)s.strokeRect(0,0,e,i);this.updateSnapCollection()},k.prototype.loadPersistedSignature=function(){var t,e;E.isNullOrUndefined(this.signatureValue)||(t=this,(e=new Image).src=this.signatureValue,e.onload=function(){t.canvasContext.clearRect(0,0,t.element.width,t.element.height),t.canvasContext.drawImage(e,0,0),t.updateSnapCollection()},this.isSignatureEmpty=!1)},k.prototype.getBlob=function(t){for(var t=t.split(","),e=t[0].match(/:(.*?);/)[1],i=atob(t[1]),s=i.length,n=new Uint8Array(s);s--;)n[s]=i.charCodeAt(s);return new Blob([n],{type:e})},k.prototype.download=function(t,e){var t=URL.createObjectURL(t),i=document.createElement("a");i.href=t,i.target="_parent",i.download=e,(document.body||document.documentElement).appendChild(i),i.click(),i.parentNode.removeChild(i)},k.prototype.internalRefresh=function(){this.pointColl=[],this.lastVelocity=0,this.lastWidth=(this.minStrokeWidth+this.maxStrokeWidth)/2},k.prototype.refresh=function(){this.isResponsive=!1,this.setHTMLProperties(),this.resizeHandler(),this.internalRefresh()},k.prototype.clear=function(){this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height),this.tempContext.clearRect(0,0,this.tempContext.canvas.width,this.tempContext.canvas.height),this.saveWithBackground&&this.backgroundImage&&this.setBackgroundImage(this.backgroundImage,"temp"),this.internalRefresh(),this.signRatioPointsColl=[],this.updateSnapCollection(!0),this.isSignatureEmpty=this.canRedraw=!0,this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","Clear"):this.trigger("change",{actionName:"clear"})},k.prototype.undo=function(){var t,e=this;0<this.incStep&&(this.incStep--,(t=new Image).src=this.snapColl[this.incStep],t.onload=function(){e.canvasContext.clearRect(0,0,e.element.width,e.element.height),e.canvasContext.drawImage(t,0,0,e.element.width,e.element.height)}),this.isClear(),this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","Undo"):this.trigger("change",{actionName:"undo"})},k.prototype.redo=function(){var t,e=this;this.incStep<this.snapColl.length-1&&(this.incStep++,(t=new Image).src=this.snapColl[this.incStep],t.onload=function(){e.canvasContext.clearRect(0,0,e.element.width,e.element.height),e.canvasContext.drawImage(t,0,0,e.element.width,e.element.height)}),this.isClear(),this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","Redo"):this.trigger("change",{actionName:"redo"})},k.prototype.isClear=function(){if(this.clearArray){for(var t=!1,e=0;e<this.clearArray.length;e++)this.clearArray[e]===this.incStep&&(t=this.isSignatureEmpty=!0);t||(this.isSignatureEmpty=!1)}},k.prototype.isEmpty=function(){return this.isSignatureEmpty},k.prototype.canUndo=function(){return 0<this.incStep},k.prototype.canRedo=function(){return this.incStep<this.snapColl.length-1},k.prototype.draw=function(t,e,i,s,n){this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height),this.canvasContext.font=(i=i||30)+"px "+(e=e||"Arial");var e=this.element.width/2,a=this.element.height/2;E.isNullOrUndefined(s)&&E.isNullOrUndefined(n)?(this.canvasContext.textAlign="center",this.canvasContext.textBaseline="middle"):(e=E.isNullOrUndefined(s)?e:s,a=E.isNullOrUndefined(n)?a+i/2:n+i/2),this.canvasContext.fillText(t,e,a),this.updateSnapCollection(),this.isSignatureEmpty=!1,this.trigger("change",{actionName:"draw-text"})},k.prototype.load=function(i,s,n){n=n||this.element.height,s=s||this.element.width,this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height);var a=this,t=new Image;"data"!==(t.src=i).slice(0,4)&&(t.crossOrigin="anonymous"),t.onload=function(){Promise.all([createImageBitmap(t,0,0,s,n)]).then(function(t){var e=document.createElement("canvas");e.width=s,e.height=n,e.getContext("2d").drawImage(t[0],0,0),"data"!==i.slice(0,4)&&(a.canvasContext.globalCompositeOperation="source-over"),a.canvasContext.drawImage(e,0,0,s,n,0,0,a.element.width,a.element.height),a.updateSnapCollection()})},this.isSignatureEmpty=this.canRedraw=!1},k.prototype.saveBackground=function(t){var e,i,s=t&&this.backgroundImage?this.snapColl[this.incStep-1]:this.snapColl[this.incStep];t||(this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height),this.backgroundImage?this.setBackgroundImage(this.backgroundImage):this.backgroundColor&&(this.setBackgroundColor(this.backgroundColor),t=!0)),t&&(e=this,(i=new Image).crossOrigin="anonymous",i.src=s,i.onload=function(){e.backgroundLoaded=!0,e.canvasContext.globalCompositeOperation="source-over",e.canvasContext.drawImage(i,0,0,e.element.width,e.element.height),e.save(e.fileType,e.fileName)})},k.prototype.save=function(t,e){var i;this.saveWithBackground&&null==this.backgroundLoaded&&(this.backgroundImage||this.backgroundColor)?(this.backgroundLoaded=!1,this.fileType=t,this.fileName=e,this.saveBackground(!1)):"Svg"===t?this.toSVG(e=e||"Signature"):"Jpeg"===t?(e=e||"Signature",!this.saveWithBackground||this.saveWithBackground&&!this.backgroundImage&&!this.backgroundColor?this.toJPEG(e):(i=this.canvasContext.canvas.toDataURL("image/jpeg"),this.download(this.getBlob(i),e+".jpeg"))):(e=e||"Signature",i=this.canvasContext.canvas.toDataURL("image/png"),this.download(this.getBlob(i),e+".png")),this.saveWithBackground&&this.backgroundLoaded&&this.resetSnap()},k.prototype.resetSnap=function(){this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height);var t=this,e=new Image;e.src=this.snapColl[this.incStep-1],e.onload=function(){t.canvasContext.drawImage(e,0,0,t.element.width,t.element.height),t.updateSnapCollection()},this.backgroundLoaded=null,this.snapColl.pop(),this.incStep--,this.snapColl.pop(),this.incStep--},k.prototype.toJPEG=function(e){var i=this,t=this.snapColl[this.incStep],s=(this.setBackgroundColor("#ffffff"),this),n=new Image;n.crossOrigin="anonymous",n.src=t,n.onload=function(){s.canvasContext.globalCompositeOperation="source-over",s.canvasContext.drawImage(n,0,0,s.element.width,s.element.height);var t=s.canvasContext.canvas.toDataURL("image/jpeg");s.download(s.getBlob(t),e+".jpeg"),s.canvasContext.clearRect(0,0,s.canvasContext.canvas.width,s.canvasContext.canvas.height),i.resizeHandler()},this.snapColl.pop(),this.incStep--},k.prototype.toSVG=function(t,e){var i=document.createElementNS("http://www.w3.org/2000/svg","svg"),s=(i.setAttribute("width",this.canvasContext.canvas.width.toString()),i.setAttribute("height",this.canvasContext.canvas.height.toString()),document.createElementNS("http://www.w3.org/2000/svg","image")),e=(s.setAttributeNS(null,"height",this.canvasContext.canvas.height.toString()),s.setAttributeNS(null,"width",this.canvasContext.canvas.width.toString()),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e),i.appendChild(s),'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+this.canvasContext.canvas.width+'" height="'+this.canvasContext.canvas.height+'">'),s=i.innerHTML,i="data:image/svg+xml;base64,"+btoa(e+s+"</svg>");return null==t?i:(this.download(this.getBlob(i),t+".svg"),null)},k.prototype.saveAsBlob=function(){return this.getBlob(this.canvasContext.canvas.toDataURL("image/png"))},k.prototype.getSignature=function(t){return this.saveWithBackground&&this.backgroundColor&&!this.backgroundImage?(this.tempContext.fillStyle=this.backgroundColor,this.tempContext.fillRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height)):this.backgroundColor||this.backgroundImage||"Jpeg"!==t||(this.tempContext.fillStyle="#fff",this.tempContext.fillRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height)),this.tempContext.drawImage(this.element,0,0),"Jpeg"===t?this.tempCanvas.toDataURL("image/jpeg"):"Svg"===t?this.toSVG(null,this.tempCanvas.toDataURL("image/png")):this.tempCanvas.toDataURL("image/png")},k.prototype.getModuleName=function(){return"signature"},k.prototype.getPersistData=function(){return this.signatureValue=this.snapColl[this.incStep],this.addOnPersist(["signatureValue"])},k.prototype.destroy=function(){"image-editor"!==this.getModuleName()&&(this.unwireEvents(null),E.removeClass([this.element],"e-"+this.getModuleName()),this.element.removeAttribute("tabindex"),this.pointColl=null,this.tempContext=null,this.tempCanvas=null,this.canvasContext=null),Rn.prototype.destroy.call(this),this.element=null},k.prototype.propertyChanged=function(t,e){var i=this.canvasContext;switch(t){case"backgroundColor":i.canvas.style.backgroundColor=e,this.backgroundColor=e;break;case"backgroundImage":i.canvas.style.backgroundImage="url("+e+")",this.backgroundImage=e,this.saveWithBackground&&this.setBackgroundImage(this.backgroundImage,"temp");break;case"strokeColor":i.fillStyle=e,this.strokeColor=e;break;case"saveWithBackground":this.saveWithBackground=e;break;case"maxStrokeWidth":this.maxStrokeWidth=e;break;case"minStrokeWidth":this.minStrokeWidth=e;break;case"velocity":this.velocity=e;break;case"isReadOnly":this.isRead(e);break;case"disabled":this.enableOrDisable(e)}},k);function k(){var t=null!==Rn&&Rn.apply(this,arguments)||this;return t.minDistance=5,t.previous=0,t.interval=30,t.timeout=null,t.isSignatureEmpty=!0,t.backgroundLoaded=null,t.isBlazor=!1,t.isResponsive=!1,t.signPointsColl=[],t.signRatioPointsColl=[],t.canRedraw=!0,t}Un=function(t,e){return(Un=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Un,A,O=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},O=(function(t,e){function i(){this.constructor=t}Un(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(N,A=Sn),N.prototype.preRender=function(){},N.prototype.render=function(){this.initialize()},N.prototype.initialize=function(){this.element.setAttribute("role","img"),this.element.setAttribute("aria-label","signature"),E.addClass([this.element],"e-"+this.getModuleName()),A.prototype.initialize.call(this,this.element),this.enablePersistence&&this.loadPersistedSignature()},N.prototype.getModuleName=function(){return A.prototype.getModuleName.call(this)},N.prototype.getPersistData=function(){return A.prototype.getPersistData.call(this)},N.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i];switch(n){case"backgroundColor":A.prototype.propertyChanged.call(this,n,t.backgroundColor);break;case"backgroundImage":A.prototype.propertyChanged.call(this,n,t.backgroundImage);break;case"strokeColor":t.strokeColor!==e.strokeColor&&A.prototype.propertyChanged.call(this,n,t.strokeColor);break;case"maxStrokeWidth":t.maxStrokeWidth!==e.maxStrokeWidth&&A.prototype.propertyChanged.call(this,n,t.maxStrokeWidth);break;case"minStrokeWidth":t.minStrokeWidth!==e.minStrokeWidth&&A.prototype.propertyChanged.call(this,n,t.minStrokeWidth);break;case"velocity":t.velocity!==e.velocity&&A.prototype.propertyChanged.call(this,n,t.velocity);break;case"saveWithBackground":A.prototype.propertyChanged.call(this,n,t.saveWithBackground);break;case"isReadOnly":A.prototype.propertyChanged.call(this,n,t.isReadOnly);break;case"disabled":A.prototype.propertyChanged.call(this,n,t.disabled)}}},O([E.Property("")],N.prototype,"backgroundColor",void 0),O([E.Property("")],N.prototype,"backgroundImage",void 0),O([E.Property(!1)],N.prototype,"disabled",void 0),O([E.Property(!1)],N.prototype,"isReadOnly",void 0),O([E.Property(!0)],N.prototype,"saveWithBackground",void 0),O([E.Property("#000000")],N.prototype,"strokeColor",void 0),O([E.Property(.5)],N.prototype,"minStrokeWidth",void 0),O([E.Property(2)],N.prototype,"maxStrokeWidth",void 0),O([E.Property(.7)],N.prototype,"velocity",void 0),O([E.Property("en-US")],N.prototype,"locale",void 0),O([E.Property(!1)],N.prototype,"enableRtl",void 0),O([E.Property(!1)],N.prototype,"enablePersistence",void 0),O([E.Event()],N.prototype,"beforeSave",void 0),O([E.Event()],N.prototype,"change",void 0),O([E.Event()],N.prototype,"created",void 0),O([E.NotifyPropertyChanges],N));function N(t,e){return A.call(this,t,e)||this}In=function(t,e){return(In=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var In,Fn,Vn=function(t,e){function i(){this.constructor=t}In(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},H=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},Mn="e-rating-icon e-icons e-star-filled",Dn="e-rating-item-list",Wn="e-rating-item-container",zn="e-rating-selected",qn="e-rating-intermediate",jn="e-rating-hidden",_n="e-disabled",Xn="e-rating-readonly",Kn="e-rating-animation",Yn="e-rating-full",Zn="e-rating-empty",Gn="e-selected-value",Jn=((Jn=o.LabelPosition||(o.LabelPosition={})).Top="Top",Jn.Bottom="Bottom",Jn.Left="Left",Jn.Right="Right",(Jn=o.PrecisionType||(o.PrecisionType={})).Full="Full",Jn.Half="Half",Jn.Quarter="Quarter",Jn.Exact="Exact",Fn=E.Component,Vn(B,Fn),B.prototype.preRender=function(){this.element.id||(this.element.id=E.getUniqueID("e-"+this.getModuleName())),this.keyConfigs={downarrow:"downarrow",leftarrow:"leftarrow",rightarrow:"rightarrow",uparrow:"uparrow",space:"space"},this.tooltipOpen=!1,this.isTouchSelected=!1,E.closest(this.element,"form")&&this.element.getAttribute("value")&&this.setProperties({value:this.element.getAttribute("value")},!0)},B.prototype.render=function(){this.initialize(),this.updateMinValue(),this.updateTemplateFunction(),this.triggerChange(null,this.value,!1,!0),this.renderItems(),this.displayLabel()},B.prototype.initialize=function(){this.wrapper=this.createElement("div",{className:"e-"+this.getModuleName()+"-container "}),this.element.parentNode.insertBefore(this.wrapper,this.element),this.wrapper.appendChild(this.element),null==this.element.getAttribute("name")&&this.element.setAttribute("name",this.element.id),E.attributes(this.element,{"aria-label":"rating"}),this.renderItemList(),this.updateReset(),this.readOnly&&this.wrapper.classList.add(Xn),this.visible||this.wrapper.classList.add(jn),this.enableRtl&&this.wrapper.classList.add("e-rtl"),this.enableAnimation&&this.wrapper.classList.add(Kn),this.cssClass&&E.addClass([this.wrapper],this.cssClass.split(" ")),this.updateTooltip(),this.wireKeyboardEvent(),this.updateDisabled()},B.prototype.updateDisabled=function(){this.wrapper.classList[this.disabled?"add":"remove"](_n),E.attributes(this.ratingItemList,{tabindex:this.disabled?"-1":"0"}),this.updateResetButton()},B.prototype.updateResetButton=function(){var t;this.allowReset&&(this.resetElement&&this.resetElement.blur(),t=this.value<=this.min||this.disabled,this.resetElement.classList[t?"add":"remove"](_n),E.attributes(this.resetElement,{tabindex:t?"-1":"0","aria-hidden":t.toString()}))},B.prototype.renderItemList=function(){var e=this;this.ratingItemList=this.createElement("div",{className:Dn,id:this.element.id+"_item-list"}),E.attributes(this.ratingItemList,{"aria-label":"rating",role:"slider"}),this.wrapper.appendChild(this.ratingItemList),E.EventHandler.add(this.ratingItemList,"touchmove",function(t){return e.touchMoveHandler(t)},this),E.EventHandler.add(this.ratingItemList,E.Browser.touchEndEvent,this.touchEndHandler,this)},B.prototype.touchMoveHandler=function(t){this.isTouchSelected||(this.wrapper.classList.add("e-rating-touch"),this.isTouchSelected=!0),this.wrapper.classList.add("e-touch-select");var e,i=this.ratingItemList.getBoundingClientRect(),i=(t.touches[0].clientX-i.x)/i.width*this.itemsCount,s=(i=(i=this.enableRtl?this.itemsCount-i:i)<this.min?this.min:i>this.itemsCount?this.itemsCount:i,0===(i=this.validateValue(i))?null:this.itemElements[parseInt((Math.ceil(i)-1).toString(),10)]);i===this.currentValue?this.showTooltip&&s&&this.openRatingTooltip(s,!1):(e=this.currentValue,this.triggerChange(t,i),this.updateCurrentValue(i),this.showTooltip&&(s?(Math.ceil(i)!==Math.ceil(e)&&this.closeRatingTooltip(),this.openRatingTooltip(s,!0)):this.closeRatingTooltip()))},B.prototype.touchEndHandler=function(){this.closeRatingTooltip(),this.wrapper.classList.remove("e-touch-select")},B.prototype.updateTemplateFunction=function(){this.emptyTemplateFunction=this.emptyTemplate?this.getTemplateString(this.emptyTemplate):null,this.fullTemplateFunction=this.fullTemplate?this.getTemplateString(this.fullTemplate):null},B.prototype.renderItems=function(){for(var e=this,t=0;t<this.itemsCount;t++){var i=this.createElement("span",{className:Wn}),s=this.createElement("span",{className:"e-rating-item"}),n=this.getRatingValue(this.value,t),n=(this.renderItemContent(s,n,t,!1),i.appendChild(s),this.wireItemsEvents(i,t+1),this.itemElements.push(i),{element:i,value:t+1});this.trigger("beforeItemRender",n,function(t){e.ratingItemList.appendChild(t.element)})}E.attributes(this.ratingItemList,{"aria-valuemax":this.itemsCount.toString()}),this.updateItemValue(!1)},B.prototype.renderItemContent=function(t,e,i,s){s&&this.removeItemContent(t),this.fullTemplate&&1===e?(t.classList.add(Yn),E.append(this.fullTemplateFunction({index:i,ratingValue:e},this,"ratingFullTemplate",this.element.id+"fullTemplate",this.isStringTemplate),t)):this.emptyTemplate?(t.classList.add(Zn),E.append(this.emptyTemplateFunction({index:i,ratingValue:e},this,"ratingEmptyTemplate",this.element.id+"emptyTemplate",this.isStringTemplate),t)):E.addClass([t],Mn.split(" "))},B.prototype.removeItemContent=function(t){t.classList.remove(Yn,Zn),E.removeClass([t],Mn.split(" ")),t.firstChild&&(t.innerHTML="")},B.prototype.updateTooltip=function(){this.showTooltip?(this.tooltipObj=new h.Tooltip({target:".e-rating-item-container",windowCollision:!0,opensOn:"Custom",cssClass:this.cssClass?"e-rating-tooltip "+this.cssClass:"e-rating-tooltip"}),this.tooltipObj.appendTo(this.ratingItemList)):E.isNullOrUndefined(this.tooltipObj)||(this.tooltipObj.destroy(),this.tooltipObj=null)},B.prototype.updateMinValue=function(){this.setProperties({min:this.validateValue(this.min)},!0),0<this.min&&this.value<this.min&&this.triggerChange(null,this.min,!1),E.attributes(this.ratingItemList,{"aria-valuemin":this.min.toString()})},B.prototype.validateValue=function(t){return t=t>this.itemsCount?this.itemsCount:t<0?0:this.precision===o.PrecisionType.Full||this.enableSingleSelection?Math.round(t):this.precision===o.PrecisionType.Half?Math.round(2*t)/2:this.precision===o.PrecisionType.Quarter?Math.round(4*t)/4:Math.round(10*t)/10},B.prototype.getRatingValue=function(t,e){return this.enableSingleSelection?e<t&&t<=e+1?1:0:e+1<=t?1:t<e?0:t-e},B.prototype.updateItemValue=function(t){void 0===t&&(t=!0);for(var e=0;e<this.itemsCount;e++){var i=this.itemElements[parseInt(e.toString(),10)],s=(i.classList.remove(zn,qn,Gn),this.getRatingValue(this.currentValue,e));1===s?i.classList.add(zn):0<s?i.classList.add(qn):this.precision===o.PrecisionType.Full&&e+1<=this.value&&!this.enableSingleSelection&&i.classList.add(Gn),t&&this.updateItemContent(s,e),i.style.setProperty("--rating-value",100*s+"%"),i.classList[0===this.value&&0===e||this.value===e+1||0<s&&s<1?"add":"remove"]("e-rating-focus")}t&&this.renderReactTemplates(),this.updateResetButton(),E.attributes(this.ratingItemList,{"aria-valuenow":this.currentValue.toString()}),E.attributes(this.element,{value:this.value.toString()})},B.prototype.updateItemContent=function(t,e){var i;(this.fullTemplate||this.emptyTemplate)&&(i=this.itemElements[parseInt(e.toString(),10)].querySelector(".e-rating-item"),this.fullTemplate&&1===t?i.classList.contains(Yn)||(this.removeItemContent(i),i.classList.add(Yn),E.append(this.fullTemplateFunction({ratingValue:t,index:e},this,"ratingFullTemplate",this.element.id+"fullTemplate"+e,this.isStringTemplate),i)):this.emptyTemplate?i.classList.contains(Zn)||(this.removeItemContent(i),i.classList.add(Zn),E.append(this.emptyTemplateFunction({ratingValue:t,index:e},this,"ratingEmptyTemplate",this.element.id+"emptyTemplate"+e,this.isStringTemplate),i)):(this.removeItemContent(i),E.addClass([i],Mn.split(" "))))},B.prototype.updateTooltipContent=function(t){var e,i,s=this;this.showTooltip&&(this.isReact&&this.clearTemplate(["ratingTooltipTemplate"]),this.tooltipTemplate?(e=this.createElement("span",{className:"e-rating-tooltip-content"}),i=this.getTemplateString(this.tooltipTemplate),E.append(i({value:this.currentValue},this,"ratingTooltipTemplate",this.element.id+"tooltipTemplate",this.isStringTemplate),e),this.tooltipObj.setProperties({content:e},t),this.isAngular&&setTimeout(function(){var t=s.ratingItemList.querySelectorAll("."+Wn+"."+zn);s.tooltipObj.refresh(t[t.length-1])})):(e=this.currentValue.toString(),this.tooltipObj.setProperties({content:E.initializeCSPTemplate(function(){return e})},t)),this.renderReactTemplates())},B.prototype.getTemplateString=function(e){var t,i="";try{i="function"!=typeof e&&(t=E.select(e))?"SCRIPT"===t.tagName?t.innerHTML:t.outerHTML:e}catch(t){i=e}return E.compile(i)},B.prototype.displayLabel=function(){this.showLabel?(this.spanLabel=this.createElement("span",{className:"e-rating-label"}),this.updateLabel(),this.updateLabelPosition()):this.wrapper.contains(this.spanLabel)&&(E.remove(this.spanLabel),this.spanLabel=null)},B.prototype.updateLabel=function(){var t;this.showLabel&&(this.labelTemplate?(this.isReact&&this.clearTemplate(["ratingLabelTemplate"]),this.spanLabel.firstChild&&(this.spanLabel.innerHTML=""),t=this.getTemplateString(this.labelTemplate),E.append(t({value:this.currentValue},this,"ratingLabelTemplate",this.element.id+"labelTemplate",this.isStringTemplate),this.spanLabel),this.renderReactTemplates()):this.spanLabel.textContent=this.currentValue+" / "+this.itemsCount)},B.prototype.updateReset=function(){this.allowReset?(this.resetElement=this.createElement("span",{className:"e-icons e-reset",attrs:{"aria-label":"resetbutton",role:"button"}}),this.updateResetButton(),E.EventHandler.add(this.resetElement,"click",this.resetClicked,this),this.wrapper.insertBefore(this.resetElement,this.ratingItemList)):this.wrapper.contains(this.resetElement)&&(E.remove(this.resetElement),this.resetElement=null)},B.prototype.updateLabelPosition=function(){this.clearLabelPosition(),this.spanLabel.classList.add("e-label-"+this.labelPosition.toLowerCase()),"Left"===this.labelPosition||"Top"===this.labelPosition?this.wrapper.firstChild.after(this.spanLabel):this.wrapper.appendChild(this.spanLabel)},B.prototype.clearLabelPosition=function(){var t=this.spanLabel.classList.value.match(/(e-label-[top|bottom|right|left]+)/g);t&&E.removeClass([this.spanLabel],t)},B.prototype.wireItemsEvents=function(t,e){var i=this;E.EventHandler.add(t,"click",function(t){return i.clickHandler(t)},this),E.EventHandler.add(t,"mousemove",function(t){return i.mouseMoveHandler(e,t)},this),E.EventHandler.add(t,"mouseleave",this.mouseLeaveHandler,this)},B.prototype.clickHandler=function(t){this.currentValue=0<this.min&&this.currentValue<this.min?this.min:this.currentValue,this.triggerChange(t,this.currentValue),this.updateItemValue(),this.updateLabel(),this.updateResetButton()},B.prototype.updateValueChange=function(t,e,i){this.triggerChange(t,e,i=void 0===i?!0:i),this.updateItemValue(),this.updateLabel()},B.prototype.triggerChange=function(t,e,i,s){void 0===i&&(i=!0),void 0===s&&(s=!1);e=this.validateValue(e),this.currentValue=e,this.currentValue===this.value||(t={event:t,isInteracted:i,value:e,previousValue:this.value},this.setProperties({value:e},!0),this.isAngular&&!s&&this.localChange({value:e}),s)||this.trigger("valueChanged",t)},B.prototype.mouseMoveHandler=function(t,e){this.isTouchSelected&&(this.wrapper.classList.remove("e-rating-touch"),this.isTouchSelected=!1);var i=this.calculateCurrentValue(t,e),i=this.validateValue(i),t=this.itemElements[parseInt((t-1).toString(),10)];i===this.currentValue?this.openRatingTooltip(t,!1):(this.updateCurrentValue(i),this.openRatingTooltip(t,!0),this.trigger("onItemHover",{element:t,event:e,value:i}))},B.prototype.openRatingTooltip=function(t,e){this.showTooltip&&(this.tooltipOpen?e&&(this.updateTooltipContent(!0),this.tooltipObj.refresh(t)):(this.updateTooltipContent(!1),this.tooltipObj.open(t),this.tooltipOpen=!0))},B.prototype.closeRatingTooltip=function(){this.tooltipOpen&&(this.tooltipObj.close(),this.tooltipOpen=!1)},B.prototype.updateCurrentValue=function(t){this.currentValue=t,this.updateItemValue(),this.updateLabel()},B.prototype.mouseLeaveHandler=function(){this.closeRatingTooltip(),this.updateCurrentValue(this.value)},B.prototype.calculateCurrentValue=function(t,e){var i=t;return this.enableSingleSelection||this.precision===o.PrecisionType.Full||(i=e.offsetX/this.itemElements[t-1].clientWidth,i=this.enableRtl?1-i:i,this.precision===o.PrecisionType.Quarter?i=i<=.25?.25:i<=.5?.5:i<.75?.75:1:this.precision===o.PrecisionType.Half&&(i=i<=.5?.5:1),i=i+t-1),i},B.prototype.reset=function(){this.resetClicked(null,!1)},B.prototype.resetClicked=function(t,e){this.updateValueChange(t,this.min,e=void 0===e?!0:e),this.updateResetButton()},B.prototype.wireKeyboardEvent=function(){this.keyboardModuleRating=new E.KeyboardEvents(this.wrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},B.prototype.keyActionHandler=function(t){if(t.preventDefault(),!this.disabled&&!this.readOnly){if(t.target.classList.contains(Dn))switch(t.action){case"uparrow":this.handleNavigation(t,!0);break;case"downarrow":this.handleNavigation(t,!1);break;case"leftarrow":this.handleNavigation(t,this.enableRtl);break;case"rightarrow":this.handleNavigation(t,!this.enableRtl)}this.allowReset&&t.target.classList.contains("e-reset")&&"space"===t.action&&this.resetClicked(t)}},B.prototype.handleNavigation=function(t,e){var i;(!e&&this.value>this.min||e&&this.value<this.itemsCount)&&(i=this.precision===o.PrecisionType.Full||this.enableSingleSelection?1:this.precision===o.PrecisionType.Half?.5:this.precision===o.PrecisionType.Quarter?.25:Math.round(1)/10,i=e?this.value+i:this.value-i,this.updateValueChange(t,i),this.updateResetButton())},B.prototype.updateContent=function(){for(var t=0;t<this.itemsCount;t++){var e=this.itemElements[parseInt(t.toString(),10)].firstElementChild;this.renderItemContent(e,this.getRatingValue(this.value,t),t,!0)}},B.prototype.getModuleName=function(){return"rating"},B.prototype.getPersistData=function(){return this.addOnPersist([])},B.prototype.removeItemElements=function(){for(var t=0;t<this.itemElements.length;t++)E.remove(this.itemElements[parseInt(t.toString(),10)]);this.itemElements=[]},B.prototype.destroy=function(){var e=this;Fn.prototype.destroy.call(this),this.removeItemElements(),this.clearTemplate(),this.spanLabel&&(E.remove(this.spanLabel),this.spanLabel=null),this.resetElement&&(E.remove(this.resetElement),this.resetElement=null),this.showTooltip&&(this.tooltipObj.destroy(),this.tooltipObj=null),E.remove(this.ratingItemList),this.ratingItemList=null,this.wrapper.parentNode.insertBefore(this.element,this.wrapper),E.remove(this.wrapper),this.wrapper=null,this.keyboardModuleRating.destroy(),this.keyboardModuleRating=null,["value","aria-label","name"].forEach(function(t){e.element.removeAttribute(t)})},H([E.Property(!(B.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"value":this.updateValueChange(null,this.value>this.min?this.value:this.min,!1);break;case"min":this.updateMinValue(),this.updateItemValue(),this.updateLabel();break;case"showLabel":this.displayLabel();break;case"visible":this.wrapper.classList[this.visible?"remove":"add"](jn);break;case"disabled":this.updateDisabled();break;case"readOnly":this.wrapper.classList[this.readOnly?"add":"remove"](Xn);break;case"allowReset":this.updateReset();break;case"enableRtl":this.wrapper.classList[this.enableRtl?"add":"remove"]("e-rtl");break;case"cssClass":e.cssClass&&E.removeClass([this.wrapper],e.cssClass.split(" ")),t.cssClass&&E.addClass([this.wrapper],t.cssClass.split(" ")),this.tooltipObj&&this.tooltipObj.setProperties({cssClass:this.cssClass?"e-rating-tooltip "+this.cssClass:"e-rating-tooltip"});break;case"labelPosition":this.updateLabelPosition();break;case"showTooltip":this.updateTooltip();break;case"precision":this.updateMinValue(),this.triggerChange(null,this.value,!1),this.updateItemValue(),this.updateLabel();break;case"enableSingleSelection":this.updateValueChange(null,this.currentValue,!1);break;case"enableAnimation":this.wrapper.classList[this.enableAnimation?"add":"remove"](Kn);break;case"emptyTemplate":case"fullTemplate":this.updateTemplateFunction(),this.updateContent();break;case"labelTemplate":this.updateLabel();break;case"itemsCount":this.removeItemElements(),this.renderItems(),this.updateLabel()}}))],B.prototype,"allowReset",void 0),H([E.Property("")],B.prototype,"cssClass",void 0),H([E.Property(!1)],B.prototype,"disabled",void 0),H([E.Property("")],B.prototype,"emptyTemplate",void 0),H([E.Property(!0)],B.prototype,"enableAnimation",void 0),H([E.Property(!1)],B.prototype,"enableSingleSelection",void 0),H([E.Property("")],B.prototype,"fullTemplate",void 0),H([E.Property(5)],B.prototype,"itemsCount",void 0),H([E.Property(o.LabelPosition.Right)],B.prototype,"labelPosition",void 0),H([E.Property("")],B.prototype,"labelTemplate",void 0),H([E.Property(0)],B.prototype,"min",void 0),H([E.Property(o.PrecisionType.Full)],B.prototype,"precision",void 0),H([E.Property(!1)],B.prototype,"readOnly",void 0),H([E.Property(!1)],B.prototype,"showLabel",void 0),H([E.Property(!0)],B.prototype,"showTooltip",void 0),H([E.Property("")],B.prototype,"tooltipTemplate",void 0),H([E.Property(0)],B.prototype,"value",void 0),H([E.Property(!0)],B.prototype,"visible",void 0),H([E.Event()],B.prototype,"beforeItemRender",void 0),H([E.Event()],B.prototype,"created",void 0),H([E.Event()],B.prototype,"onItemHover",void 0),H([E.Event()],B.prototype,"valueChanged",void 0),H([E.NotifyPropertyChanges],B));function B(t,e){t=Fn.call(this,t,e)||this;return t.itemElements=[],t}$n=function(t,e){return($n=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var $n,Qn,Vn=function(t,e){function i(){this.constructor=t}$n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},H=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},ta=((ta=o.OtpInputType||(o.OtpInputType={})).Number="number",ta.Text="text",ta.Password="password",(ta=o.OtpInputStyle||(o.OtpInputStyle={})).Outlined="outlined",ta.Underlined="underlined",ta.Filled="filled",(ta=o.TextTransform||(o.TextTransform={})).None="none",ta.Uppercase="uppercase",ta.Lowercase="lowercase",Qn=E.Component,Vn(R,Qn),R.prototype.preRender=function(){this.element.id||(this.element.id=E.getUniqueID("e-"+this.getModuleName()))},R.prototype.render=function(){this.initialize()},R.prototype.initialize=function(){E.attributes(this.element,{role:"group"}),this.renderInputs(),this.renderSeparator(1,this.inputs.length),this.addPlaceHolder(),this.updateCssClass(this.cssClass),this.updateVariantClass(),this.updateAriaLabel(this.ariaLabels),this.setElementAttributes(this.htmlAttributes,this.element),this.enableRtl&&this.element.classList.add("e-rtl"),this.previousValue=this.value.toString(),this.autoFocus&&this.focusIn()},R.prototype.renderInputs=function(){this.hiddenInputEle=this.createElement("input",{id:"otpInput_hidden",attrs:{name:this.element.id,type:"hidden",value:"number"===this.type?this.value.toString().replace(/\D/g,""):this.value.toString(),autoComplete:"off"}}),this.element.appendChild(this.hiddenInputEle);for(var t=0;t<this.length;t++)this.createOtpInput(t)},R.prototype.createOtpInput=function(t){var e=this.getDefaultValue(),i="",e=(e&&(e=e[parseInt(t.toString(),10)],"number"===this.type?isNaN(Number(e))||(i=e):i=e||""),this.createElement("input",{id:this.element.id+"-"+(t+1),className:"e-otp-input-field e-input",attrs:{maxlength:"1",type:this.type,inputmode:this.htmlAttributes.inputmode||("number"===this.type?"numeric":"text")}}));this.disabled&&e.setAttribute("disabled","disabled"),this.element.appendChild(e),this.inputs.push(e),i&&(e.value=i),this.wireEvents(e,t)},R.prototype.renderSeparator=function(t,e){if(0<this.separator.length)for(var i=t;i<e;i++){var s=this.createElement("span",{className:"e-otp-separator"});s.textContent=this.separator,this.separatorElements.push(s),this.element.insertBefore(s,this.inputs[parseInt(i.toString(),10)])}},R.prototype.updateSeparatorValue=function(){var e=this;""===this.separator?(this.separatorElements.forEach(function(t){return E.remove(t)}),this.separatorElements=[]):this.separatorElements.forEach(function(t){t.textContent=e.separator})},R.prototype.addPlaceHolder=function(){for(var t=0;t<this.inputs.length;t++){var e=this.placeholder.length<=1?this.placeholder:this.placeholder.charAt(t);this.setElementAttributes({placeholder:e},this.inputs[parseInt(t.toString(),10)])}},R.prototype.updateInputType=function(e){var i=this.htmlAttributes.inputmode||("number"===e?"numeric":"text");this.inputs.forEach(function(t){t.type=e,t.setAttribute("inputmode",i)})},R.prototype.getDefaultValue=function(){var t="number"==typeof this.value?this.value.toString():this.value,t=(t=this.textTransform?this.getTransformedText(t):t).replace(/\s/g,"");return 0<t.length?t.split(""):void 0},R.prototype.getTransformedText=function(t){return this.textTransform.toLowerCase()===o.TextTransform.Lowercase?t.toLowerCase():this.textTransform.toLowerCase()===o.TextTransform.Uppercase?t.toUpperCase():t},R.prototype.handleInputChange=function(t,e){var i=this.inputs[parseInt(t.toString(),10)],i=(i&&t<this.length-1&&0<i.value.length&&(i=this.inputs[parseInt(t.toString(),10)+1],this.shouldFireFocus=this.shouldFireBlur=!1,i.focus(),i)&&0<i.value.length&&i.select(),e.target);1<i.value.length&&(i.value=i.value.slice(0,1)),this.textTransform&&(i.value=this.getTransformedText(i.value)),this.triggerInputEvent(t,e),this.triggerValuechanged(e,!0)},R.prototype.handleKeyAction=function(t,e){1<e.key.length&&!(0===t&&"Backspace"===e.key||t===this.length-1&&"Delete"===e.key)&&(this.shouldFireFocus=this.shouldFireBlur=!1);var i,s=this.inputs[parseInt(t.toString(),10)],n=this.inputs[parseInt(t.toString(),10)-1],a=this.inputs[parseInt(t.toString(),10)+1];"Delete"===e.key?(i="",0<s.value.length?(i=s.value,s.value=""):t!==this.inputs.length-1&&(i=a.value,a.value="",a.focus()),0<i.length&&this.triggerInputEvent(t,e)):"Backspace"===e.key?0!==t&&0===s.value.length&&(i=n.value,n.value="",n.focus(),0<i.length)&&this.triggerInputEvent(t,e):"ArrowLeft"===e.key||"ArrowRight"===e.key?("ArrowLeft"===e.key&&0<t?(n.focus(),n.select()):"ArrowRight"===e.key&&t<this.inputs.length-1&&(a.focus(),a.select()),e.preventDefault()):"ArrowUp"===e.key||"ArrowDown"===e.key?e.preventDefault():"Tab"===e.key||e.shiftKey||e.ctrlKey||"number"===this.type&&/\D/.test(e.key.toLocaleLowerCase())&&e.preventDefault()},R.prototype.handleSelection=function(t){t=this.inputs[parseInt(t.toString(),10)];t.value&&t.select()},R.prototype.handleFocus=function(t,e){E.addClass([this.inputs[parseInt(t.toString(),10)]],"e-otp-input-focus"),this.shouldFireFocus&&(e={element:this.element,event:e,index:t,isInteracted:!this.isFocusInCalled,value:this.value},this.trigger("focus",e)),this.shouldFireFocus=!0},R.prototype.handleBlur=function(t,e){E.removeClass([this.inputs[parseInt(t.toString(),10)]],"e-otp-input-focus"),this.shouldFireBlur&&(e={element:this.element,event:e,value:this.value,index:t,isInteracted:!this.isFocusOutCalled},this.trigger("blur",e)),this.shouldFireBlur=!0},R.prototype.handlePaste=function(t,e){var i=e.clipboardData;if(i){e.preventDefault();for(var s=i.getData("text").split(""),n=0,a=t;a<this.inputs.length;a++)0<s.length&&s[parseInt(n.toString(),10)]&&(this.inputs[parseInt(a.toString(),10)].value=s[parseInt(n.toString(),10)],n++,this.updateValueProperty());this.focusIn(),this.triggerValuechanged(e,!0)}},R.prototype.triggerInputEvent=function(t,e){var i=this.value.toString(),e=(this.updateValueProperty(),{element:this.element,event:e,previousValue:i,value:this.value.toString(),index:t});this.trigger("input",e)},R.prototype.triggerValuechanged=function(t,e){this.length===this.value.toString().length&&this.previousValue!==this.value&&(t={element:this.element,event:t,isInteracted:e||!1,previousValue:this.previousValue,value:this.value},this.trigger("valueChanged",t),this.previousValue=this.value.toString())},R.prototype.wireEvents=function(t,e){E.EventHandler.add(t,"focus",this.handleFocus.bind(this,e),this),E.EventHandler.add(t,"blur",this.handleBlur.bind(this,e),this),E.EventHandler.add(t,"input",this.handleInputChange.bind(this,e),this),E.EventHandler.add(t,"keydown",this.handleKeyAction.bind(this,e),this),E.EventHandler.add(t,"click",this.handleSelection.bind(this,e),this),E.EventHandler.add(t,"paste",this.handlePaste.bind(this,e),this),E.EventHandler.add(t,"wheel",this.handleWheelEvent,this)},R.prototype.unWireEvents=function(){for(var t=0;t<this.inputs.length;t++){var e=this.inputs[parseInt(t.toString(),10)];E.EventHandler.remove(e,"focus",this.handleFocus.bind(this,t)),E.EventHandler.remove(e,"blur",this.handleBlur.bind(this,t)),E.EventHandler.remove(e,"input",this.handleInputChange.bind(this,t)),E.EventHandler.remove(e,"keydown",this.handleKeyAction.bind(this,t)),E.EventHandler.remove(e,"click",this.handleSelection.bind(this,t)),E.EventHandler.remove(e,"paste",this.handlePaste.bind(this,t)),E.EventHandler.remove(e,"wheel",this.handleWheelEvent)}},R.prototype.updateValueProperty=function(){var e="",t=(this.inputs.forEach(function(t){e+=t.value}),this.isProtectedOnChange);this.isProtectedOnChange=!0,this.value="number"==typeof this.value?parseInt(e,10):e,this.isProtectedOnChange=t,this.hiddenInputEle.value=this.value.toString()},R.prototype.updateInputValue=function(t){for(var e=this.value.toString(),i=(this.textTransform&&(e=this.getTransformedText(e)),t.toString()),s=0;s<this.inputs.length;s++)i.charAt(s)!==e.charAt(s)&&(this.inputs[parseInt(s.toString(),10)].value=e.charAt(s),this.hiddenInputEle.value=e);this.focusIn()},R.prototype.updateCssClass=function(t,e){var i;(e=void 0===e?"":e)&&(i=e.trim().split(" "),(e=this.element.classList).remove.apply(e,i)),t&&(i=t.trim().split(" "),(e=this.element.classList).add.apply(e,i))},R.prototype.updateVariantClass=function(){var t="outlined"===this.stylingMode.toLocaleLowerCase()?"outline":this.stylingMode.toLocaleLowerCase(),e=["underlined","filled","outline"];-1!==e.indexOf(t)&&(E.removeClass([this.element],e.map(function(t){return"e-"+t})),E.addClass([this.element],"e-"+t))},R.prototype.updateAriaLabel=function(s){this.inputs.forEach(function(t,e){var i="Enter Otp Character "+(e+1),e=s&&0<s.length&&s[parseInt(e.toString(),10)]||i;t.setAttribute("aria-label",e)})},R.prototype.updateDisabledState=function(){var e=this;this.inputs.forEach(function(t){e.disabled?t.setAttribute("disabled","disabled"):t.removeAttribute("disabled")})},R.prototype.setElementAttributes=function(t,e){if(!E.isNullOrUndefined(t))for(var i in t){var s;"class"===i?(s=t.class.replace(/\s+/g," ").trim())&&E.addClass([e],s.split(" ")):"inputmode"===i?this.setInputMode(t[""+i]):("name"===i&&this.element.id===e.id?this.hiddenInputEle:e).setAttribute(i,t[""+i])}},R.prototype.setInputMode=function(t){for(var e=0;e<this.inputs.length;e++)this.inputs[parseInt(e.toString(),10)].setAttribute("inputmode",t)},R.prototype.handleLengthChange=function(t,e){if(0<t-e){for(var i=e;i<t;i++)this.createOtpInput(i);this.renderSeparator(e,t),this.addPlaceHolder(),this.updateAriaLabel(this.ariaLabels)}else if(0<=t&&0<this.inputs.length){for(i=t;i<this.inputs.length;i++)E.remove(this.inputs[parseInt(i.toString(),10)]);if(this.inputs.splice(t),0<this.separatorElements.length){for(e=0===t?0:t-1,i=e;i<this.separatorElements.length;i++)E.remove(this.separatorElements[parseInt(i.toString(),10)]);this.separatorElements.splice(e)}}},R.prototype.getModuleName=function(){return"otpinput"},R.prototype.getPersistData=function(){return this.addOnPersist([])},R.prototype.destroy=function(){Qn.prototype.destroy.call(this),this.unWireEvents(),this.inputs.forEach(function(t){E.remove(t)}),this.separatorElements.forEach(function(t){E.remove(t)}),E.remove(this.hiddenInputEle),E.removeClass([this.element],["e-underlined","e-filled","e-outline","e-rtl"]),this.cssClass&&E.removeClass([this.element],this.cssClass.trim().split(" ")),this.element.removeAttribute("role"),this.inputs=[],this.separatorElements=[],this.hiddenInputEle=null},R.prototype.focusIn=function(){this.isFocusInCalled=!0;for(var t=this.inputs.length-1,e=0;e<this.inputs.length;e++)if(!(0<this.inputs[parseInt(e.toString(),10)].value.length)){t=e;break}this.inputs[parseInt(t.toString(),10)].focus(),this.isFocusInCalled=!1},R.prototype.focusOut=function(){this.isFocusOutCalled=!0,this.inputs.forEach(function(t){t.blur()}),this.isFocusOutCalled=!1},R.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"textTransform":this.updateInputValue(this.value);break;case"value":this.updateInputValue(e.value),this.triggerValuechanged();break;case"placeholder":this.addPlaceHolder();break;case"disabled":this.updateDisabledState();break;case"cssClass":this.updateCssClass(t.cssClass,e.cssClass);break;case"separator":""===e.separator?this.renderSeparator(1,this.inputs.length):this.updateSeparatorValue();break;case"htmlAttributes":this.setElementAttributes(t.htmlAttributes,this.element);break;case"type":this.updateInputType(t.type);break;case"stylingMode":this.updateVariantClass();break;case"ariaLabels":this.updateAriaLabel(t.ariaLabels);break;case"length":this.handleLengthChange(t.length,e.length);break;case"enableRtl":this.element.classList[this.enableRtl?"add":"remove"]("e-rtl");break;case"autoFocus":this.autoFocus&&this.focusIn()}},H([E.Property(4)],R.prototype,"length",void 0),H([E.Property("")],R.prototype,"value",void 0),H([E.Property(o.OtpInputType.Number)],R.prototype,"type",void 0),H([E.Property("")],R.prototype,"separator",void 0),H([E.Property("")],R.prototype,"placeholder",void 0),H([E.Property(o.OtpInputStyle.Outlined)],R.prototype,"stylingMode",void 0),H([E.Property(!1)],R.prototype,"disabled",void 0),H([E.Property("")],R.prototype,"cssClass",void 0),H([E.Property(!1)],R.prototype,"autoFocus",void 0),H([E.Property(o.TextTransform.None)],R.prototype,"textTransform",void 0),H([E.Property({})],R.prototype,"htmlAttributes",void 0),H([E.Property([])],R.prototype,"ariaLabels",void 0),H([E.Event()],R.prototype,"created",void 0),H([E.Event()],R.prototype,"valueChanged",void 0),H([E.Event()],R.prototype,"focus",void 0),H([E.Event()],R.prototype,"blur",void 0),H([E.Event()],R.prototype,"input",void 0),H([E.NotifyPropertyChanges],R));function R(t,e){t=Qn.call(this,t,e)||this;return t.inputs=[],t.previousValue="",t.separatorElements=[],t.shouldFireFocus=!0,t.shouldFireBlur=!0,t.isFocusInCalled=!1,t.isFocusOutCalled=!1,t.handleWheelEvent=function(t){t.preventDefault()},t}ea=function(t,e){return(ea=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var ea,ia,Vn=function(t,e){function i(){this.constructor=t}ea(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},H=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},sa=(ia=E.ChildProperty,Vn(na,ia),H([E.Property("")],na.prototype,"content",void 0),H([E.Property("")],na.prototype,"stopContent",void 0),H([E.Property("")],na.prototype,"iconCss",void 0),H([E.Property("")],na.prototype,"stopIconCss",void 0),H([E.Property("Left")],na.prototype,"iconPosition",void 0),H([E.Property(!1)],na.prototype,"isPrimary",void 0),na);function na(){return null!==ia&&ia.apply(this,arguments)||this}aa=E.ChildProperty,Vn(ra,aa),H([E.Property("Start listening")],ra.prototype,"content",void 0),H([E.Property("Stop listening")],ra.prototype,"stopContent",void 0),H([E.Property("TopCenter")],ra.prototype,"position",void 0);var aa,la=ra;function ra(){return null!==aa&&aa.apply(this,arguments)||this}(ha=o.SpeechToTextState||(o.SpeechToTextState={})).Inactive="Inactive",ha.Listening="Listening",ha.Stopped="Stopped";oa=E.Component,Vn(U,oa),U.prototype.preRender=function(){this.element.id||(this.element.id=E.getUniqueID("e-"+this.getModuleName()))},U.prototype.getDirective=function(){return"EJS-SPEECHTOTEXT"},U.prototype.getModuleName=function(){return"speech-to-text"},U.prototype.getPersistData=function(){return this.addOnPersist([])},U.prototype.render=function(){this.renderSpeechToText(),this.initializeSpeechRecognition(),E.isNullOrUndefined(this.listeningState)||this.handleStateChange(),this.wireEvents()},U.prototype.initializeLocale=function(){this.l10n=new E.L10n(this.getModuleName(),{abortedError:"Speech recognition was aborted.",audioCaptureError:"No microphone detected. Ensure your microphone is connected.",defaultError:"An unknown error occurred.",networkError:"Network error occurred. Check your internet connection.",noSpeechError:"No speech detected. Please speak into the microphone.",notAllowedError:"Microphone access denied. Allow microphone permissions.",serviceNotAllowedError:"Speech recognition service is not allowed in this context.",unsupportedBrowserError:"The browser does not support the SpeechRecognition API.",startAriaLabel:"Press to start speaking and transcribe your words",stopAriaLabel:"Press to stop speaking and end transcription",startTooltipText:"Start listening",stopTooltipText:"Stop listening"},this.locale)},U.prototype.renderSpeechToText=function(){this.initializeLocale();var t=E.isNullOrUndefined(this.buttonSettings.iconCss)||""===this.buttonSettings.iconCss?"e-icons e-listen-icon":this.buttonSettings.iconCss;this.buttonInst=new F.Button({iconCss:t,isPrimary:this.buttonSettings.isPrimary,cssClass:this.updateButtonCssClass(),disabled:this.disabled,content:this.buttonSettings.content,iconPosition:this.buttonSettings.iconPosition,enableRtl:this.enableRtl}),this.buttonInst.appendTo(this.element),this.updateTooltip(),this.updateCssClass(this.cssClass,""),this.updateAriaLabel(),E.isNullOrUndefined(this.htmlAttributes)||this.addHtmlAttributes(this.htmlAttributes)},U.prototype.updateAriaLabel=function(){var t=this.htmlAttributes&&this.htmlAttributes["aria-label"]?this.htmlAttributes["aria-label"]:this.micOn?this.l10n.getConstant("stopAriaLabel"):this.l10n.getConstant("startAriaLabel");this.element.setAttribute("aria-label",t)},U.prototype.updateCssClass=function(t,e){e&&E.removeClass([this.element],e.trim().split(" ")),t&&E.addClass([this.element],t.trim().split(" "))},U.prototype.updateButtonCssClass=function(){var t;return""===(this.isClicked?this.buttonSettings.stopContent:this.buttonSettings.content)&&(t="e-round"),this.micOn&&(t+=" e-listening-state"),t},U.prototype.updateTooltip=function(){this.showTooltip?(this.tooltipSettings&&("Start listening"===this.tooltipSettings.content&&(this.tooltipSettings.content=this.l10n.getConstant("startTooltipText")),"Stop listening"===this.tooltipSettings.stopContent)&&(this.tooltipSettings.stopContent=this.l10n.getConstant("stopTooltipText")),this.tooltipInst=new h.Tooltip({content:this.hasStarted?this.tooltipSettings.stopContent:this.tooltipSettings.content,position:this.tooltipSettings.position,windowCollision:!0,cssClass:this.cssClass?"e-speech-to-text-tooltip "+this.cssClass:"e-speech-to-text-tooltip",opensOn:"Hover",enableRtl:this.enableRtl}),this.tooltipInst.appendTo(this.element)):E.isNullOrUndefined(this.tooltipInst)||(this.tooltipInst.destroy(),this.tooltipInst=null)},U.prototype.handleStateChange=function(){var t;this.disabled||(this.listeningState===o.SpeechToTextState.Listening?(this.micOn=!0,this.startSpeechRecognition()):this.listeningState!==o.SpeechToTextState.Inactive&&this.listeningState!==o.SpeechToTextState.Stopped||(this.micOn?(this.micOn=!1,this.stopSpeechRecognition()):(t=this.isProtectedOnChange,this.isProtectedOnChange=!0,this.listeningState=o.SpeechToTextState.Inactive,this.isProtectedOnChange=t)))},U.prototype.addHtmlAttributes=function(t){if(t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&this.element.setAttribute(e,t[e])},U.prototype.removeHtmlAttributes=function(t){if(t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&this.element.removeAttribute(e)},U.prototype.wireEvents=function(){E.EventHandler.add(this.element,"click",this.handleButtonClick,this)},U.prototype.unWireEvents=function(){E.EventHandler.remove(this.element,"click",this.handleButtonClick)},U.prototype.handleButtonClick=function(t){this.isUserInteracted=!0,this.micOn=!this.micOn,this.micOn?this.startSpeechRecognition(t):this.stopSpeechRecognition(t)},U.prototype.triggerUnSupportedError=function(){var t={error:"unsupported-browser",errorMessage:this.l10n.getConstant("unsupportedBrowserError")};this.trigger("onError",t)},U.prototype.initializeSpeechRecognition=function(){var a=this,t=window,t=t.SpeechRecognition||t.webkitSpeechRecognition;t?(this.recognition=new t,this.recognition.continuous=!0,this.recognition.lang=this.lang,this.recognition.interimResults=this.allowInterimResults,this.recognition.onstart=function(t){var e=a.isProtectedOnChange,i=(a.isProtectedOnChange=!0,a.transcript=a.fullTranscript="",a.isProtectedOnChange=e,{cancel:!1,listeningState:o.SpeechToTextState.Listening,event:t,isInteracted:a.isUserInteracted});a.trigger("onStart",i,function(){i.cancel?(a.recognition.abort(),a.micOn=!1):a.handleStartRecognition()})},this.recognition.onend=function(t){a.hasStarted&&(a.micOn=!1,a.handleStopRecognition(t))},this.recognition.onerror=function(t){var e="";switch(t.error){case"not-allowed":e=a.l10n.getConstant("notAllowedError");break;case"audio-capture":e=a.l10n.getConstant("audioCaptureError");break;case"network":e=a.l10n.getConstant("networkError");break;case"no-speech":e=a.l10n.getConstant("noSpeechError");break;case"aborted":e=a.l10n.getConstant("abortedError");break;case"service-not-allowed":e=a.l10n.getConstant("serviceNotAllowedError");break;default:e=a.l10n.getConstant("defaultError")}t={event:t,error:t.error,errorMessage:e};a.trigger("onError",t),a.isUserInteracted=!1},this.recognition.onresult=function(t){var e=t.results[t.resultIndex],i="",s=a.isProtectedOnChange,n=(a.isProtectedOnChange=!0,e.isFinal?(a.fullTranscript+=e[0].transcript,a.transcript=a.fullTranscript):(i+=e[0].transcript,a.transcript=a.fullTranscript+i),{event:t,transcript:a.transcript,isInterimResult:!e.isFinal});a.trigger("transcriptChanged",n,function(){var t;n.transcript!==a.transcript&&(t=a.isProtectedOnChange,a.isProtectedOnChange=!0,a.transcript=a.fullTranscript=n.transcript,a.isProtectedOnChange=t)}),a.isProtectedOnChange=s}):this.triggerUnSupportedError()},U.prototype.handleStartRecognition=function(){var t=this.isProtectedOnChange,e=(this.isProtectedOnChange=!0,this.hasStarted=!0,this.listeningState=o.SpeechToTextState.Listening,E.isNullOrUndefined(this.tooltipInst)||(this.tooltipInst.content=this.tooltipSettings.stopContent),this.updateAriaLabel(),this.isClicked=!0,this.buttonInst.cssClass=this.updateButtonCssClass(),this.buttonInst.content=this.buttonSettings.stopContent,E.isNullOrUndefined(this.buttonSettings.stopIconCss)||""===this.buttonSettings.stopIconCss?"e-icons e-listen-stop":this.buttonSettings.stopIconCss);this.buttonInst.iconCss=e,this.isProtectedOnChange=t},U.prototype.triggerUnSupportedStart=function(t){var e=this,i=this.isProtectedOnChange,s=(this.isProtectedOnChange=!0,this.transcript="",this.isProtectedOnChange=i,{cancel:!1,listeningState:o.SpeechToTextState.Listening,event:t,isInteracted:this.isUserInteracted});this.trigger("onStart",s,function(){s.cancel||e.handleStartRecognition()})},U.prototype.startSpeechRecognition=function(t){this.hasStarted||(this.recognition?this.recognition.start():this.triggerUnSupportedStart(t))},U.prototype.stopSpeechRecognition=function(t){this.recognition?this.recognition.stop():this.handleStopRecognition(t)},U.prototype.handleStopRecognition=function(t){var e;this.hasStarted&&(e=this.isProtectedOnChange,this.isProtectedOnChange=!0,this.listeningState=o.SpeechToTextState.Stopped,E.isNullOrUndefined(this.tooltipInst)||(this.tooltipInst.content=this.tooltipSettings.content),this.updateAriaLabel(),this.isClicked=!1,this.buttonInst.cssClass=this.updateButtonCssClass(),this.buttonInst.content=this.buttonSettings.content,t={listeningState:o.SpeechToTextState.Stopped,event:t,isInteracted:this.isUserInteracted},this.trigger("onStop",t),this.listeningState=o.SpeechToTextState.Inactive,t=E.isNullOrUndefined(this.buttonSettings.iconCss)||""===this.buttonSettings.iconCss?"e-icons e-listen-icon":this.buttonSettings.iconCss,this.buttonInst.iconCss=t,this.hasStarted=!1,this.isProtectedOnChange=e)},U.prototype.buttonSettingsChanges=function(t,e){var i,s;t.content===e.content&&t.stopContent===e.stopContent||(this.buttonInst.content=this.hasStarted?this.buttonSettings.stopContent:this.buttonSettings.content,this.buttonInst.cssClass=this.updateButtonCssClass()),t.iconCss===e.iconCss&&t.stopIconCss===e.stopIconCss||(i=E.isNullOrUndefined(this.buttonSettings.iconCss)||""===this.buttonSettings.iconCss?"e-icons e-listen-icon":this.buttonSettings.iconCss,s=E.isNullOrUndefined(this.buttonSettings.stopIconCss)||""===this.buttonSettings.stopIconCss?"e-icons e-listen-stop":this.buttonSettings.stopIconCss,this.buttonInst.iconCss=this.hasStarted?s:i),t.iconPosition!==e.iconPosition&&(this.buttonInst.iconPosition=this.buttonSettings.iconPosition),t.isPrimary!==e.isPrimary&&(this.buttonInst.isPrimary=this.buttonSettings.isPrimary)},U.prototype.destroyAndNullify=function(t){t&&t.destroy()},U.prototype.destroy=function(){oa.prototype.destroy.call(this),this.unWireEvents(),this.destroyAndNullify(this.buttonInst),this.destroyAndNullify(this.tooltipInst),this.recognition=null,this.micOn=null,this.htmlAttributes=this.tooltipSettings=this.buttonSettings=null,this.element.classList.remove("e-rtl")},U.prototype.startListening=function(){this.disabled||this.isClicked||(this.isUserInteracted=!1,this.micOn=!0,this.startSpeechRecognition())},U.prototype.stopListening=function(){!this.disabled&&this.isClicked&&(this.isUserInteracted=!1,this.micOn=!1,this.stopSpeechRecognition())},U.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"lang":this.recognition&&(this.recognition.lang=this.lang);break;case"allowInterimResults":this.recognition&&(this.recognition.interimResults=this.allowInterimResults);break;case"buttonSettings":this.buttonSettingsChanges(e.buttonSettings,t.buttonSettings);break;case"cssClass":this.updateCssClass(t.cssClass,e.cssClass);break;case"disabled":this.buttonInst.disabled=this.disabled,this.handleStateChange();break;case"htmlAttributes":this.removeHtmlAttributes(e.htmlAttributes),this.addHtmlAttributes(t.htmlAttributes);break;case"listeningState":this.handleStateChange();break;case"tooltipSettings":case"showTooltip":this.updateTooltip();break;case"transcript":this.transcript=this.fullTranscript=t.transcript;break;case"enableRtl":this.buttonInst.enableRtl=this.tooltipInst.enableRtl=this.enableRtl;break;case"locale":this.l10n.setLocale(this.locale),this.updateAriaLabel(),this.updateTooltip()}},H([E.Property("")],U.prototype,"transcript",void 0),H([E.Property("")],U.prototype,"lang",void 0),H([E.Property(!0)],U.prototype,"allowInterimResults",void 0),H([E.Property(!0)],U.prototype,"showTooltip",void 0),H([E.Property("Inactive")],U.prototype,"listeningState",void 0),H([E.Complex({},sa)],U.prototype,"buttonSettings",void 0),H([E.Complex({},la)],U.prototype,"tooltipSettings",void 0),H([E.Property(!1)],U.prototype,"disabled",void 0),H([E.Property("")],U.prototype,"cssClass",void 0),H([E.Property({})],U.prototype,"htmlAttributes",void 0),H([E.Event()],U.prototype,"created",void 0),H([E.Event()],U.prototype,"onStart",void 0),H([E.Event()],U.prototype,"onStop",void 0),H([E.Event()],U.prototype,"onError",void 0),H([E.Event()],U.prototype,"transcriptChanged",void 0);var oa,ha=H([E.NotifyPropertyChanges],U);function U(t,e){t=oa.call(this,t,e)||this;return t.fullTranscript="",t.isClicked=!1,t.isUserInteracted=!1,t.hasStarted=!1,t}o.AsyncSettings=ks,o.ButtonSettings=sa,o.ButtonsProps=Os,o.ColorPicker=s,o.ColorRangeData=Be,o.FilesProp=Ss,o.FormValidator=Zi,o.LimitData=Ie,o.MaskUndo=Se,o.MaskedTextBox=Tt,o.NumericTextBox=Rt,o.OtpInput=ta,o.Rating=Jn,o.Signature=O,o.SignatureBase=Sn,o.Slider=ji,o.SmartTextArea=On,o.SpeechToText=ha,o.TEXTBOX_FOCUS=W,o.TextArea=T,o.TextBox=x,o.TicksData=Ae,o.TooltipData=Me,o.TooltipSettings=la,o.Uploader=t,o.applyMask=qt,o.bindClearEvent=Xt,o.containerAttributes=D,o.createMask=zt,o.escapeRegExp=ee,o.getMaskedVal=function(t){return Zt.call(xe(t),t.element)},o.getVal=function(t){return d.call(xe(t),t.element)},o.maskInput=function(t){var e=Ee(t),i=(qt.call(e),d.call(this,this.element));this.prevValue=i,this.value=i,t.mask&&(_t.call(e),jt.call(e))},o.maskInputBlurHandler=ie,o.maskInputDropHandler=ae,o.maskInputFocusHandler=Qt,o.maskInputMouseDownHandler=Jt,o.maskInputMouseUpHandler=$t,o.mobileRemoveFunction=oe,o.regex=Yi,o.regularExpressions=Wt,o.setElementValue=b,o.setMaskValue=Ce,o.strippedValue=d,o.triggerFocus=te,o.unstrippedValue=Zt,o.unwireEvents=_t,o.wireEvents=jt,Object.defineProperty(o,"__esModule",{value:!0})});
10
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-splitbuttons"),require("@syncfusion/ej2-buttons")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-popups","@syncfusion/ej2-splitbuttons","@syncfusion/ej2-buttons"],e):e((t=t||self).ej={},t.ej2Base,t.ej2Popups,t.ej2Splitbuttons,t.ej2Buttons)}(this,function(o,E,h,I,F){"use strict";var n,V,M,p={RTL:"e-rtl",DISABLE:"e-disabled",INPUT:"e-input",TEXTAREA:"e-multi-line-input",INPUTGROUP:"e-input-group",FLOATINPUT:"e-float-input",FLOATLINE:"e-float-line",FLOATTEXT:"e-float-text",FLOATTEXTCONTENT:"e-float-text-content",CLEARICON:"e-clear-icon",CLEARICONHIDE:"e-clear-icon-hide",LABELTOP:"e-label-top",LABELBOTTOM:"e-label-bottom",NOFLOATLABEL:"e-no-float-label",INPUTCUSTOMTAG:"e-input-custom-tag",FLOATCUSTOMTAG:"e-float-custom-tag"},D=["title","style","class"],W="e-input-focus";function z(i){q(i.floatLabelType,i.element);function t(){var t,e;((e=Q((t=i).element)).classList.contains("e-input-group")||e.classList.contains("e-outline")||e.classList.contains("e-filled"))&&e.classList.add("e-input-focus"),"Never"!==t.floatLabelType&&setTimeout(function(){n.calculateWidth(t.element,e)},80)}function e(){var t,e;((e=Q((t=i).element)).classList.contains("e-input-group")||e.classList.contains("e-outline")||e.classList.contains("e-filled"))&&e.classList.remove("e-input-focus"),"Never"!==t.floatLabelType&&setTimeout(function(){n.calculateWidth(t.element,e)},80)}function s(){q(i.floatLabelType,i.element)}i.element.addEventListener("focus",t),i.element.addEventListener("blur",e),i.element.addEventListener("input",s),i.element.__eventHandlers.inputFocusHandler=t,i.element.__eventHandlers.inputBlurHandler=e,i.element.__eventHandlers.inputHandler=s}function q(t,e){var i=e.value,e=e.parentElement,s=e&&e.parentElement;""===i||E.isNullOrUndefined(i)?"Always"!==t&&(e&&e.classList.contains("e-input-group")?e.classList.remove("e-valid-input"):s&&s.classList.contains("e-input-group")&&s.classList.remove("e-valid-input")):e&&e.classList.contains("e-input-group")?e.classList.add("e-valid-input"):s&&s.classList.contains("e-input-group")&&s.classList.add("e-valid-input")}function j(){var t=Q(this).getElementsByClassName("e-float-text")[0];E.isNullOrUndefined(t)||(E.addClass([t],p.LABELTOP),t.classList.contains(p.LABELBOTTOM)&&E.removeClass([t],p.LABELBOTTOM))}function _(){var t=Q(this);(t.getElementsByTagName("textarea")[0]?""===t.getElementsByTagName("textarea")[0].value:""===t.getElementsByTagName("input")[0].value)&&(t=t.getElementsByClassName("e-float-text")[0],E.isNullOrUndefined(t)||(t.classList.contains(p.LABELTOP)&&E.removeClass([t],p.LABELTOP),E.addClass([t],p.LABELBOTTOM)))}function X(t){t.addEventListener("focus",j),t.addEventListener("blur",_)}function K(t){E.isNullOrUndefined(t)||(t.removeEventListener("focus",j),t.removeEventListener("blur",_))}function Y(t,e,i){var s,i=E.isNullOrUndefined(i)?E.createElement:i,n=("Auto"===t.floatLabelType&&X(t.element),E.isNullOrUndefined(e.container)?(e.container=it(t,p.FLOATINPUT,p.FLOATCUSTOMTAG,"div",i),e.container.classList.add(p.INPUTGROUP),t.element.parentNode&&t.element.parentNode.insertBefore(e.container,t.element)):(E.isNullOrUndefined(t.customTag)||e.container.classList.add(p.FLOATCUSTOMTAG),e.container.classList.add(p.FLOATINPUT)),i("span",{className:p.FLOATLINE})),i=i("label",{className:p.FLOATTEXT});E.isNullOrUndefined(t.element.id)||""===t.element.id||(i.id="label_"+t.element.id.replace(/ /g,"_"),E.attributes(t.element,{"aria-labelledby":i.id})),E.isNullOrUndefined(t.element.placeholder)||""===t.element.placeholder||(i.innerText=st(t.element.placeholder),t.element.removeAttribute("placeholder")),E.isNullOrUndefined(t.properties)||E.isNullOrUndefined(t.properties.placeholder)||""===t.properties.placeholder||(i.innerText=st(t.properties.placeholder)),i.innerText||e.container.classList.add(p.NOFLOATLABEL),(e.container.classList.contains("e-float-icon-left")?((s=e.container.querySelector(".e-input-in-wrap")).appendChild(t.element),s.appendChild(n),s):(e.container.appendChild(t.element),e.container.appendChild(n),e.container)).appendChild(i),$(t.element.value,i),"Always"===t.floatLabelType&&(i.classList.contains(p.LABELBOTTOM)&&E.removeClass([i],p.LABELBOTTOM),E.addClass([i],p.LABELTOP)),"Auto"===t.floatLabelType?(s=function(){et(t.element,t.floatLabelType)},t.element.addEventListener("input",n=function(){et(t.element,t.floatLabelType)}),t.element.addEventListener("blur",s),t.element.__eventHandlers.floatInputHandler=n,t.element.__eventHandlers.floatBlurHandler=s):Z(t),E.isNullOrUndefined(t.element.getAttribute("id"))||i.setAttribute("for",t.element.getAttribute("id"))}function Z(t){var e,i;E.isNullOrUndefined(t.element)||E.isNullOrUndefined(t.element.__eventHandlers)||E.isNullOrUndefined(t.element.__eventHandlers.floatInputHandler)||E.isNullOrUndefined(t.element.__eventHandlers.floatBlurHandler)||(e=t.element.__eventHandlers.floatInputHandler,i=t.element.__eventHandlers.floatBlurHandler,t.element.removeEventListener("input",e),t.element.removeEventListener("blur",i),t.element.__eventHandlers.floatInputHandler=null,t.element.__eventHandlers.floatBlurHandler=null)}function G(t,e){"Always"===t&&e.classList.contains("e-outline")&&e.classList.add("e-valid-input")}function J(t,e,i){E.isNullOrUndefined(e)||(t&&!i?E.removeClass([e],p.CLEARICONHIDE):E.addClass([e],p.CLEARICONHIDE))}function $(t,e,i){void 0===i&&(i=null),t?(E.addClass([e],p.LABELTOP),e.classList.contains(p.LABELBOTTOM)&&E.removeClass([e],p.LABELBOTTOM)):null!=i&&i===document.activeElement||(e.classList.contains(p.LABELTOP)&&E.removeClass([e],p.LABELTOP),E.addClass([e],p.LABELBOTTOM))}function Q(t){t=E.isNullOrUndefined(t.parentNode)?t:t.parentNode;return t=t&&t.classList.contains("e-input-in-wrap")?t.parentNode:t}function tt(s,n,t){function e(){J(s.value,n)}function i(){J(s.value,n,s.readOnly)}function a(){var t,e;t=s,e=n,setTimeout(function(){E.isNullOrUndefined(e)||(E.addClass([e],p.CLEARICONHIDE),e=!E.isNullOrUndefined(t)&&t.classList.contains("e-combobox")?null:e)},200)}var l;void 0!==V&&!V||(n.addEventListener("click",l=function(t){var e,i;t=t,i=n,(e=s).classList.contains(p.DISABLE)||e.readOnly||(t.preventDefault(),e!==document.activeElement&&e.focus(),e.value="",E.addClass([i],p.CLEARICONHIDE))}),s.__eventHandlers.clearClickHandler=l);s.addEventListener("input",e),s.addEventListener("focus",i),s.addEventListener("blur",a),s.__eventHandlers.clearInputHandler=e,s.__eventHandlers.clearFocusHandler=i,s.__eventHandlers.clearBlurHandler=a}function et(t,e){Q(t).classList.contains(p.FLOATINPUT)&&"Auto"===e&&(e=Q(t).getElementsByClassName("e-float-text")[0],$(t.value,e,t))}function it(t,e,i,s,n){var a,n=E.isNullOrUndefined(n)?E.createElement:n;return E.isNullOrUndefined(t.customTag)?a=n(s,{className:e}):(a=n(t.customTag,{className:e})).classList.add(i),a.classList.add("e-control-wrapper"),a}function st(t){var e;return null==t||""===t?"":(e={"&amp;":"&","&quot;":'"',"&#39;":"'","&lt;":"<","&gt;":">","&eacute;":"é"},t.replace(/&[a-zA-Z#0-9]+;/g,function(t){return e[t]||t}))}function nt(t,e,i){E.isNullOrUndefined(i)||""===i||E.removeClass(e,i.split(" ")),E.isNullOrUndefined(t)||""===t||E.addClass(e,t.split(" "))}function at(t,e,i){var s,n,a,l;"multiselect"!==i&&t&&e&&!M.has(t)&&(M.set(t,s=function(){document.documentElement.contains(e)?at(t,e,i):(window.removeEventListener("resize",s),M.delete(t))}),window.addEventListener("resize",s)),("multiselect"===i||function(t){if(!t)return;var e=t;for(;e&&e!==document.body;){if("none"===window.getComputedStyle(e).display)return;e=e.parentElement}return 1}(t))&&(n="multiselect"===i?t:t.clientWidth-parseInt(getComputedStyle(t,null).getPropertyValue("padding-left"),10),"multiselect"!==i&&t&&e&&(a=0,l=e.getElementsByClassName("e-input-group-icon"),Array.from(l).forEach(function(t){a+=t.clientWidth+parseInt(getComputedStyle(t,null).getPropertyValue("margin-right"),10)}),n+=a-parseInt(getComputedStyle(t,null).getPropertyValue("padding-left"),10)),!E.isNullOrUndefined(e))&&!E.isNullOrUndefined(e.getElementsByClassName("e-float-text-content")[0])&&(e.getElementsByClassName("e-float-text-content")[0].classList.contains("e-float-text-overflow")&&e.getElementsByClassName("e-float-text-content")[0].classList.remove("e-float-text-overflow"),n<e.getElementsByClassName("e-float-text-content")[0].clientWidth||n===e.getElementsByClassName("e-float-text-content")[0].clientWidth)&&e.getElementsByClassName("e-float-text-content")[0].classList.add("e-float-text-overflow")}function lt(t,e,i){t=st(t);var s,n,a=Q(e);a.classList.contains(p.FLOATINPUT)?E.isNullOrUndefined(t)||""===t?(a.classList.add(p.NOFLOATLABEL),(s=a.getElementsByClassName("e-float-text-content")[0])&&s.children[0]?s.children[0].textContent="":(n=a.getElementsByClassName(p.FLOATTEXT)[0],E.isNullOrUndefined(n)||(n.textContent=""))):((s=a.getElementsByClassName("e-float-text-content")[0])&&s.children[0]?s.children[0].textContent=t:-1!==["textbox","numerictextbox","textarea","combobox","datepicker","daterangepicker","datetimepicker","maskedtextbox"].indexOf(i)&&s?s.textContent=t:(n=a.getElementsByClassName(p.FLOATTEXT)[0],E.isNullOrUndefined(n)||(n.textContent=t)),a.classList.remove(p.NOFLOATLABEL),e.removeAttribute("placeholder")):E.isNullOrUndefined(t)||""===t?e.removeAttribute("placeholder"):E.attributes(e,{placeholder:t})}function rt(t,e,i){t?E.attributes(e,{readonly:""}):e.removeAttribute("readonly"),E.isNullOrUndefined(i)||et(e,i)}function ot(t,e){t?E.addClass(e,p.RTL):E.removeClass(e,p.RTL)}function ht(t,e,i,s){var n={disabled:"","aria-disabled":"true"},a=!E.isNullOrUndefined(s);t?(e.classList.remove(p.DISABLE),dt(n,e),a&&E.removeClass([s],p.DISABLE)):(e.classList.add(p.DISABLE),ut(n,e),a&&E.addClass([s],p.DISABLE)),E.isNullOrUndefined(i)||et(e,i)}function pt(t,e,i,s,n){var a,n=E.isNullOrUndefined(n)?E.createElement:n;t?i.clearButton=(t=e,e=i,s=s,n=n,n=(E.isNullOrUndefined(n)?E.createElement:n)("span",{className:p.CLEARICON}),a=e.container,E.isNullOrUndefined(s)?(e.container.classList.contains(p.FLOATINPUT)?e.container.querySelector("."+p.FLOATTEXT):t).insertAdjacentElement("afterend",n):a.appendChild(n),E.addClass([n],p.CLEARICONHIDE),tt(t,n),n.setAttribute("aria-label","close"),n):(E.remove(i.clearButton),i.clearButton=null)}function dt(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i],a=Q(e);"disabled"===n&&e.classList.remove(p.DISABLE),"disabled"===n&&a.classList.contains(p.INPUTGROUP)&&a.classList.remove(p.DISABLE),"placeholder"===n&&a.classList.contains(p.FLOATINPUT)?a.getElementsByClassName(p.FLOATTEXT)[0].textContent="":e.removeAttribute(n)}}function ut(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i],a=Q(e);"disabled"===n&&e.classList.add(p.DISABLE),"disabled"===n&&a.classList.contains(p.INPUTGROUP)&&a.classList.add(p.DISABLE),"placeholder"===n&&a.classList.contains(p.FLOATINPUT)?a.getElementsByClassName(p.FLOATTEXT)[0].textContent=t[""+n]:e.setAttribute(n,t[""+n])}}function ct(t,e){t.classList.contains("e-outline")&&t.getElementsByClassName("e-float-text")[0]&&((e=e("span",{className:p.FLOATTEXTCONTENT})).innerHTML=t.getElementsByClassName("e-float-text")[0].innerHTML,t.getElementsByClassName("e-float-text")[0].innerHTML="",t.getElementsByClassName("e-float-text")[0].appendChild(e))}function mt(t,e,i){var s=[],n=(s.push(i),E.isNullOrUndefined(i)?e.querySelectorAll(".e-input-group-icon"):s);if(t&&0<n.length)for(var a=0;a<n.length;a++)n[parseInt(a.toString(),10)].addEventListener("mousedown",ft,!1),n[parseInt(a.toString(),10)].addEventListener("mouseup",vt,!1);else if(0<n.length)for(a=0;a<n.length;a++)n[parseInt(a.toString(),10)].removeEventListener("mousedown",ft,this),n[parseInt(a.toString(),10)].removeEventListener("mouseup",vt,this)}function ft(){for(var t,e,i=this.parentElement;!i.classList.contains("e-input-group");)i=i.parentElement;e=this,(t=i).classList.contains("e-disabled")||t.querySelector("input").readOnly||e.classList.add("e-input-btn-ripple")}function vt(){var t=this;setTimeout(function(){t.classList.remove("e-input-btn-ripple")},500)}function gt(t,e){e=e("span",{className:t});return e.classList.add("e-input-group-icon"),e}function yt(t,e,i,s){var s=E.isNullOrUndefined(s)?E.createElement:s,t=gt(t,s),n=(e.classList.add("e-float-icon-left"),e.querySelector(".e-input-in-wrap"));if(E.isNullOrUndefined(n)){n=s("span",{className:"e-input-in-wrap"}),i.parentNode.insertBefore(n,i);var a=e.querySelectorAll(i.tagName+" ~ *");n.appendChild(i);for(var l=0;l<a.length;l++){var r=a[parseInt(l.toString(),10)],o=n.parentElement;r.classList.contains("e-float-line")&&(o&&o.classList.contains("e-filled")||!o)||n.appendChild(r)}}return n.parentNode.insertBefore(t,n),mt(!0,e,t),t}function bt(t,e,i){t=gt(t,E.isNullOrUndefined(i)?E.createElement:i);return(e.classList.contains("e-float-icon-left")?e.querySelector(".e-input-in-wrap"):e).appendChild(t),mt(!0,e,t),t}function Ct(t,e){"hidden"===e.type?t.classList.add("e-hidden"):t.classList.contains("e-hidden")&&t.classList.remove("e-hidden")}function Et(t){var e=t;return e=E.isNullOrUndefined(t)||""===t?e:t.replace(/\s+/g," ").trim()}n=o.Input||(o.Input={}),V=!0,M=new Map,n.createInput=function(t,e){t.element.__eventHandlers={};var i=E.isNullOrUndefined(e)?E.createElement:e,s={container:null,buttons:[],clearButton:null};if(t.floatLabelType,V=t.bindClearAction,E.isNullOrUndefined(t.floatLabelType)||"Never"===t.floatLabelType?(s.container=it(t,p.INPUTGROUP,p.INPUTCUSTOMTAG,"span",i),t.element.parentNode.insertBefore(s.container,t.element),E.addClass([t.element],p.INPUT),s.container.appendChild(t.element)):Y(t,s,i),z(t),E.isNullOrUndefined(t.properties)||E.isNullOrUndefined(t.properties.showClearButton)||!t.properties.showClearButton||(pt(t.properties.showClearButton,t.element,s,!0,i),s.clearButton.setAttribute("role","button"),s.container.classList.contains(p.FLOATINPUT)&&E.addClass([s.container],p.INPUTGROUP)),!E.isNullOrUndefined(t.buttons))for(var n=0;n<t.buttons.length;n++)s.buttons.push(bt(t.buttons[n],s.container,i));return E.isNullOrUndefined(t.element)||"TEXTAREA"!==t.element.tagName||E.addClass([s.container],p.TEXTAREA),Ct(s.container,t.element),ct((s=function(t,e){if(!E.isNullOrUndefined(t.properties))for(var i=0,s=Object.keys(t.properties);i<s.length;i++)switch(s[i]){case"cssClass":nt(t.properties.cssClass,[e.container]),G(t.floatLabelType,e.container);break;case"enabled":ht(t.properties.enabled,t.element,t.floatLabelType,e.container);break;case"enableRtl":ot(t.properties.enableRtl,[e.container]);break;case"placeholder":lt(t.properties.placeholder,t.element);break;case"readonly":rt(t.properties.readonly,t.element)}return e}(t,s)).container,i),s},n.bindInitialEvent=z,n.wireFloatingEvents=X,n.wireClearBtnEvents=tt,n.destroy=function(t,e){void 0===e&&(e=null),l=t,E.isNullOrUndefined(l.element)||E.isNullOrUndefined(l.element.__eventHandlers)||E.isNullOrUndefined(l.element.__eventHandlers.inputFocusHandler)||E.isNullOrUndefined(l.element.__eventHandlers.inputBlurHandler)||E.isNullOrUndefined(l.element.__eventHandlers.inputHandler)||(i=l.element.__eventHandlers.inputFocusHandler,s=l.element.__eventHandlers.inputBlurHandler,a=l.element.__eventHandlers.inputHandler,l.element.removeEventListener("focus",i),l.element.removeEventListener("blur",s),l.element.removeEventListener("input",a),l.element.__eventHandlers.inputFocusHandler=null,l.element.__eventHandlers.inputBlurHandler=null,l.element.__eventHandlers.inputHandler=null),"Auto"===t.floatLabelType&&Z(t),t.properties.showClearButton&&(i=t.element,s=e,E.isNullOrUndefined(i)||E.isNullOrUndefined(i.__eventHandlers)||(E.isNullOrUndefined(i.__eventHandlers.clearClickHandler)||(n=i.__eventHandlers.clearClickHandler,void 0!==V&&!V||E.isNullOrUndefined(s)||s.removeEventListener("click",n),i.__eventHandlers.clearClickHandler=null),E.isNullOrUndefined(i.__eventHandlers.clearInputHandler))||E.isNullOrUndefined(i.__eventHandlers.clearFocusHandler)||E.isNullOrUndefined(i.__eventHandlers.clearBlurHandler)||(s=i.__eventHandlers.clearInputHandler,n=i.__eventHandlers.clearFocusHandler,a=i.__eventHandlers.clearBlurHandler,i.removeEventListener("input",s),i.removeEventListener("focus",n),i.removeEventListener("blur",a),i.__eventHandlers.clearInputHandler=null,i.__eventHandlers.clearFocusHandler=null,i.__eventHandlers.clearBlurHandler=null)),E.isNullOrUndefined(t.buttons)||mt(!1,null,t.buttons),K(t.element);var i,s,n,a,l=M.get(t.element);l&&(window.removeEventListener("resize",l),M.delete(t.element)),E.isNullOrUndefined(t.element)||(delete t.element.__eventHandlers,t.element.classList.contains(p.INPUT)&&t.element.classList.remove(p.INPUT))},n.setValue=function(t,e,i,s){e.value=t,"Never"!==i&&at(e,e.parentElement),E.isNullOrUndefined(i)||"Auto"!==i||et(e,i),!E.isNullOrUndefined(s)&&s&&(t=Q(e),E.isNullOrUndefined(t)||(s=t.getElementsByClassName(p.CLEARICON)[0],E.isNullOrUndefined(s))||(e.value&&!E.isNullOrUndefined(t)&&t.classList.contains("e-input-focus")?E.removeClass([s],p.CLEARICONHIDE):E.addClass([s],p.CLEARICONHIDE))),q(i,e)},n.setCssClass=nt,n.calculateWidth=at,n.setWidth=function(t,e){"number"==typeof t?e.style.width=E.formatUnit(t):"string"==typeof t&&(e.style.width=t.match(/px|%|em/)?t:E.formatUnit(t)),at(e.firstChild,e)},n.setPlaceholder=lt,n.setReadonly=rt,n.setEnableRtl=ot,n.setEnabled=ht,n.setClearButton=pt,n.removeAttributes=dt,n.addAttributes=ut,n.removeFloating=function(t){var e,i,s,t=t.container;!E.isNullOrUndefined(t)&&t.classList.contains(p.FLOATINPUT)&&(e=t.querySelector("textarea")?t.querySelector("textarea"):t.querySelector("input"),i=t.querySelector("."+p.FLOATTEXT).textContent,s=null!==t.querySelector(".e-clear-icon"),E.detach(t.querySelector("."+p.FLOATLINE)),E.detach(t.querySelector("."+p.FLOATTEXT)),E.classList(t,[p.INPUTGROUP],[p.FLOATINPUT]),K(e),E.attributes(e,{placeholder:i}),e.classList.add(p.INPUT),s||"INPUT"!==e.tagName||e.removeAttribute("required"))},n.addFloating=function(t,e,i,s){var n,a,s=E.isNullOrUndefined(s)?E.createElement:s,l=E.closest(t,"."+p.INPUTGROUP),r=l.tagName,r={element:t,floatLabelType:e,customTag:"DIV"!==r&&"SPAN"!==r?r:null,properties:{placeholder:i}};"Never"!==e?(i=l.querySelector(".e-clear-icon"),n={container:l},t.classList.remove(p.INPUT),Y(r,n,s),ct(n.container,s),at(r.element,n.container),s=l.classList.contains("e-float-icon-left"),E.isNullOrUndefined(i)&&(i=(s?l.querySelector(".e-input-in-wrap"):l).querySelector(".e-input-group-icon")),E.isNullOrUndefined(i)?s&&(i=l.querySelector(".e-input-group-icon")):(n=l.querySelector("."+p.FLOATLINE),a=l.querySelector("."+p.FLOATTEXT),(s=s?l.querySelector(".e-input-in-wrap"):l).insertBefore(t,i),s.insertBefore(n,i),s.insertBefore(a,i))):Z(r),G(e,t.parentElement)},n.createSpanElement=ct,n.setRipple=function(t,e){for(var i=0;i<e.length;i++)mt(t,e[parseInt(i.toString(),10)].container)},n.addIcon=function(t,e,i,s,n){if(e="string"==typeof e?e.split(","):e,"append"===t.toLowerCase())for(var a=0,l=e;a<l.length;a++)bt(l[a],i,n);else for(var r=0,o=e;r<o.length;r++)yt(o[r],i,s,n);i.getElementsByClassName("e-input-group-icon")[0]&&i.getElementsByClassName("e-float-text-overflow")[0]&&i.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon")},n.prependSpan=yt,n.appendSpan=bt,n.validateInputType=Ct,n.updateHTMLAttributesToElement=function(t,e){if(!E.isNullOrUndefined(t))for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i];D.indexOf(n)<0&&e.setAttribute(n,t[""+n])}},n.updateCssClass=function(t,e,i){nt(Et(t),[i],Et(e))},n.getInputValidClassList=Et,n.updateHTMLAttributesToWrapper=function(t,e){if(!E.isNullOrUndefined(t))for(var i=0,s=Object.keys(t);i<s.length;i++){var n,a=s[i];-1<D.indexOf(a)&&("class"===a?""!==(n=this.getInputValidClassList(t[""+a]))&&E.addClass([e],n.split(" ")):"style"===a?(n=e.getAttribute(a),n=E.isNullOrUndefined(n)?t[""+a]:n+t[""+a],e.setAttribute(a,n)):e.setAttribute(a,t[""+a]))}},n.isBlank=function(t){return!t||/^\s*$/.test(t)};xt=function(t,e){return(xt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var xt,St,Tt=function(t,e){function i(){this.constructor=t}xt(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},t=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},Pt="e-input-group-icon",Ot="e-spin-up",wt="e-error",Lt="increment",kt="decrement",At=new RegExp("^(-)?(\\d*)$"),Nt="e-input-focus",Ht=["title","style","class"],Bt=0,Rt=(St=E.Component,Tt(e,St),e.prototype.preRender=function(){this.isPrevFocused=!1,this.decimalSeparator=".",this.intRegExp=new RegExp("/^(-)?(d*)$/"),this.isCalled=!1;var t=E.getValue("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),E.removeClass([this.cloneElement],["e-control","e-numerictextbox","e-lib"]),this.angularTagName=null,this.formEle=E.closest(this.element,"form"),"EJS-NUMERICTEXTBOX"===this.element.tagName){this.angularTagName=this.element.tagName;for(var e=this.createElement("input"),i=0;i<this.element.attributes.length;i++){var s=this.element.attributes[i].nodeName;"id"!==s&&"class"!==s?(e.setAttribute(this.element.attributes[i].nodeName,this.element.attributes[i].nodeValue),e.innerHTML=this.element.innerHTML):"class"===s&&e.setAttribute(s,this.element.className.split(" ").filter(function(t){return 0!==t.indexOf("ng-")}).join(" "))}this.element.hasAttribute("name")&&this.element.removeAttribute("name"),this.element.classList.remove("e-control","e-numerictextbox"),this.element.appendChild(e),this.element=e,E.setValue("ej2_instances",t,this.element)}E.attributes(this.element,{role:"spinbutton",tabindex:"0",autocomplete:"off"});t={incrementTitle:"Increment value",decrementTitle:"Decrement value",placeholder:this.placeholder};this.l10n=new E.L10n("numerictextbox",t,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.element.hasAttribute("id")||this.element.setAttribute("id",E.getUniqueID("numerictextbox")),this.isValidState=!0,this.inputStyle=null,this.inputName=null,this.cultureInfo={},this.initCultureInfo(),this.initCultureFunc(),this.prevValue=this.value,this.updateHTMLAttrToElement(),this.checkAttributes(!1),this.formEle&&(this.inputEleValue=this.value),this.validateMinMax(),this.validateStep(),null===this.placeholder&&this.updatePlaceholder()},e.prototype.render=function(){"input"===this.element.tagName.toLowerCase()&&(this.createWrapper(),this.showSpinButton&&this.spinBtnCreation(),this.setElementWidth(this.width),this.container.classList.contains("e-input-group")||this.container.classList.add("e-input-group"),this.changeValue(null===this.value||isNaN(this.value)?null:this.strictMode?this.trimValue(this.value):this.value),this.wireEvents(),null===this.value||isNaN(this.value)||this.decimals&&this.setProperties({value:this.roundNumber(this.value,this.decimals)},!0),(this.element.getAttribute("value")||this.value)&&(this.element.setAttribute("value",this.element.value),this.hiddenInput.setAttribute("value",this.hiddenInput.value)),this.elementPrevValue=this.element.value,this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),this.element.hasAttribute("aria-labelledby")||this.element.hasAttribute("placeholder")||this.element.hasAttribute("aria-label")||this.element.setAttribute("aria-label","numerictextbox"),!E.isNullOrUndefined(E.closest(this.element,"fieldset"))&&E.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.updateFloatLabelOverflowWidth(),this.createPrependTemplate(),this.createAppendTemplate(),this.renderComplete())},e.prototype.checkAttributes=function(t){for(var e=0,i=t?E.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["value","min","max","step","disabled","readonly","style","name","placeholder"];e<i.length;e++){var s,n,a,l=i[e];if(!E.isNullOrUndefined(this.element.getAttribute(l)))switch(l){case"disabled":(E.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.enabled||t)&&(s="disabled"!==this.element.getAttribute(l)&&""!==this.element.getAttribute(l)&&"true"!==this.element.getAttribute(l),this.setProperties({enabled:s},!t));break;case"readonly":(E.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.readonly||t)&&(s="readonly"===this.element.getAttribute(l)||""===this.element.getAttribute(l)||"true"===this.element.getAttribute(l),this.setProperties({readonly:s},!t));break;case"placeholder":(E.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"value":(E.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.value||t)&&(n=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(l)),this.setProperties(E.setValue(l,n,{}),!t));break;case"min":!E.isNullOrUndefined(this.numericOptions)&&void 0!==this.numericOptions.min&&!t||null===(n=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(l)))||isNaN(n)||this.setProperties(E.setValue(l,n,{}),!t);break;case"max":!E.isNullOrUndefined(this.numericOptions)&&void 0!==this.numericOptions.max&&!t||null===(a=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(l)))||isNaN(a)||this.setProperties(E.setValue(l,a,{}),!t);break;case"step":!E.isNullOrUndefined(this.numericOptions)&&void 0!==this.numericOptions.step&&!t||null===(a=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(l)))||isNaN(a)||this.setProperties(E.setValue(l,a,{}),!t);break;case"style":this.inputStyle=this.element.getAttribute(l);break;case"name":this.inputName=this.element.getAttribute(l);break;default:var r=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(l));(null===r||isNaN(r))&&"value"!==l||this.setProperties(E.setValue(l,r,{}),!0)}}},e.prototype.updatePlaceholder=function(){this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0)},e.prototype.initCultureFunc=function(){this.instance=new E.Internationalization(this.locale)},e.prototype.initCultureInfo=function(){this.cultureInfo.format=this.format,null!==E.getValue("currency",this)&&(E.setValue("currency",this.currency,this.cultureInfo),this.setProperties({currencyCode:this.currency},!0))},e.prototype.createWrapper=function(){var t=this.cssClass,t=(E.isNullOrUndefined(this.cssClass)||""===this.cssClass||(t=this.getNumericValidClassList(this.cssClass)),o.Input.createInput({element:this.element,floatLabelType:this.floatLabelType,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:t,enableRtl:this.enableRtl,showClearButton:this.showClearButton,enabled:this.enabled}},this.createElement));this.inputWrapper=t,this.container=t.container,this.container.setAttribute("class","e-control-wrapper e-numeric "+this.container.getAttribute("class")),this.updateHTMLAttrToWrapper(),this.readonly&&E.attributes(this.element,{"aria-readonly":"true"}),this.hiddenInput=this.createElement("input",{attrs:{type:"text","data-validateHidden":"true","aria-label":"hidden",class:"e-numeric-hidden"}}),this.inputName=null!==this.inputName?this.inputName:this.element.id,this.element.removeAttribute("name"),this.isAngular&&"EJS-NUMERICTEXTBOX"===this.angularTagName&&0<this.cloneElement.id.length?E.attributes(this.hiddenInput,{name:this.cloneElement.id}):E.attributes(this.hiddenInput,{name:this.inputName}),this.container.insertBefore(this.hiddenInput,this.container.childNodes[1]),this.updateDataAttribute(!1),null!==this.inputStyle&&E.attributes(this.container,{style:this.inputStyle})},e.prototype.updateDataAttribute=function(t){var e={};if(t)e=this.htmlAttributes;else for(var i=0;i<this.element.attributes.length;i++)e[this.element.attributes[i].name]=this.element.getAttribute(this.element.attributes[i].name);for(var s=0,n=Object.keys(e);s<n.length;s++){var a=n[s];0===a.indexOf("data")&&this.hiddenInput.setAttribute(a,e[""+a])}},e.prototype.updateHTMLAttrToElement=function(){if(!E.isNullOrUndefined(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var i=e[t];Ht.indexOf(i)<0&&this.element.setAttribute(i,this.htmlAttributes[""+i])}},e.prototype.updateCssClass=function(t,e){o.Input.setCssClass(this.getNumericValidClassList(t),[this.container],this.getNumericValidClassList(e))},e.prototype.getNumericValidClassList=function(t){var e=t;return e=E.isNullOrUndefined(t)||""===t?e:t.replace(/\s+/g," ").trim()},e.prototype.updateHTMLAttrToWrapper=function(){if(!E.isNullOrUndefined(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var i,s=e[t];-1<Ht.indexOf(s)&&("class"===s?""!==(i=this.getNumericValidClassList(this.htmlAttributes[""+s]))&&E.addClass([this.container],i.split(" ")):"style"===s?(i=this.container.getAttribute(s),i=E.isNullOrUndefined(i)?this.htmlAttributes[""+s]:i+this.htmlAttributes[""+s],this.container.setAttribute(s,i)):this.container.setAttribute(s,this.htmlAttributes[""+s]))}},e.prototype.setElementWidth=function(t){E.isNullOrUndefined(t)||("number"==typeof t?this.container.style.width=E.formatUnit(t):"string"==typeof t&&(this.container.style.width=t.match(/px|%|em/)?t:E.formatUnit(t)))},e.prototype.spinBtnCreation=function(){this.spinDown=o.Input.appendSpan(Pt+" e-spin-down",this.container,this.createElement),E.attributes(this.spinDown,{title:this.l10n.getConstant("decrementTitle")}),this.spinUp=o.Input.appendSpan(Pt+" "+Ot,this.container,this.createElement),E.attributes(this.spinUp,{title:this.l10n.getConstant("incrementTitle")}),this.wireSpinBtnEvents()},e.prototype.validateMinMax=function(){"number"==typeof this.min&&!isNaN(this.min)||this.setProperties({min:-Number.MAX_VALUE},!0),"number"==typeof this.max&&!isNaN(this.max)||this.setProperties({max:Number.MAX_VALUE},!0),null!==this.decimals&&(this.min!==-Number.MAX_VALUE&&this.setProperties({min:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.min))},!0),this.max!==Number.MAX_VALUE)&&this.setProperties({max:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.max))},!0),this.setProperties({min:this.min>this.max?this.max:this.min},!0),this.min!==-Number.MAX_VALUE&&E.attributes(this.element,{"aria-valuemin":this.min.toString()}),this.max!==Number.MAX_VALUE&&E.attributes(this.element,{"aria-valuemax":this.max.toString()})},e.prototype.formattedValue=function(t,e){return this.instance.getNumberFormat({maximumFractionDigits:t,minimumFractionDigits:t,useGrouping:!1})(e)},e.prototype.validateStep=function(){null!==this.decimals&&this.setProperties({step:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.step))},!0)},e.prototype.action=function(t,e){this.isInteract=!0;var i=this.isFocused?this.instance.getNumberParser({format:"n"})(this.element.value):this.value;this.changeValue(this.performAction(i,this.step,t)),this.raiseChangeEvent(e)},e.prototype.checkErrorClass=function(){this.isValidState?E.removeClass([this.container],wt):E.addClass([this.container],wt),E.attributes(this.element,{"aria-invalid":this.isValidState?"false":"true"})},e.prototype.bindClearEvent=function(){this.showClearButton&&E.EventHandler.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this)},e.prototype.resetHandler=function(t){t.preventDefault(),this.inputWrapper.clearButton.classList.contains("e-clear-icon-hide")&&!this.inputWrapper.container.classList.contains("e-static-clear")||this.clear(t),this.isInteract=!0,this.raiseChangeEvent(t)},e.prototype.clear=function(t){var e,i;this.prevValue=this.instance.getNumberParser({format:"n"})(this.element.value),this.setProperties({value:null},!0),this.setElementValue(""),this.hiddenInput.value="",E.closest(this.element,"form")&&(e=this.element.nextElementSibling,(i=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),e.dispatchEvent(i))},e.prototype.resetFormHandler=function(){"EJS-NUMERICTEXTBOX"===this.element.tagName?this.updateValue(null):this.updateValue(this.inputEleValue)},e.prototype.setSpinButton=function(){E.isNullOrUndefined(this.spinDown)||E.attributes(this.spinDown,{title:this.l10n.getConstant("decrementTitle"),"aria-label":this.l10n.getConstant("decrementTitle")}),E.isNullOrUndefined(this.spinUp)||E.attributes(this.spinUp,{title:this.l10n.getConstant("incrementTitle"),"aria-label":this.l10n.getConstant("incrementTitle")})},e.prototype.wireEvents=function(){E.EventHandler.add(this.element,"focus",this.focusHandler,this),E.EventHandler.add(this.element,"blur",this.focusOutHandler,this),E.EventHandler.add(this.element,"keydown",this.keyDownHandler,this),E.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),E.EventHandler.add(this.element,"input",this.inputHandler,this),E.EventHandler.add(this.element,"keypress",this.keyPressHandler,this),E.EventHandler.add(this.element,"change",this.changeHandler,this),E.EventHandler.add(this.element,"paste",this.pasteHandler,this),this.enabled&&(this.bindClearEvent(),this.formEle)&&E.EventHandler.add(this.formEle,"reset",this.resetFormHandler,this),this.resizeHandler=this.windowResize.bind(this),window.addEventListener("resize",this.resizeHandler)},e.prototype.wireSpinBtnEvents=function(){E.EventHandler.add(this.spinUp,E.Browser.touchStartEvent,this.mouseDownOnSpinner,this),E.EventHandler.add(this.spinDown,E.Browser.touchStartEvent,this.mouseDownOnSpinner,this),E.EventHandler.add(this.spinUp,E.Browser.touchEndEvent,this.mouseUpOnSpinner,this),E.EventHandler.add(this.spinDown,E.Browser.touchEndEvent,this.mouseUpOnSpinner,this),E.EventHandler.add(this.spinUp,E.Browser.touchMoveEvent,this.touchMoveOnSpinner,this),E.EventHandler.add(this.spinDown,E.Browser.touchMoveEvent,this.touchMoveOnSpinner,this)},e.prototype.unwireEvents=function(){E.EventHandler.remove(this.element,"focus",this.focusHandler),E.EventHandler.remove(this.element,"blur",this.focusOutHandler),E.EventHandler.remove(this.element,"keyup",this.keyUpHandler),E.EventHandler.remove(this.element,"input",this.inputHandler),E.EventHandler.remove(this.element,"keydown",this.keyDownHandler),E.EventHandler.remove(this.element,"keypress",this.keyPressHandler),E.EventHandler.remove(this.element,"change",this.changeHandler),E.EventHandler.remove(this.element,"paste",this.pasteHandler),this.formEle&&E.EventHandler.remove(this.formEle,"reset",this.resetFormHandler),this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null)},e.prototype.unwireSpinBtnEvents=function(){E.EventHandler.remove(this.spinUp,E.Browser.touchStartEvent,this.mouseDownOnSpinner),E.EventHandler.remove(this.spinDown,E.Browser.touchStartEvent,this.mouseDownOnSpinner),E.EventHandler.remove(this.spinUp,E.Browser.touchEndEvent,this.mouseUpOnSpinner),E.EventHandler.remove(this.spinDown,E.Browser.touchEndEvent,this.mouseUpOnSpinner),E.EventHandler.remove(this.spinUp,E.Browser.touchMoveEvent,this.touchMoveOnSpinner),E.EventHandler.remove(this.spinDown,E.Browser.touchMoveEvent,this.touchMoveOnSpinner)},e.prototype.updatePrependTemplate=function(){this.removePrependTemplate(),this.createPrependTemplate()},e.prototype.updateAppendTemplate=function(){this.removeAppendTemplate(),this.createAppendTemplate()},e.prototype.templateComplier=function(e){if(e)try{return"function"!=typeof e&&E.selectAll(e,document).length?E.compile(E.select(e,document).innerHTML.trim()):E.compile(e)}catch(t){return E.compile(e)}},e.prototype.createPrependTemplate=function(){var t,e;E.isNullOrUndefined(this.prependTemplate)||(t=this.container,this.prependedElement=this.createElement("div",{className:"e-prepend-template"}),this.iconTemplateFunction=this.templateComplier(this.prependTemplate),(e=this.iconTemplateFunction(null,this,"template",this.element.id+"Template",this.isStringTemplate,null,this.prependedElement))&&(e=[].slice.call(e),E.append(e,this.prependedElement)),e=t.querySelector("input"),t.classList.add("e-prepend-wrapper"),e?t.insertBefore(this.prependedElement,e):t.insertBefore(this.prependedElement,t.firstChild),this.handleFloatLabel(),this.renderReactTemplates())},e.prototype.createAppendTemplate=function(){var t,e;E.isNullOrUndefined(this.appendTemplate)||(t=this.container,this.appendedElement=this.createElement("div",{className:"e-append-template"}),this.iconTemplateFunction=this.templateComplier(this.appendTemplate),(e=this.iconTemplateFunction(null,this,"template",this.element.id+"Template",this.isStringTemplate,null,this.appendedElement))&&(e=[].slice.call(e),E.append(e,this.appendedElement)),t.classList.add("e-append-wrapper"),e=t.querySelector(".e-spin-down"),this.showSpinButton&&e?t.insertBefore(this.appendedElement,e):t.appendChild(this.appendedElement),this.handleFloatLabel(),this.renderReactTemplates())},e.prototype.handleFloatLabel=function(){var t=this.container.querySelector(".e-float-text");t&&"Auto"===this.floatLabelType&&setTimeout(function(){t&&this.prependedElement&&!this.enableRtl?(t.style.marginLeft=this.prependedElement.offsetWidth+"px",t.style.marginRight="0"):t&&this.prependedElement&&this.enableRtl&&(t.style.marginRight=this.prependedElement.offsetWidth+"px",t.style.marginLeft="0"),t&&t.classList.contains("e-label-bottom")&&(t.style.width=this.element.offsetWidth+"px")}.bind(this),5)},e.prototype.removePrependTemplate=function(){E.isNullOrUndefined(this.prependedElement)||(E.detach(this.prependedElement),this.prependedElement=null)},e.prototype.removeAppendTemplate=function(){E.isNullOrUndefined(this.appendedElement)||(E.detach(this.appendedElement),this.appendedElement=null)},e.prototype.changeHandler=function(t){t.stopPropagation(),this.element.value.length||this.setProperties({value:null},!0);var e=this.instance.getNumberParser({format:"n"})(this.element.value);this.updateValue(e,t)},e.prototype.raiseChangeEvent=function(t){var e;this.inputValue=E.isNullOrUndefined(this.inputValue)||isNaN(this.inputValue)?null:this.inputValue,this.prevValue===this.value&&this.prevValue===this.inputValue||(e={},this.changeEventArgs={value:this.value,previousValue:this.prevValue,isInteracted:this.isInteract,isInteraction:this.isInteract,event:t},t&&(this.changeEventArgs.event=t),void 0===this.changeEventArgs.event&&(this.changeEventArgs.isInteracted=!1,this.changeEventArgs.isInteraction=!1),E.merge(e,this.changeEventArgs),this.prevValue=this.value,this.isInteract=!1,this.elementPrevValue=this.element.value,this.preventChange=!1,this.trigger("change",e))},e.prototype.pasteHandler=function(){var t,e=this;this.enabled&&!this.readonly&&(t=this.element.value,setTimeout(function(){e.numericRegex().test(e.element.value)||e.setElementValue(t)}))},e.prototype.preventHandler=function(){var a=this,l=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);setTimeout(function(){var t,e,i,s,n;0<a.element.selectionStart&&(t=a.element.selectionStart,e=a.element.selectionStart-1,i=a.element.value.split(""),s=E.getNumericObject(a.locale),n=(s=E.getValue("decimal",s)).charCodeAt(0)," "===a.element.value[e]&&0<a.element.selectionStart&&!l?(E.isNullOrUndefined(a.prevVal)?a.element.value=a.element.value.trim():0!=e?a.element.value=a.prevVal:0==e&&(a.element.value=a.element.value.trim()),a.element.setSelectionRange(e,e)):isNaN(parseFloat(a.element.value[a.element.selectionStart-1]))&&45!==a.element.value[a.element.selectionStart-1].charCodeAt(0)?(i.indexOf(a.element.value[a.element.selectionStart-1])!==i.lastIndexOf(a.element.value[a.element.selectionStart-1])&&a.element.value[a.element.selectionStart-1].charCodeAt(0)===n||a.element.value[a.element.selectionStart-1].charCodeAt(0)!==n)&&(a.element.value=a.element.value.substring(0,e)+a.element.value.substring(t,a.element.value.length),a.element.setSelectionRange(e,e),isNaN(parseFloat(a.element.value[a.element.selectionStart-1])))&&0<a.element.selectionStart&&a.element.value.length&&a.preventHandler():isNaN(parseFloat(a.element.value[a.element.selectionStart-2]))&&1<a.element.selectionStart&&45!==a.element.value[a.element.selectionStart-2].charCodeAt(0)&&(i.indexOf(a.element.value[a.element.selectionStart-2])!==i.lastIndexOf(a.element.value[a.element.selectionStart-2])&&a.element.value[a.element.selectionStart-2].charCodeAt(0)===n||a.element.value[a.element.selectionStart-2].charCodeAt(0)!==n)&&(a.element.setSelectionRange(e,e),a.nextEle=a.element.value[a.element.selectionStart],a.cursorPosChanged=!0,a.preventHandler()),!0===a.cursorPosChanged&&a.element.value[a.element.selectionStart]===a.nextEle&&isNaN(parseFloat(a.element.value[a.element.selectionStart-1]))&&(a.element.setSelectionRange(a.element.selectionStart+1,a.element.selectionStart+1),a.cursorPosChanged=!1,a.nextEle=null),""===a.element.value.trim()&&a.element.setSelectionRange(0,0),0<a.element.selectionStart&&(45===a.element.value[a.element.selectionStart-1].charCodeAt(0)&&1<a.element.selectionStart&&(E.isNullOrUndefined(a.prevVal)||(a.element.value=a.prevVal),a.element.setSelectionRange(a.element.selectionStart,a.element.selectionStart)),a.element.value[a.element.selectionStart-1]===s)&&0===a.decimals&&a.validateDecimalOnType&&(a.element.value=a.element.value.substring(0,e)+a.element.value.substring(t,a.element.value.length)),a.prevVal=a.element.value)})},e.prototype.keyUpHandler=function(){var t,e;this.enabled&&!this.readonly&&(!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)||!E.Browser.isDevice||this.preventHandler(),t=null===(t=this.instance.getNumberParser({format:"n"})(this.element.value))||isNaN(t)?null:t,this.hiddenInput.value=t||0===t?t.toString():null,E.closest(this.element,"form"))&&(t=this.element.nextElementSibling,(e=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),t.dispatchEvent(e))},e.prototype.inputHandler=function(t){var e,i;this.enabled&&!this.readonly&&(e=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform),(-1<navigator.userAgent.toLowerCase().indexOf("firefox")||e)&&E.Browser.isDevice&&this.preventHandler(),this.isAngular&&this.element.value!==E.getValue("decimal",E.getNumericObject(this.locale))&&this.element.value!==E.getValue("minusSign",E.getNumericObject(this.locale))&&this.numericRegex().test(this.element.value)&&(e=this.instance.getNumberParser({format:"n"})(this.element.value),e=isNaN(e)?null:e,this.localChange({value:e}),this.preventChange=!0),this.isVue)&&(e=this.instance.getNumberParser({format:"n"})(this.element.value),i=this.instance.getNumberParser({format:"n"})(this.elementPrevValue),t={event:t,value:null===(e=!new RegExp("[^0-9]+$").test(this.element.value)&&(-1===this.elementPrevValue.indexOf(".")&&-1===this.elementPrevValue.indexOf("-")||"0"!==this.element.value[this.element.value.length-1])?e:this.value)||isNaN(e)?null:e,previousValue:null===i||isNaN(i)?null:i},this.preventChange=!0,this.elementPrevValue=this.element.value,this.trigger("input",t))},e.prototype.keyDownHandler=function(t){if(!this.readonly)switch(t.keyCode){case 38:t.preventDefault(),this.action(Lt,t);break;case 40:t.preventDefault(),this.action(kt,t)}},e.prototype.performAction=function(t,e,i){null!==t&&!isNaN(t)||(t=0);i=this.correctRounding(t,e,i===Lt?t+e:t-e);return this.strictMode?this.trimValue(i):i},e.prototype.correctRounding=function(t,e,i){var s=new RegExp("[,.](.*)"),n=s.test(t.toString()),a=s.test(e.toString());return n||a?(n=n?s.exec(t.toString())[0].length:0,t=a?s.exec(e.toString())[0].length:0,a=Math.max(n,t),this.roundValue(i,a)):i},e.prototype.roundValue=function(t,e){e=e||0;e=Math.pow(10,e);return t*=e,Math.round(t)/e},e.prototype.updateValue=function(t,e){e&&(this.isInteract=!0),null===t||isNaN(t)||this.decimals&&(t=this.roundNumber(t,this.decimals)),this.inputValue=t,this.isVue&&this.element&&this.element.hasAttribute("modelvalue")&&this.isDynamicChange||this.changeValue(null===t||isNaN(t)?null:this.strictMode?this.trimValue(t):t),this.isDynamicChange||this.raiseChangeEvent(e)},e.prototype.updateCurrency=function(t,e){E.setValue(t,e,this.cultureInfo),this.updateValue(this.value)},e.prototype.changeValue=function(t){var e;t||0===t?(e=this.getNumberOfDecimals(t),this.setProperties({value:this.roundNumber(t,e)},!0)):this.setProperties({value:t=null},!0),this.modifyText(),this.strictMode||this.validateState()},e.prototype.modifyText=function(){var t,e;this.value||0===this.value?(t=this.formatNumber(),e=this.isFocused?t:this.instance.getNumberFormat(this.cultureInfo)(this.value),this.setElementValue(e),E.attributes(this.element,{"aria-valuenow":t}),E.isNullOrUndefined(this.hiddenInput)||(this.hiddenInput.value=this.value.toString(),null!==this.value&&this.serverDecimalSeparator&&(this.hiddenInput.value=this.hiddenInput.value.replace(".",this.serverDecimalSeparator)))):(this.setElementValue(""),this.element.removeAttribute("aria-valuenow"),this.hiddenInput.value=null)},e.prototype.setElementValue=function(t,e){o.Input.setValue(t,e||this.element,this.floatLabelType,this.showClearButton)},e.prototype.validateState=function(){this.isValidState=!0,!this.value&&0!==this.value||(this.isValidState=!(this.value>this.max||this.value<this.min)),this.checkErrorClass()},e.prototype.getNumberOfDecimals=function(t){var e=new RegExp("[eE][-+]?([0-9]+)"),i=t.toString(),t=(e.test(i)&&(/[eE]/.test(i)?"."===(i=t.toFixed(20).replace(/0+$/,"")).charAt(i.length-1)&&(i=i.slice(0,i.length-1)):(e=e.exec(i),E.isNullOrUndefined(e)||(i=t.toFixed(Math.min(parseInt(e[1],10),20))))),i.split(".")[1]),e=t&&t.length?t.length:0;return e=null!==this.decimals?e<this.decimals?e:this.decimals:e},e.prototype.formatNumber=function(){var t=this.getNumberOfDecimals(this.value);return this.instance.getNumberFormat({maximumFractionDigits:t,minimumFractionDigits:t,useGrouping:!1})(this.value)},e.prototype.trimValue=function(t){return t>this.max?this.max:t<this.min?this.min:t},e.prototype.roundNumber=function(t,e){var i=t,e=e||0,s=i.toString().split("e"),s=(i=Math.round(Number(s[0]+"e"+(s[1]?Number(s[1])+e:e)))).toString().split("e");return i=Number(s[0]+"e"+(s[1]?Number(s[1])-e:-e)),isNaN(i)&&(i=t),Number(i.toFixed(e))},e.prototype.cancelEvent=function(t){return t.preventDefault(),!1},e.prototype.keyPressHandler=function(t){if(!this.enabled||this.readonly)return!0;if(!E.Browser.isDevice&&"11.0"===E.Browser.info.version&&13===t.keyCode)return e=this.instance.getNumberParser({format:"n"})(this.element.value),this.updateValue(e,t),!0;if(0===t.which||t.metaKey||t.ctrlKey||8===t.keyCode||13===t.keyCode)return!0;var e=String.fromCharCode(t.which),i=E.getValue("decimal",E.getNumericObject(this.locale)),s="NumpadDecimal"===t.code&&e!==i;s&&(e=i);i=(i=this.element.value).substring(0,this.element.selectionStart)+e+i.substring(this.element.selectionEnd);return this.numericRegex().test(i)?(s&&(e=this.element.selectionStart+1,this.element.value=i,this.element.setSelectionRange(e,e),t.preventDefault(),t.stopPropagation()),!0):(t.preventDefault(),t.stopPropagation(),!1)},e.prototype.numericRegex=function(){var t=E.getNumericObject(this.locale),t=E.getValue("decimal",t),e="*";return"."===t&&(t="\\"+t),0===this.decimals&&this.validateDecimalOnType?At:(this.decimals&&this.validateDecimalOnType&&(e="{0,"+this.decimals+"}"),new RegExp("^\\s*(-)?(((\\d+("+t+"\\d"+e+")?)|("+t+"\\d"+e+")))?$"))},e.prototype.mouseWheel=function(t){var e;this.allowMouseWheel&&(t.preventDefault(),t.wheelDelta?e=t.wheelDelta/120:t.detail&&(e=-t.detail/3),0<e?this.action(Lt,t):e<0&&this.action(kt,t),this.cancelEvent(t))},e.prototype.windowResize=function(){this.updateFloatLabelOverflowWidth()},e.prototype.focusHandler=function(t){var e,i,s=this;clearTimeout(Bt),this.focusEventArgs={event:t,value:this.value,container:this.container},this.trigger("focus",this.focusEventArgs),this.enabled&&!this.readonly&&(this.isFocused=!0,"Never"!==this.floatLabelType&&this.inputWrapper&&this.inputWrapper.container&&(t=this.inputWrapper.container.querySelector(".e-float-text"))&&t.removeAttribute("style"),this.prevValue=this.value,!this.value&&0!==this.value||(e=this.formatNumber(),this.setElementValue(e),this.isPrevFocused)||(E.Browser.isDevice||"11.0"!==E.Browser.info.version?(t=E.Browser.isDevice&&E.Browser.isIos?600:0,Bt=setTimeout(function(){s.element.setSelectionRange(0,e.length)},t)):this.element.setSelectionRange(0,e.length)),!E.Browser.isDevice&&this.allowMouseWheel&&E.EventHandler.add(this.element,"mousewheel DOMMouseScroll",this.mouseWheel,this),i=this.container.querySelector(".e-float-text"),"Auto"===this.floatLabelType)&&(this.prependTemplate||this.appendTemplate)&&i&&setTimeout(function(){i&&(i.style.width="auto")}.bind(this),5)},e.prototype.focusOutHandler=function(t){var e,i,s,n,a=this;this.blurEventArgs={event:t,value:this.value,container:this.container},this.trigger("blur",this.blurEventArgs),this.enabled&&!this.readonly&&(this.isPrevFocused?(t.preventDefault(),E.Browser.isDevice&&(e=this.element.value,this.element.focus(),this.isPrevFocused=!1,i=this.element,setTimeout(function(){a.setElementValue(e,i)},200))):(this.isFocused=!1,this.element.value.length||this.setProperties({value:null},!0),t=this.instance.getNumberParser({format:"n"})(this.element.value),this.updateValue(t),E.Browser.isDevice||E.EventHandler.remove(this.element,"mousewheel DOMMouseScroll",this.mouseWheel)),this.updateFloatLabelOverflowWidth(),s=this.container.querySelector(".e-float-text"),"Auto"===this.floatLabelType&&(this.prependTemplate||this.appendTemplate)&&s&&setTimeout(function(){s&&this.prependedElement&&!this.enableRtl?s.style.marginLeft=this.prependedElement.offsetWidth+"px":s&&this.prependedElement&&this.enableRtl&&(s.style.marginRight=this.prependedElement.offsetWidth+"px"),s&&s.classList.contains("e-label-bottom")&&(s.style.width=this.element.offsetWidth+"px")}.bind(this),5),E.closest(this.element,"form"))&&(t=this.element.nextElementSibling,(n=document.createEvent("FocusEvent")).initEvent("focusout",!1,!0),t.dispatchEvent(n))},e.prototype.mouseDownOnSpinner=function(t){var e,i,s=this;this.isFocused&&(this.isPrevFocused=!0,t.preventDefault()),this.getElementData(t)&&(this.getElementData(t),e=t.currentTarget,i=e.classList.contains(Ot)?Lt:kt,E.EventHandler.add(e,"mouseleave",this.mouseUpClick,this),this.timeOut=setInterval(function(){s.isCalled=!0,s.action(i,t)},150),E.EventHandler.add(document,"mouseup",this.mouseUpClick,this))},e.prototype.touchMoveOnSpinner=function(t){var e;("touchmove"===t.type?(e=t.touches).length&&document.elementFromPoint(e[0].pageX,e[0].pageY):document.elementFromPoint(t.clientX,t.clientY)).classList.contains(Pt)||clearInterval(this.timeOut)},e.prototype.mouseUpOnSpinner=function(t){var e,i;this.prevValue=this.value,this.isPrevFocused&&(this.element.focus(),E.Browser.isDevice||(this.isPrevFocused=!1)),E.Browser.isDevice||t.preventDefault(),this.getElementData(t)&&(i=(e=t.currentTarget).classList.contains(Ot)?Lt:kt,E.EventHandler.remove(e,"mouseleave",this.mouseUpClick),this.isCalled||this.action(i,t),this.isCalled=!1,E.EventHandler.remove(document,"mouseup",this.mouseUpClick),E.closest(this.element,"form"))&&(e=this.element.nextElementSibling,(i=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),e.dispatchEvent(i))},e.prototype.getElementData=function(t){return!(t.which&&3===t.which||t.button&&2===t.button||!this.enabled||this.readonly||(clearInterval(this.timeOut),0))},e.prototype.floatLabelTypeUpdate=function(){o.Input.removeFloating(this.inputWrapper);var t=this.hiddenInput;this.hiddenInput.remove(),o.Input.addFloating(this.element,this.floatLabelType,this.placeholder,this.createElement),this.container.insertBefore(t,this.container.childNodes[1])},e.prototype.mouseUpClick=function(t){t.stopPropagation(),clearInterval(this.timeOut),this.isCalled=!1,this.spinUp&&E.EventHandler.remove(this.spinUp,"mouseleave",this.mouseUpClick),this.spinDown&&E.EventHandler.remove(this.spinDown,"mouseleave",this.mouseUpClick)},e.prototype.increment=function(t){void 0===t&&(t=this.step),this.isInteract=!1,this.changeValue(this.performAction(this.value,t,Lt)),this.raiseChangeEvent()},e.prototype.decrement=function(t){void 0===t&&(t=this.step),this.isInteract=!1,this.changeValue(this.performAction(this.value,t,kt)),this.raiseChangeEvent()},e.prototype.destroy=function(){this.unwireEvents(),this.removePrependTemplate(),this.removeAppendTemplate(),this.clearTemplate(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),E.detach(this.hiddenInput),this.showSpinButton&&(this.unwireSpinBtnEvents(),E.detach(this.spinUp),E.detach(this.spinDown));for(var t=["aria-labelledby","role","autocomplete","aria-readonly","aria-disabled","autocapitalize","spellcheck","aria-autocomplete","tabindex","aria-valuemin","aria-valuemax","aria-valuenow","aria-invalid"],e=0;e<t.length;e++)this.element.removeAttribute(t[e]);this.element.classList.remove("e-input"),this.container.insertAdjacentElement("afterend",this.element),E.detach(this.container),this.spinUp=null,this.spinDown=null,this.container=null,this.hiddenInput=null,this.changeEventArgs=null,this.blurEventArgs=null,this.focusEventArgs=null,this.inputWrapper=null,o.Input.destroy({element:this.element,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),"EJS-NUMERICTEXTBOX"===this.element.tagName&&E.setValue("ej2_instances",null,this.element),St.prototype.destroy.call(this)},e.prototype.getText=function(){return this.element.value},e.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.element.focus(),E.addClass([this.container],[Nt]))},e.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.element.blur(),E.removeClass([this.container],[Nt]))},e.prototype.getPersistData=function(){return this.addOnPersist(["value"])},e.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i];switch(n){case"width":this.setElementWidth(t.width),o.Input.calculateWidth(this.element,this.container);break;case"cssClass":this.updateCssClass(t.cssClass,e.cssClass);break;case"enabled":o.Input.setEnabled(t.enabled,this.element),this.bindClearEvent();break;case"enableRtl":o.Input.setEnableRtl(t.enableRtl,[this.container]),this.handleFloatLabel();break;case"readonly":o.Input.setReadonly(t.readonly,this.element),this.readonly?E.attributes(this.element,{"aria-readonly":"true"}):this.element.removeAttribute("aria-readonly");break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.updateDataAttribute(!0),this.checkAttributes(!0),o.Input.validateInputType(this.container,this.element);break;case"placeholder":o.Input.setPlaceholder(t.placeholder,this.element,this.getModuleName()),o.Input.calculateWidth(this.element,this.container);break;case"step":this.step=t.step,this.validateStep();break;case"showSpinButton":this.updateSpinButton(t);break;case"showClearButton":this.updateClearButton(t);break;case"floatLabelType":this.floatLabelType=t.floatLabelType,this.floatLabelTypeUpdate();break;case"value":this.isAngular&&this.formEle&&e.value===t.value&&(this.preventChange=!0),this.isDynamicChange=(this.isAngular||this.isVue)&&this.preventChange,this.updateValue(t.value),this.isDynamicChange&&(this.preventChange=!1,this.isDynamicChange=!1);break;case"min":case"max":E.setValue(n,E.getValue(n,t),this),this.validateMinMax(),this.updateValue(this.value);break;case"strictMode":this.strictMode=t.strictMode,this.updateValue(this.value),this.validateState();break;case"locale":this.initCultureFunc(),this.l10n.setLocale(this.locale),this.setSpinButton(),this.updatePlaceholder(),o.Input.setPlaceholder(this.placeholder,this.element),this.updateValue(this.value);break;case"currency":var a=E.getValue(n,t);this.setProperties({currencyCode:a},!0),this.updateCurrency(n,a);break;case"currencyCode":a=E.getValue(n,t);this.setProperties({currency:a},!0),this.updateCurrency("currency",a);break;case"format":E.setValue(n,E.getValue(n,t),this),this.initCultureInfo(),this.updateValue(this.value);break;case"decimals":this.decimals=t.decimals,this.updateValue(this.value);break;case"allowMouseWheel":this.allowMouseWheel&&this.isFocused&&E.EventHandler.add(this.element,"mousewheel DOMMouseScroll",this.mouseWheel,this);break;case"prependTemplate":this.updatePrependTemplate();break;case"appendTemplate":this.updateAppendTemplate()}}},e.prototype.updateClearButton=function(t){o.Input.setClearButton(t.showClearButton,this.element,this.inputWrapper,void 0,this.createElement),this.bindClearEvent()},e.prototype.updateSpinButton=function(t){t.showSpinButton?this.spinBtnCreation():(E.detach(this.spinUp),E.detach(this.spinDown))},e.prototype.getRightIconsWidth=function(){for(var t=0,e=this.inputWrapper.container.querySelectorAll(".e-input-group-icon, .e-clear-icon"),i=0;i<e.length;i++)t+=e[i].offsetWidth;return t},e.prototype.updateFloatLabelOverflowWidth=function(){var t=this.inputWrapper.container,e=t.querySelector(".e-float-text-overflow")||t.querySelector(".e-float-text"),t=t.clientWidth-this.getRightIconsWidth();!e||!t||this.cssClass&&-1!==this.cssClass.split(" ").indexOf("e-outline")||(e.style.width=t+"px")},e.prototype.getModuleName=function(){return"numerictextbox"},t([E.Property("")],e.prototype,"cssClass",void 0),t([E.Property(null)],e.prototype,"value",void 0),t([E.Property(-Number.MAX_VALUE)],e.prototype,"min",void 0),t([E.Property(Number.MAX_VALUE)],e.prototype,"max",void 0),t([E.Property(1)],e.prototype,"step",void 0),t([E.Property(null)],e.prototype,"width",void 0),t([E.Property(null)],e.prototype,"placeholder",void 0),t([E.Property({})],e.prototype,"htmlAttributes",void 0),t([E.Property(!0)],e.prototype,"showSpinButton",void 0),t([E.Property(!1)],e.prototype,"readonly",void 0),t([E.Property(!0)],e.prototype,"enabled",void 0),t([E.Property(!1)],e.prototype,"showClearButton",void 0),t([E.Property(!1)],e.prototype,"enablePersistence",void 0),t([E.Property("n2")],e.prototype,"format",void 0),t([E.Property(null)],e.prototype,"decimals",void 0),t([E.Property(null)],e.prototype,"currency",void 0),t([E.Property(null)],e.prototype,"currencyCode",void 0),t([E.Property(!0)],e.prototype,"strictMode",void 0),t([E.Property(!1)],e.prototype,"validateDecimalOnType",void 0),t([E.Property(!0)],e.prototype,"allowMouseWheel",void 0),t([E.Property("Never")],e.prototype,"floatLabelType",void 0),t([E.Property(null)],e.prototype,"prependTemplate",void 0),t([E.Property(null)],e.prototype,"appendTemplate",void 0),t([E.Event()],e.prototype,"created",void 0),t([E.Event()],e.prototype,"destroyed",void 0),t([E.Event()],e.prototype,"change",void 0),t([E.Event()],e.prototype,"focus",void 0),t([E.Event()],e.prototype,"blur",void 0),t([E.NotifyPropertyChanges],e));function e(t,e){e=St.call(this,t,e)||this;return e.preventChange=!1,e.isDynamicChange=!1,e.numericOptions=t,e}var Ut="e-error",It="e-input-group",Ft="e-float-input",Vt="e-utility-mask",Mt="e-label-top",Dt="e-label-bottom",Wt={0:"[0-9]",9:"[0-9 ]","#":"[0-9 +-]",L:"[A-Za-z]","?":"[A-Za-z ]","&":"[^ ]+",C:"[^]+",A:"[A-Za-z0-9]",a:"[A-Za-z0-9 ]"};function zt(){if(E.attributes(this.element,{role:"textbox",autocomplete:"off",autocapitalize:"off",spellcheck:"false","aria-live":"assertive"}),this.mask){for(var t=this.mask.split("]"),e=0;e<t.length;e++)if("\\"===t[e][t[e].length-1]){t[e]=t[e]+"]";for(var i=t[e].split("["),s=0;s<i.length;s++)"\\"===i[s][i[s].length-1]&&(i[s]=i[s]+"["),Gt.call(this,i[s])}else if(1<(i=t[e].split("[")).length)for(var n=!1,s=0;s<i.length;s++)"\\"===i[s]?(this.customRegExpCollec.push("["),this.hiddenMask+=i[s]+"["):""===i[s]?n=!0:""!==i[s]&&n||s===i.length-1?(this.customRegExpCollec.push("["+i[s]+"]"),this.hiddenMask+=this.promptChar,n=!1):Gt.call(this,i[s]);else Gt.call(this,i[0]);if(this.escapeMaskValue=this.hiddenMask,this.promptMask=this.hiddenMask.replace(/[09?LCAa#&]/g,this.promptChar),!E.isNullOrUndefined(this.customCharacters))for(e=0;e<this.promptMask.length;e++)E.isNullOrUndefined(this.customCharacters[this.promptMask[e]])||(this.promptMask=this.promptMask.replace(new RegExp(this.promptMask[e],"g"),this.promptChar));if(this.hiddenMask.match(new RegExp(/\\/)))for(e=0;e<this.hiddenMask.length;e++){var a,s=1<=e?e:0;s-=a=this.hiddenMask.length-this.promptMask.length,0<e&&"\\"!==this.hiddenMask[e-1]&&(">"===this.hiddenMask[e]||"<"===this.hiddenMask[e]||"|"===this.hiddenMask[e])&&(this.promptMask=this.promptMask.substring(0,s)+this.promptMask.substring(e+1-a,this.promptMask.length),this.escapeMaskValue=this.escapeMaskValue.substring(0,s)+this.escapeMaskValue.substring(e+1-a,this.escapeMaskValue.length)),"\\"===this.hiddenMask[e]&&(this.promptMask=this.promptMask.substring(0,s)+this.hiddenMask[e+1]+this.promptMask.substring(e+2-a,this.promptMask.length),this.escapeMaskValue=this.escapeMaskValue.substring(0,s)+this.escapeMaskValue[e+1]+this.escapeMaskValue.substring(e+2-a,this.escapeMaskValue.length))}else this.promptMask=this.promptMask.replace(/[>|<]/g,""),this.escapeMaskValue=this.hiddenMask.replace(/[>|<]/g,"");E.attributes(this.element,{"aria-invalid":"false"})}}function qt(){b.call(this,this.promptMask),Ce.call(this,this.value)}function jt(){E.EventHandler.add(this.element,"keydown",re,this),E.EventHandler.add(this.element,"keypress",de,this),E.EventHandler.add(this.element,"keyup",ce,this),E.EventHandler.add(this.element,"input",le,this),E.EventHandler.add(this.element,"focus",Qt,this),E.EventHandler.add(this.element,"blur",ie,this),E.EventHandler.add(this.element,"paste",se,this),E.EventHandler.add(this.element,"cut",ne,this),E.EventHandler.add(this.element,"drop",ae,this),E.EventHandler.add(this.element,"mousedown",Jt,this),E.EventHandler.add(this.element,"mouseup",$t,this),this.enabled&&(Xt.call(this),this.formElement)&&E.EventHandler.add(this.formElement,"reset",Yt,this)}function _t(){E.EventHandler.remove(this.element,"keydown",re),E.EventHandler.remove(this.element,"keypress",de),E.EventHandler.remove(this.element,"keyup",ce),E.EventHandler.remove(this.element,"input",le),E.EventHandler.remove(this.element,"focus",Qt),E.EventHandler.remove(this.element,"blur",ie),E.EventHandler.remove(this.element,"paste",se),E.EventHandler.remove(this.element,"cut",ne),E.EventHandler.remove(this.element,"drop",ae),E.EventHandler.remove(this.element,"mousedown",Jt),E.EventHandler.remove(this.element,"mouseup",$t),this.formElement&&E.EventHandler.remove(this.formElement,"reset",Yt)}function Xt(){this.showClearButton&&E.EventHandler.add(this.inputObj.clearButton,"mousedown touchstart",Kt,this)}function Kt(t){t.preventDefault(),this.inputObj.clearButton.classList.contains("e-clear-icon-hide")&&!this.inputObj.container.classList.contains("e-static-clear")||(function(t){var e=this.element.value;b.call(this,this.promptMask),this.redoCollec.unshift({value:this.promptMask,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),ue.call(this,t,e),this.element.setSelectionRange(0,0)}.call(this,t),this.value="")}function Yt(){"EJS-MASKEDTEXTBOX"===this.element.tagName?b.call(this,this.promptMask):this.value=this.initInputValue}function Zt(t){return t.value}function d(t,e){var i="",s=0,n=!1,a=!E.isNullOrUndefined(e)||E.isNullOrUndefined(t)||E.isNullOrUndefined(this)?e:t.value;if(a!==this.promptMask)for(var l=0;l<this.customRegExpCollec.length;l++)n=n&&!1,">"!==this.customRegExpCollec[s]&&"<"!==this.customRegExpCollec[s]&&"|"!==this.customRegExpCollec[s]&&"\\"!==this.customRegExpCollec[s]||(--l,n=!0),n||a[l]!==this.promptChar&&!E.isNullOrUndefined(this.customRegExpCollec[s])&&(this._callPasteHandler||!E.isNullOrUndefined(this.regExpCollec[this.customRegExpCollec[s]])&&!this.maskedRegExp.includes(this.customRegExpCollec[s])||2<this.customRegExpCollec[s].length&&"["===this.customRegExpCollec[s][0]&&"]"===this.customRegExpCollec[s][this.customRegExpCollec[s].length-1]||!E.isNullOrUndefined(this.customCharacters)&&!E.isNullOrUndefined(this.customCharacters[this.customRegExpCollec[s]]))&&""!==a&&(i+=a[l]),++s;return i=null===this.mask||""===this.mask&&void 0!==this.value?a:i}function Gt(t){for(var e=0;e<t.length;e++)this.hiddenMask+=t[e],"\\"!==t[e]?this.customRegExpCollec.push(t[e]):"\\"!==t[e]||E.isNullOrUndefined(this.regExpCollec[t[e+1]])||this.maskedRegExp.push(t[e+1])}function Jt(){this.isClicked=!0}function $t(){this.isClicked=!1}function Qt(t){var e,i=this,s=this.element,n=0,a=d.call(this,s),l=!1,r=!1,o={selectionStart:s.selectionStart,event:t,value:this.value,maskedValue:s.value,container:E.isNullOrUndefined(this.inputObj)?this.inputObj:this.inputObj.container,selectionEnd:s.selectionEnd},h=(this.isClicked||te.call(this,o,s),"Never"!==this.floatLabelType&&this.inputObj&&this.inputObj.container&&(e=this.inputObj.container.querySelector(".e-float-text"))&&e.removeAttribute("style"),this.inputObj.container.querySelector(".e-float-text"));if(h&&"Auto"===this.floatLabelType&&(this.prependTemplate||this.appendTemplate)&&setTimeout(function(){h&&(h.style.width="auto")}.bind(this),5),this.mask&&(null!==a&&""!==a||"Always"===this.floatLabelType||null===this.placeholder||""===this.placeholder||(s.value=this.promptMask),setTimeout(function(){if(s.selectionStart===i.promptMask.length||s.value[s.selectionStart]===i.promptChar)l=!0;else for(var t=s.selectionStart;t<i.promptMask.length;t++){if(s.value[t]===i.promptChar){l=!0;break}if(s.value[t]!==i.promptMask[t]){l=!1;break}}}),setTimeout(function(){var t=s.selectionStart-1;if(t==i.promptMask.length-1||s.value[t]===i.promptChar)r=!0;else for(var e=t;0<=e;e--){if(s.value[e]===i.promptChar){r=!0;break}if(s.value[e]!==i.promptMask[e]){r=!1;break}}}),this.isClicked||"Always"!==this.floatLabelType&&(null===a||""===a)&&null!==this.placeholder&&""!==this.placeholder)){for(n=0;n<this.promptMask.length;n++)if(s.value[n]===this.promptChar){setTimeout(function(){(l||r)&&(s.selectionEnd=n,s.selectionStart=n),o={selectionStart:s.selectionStart,event:t,value:i.value,maskedValue:s.value,container:E.isNullOrUndefined(i.inputObj)?i.inputObj:i.inputObj.container,selectionEnd:s.selectionEnd},te.call(i,o,s)},110);break}E.isNullOrUndefined(s.value.match(ee(this.promptChar)))&&(o={selectionStart:s.selectionStart,event:t,value:this.value,maskedValue:s.value,container:E.isNullOrUndefined(this.inputObj)?this.inputObj:this.inputObj.container,selectionEnd:s.selectionEnd},te.call(this,o,s)),this.isClicked=!1}}function te(t,e){this.trigger("focus",t,function(t){e.selectionStart=t.selectionStart,e.selectionEnd=t.selectionEnd})}function ee(t){return E.isNullOrUndefined(t)?t:t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function ie(t){this.blurEventArgs={event:t,value:this.value,maskedValue:this.element.value,container:E.isNullOrUndefined(this.inputObj)?this.inputObj:this.inputObj.container},this.trigger("blur",this.blurEventArgs),this.updateFloatLabelOverflowWidth();var e=this.inputObj.container.querySelector(".e-float-text");"Auto"===this.floatLabelType&&(this.prependTemplate||this.appendTemplate)&&e&&setTimeout(function(){e&&this.prependedElement&&!this.enableRtl?e.style.marginLeft=this.prependedElement.offsetWidth+"px":e&&this.prependedElement&&this.enableRtl&&(e.style.marginRight=this.prependedElement.offsetWidth+"px"),e&&(e.style.width=this.element.offsetWidth+"px")}.bind(this),5),this.mask&&(this.isFocus=!1,this.placeholder)&&this.element.value===this.promptMask&&"Always"!==this.floatLabelType&&(b.call(this,""),t=this.element.parentNode.querySelector(".e-float-text"),"Auto"===this.floatLabelType)&&!E.isNullOrUndefined(t)&&t.classList.contains(Mt)&&E.removeClass([t],Mt)}function se(s){var n,a,l,r=this;this.mask&&!this.readonly&&(n=this.element.selectionStart,a=this.element.selectionEnd,l=this.element.value,b.call(this,""),this._callPasteHandler=!0,setTimeout(function(){var t=r.element.value.replace(/ /g,""),e=(0<r.redoCollec.length&&r.redoCollec[0].value===r.element.value&&(t=d.call(r,r.element)),b.call(r,l),r.element.selectionStart=n,r.element.selectionEnd=a,0);for(r.maskKeyPress=!0;fe.call(r,t[e],!1,null),++e<t.length;);if(r.maskKeyPress=!1,r._callPasteHandler=!1,r.element.value===l){var i=0;for(r.maskKeyPress=!0;fe.call(r,t[i],!1,null),++i<t.length;);r.maskKeyPress=!1}else ue.call(r,s,l)},1))}function ne(t){var e,i,s,n,a=this;this.mask&&!this.readonly&&(e=this.element.value,i=this.element.selectionStart,s=this.element.selectionEnd,this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),n=this.element.value.substring(0,i)+this.promptMask.substring(i,s)+this.element.value.substring(s),setTimeout(function(){b.call(a,n),a.element.selectionStart=a.element.selectionEnd=i,a.element.value!==e&&ue.call(a,t,null)},0))}function ae(t){t.preventDefault()}function le(t){if(!0!==E.Browser.isIE||""!==this.element.value||"Never"!==this.floatLabelType)if(E.extend(t,{ctrlKey:!1,keyCode:229}),this.mask){if(""===this.element.value&&this.redoCollec.unshift({value:this.promptMask,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),1===this.element.value.length&&(this.element.value=this.element.value+this.promptMask,this.element.setSelectionRange(1,1)),this._callPasteHandler||E.Browser.isDevice||pe.call(this,t),this.element.value.length>this.promptMask.length){for(var e=this.element.selectionStart,i=this.element.value.length-this.promptMask.length,s=this.element.value.substring(e-i,e),n=(this.maskKeyPress=!1,0);fe.call(this,s[n],t.ctrlKey,t),++n<s.length;);this.element.value!==this.preEleVal&&ue.call(this,t,null)}i=d.call(this,this.element);this.prevValue=i,""===(this.value=i)&&(b.call(this,this.promptMask),this.element.setSelectionRange(0,0))}}function re(t){var e,i;this.mask&&!this.readonly&&(229!==t.keyCode&&(!t.ctrlKey||89!==t.keyCode&&90!==t.keyCode||t.preventDefault(),pe.call(this,t)),e=this.element.value,!t.ctrlKey||89!==t.keyCode&&90!==t.keyCode||(i=void 0,90===t.keyCode&&0<this.undoCollec.length&&e!==this.undoCollec[this.undoCollec.length-1].value?(i=this.undoCollec[this.undoCollec.length-1],this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),b.call(this,i.value),this.element.selectionStart=i.startIndex,this.element.selectionEnd=i.endIndex,this.undoCollec.splice(this.undoCollec.length-1,1)):89===t.keyCode&&0<this.redoCollec.length&&e!==this.redoCollec[0].value&&(i=this.redoCollec[0],this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),b.call(this,i.value),this.element.selectionStart=i.startIndex,this.element.selectionEnd=i.endIndex,this.redoCollec.splice(0,1))))}function oe(){var t,e=this.element.selectionStart,i=this.element.selectionEnd;0<this.redoCollec.length?(t=this.redoCollec[0],b.call(this,t.value),t.startIndex-e==1?(this.element.selectionStart=t.startIndex,this.element.selectionEnd=t.endIndex):(this.element.selectionStart=e+1,this.element.selectionEnd=i+1)):(b.call(this,this.promptMask),this.element.selectionStart=this.element.selectionEnd=e)}function he(t,e,i){return"input"===i.type&&(t=!1,e=this.element.value,b.call(this,this.promptMask),Ce.call(this,e)),t}function pe(t){var e,i=!1,s=!1,n=(this.element.value.length<this.promptMask.length&&(e=this.element.value,i=he.call(this,i=!0,e,t),oe.call(this)),this.element.value.length>=this.promptMask.length&&"input"===t.type&&(i=he.call(this,i,e,t)),this.element.selectionStart),a=this.element.selectionEnd,l=this.element.selectionStart,r=this.element.selectionEnd,o=this.hiddenMask.replace(/[>|\\<]/g,""),h=o[l-1],p=this.element.selectionEnd;if(i||8===t.keyCode||46===t.keyCode){this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:r});var d=!1,u=this.element.value;if(0<l||(8===t.keyCode||46===t.keyCode)&&l<this.element.value.length&&this.element.selectionEnd-l!==this.element.value.length){var c=l;l!==r?(l=r,46===t.keyCode&&(d=!0)):46===t.keyCode?++c:--c;for(var m=l;8===t.keyCode||i||d?c<m:m<c;8===t.keyCode||i||d?m--:m++)for(var f=l;8===t.keyCode||i||d?0<f:f<this.element.value.length;8===t.keyCode||i||d?f--:f++){var v,g,y=void 0;(8===t.keyCode||d)&&(n!==a&&n!==l||n===a)||i?(h=o[f-1],y=l-1):(h=o[f],y=l,++l),this.element.value[y];if(E.isNullOrUndefined(this.regExpCollec[""+h])&&!E.isNullOrUndefined(this.customCharacters)&&E.isNullOrUndefined(this.customCharacters[""+h])&&this.hiddenMask[y]!==this.promptChar&&"["!==this.customRegExpCollec[y][0]&&"]"!==this.customRegExpCollec[y][this.customRegExpCollec[y].length-1]||this.promptMask[y]!==this.promptChar&&E.isNullOrUndefined(this.customCharacters)?(this.element.selectionStart=this.element.selectionEnd=y,t.preventDefault(),46!==t.keyCode||d||++this.element.selectionStart):(v=this.element.value,g=this.promptChar,g=v.substring(0,y)+g+v.substring(l,v.length),b.call(this,g),t.preventDefault(),46!==t.keyCode||d||y++,this.element.selectionStart=this.element.selectionEnd=y,s=!0),l=this.element.selectionStart,!s&&8===t.keyCode||d||!s&&46!==t.keyCode?y=l-1:(y=l,s=!1),v=this.element.value[y],n!==a&&this.element.selectionStart===n||this.promptMask[y]===this.promptChar||v!==this.promptMask[y]&&this.promptMask[y]!==this.promptChar&&!E.isNullOrUndefined(this.customCharacters))break}}46===t.keyCode&&d&&s&&(this.element.selectionStart=this.element.selectionEnd=p),0===this.element.selectionStart&&this.element.selectionEnd===this.element.value.length&&(b.call(this,this.promptMask),t.preventDefault(),this.element.selectionStart=this.element.selectionEnd=l),this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),this.element.value!==u&&ue.call(this,t,e)}}function de(t){var e,i;this.mask&&!this.readonly&&(e=this.element.value,(!t.ctrlKey&&!t.metaKey||(t.ctrlKey||t.metaKey)&&"KeyA"!==t.code&&"KeyY"!==t.code&&"KeyZ"!==t.code&&"KeyX"!==t.code&&"KeyC"!==t.code&&"KeyV"!==t.code)&&(this.maskKeyPress=!0,(i="Spacebar"===(i=t.key)?String.fromCharCode(t.keyCode):i)?1===i.length&&(fe.call(this,i,t.ctrlKey,t),t.preventDefault()):(this.isIosInvalid=!0,fe.call(this,String.fromCharCode(t.keyCode),t.ctrlKey,t),t.preventDefault(),this.isIosInvalid=!1),32===t.keyCode)&&" "===i&&" "===this.promptChar&&(this.element.selectionStart=this.element.selectionEnd=this.element.selectionStart-i.length),this.element.value!==e)&&ue.call(this,t,e)}function ue(t,e){var i,s=this.isProtectedOnChange;E.isNullOrUndefined(this.changeEventArgs)||this.isInitial||(this.changeEventArgs={value:this.element.value,maskedValue:this.element.value,isInteraction:!(i={}),isInteracted:!1},this.mask&&(this.changeEventArgs.value=d.call(this,this.element)),E.isNullOrUndefined(t)||(this.changeEventArgs.isInteracted=!0,this.changeEventArgs.isInteraction=!0,this.changeEventArgs.event=t),this.isProtectedOnChange=!0,this.value=this.changeEventArgs.value,this.isProtectedOnChange=s,E.merge(i,this.changeEventArgs),this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",i)),this.preEleVal=this.element.value,this.prevValue=d.call(this,this.element)}function ce(t){var e,i,s,n,a,l,r,o;this.mask&&!this.readonly?(s=void 0,this.maskKeyPress||229!==t.keyCode?be.call(this):(a=void 0,1===this.element.value.length&&(this.element.value=this.element.value+this.promptMask,this.element.setSelectionRange(1,1)),this.element.value.length>this.promptMask.length&&(i=this.element.selectionStart,e=this.element.value.length-this.promptMask.length,i=this.element.value.substring(i-e,i),0<this.undoCollec.length?(s=this.undoCollec[this.undoCollec.length-1],n=this.element.selectionStart,a=s.value,r=s.value.substring(n-e,n),s=this.redoCollec[0],i=i.trim(),(l=E.Browser.isAndroid&&""===i)||r===i||s.value.substring(n-e,n)===i?l&&ge.call(this,t,n-1,this.element.selectionEnd-1,i,t.ctrlKey,!1):fe.call(this,i,t.ctrlKey,t)):(a=this.promptMask,fe.call(this,i,t.ctrlKey,t)),this.maskKeyPress=!1,ue.call(this,t,a))),r=d.call(this,this.element),(0!==this.element.selectionStart||this.promptMask!==this.element.value||""!==r||""===r&&this.value!==r)&&(this.prevValue=r,this.value=r)):ue.call(this,t),0===this.element.selectionStart&&0===this.element.selectionEnd&&(o=this.element,setTimeout(function(){o.setSelectionRange(0,0)},0))}function me(t){this.maskKeyPress||!function(t){var e;1<t.length&&this.promptMask.length+t.length<this.element.value.length&&(e=this.redoCollec[0].value.substring(0,this.redoCollec[0].startIndex)+t+this.redoCollec[0].value.substring(this.redoCollec[0].startIndex,this.redoCollec[0].value.length),b.call(this,e),this.element.selectionStart=this.element.selectionEnd=this.redoCollec[0].startIndex+t.length),this.element.selectionStart=this.element.selectionStart-t.length,this.element.selectionEnd=this.element.selectionEnd-t.length}.call(this,t)}function fe(t,e,i){if(me.call(this,t),!E.isNullOrUndefined(this)&&!E.isNullOrUndefined(t))for(var s,n=d=this.element.selectionStart,a=!1,l=this.element.value,r=!1,o=!1,h=0;h<t.length;h++){var p=t[h],d=this.element.selectionStart;if(this.maskKeyPress||n!==d||(d+=h),!this.maskKeyPress||d<this.promptMask.length){for(var u,c,m=d;m<this.promptMask.length;m++){var f=this.escapeMaskValue[d];"\\"===this.hiddenMask[d]&&this.hiddenMask[d+1]===t&&(o=!0),(E.isNullOrUndefined(this.regExpCollec[""+f])&&(E.isNullOrUndefined(this.customCharacters)||!E.isNullOrUndefined(this.customCharacters)&&E.isNullOrUndefined(this.customCharacters[""+f]))&&this.hiddenMask[d]!==this.promptChar&&"["!==this.customRegExpCollec[d][0]&&"]"!==this.customRegExpCollec[d][this.customRegExpCollec[d].length-1]||this.promptMask[d]!==this.promptChar&&E.isNullOrUndefined(this.customCharacters)||this.promptChar===f&&this.escapeMaskValue===this.mask)&&(this.element.selectionStart=this.element.selectionEnd=d+1,d=this.element.selectionStart,f=this.hiddenMask[d])}if(E.isNullOrUndefined(this.customCharacters)||E.isNullOrUndefined(this.customCharacters[""+f]))(!E.isNullOrUndefined(this.regExpCollec[""+f])&&p.match(new RegExp(this.regExpCollec[""+f]))&&this.promptMask[d]===this.promptChar||this.promptMask[d]===this.promptChar&&"["===this.customRegExpCollec[d][0]&&"]"===this.customRegExpCollec[d][this.customRegExpCollec[d].length-1]&&p.match(new RegExp(this.customRegExpCollec[d])))&&(a=!0);else for(var v=this.customCharacters[""+f].split(","),m=0;m<v.length;m++)if(p.match(new RegExp("["+v[m]+"]"))){a=!0;break}(!this.maskKeyPress||d<this.hiddenMask.length)&&a?(0===h&&(this.maskKeyPress?this.undoCollec.push({value:l,startIndex:d,endIndex:d}):(u=this.element.selectionStart,c=this.element.selectionEnd,0<this.redoCollec.length?(s=this.redoCollec[0].value,b.call(this,s),this.undoCollec.push(this.redoCollec[0])):(this.undoCollec.push({value:this.promptMask,startIndex:d,endIndex:d}),s=this.promptMask,b.call(this,s)),this.element.selectionStart=u,this.element.selectionEnd=c)),d=this.element.selectionStart,ve.call(this,i,d,p,s,o),r=!0,h===t.length-1&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),a=!1):(d=this.element.selectionStart,ge.call(this,i,d,n,t,e,r)),h!==t.length-1||a||(!E.Browser.isAndroid||E.Browser.isAndroid&&d<this.promptMask.length)&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd})}else 1!==t.length||e||E.isNullOrUndefined(i)||ye.call(this)}}function ve(t,e,i,s,n){this.hiddenMask.length>this.promptMask.length&&(i=function(t,e){var i,s,n=e,a=0;for(s=0;s<this.hiddenMask.length;s++)if("\\"===this.hiddenMask[s]&&(i=n.substring(0,s)+"\\"+n.substring(s,n.length)),">"!==this.hiddenMask[s]&&"<"!==this.hiddenMask[s]&&"|"!==this.hiddenMask[s]||(this.hiddenMask[s]!==n[s]&&(i=n.substring(0,s)+this.hiddenMask[s]+n.substring(s,n.length)),++a),i){if(i[s]===this.promptChar&&s>this.element.selectionStart||this.element.value.indexOf(this.promptChar)<0&&this.element.selectionStart+a===s){a=0;break}n=i}for(;0<=s&&i;){if(0===s||"\\"!==i[s-1]){if(">"===i[s]){t=t.toUpperCase();break}if("<"===i[s]){t=t.toLowerCase();break}if("|"===i[s])break}--s}return t}.call(this,i,this.element.value)),n||(i=(n=this.element.value).substring(0,e)+i+n.substring(e+1,n.length),b.call(this,i),this.element.selectionStart=this.element.selectionEnd=e+1)}function ge(t,e,i,s,n,a){var l;this.maskKeyPress||(l=this.element.value,e>=this.promptMask.length?b.call(this,l.substring(0,e)):(i===e?b.call(this,l.substring(0,e)+l.substring(e+1,l.length)):this.promptMask.length===this.element.value.length?b.call(this,l.substring(0,e)+l.substring(e,l.length)):b.call(this,l.substring(0,i)+l.substring(i+1,l.length)),this.element.selectionStart=this.element.selectionEnd=a||this.element.value[i]!==this.promptChar?e:i),ye.call(this)),1!==s.length||n||E.isNullOrUndefined(t)||ye.call(this)}function ye(){var t=this,e=this.element.parentNode,i=200;e.classList.contains(It)||e.classList.contains(Ft)?E.addClass([e],Ut):E.addClass([this.element],Ut),!0===this.isIosInvalid&&(i=400),E.attributes(this.element,{"aria-invalid":"true"}),setTimeout(function(){t.maskKeyPress||be.call(t)},i)}function be(){var t=this.element.parentNode;E.isNullOrUndefined(t)||E.removeClass([t],Ut),E.removeClass([this.element],Ut),E.attributes(this.element,{"aria-invalid":"false"})}function Ce(t){if(this.mask&&void 0!==t&&(void 0===this.prevValue||this.prevValue!==t)){if(this.maskKeyPress=!0,b.call(this,this.promptMask),""===t||null===t&&"Never"===this.floatLabelType&&this.placeholder||(this.element.selectionStart=0,this.element.selectionEnd=0),null!==t)for(var e=0;e<t.length;e++)fe.call(this,t[e],!1,null);var i=d.call(this,this.element),i=(this.prevValue=i,this.value=i,ue.call(this,null,null),this.maskKeyPress=!1,this.element.parentNode.querySelector(".e-float-text"));this.element.value===this.promptMask&&"Auto"===this.floatLabelType&&this.placeholder&&!E.isNullOrUndefined(i)&&i.classList.contains(Mt)&&!this.isFocus&&(E.removeClass([i],Mt),E.addClass([i],Dt),b.call(this,""))}(null===this.mask||""===this.mask&&void 0!==this.value)&&b.call(this,this.value)}function b(t,e){!this.isFocus&&"Auto"===this.floatLabelType&&this.placeholder&&E.isNullOrUndefined(this.value)&&(t="");var i=d.call(this,e||this.element,t);null===i||""===i?(o.Input.setValue(t,e||this.element,this.floatLabelType,!1),this.showClearButton&&this.inputObj.clearButton.classList.add("e-clear-icon-hide")):o.Input.setValue(t,e||this.element,this.floatLabelType,this.showClearButton)}function Ee(t){E.addClass([t.element],Vt);t={element:t.element,mask:t.mask,promptMask:"",hiddenMask:"",escapeMaskValue:"",promptChar:t.promptChar?1<t.promptChar.length?t.promptChar=t.promptChar[0]:t.promptChar:"_",value:t.value||null,regExpCollec:Wt,customRegExpCollec:[],customCharacters:t.customCharacters,undoCollec:[],redoCollec:[],maskKeyPress:!1,prevValue:""};return zt.call(t),t}function xe(t){var e;return e=!E.isNullOrUndefined(t)&&t.element.classList.contains(Vt)?Ee(t):e}function Se(){}Te=function(t,e){return(Te=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Te,Pe,Tt=function(t,e){function i(){this.constructor=t}Te(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},t=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},Oe="e-input-focus",we=["title","style","class"],Tt=(Pe=E.Component,Tt(i,Pe),i.prototype.getModuleName=function(){return"maskedtextbox"},i.prototype.preRender=function(){this.promptMask="",this.hiddenMask="",this.escapeMaskValue="",this.regExpCollec=Wt,this.customRegExpCollec=[],this.maskedRegExp=[],this.undoCollec=[],this.redoCollec=[],this.changeEventArgs={},this.focusEventArgs={},this.blurEventArgs={},this.maskKeyPress=!1,this.isFocus=!1,this.isInitial=!1,this.isIosInvalid=!1;var t=E.getValue("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),E.removeClass([this.cloneElement],["e-control","e-maskedtextbox","e-lib"]),this.angularTagName=null,this.formElement=E.closest(this.element,"form"),"EJS-MASKEDTEXTBOX"===this.element.tagName){this.angularTagName=this.element.tagName;for(var e=this.createElement("input"),i=0;i<this.element.attributes.length;i++)e.setAttribute(this.element.attributes[i].nodeName,this.element.attributes[i].nodeValue),e.innerHTML=this.element.innerHTML;this.element.hasAttribute("id")&&this.element.removeAttribute("id"),this.element.hasAttribute("name")&&this.element.removeAttribute("name"),this.element.classList.remove("e-control","e-maskedtextbox"),this.element.classList.add("e-mask-container"),this.element.appendChild(e),this.element=e,E.setValue("ej2_instances",t,this.element)}this.updateHTMLAttrToElement(),this.checkHtmlAttributes(!1),this.formElement&&(this.initInputValue=this.value)},i.prototype.getPersistData=function(){return this.addOnPersist(["value"])},i.prototype.render=function(){"input"===this.element.tagName.toLowerCase()&&("Never"===this.floatLabelType&&E.addClass([this.element],"e-input"),this.createWrapper(),this.updateHTMLAttrToWrapper(),""===this.element.name&&this.element.setAttribute("name",this.element.id),this.isInitial=!0,this.resetMaskedTextBox(),this.isInitial=!1,this.setMaskPlaceholder(!0,!1),this.setWidth(this.width),this.preEleVal=this.element.value,E.Browser.isDevice||"11.0"!==E.Browser.info.version&&"edge"!==E.Browser.info.name||this.element.blur(),E.Browser.isDevice&&E.Browser.isIos&&this.element.blur(),(this.element.getAttribute("value")||this.value)&&this.element.setAttribute("value",this.element.value),!E.isNullOrUndefined(E.closest(this.element,"fieldset"))&&E.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.element.hasAttribute("aria-labelledby")||this.element.hasAttribute("placeholder")||this.element.hasAttribute("aria-label")||this.element.setAttribute("aria-label","maskedtextbox"),this.updateFloatLabelOverflowWidth(),this.createPrependTemplate(),this.createAppendTemplate(),this.renderComplete())},i.prototype.updateHTMLAttrToElement=function(){if(!E.isNullOrUndefined(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var i=e[t];we.indexOf(i)<0&&this.element.setAttribute(i,this.htmlAttributes[""+i])}},i.prototype.updateCssClass=function(t,e){o.Input.setCssClass(this.getValidClassList(t),[this.inputObj.container],this.getValidClassList(e))},i.prototype.getValidClassList=function(t){var e=t;return e=E.isNullOrUndefined(t)||""===t?e:t.replace(/\s+/g," ").trim()},i.prototype.updateHTMLAttrToWrapper=function(){if(!E.isNullOrUndefined(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var i,s=e[t];-1<we.indexOf(s)&&("class"===s?""!==(i=this.htmlAttributes[""+s].replace(/\s+/g," ").trim())&&E.addClass([this.inputObj.container],i.split(" ")):"style"===s?(i=this.inputObj.container.getAttribute(s),i=E.isNullOrUndefined(i)?this.htmlAttributes[""+s]:i+this.htmlAttributes[""+s],this.inputObj.container.setAttribute(s,i)):this.inputObj.container.setAttribute(s,this.htmlAttributes[""+s]))}},i.prototype.resetMaskedTextBox=function(){this.promptMask="",this.hiddenMask="",this.escapeMaskValue="",this.customRegExpCollec=[],this.undoCollec=[],this.redoCollec=[],this.promptChar&&1<this.promptChar.length&&(this.promptChar=this.promptChar[0]),zt.call(this),qt.call(this),(null===this.mask||""===this.mask&&void 0!==this.value)&&b.call(this,this.value);var t=d.call(this,this.element);this.prevValue=t,this.value=t,this.isInitial||_t.call(this),jt.call(this)},i.prototype.setMaskPlaceholder=function(t,e){(e||this.placeholder)&&(o.Input.setPlaceholder(this.placeholder,this.element,this.getModuleName()),this.element.value===this.promptMask&&t&&"Always"!==this.floatLabelType||this.element.value===this.promptMask&&"Never"===this.floatLabelType)&&b.call(this,"")},i.prototype.setWidth=function(t){E.isNullOrUndefined(t)||("number"==typeof t?(this.inputObj.container.style.width=E.formatUnit(t),this.element.style.width=E.formatUnit(t)):"string"==typeof t&&(t=t.match(/px|%|em/)?t:E.formatUnit(t),this.inputObj.container.style.width=t,this.element.style.width=t))},i.prototype.checkHtmlAttributes=function(t){for(var e=0,i=t?E.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly"];e<i.length;e++){var s,n=i[e];if(!E.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"placeholder":(E.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"disabled":(E.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.enabled||t)&&(s="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n),this.setProperties({enabled:s},!t));break;case"value":(E.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.value||t)&&this.setProperties({value:this.element.value},!t);break;case"readonly":(E.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.readonly||t)&&(s="readonly"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n),this.setProperties({readonly:s},!t))}}},i.prototype.createWrapper=function(){var t=this.cssClass;E.isNullOrUndefined(this.cssClass)||""===this.cssClass||(t=this.getValidClassList(this.cssClass)),this.inputObj=o.Input.createInput({element:this.element,floatLabelType:this.floatLabelType,properties:{enableRtl:this.enableRtl,cssClass:t,enabled:this.enabled,readonly:this.readonly,placeholder:this.placeholder,showClearButton:this.showClearButton}},this.createElement),this.inputObj.container.setAttribute("class","e-control-wrapper e-mask "+this.inputObj.container.getAttribute("class"))},i.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"value":t.value!==e.value&&(Ce.call(this,this.value),this.placeholder&&!this.isFocus&&this.setMaskPlaceholder(!1,!1),""===this.value)&&null!=e.value&&(this.element.selectionStart=0,this.element.selectionEnd=0);break;case"placeholder":this.setMaskPlaceholder(!0,!0);break;case"width":this.setWidth(t.width),o.Input.calculateWidth(this.element,this.inputObj.container);break;case"cssClass":this.updateCssClass(t.cssClass,e.cssClass);break;case"enabled":o.Input.setEnabled(t.enabled,this.element,this.floatLabelType,this.inputObj.container);break;case"readonly":o.Input.setReadonly(t.readonly,this.element);break;case"enableRtl":o.Input.setEnableRtl(t.enableRtl,[this.inputObj.container]),this.handleFloatLabel();break;case"customCharacters":this.customCharacters=t.customCharacters,this.resetMaskedTextBox();break;case"showClearButton":o.Input.setClearButton(t.showClearButton,this.element,this.inputObj,void 0,this.createElement),Xt.call(this);break;case"floatLabelType":this.floatLabelType=t.floatLabelType,o.Input.removeFloating(this.inputObj),o.Input.addFloating(this.element,this.floatLabelType,this.placeholder,this.createElement);break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.checkHtmlAttributes(!0);break;case"prependTemplate":this.updatePrependTemplate();break;case"appendTemplate":this.updateAppendTemplate();break;case"mask":var n=this.value;this.mask=t.mask,this.maskedRegExp=[],this.updateValue(n);break;case"promptChar":1<t.promptChar.length&&(t.promptChar=t.promptChar[0]),t.promptChar?this.promptChar=t.promptChar:this.promptChar="_";n=this.element.value.replace(new RegExp("["+e.promptChar+"]","g"),this.promptChar);this.promptMask===this.element.value&&(n=this.promptMask.replace(new RegExp("["+e.promptChar+"]","g"),this.promptChar)),this.promptMask=this.promptMask.replace(new RegExp("["+e.promptChar+"]","g"),this.promptChar),this.undoCollec=this.redoCollec=[],b.call(this,n)}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange},i.prototype.updatePrependTemplate=function(){this.removePrependTemplate(),this.createPrependTemplate()},i.prototype.updateAppendTemplate=function(){this.removeAppendTemplate(),this.createAppendTemplate()},i.prototype.templateComplier=function(e){if(e)try{return"function"!=typeof e&&E.selectAll(e,document).length?E.compile(E.select(e,document).innerHTML.trim()):E.compile(e)}catch(t){return E.compile(e)}},i.prototype.createPrependTemplate=function(){var t,e;E.isNullOrUndefined(this.prependTemplate)||(t=this.inputObj.container,this.prependedElement=this.createElement("div",{className:"e-prepend-template"}),this.iconTemplateFunction=this.templateComplier(this.prependTemplate),(e=this.iconTemplateFunction(null,this,"template",this.element.id+"Template",this.isStringTemplate,null,this.prependedElement))&&(e=[].slice.call(e),E.append(e,this.prependedElement)),e=t.querySelector("input"),t.classList.add("e-prepend-wrapper"),e?t.insertBefore(this.prependedElement,e):t.insertBefore(this.prependedElement,t.firstChild),this.handleFloatLabel(),this.renderReactTemplates())},i.prototype.createAppendTemplate=function(){var t,e;E.isNullOrUndefined(this.appendTemplate)||(t=this.inputObj.container,this.appendedElement=this.createElement("div",{className:"e-append-template"}),this.iconTemplateFunction=this.templateComplier(this.appendTemplate),(e=this.iconTemplateFunction(null,this,"template",this.element.id+"Template",this.isStringTemplate,null,this.appendedElement))&&(e=[].slice.call(e),E.append(e,this.appendedElement)),t.classList.add("e-append-wrapper"),t.appendChild(this.appendedElement),this.handleFloatLabel(),this.renderReactTemplates())},i.prototype.handleFloatLabel=function(){var t=this.inputObj.container.querySelector(".e-float-text");t&&"Auto"===this.floatLabelType&&setTimeout(function(){t&&this.prependedElement&&!this.enableRtl?(t.style.marginLeft=this.prependedElement.offsetWidth+"px",t.style.marginRight="0"):t&&this.prependedElement&&this.enableRtl&&(t.style.marginRight=this.prependedElement.offsetWidth+"px",t.style.marginLeft="0"),t&&t.classList.contains("e-label-bottom")&&(t.style.width=this.element.offsetWidth+"px")}.bind(this),5)},i.prototype.removePrependTemplate=function(){E.isNullOrUndefined(this.prependedElement)||(E.detach(this.prependedElement),this.prependedElement=null)},i.prototype.removeAppendTemplate=function(){E.isNullOrUndefined(this.appendedElement)||(E.detach(this.appendedElement),this.appendedElement=null)},i.prototype.updateValue=function(t){this.resetMaskedTextBox(),Ce.call(this,t)},i.prototype.getMaskedValue=function(){return Zt.call(this,this.element)},i.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.isFocus=!0,this.element.focus(),E.addClass([this.inputObj.container],[Oe]))},i.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.isFocus=!1,this.element.blur(),E.removeClass([this.inputObj.container],[Oe]))},i.prototype.getRightIconsWidth=function(){for(var t=0,e=this.inputObj.container.querySelectorAll(".e-input-group-icon, .e-clear-icon"),i=0;i<e.length;i++)t+=e[i].offsetWidth;return t},i.prototype.updateFloatLabelOverflowWidth=function(){var t=this.inputObj.container,e=t.querySelector(".e-float-text-overflow")||t.querySelector(".e-float-text"),t=t.clientWidth-this.getRightIconsWidth();!e||!t||this.cssClass&&-1!==this.cssClass.split(" ").indexOf("e-outline")||(e.style.width=t+"px")},i.prototype.destroy=function(){_t.call(this),this.removePrependTemplate(),this.removeAppendTemplate(),this.clearTemplate(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]);for(var t=["aria-labelledby","role","autocomplete","aria-readonly","aria-disabled","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-invalid"],e=0;e<t.length;e++)this.element.removeAttribute(t[e]);this.element.classList.remove("e-input"),this.inputObj&&(this.inputObj.container.insertAdjacentElement("afterend",this.element),E.detach(this.inputObj.container)),this.blurEventArgs=null,o.Input.destroy({element:this.element,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),this.changeEventArgs=null,this.inputObj=null,"EJS-MASKEDTEXTBOX"===this.element.tagName&&E.setValue("ej2_instances",null,this.element),Pe.prototype.destroy.call(this)},t([E.Property(null)],i.prototype,"cssClass",void 0),t([E.Property(null)],i.prototype,"width",void 0),t([E.Property(null)],i.prototype,"placeholder",void 0),t([E.Property("Never")],i.prototype,"floatLabelType",void 0),t([E.Property({})],i.prototype,"htmlAttributes",void 0),t([E.Property(!0)],i.prototype,"enabled",void 0),t([E.Property(!1)],i.prototype,"readonly",void 0),t([E.Property(!1)],i.prototype,"showClearButton",void 0),t([E.Property(!1)],i.prototype,"enablePersistence",void 0),t([E.Property(null)],i.prototype,"mask",void 0),t([E.Property("_")],i.prototype,"promptChar",void 0),t([E.Property(null)],i.prototype,"value",void 0),t([E.Property(null)],i.prototype,"customCharacters",void 0),t([E.Property(null)],i.prototype,"prependTemplate",void 0),t([E.Property(null)],i.prototype,"appendTemplate",void 0),t([E.Event()],i.prototype,"created",void 0),t([E.Event()],i.prototype,"destroyed",void 0),t([E.Event()],i.prototype,"change",void 0),t([E.Event()],i.prototype,"focus",void 0),t([E.Event()],i.prototype,"blur",void 0),t([E.NotifyPropertyChanges],i));function i(t,e){e=Pe.call(this,t,e)||this;return e.initInputValue="",e.preventChange=!1,e.isClicked=!1,e.maskOptions=t,e}Le=function(t,e){return(Le=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Le,ke,t=function(t,e){function i(){this.constructor=t}Le(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},s=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},Ae=(ke=E.ChildProperty,t(Ne,ke),s([E.Property("None")],Ne.prototype,"placement",void 0),s([E.Property(10)],Ne.prototype,"largeStep",void 0),s([E.Property(1)],Ne.prototype,"smallStep",void 0),s([E.Property(!1)],Ne.prototype,"showSmallTicks",void 0),s([E.Property(null)],Ne.prototype,"format",void 0),Ne);function Ne(){return null!==ke&&ke.apply(this,arguments)||this}He=E.ChildProperty,t(Re,He),s([E.Property(null)],Re.prototype,"color",void 0),s([E.Property(null)],Re.prototype,"start",void 0),s([E.Property(null)],Re.prototype,"end",void 0);var He,Be=Re;function Re(){return null!==He&&He.apply(this,arguments)||this}Ue=E.ChildProperty,t(Fe,Ue),s([E.Property(!1)],Fe.prototype,"enabled",void 0),s([E.Property(null)],Fe.prototype,"minStart",void 0),s([E.Property(null)],Fe.prototype,"minEnd",void 0),s([E.Property(null)],Fe.prototype,"maxStart",void 0),s([E.Property(null)],Fe.prototype,"maxEnd",void 0),s([E.Property(!1)],Fe.prototype,"startHandleFixed",void 0),s([E.Property(!1)],Fe.prototype,"endHandleFixed",void 0);var Ue,Ie=Fe;function Fe(){return null!==Ue&&Ue.apply(this,arguments)||this}Ve=E.ChildProperty,t(De,Ve),s([E.Property("")],De.prototype,"cssClass",void 0),s([E.Property("Before")],De.prototype,"placement",void 0),s([E.Property("Focus")],De.prototype,"showOn",void 0),s([E.Property(!1)],De.prototype,"isVisible",void 0),s([E.Property(null)],De.prototype,"format",void 0);var Ve,Me=De;function De(){return null!==Ve&&Ve.apply(this,arguments)||this}var We,ze=1e-10,qe="e-slider",je="e-rtl",_e="e-slider-input",Xe="e-control-wrapper",Ke="e-handle",Ye="e-range",Ze="e-slider-button",Ge="e-first-button",Je="e-second-button",$e="e-scale",Qe="e-tick",ti="e-large",ei="e-tick-value",ii="e-slider-tooltip",si="e-slider-hover",ni="e-handle-first",ai="e-handle-second",li="e-disabled",ri="e-slider-container",oi="e-slider-horizontal-before",hi="e-slider-horizontal-after",pi="e-slider-vertical-before",di="e-slider-vertical-after",ui="e-material-tooltip-open",ci="e-tooltip-active",mi="e-material-slider",fi="e-slider-track",vi="e-slider-horizantal-color",gi="e-slider-vertical-color",yi="e-handle-focused",bi="e-vertical",Ci="e-horizontal",Ei="e-handle-start",xi="e-material-tooltip-start",a="e-tab-handle",Si="e-button-icon",Ti="e-small-size",Pi="e-tick-pos",Oi="e-first-tick",wi="e-last-tick",Li="e-slider-btn",ki="e-tab-track",Ai="e-tab-range",Ni="e-handle-active",Hi="e-material-handle",Bi="e-material-range",Ri="e-material-default",Ui="e-material-tooltip-show",Ii="e-material-tooltip-hide",Fi="e-read-only",Vi="e-limits",Mi="e-limit-bar",Di="e-limit-first",Wi="e-limit-second",zi="e-drag-horizontal",qi="e-drag-vertical",ji=(We=E.Component,t(l,We),l.prototype.preRender=function(){this.l10n=new E.L10n("slider",{incrementTitle:"Increase",decrementTitle:"Decrease"},this.locale),this.isElementFocused=!1,this.tickElementCollection=[],this.tooltipFormatInfo={},this.ticksFormatInfo={},this.initCultureInfo(),this.initCultureFunc(),this.formChecker()},l.prototype.formChecker=function(){var t=E.closest(this.element,"form");t?(this.isForm=!0,E.isNullOrUndefined(this.formResetValue)||this.setProperties({value:this.formResetValue},!0),this.formResetValue=this.value,"Range"!==this.type||!E.isNullOrUndefined(this.formResetValue)&&"object"==typeof this.formResetValue?E.isNullOrUndefined(this.formResetValue)&&(this.formResetValue=parseFloat(E.formatUnit(this.min))):this.formResetValue=[parseFloat(E.formatUnit(this.min)),parseFloat(E.formatUnit(this.max))],this.formElement=t):this.isForm=!1},l.prototype.initCultureFunc=function(){this.internationalization=new E.Internationalization(this.locale)},l.prototype.initCultureInfo=function(){this.tooltipFormatInfo.format=E.isNullOrUndefined(this.tooltip.format)?null:this.tooltip.format,this.ticksFormatInfo.format=E.isNullOrUndefined(this.ticks.format)?null:this.ticks.format},l.prototype.formatString=function(t,e){var i,s=null,n=null;return!t&&0!==t||(s=this.formatNumber(t),i=this.numberOfDecimals(t),n=this.internationalization.getNumberFormat(e)(this.makeRoundNumber(t,i))),{elementVal:s,formatString:n}},l.prototype.formatNumber=function(t){var e=this.numberOfDecimals(t);return this.internationalization.getNumberFormat({maximumFractionDigits:e,minimumFractionDigits:e,useGrouping:!1})(t)},l.prototype.numberOfDecimals=function(t){t=t.toString().split(".")[1];return t&&t.length?t.length:0},l.prototype.makeRoundNumber=function(t,e){return Number(t.toFixed(e||0))},l.prototype.render=function(){var t=this;this.initialize(),this.initRender(),this.wireEvents(),this.setZindex(),this.renderComplete(),"EJS-SLIDER"===this.element.tagName&&"none"===this.getTheme(this.sliderContainer)&&setTimeout(function(){t.refresh()},0)},l.prototype.initialize=function(){E.addClass([this.element],qe),this.setCSSClass()},l.prototype.setElementWidth=function(t){E.isNullOrUndefined(t)||E.isNullOrUndefined(this.sliderContainer)||("number"==typeof t?this.sliderContainer.style.width=E.formatUnit(t):"string"==typeof t&&(this.sliderContainer.style.width=t.match(/px|%|em/)?t:E.formatUnit(t)))},l.prototype.setCSSClass=function(t){t&&E.removeClass([this.element],t.split(" ")),this.cssClass&&E.addClass([this.element],this.cssClass.split(" "))},l.prototype.setEnabled=function(){this.enabled?(E.removeClass([this.sliderContainer],[li]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.remove(li),this.wireEvents()):(E.addClass([this.sliderContainer],[li]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.add(li),this.unwireEvents())},l.prototype.getTheme=function(t){return window.getComputedStyle(t,":after").getPropertyValue("content").replace(/['"]+/g,"")},l.prototype.secureRandom=function(){var t=new Uint32Array(1);return window.crypto.getRandomValues(t),t[0]/4294967296},l.prototype.initRender=function(){this.sliderContainer=this.createElement("div",{className:ri+" "+Xe}),this.element.parentNode.insertBefore(this.sliderContainer,this.element),this.sliderContainer.appendChild(this.element),this.sliderTrack=this.createElement("div",{className:fi}),this.element.appendChild(this.sliderTrack),this.setElementWidth(this.width),this.element.tabIndex=-1,this.getThemeInitialization(),this.setHandler(),this.createRangeBar(),this.limits.enabled&&this.createLimitBar(),this.setOrientClass(),this.hiddenInput=this.createElement("input",{attrs:{type:"hidden",value:E.isNullOrUndefined(this.value)?E.isNullOrUndefined(this.min)?"0":this.min.toString():this.value.toString(),name:this.element.getAttribute("name")||this.element.getAttribute("id")||"_"+(1e3*this.secureRandom()).toFixed(0)+"slider",class:_e}}),this.hiddenInput.tabIndex=-1,this.sliderContainer.appendChild(this.hiddenInput),this.showButtons&&this.setButtons(),this.setEnableRTL(),"Range"===this.type?this.rangeValueUpdate():this.value=E.isNullOrUndefined(this.value)?E.isNullOrUndefined(this.min)?0:parseFloat(E.formatUnit(this.min.toString())):this.value,this.previousVal="Range"!==this.type?this.checkHandleValue(parseFloat(E.formatUnit(this.value.toString()))):[this.checkHandleValue(parseFloat(E.formatUnit(this.value[0].toString()))),this.checkHandleValue(parseFloat(E.formatUnit(this.value[1].toString())))],this.previousChanged=this.previousVal,E.isNullOrUndefined(this.element.hasAttribute("name"))||this.element.removeAttribute("name"),this.setValue(),this.limits.enabled&&this.setLimitBar(),"None"!==this.ticks.placement&&this.renderScale(),this.tooltip.isVisible&&this.renderTooltip(),this.enabled?E.removeClass([this.sliderContainer],[li]):E.addClass([this.sliderContainer],[li]),this.readonly?E.addClass([this.sliderContainer],[Fi]):E.removeClass([this.sliderContainer],[Fi])},l.prototype.getThemeInitialization=function(){this.isMaterial="material"===this.getTheme(this.sliderContainer)||"material-dark"===this.getTheme(this.sliderContainer),this.isMaterial3="Material3"===this.getTheme(this.sliderContainer)||"Material3-dark"===this.getTheme(this.sliderContainer),this.isBootstrap="bootstrap"===this.getTheme(this.sliderContainer)||"bootstrap-dark"===this.getTheme(this.sliderContainer),this.isBootstrap4="bootstrap4"===this.getTheme(this.sliderContainer),this.isTailwind="tailwind"===this.getTheme(this.sliderContainer)||"tailwind-dark"===this.getTheme(this.sliderContainer),this.isTailwind3="tailwind3"===this.getTheme(this.sliderContainer)||"tailwind3-dark"===this.getTheme(this.sliderContainer),this.isBootstrap5="bootstrap5"===this.getTheme(this.sliderContainer),this.isFluent="FluentUI"===this.getTheme(this.sliderContainer),this.isFluent2="fluent2"===this.getTheme(this.sliderContainer),this.isBootstrap5Dot3="bootstrap5.3"===this.getTheme(this.sliderContainer),this.isMaterialTooltip=(this.isMaterial||this.isMaterial3)&&"Range"!==this.type&&this.tooltip.isVisible},l.prototype.createRangeBar=function(){"Default"!==this.type&&(this.rangeBar=this.createElement("div",{attrs:{class:Ye}}),this.element.appendChild(this.rangeBar),this.drag)&&"Range"===this.type&&("Horizontal"===this.orientation?this.rangeBar.classList.add(zi):this.rangeBar.classList.add(qi))},l.prototype.createLimitBar=function(){var t="Range"!==this.type?Mi:Di;t+=" "+Vi,this.limitBarFirst=this.createElement("div",{attrs:{class:t}}),this.element.appendChild(this.limitBarFirst),"Range"===this.type&&(this.limitBarSecond=this.createElement("div",{attrs:{class:Wi+" "+Vi}}),this.element.appendChild(this.limitBarSecond))},l.prototype.setOrientClass=function(){"Vertical"!==this.orientation?(this.sliderContainer.classList.remove(bi),this.sliderContainer.classList.add(Ci),this.firstHandle.setAttribute("aria-orientation","horizontal"),"Range"===this.type&&this.secondHandle.setAttribute("aria-orientation","horizontal")):(this.sliderContainer.classList.remove(Ci),this.sliderContainer.classList.add(bi),this.firstHandle.setAttribute("aria-orientation","vertical"),"Range"===this.type&&this.secondHandle.setAttribute("aria-orientation","vertical"))},l.prototype.setAriaAttributes=function(t){var i=this,e=this.min,s=this.max;!E.isNullOrUndefined(this.customValues)&&0<this.customValues.length&&(e=this.customValues[0],s=this.customValues[this.customValues.length-1]),"Range"!==this.type?E.attributes(t,{"aria-valuemin":E.isNullOrUndefined(e)?"0":e.toString(),"aria-valuemax":E.isNullOrUndefined(s)?"100":s.toString()}):(!E.isNullOrUndefined(this.customValues)&&0<this.customValues.length?[[E.isNullOrUndefined(e)?"":e.toString(),1<this.value.length&&!E.isNullOrUndefined(this.customValues[this.value[1]])?this.customValues[this.value[1]].toString():""],[0<this.value.length&&!E.isNullOrUndefined(this.customValues[this.value[0]])?this.customValues[this.value[0]].toString():"",E.isNullOrUndefined(s)?"":s.toString()]]:[[E.isNullOrUndefined(e)?"":e.toString(),1<this.value.length&&!E.isNullOrUndefined(this.value[1])?this.value[1].toString():""],[0<this.value.length&&!E.isNullOrUndefined(this.value[0])?this.value[0].toString():"",E.isNullOrUndefined(s)?"":s.toString()]]).forEach(function(t,e){e=0===e?i.firstHandle:i.secondHandle;e&&E.attributes(e,{"aria-valuemin":t[0],"aria-valuemax":t[1]})})},l.prototype.createSecondHandle=function(){this.secondHandle=this.createElement("div",{attrs:{class:Ke,role:"slider",tabIndex:"0","aria-label":"slider"}}),this.secondHandle.classList.add(ai),this.element.appendChild(this.secondHandle)},l.prototype.createFirstHandle=function(){this.firstHandle=this.createElement("div",{attrs:{class:Ke,role:"slider",tabIndex:"0","aria-label":"slider"}}),this.firstHandle.classList.add(ni),this.element.appendChild(this.firstHandle),this.isMaterialTooltip&&(this.materialHandle=this.createElement("div",{attrs:{class:Ke+" "+Hi}}),this.element.appendChild(this.materialHandle))},l.prototype.wireFirstHandleEvt=function(t){t?(E.EventHandler.remove(this.firstHandle,"mousedown touchstart",this.handleFocus),E.EventHandler.remove(this.firstHandle,"transitionend",this.transitionEnd),E.EventHandler.remove(this.firstHandle,"mouseenter touchenter",this.handleOver),E.EventHandler.remove(this.firstHandle,"mouseleave touchend",this.handleLeave)):(E.EventHandler.add(this.firstHandle,"mousedown touchstart",this.handleFocus,this),E.EventHandler.add(this.firstHandle,"transitionend",this.transitionEnd,this),E.EventHandler.add(this.firstHandle,"mouseenter touchenter",this.handleOver,this),E.EventHandler.add(this.firstHandle,"mouseleave touchend",this.handleLeave,this))},l.prototype.wireSecondHandleEvt=function(t){t?(E.EventHandler.remove(this.secondHandle,"mousedown touchstart",this.handleFocus),E.EventHandler.remove(this.secondHandle,"transitionend",this.transitionEnd),E.EventHandler.remove(this.secondHandle,"mouseenter touchenter",this.handleOver),E.EventHandler.remove(this.secondHandle,"mouseleave touchend",this.handleLeave)):(E.EventHandler.add(this.secondHandle,"mousedown touchstart",this.handleFocus,this),E.EventHandler.add(this.secondHandle,"transitionend",this.transitionEnd,this),E.EventHandler.add(this.secondHandle,"mouseenter touchenter",this.handleOver,this),E.EventHandler.add(this.secondHandle,"mouseleave touchend",this.handleLeave,this))},l.prototype.handleStart=function(){"Range"!==this.type&&(this.firstHandle.classList[0===this.handlePos1?"add":"remove"](Ei),this.isMaterialTooltip)&&(this.materialHandle.classList[0===this.handlePos1?"add":"remove"](Ei),this.tooltipElement)&&this.tooltipElement.classList[0===this.handlePos1?"add":"remove"](xi)},l.prototype.transitionEnd=function(t){"transform"!==t.propertyName&&(this.handleStart(),this.enableAnimation||(this.getHandle().style.transition="none"),"Default"!==this.type&&(this.rangeBar.style.transition="none"),(this.isMaterial||this.isMaterial3)&&this.tooltip.isVisible&&"Default"===this.type&&(this.tooltipElement.style.transition=this.transition.handle),this.tooltipToggle(this.getHandle()),this.closeTooltip())},l.prototype.handleFocusOut=function(){this.firstHandle.classList.contains(yi)&&this.firstHandle.classList.remove(yi),"Range"===this.type&&this.secondHandle.classList.contains(yi)&&this.secondHandle.classList.remove(yi)},l.prototype.handleFocus=function(t){this.focusSliderElement(),this.sliderBarClick(t),(t.currentTarget===this.firstHandle?(this.firstHandle.classList.add(yi),this.firstHandle):(this.secondHandle.classList.add(yi),this.secondHandle)).classList.add(a),E.EventHandler.add(document,"mousemove touchmove",this.sliderBarMove,this),E.EventHandler.add(document,"mouseup touchend",this.sliderBarUp,this)},l.prototype.handleOver=function(t){this.tooltip.isVisible&&"Hover"===this.tooltip.showOn&&this.tooltipToggle(t.currentTarget),"Default"===this.type&&this.tooltipToggle(this.getHandle())},l.prototype.handleLeave=function(t){!this.tooltip.isVisible||"Hover"!==this.tooltip.showOn||t.currentTarget.classList.contains(yi)||t.currentTarget.classList.contains(a)||this.closeTooltip()},l.prototype.setHandler=function(){this.createFirstHandle(),"Range"===this.type&&this.createSecondHandle()},l.prototype.setEnableRTL=function(){this.enableRtl&&"Vertical"!==this.orientation?E.addClass([this.sliderContainer],je):E.removeClass([this.sliderContainer],je);var t="Vertical"!==this.orientation?this.horDir:this.verDir;this.enableRtl?this.horDir="right":this.horDir="left",this.verDir="bottom",t!==("Vertical"!==this.orientation?this.horDir:this.verDir)&&"Horizontal"===this.orientation&&(E.setStyleAttribute(this.firstHandle,{right:"",left:"auto"}),"Range"===this.type)&&E.setStyleAttribute(this.secondHandle,{top:"",left:"auto"}),this.setBarColor()},l.prototype.tooltipValue=function(){var e,i=this,t={value:this.value,text:""};this.initialTooltip&&(this.initialTooltip=!1,this.setTooltipContent(),t.text=e="function"==typeof this.tooltipObj.content?this.tooltipObj.content():this.tooltipObj.content,this.trigger("tooltipChange",t,function(t){i.addTooltipClass(t.text),e!==t.text&&(i.customAriaText=t.text,i.enableHtmlSanitizer?t.text=E.SanitizeHtmlHelper.sanitize(t.text.toString()):t.text=t.text.toString(),i.tooltipObj.content=E.initializeCSPTemplate(function(){return t.text}),i.setAriaAttrValue(i.firstHandle),"Range"===i.type)&&i.setAriaAttrValue(i.secondHandle)}),this.isMaterialTooltip)&&this.setPreviousVal("change",this.value)},l.prototype.setTooltipContent=function(){var t=this.formatContent(this.tooltipFormatInfo,!1);this.tooltipObj.content=E.initializeCSPTemplate(function(){return t})},l.prototype.formatContent=function(t,e){var i="",s=this.handleVal1,n=this.handleVal2;return!E.isNullOrUndefined(this.customValues)&&0<this.customValues.length&&(s=this.customValues[this.handleVal1],n=this.customValues[this.handleVal2]),e?"Range"===this.type?i=this.enableRtl&&"Vertical"!==this.orientation?E.isNullOrUndefined(this.tooltip)||E.isNullOrUndefined(this.tooltip.format)?n.toString()+" - "+s.toString():this.formatString(n,t).elementVal+" - "+this.formatString(s,t).elementVal:E.isNullOrUndefined(this.tooltip)||E.isNullOrUndefined(this.tooltip.format)?s.toString()+" - "+n.toString():this.formatString(s,t).elementVal+" - "+this.formatString(n,t).elementVal:E.isNullOrUndefined(s)||(i=E.isNullOrUndefined(this.tooltip)||E.isNullOrUndefined(this.tooltip.format)?s.toString():this.formatString(s,t).elementVal):"Range"===this.type?i=this.enableRtl&&"Vertical"!==this.orientation?E.isNullOrUndefined(t.format)?n.toString()+" - "+s.toString():this.formatString(n,t).formatString+" - "+this.formatString(s,t).formatString:E.isNullOrUndefined(t.format)?s.toString()+" - "+n.toString():this.formatString(s,t).formatString+" - "+this.formatString(n,t).formatString:E.isNullOrUndefined(s)||(i=E.isNullOrUndefined(t.format)?s.toString():this.formatString(s,t).formatString),i},l.prototype.addTooltipClass=function(t){var e;this.isMaterialTooltip&&(t=t.toString().length,this.tooltipElement?(e=4<t?{oldCss:Ri,newCss:Bi}:{oldCss:Bi,newCss:Ri},this.tooltipElement.classList.remove(e.oldCss),this.tooltipElement.classList.contains(e.newCss)||(this.tooltipElement.classList.add(e.newCss),this.tooltipElement.style.transform=4<t?"scale(1)":this.getTooltipTransformProperties(this.previousTooltipClass).rotate)):(e=4<t?Bi:Ri,this.tooltipObj.cssClass=ii+" "+e))},l.prototype.tooltipPlacement=function(){return"Horizontal"===this.orientation?"Before"===this.tooltip.placement?"TopCenter":"BottomCenter":"Before"===this.tooltip.placement?"LeftCenter":"RightCenter"},l.prototype.tooltipBeforeOpen=function(t){this.tooltipElement=t.element,this.tooltip.cssClass&&E.addClass([this.tooltipElement],this.tooltip.cssClass.split(" ").filter(function(t){return t})),t.target.removeAttribute("aria-describedby"),this.isMaterialTooltip&&(this.tooltipElement.firstElementChild.classList.add(Ii),this.handleStart(),this.setTooltipTransform())},l.prototype.tooltipCollision=function(t){if(this.isBootstrap||this.isBootstrap4||(this.isMaterial||this.isMaterial3)&&!this.isMaterialTooltip){var e=this.isBootstrap4?3:6;switch(t){case"TopCenter":this.tooltipObj.setProperties({offsetY:-e},!1);break;case"BottomCenter":this.tooltipObj.setProperties({offsetY:e},!1);break;case"LeftCenter":this.tooltipObj.setProperties({offsetX:-e},!1);break;case"RightCenter":this.tooltipObj.setProperties({offsetX:e},!1)}}},l.prototype.materialTooltipEventCallBack=function(t){this.sliderBarClick(t),E.EventHandler.add(document,"mousemove touchmove",this.sliderBarMove,this),E.EventHandler.add(document,"mouseup touchend",this.sliderBarUp,this)},l.prototype.wireMaterialTooltipEvent=function(t){this.isMaterialTooltip&&(t?E.EventHandler.remove(this.tooltipElement,"mousedown touchstart",this.materialTooltipEventCallBack):E.EventHandler.add(this.tooltipElement,"mousedown touchstart",this.materialTooltipEventCallBack,this))},l.prototype.tooltipPositionCalculation=function(t){var e;switch(t){case"TopCenter":e=oi;break;case"BottomCenter":e=hi;break;case"LeftCenter":e=pi;break;case"RightCenter":e=di}return e},l.prototype.getTooltipTransformProperties=function(t){var e;return this.tooltipElement&&(e="Horizontal"===this.orientation?this.tooltipElement.clientHeight+14-this.tooltipElement.clientHeight/2:this.tooltipElement.clientWidth+14-this.tooltipElement.clientWidth/2,e="Horizontal"===this.orientation?t===oi?{rotate:"rotate(45deg)",translate:"translateY("+e+"px)"}:{rotate:"rotate(225deg)",translate:"translateY("+-e+"px)"}:t===pi?{rotate:"rotate(-45deg)",translate:"translateX("+e+"px)"}:{rotate:"rotate(-225deg)",translate:"translateX("+-e+"px)"}),e},l.prototype.openMaterialTooltip=function(){var t,e=this;this.isMaterialTooltip&&(this.refreshTooltip(this.firstHandle),(t=this.tooltipElement.firstElementChild).classList.remove(Ii),t.classList.add(Ui),this.firstHandle.style.cursor="default",this.tooltipElement.style.transition=this.scaleTransform,this.tooltipElement.classList.add(ui),this.materialHandle.style.transform="scale(0)",4<t.innerText.length?this.tooltipElement.style.transform="scale(1)":this.tooltipElement.style.transform=this.getTooltipTransformProperties(this.previousTooltipClass).rotate,"Default"===this.type?setTimeout(function(){e.tooltipElement&&(e.tooltipElement.style.transition=e.transition.handle)},2500):setTimeout(function(){e.tooltipElement&&(e.tooltipElement.style.transition="none")},2500))},l.prototype.closeMaterialTooltip=function(){var t,e=this;this.isMaterialTooltip&&(t=this.tooltipElement.firstElementChild,this.tooltipElement.style.transition=this.scaleTransform,t.classList.remove(Ui),t.classList.add(Ii),this.firstHandle.style.cursor="-webkit-grab",this.firstHandle.style.cursor="grab",this.materialHandle&&(this.materialHandle.style.transform="scale(1)"),this.tooltipElement.classList.remove(ui),this.setTooltipTransform(),this.tooltipTarget=void 0,setTimeout(function(){e.tooltipElement&&(e.tooltipElement.style.transition="none")},2500))},l.prototype.checkTooltipPosition=function(t){var e=this.tooltipPositionCalculation(t.collidedPosition);void 0!==this.tooltipCollidedPosition&&this.tooltipCollidedPosition===t.collidedPosition&&t.element.classList.contains(e)||(this.isMaterialTooltip&&(void 0!==e&&(t.element.classList.remove(this.previousTooltipClass),t.element.classList.add(e),this.previousTooltipClass=e),t.element.style.transform)&&t.element.classList.contains(ui)&&t.element.firstElementChild.innerText.length<=4&&(t.element.style.transform=this.getTooltipTransformProperties(this.previousTooltipClass).rotate),this.tooltipCollidedPosition=t.collidedPosition),this.isMaterialTooltip&&this.tooltipElement&&-1!==this.tooltipElement.style.transform.indexOf("translate")&&this.setTooltipTransform()},l.prototype.setTooltipTransform=function(){var t=this.getTooltipTransformProperties(this.previousTooltipClass);E.isNullOrUndefined(this.tooltipElement)||(4<this.tooltipElement.firstElementChild.innerText.length?this.tooltipElement.style.transform=t.translate+" scale(0.01)":this.tooltipElement.style.transform=t.translate+" "+t.rotate+" scale(0.01)")},l.prototype.renderTooltip=function(){this.tooltipObj=new h.Tooltip({showTipPointer:this.isBootstrap||this.isMaterial||this.isMaterial3||this.isBootstrap4||this.isTailwind||this.isTailwind3||this.isBootstrap5||this.isFluent||this.isFluent2||this.isBootstrap5Dot3,cssClass:ii,height:this.isMaterial||this.isMaterial3?30:"auto",animation:{open:{effect:"None"},close:{effect:"FadeOut",duration:500}},opensOn:"Custom",beforeOpen:this.tooltipBeforeOpen.bind(this),beforeCollision:this.checkTooltipPosition.bind(this),beforeClose:this.tooltipBeforeClose.bind(this),enableHtmlSanitizer:this.enableHtmlSanitizer}),this.tooltipObj.appendTo(this.firstHandle),this.initializeTooltipProps()},l.prototype.initializeTooltipProps=function(){var t="Auto"===this.tooltip.showOn?"Hover":this.tooltip.showOn;this.setProperties({tooltip:{showOn:t}},!0),this.tooltipObj.position=this.tooltipPlacement(),this.tooltipCollision(this.tooltipObj.position),[this.firstHandle,this.rangeBar,this.secondHandle].forEach(function(t){E.isNullOrUndefined(t)||(t.style.transition="none")}),this.isMaterialTooltip&&(this.sliderContainer.classList.add(mi),this.tooltipValue(),this.tooltipObj.animation.close.effect="None",this.tooltipObj.open(this.firstHandle))},l.prototype.tooltipBeforeClose=function(){this.tooltipElement=void 0,this.tooltipCollidedPosition=void 0},l.prototype.setButtons=function(){this.firstBtn=this.createElement("div",{className:Ze+" "+Ge}),this.firstBtn.appendChild(this.createElement("span",{className:Si})),(this.isTailwind||this.isTailwind3)&&this.firstBtn.querySelector("span").classList.add("e-icons"),this.firstBtn.tabIndex=-1,this.secondBtn=this.createElement("div",{className:Ze+" "+Je}),this.secondBtn.appendChild(this.createElement("span",{className:Si})),(this.isTailwind||this.isTailwind3)&&this.secondBtn.querySelector("span").classList.add("e-icons"),this.secondBtn.tabIndex=-1,this.sliderContainer.classList.add(Li),this.sliderContainer.appendChild(this.firstBtn),this.sliderContainer.appendChild(this.secondBtn),this.sliderContainer.appendChild(this.element),this.buttonTitle()},l.prototype.buttonTitle=function(){var t=this.enableRtl&&"Vertical"!==this.orientation,e=(this.l10n.setLocale(this.locale),this.l10n.getConstant("decrementTitle")),i=this.l10n.getConstant("incrementTitle");E.attributes(t?this.secondBtn:this.firstBtn,{"aria-label":e,title:e}),E.attributes(t?this.firstBtn:this.secondBtn,{"aria-label":i,title:i})},l.prototype.buttonFocusOut=function(){(this.isMaterial||this.isMaterial3)&&this.getHandle().classList.remove("e-large-thumb-size")},l.prototype.repeatButton=function(t){var e,i=this.handleValueUpdate(),s=this.enableRtl&&"Vertical"!==this.orientation;t.target.parentElement.classList.contains(Ge)||t.target.classList.contains(Ge)?e=s?this.add(i,parseFloat(this.step.toString()),!0):this.add(i,parseFloat(this.step.toString()),!1):(t.target.parentElement.classList.contains(Je)||t.target.classList.contains(Je))&&(e=s?this.add(i,parseFloat(this.step.toString()),!1):this.add(i,parseFloat(this.step.toString()),!0)),(e=this.limits.enabled?this.getLimitCorrectedValues(e):e)>=this.min&&e<=this.max&&(this.changeHandleValue(e,t),this.tooltipToggle(this.getHandle()))},l.prototype.repeatHandlerMouse=function(t){t.preventDefault(),"mousedown"!==t.type&&"touchstart"!==t.type||(this.buttonClick(t),this.repeatInterval=setInterval(this.repeatButton.bind(this),180,t))},l.prototype.materialChange=function(){this.getHandle().classList.contains("e-large-thumb-size")||this.getHandle().classList.add("e-large-thumb-size")},l.prototype.focusHandle=function(){this.getHandle().classList.contains(a)||this.getHandle().classList.add(a)},l.prototype.repeatHandlerUp=function(t){this.changeEvent("changed",t),this.closeTooltip(),clearInterval(this.repeatInterval),this.getHandle().focus()},l.prototype.customTickCounter=function(t){var e=4;return e=!E.isNullOrUndefined(this.customValues)&&0<this.customValues.length&&(4<t&&(e=3),7<t&&(e=2),14<t&&(e=1),28<t)?0:e},l.prototype.renderScale=function(){var t="Vertical"===this.orientation?"v":"h",e=(this.ul=this.createElement("ul",{className:$e+" e-"+t+"-scale "+Qe+"-"+this.ticks.placement.toLowerCase(),attrs:{role:"presentation","aria-hidden":"true"}}),this.ul.style.zIndex="-1",E.Browser.isAndroid&&"h"==t&&this.ul.classList.add(Pi),this.ticks.smallStep),i=(this.ticks.showSmallTicks?e<=0&&(e=parseFloat(E.formatUnit(this.step))):e=0<this.ticks.largeStep?this.ticks.largeStep:parseFloat(E.formatUnit(this.max))-parseFloat(E.formatUnit(this.min)),parseFloat(E.formatUnit(this.min))),s=parseFloat(E.formatUnit(this.max)),n=parseFloat(E.formatUnit(e)),a=!E.isNullOrUndefined(this.customValues)&&0<this.customValues.length&&this.customValues.length-1,l=this.customTickCounter(a),r=!E.isNullOrUndefined(this.customValues)&&0<this.customValues.length?a*l+a:Math.abs((s-i)/n),o=(this.element.appendChild(this.ul),parseFloat(this.min.toString())),h=("v"==t&&(o=parseFloat(this.max.toString())),0),p=100/r;p===1/0&&(p=5);for(var d=0,u=!E.isNullOrUndefined(this.customValues)&&0<this.customValues.length?this.customValues.length-1:0,c=0;d<=r;d++){var m,f,v,g=this.createElement("li",{attrs:{class:Qe,role:"presentation","aria-hidden":"true"}}),y=(!E.isNullOrUndefined(this.customValues)&&0<this.customValues.length?(m=d%(l+1)==0)&&("h"==t?(o=this.customValues[c],c++):(o=this.customValues[u],u--),g.setAttribute("title",o.toString())):(g.setAttribute("title",o.toString()),m=0===this.numberOfDecimals(this.max)&&0===this.numberOfDecimals(this.min)&&0===this.numberOfDecimals(this.step)?(v="h"==t?(o-parseFloat(this.min.toString()))%this.ticks.largeStep:Math.abs(o-parseFloat(this.max.toString()))%this.ticks.largeStep,Math.abs(v)<ze||Math.abs(this.ticks.largeStep-v)<ze):(f=this.ticks.largeStep,C=o,v="h"==t?(C-i)%f:Math.abs(C-parseFloat(s.toString()))%f,Math.abs(v)<ze||Math.abs(f-v)<ze)),m&&g.classList.add(ti),"h"==t?g.style.width=p+"%":g.style.height=p+"%",m?"Both"===this.ticks.placement?2:1:0);if(m)for(var b=0;b<y;b++)this.createTick(g,o);else E.isNullOrUndefined(this.customValues)&&this.formatTicksValue(g,o);this.ul.appendChild(g),this.tickElementCollection.push(g);var C=void 0;E.isNullOrUndefined(this.customValues)&&(C=this.numberOfDecimals(e)>this.numberOfDecimals(o)?this.numberOfDecimals(e):this.numberOfDecimals(o),o="h"==t||this.min>this.max?this.makeRoundNumber(o+e,C):this.makeRoundNumber(o-e,C),h=this.makeRoundNumber(h+e,C))}this.ticksAlignment(t,p)},l.prototype.ticksAlignment=function(t,e,i){void 0===i&&(i=!0),this.firstChild=this.ul.firstElementChild,this.lastChild=this.ul.lastElementChild,this.firstChild.classList.add(Oi),this.lastChild.classList.add(wi),this.sliderContainer.classList.add($e+"-"+this.ticks.placement.toLowerCase()),"h"===t?(this.firstChild.style.width=e/2+"%",this.lastChild.style.width=e/2+"%"):(this.firstChild.style.height=e/2+"%",this.lastChild.style.height=e/2+"%");t={ticksWrapper:this.ul,tickElements:this.tickElementCollection};i&&this.trigger("renderedTicks",t),this.scaleAlignment()},l.prototype.createTick=function(t,e){var i=this.createElement("span",{className:ei+" "+Qe+"-"+this.ticks.placement.toLowerCase(),attrs:{role:"presentation","aria-hidden":"true"}});t.appendChild(i),E.isNullOrUndefined(this.customValues)?this.formatTicksValue(t,e,i):this.enableHtmlSanitizer?i.innerHTML=E.SanitizeHtmlHelper.sanitize(e.toString()):i.innerHTML=e.toString()},l.prototype.formatTicksValue=function(e,t,i){var s=this,n=this.formatNumber(t),n=E.isNullOrUndefined(this.ticks)||E.isNullOrUndefined(this.ticks.format)?n:this.formatString(t,this.ticksFormatInfo).formatString;this.trigger("renderingTicks",{value:t,text:n,tickElement:e},function(t){e.setAttribute("title",t.text.toString()),i&&(s.enableHtmlSanitizer?i.innerHTML=E.SanitizeHtmlHelper.sanitize(t.text.toString()):i.innerHTML=t.text.toString())})},l.prototype.scaleAlignment=function(){this.tickValuePosition(),"Vertical"===this.orientation?this.element.getBoundingClientRect().width<=15?this.sliderContainer.classList.add(Ti):this.sliderContainer.classList.remove(Ti):this.element.getBoundingClientRect().height<=15?this.sliderContainer.classList.add(Ti):this.sliderContainer.classList.remove(Ti)},l.prototype.tickValuePosition=function(){this.firstChild=this.element.querySelector("ul").children[0];for(var t,e,i=this.firstChild.getBoundingClientRect(),s=this.ticks.smallStep,s=Math.abs(parseFloat(E.formatUnit(this.max))-parseFloat(E.formatUnit(this.min)))/s,n=(0<this.firstChild.children.length&&(t=this.firstChild.children[0].getBoundingClientRect()),[this.sliderContainer.querySelectorAll("."+Qe+"."+ti+" ."+ei)]),a="Both"===this.ticks.placement?[].slice.call(n[0],2):[].slice.call(n[0],1),l="Vertical"===this.orientation?2*i.height:2*i.width,r=0;r<this.firstChild.children.length;r++)"Vertical"===this.orientation?this.firstChild.children[r].style.top=-t.height/2+"px":this.enableRtl?this.firstChild.children[r].style.left=(l-this.firstChild.children[r].getBoundingClientRect().width)/2+"px":this.firstChild.children[r].style.left=-t.width/2+"px";for(r=0;r<a.length;r++)e=a[r].getBoundingClientRect(),"Vertical"===this.orientation?E.setStyleAttribute(a[r],{top:(l-e.height)/2+"px"}):E.setStyleAttribute(a[r],{left:(l-e.width)/2+"px"});this.enableRtl&&this.lastChild.children.length&&0!=s&&(this.lastChild.children[0].style.left=-this.lastChild.getBoundingClientRect().width/2+"px","Both"===this.ticks.placement)&&(this.lastChild.children[1].style.left=-this.lastChild.getBoundingClientRect().width/2+"px"),0==s&&("Horizontal"===this.orientation&&(this.enableRtl?(this.firstChild.classList.remove(wi),this.firstChild.style.right=this.firstHandle.style.right,this.firstChild.children[0].style.left=this.firstChild.getBoundingClientRect().width/2+2+"px","Both"===this.ticks.placement&&(this.firstChild.children[1].style.left=this.firstChild.getBoundingClientRect().width/2+2+"px")):(this.firstChild.classList.remove(wi),this.firstChild.style.left=this.firstHandle.style.left)),"Vertical"===this.orientation)&&this.firstChild.classList.remove(wi)},l.prototype.setAriaAttrValue=function(t){var e=!E.isNullOrUndefined(this.ticks)&&!E.isNullOrUndefined(this.ticks.format),i=e?this.formatContent(this.tooltipFormatInfo,!1):this.formatContent(this.ticksFormatInfo,!1),e=e?this.formatContent(this.ticksFormatInfo,!0):this.formatContent(this.tooltipFormatInfo,!0),s=2===(i=this.customAriaText||i).split(" - ").length?i.split(" - "):[i,i];this.setAriaAttributes(t),"Range"!==this.type?E.attributes(t,{"aria-valuenow":e,"aria-valuetext":i}):this.enableRtl?t===this.firstHandle?E.attributes(t,{"aria-valuenow":e.split(" - ")[1],"aria-valuetext":s[1]}):E.attributes(t,{"aria-valuenow":e.split(" - ")[0],"aria-valuetext":s[0]}):t===this.firstHandle?E.attributes(t,{"aria-valuenow":e.split(" - ")[0],"aria-valuetext":s[0]}):E.attributes(t,{"aria-valuenow":e.split(" - ")[1],"aria-valuetext":s[1]})},l.prototype.handleValueUpdate=function(){var t="Range"!==this.type||1===this.activeHandle?this.handleVal1:this.handleVal2;return t},l.prototype.getLimitCorrectedValues=function(t){return t=("MinRange"===this.type||"Default"===this.type||1===this.activeHandle?this.getLimitValueAndPosition(t,this.limits.minStart,this.limits.minEnd):this.getLimitValueAndPosition(t,this.limits.maxStart,this.limits.maxEnd))[0]},l.prototype.focusSliderElement=function(){this.isElementFocused||(this.element.focus(),this.isElementFocused=!0)},l.prototype.buttonClick=function(t){this.focusSliderElement();var e,i=this.enableRtl&&"Vertical"!==this.orientation,s=this.handleValueUpdate();40===t.keyCode||37===t.keyCode||t.currentTarget.classList.contains(Ge)?e=i?this.add(s,parseFloat(this.step.toString()),!0):this.add(s,parseFloat(this.step.toString()),!1):38===t.keyCode||39===t.keyCode||t.currentTarget.classList.contains(Je)?e=i?this.add(s,parseFloat(this.step.toString()),!1):this.add(s,parseFloat(this.step.toString()),!0):33===t.keyCode||t.currentTarget.classList.contains(Ge)?e=i?this.add(s,parseFloat(this.ticks.largeStep.toString()),!1):this.add(s,parseFloat(this.ticks.largeStep.toString()),!0):34===t.keyCode||t.currentTarget.classList.contains(Je)?e=i?this.add(s,parseFloat(this.ticks.largeStep.toString()),!0):this.add(s,parseFloat(this.ticks.largeStep.toString()),!1):36===t.keyCode?e=parseFloat((this.min<this.max?this.min:this.max).toString()):35===t.keyCode&&(e=parseFloat((this.min<this.max?this.max:this.min).toString())),this.limits.enabled&&(e=this.getLimitCorrectedValues(e)),this.changeHandleValue(e,t),!this.isMaterial&&!this.isMaterial3||this.tooltip.isVisible||this.getHandle().classList.contains(a)||this.materialChange(),this.tooltipToggle(this.getHandle()),this.getHandle().focus(),this.focusHandle(),t.currentTarget.classList.contains(Ge)&&E.EventHandler.add(this.firstBtn,"mouseup touchend",this.buttonUp,this),t.currentTarget.classList.contains(Je)&&E.EventHandler.add(this.secondBtn,"mouseup touchend",this.buttonUp,this)},l.prototype.tooltipToggle=function(t){this.isMaterialTooltip?this.tooltipElement.classList.contains(ui)?this.refreshTooltip(this.firstHandle):this.openMaterialTooltip():this.tooltipElement?this.refreshTooltip(t):this.openTooltip(t)},l.prototype.buttonUp=function(t){t.currentTarget.classList.contains(Ge)&&E.EventHandler.remove(this.firstBtn,"mouseup touchend",this.buttonUp),t.currentTarget.classList.contains(Je)&&E.EventHandler.remove(this.secondBtn,"mouseup touchend",this.buttonUp)},l.prototype.setRangeBar=function(){"Horizontal"!==this.orientation||E.isNullOrUndefined(this.rangeBar)?E.isNullOrUndefined(this.rangeBar)||("MinRange"===this.type?(this.rangeBar.style.bottom=this.min>this.max?this.handlePos1+"px":"0px",E.setStyleAttribute(this.rangeBar,{height:E.isNullOrUndefined(this.handlePos1)?0:this.min>this.max?this.element.clientHeight-this.handlePos1+"px":this.handlePos1+"px"})):(this.rangeBar.style.bottom=this.min>this.max?this.handlePos2+"px":this.handlePos1+"px",E.setStyleAttribute(this.rangeBar,{height:this.min>this.max?this.handlePos1-this.handlePos2+"px":this.handlePos2-this.handlePos1+"px"}))):"MinRange"===this.type?(this.enableRtl?this.rangeBar.style.right="0px":this.rangeBar.style.left="0px",E.setStyleAttribute(this.rangeBar,{width:E.isNullOrUndefined(this.handlePos1)?0:this.handlePos1+"px"})):(this.enableRtl?this.rangeBar.style.right=this.handlePos1+"px":this.rangeBar.style.left=this.handlePos1+"px",E.setStyleAttribute(this.rangeBar,{width:this.handlePos2-this.handlePos1+"px"}))},l.prototype.checkValidValueAndPos=function(t){return t=this.checkHandleValue(t),t=this.checkHandlePosition(t)},l.prototype.setLimitBarPositions=function(t,e,i,s){"Horizontal"===this.orientation?(this.enableRtl?this.limitBarFirst.style.right=t+"px":this.limitBarFirst.style.left=t+"px",this.limitBarFirst.style.width=e-t+"px"):(this.limitBarFirst.style.bottom=(this.min<this.max?t:e)+"px",this.limitBarFirst.style.height=(this.min<this.max?e-t:t-e)+"px"),"Range"===this.type&&("Horizontal"===this.orientation?(this.enableRtl?this.limitBarSecond.style.right=i+"px":this.limitBarSecond.style.left=i+"px",this.limitBarSecond.style.width=s-i+"px"):(this.limitBarSecond.style.bottom=(this.min<this.max?i:s)+"px",this.limitBarSecond.style.height=(this.min<this.max?s-i:i-s)+"px"))},l.prototype.setLimitBar=function(){var t,e,i,s;"Default"===this.type||"MinRange"===this.type?(t=this.getLimitValueAndPosition(this.limits.minStart,this.limits.minStart,this.limits.minEnd,!0)[0],t=this.checkValidValueAndPos(t),e=this.getLimitValueAndPosition(this.limits.minEnd,this.limits.minStart,this.limits.minEnd,!0)[0],e=this.checkValidValueAndPos(e),this.setLimitBarPositions(t,e)):"Range"===this.type&&(t=this.getLimitValueAndPosition(this.limits.minStart,this.limits.minStart,this.limits.minEnd,!0)[0],t=this.checkValidValueAndPos(t),e=this.getLimitValueAndPosition(this.limits.minEnd,this.limits.minStart,this.limits.minEnd,!0)[0],e=this.checkValidValueAndPos(e),i=this.getLimitValueAndPosition(this.limits.maxStart,this.limits.maxStart,this.limits.maxEnd,!0)[0],i=this.checkValidValueAndPos(i),s=this.getLimitValueAndPosition(this.limits.maxEnd,this.limits.maxStart,this.limits.maxEnd,!0)[0],s=this.checkValidValueAndPos(s),this.setLimitBarPositions(t,e,i,s))},l.prototype.getLimitValueAndPosition=function(t,e,i,s){return E.isNullOrUndefined(e)&&(e=this.min<this.max?this.min:this.max,E.isNullOrUndefined(t))&&s&&(t=e),E.isNullOrUndefined(i)&&(i=this.min<this.max?this.max:this.min,E.isNullOrUndefined(t))&&s&&(t=i),[t=i<(t=t<e?e:t)?i:t,this.checkHandlePosition(t)]},l.prototype.setValue=function(){var t;!E.isNullOrUndefined(this.customValues)&&0<this.customValues.length&&(this.min=0,this.max=this.customValues.length-1,this.setBarColor()),this.setAriaAttributes(this.firstHandle),this.handleVal1=E.isNullOrUndefined(this.value)?this.checkHandleValue(parseFloat(this.min.toString())):this.checkHandleValue(parseFloat(this.value.toString())),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.preHandlePos1=this.handlePos1,E.isNullOrUndefined(this.activeHandle)&&(this.activeHandle="Range"===this.type?2:1),"Default"===this.type||"MinRange"===this.type?(this.limits.enabled&&(t=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd),this.handleVal1=t[0],this.handlePos1=t[1],this.preHandlePos1=this.handlePos1),this.setHandlePosition(null),this.handleStart(),this.value=this.handleVal1,this.setAriaAttrValue(this.firstHandle),this.changeEvent("changed",null)):this.validateRangeValue(),"Default"!==this.type&&this.setRangeBar(),this.limits.enabled&&this.setLimitBar()},l.prototype.rangeValueUpdate=function(){null!==this.value&&"object"==typeof this.value||(this.value=[parseFloat(E.formatUnit(this.min)),parseFloat(E.formatUnit(this.max))])},l.prototype.validateRangeValue=function(){this.rangeValueUpdate(),this.setRangeValue()},l.prototype.modifyZindex=function(){"Range"!==this.type||E.isNullOrUndefined(this.firstHandle)||E.isNullOrUndefined(this.secondHandle)?this.isMaterialTooltip&&this.tooltipElement&&(this.tooltipElement.style.zIndex=h.getZindexPartial(this.element)+""):1===this.activeHandle?(this.firstHandle.style.zIndex=this.zIndex+4+"",this.secondHandle.style.zIndex=this.zIndex+3+""):(this.firstHandle.style.zIndex=this.zIndex+3+"",this.secondHandle.style.zIndex=this.zIndex+4+"")},l.prototype.setHandlePosition=function(t){var e=this,i=1===this.activeHandle?this.handlePos1:this.handlePos2,s=this.isMaterialTooltip?[this.firstHandle,this.materialHandle]:[this.getHandle()];this.handleStart(),s.forEach(function(t){E.isNullOrUndefined(t)||("Horizontal"===e.orientation?e.enableRtl?t.style.right=i+"px":t.style.left=i+"px":t.style.bottom=i+"px")}),this.changeEvent("change",t)},l.prototype.getHandle=function(){return 1===this.activeHandle?this.firstHandle:this.secondHandle},l.prototype.setRangeValue=function(){this.updateRangeValue(),this.activeHandle=1,this.setHandlePosition(null),this.activeHandle=2,this.setHandlePosition(null),this.activeHandle=1},l.prototype.changeEvent=function(t,e){var i,s="change"===t?this.previousVal:this.previousChanged;"Range"!==this.type?(this.setProperties({value:this.handleVal1},!0),s===this.value||this.isMaterialTooltip&&this.initialTooltip||(this.trigger(t,this.changeEventArgs(t,e)),this.initialTooltip=!0,this.setPreviousVal(t,this.value)),this.setAriaAttrValue(this.firstHandle)):(i=this.value=[this.handleVal1,this.handleVal2],this.setProperties({value:i},!0),(s.length===this.value.length&&this.value[0]!==s[0]||this.value[1]!==s[1])&&(this.initialTooltip=!1,this.trigger(t,this.changeEventArgs(t,e)),this.initialTooltip=!0,this.setPreviousVal(t,this.value)),this.setAriaAttrValue(this.getHandle())),this.hiddenInput.value=this.value.toString()},l.prototype.changeEventArgs=function(t,e){t=this.tooltip.isVisible&&this.tooltipObj&&this.initialTooltip?(this.tooltipValue(),{value:this.value,previousValue:"change"===t?this.previousVal:this.previousChanged,action:t,text:"function"==typeof this.tooltipObj.content?this.tooltipObj.content():this.tooltipObj.content,isInteracted:!E.isNullOrUndefined(e)}):{value:this.value,previousValue:"change"===t?this.previousVal:this.previousChanged,action:t,text:E.isNullOrUndefined(this.ticksFormatInfo.format)?this.value.toString():"Range"!==this.type?this.formatString(this.value,this.ticksFormatInfo).formatString:this.formatString(this.value[0],this.ticksFormatInfo).formatString+" - "+this.formatString(this.value[1],this.ticksFormatInfo).formatString,isInteracted:!E.isNullOrUndefined(e)};return t},l.prototype.setPreviousVal=function(t,e){"change"===t?this.previousVal=e:this.previousChanged=e},l.prototype.updateRangeValue=function(){var t=this.value.toString().split(",").map(Number);this.enableRtl&&"Vertical"!==this.orientation||this.rtl?this.value=[t[1],t[0]]:this.value=[t[0],t[1]],this.enableRtl&&"Vertical"!==this.orientation?(this.handleVal1=this.checkHandleValue(this.value[1]),this.handleVal2=this.checkHandleValue(this.value[0])):(this.handleVal1=this.checkHandleValue(this.value[0]),this.handleVal2=this.checkHandleValue(this.value[1])),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.handlePos2=this.checkHandlePosition(this.handleVal2),this.min<this.max&&this.handlePos1>this.handlePos2&&(this.handlePos1=this.handlePos2,this.handleVal1=this.handleVal2),this.min>this.max&&this.handlePos1<this.handlePos2&&(this.handlePos2=this.handlePos1,this.handleVal2=this.handleVal1),this.preHandlePos1=this.handlePos1,this.preHandlePos2=this.handlePos2,this.limits.enabled&&(this.activeHandle=1,t=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd),this.handleVal1=t[0],this.handlePos1=t[1],this.preHandlePos1=this.handlePos1,this.activeHandle=2,t=this.getLimitValueAndPosition(this.handleVal2,this.limits.maxStart,this.limits.maxEnd),this.handleVal2=t[0],this.handlePos2=t[1],this.preHandlePos2=this.handlePos2)},l.prototype.checkHandlePosition=function(t){return t=100*(t-parseFloat(E.formatUnit(this.min)))/(parseFloat(E.formatUnit(this.max))-parseFloat(E.formatUnit(this.min))),t="Horizontal"===this.orientation?this.element.getBoundingClientRect().width*(t/100):this.element.getBoundingClientRect().height*(t/100),t=parseFloat(E.formatUnit(this.max))===parseFloat(E.formatUnit(this.min))?"Horizontal"===this.orientation?this.element.getBoundingClientRect().width:this.element.getBoundingClientRect().height:t},l.prototype.checkHandleValue=function(t){var e;return this.min===this.max?parseFloat(E.formatUnit(this.max)):(t<(e=this.tempStartEnd()).start?t=e.start:t>e.end&&(t=e.end),t)},l.prototype.reposition=function(){var t=this;E.isNullOrUndefined(this.firstHandle)||(this.firstHandle.style.transition="none"),"Default"===this.type||E.isNullOrUndefined(this.rangeBar)||(this.rangeBar.style.transition="none"),"Range"!==this.type||E.isNullOrUndefined(this.secondHandle)||(this.secondHandle.style.transition="none"),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.handleVal2&&(this.handlePos2=this.checkHandlePosition(this.handleVal2)),"Horizontal"===this.orientation?(this.enableRtl?this.firstHandle.style.right=this.handlePos1+"px":this.firstHandle.style.left=this.handlePos1+"px",this.isMaterialTooltip&&!E.isNullOrUndefined(this.materialHandle)&&(this.enableRtl?this.materialHandle.style.right=this.handlePos1+"px":this.materialHandle.style.left=this.handlePos1+"px"),"MinRange"!==this.type||E.isNullOrUndefined(this.rangeBar)?"Range"!==this.type||E.isNullOrUndefined(this.secondHandle)||E.isNullOrUndefined(this.rangeBar)||(this.enableRtl?(this.secondHandle.style.right=this.handlePos2+"px",this.rangeBar.style.right=this.handlePos1+"px"):(this.secondHandle.style.left=this.handlePos2+"px",this.rangeBar.style.left=this.handlePos1+"px"),E.setStyleAttribute(this.rangeBar,{width:this.handlePos2-this.handlePos1+"px"})):(this.enableRtl?this.rangeBar.style.right="0px":this.rangeBar.style.left="0px",E.setStyleAttribute(this.rangeBar,{width:E.isNullOrUndefined(this.handlePos1)?0:this.handlePos1+"px"}))):(this.firstHandle.style.bottom=this.handlePos1+"px",this.isMaterialTooltip&&(this.materialHandle.style.bottom=this.handlePos1+"px"),"MinRange"===this.type?(this.rangeBar.style.bottom=this.min>this.max?this.handlePos1+"px":"0px",E.setStyleAttribute(this.rangeBar,{height:E.isNullOrUndefined(this.handlePos1)?0:this.min>this.max?this.element.clientHeight-this.handlePos1+"px":this.handlePos1+"px"})):"Range"===this.type&&(this.secondHandle.style.bottom=this.handlePos2+"px",this.rangeBar.style.bottom=this.min>this.max?this.handlePos2+"px":this.handlePos1+"px",E.setStyleAttribute(this.rangeBar,{height:this.min>this.max?this.handlePos1-this.handlePos2+"px":this.handlePos2-this.handlePos1+"px"}))),this.limits.enabled&&this.setLimitBar(),"None"!==this.ticks.placement&&this.ul&&(this.removeElement(this.ul),this.ul=void 0,this.renderScale()),this.handleStart(),this.tooltip.isVisible||setTimeout(function(){E.isNullOrUndefined(t.firstHandle)||(t.firstHandle.style.transition=t.scaleTransform),"Range"!==t.type||E.isNullOrUndefined(t.secondHandle)||(t.secondHandle.style.transition=t.scaleTransform)}),this.refreshTooltip(this.tooltipTarget),this.setBarColor()},l.prototype.changeHandleValue=function(t,e){var i=null;1===this.activeHandle?this.limits.enabled&&this.limits.startHandleFixed||(this.handleVal1=this.checkHandleValue(t),this.handlePos1=this.checkHandlePosition(this.handleVal1),"Range"===this.type&&(this.handlePos1>this.handlePos2&&this.min<this.max||this.handlePos1<this.handlePos2&&this.min>this.max)&&(this.handlePos1=this.handlePos2,this.handleVal1=this.handleVal2),this.handlePos1!==this.preHandlePos1&&(i=this.preHandlePos1=this.handlePos1)):this.limits.enabled&&this.limits.endHandleFixed||(this.handleVal2=this.checkHandleValue(t),this.handlePos2=this.checkHandlePosition(this.handleVal2),"Range"===this.type&&(this.handlePos2<this.handlePos1&&this.min<this.max||this.handlePos2>this.handlePos1&&this.min>this.max)&&(this.handlePos2=this.handlePos1,this.handleVal2=this.handleVal1),this.handlePos2!==this.preHandlePos2&&(i=this.preHandlePos2=this.handlePos2)),this.modifyZindex(),null!==i&&("Default"!==this.type&&this.setRangeBar(),this.setHandlePosition(e))},l.prototype.tempStartEnd=function(){return this.min>this.max?{start:this.max,end:this.min}:{start:this.min,end:this.max}},l.prototype.xyToPosition=function(t){var e,i;if(this.min===this.max)return 100;"Horizontal"===this.orientation?(e=t.x-this.element.getBoundingClientRect().left,i=this.element.offsetWidth/100,this.val=e/i):(e=t.y-this.element.getBoundingClientRect().top,i=this.element.offsetHeight/100,this.val=100-e/i);t=this.stepValueCalculation(this.val);return t<0?t=0:100<t&&(t=100),this.enableRtl&&"Vertical"!==this.orientation&&(t=100-t),"Horizontal"===this.orientation?this.element.getBoundingClientRect().width*(t/100):this.element.getBoundingClientRect().height*(t/100)},l.prototype.stepValueCalculation=function(t){0===this.step&&(this.step=1);var e=parseFloat(E.formatUnit(this.step))/((parseFloat(E.formatUnit(this.max))-parseFloat(E.formatUnit(this.min)))/100),i=t%Math.abs(e);return 0!=i&&(i<e/2?t-=i:t+=Math.abs(e)-i),t},l.prototype.add=function(t,e,i){var s=Math.pow(10,3),i=i?(Math.round(t*s)+Math.round(e*s))/s:(Math.round(t*s)-Math.round(e*s))/s;return i},l.prototype.positionToValue=function(t){var e=parseFloat(E.formatUnit(this.max))-parseFloat(E.formatUnit(this.min)),t="Horizontal"===this.orientation?t/this.element.getBoundingClientRect().width*e:t/this.element.getBoundingClientRect().height*e;return this.add(t,parseFloat(this.min.toString()),!0)},l.prototype.sliderBarClick=function(t){t.preventDefault(),"mousedown"===t.type||"mouseup"===t.type||"click"===t.type?i={x:t.clientX,y:t.clientY}:"touchend"!==t.type&&"touchstart"!==t.type||(i={x:t.changedTouches[0].clientX,y:t.changedTouches[0].clientY});var e,i=this.xyToPosition(i),s=this.positionToValue(i),n=(("Range"===this.type&&(this.min<this.max&&this.handlePos2-i<i-this.handlePos1||this.min>this.max&&this.handlePos1-i>i-this.handlePos2)?(this.activeHandle=2,this.limits.enabled&&this.limits.endHandleFixed||(this.limits.enabled&&(s=(n=this.getLimitValueAndPosition(s,this.limits.maxStart,this.limits.maxEnd))[0],i=n[1]),this.secondHandle.classList.add(Ni),this.handlePos2=this.preHandlePos2=i,this.handleVal2=s),this.modifyZindex(),this.secondHandle):(this.activeHandle=1,this.limits.enabled&&this.limits.startHandleFixed||(this.limits.enabled&&(s=(n=this.getLimitValueAndPosition(s,this.limits.minStart,this.limits.minEnd))[0],i=n[1]),this.firstHandle.classList.add(Ni),this.handlePos1=this.preHandlePos1=i,this.handleVal1=s),this.modifyZindex(),this.firstHandle)).focus(),this.isMaterialTooltip&&this.tooltipElement.classList.add(ci),this.element.querySelector("."+a)),i=(n&&this.getHandle()!==n&&n.classList.remove(a),1===this.activeHandle?this.firstHandle:this.secondHandle);"click"!==t.type&&"mousedown"!==t.type||t.target!==i||(n=t.clientX,e=t.clientY,document.elementFromPoint(n,e)),this.checkRepeatedValue(s)&&(n=(this.isMaterial||this.isMaterial3)&&this.tooltip.isVisible?this.transitionOnMaterialTooltip:this.transition,this.getHandle().style.transition=n.handle,"Default"!==this.type&&(this.rangeBar.style.transition=n.rangeBar),this.setHandlePosition(t),this.isMaterialTooltip&&(this.initialTooltip=!1),t.target!==i&&this.changeEvent("changed",t),"Default"!==this.type)&&this.setRangeBar()},l.prototype.handleValueAdjust=function(t,e,i){1===i?(this.handleVal1=e,this.handleVal2=this.handleVal1+this.minDiff):2===i&&(this.handleVal2=e,this.handleVal1=this.handleVal2-this.minDiff),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.handlePos2=this.checkHandlePosition(this.handleVal2)},l.prototype.dragRangeBarMove=function(t){var e,i,s;"touchmove"!==t.type&&t.preventDefault(),this.rangeBarDragged=!0,this.rangeBar.style.transition="none",this.firstHandle.style.transition="none",this.secondHandle.style.transition="none",e=("mousemove"===t.type?(i=(e=[t.clientX,t.clientY])[0],e):(i=(e=[t.changedTouches[0].clientX,t.changedTouches[0].clientY])[0],e))[1],this.limits.enabled&&this.limits.startHandleFixed||this.limits.enabled&&this.limits.endHandleFixed||(s=this.enableRtl?{x:i+this.secondPartRemain,y:e+this.secondPartRemain}:{x:i-this.firstPartRemain,y:e+this.secondPartRemain},this.min>this.max?(this.handlePos2=this.xyToPosition(s),this.handleVal2=this.positionToValue(this.handlePos2)):(this.handlePos1=this.xyToPosition(s),this.handleVal1=this.positionToValue(this.handlePos1)),s=this.enableRtl?{x:i-this.firstPartRemain,y:e-this.firstPartRemain}:{x:i+this.secondPartRemain,y:e-this.firstPartRemain},this.min>this.max?(this.handlePos1=this.xyToPosition(s),this.handleVal1=this.positionToValue(this.handlePos1)):(this.handlePos2=this.xyToPosition(s),this.handleVal2=this.positionToValue(this.handlePos2)),this.limits.enabled&&(i=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd),this.handleVal1=i[0],this.handlePos1=i[1],this.handleVal1===this.limits.minEnd&&this.handleValueAdjust(this.handleVal1,this.limits.minEnd,1),this.handleVal1===this.limits.minStart&&this.handleValueAdjust(this.handleVal1,this.limits.minStart,1),i=this.getLimitValueAndPosition(this.handleVal2,this.limits.maxStart,this.limits.maxEnd),this.handleVal2=i[0],this.handlePos2=i[1],this.handleVal2===this.limits.maxStart&&this.handleValueAdjust(this.handleVal2,this.limits.maxStart,2),this.handleVal2===this.limits.maxEnd)&&this.handleValueAdjust(this.handleVal2,this.limits.maxEnd,2),this.handleVal2===(this.min>this.max?this.min:this.max)&&this.handleValueAdjust(this.handleVal2,this.min>this.max?this.min:this.max,2),this.handleVal1===(this.min>this.max?this.max:this.min)&&this.handleValueAdjust(this.handleVal1,this.min>this.max?this.max:this.min,1)),this.activeHandle=1,this.setHandlePosition(t),this.activeHandle=2,this.setHandlePosition(t),this.tooltipToggle(this.rangeBar),this.setRangeBar()},l.prototype.sliderBarUp=function(t){this.changeEvent("changed",t),this.handleFocusOut(),this.firstHandle.classList.remove(Ni),"Range"===this.type&&(this.initialTooltip=!1,this.secondHandle.classList.remove(Ni)),this.closeTooltip(),(this.isMaterial||this.isMaterial3)&&(this.getHandle().classList.remove("e-large-thumb-size"),this.isMaterialTooltip)&&this.tooltipElement.classList.remove(ci),E.EventHandler.remove(document,"mousemove touchmove",this.sliderBarMove),E.EventHandler.remove(document,"mouseup touchend",this.sliderBarUp)},l.prototype.sliderBarMove=function(t){"touchmove"!==t.type&&t.preventDefault(),s="mousemove"===t.type?{x:t.clientX,y:t.clientY}:{x:t.changedTouches[0].clientX,y:t.changedTouches[0].clientY};var e,i,s=this.xyToPosition(s),n=this.positionToValue(s);s=Math.round(s),"Range"!==this.type&&1===this.activeHandle&&(this.limits.enabled&&this.limits.startHandleFixed||(this.limits.enabled&&(s=(e=this.getLimitValueAndPosition(n,this.limits.minStart,this.limits.minEnd))[1],n=e[0]),this.handlePos1=s,this.handleVal1=n),this.firstHandle.classList.add(Ni)),"Range"===this.type&&(1===this.activeHandle?(this.firstHandle.classList.add(Ni),this.limits.enabled&&this.limits.startHandleFixed||((this.min<this.max&&s>this.handlePos2||this.min>this.max&&s<this.handlePos2)&&(s=this.handlePos2,n=this.handleVal2),s!==this.preHandlePos1&&(this.limits.enabled&&(n=(i=this.getLimitValueAndPosition(n,this.limits.minStart,this.limits.minEnd))[0],s=i[1]),this.handlePos1=this.preHandlePos1=s,this.handleVal1=n,this.activeHandle=1))):2===this.activeHandle&&(this.secondHandle.classList.add(Ni),this.limits.enabled&&this.limits.endHandleFixed||((this.min<this.max&&s<this.handlePos1||this.min>this.max&&s>this.handlePos1)&&(s=this.handlePos1,n=this.handleVal1),s!==this.preHandlePos2&&(this.limits.enabled&&(n=(i=this.getLimitValueAndPosition(n,this.limits.maxStart,this.limits.maxEnd))[0],s=i[1]),this.handlePos2=this.preHandlePos2=s,this.handleVal2=n,this.activeHandle=2)))),this.checkRepeatedValue(n)&&(this.getHandle().style.transition=this.scaleTransform,"Default"!==this.type&&(this.rangeBar.style.transition="none"),this.setHandlePosition(t),!this.isMaterial&&!this.isMaterial3||this.tooltip.isVisible||this.getHandle().classList.contains(a)||this.materialChange(),this.tooltipToggle(this.getHandle()),"Default"!==this.type)&&this.setRangeBar()},l.prototype.dragRangeBarUp=function(t){this.rangeBarDragged?this.isDragComplete=!0:(this.focusSliderElement(),this.sliderBarClick(t)),this.changeEvent("changed",t),this.closeTooltip(),E.EventHandler.remove(document,"mousemove touchmove",this.dragRangeBarMove),E.EventHandler.remove(document,"mouseup touchend",this.dragRangeBarUp),this.rangeBarDragged=!1},l.prototype.checkRepeatedValue=function(t){if("Range"===this.type){if(t===(this.enableRtl&&"Vertical"!==this.orientation?1===this.activeHandle?this.previousVal[1]:this.previousVal[0]:1===this.activeHandle?this.previousVal[0]:this.previousVal[1]))return 0}else if(t===this.previousVal)return 0;return 1},l.prototype.refreshTooltip=function(t){this.tooltip.isVisible&&this.tooltipObj&&(this.tooltipValue(),t)&&(this.tooltipObj.refresh(t),this.tooltipTarget=t)},l.prototype.openTooltip=function(t){this.tooltip.isVisible&&this.tooltipObj&&!this.isMaterialTooltip&&(this.tooltipValue(),this.tooltipObj.open(t),this.tooltipTarget=t)},l.prototype.closeTooltip=function(){this.tooltip.isVisible&&this.tooltipObj&&"Always"!==this.tooltip.showOn&&!this.isMaterialTooltip&&(this.tooltipValue(),this.tooltipObj.close(),this.tooltipTarget=void 0)},l.prototype.keyDown=function(t){switch(t.keyCode){case 37:case 38:case 39:case 40:case 33:case 34:case 36:case 35:t.preventDefault(),this.buttonClick(t)}},l.prototype.wireButtonEvt=function(t){t?(E.EventHandler.remove(this.firstBtn,"mouseleave touchleave",this.buttonFocusOut),E.EventHandler.remove(this.secondBtn,"mouseleave touchleave",this.buttonFocusOut),E.EventHandler.remove(this.firstBtn,"mousedown touchstart",this.repeatHandlerMouse),E.EventHandler.remove(this.firstBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp),E.EventHandler.remove(this.secondBtn,"mousedown touchstart",this.repeatHandlerMouse),E.EventHandler.remove(this.secondBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp),E.EventHandler.remove(this.firstBtn,"focusout",this.sliderFocusOut),E.EventHandler.remove(this.secondBtn,"focusout",this.sliderFocusOut)):(E.EventHandler.add(this.firstBtn,"mouseleave touchleave",this.buttonFocusOut,this),E.EventHandler.add(this.secondBtn,"mouseleave touchleave",this.buttonFocusOut,this),E.EventHandler.add(this.firstBtn,"mousedown touchstart",this.repeatHandlerMouse,this),E.EventHandler.add(this.firstBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp,this),E.EventHandler.add(this.secondBtn,"mousedown touchstart",this.repeatHandlerMouse,this),E.EventHandler.add(this.secondBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp,this),E.EventHandler.add(this.firstBtn,"focusout",this.sliderFocusOut,this),E.EventHandler.add(this.secondBtn,"focusout",this.sliderFocusOut,this))},l.prototype.rangeBarMousedown=function(t){var e,i,s;t.preventDefault(),this.focusSliderElement(),"Range"===this.type&&this.drag&&t.target===this.rangeBar&&(s=i=void 0,"mousedown"===t.type?(i=(e=[t.clientX,t.clientY])[0],s=e[1]):"touchstart"===t.type&&(i=(e=[t.changedTouches[0].clientX,t.changedTouches[0].clientY])[0],s=e[1]),"Horizontal"===this.orientation?(this.firstPartRemain=i-this.rangeBar.getBoundingClientRect().left,this.secondPartRemain=this.rangeBar.getBoundingClientRect().right-i):(this.firstPartRemain=s-this.rangeBar.getBoundingClientRect().top,this.secondPartRemain=this.rangeBar.getBoundingClientRect().bottom-s),this.minDiff=this.handleVal2-this.handleVal1,this.tooltipToggle(this.rangeBar),(t=this.element.querySelector("."+a))&&t.classList.remove(a),E.EventHandler.add(document,"mousemove touchmove",this.dragRangeBarMove,this),E.EventHandler.add(document,"mouseup touchend",this.dragRangeBarUp,this))},l.prototype.elementClick=function(t){this.isDragComplete?this.isDragComplete=!1:(t.preventDefault(),this.focusSliderElement(),this.sliderBarClick(t),this.focusHandle())},l.prototype.wireEvents=function(){this.onresize=this.reposition.bind(this),window.addEventListener("resize",this.onresize),this.enabled&&!this.readonly&&(E.EventHandler.add(this.element,"click",this.elementClick,this),"Range"===this.type&&this.drag&&E.EventHandler.add(this.rangeBar,"mousedown touchstart",this.rangeBarMousedown,this),E.EventHandler.add(this.sliderContainer,"keydown",this.keyDown,this),E.EventHandler.add(this.sliderContainer,"keyup",this.keyUp,this),E.EventHandler.add(this.element,"focusout",this.sliderFocusOut,this),E.EventHandler.add(this.sliderContainer,"mouseover mouseout touchstart touchend",this.hover,this),this.wireFirstHandleEvt(!1),"Range"===this.type&&this.wireSecondHandleEvt(!1),this.showButtons&&this.wireButtonEvt(!1),this.wireMaterialTooltipEvent(!1),this.isForm)&&E.EventHandler.add(this.formElement,"reset",this.formResetHandler,this)},l.prototype.unwireEvents=function(){E.EventHandler.remove(this.element,"click",this.elementClick),"Range"===this.type&&this.drag&&E.EventHandler.remove(this.rangeBar,"mousedown touchstart",this.rangeBarMousedown),E.EventHandler.remove(this.sliderContainer,"keydown",this.keyDown),E.EventHandler.remove(this.sliderContainer,"keyup",this.keyUp),E.EventHandler.remove(this.element,"focusout",this.sliderFocusOut),E.EventHandler.remove(this.sliderContainer,"mouseover mouseout touchstart touchend",this.hover),this.wireFirstHandleEvt(!0),"Range"===this.type&&this.wireSecondHandleEvt(!0),this.showButtons&&this.wireButtonEvt(!0),this.wireMaterialTooltipEvent(!0),E.EventHandler.remove(this.element,"reset",this.formResetHandler)},l.prototype.formResetHandler=function(){this.setProperties({value:this.formResetValue},!0),this.setValue()},l.prototype.keyUp=function(t){var e;9===t.keyCode&&t.target.classList.contains(Ke)&&(this.focusSliderElement(),t.target.classList.contains(a)||(this.element.querySelector("."+a)&&this.element.querySelector("."+a).classList.remove(a),t.target.classList.add(a),(e=t.target.parentElement)===this.element&&(e.querySelector("."+fi).classList.add(ki),"Range"!==this.type&&"MinRange"!==this.type||e.querySelector("."+Ye).classList.add(Ai)),"Range"===this.type&&((e=t.target.previousSibling)&&e.classList.contains(Ke)?this.activeHandle=2:this.activeHandle=1),this.getHandle().focus(),this.tooltipToggle(this.getHandle()))),this.closeTooltip(),this.changeEvent("changed",t)},l.prototype.hover=function(t){E.isNullOrUndefined(t)||("mouseover"===t.type||"touchmove"===t.type||"mousemove"===t.type||"pointermove"===t.type||"touchstart"===t.type?this.sliderContainer.classList.add(si):(this.sliderContainer.classList.remove(si),t=t.currentTarget,this.tooltip.isVisible&&"Always"!==this.tooltip.showOn&&this.tooltipObj&&this.isMaterialTooltip&&!t.classList.contains(yi)&&!t.classList.contains(a)&&this.closeMaterialTooltip()))},l.prototype.sliderFocusOut=function(t){t.relatedTarget!==this.secondHandle&&t.relatedTarget!==this.firstHandle&&t.relatedTarget!==this.element&&t.relatedTarget!==this.firstBtn&&t.relatedTarget!==this.secondBtn&&(this.closeMaterialTooltip(),this.closeTooltip(),this.element.querySelector("."+a)&&this.element.querySelector("."+a).classList.remove(a),this.element.querySelector("."+ki)&&(this.element.querySelector("."+ki).classList.remove(ki),"Range"!==this.type&&"MinRange"!==this.type||!this.element.querySelector("."+Ai)||this.element.querySelector("."+Ai).classList.remove(Ai)),this.hiddenInput.focus(),this.hiddenInput.blur(),this.isElementFocused=!1)},l.prototype.removeElement=function(t){t.parentNode&&t.parentNode.removeChild(t)},l.prototype.changeSliderType=function(t,e){this.isMaterialTooltip&&this.materialHandle&&(this.sliderContainer.classList.remove(mi),this.removeElement(this.materialHandle),this.materialHandle=void 0),this.removeElement(this.firstHandle),this.firstHandle=void 0,"Default"!==t&&("Range"===t&&(this.removeElement(this.secondHandle),this.secondHandle=void 0),this.removeElement(this.rangeBar),this.rangeBar=void 0),this.tooltip.isVisible&&!E.isNullOrUndefined(this.tooltipObj)&&(this.tooltipObj.destroy(),this.tooltipElement=void 0,this.tooltipCollidedPosition=void 0),this.limits.enabled&&("MinRange"===t||"Default"===t?E.isNullOrUndefined(this.limitBarFirst)||(this.removeElement(this.limitBarFirst),this.limitBarFirst=void 0):E.isNullOrUndefined(this.limitBarSecond)||(this.removeElement(this.limitBarSecond),this.limitBarSecond=void 0)),this.activeHandle=1,this.getThemeInitialization(),"Range"===this.type&&this.rangeValueUpdate(),this.createRangeBar(),this.limits.enabled&&this.createLimitBar(),this.setHandler(),this.setOrientClass(),this.wireFirstHandleEvt(!this.enabled),"Range"===this.type&&this.wireSecondHandleEvt(!this.enabled),this.setValue(),this.tooltip.isVisible&&(this.renderTooltip(),this.wireMaterialTooltipEvent(!1)),this.setBarColor(),"tooltip"!==e&&this.updateConfig(),this.readonly&&(this.sliderContainer.classList.remove(Fi),this.setReadOnly())},l.prototype.changeRtl=function(){var t;this.enableRtl||"Range"!==this.type||(this.value=[this.handleVal2,this.handleVal1]),this.updateConfig(),this.tooltip.isVisible&&this.tooltipObj.refresh(this.firstHandle),this.showButtons&&(t=this.enableRtl&&"Vertical"!==this.orientation,E.attributes(t?this.secondBtn:this.firstBtn,{"aria-label":"Decrease",title:"Decrease"}),E.attributes(t?this.firstBtn:this.secondBtn,{"aria-label":"Increase",title:"Increase"}))},l.prototype.changeOrientation=function(){this.changeSliderType(this.type,"null")},l.prototype.updateConfig=function(){this.setEnableRTL(),this.setValue(),this.tooltip.isVisible&&this.refreshTooltip(this.tooltipTarget),"None"!==this.ticks.placement&&this.ul&&(this.removeElement(this.ul),this.ul=void 0,this.renderScale()),this.limitsPropertyChange()},l.prototype.limitsPropertyChange=function(){this.limits.enabled?(E.isNullOrUndefined(this.limitBarFirst)&&"Range"!==this.type&&this.createLimitBar(),E.isNullOrUndefined(this.limitBarFirst)&&E.isNullOrUndefined(this.limitBarSecond)&&"Range"===this.type&&this.createLimitBar(),this.setLimitBar(),this.setValue()):(E.isNullOrUndefined(this.limitBarFirst)||E.detach(this.limitBarFirst),E.isNullOrUndefined(this.limitBarSecond)||E.detach(this.limitBarSecond))},l.prototype.getPersistData=function(){return this.addOnPersist(["value"])},l.prototype.destroy=function(){We.prototype.destroy.call(this),this.unwireEvents(),window.removeEventListener("resize",this.onresize),E.removeClass([this.sliderContainer],[li]),this.firstHandle.removeAttribute("aria-orientation"),"Range"===this.type&&this.secondHandle.removeAttribute("aria-orientation"),this.sliderContainer.parentNode&&this.sliderContainer.parentNode.insertBefore(this.element,this.sliderContainer),E.detach(this.sliderContainer),this.tooltip.isVisible&&this.tooltipObj.destroy(),this.element.innerHTML="",this.hiddenInput=null,this.sliderContainer=null,this.sliderTrack=null,this.rangeBar=null,this.firstHandle=null,this.secondHandle=null,this.tickElementCollection=null,this.ul=null,this.firstBtn=null,this.secondBtn=null,this.materialHandle=null,this.tooltipObj=null,this.tooltipTarget=null,this.limitBarFirst=null,this.limitBarSecond=null,this.firstChild=null,this.lastChild=null,this.tooltipElement=null},l.prototype.onPropertyChanged=function(t,e){for(var i=this,s=0,n=Object.keys(t);s<n.length;s++){var a,l=n[s];switch(l){case"cssClass":this.setCSSClass(e.cssClass);break;case"value":t&&e&&(a=E.isNullOrUndefined(t.value)?"Range"===this.type?[this.min,this.max]:this.min:t.value,this.setProperties({value:a},!0),E.isNullOrUndefined(e.value)||e.value.toString()===a.toString()||(this.setValue(),this.refreshTooltip(this.tooltipTarget),"Range"===this.type&&(E.isNullOrUndefined(t.value)||e.value[1]===a[1]?this.activeHandle=1:this.activeHandle=2)));break;case"min":case"step":case"max":this.setMinMaxValue();break;case"tooltip":E.isNullOrUndefined(t.tooltip)||E.isNullOrUndefined(e.tooltip)||(this.initialTooltip=!0,this.setTooltip(l),this.showButtons)||this.wireEvents();break;case"type":E.isNullOrUndefined(e)||!Object.keys(e).length||E.isNullOrUndefined(e.type)||(this.changeSliderType(e.type,l),this.setZindex());break;case"enableRtl":e.enableRtl!==t.enableRtl&&"Vertical"!==this.orientation&&(this.rtl=e.enableRtl,this.changeRtl());break;case"limits":this.limitsPropertyChange();break;case"orientation":this.changeOrientation();break;case"ticks":E.isNullOrUndefined(this.sliderContainer.querySelector("."+$e))||(E.detach(this.ul),Array.prototype.forEach.call(this.sliderContainer.classList,function(t){t.match(/e-scale-/)&&i.sliderContainer.classList.remove(t)})),"None"!==this.ticks.placement&&(this.renderScale(),this.setZindex());break;case"locale":this.showButtons&&this.buttonTitle();break;case"showButtons":t.showButtons?(this.setButtons(),this.reposition(),this.enabled&&!this.readonly&&this.wireButtonEvt(!1)):this.firstBtn&&this.secondBtn&&(this.sliderContainer.removeChild(this.firstBtn),this.sliderContainer.removeChild(this.secondBtn),this.sliderContainer.classList.remove(Li),this.firstBtn=void 0,this.secondBtn=void 0,this.reposition());break;case"enabled":this.setEnabled();break;case"readonly":this.setReadOnly();break;case"customValues":this.setValue(),this.reposition();break;case"colorRange":this.reposition();break;case"width":this.setElementWidth(t.width),this.setMinMaxValue(),this.limits&&this.limitsPropertyChange()}}},l.prototype.setReadOnly=function(){this.readonly?(this.unwireEvents(),this.sliderContainer.classList.add(Fi)):(this.wireEvents(),this.sliderContainer.classList.remove(Fi))},l.prototype.setMinMaxValue=function(){var e=this;this.setValue(),this.refreshTooltip(this.tooltipTarget),E.isNullOrUndefined(this.sliderContainer.querySelector("."+$e))||this.ul&&(E.detach(this.ul),Array.prototype.forEach.call(this.sliderContainer.classList,function(t){t.match(/e-scale-/)&&e.sliderContainer.classList.remove(t)})),"None"!==this.ticks.placement&&(this.renderScale(),this.setZindex())},l.prototype.setZindex=function(){this.zIndex=6,E.isNullOrUndefined(this.ticks)||"None"===this.ticks.placement||E.isNullOrUndefined(this.ul)||E.isNullOrUndefined(this.element)||(this.ul.style.zIndex=this.zIndex+-7+"",this.element.style.zIndex=this.zIndex+2+""),this.isMaterial||this.isMaterial3||E.isNullOrUndefined(this.ticks)||"Both"!==this.ticks.placement||(this.element.style.zIndex=this.zIndex+2+""),E.isNullOrUndefined(this.firstHandle)||(this.firstHandle.style.zIndex=this.zIndex+3+""),"Range"!==this.type||E.isNullOrUndefined(this.secondHandle)||(this.secondHandle.style.zIndex=this.zIndex+4+"")},l.prototype.setTooltip=function(t){this.changeSliderType(this.type,t)},l.prototype.setBarColor=function(){for(var t,e,i=this.sliderTrack.lastElementChild;i;)this.sliderTrack.removeChild(i),i=this.sliderTrack.lastElementChild;for(var s,n,a,l=0;l<this.colorRange.length;l++)E.isNullOrUndefined(this.colorRange[l].start)||E.isNullOrUndefined(this.colorRange[l].end)||this.colorRange[l].end>this.colorRange[l].start&&(this.colorRange[l].start<this.min&&(this.colorRange[l].start=this.min),this.colorRange[l].end>this.max&&(this.colorRange[l].end=this.max),s=this.checkHandlePosition(this.colorRange[l].start),n=this.checkHandlePosition(this.colorRange[l].end),(a=this.createElement("div")).style.backgroundColor=this.colorRange[l].color,a.style.border="1px solid "+this.colorRange[l].color,"Horizontal"===this.orientation?(e=vi,t=this.enableRtl?E.isNullOrUndefined(this.customValues)?this.checkHandlePosition(this.max)-this.checkHandlePosition(this.colorRange[l].end):this.checkHandlePosition(this.customValues.length-this.colorRange[l].end-1):this.checkHandlePosition(this.colorRange[l].start),a.style.width=n-s+"px",a.style.left=t+"px"):(e=gi,t=this.checkHandlePosition(this.colorRange[l].start),a.style.height=n-s+"px",a.style.bottom=t+"px"),a.classList.add(e),this.sliderTrack.appendChild(a))},l.prototype.getModuleName=function(){return"slider"},s([E.Property(null)],l.prototype,"value",void 0),s([E.Property(null)],l.prototype,"customValues",void 0),s([E.Property(1)],l.prototype,"step",void 0),s([E.Property(null)],l.prototype,"width",void 0),s([E.Property(0)],l.prototype,"min",void 0),s([E.Property(100)],l.prototype,"max",void 0),s([E.Property(!1)],l.prototype,"readonly",void 0),s([E.Property("Default")],l.prototype,"type",void 0),s([E.Collection([{}],Be)],l.prototype,"colorRange",void 0),s([E.Complex({},Ae)],l.prototype,"ticks",void 0),s([E.Complex({},Ie)],l.prototype,"limits",void 0),s([E.Property(!0)],l.prototype,"enabled",void 0),s([E.Complex({},Me)],l.prototype,"tooltip",void 0),s([E.Property(!1)],l.prototype,"showButtons",void 0),s([E.Property(!0)],l.prototype,"enableAnimation",void 0),s([E.Property("Horizontal")],l.prototype,"orientation",void 0),s([E.Property("")],l.prototype,"cssClass",void 0),s([E.Property(!0)],l.prototype,"enableHtmlSanitizer",void 0),s([E.Event()],l.prototype,"created",void 0),s([E.Event()],l.prototype,"change",void 0),s([E.Event()],l.prototype,"changed",void 0),s([E.Event()],l.prototype,"renderingTicks",void 0),s([E.Event()],l.prototype,"renderedTicks",void 0),s([E.Event()],l.prototype,"tooltipChange",void 0),s([E.NotifyPropertyChanges],l));function l(t,e){t=We.call(this,t,e)||this;return t.horDir="left",t.verDir="bottom",t.transition={handle:"left .4s cubic-bezier(.25, .8, .25, 1), right .4s cubic-bezier(.25, .8, .25, 1), top .4s cubic-bezier(.25, .8, .25, 1) , bottom .4s cubic-bezier(.25, .8, .25, 1)",rangeBar:"all .4s cubic-bezier(.25, .8, .25, 1)"},t.transitionOnMaterialTooltip={handle:"left 1ms ease-out, right 1ms ease-out, bottom 1ms ease-out, top 1ms ease-out",rangeBar:"left 1ms ease-out, right 1ms ease-out, bottom 1ms ease-out, width 1ms ease-out, height 1ms ease-out"},t.scaleTransform="transform .4s cubic-bezier(.25, .8, .25, 1)",t.customAriaText=null,t.drag=!0,t.isDragComplete=!1,t.initialTooltip=!0,t}_i=function(t,e){return(_i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var _i,Xi,Ki,t=function(t,e){function i(){this.constructor=t}_i(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},s=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},Yi={EMAIL:new RegExp("^[A-Za-z0-9._%+-]{1,}@[A-Za-z0-9._%+-]{1,}([.]{1}[a-zA-Z0-9]{2,}|[.]{1}[a-zA-Z0-9]{2,4}[.]{1}[a-zA-Z0-9]{2,4})$"),URL:/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/m,DATE_ISO:new RegExp("^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$"),DIGITS:new RegExp("^[0-9]*$"),PHONE:new RegExp("^[+]?[0-9]{9,13}$"),CREDITCARD:new RegExp("^\\d{13,16}$")},Zi=((Zi=o.ErrorOption||(o.ErrorOption={}))[Zi.Message=0]="Message",Zi[Zi.Label=1]="Label",Xi=E.Base,t(r,Xi),(Ki=r).prototype.addRules=function(t,e){t&&(this.rules.hasOwnProperty(t)?E.extend(this.rules[""+t],e,{}):this.rules[""+t]=e)},r.prototype.removeRules=function(t,e){if(t||e){if(this.rules[""+t]&&!e)delete this.rules[""+t];else if(!E.isNullOrUndefined(this.rules[""+t]&&e))for(var i=0;i<e.length;i++)delete this.rules[""+t][e[parseInt(i.toString(),10)]]}else this.rules={}},r.prototype.validate=function(e){var t=Object.keys(this.rules);if(e&&t.length)return this.validateRules(e),-1!==t.indexOf(e)&&0===this.errorRules.filter(function(t){return t.name===e}).length;this.errorRules=[];for(var i=0,s=t;i<s.length;i++){var n=s[i];this.validateRules(n)}return 0===this.errorRules.length},r.prototype.reset=function(){this.element.reset(),this.clearForm()},r.prototype.getInputElement=function(t){return this.inputElement=E.select('[name="'+t+'"]',this.element),this.inputElement},r.prototype.destroy=function(){this.reset(),this.unwireEvents(),this.rules={};for(var t=0,e=E.selectAll("."+this.errorClass+", ."+this.validClass,this.element);t<e.length;t++){var i=e[t];E.detach(i)}Xi.prototype.destroy.call(this),this.infoElement=null,E.onIntlChange.off("notifyExternalChange",this.afterLocalization)},r.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)"locale"===s[i]&&this.localeFunc()},r.prototype.localeFunc=function(){for(var t=0,e=Object.keys(this.defaultMessages);t<e.length;t++){var i=e[t],s=(this.l10n.setLocale(this.locale),this.l10n.getConstant(i));this.localyMessage[""+i]=s}},r.prototype.getModuleName=function(){return"formvalidator"},r.prototype.afterLocalization=function(t){this.locale=t.locale,this.localeFunc()},r.prototype.refresh=function(){this.unwireEvents(),this.inputElements=E.selectAll(this.selectQuery,this.element),this.wireEvents()},r.prototype.clearForm=function(){this.errorRules=[],this.validated=[];for(var t=0,e=E.selectAll(this.selectQuery,this.element);t<e.length;t++){var i=e[t],s=(i.removeAttribute("aria-invalid"),i.parentElement),n=s.parentElement;(s.classList.contains("e-control-wrapper")||s.classList.contains("e-wrapper")||i.classList.contains("e-input")&&s.classList.contains("e-input-group")?s:null!=n&&(n.classList.contains("e-control-wrapper")||n.classList.contains("e-wrapper"))?n:i).classList.remove(this.errorClass),0<i.name.length&&(this.getInputElement(i.name),this.getErrorElement(i.name),this.hideMessage(i.name)),(s.classList.contains("e-control-wrapper")||s.classList.contains("e-wrapper")||i.classList.contains("e-input")&&s.classList.contains("e-input-group")?s:null!=n&&(n.classList.contains("e-control-wrapper")||n.classList.contains("e-wrapper"))?n:i).classList.remove(this.validClass)}},r.prototype.createHTML5Rules=function(){for(var t=["required","validateHidden","regex","rangeLength","maxLength","minLength","dateIso","digits","pattern","data-val-required","type","data-validation","min","max","range","equalTo","data-val-minlength-min","data-val-equalto-other","data-val-maxlength-max","data-val-range-min","data-val-regex-pattern","data-val-length-max","data-val-creditcard","data-val-phone"],e=["hidden","email","url","date","number","tel"],i=0,s=this.inputElements;i<s.length;i++){for(var n=s[i],a={},l=0,r=t;l<r.length;l++){var o=r[l];if(null!==n.getAttribute(o))switch(o){case"required":this.defRule(n,a,o,n.required);break;case"data-validation":o=n.getAttribute(o),this.defRule(n,a,o,!0);break;case"type":-1!==e.indexOf(n.type)&&this.defRule(n,a,n.type,!0);break;case"rangeLength":case"range":this.defRule(n,a,o,JSON.parse(n.getAttribute(o)));break;case"equalTo":var h=n.getAttribute(o);this.defRule(n,a,o,h);break;default:"true"===n.getAttribute("data-val")?this.annotationRule(n,a,o,n.getAttribute(o)):this.defRule(n,a,o,n.getAttribute(o))}}0!==Object.keys(a).length&&this.addRules(n.name,a)}},r.prototype.annotationRule=function(t,e,i,s){var n=i.split("-"),a=["required","creditcard","phone","maxlength","minlength","range","regex","equalto"],l=n[n.length-1],n=n[n.length-2];if(-1!==a.indexOf(l))switch(l){case"required":this.defRule(t,e,"required",s);break;case"creditcard":this.defRule(t,e,"creditcard",s);break;case"phone":this.defRule(t,e,"tel",s)}else if(-1!==a.indexOf(n))switch(n){case"maxlength":this.defRule(t,e,"maxLength",s);break;case"minlength":this.defRule(t,e,"minLength",s);break;case"range":var r=t.getAttribute("data-val-range-min"),o=t.getAttribute("data-val-range-max");this.defRule(t,e,"range",[r,o]);break;case"equalto":r=t.getAttribute(i).split(".");this.defRule(t,e,"equalTo",r[r.length-1]);break;case"regex":this.defRule(t,e,"regex",s)}},r.prototype.defRule=function(t,e,i,s){var n,a=t.getAttribute("data-"+i+"-message"),l=t.getAttribute("data-val-"+i);this.rules[t.name]&&"validateHidden"!==i&&"hidden"!==i&&(this.getInputElement(t.name),n=this.getErrorMessage(this.rules[t.name][""+i],i)),a?s=[s,a]:l?s=[s,l]:n&&(s=[s,n]),e[""+i]=s},r.prototype.wireEvents=function(){for(var t=0,e=this.inputElements;t<e.length;t++){var i=e[t];Ki.isCheckable(i)?E.EventHandler.add(i,"click",this.clickHandler,this):"SELECT"===i.tagName?E.EventHandler.add(i,"change",this.changeHandler,this):(E.EventHandler.add(i,"focusout",this.focusOutHandler,this),E.EventHandler.add(i,"keyup",this.keyUpHandler,this))}E.EventHandler.add(this.element,"submit",this.submitHandler,this),E.EventHandler.add(this.element,"reset",this.resetHandler,this)},r.prototype.unwireEvents=function(){for(var t=0,e=this.inputElements;t<e.length;t++){var i=e[t];E.EventHandler.clearEvents(i)}E.EventHandler.remove(this.element,"submit",this.submitHandler),E.EventHandler.remove(this.element,"reset",this.resetHandler)},r.prototype.focusOutHandler=function(t){this.trigger("focusout",t);t=t.target;this.rules[t.name]&&(this.rules[t.name][this.required]||0<t.value.length?this.validate(t.name):-1===this.validated.indexOf(t.name)&&this.validated.push(t.name))},r.prototype.keyUpHandler=function(t){this.trigger("keyup",t);var e=t.target;(9!==t.which||this.rules[e.name]&&(!this.rules[e.name]||this.rules[e.name][this.required]))&&-1!==this.validated.indexOf(e.name)&&this.rules[e.name]&&-1===[16,17,18,20,35,36,37,38,39,40,45,144,225].indexOf(t.which)&&this.validate(e.name)},r.prototype.clickHandler=function(t){this.trigger("click",t);t=t.target;"submit"!==t.type?this.validate(t.name):null!==t.getAttribute("formnovalidate")&&(this.allowSubmit=!0)},r.prototype.changeHandler=function(t){this.trigger("change",t);t=t.target;this.validate(t.name)},r.prototype.submitHandler=function(t){this.trigger("submit",t),this.allowSubmit||this.validate()?this.allowSubmit=!1:t.preventDefault()},r.prototype.resetHandler=function(){this.clearForm()},r.prototype.validateRules=function(t){if(this.rules[""+t]){var e=Object.keys(this.rules[""+t]),i=!1,s=!1,n=e.indexOf("validateHidden"),a=e.indexOf("hidden");if(this.getInputElement(t),-1!==n&&(s=!0),!(i=-1!==a?!0:i)||s){-1!==n&&e.splice(n,1),-1!==a&&e.splice(a-1,1),this.getErrorElement(t);for(var l=0,r=e;l<r.length;l++){var o=r[l],h=this.getErrorMessage(this.rules[""+t][""+o],o),p={name:t,message:h},h={inputName:t,element:this.inputElement,message:h};if(!this.isValid(t,o)&&!this.inputElement.classList.contains(this.ignore)){this.removeErrorRules(t),this.errorRules.push(p),this.inputElement.setAttribute("aria-invalid","true"),this.inputElement.setAttribute("aria-describedby",this.inputElement.id+"-info");var d=this.inputElement.parentElement,u=d.parentElement;(d.classList.contains("e-control-wrapper")||d.classList.contains("e-wrapper")||this.inputElement.classList.contains("e-input")&&d.classList.contains("e-input-group")?(d.classList.add(this.errorClass),d):null!=u&&(u.classList.contains("e-control-wrapper")||u.classList.contains("e-wrapper"))?(u.classList.add(this.errorClass),u):(this.inputElement.classList.add(this.errorClass),this.inputElement)).classList.remove(this.validClass),this.infoElement?this.showMessage(p):this.createErrorElement(t,p.message,this.inputElement),h.errorElement=this.infoElement,h.status="failure",(d.classList.contains("e-control-wrapper")||d.classList.contains("e-wrapper")||this.inputElement.classList.contains("e-input")&&d.classList.contains("e-input-group")?(d.classList.add(this.errorClass),d):null!=u&&(u.classList.contains("e-control-wrapper")||u.classList.contains("e-wrapper"))?(u.classList.add(this.errorClass),u):(this.inputElement.classList.add(this.errorClass),this.inputElement)).classList.remove(this.validClass),this.optionalValidationStatus(t,h),this.trigger("validationComplete",h),"required"===o&&this.inputElement.setAttribute("aria-required","true");break}this.hideMessage(t),h.status="success",this.trigger("validationComplete",h)}}}},r.prototype.optionalValidationStatus=function(t,e){this.rules[""+t][this.required]||this.inputElement.value.length||E.isNullOrUndefined(this.infoElement)||(this.infoElement.innerHTML=this.inputElement.value,this.infoElement.setAttribute("aria-invalid","false"),e.status="",this.hideMessage(t))},r.prototype.isValid=function(t,e){var i=this.rules[""+t][""+e],i=i instanceof Array&&"string"==typeof i[1]?i[0]:i,s=this.rules[""+t][""+e],n="min"!==e&&"max"!==e||!this.rules[""+t].date||"string"!=typeof this.rules[""+t].date?null:this.rules[""+t].date,i={value:this.inputElement.value,param:i,element:this.inputElement,formElement:this.element,format:n,culture:this.locale};return this.trigger("validationBegin",i),!i.param&&"required"===e||(s&&"function"==typeof s[0]?s[0].call(this,{element:this.inputElement,value:this.inputElement.value}):Ki.isCheckable(this.inputElement)?"required"!==e||0<E.selectAll('input[name="'+t+'"]:checked',this.element).length:Ki.checkValidator[""+e](i))},r.prototype.getErrorMessage=function(t,e){var i=(a=this.inputElement.getAttribute("data-"+e+"-message")?this.inputElement.getAttribute("data-"+e+"-message"):t instanceof Array&&"string"==typeof t[1]?t[1]:(0!==Object.keys(this.localyMessage).length?this.localyMessage:this.defaultMessages)[""+e]).match(/{(\d)}/g);if(!E.isNullOrUndefined(i))for(var s=0;s<i.length;s++)var n=t instanceof Array?t[parseInt(s.toString(),10)]:t,a=a.replace(i[parseInt(s.toString(),10)],n);return a},r.prototype.createErrorElement=function(t,e,i){var s,e=E.createElement(this.errorElement,{className:this.errorClass,innerHTML:e,attrs:{for:t}});this.errorOption===o.ErrorOption.Message&&(e.classList.remove(this.errorClass),e.classList.add("e-message"),e=E.createElement(this.errorContainer,{className:this.errorClass,innerHTML:e.outerHTML})),e.id=this.inputElement.name+"-info",this.element.querySelector('[data-valmsg-for="'+i.id+'"]')?this.element.querySelector('[data-valmsg-for="'+i.id+'"]').appendChild(e):!0===i.hasAttribute("data-msg-containerid")?(i=i.getAttribute("data-msg-containerid"),E.select("#"+i,this.element).appendChild(e)):null!=this.customPlacement?this.customPlacement.call(this,this.inputElement,e):(s=(i=this.inputElement.parentElement).parentElement,i.classList.contains("e-control-wrapper")||i.classList.contains("e-wrapper")?s.insertBefore(e,i.nextSibling):s.classList.contains("e-control-wrapper")||s.classList.contains("e-wrapper")?s.parentElement.insertBefore(e,s.nextSibling):i.insertBefore(e,this.inputElement.nextSibling)),e.style.display="block",this.getErrorElement(t),this.validated.push(t),this.checkRequired(t)},r.prototype.getErrorElement=function(t){return this.infoElement=E.select(this.errorElement+"."+this.errorClass,this.inputElement.parentElement),this.infoElement||(this.infoElement=E.select(this.errorElement+"."+this.errorClass+'[for="'+t+'"]',this.element)),this.infoElement},r.prototype.removeErrorRules=function(t){for(var e=0;e<this.errorRules.length;e++)this.errorRules[parseInt(e.toString(),10)].name===t&&this.errorRules.splice(e,1)},r.prototype.showMessage=function(t){this.infoElement.style.display="block",this.infoElement.innerHTML=t.message,this.checkRequired(t.name)},r.prototype.hideMessage=function(t){var e;this.infoElement&&(this.infoElement.style.display="none",this.removeErrorRules(t),e=(t=this.inputElement.parentElement).parentElement,(t.classList.contains("e-control-wrapper")||t.classList.contains("e-wrapper")||this.inputElement.classList.contains("e-input")&&t.classList.contains("e-input-group")?(t.classList.add(this.validClass),t):null!=e&&(e.classList.contains("e-control-wrapper")||e.classList.contains("e-wrapper"))?(e.classList.add(this.validClass),e):(this.inputElement.classList.add(this.validClass),this.inputElement)).classList.remove(this.errorClass),this.inputElement.setAttribute("aria-invalid","false"))},r.prototype.checkRequired=function(t){this.rules[""+t][this.required]||this.inputElement.value.length||E.isNullOrUndefined(this.infoElement)||(this.infoElement.innerHTML=this.inputElement.value,this.infoElement.setAttribute("aria-invalid","false"),this.hideMessage(t))},r.isCheckable=function(t){t=t.getAttribute("type");return t&&("checkbox"===t||"radio"===t||"submit"===t)},r.checkValidator={required:function(t){return isNaN(Date.parse(t.value))?0<t.value.toString().length:!isNaN(new Date(t.value).getTime())},email:function(t){return Yi.EMAIL.test(t.value)},url:function(t){return Yi.URL.test(t.value)},dateIso:function(t){return Yi.DATE_ISO.test(t.value)},tel:function(t){return Yi.PHONE.test(t.value)},creditcard:function(t){return Yi.CREDITCARD.test(t.value)},number:function(t){return!isNaN(Number(t.value))&&-1===String(t.value).indexOf(" ")},digits:function(t){return Yi.DIGITS.test(t.value)},maxLength:function(t){return t.value.length<=Number(t.param)},minLength:function(t){return t.value.length>=Number(t.param)},rangeLength:function(t){var e=t.param;return t.value.length>=e[0]&&t.value.length<=e[1]},range:function(t){var e=t.param;return!isNaN(Number(t.value))&&Number(t.value)>=e[0]&&Number(t.value)<=e[1]},date:function(t){var e,i;return E.isNullOrUndefined(t.param)||"string"!=typeof t.param||""===t.param?!isNaN(new Date(t.value).getTime()):(i=t.culture&&""!==t.culture?new E.Internationalization(t.culture):new E.Internationalization,e={format:t.param.toString(),type:"dateTime",skeleton:"yMd"},i=i.parseDate(t.value,e),!E.isNullOrUndefined(i)&&i instanceof Date&&!isNaN(+i))},max:function(t){var e,i,s;return isNaN(Number(t.value))?t.format&&""!==t.format?(s=t.culture&&""!==t.culture?new E.Internationalization(t.culture):new E.Internationalization,e={format:t.format.toString(),type:"dateTime",skeleton:"yMd"},i=s.parseDate(t.value,e),s="string"==typeof t.param?s.parseDate(JSON.parse(JSON.stringify(t.param)),e):t.param,new Date(i).getTime()<=new Date(s).getTime()):new Date(t.value).getTime()<=new Date(JSON.parse(JSON.stringify(t.param))).getTime():+t.value<=+t.param},min:function(t){var e,i,s;return isNaN(Number(t.value))?-1!==t.value.indexOf(",")?(s=t.value.replace(/,/g,""),parseFloat(s)>=Number(t.param)):t.format&&""!==t.format?(s=t.culture&&""!==t.culture?new E.Internationalization(t.culture):new E.Internationalization,e={format:t.format.toString(),type:"dateTime",skeleton:"yMd"},i=s.parseDate(t.value,e),s="string"==typeof t.param?s.parseDate(JSON.parse(JSON.stringify(t.param)),e):t.param,new Date(i).getTime()>=new Date(s).getTime()):new Date(t.value).getTime()>=new Date(JSON.parse(JSON.stringify(t.param))).getTime():+t.value>=+t.param},regex:function(t){return new RegExp(t.param).test(t.value)},equalTo:function(t){var e=t.formElement.querySelector("#"+t.param);return t.param=e.value,t.param===t.value}},s([E.Property("")],r.prototype,"locale",void 0),s([E.Property("e-hidden")],r.prototype,"ignore",void 0),s([E.Property()],r.prototype,"rules",void 0),s([E.Property("e-error")],r.prototype,"errorClass",void 0),s([E.Property("e-valid")],r.prototype,"validClass",void 0),s([E.Property("label")],r.prototype,"errorElement",void 0),s([E.Property("div")],r.prototype,"errorContainer",void 0),s([E.Property(o.ErrorOption.Label)],r.prototype,"errorOption",void 0),s([E.Event()],r.prototype,"focusout",void 0),s([E.Event()],r.prototype,"keyup",void 0),s([E.Event()],r.prototype,"click",void 0),s([E.Event()],r.prototype,"change",void 0),s([E.Event()],r.prototype,"submit",void 0),s([E.Event()],r.prototype,"validationBegin",void 0),s([E.Event()],r.prototype,"validationComplete",void 0),s([E.Event()],r.prototype,"customPlacement",void 0),Ki=s([E.NotifyPropertyChanges],r));function r(t,e){e=Xi.call(this,e,t)||this;if(e.validated=[],e.errorRules=[],e.allowSubmit=!1,e.required="required",e.infoElement=null,e.inputElement=null,e.selectQuery="input:not([type=reset]):not([type=button]), select, textarea",e.localyMessage={},e.defaultMessages={required:"This field is required.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateIso:"Please enter a valid date ( ISO ).",creditcard:"Please enter valid card number",number:"Please enter a valid number.",digits:"Please enter only digits.",maxLength:"Please enter no more than {0} characters.",minLength:"Please enter at least {0} characters.",rangeLength:"Please enter a value between {0} and {1} characters long.",range:"Please enter a value between {0} and {1}.",max:"Please enter a value less than or equal to {0}.",min:"Please enter a value greater than or equal to {0}.",regex:"Please enter a correct value.",tel:"Please enter a valid phone number.",pattern:"Please enter a correct pattern value.",equalTo:"Please enter the valid match text"},void 0===e.rules&&(e.rules={}),e.l10n=new E.L10n("formValidator",e.defaultMessages,e.locale),e.locale&&e.localeFunc(),E.onIntlChange.on("notifyExternalChange",e.afterLocalization,e),t="string"==typeof t?E.select(t,document):t,null!=e.element)return e.element.setAttribute("novalidate",""),e.inputElements=E.selectAll(e.selectQuery,e.element),e.createHTML5Rules(),e.wireEvents(),e}Gi=function(t,e){return(Gi=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Gi,Ji,t=function(t,e){function i(){this.constructor=t}Gi(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},s=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},$i="e-file-select",Qi="e-file-drop",ts="e-upload-files",es="e-upload-file-list",c="e-file-status",is="e-file-name",ss="e-file-type",ns="e-file-size",m="e-file-remove-btn",u="e-file-delete-btn",as="e-spinner-pane",f="e-file-abort-btn",ls="e-file-reload-btn",rs="e-upload-drag-hover",os="e-upload-progress-wrap",hs="e-upload-progress-bar",ps="e-progress-bar-text",v="e-upload-progress",ds="e-upload-success",g="e-upload-fails",us="e-file-container",cs="e-validation-fails",ms="e-disabled",fs="e-rtl-container",vs="e-clear-icon-focus",y="e-file-pause-btn",gs="e-file-play-btn",ys="e-restrict-retry",bs=["title","style","class"],Cs="e-form-upload",Es="e-hidden-file-input",xs="e-file-invalid",Ss=(Ji=E.ChildProperty,t(Ts,Ji),s([E.Property("")],Ts.prototype,"name",void 0),s([E.Property(null)],Ts.prototype,"size",void 0),s([E.Property("")],Ts.prototype,"type",void 0),Ts);function Ts(){return null!==Ji&&Ji.apply(this,arguments)||this}Ps=E.ChildProperty,t(ws,Ps),s([E.Property("Browse...")],ws.prototype,"browse",void 0),s([E.Property("Upload")],ws.prototype,"upload",void 0),s([E.Property("Clear")],ws.prototype,"clear",void 0);var Ps,Os=ws;function ws(){return null!==Ps&&Ps.apply(this,arguments)||this}Ls=E.ChildProperty,t(As,Ls),s([E.Property("")],As.prototype,"saveUrl",void 0),s([E.Property("")],As.prototype,"removeUrl",void 0),s([E.Property(0)],As.prototype,"chunkSize",void 0),s([E.Property(3)],As.prototype,"retryCount",void 0),s([E.Property(500)],As.prototype,"retryAfterDelay",void 0);var Ls,ks=As;function As(){return null!==Ls&&Ls.apply(this,arguments)||this}Ns=E.Component,t(C,Ns),C.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"allowedExtensions":this.setExtensions(this.allowedExtensions),this.clearAll();break;case"enabled":this.setControlStatus();break;case"multiple":this.setMultipleSelection();break;case"enableRtl":this.setRTL(),this.reRenderFileList();break;case"buttons":this.buttons.browse=E.isNullOrUndefined(this.buttons.browse)?"":this.buttons.browse,this.buttons.clear=E.isNullOrUndefined(this.buttons.clear)?"":this.buttons.clear,this.buttons.upload=E.isNullOrUndefined(this.buttons.upload)?"":this.buttons.upload,this.renderButtonTemplates();break;case"dropArea":this.unBindDropEvents(),this.updateDropArea();break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.checkHTMLAttributes(!0);break;case"files":this.renderPreLoadFiles();break;case"directoryUpload":this.updateDirectoryAttributes();break;case"template":this.isReact?this.reRenderFileList():this.clearAll();break;case"minFileSize":case"maxFileSize":case"autoUpload":case"sequentialUpload":this.clearAll();break;case"locale":this.l10n.setLocale(this.locale),this.setLocalizedTexts(),this.preLocaleObj=E.getValue("currentLocale",this.l10n);break;case"cssClass":this.setCSSClass(e.cssClass)}},C.prototype.setLocalizedTexts=function(){E.isNullOrUndefined(this.template)&&("string"==typeof this.buttons.browse&&(this.browseButton.innerText="Browse..."===this.buttons.browse?this.localizedTexts("Browse"):this.buttons.browse,this.browseButton.setAttribute("title",this.browseButton.innerText),this.uploadWrapper)&&!E.isNullOrUndefined(this.uploadWrapper.querySelector("."+Qi))&&(this.uploadWrapper.querySelector("."+Qi).innerHTML=this.localizedTexts("dropFilesHint")),this.updateFileList())},C.prototype.getKeyValue=function(t){for(var e,i=0,s=Object.keys(this.preLocaleObj);i<s.length;i++){var n=s[i];this.preLocaleObj[""+n]===t&&(e=n)}return e},C.prototype.updateFileList=function(){if(0<this.fileList.length&&!E.isNullOrUndefined(this.uploadWrapper.querySelector("."+ts)))for(var t=0;t<this.fileList.length;t++)this.fileList[t].querySelector(".e-file-status").innerHTML=this.localizedTexts(this.getKeyValue(this.filesData[t].status)),this.filesData[t].status=this.localizedTexts(this.getKeyValue(this.filesData[t].status)),this.fileList[t].classList.contains(ds)&&this.fileList[t].querySelector(".e-icons").setAttribute("title",this.localizedTexts("delete")),this.fileList[t].querySelector(".e-file-play-btn")&&this.fileList[t].querySelector(".e-icons").setAttribute("title",this.localizedTexts("resume")),this.fileList[t].querySelector(".e-file-remove-btn")&&this.fileList[t].querySelector(".e-icons").setAttribute("title",this.localizedTexts("remove")),this.fileList[t].querySelector(".e-file-reload-btn")&&this.fileList[t].querySelector(".e-icons").setAttribute("title",this.localizedTexts("retry")),this.autoUpload||(this.uploadButton.innerText="Upload"===this.buttons.upload?this.localizedTexts("Upload"):this.buttons.upload,this.uploadButton.setAttribute("title",this.localizedTexts("Upload")),this.clearButton.innerText="Clear"===this.buttons.clear?this.localizedTexts("Clear"):this.buttons.clear,this.clearButton.setAttribute("title",this.localizedTexts("Clear")))},C.prototype.reRenderFileList=function(){this.listParent&&(E.detach(this.listParent),this.listParent=null,this.fileList=[],this.internalCreateFileList(this.filesData),this.actionButtons)&&(this.removeActionButtons(),this.renderActionButtons(),this.checkActionButtonStatus())},C.prototype.preRender=function(){this.localeText={Browse:"Browse...",Clear:"Clear",Upload:"Upload",invalidFileName:"File Name is not allowed",dropFilesHint:"Or drop files here",invalidMaxFileSize:"File size is too large",invalidMinFileSize:"File size is too small",invalidFileType:"File type is not allowed",uploadFailedMessage:"File failed to upload",uploadSuccessMessage:"File uploaded successfully",removedSuccessMessage:"File removed successfully",removedFailedMessage:"Unable to remove file",inProgress:"Uploading",readyToUploadMessage:"Ready to upload",abort:"Abort",remove:"Remove",cancel:"Cancel",delete:"Delete file",pauseUpload:"File upload paused",pause:"Pause",resume:"Resume",retry:"Retry",fileUploadCancel:"File upload canceled",invalidFileSelection:"Invalid files selected",totalFiles:"Total files",size:"Size"},this.l10n=new E.L10n("uploader",this.localeText,this.locale),this.preLocaleObj=E.getValue("currentLocale",this.l10n),this.formRendered(),this.updateHTMLAttrToElement(),this.checkHTMLAttributes(!1);var t=E.getValue("ej2_instances",this.element);if("EJS-UPLOADER"===this.element.tagName){for(var e=this.createElement("input",{attrs:{type:"file"}}),i=0;i<this.element.attributes.length;i++)"id"!==this.element.attributes[i].nodeName?e.setAttribute(this.element.attributes[i].nodeName,this.element.attributes[i].nodeValue):"id"===this.element.attributes[i].nodeName&&e.setAttribute(this.element.attributes[i].nodeName,E.getUniqueID("uploader")),e.innerHTML=this.element.innerHTML;e.hasAttribute("name")||e.setAttribute("name","UploadFiles"),this.element.appendChild(e),this.element=e,E.setValue("ej2_instances",t,this.element)}t[0].isPureReactComponent&&(E.isNullOrUndefined(t[0].props.name)?!E.isNullOrUndefined(t[0].props.id)&&E.isNullOrUndefined(t[0].props.name)?this.element.setAttribute("name",t[0].props.id):this.element.setAttribute("name","UploadFiles"):this.element.setAttribute("name",t[0].props.name)),E.isNullOrUndefined(this.element.getAttribute("name"))&&(E.isNullOrUndefined(this.element.getAttribute("id"))||""===this.element.getAttribute("id")?this.element.setAttribute("name","UploadFiles"):this.element.setAttribute("name",this.element.getAttribute("id"))),this.element.hasAttribute("type")||this.element.setAttribute("type","file"),this.updateDirectoryAttributes(),this.keyConfigs={enter:"enter"},this.element.hasAttribute("tabindex")&&(this.tabIndex=this.element.getAttribute("tabindex")),this.browserName=E.Browser.info.name,this.uploaderName=this.element.getAttribute("name")},C.prototype.formRendered=function(){var t=E.closest(this.element,"form");if(!E.isNullOrUndefined(t))for(;t&&t!==document.documentElement;t=t.parentElement)"FORM"===t.tagName&&(this.isForm=!0,(this.formElement=t).setAttribute("enctype","multipart/form-data"),t.setAttribute("encoding","multipart/form-data"))},C.prototype.getPersistData=function(){return this.addOnPersist(["filesData"])},C.prototype.getModuleName=function(){return"uploader"},C.prototype.updateDirectoryAttributes=function(){this.directoryUpload?(this.element.setAttribute("directory","true"),this.element.setAttribute("webkitdirectory","true")):(this.element.removeAttribute("directory"),this.element.removeAttribute("webkitdirectory"))},C.prototype.render=function(){this.renderBrowseButton(),this.initializeUpload(),this.updateHTMLAttrToWrapper(),this.wireEvents(),this.setMultipleSelection(),this.setExtensions(this.allowedExtensions),this.setRTL(),this.renderPreLoadFiles(),this.setControlStatus(),this.setCSSClass()},C.prototype.renderBrowseButton=function(){this.browseButton=this.createElement("button",{className:"e-css e-btn",attrs:{type:"button"}}),this.browseButton.setAttribute("tabindex",this.tabIndex),"string"==typeof this.buttons.browse?(this.browseButton.textContent="Browse..."===this.buttons.browse?this.localizedTexts("Browse"):this.buttons.browse,this.browseButton.setAttribute("title",this.browseButton.innerText)):this.browseButton.appendChild(this.buttons.browse),this.element.setAttribute("aria-label","Uploader")},C.prototype.renderActionButtons=function(){this.element.setAttribute("tabindex","-1"),this.actionButtons=this.createElement("div",{className:"e-upload-actions"}),this.uploadButton=this.createElement("button",{className:"e-file-upload-btn e-css e-btn e-flat e-primary",attrs:{type:"button",tabindex:this.btnTabIndex,"aria-label":this.localizedTexts("Upload")}}),this.clearButton=this.createElement("button",{className:"e-file-clear-btn e-css e-btn e-flat",attrs:{type:"button",tabindex:this.btnTabIndex,"aria-label":this.localizedTexts("Clear")}}),this.actionButtons.appendChild(this.clearButton),this.actionButtons.appendChild(this.uploadButton),this.renderButtonTemplates(),this.uploadWrapper.appendChild(this.actionButtons),this.browseButton.blur(),this.isPreloadFiles||this.uploadButton.focus(),this.wireActionButtonEvents()},C.prototype.serverActionButtonsEventBind=function(t){t&&!this.isForm&&(this.browseButton.blur(),this.actionButtons=t,this.uploadButton=this.actionButtons.querySelector(".e-file-upload-btn"),this.clearButton=this.actionButtons.querySelector(".e-file-clear-btn"),this.uploadButton.focus(),this.unwireActionButtonEvents(),this.wireActionButtonEvents(),this.checkActionButtonStatus())},C.prototype.wireActionButtonEvents=function(){E.EventHandler.add(this.uploadButton,"click",this.uploadButtonClick,this),E.EventHandler.add(this.clearButton,"click",this.clearButtonClick,this)},C.prototype.unwireActionButtonEvents=function(){E.EventHandler.remove(this.uploadButton,"click",this.uploadButtonClick),E.EventHandler.remove(this.clearButton,"click",this.clearButtonClick)},C.prototype.removeActionButtons=function(){this.actionButtons&&(this.unwireActionButtonEvents(),E.detach(this.actionButtons),this.actionButtons=null)},C.prototype.renderButtonTemplates=function(){var t;"string"==typeof this.buttons.browse?(this.browseButton.textContent="Browse..."===this.buttons.browse?this.localizedTexts("Browse"):this.buttons.browse,this.browseButton.setAttribute("title",this.browseButton.textContent)):(this.browseButton.innerHTML="",this.browseButton.appendChild(this.buttons.browse)),this.uploadButton&&(t=E.isNullOrUndefined(this.buttons.upload)?"Upload":this.buttons.upload,this.buttons.upload=t,"string"==typeof this.buttons.upload?(this.uploadButton.textContent="Upload"===this.buttons.upload?this.localizedTexts("Upload"):this.buttons.upload,this.uploadButton.setAttribute("title",this.uploadButton.textContent)):(this.uploadButton.innerHTML="",this.uploadButton.appendChild(this.buttons.upload))),this.clearButton&&(t=E.isNullOrUndefined(this.buttons.clear)?"Clear":this.buttons.clear,this.buttons.clear=t,"string"==typeof this.buttons.clear?(this.clearButton.textContent="Clear"===this.buttons.clear?this.localizedTexts("Clear"):this.buttons.clear,this.clearButton.setAttribute("title",this.clearButton.textContent)):(this.clearButton.innerHTML="",this.clearButton.appendChild(this.buttons.clear)))},C.prototype.initializeUpload=function(){this.element.setAttribute("tabindex","-1");var t=this.createElement("span",{className:$i});this.element.parentElement.insertBefore(t,this.element),this.dropAreaWrapper=this.createElement("div",{className:"e-file-select-wrap"}),this.element.parentElement.insertBefore(this.dropAreaWrapper,this.element),t.appendChild(this.element),this.dropAreaWrapper.appendChild(this.browseButton),this.dropAreaWrapper.appendChild(t),this.uploadWrapper=this.createElement("div",{className:"e-upload e-control-wrapper"}),this.dropAreaWrapper.parentElement.insertBefore(this.uploadWrapper,this.dropAreaWrapper),this.uploadWrapper.appendChild(this.dropAreaWrapper),this.setDropArea()},C.prototype.renderPreLoadFiles=function(){if(this.files.length)if(this.enablePersistence&&this.filesData.length)this.internalCreateFileList(this.filesData);else if(!E.isNullOrUndefined(this.files[0].size)){this.isPreloadFiles=!0;var t=[].slice.call(this.files),e=[];this.multiple||(this.clearData(),t=[t[0]]);for(var i=0,s=t;i<s.length;i++){var n=s[i],n={name:n.name+"."+n.type.split(".")[n.type.split(".").length-1],rawFile:"",size:n.size,status:this.localizedTexts("uploadSuccessMessage"),type:n.type,validationMessages:{minSize:"",maxSize:""},statusCode:"2"};e.push(n),this.filesData.push(n)}this.internalCreateFileList(e),this.autoUpload||!this.listParent||this.actionButtons||this.isForm&&!this.allowUpload()||!this.showFileList||this.renderActionButtons(),this.checkActionButtonStatus(),this.sequentialUpload&&(this.count=this.filesData.length-1),this.isPreloadFiles=!1}},C.prototype.checkActionButtonStatus=function(){var t;this.actionButtons&&(0<(t=this.uploadWrapper.querySelectorAll("."+cs).length+this.uploadWrapper.querySelectorAll(".e-upload-fails:not(.e-upload-progress)").length+this.uploadWrapper.querySelectorAll("span."+ds).length+this.uploadWrapper.querySelectorAll("span."+v).length)&&t===this.uploadWrapper.querySelectorAll("li").length?this.uploadButton.setAttribute("disabled","disabled"):this.uploadButton.removeAttribute("disabled"))},C.prototype.setDropArea=function(){var t=this.dropAreaWrapper&&this.dropAreaWrapper.querySelector(".e-file-drop");if(this.dropArea){this.dropZoneElement="string"!=typeof this.dropArea?this.dropArea:E.select(this.dropArea,document);for(var e=this.element,i=!1;e.parentNode;)(e=e.parentNode)===this.dropZoneElement&&(i=!0,t?t.innerHTML=this.localizedTexts("dropFilesHint"):this.createDropTextHint());!i&&t&&E.remove(t),e=null}else E.isNullOrUndefined(this.uploaderOptions)||void 0!==this.uploaderOptions.dropArea||(this.createDropTextHint(),this.dropZoneElement=this.uploadWrapper,this.setProperties({dropArea:this.uploadWrapper},!0));this.bindDropEvents()},C.prototype.updateDropArea=function(){var t;this.dropArea?this.setDropArea():(this.dropZoneElement=null,(t=this.dropAreaWrapper.querySelector(".e-file-drop"))&&E.remove(t))},C.prototype.createDropTextHint=function(){var t=this.createElement("span",{className:Qi});t.innerHTML=this.localizedTexts("dropFilesHint"),this.dropAreaWrapper.appendChild(t)},C.prototype.updateHTMLAttrToElement=function(){if(!E.isNullOrUndefined(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var i=e[t];bs.indexOf(i)<0&&this.element.setAttribute(i,this.htmlAttributes[""+i])}},C.prototype.updateHTMLAttrToWrapper=function(){if(!E.isNullOrUndefined(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var i,s=e[t];-1<bs.indexOf(s)&&("class"===s?""!==(i=this.htmlAttributes[""+s].replace(/\s+/g," ").trim())&&E.addClass([this.uploadWrapper],i.split(" ")):"style"===s?(i=this.uploadWrapper.getAttribute(s),i=E.isNullOrUndefined(i)?this.htmlAttributes[""+s]:i+this.htmlAttributes[""+s],this.uploadWrapper.setAttribute(s,i)):this.uploadWrapper.setAttribute(s,this.htmlAttributes[""+s]))}},C.prototype.setMultipleSelection=function(){var t;this.multiple&&!this.element.hasAttribute("multiple")?((t=document.createAttribute("multiple")).value="multiple",this.element.setAttributeNode(t)):this.multiple||this.element.removeAttribute("multiple")},C.prototype.checkAutoUpload=function(t){this.autoUpload?(this.sequentialUpload?this.sequenceUpload(t):this.upload(t),this.removeActionButtons()):this.actionButtons||this.renderActionButtons(),this.checkActionButtonStatus()},C.prototype.sequenceUpload=function(t){var e;this.filesData.length-t.length!=0&&"1"===this.filesData[this.filesData.length-t.length-1].statusCode||((this.multiple||this.count<0)&&++this.count,e=!this.showFileList,"object"==typeof this.filesData[this.count]?(this.isFirstFileOnSelection=!1,this.upload(this.filesData[this.count],e),"0"===this.filesData[this.count].statusCode&&this.multiple&&this.sequenceUpload(t)):--this.count)},C.prototype.setCSSClass=function(t){var e=t,t=(E.isNullOrUndefined(t)||(e=t.replace(/\s+/g," ").trim()),E.isNullOrUndefined(t)||""===e||E.removeClass([this.uploadWrapper],e.split(" ")),this.cssClass);E.isNullOrUndefined(this.cssClass)||""===this.cssClass||(t=this.cssClass.replace(/\s+/g," ").trim()),E.isNullOrUndefined(this.cssClass)||""===t||E.addClass([this.uploadWrapper],t.split(-1<t.indexOf(",")?",":" "))},C.prototype.wireEvents=function(){E.EventHandler.add(this.browseButton,"click",this.browseButtonClick,this),E.EventHandler.add(this.element,"change",this.onSelectFiles,this),this.documentClickHandler=this.removeFocus.bind(this),E.EventHandler.add(document,"click",this.documentClickHandler),this.keyboardModule=new E.KeyboardEvents(this.uploadWrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.isForm&&E.EventHandler.add(this.formElement,"reset",this.resetForm,this)},C.prototype.unWireEvents=function(){E.EventHandler.remove(this.browseButton,"click",this.browseButtonClick),E.EventHandler.remove(this.element,"change",this.onSelectFiles),this.documentClickHandler&&(E.EventHandler.remove(document,"click",this.documentClickHandler),this.documentClickHandler=null),this.isForm&&E.EventHandler.remove(this.formElement,"reset",this.resetForm),this.keyboardModule&&this.keyboardModule.destroy()},C.prototype.resetForm=function(){this.clearAll()},C.prototype.keyActionHandler=function(t){var e,i,s=t.target;"enter"===t.action&&(t.target===this.clearButton?this.clearButtonClick():t.target===this.uploadButton?this.uploadButtonClick():t.target===this.browseButton?this.browseButtonClick():s.classList.contains(y)?((e=this.getCurrentMetaData(null,t)).file.statusCode="4",e.file.status=this.localizedTexts("pauseUpload"),this.abortUpload(e,!1)):s.classList.contains(gs)?this.resumeUpload(this.getCurrentMetaData(null,t),t):s.classList.contains(ls)?(e=this.getCurrentMetaData(null,t),E.isNullOrUndefined(e)?(i=t.target.parentElement,i=this.filesData[this.fileList.indexOf(i)],this.retry(i)):(e.file.statusCode="1",e.file.status=this.localizedTexts("readyToUploadMessage"),this.chunkUpload(e.file))):(this.removeFiles(t),s.classList.contains(f)||this.browseButton.focus()),t.preventDefault(),t.stopPropagation())},C.prototype.getCurrentMetaData=function(t,e){var i,s;s=E.isNullOrUndefined(t)?(e=e.target.parentElement,this.filesData[this.fileList.indexOf(e)]):t;for(var n=0;n<this.uploadMetaData.length;n++)this.uploadMetaData[n].file.name===s.name&&(i=this.uploadMetaData[n]);return i},C.prototype.removeFocus=function(){this.uploadWrapper&&this.listParent&&this.listParent.querySelector("."+vs)&&(document.activeElement.blur(),this.listParent.querySelector("."+vs).classList.remove(vs))},C.prototype.browseButtonClick=function(){this.element.click()},C.prototype.uploadButtonClick=function(){this.sequentialUpload?this.sequenceUpload(this.filesData):this.upload(this.filesData)},C.prototype.clearButtonClick=function(){this.clearAll(),this.sequentialUpload&&(this.count=-1),this.actionCompleteCount=0},C.prototype.bindDropEvents=function(){this.dropZoneElement&&(E.EventHandler.add(this.dropZoneElement,"drop",this.dropElement,this),E.EventHandler.add(this.dropZoneElement,"dragover",this.dragHover,this),E.EventHandler.add(this.dropZoneElement,"dragleave",this.onDragLeave,this),E.EventHandler.add(this.dropZoneElement,"paste",this.onPasteFile,this),E.EventHandler.add(this.dropZoneElement,"dragenter",this.onDragEnter,this))},C.prototype.unBindDropEvents=function(){this.dropZoneElement&&(E.EventHandler.remove(this.dropZoneElement,"drop",this.dropElement),E.EventHandler.remove(this.dropZoneElement,"dragover",this.dragHover),E.EventHandler.remove(this.dropZoneElement,"dragleave",this.onDragLeave),E.EventHandler.remove(this.dropZoneElement,"paste",this.onPasteFile),E.EventHandler.remove(this.dropZoneElement,"dragenter",this.onDragEnter))},C.prototype.onDragEnter=function(t){this.enabled&&(this.dropZoneElement.classList.add(rs),this.dragCounter=this.dragCounter+1,t.preventDefault(),t.stopPropagation())},C.prototype.onDragLeave=function(){this.enabled&&(this.dragCounter=this.dragCounter-1,this.dragCounter||this.dropZoneElement.classList.remove(rs))},C.prototype.dragHover=function(t){this.enabled&&("Default"!==this.dropEffect&&(t.dataTransfer.dropEffect=this.dropEffect.toLowerCase()),t.preventDefault(),t.stopPropagation())},C.prototype.dropElement=function(t){this.dragCounter=0,this.dropZoneElement.classList.remove(rs),this.onSelectFiles(t),t.preventDefault(),t.stopPropagation()},C.prototype.onPasteFile=function(t){var e=t.clipboardData.items;if("paste"===t.type&&"msie"!==this.browserName&&"edge"!==this.browserName&&"safari"!==this.browserName&&(this.element.files=t.clipboardData.files),1===e.length||this.multiple)for(var i=0;i<e.length;i++){var s=[].slice.call(e)[i];E.isNullOrUndefined(s.getAsFile())||"file"!==s.kind&&!s.type.match("^image/")||this.renderSelectedFiles(t,[s.getAsFile()],!1,!0)}},C.prototype.getSelectedFiles=function(t){for(var e=[],i=this.fileList[t],s=this.getFilesData(),n=+i.getAttribute("data-files-count"),a=0,l=0;l<t;l++)a+=+this.fileList[l].getAttribute("data-files-count");for(var r=a;r<a+n;r++)e.push(s[r]);return i=null,e},C.prototype.removeFiles=function(t){var e,i,s,n;this.enabled&&(e=t.target.parentElement,s=this.fileList.indexOf(e),i=this.fileList[s],s=(n=this.isFormUpload())?this.getSelectedFiles(s):this.getFilesInArray(this.filesData[s]),E.isNullOrUndefined(s)||(t.target.classList.contains(f)&&!n?(s[0].statusCode="5",E.isNullOrUndefined(i)||(n=i.querySelector("."+f),h.createSpinner({target:n,width:"20px"}),h.showSpinner(n)),this.sequentialUpload&&this.uploadSequential(),i.classList.contains(ys)||this.checkActionComplete(!0)):E.closest(t.target,"."+as)||this.remove(s,!1,!1,!0,t),this.isForm&&i&&i.classList.contains(xs)&&(this.element.value=""),this.checkActionButtonStatus(),this.actionButtons&&this.clearButton&&this.uploadWrapper&&1===(n=this.uploadWrapper.querySelectorAll(".e-upload-progress-bar.e-upload-progress:not(.e-upload-success):not(.e-upload-fails)")).length&&e.contains(n[0])&&this.clearButton.hasAttribute("disabled")&&this.clearButton.removeAttribute("disabled"),i=null))},C.prototype.removeFilesData=function(t,e){var i;e?this.showFileList||(i=this.filesData.indexOf(t),this.filesData.splice(i,1)):(e=this.getLiElement(t),E.isNullOrUndefined(e)||(this.element.value="",(t=e.querySelector(".e-icons"))&&E.EventHandler.remove(t,"click",this.removeFiles),E.detach(e),i=this.fileList.indexOf(e),this.fileList.splice(i,1),this.filesData.splice(i,1),0!==this.fileList.length||E.isNullOrUndefined(this.listParent)||(E.detach(this.listParent),this.listParent=null,this.removeActionButtons()),this.sequentialUpload&&i<=this.count&&--this.count))},C.prototype.removeUploadedFile=function(i,t,s,e){var n=this,a=i,l=new E.Ajax(this.asyncSettings.removeUrl,"POST",!0,null),r=(l.emitError=!1,new FormData);l.beforeSend=function(e){t.currentRequest=l.httpRequest,s?n.removingEventCallback(t,r,a,i):n.trigger("removing",t,function(t){t.cancel?e.cancel=!0:n.removingEventCallback(t,r,a,i)})},l.onLoad=function(t){return n.removeCompleted(t,a,e),{}},l.onError=function(t){return n.removeFailed(t,a,e),{}},l.send(r)},C.prototype.removingEventCallback=function(t,e,i,s){var n=this.element.getAttribute("name"),s=this.getLiElement(s);E.isNullOrUndefined(s)||E.isNullOrUndefined(s.querySelector("."+u))&&E.isNullOrUndefined(s.querySelector("."+m))||(s=s.querySelector("."+u)?s.querySelector("."+u):s.querySelector("."+m),h.createSpinner({target:s,width:"20px"}),h.showSpinner(s)),t.postRawFile&&!E.isNullOrUndefined(i.rawFile)&&""!==i.rawFile?e.append(n,i.rawFile,i.name):e.append(n,i.name),this.updateFormData(e,t.customFormData)},C.prototype.updateFormData=function(i,s){if(0<s.length&&s[0])for(var t=0;t<s.length;t++)!function(t){var e=s[t],t=Object.keys(e).map(function(t){return e[""+t]});i.append(Object.keys(e)[0],t)}(t)},C.prototype.updateCustomheader=function(i,s){if(0<s.length&&s[0])for(var t=0;t<s.length;t++)!function(t){var e=s[t],t=Object.keys(e).map(function(t){return e[""+t]});i.setRequestHeader(Object.keys(e)[0],t)}(t)},C.prototype.removeCompleted=function(t,e,i){var s=t&&t.currentTarget?this.getResponse(t):null,n=t.target;4===n.readyState&&200<=n.status&&n.status<=299?(n={e:t,response:s,operation:"remove",file:this.updateStatus(e,this.localizedTexts("removedSuccessMessage"),"2")},this.trigger("success",n),this.removeFilesData(e,i),s=this.uploadedFilesData.indexOf(e),this.uploadedFilesData.splice(s,1),this.trigger("change",{files:this.uploadedFilesData})):this.removeFailed(t,e,i)},C.prototype.removeFailed=function(t,e,i){var t={e:t,response:t&&t.currentTarget?this.getResponse(t):null,operation:"remove",file:this.updateStatus(e,this.localizedTexts("removedFailedMessage"),"0")},s=(i||(i=this.filesData.indexOf(e),(i=this.fileList[i])&&(i.classList.remove(ds),i.classList.add(g),s=i.querySelector("."+c))&&(s.classList.remove(ds),s.classList.add(g)),i=null,this.checkActionButtonStatus()),this.trigger("failure",t),this.getLiElement(e));E.isNullOrUndefined(s)||E.isNullOrUndefined(s.querySelector("."+u))||(i=s.querySelector("."+u),h.hideSpinner(i),E.detach(s.querySelector(".e-spinner-pane")))},C.prototype.getFilesFromFolder=function(e){this.filesEntries=[];var n=this.multiple?e.dataTransfer.items:[e.dataTransfer.items[0]];if(this.checkDirectoryUpload(n))for(var a=this,t=0;t<n.length;t++)!function(t){var i,s=n[t].webkitGetAsEntry();s.isFile?(i=[],s.file(function(t){var e=s.fullPath;i.push({path:e,file:t})}),a.renderSelectedFiles(e,i,!0)):s.isDirectory&&a.traverseFileTree(s,e)}(t)},C.prototype.checkDirectoryUpload=function(t){for(var e=0;t&&e<t.length;e++)if(t[e].webkitGetAsEntry().isDirectory)return!0;return!1},C.prototype.traverseFileTree=function(t,e){t.isFile?this.filesEntries.push(t):t.isDirectory&&(t=t.createReader(),this.readFileFromDirectory(t,e))},C.prototype.readFileFromDirectory=function(i,s){var n=this;i.readEntries(function(t){for(var e=0;e<t.length;e++)n.traverseFileTree(t[e],s);n.pushFilesEntries(s),t.length&&n.readFileFromDirectory(i)})},C.prototype.pushFilesEntries=function(s){for(var n=this,a=[],t=this,e=0;e<this.filesEntries.length;e++)!function(i){t.filesEntries[i].file(function(t){var e;n.filesEntries.length&&(e=n.filesEntries[i].fullPath,a.push({path:e,file:t}),i===n.filesEntries.length-1)&&(n.filesEntries=[],n.renderSelectedFiles(s,a,!0))})}(e)},C.prototype.onSelectFiles=function(t){var e,i;this.enabled&&("drop"===t.type?this.directoryUpload?this.getFilesFromFolder(t):(i=this.sortFilesList=t.dataTransfer.files,"msie"!==this.browserName&&"edge"!==this.browserName&&"safari"!==this.browserName&&(this.element.files=i),0<i.length&&(e=this.multiple?this.sortFileList(i):[i[0]],this.renderSelectedFiles(t,e))):(e=[].slice.call(t.target.files),this.renderSelectedFiles(t,e)),this.isAngular||this.isReact)&&t.stopPropagation()},C.prototype.getBase64=function(s){return new Promise(function(t,e){var i=new FileReader;i.readAsDataURL(s),i.onload=function(){return t(i.result)},i.onerror=function(t){return e(t)}})},C.prototype.renderSelectedFiles=function(t,e,i,s){var n=this,a={event:t,cancel:!(this.base64String=[]),filesData:[],isModified:!1,modifiedFilesData:[],progressInterval:"",isCanceled:!1,currentRequest:null,customFormData:null};if(e.length<1)a.isCanceled=!0,this.trigger("selected",a);else{this.flag=!0;var l=[];this.multiple||(this.clearData(!0),e=[e[this.actionCompleteCount=0]]);for(var r=0;r<e.length;r++){var o=i?e[r].file:e[r];this.updateInitialFileDetails(t,e,o,r,l,i,s)}if(a.filesData=l,!E.isNullOrUndefined(this.allowedExtensions)&&-1<this.allowedExtensions.indexOf("*")&&(this.allTypes=!0),this.enableHtmlSanitizer)for(r=0;r<l.length;r++){for(var h=E.SanitizeHtmlHelper.beforeSanitize(),h=E.SanitizeHtmlHelper.serializeValue(h,l[parseInt(r.toString(),10)].name),p=l[parseInt(r.toString(),10)].name,d=!1,u=0;u<p.length;u++)if(127<p.charCodeAt(u)){d=!0;break}var c=/<([a-z][a-z0-9]*)\b[^>]*>(.*?)<\/\1>/i.test(p);h===l[parseInt(r.toString(),10)].name||d&&!c||(h=e[parseInt(r.toString(),10)].name.replace(/[\u00A0-\u9999<>\\&]/g,function(t){return"&#"+t.charCodeAt(0)+";"}),l[parseInt(r.toString(),10)].name=h,l[parseInt(r.toString(),10)].status=this.localizedTexts("invalidFileName"),l[parseInt(r.toString(),10)].statusCode="0")}this.allTypes||(l=this.checkExtension(l)),this.trigger("selected",a,function(t){n._internalRenderSelect(t,l)})}},C.prototype.updateInitialFileDetails=function(t,e,i,s,n,a,l){a={name:a?e[s].path.substring(1,e[s].path.length):l?E.getUniqueID(i.name.substring(0,i.name.lastIndexOf(".")))+"."+this.getFileType(i.name):this.directoryUpload?e[s].webkitRelativePath:i.name,rawFile:i,size:i.size,status:this.localizedTexts("readyToUploadMessage"),type:this.getFileType(i.name),validationMessages:this.validatedFileSize(i.size),statusCode:"1",id:E.getUniqueID(i.name.substring(0,i.name.lastIndexOf(".")))+"."+this.getFileType(i.name)};l&&(a.fileSource="paste"),a.status=""!==a.validationMessages.minSize?this.localizedTexts("invalidMinFileSize"):""!==a.validationMessages.maxSize?this.localizedTexts("invalidMaxFileSize"):a.status,""===a.validationMessages.minSize&&""===a.validationMessages.maxSize||(a.statusCode="0",this.checkActionComplete(!0)),n.push(a)},C.prototype._internalRenderSelect=function(t,e){if(!t.cancel){if(this.selectedFiles=this.selectedFiles.concat(e),this.btnTabIndex=this.disableKeyboardNavigation?"-1":"0",this.showFileList){if(t.isModified&&0<t.modifiedFilesData.length){for(var i=0;i<t.modifiedFilesData.length;i++)for(var s=0;s<e.length;s++)t.modifiedFilesData[i].id===e[s].id&&(t.modifiedFilesData[i].rawFile=e[s].rawFile);var n=this.allTypes?t.modifiedFilesData:this.checkExtension(t.modifiedFilesData);this.updateSortedFileList(n),this.filesData=this.filesData.concat(n),this.isForm&&!this.allowUpload()||this.checkAutoUpload(n)}else{if(this.internalCreateFileList(e),this.autoUpload&&this.sequenceUpload&&this.sequentialUpload&&0<this.filesData.length&&"2"!==this.filesData[this.filesData.length-1].statusCode&&"0"!==this.filesData[this.filesData.length-1].statusCode)return void(this.filesData=this.filesData.concat(e));this.filesData=this.filesData.concat(e),this.isForm&&!this.allowUpload()||this.checkAutoUpload(e)}E.isNullOrUndefined(t.progressInterval)||""===t.progressInterval||(this.progressInterval=t.progressInterval)}else this.filesData=this.filesData.concat(e),this.autoUpload&&this.upload(this.filesData,!0);this.raiseActionComplete(),this.isFirstFileOnSelection=!0}},C.prototype.allowUpload=function(){var t=!1;return t=this.isForm&&!E.isNullOrUndefined(this.asyncSettings.saveUrl)&&""!==this.asyncSettings.saveUrl?!0:t},C.prototype.isFormUpload=function(){var t=!1;return t=!this.isForm||!E.isNullOrUndefined(this.asyncSettings.saveUrl)&&""!==this.asyncSettings.saveUrl||!E.isNullOrUndefined(this.asyncSettings.removeUrl)&&""!==this.asyncSettings.removeUrl?t:!0},C.prototype.clearData=function(t){if(!E.isNullOrUndefined(this.listParent)){for(var e=this.listParent.querySelectorAll(".e-icons"),i=0;i<e.length;i++)E.EventHandler.remove(e[i],"click",this.removeFiles);E.detach(this.listParent),this.listParent=null}"msie"===this.browserName||t||(this.element.value=""),this.isFormUpload()&&this.uploadWrapper.querySelector("."+$i)&&((t=this.uploadWrapper.querySelector("."+$i).querySelector("."+Es))&&this.uploadWrapper.querySelector("."+$i).removeChild(t),t=null),this.fileList.length=0,this.filesData.length=0,this.removeActionButtons()},C.prototype.updateSortedFileList=function(t){var e=this.createElement("div",{id:"clonewrapper"}),i=-1;if(this.listParent){for(var s=0;s<this.listParent.querySelectorAll("li").length;s++){var n=this.listParent.querySelectorAll("li")[s];e.appendChild(n.cloneNode(!0)),n=null}this.removeActionButtons();var a=[].slice.call(e.childNodes);this.createParentUL();for(var l=0;l<t.length;l++){for(var r=0;r<this.filesData.length;r++)this.filesData[r].name===t[l].name&&(this.listParent.appendChild(a[r]),E.EventHandler.add(a[r].querySelector(".e-icons"),"click",this.removeFiles,this),this.fileList.push(a[r]),i=l);i!==l&&this.internalCreateFileList([t[l]])}e.innerHTML="",a.length=0}else this.internalCreateFileList(t)},C.prototype.isBlank=function(t){return!t||/^\s*$/.test(t)},C.prototype.checkGenericExtension=function(t,e){var i=[];switch(t.toLowerCase()){case"image/*":i.push("jpg","jpeg","png","gif","bmp","tiff","svg","webp","heic");break;case"audio/*":i.push("mp3","wav","aac","flac","ogg","m4a");break;case"video/*":i.push("mp4","mov","avi","mkv","flv","wmv","webm","mpeg");break;case"application/*":i.push("doc","docx","xls","xlsx","ppt","pptx","zip","rar","7z","tar","pdf");break;case"text/*":i.push("txt","csv","html","css","js","json","xml","md")}return i.includes(e.toLowerCase())},C.prototype.checkExtension=function(t){var e=t;if(!this.isBlank(this.allowedExtensions)){for(var i=[],s=0,n=E.isNullOrUndefined(i)?[""]:this.allowedExtensions.split(",");s<n.length;s++){var a=n[s];i.push(a.trim().toLocaleLowerCase())}for(var l=0;l<t.length;l++){var r=-1!==t[l].type.indexOf(".")?t[l].type.replace(".",""):t[l].type;-1!==i[0].indexOf("/*")?this.checkGenericExtension(i[0],r)||(t[l].status=this.localizedTexts("invalidFileType"),t[l].statusCode="0"):-1===i.indexOf(("."+r).toLocaleLowerCase())&&(t[l].status=this.localizedTexts("invalidFileType"),t[l].statusCode="0")}}return e},C.prototype.validatedFileSize=function(t){var e="",i="";return t<this.minFileSize?e=this.localizedTexts("invalidMinFileSize"):i=t>this.maxFileSize?this.localizedTexts("invalidMaxFileSize"):e="",{minSize:e,maxSize:i}},C.prototype.isPreLoadFile=function(t){for(var e=!1,i=0;i<this.files.length;i++)this.files[i].name===t.name.slice(0,t.name.lastIndexOf("."))&&this.files[i].type===t.type&&(e=!0);return e},C.prototype.createCustomfileList=function(t){this.createParentUL();for(var e=0,i=t;e<i.length;e++){var s=i[e],n=this.createElement("li",{className:es,attrs:{"data-file-name":s.name}}),a=(this.uploadTemplateFn=this.templateComplier(this.template),this.uploadTemplateFn(s,this,"template",this.element.id+"Template",this.isStringTemplate,null,n)),a=(a&&(a=[].slice.call(a),E.append(a,n)),t.indexOf(s)),l={element:n,fileInfo:s,index:a,isPreload:this.isPreLoadFile(s)},a={element:n,fileInfo:s,index:a,isPreload:this.isPreLoadFile(s)};this.trigger("rendering",l),this.trigger("fileListRendering",a),this.listParent.appendChild(n),this.fileList.push(n),0}this.renderReactTemplates()},C.prototype.createParentUL=function(){E.isNullOrUndefined(this.listParent)&&(this.listParent=this.createElement("ul",{className:ts}),this.uploadWrapper.appendChild(this.listParent))},C.prototype.formFileList=function(t,e){for(var i,s=this.createElement("li",{className:es}),n=(s.setAttribute("data-files-count",t.length+""),this.createElement("span",{className:us})),a=0,l=t;a<l.length;a++){var r=l[a],o=this.createElement("span",{className:is}),h=(o.innerHTML=this.getFileNameOnly(r.name),this.createElement("span",{className:ss})),p=this.getFileType(r.name);h.innerHTML="."+p,p||h.classList.add("e-hidden"),this.enableRtl?((p=this.createElement("span",{className:fs})).appendChild(h),p.appendChild(o),n.appendChild(p)):(n.appendChild(o),n.appendChild(h)),this.truncateName(o),i=this.formValidateFileInfo(r,s)}s.appendChild(n),this.setListToFileInfo(t,s);var d=this.listParent.querySelectorAll("li").length,u=this.createElement("span"),u=(s.classList.contains(xs)?(u.classList.add(c),u.classList.add(xs),u.innerText=1<t.length?this.localizedTexts("invalidFileSelection"):i):(u.classList.add(1<t.length?"e-file-information":ns),u.innerText=1<t.length?this.localizedTexts("totalFiles")+": "+t.length+" , "+this.localizedTexts("size")+": "+this.bytesToSize(this.getFileSize(t)):this.bytesToSize(t[0].size),this.createFormInput(t)),n.appendChild(u),E.isNullOrUndefined(s.querySelector(".e-icons"))&&(u=this.createElement("span",{className:"e-icons",attrs:{tabindex:this.btnTabIndex}}),"msie"===this.browserName&&u.classList.add("e-msie"),u.setAttribute("title",this.localizedTexts("remove")),s.appendChild(n),s.appendChild(u),E.EventHandler.add(u,"click",this.removeFiles,this),u.classList.add(m)),{element:s,fileInfo:this.mergeFileInfo(t,s),index:d,isPreload:this.isPreLoadFile(this.mergeFileInfo(t,s))}),d={element:s,fileInfo:this.mergeFileInfo(t,s),index:d,isPreload:this.isPreLoadFile(this.mergeFileInfo(t,s))};this.trigger("rendering",u),this.trigger("fileListRendering",d),this.listParent.appendChild(s),this.fileList.push(s)},C.prototype.formValidateFileInfo=function(t,e){var i=t.status,s=this.validatedFileSize(t.size),s=(""===s.minSize&&""===s.maxSize||(this.addInvalidClass(e),i=""!==s.minSize?this.localizedTexts("invalidMinFileSize"):""!==s.maxSize?this.localizedTexts("invalidMaxFileSize"):i),this.checkExtension(this.getFilesInArray(t))[0].status);return s===this.localizedTexts("invalidFileType")&&(this.addInvalidClass(e),i=s),i},C.prototype.addInvalidClass=function(t){t.classList.add(xs)},C.prototype.createFormInput=function(t){if("safari"!==this.browserName){var e=this.element.cloneNode(!0);e.classList.add(Es);for(var i=0,s=t;i<s.length;i++)s[i].input=e;e.setAttribute("id",E.getUniqueID("hiddenUploader")),e.setAttribute("name",this.uploaderName),this.uploadWrapper.querySelector("."+$i).appendChild(e),"msie"!==this.browserName&&"edge"!==this.browserName&&(this.element.value="")}},C.prototype.getFileSize=function(t){for(var e=0,i=0,s=t;i<s.length;i++)e+=s[i].size;return e},C.prototype.mergeFileInfo=function(t,e){for(var i={name:"",rawFile:"",size:0,status:"",type:"",validationMessages:{minSize:"",maxSize:""},statusCode:"1",list:e},s=[],n="",a=0,l=t;a<l.length;a++){var r=l[a];s.push(r.name),n=r.type}return i.name=s.join(", "),i.size=this.getFileSize(t),i.type=n,i.status=this.statusForFormUpload(t,e),i},C.prototype.statusForFormUpload=function(t,e){for(var i=!0,s=0,n=t;s<n.length;s++){var a=n[s],l=a.status,r=this.validatedFileSize(a.size),r=(""===r.minSize&&""===r.maxSize||(i=!1,l=""!==r.minSize?this.localizedTexts("invalidMinFileSize"):""!==r.maxSize?this.localizedTexts("invalidMaxFileSize"):l),this.checkExtension(this.getFilesInArray(a))[0].status);r===this.localizedTexts("invalidFileType")&&(i=!1,l=r)}return l=i?this.localizedTexts("totalFiles")+": "+t.length+" , "+this.localizedTexts("size")+": "+this.bytesToSize(this.getFileSize(t)):(e.classList.add(xs),1<t.length?this.localizedTexts("invalidFileSelection"):l)},C.prototype.formCustomFileList=function(t,e){this.createParentUL();var i=this.createElement("li",{className:es}),s=(i.setAttribute("data-files-count",t.length+""),this.setListToFileInfo(t,i),this.mergeFileInfo(t,i)),n=(i.setAttribute("data-file-name",s.name),this.uploadTemplateFn=this.templateComplier(this.template),this.uploadTemplateFn(s,this,"template",this.element.id+"Template",this.isStringTemplate,null,i)),n=(n&&(n=[].slice.call(n),E.append(n,i)),this.listParent.querySelectorAll("li").length),t=(i.classList.contains(xs)||this.createFormInput(t),{element:i,fileInfo:s,index:n,isPreload:this.isPreLoadFile(s)}),n={element:i,fileInfo:s,index:n,isPreload:this.isPreLoadFile(s)};this.trigger("rendering",t),this.trigger("fileListRendering",n),this.listParent.appendChild(i),this.fileList.push(i),this.renderReactTemplates()},C.prototype.createFileList=function(t){this.filesData=this.filesData&&0<this.filesData.length?this.filesData.concat(t):t,this.internalCreateFileList(t)},C.prototype.internalCreateFileList=function(t){if(this.createParentUL(),""===this.template||E.isNullOrUndefined(this.template))if(this.isFormUpload())this.uploadWrapper.classList.add(Cs),this.formFileList(t,this.element.files);else for(var e=0,i=t;e<i.length;e++){var s=i[e],n=this.createElement("li",{className:es,attrs:{"data-file-name":s.name,"data-files-count":"1"}}),a=this.createElement("span",{className:us}),l=this.createElement("span",{className:is,attrs:{title:s.name}}),r=(l.innerHTML=this.getFileNameOnly(s.name),this.createElement("span",{className:ss})),o=this.getFileType(s.name),o=(r.innerHTML="."+o,o||r.classList.add("e-hidden"),this.enableRtl?((o=this.createElement("span",{className:fs})).appendChild(r),o.appendChild(l),a.appendChild(o)):(a.appendChild(l),a.appendChild(r)),this.createElement("span",{className:ns})),r=(o.innerHTML=this.bytesToSize(s.size),a.appendChild(o),this.createElement("span",{className:c})),o=(a.appendChild(r),r.innerHTML=s.status,n.appendChild(a),this.createElement("span",{className:" e-icons",attrs:{tabindex:this.btnTabIndex}})),a=("msie"===this.browserName&&o.classList.add("e-msie"),o.setAttribute("title",this.localizedTexts("remove")),n.appendChild(o),E.EventHandler.add(o,"click",this.removeFiles,this),"2"===s.statusCode?(r.classList.add(ds),o.classList.add(u),o.setAttribute("title",this.localizedTexts("delete")),o.setAttribute("aria-label",this.localizedTexts("delete"))):"1"!==s.statusCode&&(r.classList.remove(ds),r.classList.add(cs)),this.autoUpload&&"1"===s.statusCode&&""!==this.asyncSettings.saveUrl&&(r.innerHTML=""),o.classList.contains(u)||(o.classList.add(m),o.setAttribute("aria-label",this.localizedTexts("remove"))),t.indexOf(s)),r={element:n,fileInfo:s,index:a,isPreload:this.isPreLoadFile(s)},o={element:n,fileInfo:s,index:a,isPreload:this.isPreLoadFile(s)},a=(this.trigger("rendering",r),this.trigger("fileListRendering",o),this.listParent.appendChild(n),this.fileList.push(n),this.truncateName(l),this.flag);this.isPreLoadFile(s)&&(this.flag=!1,this.checkActionComplete(!0),this.flag=a),n=null}else this.isFormUpload()?(this.uploadWrapper.classList.add(Cs),this.formCustomFileList(t,this.element.files)):this.createCustomfileList(t)},C.prototype.getSlicedName=function(t){var e=t.textContent;t.dataset.tail=e.slice(e.length-10)},C.prototype.setListToFileInfo=function(t,e){for(var i=0,s=t;i<s.length;i++)s[i].list=e},C.prototype.truncateName=function(t){("edge"!==this.browserName&&t.offsetWidth<t.scrollWidth||t.offsetWidth+1<t.scrollWidth)&&this.getSlicedName(t)},C.prototype.getFileType=function(t){var e,i=t.lastIndexOf(".");return(e=0<=i?t.substring(i+1):e)||""},C.prototype.getFileNameOnly=function(t){var e=this.getFileType(t);return t.split("."+e)[0]},C.prototype.setInitialAttributes=function(){var t;this.initialAttr.accept&&this.element.setAttribute("accept",this.initialAttr.accept),this.initialAttr.disabled&&this.element.setAttribute("disabled","disabled"),this.initialAttr.multiple&&(t=document.createAttribute("multiple"),this.element.setAttributeNode(t))},C.prototype.filterfileList=function(t){for(var e,i=[],s=0;s<t.length;s++)e=this.getLiElement(t[s]),(E.isNullOrUndefined(e)||e.classList.contains(ds))&&(this.showFileList||"File uploaded successfully"===t[s].status)||i.push(t[s]);return e=null,i},C.prototype.updateStatus=function(t,e,i,s){return void 0===s&&(s=!0),""===e||E.isNullOrUndefined(e)||""===i||E.isNullOrUndefined(i)||(t.status=e,t.statusCode=i),s&&(i=this.getLiElement(t),E.isNullOrUndefined(i)||E.isNullOrUndefined(i.querySelector("."+c))||""===e||E.isNullOrUndefined(e)||(i.querySelector("."+c).textContent=e),i=null),t},C.prototype.getLiElement=function(t){for(var e,i=0;i<this.filesData.length;i++)E.isNullOrUndefined(t)||(E.isNullOrUndefined(this.filesData[i].id)||E.isNullOrUndefined(t.id)?this.filesData[i].name!==t.name:this.filesData[i].name!==t.name||this.filesData[i].id!==t.id)||(e=i);return this.fileList[e]},C.prototype.createProgressBar=function(t){var e=this.createElement("span",{className:os}),i=this.createElement("progressbar",{className:hs,attrs:{value:"0",max:"100"}}),s=this.createElement("span",{className:"e-progress-inner-wrap"}),n=(i.style.width="0%",this.createElement("span",{className:ps}));n.textContent="0%",s.appendChild(i),e.appendChild(s),e.appendChild(n),t.querySelector("."+us).appendChild(e)},C.prototype.updateProgressbar=function(t,e){var i;isNaN(Math.round(t.loaded/t.total*100))||E.isNullOrUndefined(e.querySelector("."+hs))||!E.isNullOrUndefined(this.progressInterval)&&""!==this.progressInterval&&0!=(i=Math.round(t.loaded/t.total*100)%parseInt(this.progressInterval,10))&&100!=i||this.changeProgressValue(e,Math.round(t.loaded/t.total*100).toString()+"%")},C.prototype.changeProgressValue=function(t,e){t.querySelector("."+hs).style.width=e,t.querySelector("."+ps).textContent=e},C.prototype.uploadInProgress=function(t,e,i,s){var n=this.getLiElement(e);E.isNullOrUndefined(n)&&!i||(E.isNullOrUndefined(n)?this.cancelUploadingFile(e,t,s):("5"===e.statusCode&&this.cancelUploadingFile(e,t,s,n),0<n.querySelectorAll("."+os).length||!n.querySelector("."+c)||(n.querySelector("."+c).classList.add(v),this.createProgressBar(n),this.updateProgressBarClasses(n,v),n.querySelector("."+c).classList.remove(g)),this.updateProgressbar(t,n),i=n.querySelector("."+m),E.isNullOrUndefined(i)||(i.classList.add(f,v),i.setAttribute("title",this.localizedTexts("abort")),i.classList.remove(m))),s={e:t,operation:"upload",file:this.updateStatus(e,this.localizedTexts("inProgress"),"3")},this.trigger("progress",s))},C.prototype.cancelUploadingFile=function(n,t,a,l){var r=this;"5"===n.statusCode&&this.trigger("canceling",{event:t,fileData:n,cancel:!1,customFormData:[],currentRequest:null},function(e){var t,i,s;e.cancel?(n.statusCode="3",E.isNullOrUndefined(l)||(t=l.querySelector("."+f),E.isNullOrUndefined(t))||(h.hideSpinner(t),E.detach(l.querySelector(".e-spinner-pane")))):(a.emitError=!1,a.httpRequest.abort(),t=new FormData,"5"===n.statusCode&&(i=r.element.getAttribute("name"),t.append(i,n.name),t.append("cancel-uploading",n.name),r.updateFormData(t,e.customFormData),(s=new E.Ajax(r.asyncSettings.removeUrl,"POST",!0,null)).emitError=!1,s.beforeSend=function(t){e.currentRequest&&r.updateCustomheader(s.httpRequest,e.currentRequest)},s.onLoad=function(t){return r.removecanceledFile(t,n),{}},s.send(t)))})},C.prototype.removecanceledFile=function(t,e){var i,s=this.getLiElement(e);E.isNullOrUndefined(s)||s.querySelector("."+ls)||E.isNullOrUndefined(s.querySelector("."+f))||(this.updateStatus(e,this.localizedTexts("fileUploadCancel"),"5"),this.renderFailureState(t,e,s),i=s.querySelector("."+m),E.isNullOrUndefined(s)||(h.hideSpinner(i),E.isNullOrUndefined(s.querySelector(".e-spinner-pane")))||E.detach(s.querySelector(".e-spinner-pane")),i=t&&t.currentTarget?this.getResponse(t):null,this.trigger("success",{event:t,response:i,operation:"cancel",file:e}))},C.prototype.renderFailureState=function(t,e,i){var s=this,n=(this.updateProgressBarClasses(i,g),this.removeProgressbar(i,"failure"),E.isNullOrUndefined(i.querySelector(".e-file-status"))||i.querySelector(".e-file-status").classList.add(g),i.querySelector("."+f));E.isNullOrUndefined(n)||(n.classList.remove(f,v),n.classList.add(m),n.setAttribute("title",this.localizedTexts("remove")),this.pauseButton=this.createElement("span",{className:"e-icons e-file-reload-btn",attrs:{tabindex:this.btnTabIndex}}),n.parentElement.insertBefore(this.pauseButton,n),this.pauseButton.setAttribute("title",this.localizedTexts("retry")),this.pauseButton.setAttribute("aria-label",this.localizedTexts("retry")),i.querySelector("."+ls).addEventListener("click",function(t){s.reloadcanceledFile(t,e,i,!1)},!1))},C.prototype.reloadcanceledFile=function(t,e,i,s){e.statusCode="1",e.status=this.localizedTexts("readyToUploadMessage"),s||(E.isNullOrUndefined(i.querySelector("."+c))||i.querySelector("."+c).classList.remove(g),E.isNullOrUndefined(i.querySelector("."+ls))||E.detach(i.querySelector("."+ls)),this.pauseButton=null),E.isNullOrUndefined(i)||i.classList.add(ys),this.upload([e])},C.prototype.uploadComplete=function(t,e,i){var s=t.target;4===s.readyState&&200<=s.status&&s.status<=299?(s=this.getLiElement(e),E.isNullOrUndefined(s)&&(!i||E.isNullOrUndefined(i))&&this.showFileList||(E.isNullOrUndefined(s)||(this.updateProgressBarClasses(s,ds),this.removeProgressbar(s,"success"),i=s.querySelector("."+f),E.isNullOrUndefined(i))||(i.classList.add(u),i.setAttribute("title",this.localizedTexts("delete")),i.setAttribute("aria-label",this.localizedTexts("delete")),i.classList.remove(f),i.classList.remove(v)),this.raiseSuccessEvent(t,e))):this.uploadFailed(t,e)},C.prototype.getResponse=function(t){t=t.currentTarget;return{readyState:t.readyState,statusCode:t.status,statusText:t.statusText,headers:t.getAllResponseHeaders(),withCredentials:t.withCredentials}},C.prototype.raiseSuccessEvent=function(t,e){var i=this,s=t&&t.currentTarget?this.getResponse(t):null,n=this.localizedTexts("uploadSuccessMessage"),t={e:t,response:s,operation:"upload",file:this.updateStatus(e,n,"2",!1),statusText:n},s=this.getLiElement(e);E.isNullOrUndefined(s)||(n=s.querySelector("."+as),E.isNullOrUndefined(n))||(h.hideSpinner(s),E.detach(n)),this.trigger("success",t,function(t){i.updateStatus(e,t.statusText,"2"),i.multiple?i.uploadedFilesData.push(e):i.uploadedFilesData=[e],i.trigger("change",{file:i.uploadedFilesData}),i.checkActionButtonStatus(),0<i.fileList.length?i.getLiElement(e).classList.contains(ys)?i.getLiElement(e).classList.remove(ys):(i.uploadSequential(),i.checkActionComplete(!0)):i.showFileList||i.checkActionComplete(!0)})},C.prototype.uploadFailed=function(t,e){var i=this,s=this.getLiElement(e),n=t&&t.currentTarget?this.getResponse(t):null,a=this.localizedTexts("uploadFailedMessage"),n={e:t,response:n,operation:"upload",file:this.updateStatus(e,a,"0",!1),statusText:a};E.isNullOrUndefined(s)||this.renderFailureState(t,e,s),this.trigger("failure",n,function(t){i.updateStatus(e,t.statusText,"0"),i.checkActionButtonStatus(),i.uploadSequential(),i.checkActionComplete(!0)})},C.prototype.uploadSequential=function(){this.sequentialUpload&&(this.autoUpload?this.checkAutoUpload(this.filesData):this.uploadButtonClick())},C.prototype.checkActionComplete=function(t){t?++this.actionCompleteCount:--this.actionCompleteCount,this.raiseActionComplete()},C.prototype.raiseActionComplete=function(){var t;this.filesData.length===this.actionCompleteCount&&this.flag&&(this.flag=!1,(t={fileData:[]}).fileData=this.getSelectedFileStatus(this.selectedFiles),this.trigger("actionComplete",t))},C.prototype.getSelectedFileStatus=function(t){for(var e=[],i=0,s=0;s<t.length;s++)for(var n=t[s],a=0;a<this.filesData.length;a++)if(this.filesData[a].name===n.name&&this.filesData[a].status===n.status){e[i]=this.filesData[a],++i;break}return e},C.prototype.updateProgressBarClasses=function(t,e){t=t.querySelector("."+hs);E.isNullOrUndefined(t)||(t.classList.add(e),this.actionButtons&&this.clearButton&&this.uploadWrapper&&("e-upload-progress"!==e||this.clearButton.hasAttribute("disabled")?"e-upload-success"!==e&&"e-upload-fails"!==e||0!==this.uploadWrapper.querySelectorAll(".e-upload-progress-bar.e-upload-progress:not(.e-upload-success):not(.e-upload-fails)").length||!this.clearButton.hasAttribute("disabled")||this.clearButton.removeAttribute("disabled"):this.clearButton.setAttribute("disabled","disabled")))},C.prototype.removeProgressbar=function(t,e){var i=this;E.isNullOrUndefined(t.querySelector("."+os))||(this.progressAnimation=new E.Animation({duration:1250}),this.progressAnimation.animate(t.querySelector("."+os),{name:"FadeOut"}),this.progressAnimation.animate(t.querySelector("."+ps),{name:"FadeOut"}),setTimeout(function(){i.animateProgressBar(t,e)},750))},C.prototype.animateProgressBar=function(t,e){"success"===e?(t.classList.add(ds),E.isNullOrUndefined(t.querySelector("."+c))||(t.querySelector("."+c).classList.remove(v),this.progressAnimation.animate(t.querySelector("."+c),{name:"FadeIn"}),t.querySelector("."+c).classList.add(ds))):E.isNullOrUndefined(t.querySelector("."+c))||(t.querySelector("."+c).classList.remove(v),this.progressAnimation.animate(t.querySelector("."+c),{name:"FadeIn"}),t.querySelector("."+c).classList.add(g)),t.querySelector("."+os)&&E.detach(t.querySelector("."+os))},C.prototype.setExtensions=function(t){""===t||E.isNullOrUndefined(t)?this.element.removeAttribute("accept"):this.element.setAttribute("accept",t)},C.prototype.templateComplier=function(e){if(e)try{return"function"!=typeof e&&E.selectAll(e,document).length?E.compile(E.select(e,document).innerHTML.trim()):E.compile(e)}catch(t){return E.compile(e)}},C.prototype.setRTL=function(){this.enableRtl?E.addClass([this.uploadWrapper],"e-rtl"):E.removeClass([this.uploadWrapper],"e-rtl")},C.prototype.localizedTexts=function(t){return this.l10n.setLocale(this.locale),this.l10n.getConstant(t)},C.prototype.setControlStatus=function(){this.enabled?(this.uploadWrapper.classList.contains(ms)&&this.uploadWrapper.classList.remove(ms),!E.isNullOrUndefined(this.browseButton)&&this.element.hasAttribute("disabled")&&(this.element.removeAttribute("disabled"),this.browseButton.removeAttribute("disabled")),!E.isNullOrUndefined(this.clearButton)&&this.clearButton.hasAttribute("disabled")&&this.clearButton.removeAttribute("disabled"),!E.isNullOrUndefined(this.uploadButton)&&this.uploadButton.hasAttribute("disabled")&&this.uploadButton.hasAttribute("disabled")):(this.uploadWrapper.classList.add(ms),this.element.setAttribute("disabled","disabled"),this.browseButton.setAttribute("disabled","disabled"),E.isNullOrUndefined(this.clearButton)||this.clearButton.setAttribute("disabled","disabled"),E.isNullOrUndefined(this.uploadButton)||this.uploadButton.setAttribute("disabled","disabled"))},C.prototype.checkHTMLAttributes=function(t){for(var e=0,i=t?E.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["accept","multiple","disabled"];e<i.length;e++){var s,n=i[e];if(!E.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"accept":(E.isNullOrUndefined(this.uploaderOptions)||void 0===this.uploaderOptions.allowedExtensions||t)&&(this.setProperties({allowedExtensions:this.element.getAttribute("accept")},!t),this.initialAttr.accept=this.allowedExtensions);break;case"multiple":(E.isNullOrUndefined(this.uploaderOptions)||void 0===this.uploaderOptions.multiple||t)&&(s="multiple"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n),this.setProperties({multiple:s},!t),this.initialAttr.multiple=!0);break;case"disabled":(E.isNullOrUndefined(this.uploaderOptions)||void 0===this.uploaderOptions.enabled||t)&&(s="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n),this.setProperties({enabled:s},!t),this.initialAttr.disabled=!0)}}},C.prototype.chunkUpload=function(t,e,i){var s=Math.min(this.asyncSettings.chunkSize,t.size),n=t.rawFile.slice(0,s);this.sendRequest(t,{chunkIndex:0,blob:n,file:t,start:0,end:s,retryCount:0,request:null},e,i)},C.prototype.sendRequest=function(i,s,e,t){var n=this,a=new FormData,l=i.rawFile.slice(s.start,s.end),l=(a.append(this.uploaderName,l,i.name),a.append("chunk-index",s.chunkIndex.toString()),a.append("chunkIndex",s.chunkIndex.toString()),Math.max(Math.ceil(i.size/this.asyncSettings.chunkSize),1)),r=(a.append("total-chunk",l.toString()),a.append("totalChunk",l.toString()),new E.Ajax({url:this.asyncSettings.saveUrl,type:"POST",async:!0,contentType:null})),o=(r.emitError=!1,r.onLoad=function(t){return n.chunkUploadComplete(t,s,e),{}},r.onUploadProgress=function(t){return n.chunkUploadInProgress(t,s,e),{}},{fileData:i,customFormData:[],cancel:!1,chunkSize:0===this.asyncSettings.chunkSize?null:this.asyncSettings.chunkSize});r.beforeSend=function(e){o.currentRequest=r.httpRequest,o.currentChunkIndex=s.chunkIndex,0===o.currentChunkIndex?n.trigger("uploading",o,function(t){n.uploadingEventCallback(a,t,e,i)}):n.trigger("chunkUploading",o,function(t){n.uploadingEventCallback(a,t,e,i)})},r.onError=function(t){return n.chunkUploadFailed(t,s,e),{}},r.send(a),s.request=r},C.prototype.uploadingEventCallback=function(t,e,i,s){e.cancel?this.eventCancelByArgs(i,e,s):this.updateFormData(t,e.customFormData)},C.prototype.eventCancelByArgs=function(t,e,i){var s,n=this;t.cancel=!0,"5"!==e.fileData.statusCode&&(e.fileData.statusCode="5",e.fileData.status=this.localizedTexts("fileUploadCancel"),(s=this.getLiElement(e.fileData))&&(E.isNullOrUndefined(s.querySelector("."+c))||(s.querySelector("."+c).innerHTML=this.localizedTexts("fileUploadCancel"),s.querySelector("."+c).classList.add(g)),this.pauseButton=this.createElement("span",{className:"e-icons e-file-reload-btn",attrs:{tabindex:this.btnTabIndex}}),(t=s.querySelector("."+m))&&t.parentElement.insertBefore(this.pauseButton,t),this.pauseButton.setAttribute("title",this.localizedTexts("retry")),this.pauseButton.addEventListener("click",function(t){n.reloadcanceledFile(t,i,s)},!1),this.checkActionButtonStatus()),s=null)},C.prototype.checkChunkUpload=function(){return!(this.asyncSettings.chunkSize<=0||E.isNullOrUndefined(this.asyncSettings.chunkSize))},C.prototype.chunkUploadComplete=function(t,n,a){var l,r=this,o=t.target;if(4===o.readyState&&200<=o.status&&o.status<300){var e=t&&t.currentTarget?this.getResponse(t):null,i=Math.max(Math.ceil(n.file.size/this.asyncSettings.chunkSize),1),e={event:t,file:n.file,chunkIndex:n.chunkIndex,totalChunk:i,chunkSize:this.asyncSettings.chunkSize,response:e};if(this.trigger("chunkSuccess",e),!E.isNullOrUndefined(a)&&a||(l=this.getLiElement(n.file)),this.updateMetaData(n),n.end===n.file.size&&(n.file.statusCode="3"),"5"===n.file.statusCode){e={event:t,fileData:n.file,cancel:!1,customFormData:[],currentRequest:null};this.trigger("canceling",e,function(e){var t,i,s;e.cancel?(n.file.statusCode="3",t=l.querySelector("."+f),E.isNullOrUndefined(l)||E.isNullOrUndefined(t)||(h.hideSpinner(t),E.detach(l.querySelector(".e-spinner-pane"))),r.sendNextRequest(n)):(n.request.emitError=!1,o.abort(),t=new FormData,i=r.element.getAttribute("name"),t.append(i,n.file.name),t.append("cancel-uploading",n.file.name),t.append("cancelUploading",n.file.name),r.updateFormData(t,e.customFormData),(s=new E.Ajax(r.asyncSettings.removeUrl,"POST",!0,null)).emitError=!1,s.beforeSend=function(t){Array.isArray(e.currentRequest)&&r.updateCustomheader(s.httpRequest,e.currentRequest)},s.onLoad=function(t){return r.removeChunkFile(t,n,a),{}},s.send(t))})}else{if(i-1===n.chunkIndex&&i>n.chunkIndex)return 0<=(e=this.pausedData.indexOf(n))&&this.pausedData.splice(e,1),E.isNullOrUndefined(this.template)&&(E.isNullOrUndefined(a)||!a)&&l&&(l&&!E.isNullOrUndefined(l.querySelector("."+y))&&E.detach(l.querySelector("."+y)),this.removeChunkProgressBar(n)),void this.raiseSuccessEvent(t,n.file);"4"!==n.file.statusCode&&this.sendNextRequest(n)}}else this.chunkUploadFailed(t,n);l=null},C.prototype.sendNextRequest=function(t){t.start=t.end,t.end+=this.asyncSettings.chunkSize,t.end=Math.min(t.end,t.file.size),t.chunkIndex+=1,this.sendRequest(t.file,t)},C.prototype.removeChunkFile=function(t,e,i){var s,n;E.isNullOrUndefined(this.template)&&E.isNullOrUndefined(i)&&!i&&(n=s=(i=this.getLiElement(e.file)).querySelector("."+f),this.updateStatus(e.file,this.localizedTexts("fileUploadCancel"),"5"),this.updateProgressBarClasses(i,g),this.removeProgressbar(i,"failure"),s&&(s.classList.remove(f),s.classList.add(m),s.setAttribute("title",this.localizedTexts("remove"))),(e=i.querySelector("."+y))&&(e.classList.add(ls),e.classList.remove(y),e.setAttribute("title",this.localizedTexts("retry"))),E.isNullOrUndefined(i)||E.isNullOrUndefined(s)||E.isNullOrUndefined(i.querySelector(".e-spinner-pane"))||(h.hideSpinner(n),E.detach(i.querySelector(".e-spinner-pane"))))},C.prototype.pauseUpload=function(t,e,i){t.file.statusCode="4",t.file.status=this.localizedTexts("pause"),this.updateMetaData(t);e={event:e||null,file:t.file,chunkIndex:t.chunkIndex,chunkCount:Math.round(t.file.size/this.asyncSettings.chunkSize),chunkSize:this.asyncSettings.chunkSize};this.abortUpload(t,i,e),this.sequentialUpload&&this.uploadSequential()},C.prototype.abortUpload=function(t,e,i){"4"!==t.file.statusCode&&(t.request.emitError=!1,t.request.httpRequest.abort());var s=this.getLiElement(t.file);E.isNullOrUndefined(this.template)&&(E.isNullOrUndefined(e)||!e)&&s&&((e=s.querySelector("."+y)).classList.remove(y),e.classList.add(gs),e.setAttribute("title",this.localizedTexts("resume")),e.nextElementSibling.classList.add(m),e.nextElementSibling.classList.remove(f),e.nextElementSibling.setAttribute("title",this.localizedTexts("remove")));for(var n=0;n<this.pausedData.length;n++)this.pausedData[n].file.name===t.file.name&&this.pausedData.splice(n,1);this.pausedData.push(t),this.trigger("pausing",i)},C.prototype.resumeUpload=function(t,e,i){var s,n=this.getLiElement(t.file),n=(E.isNullOrUndefined(n)||(s=n.querySelector("."+gs)),E.isNullOrUndefined(s)||!E.isNullOrUndefined(i)&&i||(s.classList.remove(gs),s.classList.add(y),s.setAttribute("title",this.localizedTexts("pause")),s.nextElementSibling.classList.remove(m),s.nextElementSibling.classList.add(f),s.nextElementSibling.setAttribute("title",this.localizedTexts("abort"))),t.file.status=this.localizedTexts("inProgress"),t.file.statusCode="3",this.updateMetaData(t),{event:e||null,file:t.file,chunkIndex:t.chunkIndex,chunkCount:Math.round(t.file.size/this.asyncSettings.chunkSize),chunkSize:this.asyncSettings.chunkSize});this.trigger("resuming",n);for(var a=0;a<this.pausedData.length;a++)this.pausedData[a].end===this.pausedData[a].file.size?this.chunkUploadComplete(e,t,i):this.pausedData[a].file.name===t.file.name&&(this.pausedData[a].start=this.pausedData[a].end,this.pausedData[a].end=this.pausedData[a].end+this.asyncSettings.chunkSize,this.pausedData[a].end=Math.min(this.pausedData[a].end,this.pausedData[a].file.size),this.pausedData[a].chunkIndex=this.pausedData[a].chunkIndex+1,this.sendRequest(this.pausedData[a].file,this.pausedData[a],i))},C.prototype.updateMetaData=function(t){-1===this.uploadMetaData.indexOf(t)||this.uploadMetaData.splice(this.uploadMetaData.indexOf(t),1),this.uploadMetaData.push(t)},C.prototype.removeChunkProgressBar=function(t){var t=this.getLiElement(t.file);E.isNullOrUndefined(t)||(this.updateProgressBarClasses(t,ds),this.removeProgressbar(t,"success"),t=t.querySelector("."+f),E.isNullOrUndefined(t))||(t.classList.add(u),t.setAttribute("title",this.localizedTexts("delete")),t.classList.remove(f,v))},C.prototype.chunkUploadFailed=function(i,s,n){var a,l=this,t=Math.max(Math.ceil(s.file.size/this.asyncSettings.chunkSize),1),r=(!E.isNullOrUndefined(this.template)||!E.isNullOrUndefined(n)&&n||(a=this.getLiElement(s.file)),i&&i.currentTarget?this.getResponse(i):null),t={event:i,file:s.file,chunkIndex:s.chunkIndex,totalChunk:t,chunkSize:this.asyncSettings.chunkSize,cancel:!1,response:r};this.trigger("chunkFailure",t,function(t){var e;t.cancel||(s.retryCount<l.asyncSettings.retryCount?setTimeout(function(){l.retryRequest(a,s,n)},l.asyncSettings.retryAfterDelay):(E.isNullOrUndefined(a)||(t=a.querySelector("."+y)?a.querySelector("."+y):a.querySelector("."+gs),E.isNullOrUndefined(t)||(t.classList.add(ls),t.classList.remove(y,gs)),l.updateProgressBarClasses(a,g),l.removeProgressbar(a,"failure"),a.querySelector(".e-icons").classList.remove(v),(t=a.querySelector("."+f)?a.querySelector("."+f):a.querySelector("."+m)).classList.remove(f),E.isNullOrUndefined(a.querySelector("."+y))||E.detach(a.querySelector("."+y)),0<s.start?(t.classList.add(u),t.setAttribute("title",l.localizedTexts("delete"))):(t.classList.add(m),t.setAttribute("title",l.localizedTexts("remove")))),s.retryCount=0,e=s.file,t=l.localizedTexts("uploadFailedMessage"),t={e:i,response:r,operation:"upload",file:l.updateStatus(e,t,"0",!1),statusText:t},l.trigger("failure",t,function(t){l.updateStatus(e,t.statusText,"0"),l.uploadSequential(),l.checkActionComplete(!0)})))}),a=null},C.prototype.retryRequest=function(t,e,i){E.isNullOrUndefined(this.template)&&(E.isNullOrUndefined(i)||!i)&&t&&this.updateProgressBarClasses(t,g),e&&(e.retryCount+=1,this.sendRequest(e.file,e))},C.prototype.checkPausePlayAction=function(t){var e=t.target,i=t.target.parentElement,i=this.fileList.indexOf(i),i=this.filesData[i],i=this.getCurrentMetaData(i);e.classList.contains(y)?this.pauseUpload(i,t):e.classList.contains(gs)?this.resumeUpload(i,t):e.classList.contains(ls)&&(i.file.status===this.localizedTexts("fileUploadCancel")?this.retryUpload(i,!1):this.retryUpload(i,!0))},C.prototype.retryUpload=function(t,e){e?(t.end=t.end+this.asyncSettings.chunkSize,t.start=t.start+this.asyncSettings.chunkSize,this.sendRequest(t.file,t)):(t.file.statusCode="1",t.file.status=this.localizedTexts("readyToUploadMessage"),this.chunkUpload(t.file)),this.getLiElement(t.file).classList.add(ys)},C.prototype.chunkUploadInProgress=function(t,e,i){var s,n,a=this;"4"===e.file.statusCode||("4"!==e.file.statusCode&&"5"!==e.file.statusCode&&(e.file.statusCode="3",e.file.status=this.localizedTexts("inProgress")),this.updateMetaData(e),s=this.getLiElement(e.file),E.isNullOrUndefined(s))||(n=s.querySelector("."+ls),E.isNullOrUndefined(n)||(n.classList.add(y),n.setAttribute("title",this.localizedTexts("pause")),n.classList.remove(ls)),E.isNullOrUndefined(s)||(0<s.querySelectorAll("."+os).length||(n=s.querySelector("."+c),E.isNullOrUndefined(this.template)&&(n.classList.add(v),n.classList.remove(g),this.createProgressBar(s),this.updateProgressBarClasses(s,v)),n=s.querySelector("."+m)?s.querySelector("."+m):s.querySelector("."+u),E.isNullOrUndefined(n))||(n.classList.add(f),n.setAttribute("title",this.localizedTexts("abort")),n.classList.remove(m)),!isNaN(Math.round(t.loaded/t.total*100))&&E.isNullOrUndefined(this.template)&&"4"!==e.file.statusCode&&(n=void 0,t=Math.ceil(e.file.size/this.asyncSettings.chunkSize)-1,this.asyncSettings.chunkSize)&&t&&(n=Math.round(e.chunkIndex/t*100),this.changeProgressValue(s,n.toString()+"%")),0===e.chunkIndex&&this.checkActionButtonStatus()),E.isNullOrUndefined(s.querySelector("."+y))&&E.isNullOrUndefined(this.template)&&E.isNullOrUndefined(s.querySelector("."+u))&&(this.pauseButton=this.createElement("span",{className:"e-icons e-file-pause-btn",attrs:{tabindex:this.btnTabIndex}}),"msie"===this.browserName&&this.pauseButton.classList.add("e-msie"),(t=s.querySelector("."+f)).parentElement.insertBefore(this.pauseButton,t),this.pauseButton.setAttribute("title",this.localizedTexts("pause")),this.pauseButton.addEventListener("click",function(t){a.checkPausePlayAction(t)},!1)))},C.prototype.bytesToSize=function(t){var e=-1;if(!t)return"0.0 KB";for(;e++,99<(t/=1024););return 2<=e&&(t*=1024,e=1),Math.max(t,0).toFixed(1)+" "+["KB","MB"][e]},C.prototype.sortFileList=function(t){for(var e=t=t||this.sortFilesList,i=[],s=0;s<e.length;s++)i.push(e[s].name);for(var n=[],a=0,l=i.sort();a<l.length;a++)for(var r=l[a],s=0;s<e.length;s++)r===e[s].name&&n.push(e[s]);return n},C.prototype.destroy=function(){this.element.value=null,this.clearTemplate(),this.clearAll(),this.unWireEvents(),this.unBindDropEvents(),this.multiple&&this.element.removeAttribute("multiple"),this.enabled||this.element.removeAttribute("disabled"),this.element.removeAttribute("accept"),this.setInitialAttributes();for(var t=0,e=["aria-label","directory","webkitdirectory","tabindex"];t<e.length;t++)this.element.removeAttribute(e[t]);E.isNullOrUndefined(this.uploadWrapper)||(this.uploadWrapper.parentElement.appendChild(this.element),E.detach(this.uploadWrapper)),this.fileList=[],this.filesData=[],this.fileList.length=0,this.filesData.length=0,this.uploadWrapper=null,this.browseButton=null,this.listParent=null,this.dropAreaWrapper=null,this.dropZoneElement=null,this.actionButtons=null,this.pauseButton=null,this.formElement=null,this.dropArea=null,this.keyboardModule=null,this.clearButton=null,this.uploadButton=null,"EJS-UPLOADER"===this.element.tagName&&E.setValue("ej2_instances",null,this.element),Ns.prototype.destroy.call(this)},C.prototype.upload=function(t,e){var i,s=this;t=t||this.filesData,this.sequentialUpload&&(this.isFirstFileOnSelection||e)?this.sequenceUpload(t):(i=this.getFilesInArray(t),this.trigger("beforeUpload",{customFormData:[],currentRequest:null,cancel:!1},function(t){t.cancel||(s.customFormDatas=t.customFormData&&0<t.customFormData.length?t.customFormData:s.customFormDatas,s.uploadFiles(i,e))}))},C.prototype.getFilesInArray=function(t){var e=[];return t&&(t instanceof Array?e=t:e.push(t)),e},C.prototype.serverReadFileBase64=function(a,l,r){var o=this;return new Promise(function(i,s){var n,t=o.fileStreams[a].rawFile;try{var e=new FileReader;e.onload=(n=e,function(){try{var t=n.result,e=t?t.split(";base64,")[1]:null;i(e)}catch(t){s(t)}}),e.readAsDataURL(t.slice(l,l+r))}catch(t){s(t)}})},C.prototype.uploadFileCount=function(t){var e=this.filesData;return e&&0!==e.length?e.length:-1},C.prototype.getFileRead=function(t,e){var i=this.filesData;return i&&0!==i.length?(i=i[t],t=this.newFileRef++,this.fileStreams[t]=i,t):-1},C.prototype.uploadFiles=function(t,e){var i,s=[];if(""!==this.asyncSettings.saveUrl&&!E.isNullOrUndefined(this.asyncSettings.saveUrl)){s=!e||E.isNullOrUndefined(e)?this.multiple?this.filterfileList(t):((i=[]).push(t[0]),this.filterfileList(i)):t;for(var n=0;n<s.length;n++)this.uploadFilesRequest(s,n,e)}},C.prototype.uploadFilesRequest=function(i,s,e){var t,n=this,a=this.checkChunkUpload(),l=new E.Ajax(this.asyncSettings.saveUrl,"POST",!0,null),r=(l.emitError=!1,{fileData:i[s],customFormData:[],cancel:!1}),o=new FormData;l.beforeSend=function(e){r.currentRequest=l.httpRequest,n.trigger("uploading",r,function(t){t.cancel&&n.eventCancelByArgs(e,t,i[s]),n.customFormDatas&&0<n.customFormDatas.length&&n.updateFormData(o,n.customFormDatas),n.updateFormData(o,t.customFormData)})},"1"===i[s].statusCode&&(t=this.element.getAttribute("name"),o.append(t,i[s].rawFile,i[s].name),a&&i[s].size>this.asyncSettings.chunkSize?this.chunkUpload(i[s],e,s):(l.onLoad=function(t){return r.cancel||n.uploadComplete(t,i[s],e),{}},l.onUploadProgress=function(t){return r.cancel||n.uploadInProgress(t,i[s],e,l),{}},l.onError=function(t){return n.uploadFailed(t,i[s]),{}},l.send(o)))},C.prototype.spliceFiles=function(t){for(var e=this.fileList[t],i=this.getFilesData(),e=+e.getAttribute("data-files-count"),s=0,n=0;n<t;n++)s+=+this.fileList[n].getAttribute("data-files-count");for(var a=s+e-1;s<=a;a--)i.splice(a,1)},C.prototype.remove=function(l,a,r,t,o){var h=this,p=(E.isNullOrUndefined(t)&&(t=!0),{event:o,cancel:!1,filesData:[],customFormData:[],postRawFile:t,currentRequest:null});this.trigger("beforeRemove",{cancel:!1,customFormData:[],currentRequest:null},function(t){if(!t.cancel)if(h.isFormUpload())p.filesData=l,h.trigger("removing",p,function(t){if(!t.cancel)for(var e=!1,i=void 0,s=0,n=h.getFilesInArray(l);s<n.length;s++){var a=n[s];-1<(i=e?i:h.fileList.indexOf(a.list))&&((a=E.isNullOrUndefined(a.input)?null:a.input)&&E.detach(a),h.spliceFiles(i),E.detach(h.fileList[i]),h.fileList.splice(i,1),e=!0,i=-1)}});else if(h.isForm&&(E.isNullOrUndefined(h.asyncSettings.removeUrl)||""===h.asyncSettings.removeUrl))p.filesData=h.getFilesData(),h.trigger("removing",p,function(t){t.cancel||h.clearAll()});else for(var t=[],e=((l=E.isNullOrUndefined(l)?h.filesData:l)instanceof Array?t=l:t.push(l),p.filesData=t,h.asyncSettings.removeUrl),i=""!==e&&!E.isNullOrUndefined(e),s=0,n=t;s<n.length;s++)!function(e){var t=h.uploadedFilesData.indexOf(e);("2"===e.statusCode||"4"===e.statusCode||"0"===e.statusCode&&-1!==t)&&i?h.removeUploadedFile(e,p,r,a):r?h.removeFilesData(e,a):h.trigger("removing",p,function(t){t.cancel||h.removeFilesData(e,a)}),o&&!o.target.classList.contains(m)&&h.checkActionComplete(!1)}(n[s])})},C.prototype.clearAll=function(){var t,e=this;E.isNullOrUndefined(this.listParent)?("msie"!==this.browserName&&(this.element.value=""),this.filesData=[]):(t={cancel:!1,filesData:this.filesData},this.trigger("clearing",t,function(t){t.cancel||(e.clearData(),e.actionCompleteCount=0,e.count=-1)}))},C.prototype.getFilesData=function(t){return E.isNullOrUndefined(t)?this.filesData:this.getSelectedFiles(t)},C.prototype.pause=function(t,e){t=t||this.filesData;t=this.getFilesInArray(t);this.pauseUploading(t,e)},C.prototype.pauseUploading=function(t,e){for(var i=this.getFiles(t),s=0;s<i.length;s++)"3"===i[s].statusCode&&this.pauseUpload(this.getCurrentMetaData(i[s],null),null,e)},C.prototype.getFiles=function(t){var e=[];return E.isNullOrUndefined(t)||t instanceof Array?e=t:e.push(t),e},C.prototype.resume=function(t,e){t=t||this.filesData;t=this.getFilesInArray(t);this.resumeFiles(t,e)},C.prototype.resumeFiles=function(t,e){for(var i=this.getFiles(t),s=0;s<i.length;s++)"4"===i[s].statusCode&&this.resumeUpload(this.getCurrentMetaData(i[s],null),null,e)},C.prototype.retry=function(t,e,i){t=t||this.filesData;t=this.getFilesInArray(t);this.sequentialUpload&&this.isFirstFileOnSelection&&(this.isFirstFileOnSelection=!1),this.retryFailedFiles(t,e,i)},C.prototype.retryFailedFiles=function(t,e,i){for(var s,n=this.getFiles(t),a=0;a<n.length;a++)"5"!==n[a].statusCode&&"0"!==n[a].statusCode||(0<this.asyncSettings.chunkSize&&this.getCurrentMetaData(n[a],null)?this.retryUpload(this.getCurrentMetaData(n[a],null),e):(s=void 0,i||(s=this.fileList[this.filesData.indexOf(n[a])]),this.reloadcanceledFile(null,n[a],s,i)))},C.prototype.cancel=function(t){t=t||this.filesData;t=this.getFilesInArray(t);this.cancelUpload(t)},C.prototype.cancelUpload=function(t){var e=this.getFiles(t);if(0<this.asyncSettings.chunkSize)for(var i,s=0;s<e.length;s++)"3"===e[s].statusCode&&((i=this.getCurrentMetaData(e[s],null)).file.statusCode="5",i.file.status=this.localizedTexts("fileUploadCancel"),this.updateMetaData(i),this.showHideUploadSpinner(e[s]));else for(s=0;s<e.length;s++)"3"===e[s].statusCode&&(e[s].statusCode="5",e[s].status=this.localizedTexts("fileUploadCancel"),this.showHideUploadSpinner(e[s]))},C.prototype.showHideUploadSpinner=function(t){var t=this.getLiElement(t);!E.isNullOrUndefined(t)&&E.isNullOrUndefined(this.template)&&(t=t.querySelector("."+f),h.createSpinner({target:t,width:"20px"}),h.showSpinner(t))},s([E.Complex({saveUrl:"",removeUrl:""},ks)],C.prototype,"asyncSettings",void 0),s([E.Property(!1)],C.prototype,"sequentialUpload",void 0),s([E.Property({})],C.prototype,"htmlAttributes",void 0),s([E.Property("")],C.prototype,"cssClass",void 0),s([E.Property(!0)],C.prototype,"enabled",void 0),s([E.Property(null)],C.prototype,"template",void 0),s([E.Property(!0)],C.prototype,"multiple",void 0),s([E.Property(!0)],C.prototype,"autoUpload",void 0),s([E.Property(!0)],C.prototype,"enableHtmlSanitizer",void 0),s([E.Complex({},Os)],C.prototype,"buttons",void 0),s([E.Property("")],C.prototype,"allowedExtensions",void 0),s([E.Property(0)],C.prototype,"minFileSize",void 0),s([E.Property(3e7)],C.prototype,"maxFileSize",void 0),s([E.Property(null)],C.prototype,"dropArea",void 0),s([E.Collection([{}],Ss)],C.prototype,"files",void 0),s([E.Property(!0)],C.prototype,"showFileList",void 0),s([E.Property(!1)],C.prototype,"directoryUpload",void 0),s([E.Property("Default")],C.prototype,"dropEffect",void 0),s([E.Event()],C.prototype,"created",void 0),s([E.Event()],C.prototype,"actionComplete",void 0),s([E.Event()],C.prototype,"rendering",void 0),s([E.Event()],C.prototype,"beforeUpload",void 0),s([E.Event()],C.prototype,"fileListRendering",void 0),s([E.Event()],C.prototype,"selected",void 0),s([E.Event()],C.prototype,"uploading",void 0),s([E.Event()],C.prototype,"success",void 0),s([E.Event()],C.prototype,"failure",void 0),s([E.Event()],C.prototype,"removing",void 0),s([E.Event()],C.prototype,"beforeRemove",void 0),s([E.Event()],C.prototype,"clearing",void 0),s([E.Event()],C.prototype,"progress",void 0),s([E.Event()],C.prototype,"change",void 0),s([E.Event()],C.prototype,"chunkSuccess",void 0),s([E.Event()],C.prototype,"chunkFailure",void 0),s([E.Event()],C.prototype,"chunkUploading",void 0),s([E.Event()],C.prototype,"canceling",void 0),s([E.Event()],C.prototype,"pausing",void 0),s([E.Event()],C.prototype,"resuming",void 0);var Ns,t=s([E.NotifyPropertyChanges],C);function C(t,e){e=Ns.call(this,t,e)||this;return e.initialAttr={accept:null,multiple:!1,disabled:!1},e.uploadedFilesData=[],e.base64String=[],e.isForm=!1,e.allTypes=!1,e.pausedData=[],e.uploadMetaData=[],e.tabIndex="0",e.btnTabIndex="0",e.disableKeyboardNavigation=!1,e.count=-1,e.actionCompleteCount=0,e.flag=!0,e.selectedFiles=[],e.uploaderName="UploadFiles",e.fileStreams=[],e.newFileRef=0,e.isFirstFileOnSelection=!1,e.dragCounter=0,e.fileList=[],e.filesData=[],e.uploaderOptions=t,e}Hs=function(t,e){return(Hs=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Hs,Bs,s=function(t,e){function i(){this.constructor=t}Hs(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},x=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},Rs="e-apply",Us="e-cancel",Is="e-current",Fs="e-ctrl-btn",Vs="e-switch-ctrl-btn",Ms="e-disabled",Ds="e-value-switch-btn",Ws="e-handler",zs="e-hide-hex-value",qs="e-hide-opacity",js="e-hide-switchable-value",_s="e-hide-value",Xs="e-hide-valueswitcher",Ks="e-hsv-color",Ys="e-hsv-container",Zs="e-selected-value",Gs="e-mode-switch-btn",Js="e-nocolor-item",$s="e-opacity-value",Qs="e-palette",tn="e-color-palette",en="e-color-picker",sn="e-preview-container",nn="e-previous",an="e-show-value",ln="e-selected",rn="e-split-preview",on="e-tile",hn=["#000000","#f44336","#e91e63","#9c27b0","#673ab7","#2196f3","#03a9f4","#00bcd4","#009688","#ffeb3b","#ffffff","#ffebee","#fce4ec","#f3e5f5","#ede7f6","#e3f2fd","#e1f5fe","#e0f7fa","#e0f2f1","#fffde7","#f2f2f2","#ffcdd2","#f8bbd0","#e1bee7","#d1c4e9","#bbdefb","#b3e5fc","#b2ebf2","#b2dfdb","#fff9c4","#e6e6e6","#ef9a9a","#f48fb1","#ce93d8","#b39ddb","#90caf9","#81d4fa","#80deea","#80cbc4","#fff59d","#cccccc","#e57373","#f06292","#ba68c8","#9575cd","#64b5f6","#4fc3f7","#4dd0e1","#4db6ac","#fff176","#b3b3b3","#ef5350","#ec407a","#ab47bc","#7e57c2","#42a5f5","#29b6f6","#26c6da","#26a69a","#ffee58","#999999","#e53935","#d81b60","#8e24aa","#5e35b1","#1e88e5","#039be5","#00acc1","#00897b","#fdd835","#808080","#d32f2f","#c2185b","#7b1fa2","#512da8","#1976d2","#0288d1","#0097a7","#00796b","#fbc02d","#666666","#c62828","#ad1457","#6a1b9a","#4527a0","#1565c0","#0277bd","#00838f","#00695c","#f9a825","#4d4d4d","#b71c1c","#880e4f","#4a148c","#311b92","#0d47a1","#01579b","#006064","#004d40","#f57f17"],s=(Bs=E.Component,s(S,Bs),S.prototype.preRender=function(){var t=this.element;this.formElement=E.closest(this.element,"form"),this.formElement&&E.EventHandler.add(this.formElement,"reset",this.formResetHandler,this);this.l10n=new E.L10n("colorpicker",{Apply:"Apply",Cancel:"Cancel",ModeSwitcher:"Switch Mode",RecentColors:"Recent colors",CurrentColor:"Current",PreviousColor:"Previous"},this.locale),t.getAttribute("ejs-for")&&!t.getAttribute("name")&&t.setAttribute("name",t.id)},S.prototype.render=function(){this.initWrapper(),this.inline?this.createWidget():this.createSplitBtn(),this.enableOpacity||E.addClass([this.container.parentElement],qs),this.renderComplete()},S.prototype.initWrapper=function(){var t=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper"}),e=(this.element.parentNode.insertBefore(t,this.element),t.appendChild(this.element),E.attributes(this.element,{tabindex:"-1",spellcheck:"false","aria-label":"colorpicker"}),this.container=this.createElement("div",{className:"e-container"}),this.getWrapper().appendChild(this.container),this.value?this.roundValue(this.value).toLowerCase():"#008000ff"),i=(e=this.noColor&&"Palette"===this.mode&&""===this.value?"":e).slice(0,7);E.isNullOrUndefined(this.initialInputValue)&&(this.initialInputValue=i),this.element.value=i,this.enableOpacity?this.setProperties({value:e},!0):this.setProperties({value:i},!0),this.enableRtl&&t.classList.add("e-rtl"),this.cssClass&&E.addClass([t],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.tileRipple=E.rippleEffect(this.container,{selector:"."+on}),this.ctrlBtnRipple=E.rippleEffect(this.container,{selector:".e-btn"})},S.prototype.getWrapper=function(){return this.element.parentElement},S.prototype.createWidget=function(){"Palette"===this.mode?(this.createPalette(),this.inline||this.firstPaletteFocus()):(this.createPicker(),this.inline||this.getDragHandler().focus()),this.isRgb=!0,this.createInput(),this.createCtrlBtn(),this.disabled||this.wireEvents(),this.inline&&this.disabled&&this.toggleDisabled(!0),E.Browser.isDevice&&this.refreshPopupPos()},S.prototype.createSplitBtn=function(){var e=this,t=this.createElement("button",{className:"e-split-colorpicker"}),i=(this.getWrapper().appendChild(t),this.splitBtn=new I.SplitButton({iconCss:"e-selected-color",target:this.container,disabled:this.disabled,enableRtl:this.enableRtl,createPopupOnClick:this.createPopupOnClick,open:this.onOpen.bind(this),click:function(){var t=new MouseEvent("click",{bubbles:!0,cancelable:!1});e.trigger("change",{currentValue:{hex:e.value.slice(0,7),rgba:e.convertToRgbString(e.hexToRgb(e.value))},previousValue:{hex:null,rgba:null},value:e.value,event:t})}}),this.splitBtn.createElement=this.createElement,this.isAngular&&(this.splitBtn.isAngular=this.isAngular),this.splitBtn.appendTo(t),this.splitBtn.element.setAttribute("aria-label","colorpicker"),this.createElement("span",{className:rn})),t=(E.select(".e-selected-color",t).appendChild(i),i.style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value)),this.getPopupEle());E.addClass([t],"e-colorpicker-popup"),this.cssClass&&(i=this.cssClass.replace(/\s+/g," ").trim().split(" "),t&&E.addClass([t],i),this.splitBtn&&this.splitBtn.activeElem&&this.splitBtn.activeElem[0]&&E.addClass([this.splitBtn.activeElem[0]],i),this.splitBtn&&this.splitBtn.activeElem&&this.splitBtn.activeElem[1]&&E.addClass([this.splitBtn.activeElem[1]],i),this.splitBtn)&&this.splitBtn.element&&this.splitBtn.element.parentElement&&E.addClass([this.splitBtn.element.parentElement],i),E.Browser.isDevice&&!this.createPopupOnClick&&((i=this.getPopupInst()).relateTo=document.body,i.position={X:"center",Y:"center"},i.targetType="container",i.collision={X:"fit",Y:"fit"},i.offsetY=4,t.style.zIndex=h.getZindexPartial(this.splitBtn.element).toString()),this.bindCallBackEvent()},S.prototype.onOpen=function(){var t;this.trigger("open",{element:this.container}),E.Browser.isDevice||(t=this.getPopupInst(),0<h.isCollide(t.element).length&&(t.collision={X:"flip",Y:"fit"},t.position={X:"right",Y:"bottom"},t.targetType="container"))},S.prototype.getPopupInst=function(){return E.getInstance(this.getPopupEle(),h.Popup)},S.prototype.bindCallBackEvent=function(){var a=this;this.splitBtn.beforeOpen=function(s){var n=new I.Deferred;return a.trigger("beforeOpen",s,function(t){var e,i;t.cancel||((e=a.getPopupEle()).style.top=E.formatUnit(0+pageYOffset),e.style.left=E.formatUnit(0+pageXOffset),e.style.display="block",a.createWidget(),e.style.display="",E.Browser.isDevice&&(a.createPopupOnClick&&((i=a.getPopupInst()).relateTo=document.body,i.position={X:"center",Y:"center"},i.targetType="container",i.collision={X:"fit",Y:"fit"},i.offsetY=4,e.style.zIndex=h.getZindexPartial(a.splitBtn.element).toString()),a.modal=a.createElement("div"),a.modal.className="e-"+a.getModuleName()+" e-modal",a.modal.style.display="none",(i=a.getAppendToElement()).insertBefore(a.modal,e),i.className+=" e-colorpicker-overflow",a.modal.style.display="block",a.modal.style.zIndex=(Number(e.style.zIndex)-1).toString())),s.cancel=t.cancel,n.resolve(t)}),n},this.splitBtn.beforeClose=function(e){var t,i=new I.Deferred;return E.isNullOrUndefined(e.event)?i.resolve(e):(t={element:a.container,event:e.event,cancel:!1},a.trigger("beforeClose",t,function(t){E.Browser.isDevice&&e.event.target===a.modal&&(t.cancel=!0),t.cancel||(a.onPopupClose(),"keydown"===e.event.type&&27===e.event.keyCode&&a.splitBtn.element.focus()),e.cancel=t.cancel,i.resolve(t)})),i}},S.prototype.getAppendToElement=function(){if(this.isAngular){var t=this.element.closest(".cdk-overlay-pane"),e=this.element.closest("[popover]");if(t&&e)return t}return document.body},S.prototype.onPopupClose=function(){var t;this.unWireEvents(),this.destroyOtherComp(),this.container.style.width="",E.select("."+rn,this.splitBtn.element).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value)),this.container.innerHTML="",E.removeClass([this.container],[en,tn]),E.Browser.isDevice&&this.modal&&(t=this.getAppendToElement(),E.removeClass([t],"e-colorpicker-overflow"),this.modal.style.display="none",this.modal.outerHTML="",this.modal=null)},S.prototype.createPalette=function(){if(E.classList(this.container,[tn],[en]),this.presetColors){var t=this.createElement("div",{className:"e-custom-palette"}),e=(this.appendElement(t),Object.keys(this.presetColors));if(1===e.length)this.appendPalette(this.presetColors[e[0]],e[0],t);else for(var i=0,s=e.length;i<s;i++)this.appendPalette(this.presetColors[e[i]],e[i],t);10<E.selectAll(".e-row",t).length&&E.addClass([t],"e-palette-group")}else this.appendPalette(hn,"default");"Palette"===this.mode&&!this.modeSwitcher&&this.noColor&&this.setNoColor(),this.showRecentColors&&this.recentColors&&0<this.recentColors.length&&this.renderRecentColor();var n=parseInt(getComputedStyle(this.container).borderBottomWidth,10);this.container.style.width=E.formatUnit(this.container.children[0].offsetWidth+n+n),this.rgb=this.hexToRgb(this.roundValue(this.value)),this.hsv=this.rgbToHsv.apply(this,this.rgb)},S.prototype.renderRecentColor=function(){var i=this,t=this.container.querySelector(".e-clr-pal-rec-wpr"),t=(t&&E.detach(t),this.createElement("div",{className:"e-clr-pal-rec-wpr"})),e=this.container.querySelector(".e-switch-ctrl-btn"),e=(e?this.container.insertBefore(t,e):this.container.appendChild(t),this.createElement("label",{className:"e-recent-clr-span"}));if(e.textContent=this.l10n.getConstant("RecentColors"),t.appendChild(e),0<this.recentColors.length){for(this.recentColors=this.recentColors.filter(function(t,e){return i.recentColors.indexOf(t)===e});10<this.recentColors.length;)this.recentColors.pop();this.appendPalette(this.recentColors,"recent-color",t)}},S.prototype.firstPaletteFocus=function(){E.select("."+ln,this.container.children[0])||E.selectAll("."+Qs,this.container)[0].focus()},S.prototype.appendPalette=function(t,e,i){var s,n,a,l=this.createElement("div",{className:Qs,attrs:{tabindex:"0",role:"grid"}});"recent-color"===e&&l.classList.add("e-recent-palette"),i?i.appendChild(l):this.appendElement(l);for(var r=0,o=t.length;r<o;r++)0!==r&&r%this.columns!=0||(s=this.createElement("div",{className:"e-row",attrs:{role:"row"}}),l.appendChild(s)),a=this.roundValue(t[r]).toLowerCase(),n=this.createElement("span",{className:on,attrs:{role:"gridcell","aria-label":a,"aria-selected":"false"}}),this.trigger("beforeTileRender",{element:n,presetName:e,value:t[r]}),s.appendChild(n),this.value===a&&"recent-color"!==e&&(this.addTileSelection(n),l.focus()),n.style.backgroundColor=this.convertToRgbString(this.hexToRgb(a))},S.prototype.setNoColor=function(){var e=this.container.querySelector(".e-row").children[0];e.classList.add(Js),this.value||(e.classList.add(ln),E.closest(e,"."+Qs).focus()),["aria-selected","aria-label"].forEach(function(t){e.removeAttribute(t)}),e.style.backgroundColor=""},S.prototype.appendElement=function(t,e){e=this.container.children[e=void 0===e?0:e];e?this.container.insertBefore(t,e):this.container.appendChild(t)},S.prototype.addTileSelection=function(t){t&&(t.classList.add(ln),t.setAttribute("aria-selected","true"))},S.prototype.createPicker=function(){E.classList(this.container,[en],[tn]);var t=this.createElement("div",{className:Ys}),e=(this.appendElement(t),t.appendChild(this.createElement("div",{className:Ks})),this.createElement("span",{className:Ws,attrs:{tabindex:"0"}}));t.appendChild(e),null!==this.value&&""!==this.value||(this.value="#008000ff"),this.rgb=this.hexToRgb(this.value),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.setHsvContainerBg(),this.setHandlerPosition(),this.createSlider(),this.createDragTooltip()},S.prototype.setHsvContainerBg=function(t){void 0===t&&(t=this.hsv[0]),this.getHsvContainer().style.backgroundColor=this.convertToRgbString(this.hsvToRgb(t,100,100,1))},S.prototype.getHsvContainer=function(){return E.select("."+Ys,this.container)},S.prototype.setHandlerPosition=function(){var t=this.getDragHandler(),e=E.select("."+Ks,this.container);this.enableRtl?t.style.left=E.formatUnit((e.offsetWidth-t.offsetWidth/2.5)*Math.abs(100-this.hsv[1])/100):t.style.left=E.formatUnit((e.offsetWidth-t.offsetWidth/2.5)*this.hsv[1]/100),t.style.top=E.formatUnit((e.offsetHeight-t.offsetHeight/2.5)*(100-this.hsv[2])/100)},S.prototype.createSlider=function(){var t=this.createElement("div",{className:"e-slider-preview"}),e=(this.appendElement(t,1),this.createPreview(t),this.createElement("div",{className:"e-colorpicker-slider"})),t=(t.insertBefore(e,t.children[0]),this.createElement("div",{className:"e-hue-slider"}));e.appendChild(t),this.hueSlider=new ji({value:this.hsv[0],min:0,max:359,enableRtl:this.enableRtl,enabled:!this.disabled,change:this.hueChange.bind(this)}),this.hueSlider.createElement=this.createElement,this.hueSlider.appendTo(t),this.enableOpacity&&(t=this.createElement("div",{className:"e-opacity-slider"}),e.appendChild(t),this.createOpacitySlider(t))},S.prototype.createOpacitySlider=function(t){this.opacitySlider=new ji({value:100*this.rgb[3],min:0,max:100,enableRtl:this.enableRtl,enabled:!this.disabled,change:this.opacityChange.bind(this)}),this.opacitySlider.createElement=this.createElement,this.opacitySlider.appendTo(t);var e=this.createElement("div",{className:"e-opacity-empty-track"});t.appendChild(e),this.updateOpacitySliderBg()},S.prototype.updateOpacitySliderBg=function(){var t=this.enableRtl?"to left":"to right",e=E.select(".e-opacity-empty-track",this.opacitySlider.element);e&&(e.style.background="linear-gradient("+t+", rgba("+this.rgb.slice(0,3)+", 0) 0%, "+this.convertToRgbString(this.rgb.slice(0,3))+" 100%)")},S.prototype.hueChange=function(t){this.hsv[0]=t.value,this.setHsvContainerBg(),this.convertToOtherFormat()},S.prototype.opacityChange=function(t){var t=t.value,e=this.rgbToHex(this.rgb),i=(this.hsv[3]=t/100,this.rgb[3]=t/100,this.rgbToHex(this.rgb)),t=(this.updateOpacityInput(t),this.convertToRgbString(this.rgb));this.updatePreview(t),this.triggerEvent(i,e,t)},S.prototype.updateOpacityInput=function(t){var e;this.enableOpacity&&!this.getWrapper().classList.contains(_s)&&((e=E.getInstance(E.select("."+$s,this.container),Rt)).value=t,e.dataBind())},S.prototype.createPreview=function(t){var e=this.createElement("div",{className:sn}),t=(t.appendChild(e),this.createElement("span",{className:"e-preview "+Is,attrs:{title:this.l10n.getConstant("CurrentColor")}})),i=(e.appendChild(t),this.convertToRgbString(this.rgb));t.style.backgroundColor=i,t=this.createElement("span",{className:"e-preview "+nn,attrs:{title:this.l10n.getConstant("PreviousColor")}}),e.appendChild(t),t.style.backgroundColor=i},S.prototype.isPicker=function(){return!this.container.classList.contains(tn)},S.prototype.getPopupEle=function(){return this.container.parentElement},S.prototype.createNumericInput=function(t,e,i,s){var n=this,e=new Rt({value:e,placeholder:i,min:0,max:s,format:"###.##",showSpinButton:!1,floatLabelType:"Always",enableRtl:this.enableRtl,enabled:!this.disabled,readonly:!this.isPicker(),change:function(t){t.event&&n.inputHandler(t.event)}});e.createElement=this.createElement,e.appendTo(t)},S.prototype.createInput=function(){var t=this.isPicker(),e=this.getWrapper();if(t&&!e.classList.contains(_s)||!t&&e.classList.contains(an)){var i=this.createElement("div",{className:Zs}),s=(t?this.appendElement(i,2):this.appendElement(i,1),this.createElement("div",{className:"e-input-container"}));if(i.appendChild(s),e.classList.contains(Xs)||this.appendValueSwitchBtn(i),e.classList.contains(zs)||(t=this.createElement("input",{className:"e-hex",attrs:{maxlength:"7",spellcheck:"false","aria-label":"HEX"}}),s.appendChild(t),o.Input.createInput({element:t,floatLabelType:"Always",properties:{placeholder:"HEX",enableRtl:this.enableRtl,enabled:!this.disabled,readonly:!this.isPicker()}},this.createElement),o.Input.setValue(this.value.slice(0,7),t),t.addEventListener("input",this.inputHandler.bind(this))),!e.classList.contains(js)){for(var n=void 0,a=void 0,a=this.isRgb?(n="RGB",this.rgb):(n="HSV",this.hsv),l=["rh","gs","bv"],r=0;r<3;r++)this.createNumericInput(s.appendChild(this.createElement("input",{className:"e-"+l[r]+"-value"})),a[r],n[r],255);this.enableOpacity&&this.appendOpacityValue(s)}}},S.prototype.appendOpacityValue=function(t){this.createNumericInput(t.appendChild(this.createElement("input",{className:$s})),100*this.rgb[3],"A",100)},S.prototype.appendValueSwitchBtn=function(t){var e=this.createElement("button",{className:"e-icons e-css e-btn e-flat e-icon-btn "+Ds,attrs:{title:"Toggle format"}});t.appendChild(e),this.isPicker()&&!this.getWrapper().classList.contains(js)&&e.addEventListener("click",this.formatSwitchHandler.bind(this))},S.prototype.createCtrlBtn=function(){var t,e;(this.modeSwitcher||this.showButtons)&&(this.l10n.setLocale(this.locale),e=this.createElement("div",{className:Vs}),this.container.appendChild(e),this.showButtons&&(t=this.createElement("div",{className:Fs}),e.appendChild(t),e=this.l10n.getConstant("Apply"),t.appendChild(this.createElement("button",{innerHTML:e,className:"e-btn e-css e-flat e-primary e-small "+Rs,attrs:{title:e}})),e=this.l10n.getConstant("Cancel"),t.appendChild(this.createElement("button",{innerHTML:e,className:"e-btn e-css e-flat e-small "+Us,attrs:{title:e}}))),this.modeSwitcher)&&this.appendModeSwitchBtn()},S.prototype.appendModeSwitchBtn=function(){var t=this.createElement("button",{className:"e-icons e-btn e-flat e-icon-btn "+Gs,attrs:{title:this.l10n.getConstant("ModeSwitcher")}});E.select("."+Vs,this.container).insertBefore(t,E.select("."+Fs,this.container))},S.prototype.createDragTooltip=function(){var e=this,t=new h.Tooltip({opensOn:"Custom",showTipPointer:!1,cssClass:"e-color-picker-tooltip",htmlAttributes:{title:"tooltip"},beforeOpen:function(t){e.tooltipEle=t.element},animation:{open:{effect:"None"},close:{effect:"None"}}});t.createElement=this.createElement,t.appendTo(this.container),t.open(this.container),this.tooltipEle.style.zIndex=h.getZindexPartial(this.tooltipEle).toString(),this.tooltipEle.setAttribute("aria-label","colorpicker-tooltip"),E.select(".e-tip-content",this.tooltipEle).appendChild(this.createElement("div",{className:"e-tip-transparent"}))},S.prototype.getTooltipInst=function(){return E.getInstance(this.container,h.Tooltip)},S.prototype.setTooltipOffset=function(t){this.getTooltipInst().offsetY=t},S.prototype.toggleDisabled=function(e){e?this.getWrapper().classList.add(Ms):this.getWrapper().classList.remove(Ms),this.showButtons&&[].slice.call(E.selectAll(".e-btn",this.container)).forEach(function(t){e?E.attributes(t,{disabled:""}):t.removeAttribute("disabled")})},S.prototype.convertToRgbString=function(t){return t.length?4===t.length?"rgba("+t.join()+")":"rgb("+t.join()+")":""},S.prototype.convertToHsvString=function(t){return 4===t.length?"hsva("+t.join()+")":"hsv("+t.join()+")"},S.prototype.updateHsv=function(){this.hsv[1]=100<this.hsv[1]?100:this.hsv[1],this.hsv[2]=100<this.hsv[2]?100:this.hsv[2],this.setHandlerPosition()},S.prototype.convertToOtherFormat=function(t,e){void 0===t&&(t=!1);var i=this.rgbToHex(this.rgb),s=(this.rgb=this.hsvToRgb.apply(this,this.hsv),this.rgbToHex(this.rgb)),n=this.convertToRgbString(this.rgb);this.updatePreview(n),this.updateInput(s),this.triggerEvent(s,i,n,t,e)},S.prototype.updateInput=function(t){var e=this.getWrapper();e.classList.contains(_s)||(e.classList.contains(zs)||o.Input.setValue(t.substr(0,7),E.select(".e-hex",this.container)),e.classList.contains(js))||(this.isRgb?this.updateValue(this.rgb,!1):this.updateValue(this.hsv,!1))},S.prototype.updatePreview=function(t){this.enableOpacity&&this.updateOpacitySliderBg(),E.select(".e-tip-transparent",this.tooltipEle).style.backgroundColor=t,E.select("."+sn+" ."+Is,this.container).style.backgroundColor=t,E.select("."+sn+" ."+nn,this.container).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value))},S.prototype.getDragHandler=function(){return E.select("."+Ws,this.container)},S.prototype.removeTileSelection=function(){[].slice.call(E.selectAll("."+ln,this.container)).forEach(function(t){t.classList.remove(ln),t.setAttribute("aria-selected","false")})},S.prototype.convertRgbToNumberArray=function(t){return t.slice(t.indexOf("(")+1,t.indexOf(")")).split(",").map(function(t,e){return 3!==e?parseInt(t,10):parseFloat(t)})},S.prototype.getValue=function(t,e){var i,s;return t=t||this.value,e=e?e.toLowerCase():"hex","r"===t[0]?(i=this.convertRgbToNumberArray(t),"hex"===e||"hexa"===e?(s=this.rgbToHex(i),"hex"===e?s.slice(0,7):s):"hsv"===e?this.convertToHsvString(this.rgbToHsv.apply(this,i.slice(0,3))):"hsva"===e?this.convertToHsvString(this.rgbToHsv.apply(this,i)):"null"):"h"===t[0]?(i=this.hsvToRgb.apply(this,this.convertRgbToNumberArray(t)),"rgba"===e?this.convertToRgbString(i):"hex"===e||"hexa"===e?(s=this.rgbToHex(i),"hex"===e?s.slice(0,7):s):"rgb"===e?this.convertToRgbString(i.slice(0,3)):"null"):(t=this.roundValue(t),s=this.hexToRgb(t),"rgb"!==e&&"hsv"!==e||(s=s.slice(0,3)),"rgba"===e||"rgb"===e?this.convertToRgbString(s):"hsva"===e||"hsv"===e?this.convertToHsvString(this.rgbToHsv.apply(this,s)):"hex"===e?t.slice(0,7):"a"===e?s[3].toString():"null")},S.prototype.toggle=function(){this.container.parentElement.classList.contains("e-popup-close")?this.splitBtn.toggle():this.closePopup(null)},S.prototype.getModuleName=function(){return"colorpicker"},S.prototype.getPersistData=function(){return this.addOnPersist(["value"])},S.prototype.wireEvents=function(){var t;this.isPicker()?(t=this.getDragHandler(),E.EventHandler.add(t,"keydown",this.pickerKeyDown,this),(t=E.select("."+Fs,this.container))&&E.EventHandler.add(t,"keydown",this.ctrlBtnKeyDown,this),E.EventHandler.add(this.getHsvContainer(),"mousedown touchstart",this.handlerDown,this),(this.modeSwitcher||this.showButtons)&&this.addCtrlSwitchEvent(),E.EventHandler.add(E.select("."+nn,this.container),"click",this.previewHandler,this)):(E.EventHandler.add(this.container,"click",this.paletteClickHandler,this),E.EventHandler.add(this.container,"keydown",this.paletteKeyDown,this))},S.prototype.formResetHandler=function(){this.value=this.initialInputValue,E.attributes(this.element,{value:this.initialInputValue})},S.prototype.addCtrlSwitchEvent=function(){var t=E.select("."+Vs,this.container);t&&E.EventHandler.add(t,"click",this.btnClickHandler,this)},S.prototype.ctrlBtnKeyDown=function(t){13===t.keyCode&&(E.select("."+Rs,this.container)&&(t=this.rgbToHex(this.rgb),this.triggerChangeEvent(t)),this.splitBtn.element.focus())},S.prototype.pickerKeyDown=function(t){switch(t.keyCode){case 39:this.handlerDragPosition(1,this.enableRtl?-1:1,t);break;case 37:this.handlerDragPosition(1,this.enableRtl?1:-1,t);break;case 38:this.handlerDragPosition(2,1,t);break;case 40:this.handlerDragPosition(2,-1,t);break;case 13:t.preventDefault();var e=this.rgbToHex(this.rgb);this.enterKeyHandler(e)}},S.prototype.enterKeyHandler=function(t){this.triggerChangeEvent(t),!this.inline&&this.splitBtn&&this.splitBtn.element.focus()},S.prototype.closePopup=function(t){var e=this,t={element:this.container,event:t,cancel:!1};this.trigger("beforeClose",t,function(t){t.cancel||(e.splitBtn.toggle(),e.onPopupClose())})},S.prototype.triggerChangeEvent=function(t,e){var i=t.slice(0,7);this.trigger("change",{currentValue:{hex:i,rgba:this.convertToRgbString(this.rgb)},event:e,previousValue:{hex:this.value.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(this.value))},value:this.enableOpacity?t:i}),this.showRecentColors&&(this.recentColors.unshift(i),this.inline)&&this.renderRecentColor(),this.enableOpacity?this.setProperties({value:t},!0):this.setProperties({value:i},!0),this.element.value=i||"#000000"},S.prototype.handlerDragPosition=function(t,e,i){i.preventDefault(),this.hsv[t]+=e*(i.ctrlKey?1:3),this.hsv[t]<0&&(this.hsv[t]=0),this.updateHsv(),this.convertToOtherFormat(!0,i)},S.prototype.handlerDown=function(t){t.preventDefault(),"mousedown"===t.type?(this.clientX=Math.abs(t.pageX-pageXOffset),this.clientY=Math.abs(t.pageY-pageYOffset),this.setTooltipOffset(8)):(this.clientX=Math.abs(t.changedTouches[0].pageX-pageXOffset),this.clientY=Math.abs(t.changedTouches[0].pageY-pageYOffset),this.setTooltipOffset(-8)),this.setHsv(this.clientX,this.clientY),this.getDragHandler().style.transition="left .4s cubic-bezier(.25, .8, .25, 1), top .4s cubic-bezier(.25, .8, .25, 1)",this.updateHsv(),this.convertToOtherFormat(!1,t),this.getDragHandler().focus(),E.EventHandler.add(document,"mousemove touchmove",this.handlerMove,this),E.EventHandler.add(document,"mouseup touchend",this.handlerEnd,this)},S.prototype.handlerMove=function(t){"touchmove"!==t.type&&t.preventDefault(),i="mousemove"===t.type?(e=Math.abs(t.pageX-pageXOffset),Math.abs(t.pageY-pageYOffset)):(e=Math.abs(t.changedTouches[0].pageX-pageXOffset),Math.abs(t.changedTouches[0].pageY-pageYOffset)),this.setHsv(e,i);var e,i,s=this.getDragHandler();this.updateHsv(),this.convertToOtherFormat(!1,t),this.getTooltipInst().refresh(s),this.tooltipEle.style.transform||(8<Math.abs(this.clientX-e)||8<Math.abs(this.clientY-i))&&(E.select("."+Ks,this.container).style.cursor="pointer",s.style.transition="none",this.inline||(this.tooltipEle.style.zIndex=(parseInt(this.getPopupEle().style.zIndex,10)+1).toString()),this.tooltipEle.style.transform="rotate(45deg)",s.classList.add("e-hide-handler"))},S.prototype.setHsv=function(t,e){var i=E.select("."+Ks,this.container),s=i.getBoundingClientRect();t=this.enableRtl?t>s.right?0:Math.abs(t-s.right):t>s.left?Math.abs(t-s.left):0,e=e>s.top?Math.abs(e-s.top):0,this.hsv[2]=Math.round(10*Number(100*(i.offsetHeight-Math.max(0,Math.min(i.offsetHeight,e-i.offsetTop)))/i.offsetHeight))/10,this.hsv[1]=Math.round(10*Number(100*Math.max(0,Math.min(i.offsetWidth,t-i.offsetLeft))/i.offsetWidth))/10},S.prototype.handlerEnd=function(t){"touchend"!==t.type&&t.preventDefault(),E.EventHandler.remove(document,"mousemove touchmove",this.handlerMove),E.EventHandler.remove(document,"mouseup touchend",this.handlerEnd);var e=this.getDragHandler();E.select("."+Ks,this.container).style.cursor="",this.tooltipEle.style.transform&&(this.tooltipEle.style.transform="",e.classList.remove("e-hide-handler")),this.inline||this.showButtons||this.closePopup(t)},S.prototype.btnClickHandler=function(t){var e=t.target;E.closest(e,"."+Gs)?(t.stopPropagation(),this.switchToPalette()):(e.classList.contains(Rs)||e.classList.contains(Us))&&this.ctrlBtnClick(e,t)},S.prototype.switchToPalette=function(){this.trigger("beforeModeSwitch",{element:this.container,mode:"Palette"}),this.unWireEvents(),this.destroyOtherComp(),E.detach(E.select(".e-slider-preview",this.container)),this.getWrapper().classList.contains(_s)||E.remove(E.select("."+Zs,this.container)),E.detach(this.getHsvContainer()),this.createPalette(),this.firstPaletteFocus(),this.createInput(),this.refreshPopupPos(),this.element.parentElement&&this.element.parentElement.parentElement&&this.element.parentElement.parentElement.classList.contains("e-ie-ddb-popup")&&this.refreshImageEditorPopupPos(),this.wireEvents(),this.trigger("onModeSwitch",{element:this.container,mode:"Palette"})},S.prototype.refreshImageEditorPopupPos=function(){var t,e;E.Browser.isDevice&&((t=this.getPopupEle()).style.left=E.formatUnit(0+pageXOffset),t.style.top=E.formatUnit(0+pageYOffset),e=document.querySelector("#"+this.element.parentElement.parentElement.id.split("-popup")[0]))&&t.parentElement.ej2_instances[0].refreshPosition(e)},S.prototype.refreshPopupPos=function(){var t;this.inline||((t=this.getPopupEle()).style.left=E.formatUnit(0+pageXOffset),t.style.top=E.formatUnit(0+pageYOffset),this.getPopupInst().refreshPosition(this.splitBtn.element.parentElement))},S.prototype.formatSwitchHandler=function(){this.isRgb?(this.updateValue(this.hsv,!0,3,[360,100,100]),this.isRgb=!1):(this.updateValue(this.rgb,!0,2),this.isRgb=!0)},S.prototype.updateValue=function(t,e,i,s){for(var n,a=["e-rh-value","e-gs-value","e-bv-value"],l=0,r=a.length;l<r;l++)(n=E.getInstance(E.select("."+a[l],this.container),Rt)).value=Math.round(t[l]),e&&(n.placeholder=a[l].substr(i,1).toUpperCase(),n.max=s?s[l]:255),n.dataBind()},S.prototype.previewHandler=function(t){var e=t.target,i=this.rgbToHex(this.rgb),e=(this.rgb=this.convertRgbToNumberArray(e.style.backgroundColor),this.rgb[3]||(this.rgb[3]=1),this.rgbToHex(this.rgb)),s=this.rgbToHsv.apply(this,this.rgb);s[0]!==this.hsv[0]&&(this.hueSlider.setProperties({value:s[0]},!0),this.hueSlider.refresh()),this.setHsvContainerBg(s[0]),this.enableOpacity&&s[3]!==this.hsv[3]&&(this.opacitySlider.setProperties({value:100*s[3]},!0),this.opacitySlider.refresh(),this.updateOpacitySliderBg()),this.hsv=s,this.setHandlerPosition(),this.updateInput(e),E.select("."+sn+" ."+Is,this.container).style.backgroundColor=this.convertToRgbString(this.rgb),this.triggerEvent(e,i,this.convertToRgbString(this.rgb),!1,t)},S.prototype.paletteClickHandler=function(t){t.preventDefault();var e,i,s=t.target;s.classList.contains(on)?(this.removeTileSelection(),this.addTileSelection(s),s.classList.contains(Js)?this.noColorTile():(e=s.getAttribute("aria-label"),i=this.rgbToHex(this.rgb),this.rgb=this.hexToRgb(this.roundValue(e)),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.getWrapper().classList.contains(an)&&this.updateInput(e),this.triggerEvent(e,i,this.convertToRgbString(this.rgb),!1,t)),this.inline||this.showButtons||this.closePopup(t)):E.closest(s,"."+Gs)?this.switchToPicker():s.classList.contains(Rs)||s.classList.contains(Us)?this.ctrlBtnClick(s,t):this.getWrapper().classList.contains(an)&&E.closest(s,"."+Ds)&&this.formatSwitchHandler()},S.prototype.noColorTile=function(t){void 0===t&&(t=!1);var e=this.rgbToHex(this.rgb);this.rgb=[],this.hsv=[],this.triggerEvent("",e,"",t)},S.prototype.switchToPicker=function(){var t=this.getWrapper(),t=(this.trigger("beforeModeSwitch",{element:this.container,mode:"Picker"}),this.unWireEvents(),[].slice.call(E.selectAll("."+Qs,this.container)).forEach(function(t){E.detach(t)}),this.container.querySelector(".e-clr-pal-rec-wpr")&&E.detach(this.container.querySelector(".e-clr-pal-rec-wpr")),t.classList.contains(an)&&E.detach(E.select("."+Zs,this.container)),this.container.style.width="",E.select(".e-custom-palette",this.container));this.presetColors&&E.remove(t),this.createPicker(),this.getDragHandler().focus(),this.createInput(),this.refreshPopupPos(),this.element.parentElement&&this.element.parentElement.parentElement&&this.element.parentElement.parentElement.classList.contains("e-ie-ddb-popup")&&this.refreshImageEditorPopupPos(),this.wireEvents(),this.trigger("onModeSwitch",{element:this.container,mode:"Picker"})},S.prototype.ctrlBtnClick=function(t,e){var i;t.classList.contains(Rs)&&(i=this.rgbToHex(this.rgb),this.triggerChangeEvent(i,e)),!this.inline&&this.splitBtn?(this.closePopup(e),this.splitBtn.element.focus()):t.classList.contains(Us)&&(i={element:this.container,event:e,cancel:!1},this.trigger("beforeClose",i))},S.prototype.paletteKeyDown=function(t){var e=t.target;if(e.classList.contains(Qs)){var i,s,n=[].slice.call(E.selectAll("."+on,e)),a=n.filter(function(t){return t.classList.contains("e-selected")}).pop();switch(!t.altKey&&t.keyCode){case 39:t.preventDefault(),s=(!a||!(!this.enableRtl&&n.indexOf(a)===n.length-1||this.enableRtl&&0===n.indexOf(a)))&&a?this.tilePosition(n,a,this.enableRtl?-1:1):this.enableRtl?n.length-1:0,n[s]&&(i=n[s]),this.keySelectionChanges(i);break;case 37:t.preventDefault(),s=(!a||!(!this.enableRtl&&0===n.indexOf(a)||this.enableRtl&&n.indexOf(a)===n.length-1))&&a?this.tilePosition(n,a,this.enableRtl?1:-1):this.enableRtl?0:n.length-1,n[s]&&(i=n[s]),this.keySelectionChanges(i);break;case 38:t.preventDefault(),i=n[s=a?this.tilePosition(n,a,-this.columns):0]||n[s-this.columns],this.keySelectionChanges(i);break;case 40:t.preventDefault(),i=n[s=a?this.tilePosition(n,a,this.columns):n.length-1]||n[s=(s%=n.length)+n[n.length-1].parentElement.childElementCount],this.keySelectionChanges(i);break;case 13:t.preventDefault(),a&&(s=a.getAttribute("aria-label"),this.enterKeyHandler(s||""))}}},S.prototype.keySelectionChanges=function(t){var e;this.removeTileSelection(),this.addTileSelection(t),t.classList.contains(Js)?this.noColorTile(!0):(t=t.getAttribute("aria-label"),e=this.rgbToHex(this.rgb),this.rgb=this.hexToRgb(t),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.getWrapper().classList.contains(an)&&this.updateInput(t),this.triggerEvent(t,e,this.convertToRgbString(this.rgb),!0))},S.prototype.tilePosition=function(t,e,i){var s=(t=Array.prototype.slice.call(t)).length,n=this.columns-t[s-1].parentElement.childElementCount,t=t.indexOf(e);return(t+=i)<0?t+=s+n:t%=s+n,t},S.prototype.inputHandler=function(t){var e,i,s=t.target;if(s.value.length)switch(E.select(".e-float-text",s.parentElement).textContent){case"HEX":var n="";if(9!==(n="#"===s.value[0]&&5!==s.value.length||"#"!==s.value[0]&&4!==s.value.length?this.roundValue(s.value):n).length)return;i=this.rgbToHex(this.rgb),this.rgb=this.hexToRgb(n+n.substr(-2)),this.inputValueChange(this.rgbToHsv.apply(this,this.rgb),i,s.value,t);break;case"R":this.rgb[0]!==Number(s.value)&&(i=this.rgbToHex(this.rgb),this.rgb[0]=Number(s.value),e=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(e,i,null,t));break;case"G":this.rgb[1]!==Number(s.value)&&(i=this.rgbToHex(this.rgb),this.rgb[1]=Number(s.value),e=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(e,i,null,t));break;case"B":this.rgb[2]!==Number(s.value)&&(i=this.rgbToHex(this.rgb),this.rgb[2]=Number(s.value),e=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(e,i,null,t));break;case"H":this.hueSlider.value=Number(s.value);break;case"S":this.hsv[1]!==Number(s.value)&&(this.hsv[1]=Number(s.value),this.updateHsv(),this.convertToOtherFormat(!1,t));break;case"V":this.hsv[2]!==Number(s.value)&&(this.hsv[2]=Number(s.value),this.updateHsv(),this.convertToOtherFormat(!1,t));break;case"A":this.opacitySlider.value=Number(s.value)}},S.prototype.inputValueChange=function(t,e,i,s){t[0]!==this.hsv[0]&&(this.hueSlider.setProperties({value:t[0]},!0),this.hueSlider.refresh(),this.setHsvContainerBg(t[0])),this.hsv=t;t=this.rgbToHex(this.rgb),this.setHandlerPosition(),this.updateInput(i||t),i=this.convertToRgbString(this.rgb);this.updatePreview(i),this.triggerEvent(t,e,i,!1,s)},S.prototype.triggerEvent=function(t,e,i,s,n){void 0===s&&(s=!1);var a=t.slice(0,7);E.isNullOrUndefined(n)&&(n=new MouseEvent("click",{bubbles:!0,cancelable:!1})),this.showButtons||s?this.trigger("select",{currentValue:{hex:a,rgba:i},event:n,previousValue:{hex:e.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(e))}}):(this.trigger("change",{currentValue:{hex:a,rgba:i},event:n,previousValue:{hex:this.value.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(this.value))},value:t}),this.showRecentColors&&(this.recentColors.unshift(a),this.inline)&&this.renderRecentColor(),this.enableOpacity?this.setProperties({value:t},!0):this.setProperties({value:a},!0),this.element.value=a||"#000000")},S.prototype.destroy=function(){var e=this,t=this.getWrapper();Bs.prototype.destroy.call(this),["tabindex","spellcheck"].forEach(function(t){e.element.removeAttribute(t)}),this.inline?(this.unWireEvents(),this.destroyOtherComp()):(this.isPopupOpen()&&(this.unWireEvents(),this.destroyOtherComp()),delete this.splitBtn.beforeClose,delete this.splitBtn.beforeOpen,delete this.splitBtn.click,delete this.splitBtn.open,this.splitBtn.destroy(),this.splitBtn=null),this.tileRipple(),this.tileRipple=null,this.ctrlBtnRipple(),this.ctrlBtnRipple=null,this.element.nextElementSibling&&E.detach(this.element.nextElementSibling),t&&(t.parentElement.insertBefore(this.element,t),E.detach(t)),this.container=null,this.formElement&&E.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},S.prototype.destroyOtherComp=function(){if(this.isPicker()){for(var t=E.closest(this.hueSlider.element,".e-color-picker").querySelectorAll(".e-numerictextbox"),e=0;e<t.length;e++)E.getInstance(t[e],Rt).destroy();this.hueSlider.destroy(),this.enableOpacity&&(this.opacitySlider.destroy(),this.opacitySlider=null),this.hueSlider=null;var i=this.getTooltipInst();i.close(),i.destroy(),this.tooltipEle=null}},S.prototype.isPopupOpen=function(){return this.getPopupEle().classList.contains("e-popup-open")},S.prototype.unWireEvents=function(){var t;this.isPicker()?(t=this.getDragHandler(),E.EventHandler.remove(t,"keydown",this.pickerKeyDown),(t=E.select("."+Fs,this.container))&&E.EventHandler.remove(t,"keydown",this.ctrlBtnKeyDown),E.EventHandler.remove(this.getHsvContainer(),"mousedown touchstart",this.handlerDown),(this.modeSwitcher||this.showButtons)&&E.EventHandler.remove(E.select("."+Vs,this.container),"click",this.btnClickHandler),E.EventHandler.remove(E.select("."+nn,this.container),"click",this.previewHandler)):(E.EventHandler.remove(this.container,"click",this.paletteClickHandler),E.EventHandler.remove(this.container,"keydown",this.paletteKeyDown))},S.prototype.roundValue=function(t){if(!t)return"";var e=(t="#"!==t[0]?"#"+t:t).length;if(4===e&&(t+="f",e=5),5===e){for(var i="",s=1,n=t.length;s<n;s++)i+=t.charAt(s)+t.charAt(s);t="#"+i,e=9}return 7===e&&(t+="ff"),t},S.prototype.hexToRgb=function(t){if(!t)return[];9!==(t=t.trim()).length&&(t=this.roundValue(t));var e=Number((parseInt(t.slice(-2),16)/255).toFixed(2)),t=(t=t.slice(1,7),parseInt(t,16)),i=[];return i.push(t>>16&255),i.push(t>>8&255),i.push(255&t),i.push(e),i},S.prototype.rgbToHsv=function(t,e,i,s){if(this.rgb&&!this.rgb.length)return[];t/=255,e/=255,i/=255;var n,a=Math.max(t,e,i),l=Math.min(t,e,i),r=a,o=a-l,h=0===a?0:o/a;if(a===l)n=0;else{switch(a){case t:n=(e-i)/o+(e<i?6:0);break;case e:n=(i-t)/o+2;break;case i:n=(t-e)/o+4}n/=6}l=[Math.round(360*n),Math.round(1e3*h)/10,Math.round(1e3*r)/10];return E.isNullOrUndefined(s)||l.push(s),l},S.prototype.hsvToRgb=function(t,e,i,s){var n,a,l;if(i/=100,0===(e/=100))return n=a=l=i,[Math.round(255*n),Math.round(255*a),Math.round(255*l),s];t/=60;var r=Math.floor(t),t=t-r,o=i*(1-e),h=i*(1-e*t),p=i*(1-e*(1-t));switch(r){case 0:n=i,a=p,l=o;break;case 1:n=h,a=i,l=o;break;case 2:n=o,a=i,l=p;break;case 3:n=o,a=h,l=i;break;case 4:n=p,a=o,l=i;break;default:n=i,a=o,l=h}e=[Math.round(255*n),Math.round(255*a),Math.round(255*l)];return E.isNullOrUndefined(s)||e.push(s),e},S.prototype.rgbToHex=function(t){return t.length?"#"+this.hex(t[0])+this.hex(t[1])+this.hex(t[2])+(E.isNullOrUndefined(t[3])?"":0!==t[3]?(Math.round(255*t[3])+65536).toString(16).substr(-2):"00"):""},S.prototype.hex=function(t){return("0"+t.toString(16)).slice(-2)},S.prototype.changeModeSwitcherProp=function(t){var e=E.select("."+Vs,this.container);t?e?this.appendModeSwitchBtn():(this.createCtrlBtn(),this.isPicker()&&!this.disabled&&this.addCtrlSwitchEvent()):e&&(this.showButtons?E.detach(E.select("."+Gs,e)):E.remove(e))},S.prototype.changeShowBtnProps=function(t){var e=E.select("."+Vs,this.container);t?(e&&E.remove(e),this.createCtrlBtn(),this.isPicker()&&!this.disabled&&this.addCtrlSwitchEvent()):this.modeSwitcher?E.detach(E.select("."+Fs,e)):E.remove(e)},S.prototype.changeValueProp=function(t){this.isPicker()?(this.rgb=this.hexToRgb(t),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.setHandlerPosition(),E.detach(E.closest(this.hueSlider.element,".e-slider-preview")),this.createSlider(),this.setHsvContainerBg(),this.updateInput(t),4===this.rgb.length&&this.updateOpacityInput(100*this.rgb[3])):(this.removeTileSelection(),(t=this.container.querySelector('span[aria-label="'+this.roundValue(t)+'"]'))&&this.addTileSelection(t))},S.prototype.setInputEleProps=function(){E.remove(E.select("."+Zs,this.container)),this.createInput()},S.prototype.changeDisabledProp=function(t){this.isPicker()&&(this.hueSlider.enabled=!t,this.opacitySlider.enabled=!t,this.setInputEleProps()),t?(this.toggleDisabled(!0),this.unWireEvents()):(this.toggleDisabled(!1),this.wireEvents())},S.prototype.changeCssClassProps=function(t,e){var i=this.getWrapper(),s=this.getPopupEle();e&&(E.removeClass([i,s],e.split(" ")),this.splitBtn&&this.splitBtn.activeElem&&this.splitBtn.activeElem[0]&&this.splitBtn.activeElem[1]&&E.removeClass([this.splitBtn.activeElem[0],this.splitBtn.activeElem[1]],e.split(" ")),this.splitBtn)&&this.splitBtn.element&&this.splitBtn.element.parentElement&&E.removeClass([this.splitBtn.element.parentElement],e.split(" ")),t&&(E.addClass([i,s],t.replace(/\s+/g," ").trim().split(" ")),this.splitBtn&&this.splitBtn.activeElem&&this.splitBtn.activeElem[0]&&this.splitBtn.activeElem[1]&&E.addClass([this.splitBtn.activeElem[0],this.splitBtn.activeElem[1]],t.replace(/\s+/g," ").trim().split(" ")),this.splitBtn)&&this.splitBtn.element&&this.splitBtn.element.parentElement&&E.addClass([this.splitBtn.element.parentElement],t.replace(/\s+/g," ").trim().split(" "))},S.prototype.changeRtlProps=function(t){t?E.addClass([this.getWrapper()],"e-rtl"):E.removeClass([this.getWrapper()],"e-rtl")},S.prototype.changePaletteProps=function(){E.detach(this.container.children[0]),this.container.style.width="",this.createPalette()},S.prototype.changeOpacityProps=function(t){var e=this.getWrapper();t?(E.removeClass([this.container.parentElement],qs),this.createOpacitySlider(E.select(".e-colorpicker-slider",this.container).appendChild(this.createElement("div",{className:"e-opacity-slider"}))),e.classList.contains(_s)||e.classList.contains(js)||this.appendOpacityValue(E.select(".e-input-container",this.container))):(E.addClass([this.container.parentElement],qs),this.opacitySlider.destroy(),E.remove(this.opacitySlider.element),this.opacitySlider=null,e.classList.contains(_s)||e.classList.contains(js)||E.remove(E.select("."+$s,this.container).parentElement))},S.prototype.onPropertyChanged=function(s,n){var t,e,a=this;if(E.isNullOrUndefined(s.value)||(9===(t=this.roundValue(s.value)).length?(this.element.value=this.roundValue(t).slice(0,7),(e=this.splitBtn&&E.select("."+rn,this.splitBtn.element))&&(e.style.backgroundColor=this.convertToRgbString(this.hexToRgb(s.value)))):this.noColor&&"Palette"===this.mode&&""===this.value?(e=this.splitBtn&&E.select("."+rn,this.splitBtn.element)).style.backgroundColor="":this.value=n.value),!this.inline&&E.isNullOrUndefined(s.inline))if(this.splitBtn.setProperties(I.getModel(s,["disabled","enableRtl"])),!this.isPopupOpen())return this.changeCssClassProps(s.cssClass,n.cssClass),void this.changeRtlProps(s.enableRtl);for(var l=this,i=0,r=Object.keys(s);i<r.length;i++)!function(t){switch(t){case"inline":s.inline?(l.getWrapper().appendChild(l.container),l.splitBtn.destroy(),E.detach(l.element.nextElementSibling),l.container.children.length||l.createWidget()):(l.destroyOtherComp(),l.unWireEvents(),l.container.innerHTML="",l.createSplitBtn());break;case"cssClass":l.changeCssClassProps(s.cssClass,n.cssClass);var e=(e=s.cssClass.split(" ").concat(n.cssClass.split(" "))).reduce(function(t,e){return t.indexOf(e)<0&&t.push(e),t},[]),i=0;e.forEach(function(t){0!==i||t!==_s&&t!==Xs&&t!==an&&t!==zs&&t!==js||(E.select("."+Zs,a.container)&&E.remove(E.select("."+Zs,a.container)),a.createInput(),i++)});break;case"enableRtl":l.isPicker()&&(l.hueSlider.enableRtl=s.enableRtl,l.enableOpacity&&(l.opacitySlider.enableRtl=s.enableRtl),l.setInputEleProps()),l.changeRtlProps(s.enableRtl);break;case"disabled":l.changeDisabledProp(s.disabled);break;case"value":l.value!==n.value&&l.changeValueProp(s.value);break;case"showButtons":l.changeShowBtnProps(s.showButtons);break;case"mode":"Picker"===s.mode?l.switchToPicker():l.switchToPalette();break;case"modeSwitcher":l.changeModeSwitcherProp(s.modeSwitcher);break;case"columns":case"presetColors":l.isPicker()||l.changePaletteProps();break;case"noColor":s.noColor?"Palette"!==l.mode||l.modeSwitcher||l.setNoColor():l.changePaletteProps();break;case"enableOpacity":l.changeOpacityProps(s.enableOpacity);break;case"showRecentColors":s.showRecentColors||(e=l.container.querySelector(".e-clr-pal-rec-wpr"))&&E.detach(e),l.recentColors=[]}}(r[i])},S.prototype.focusIn=function(){this.element.parentElement.focus()},x([E.Property("#008000ff")],S.prototype,"value",void 0),x([E.Property("")],S.prototype,"cssClass",void 0),x([E.Property(!1)],S.prototype,"disabled",void 0),x([E.Property("Picker")],S.prototype,"mode",void 0),x([E.Property(!0)],S.prototype,"modeSwitcher",void 0),x([E.Property(null)],S.prototype,"presetColors",void 0),x([E.Property(!0)],S.prototype,"showButtons",void 0),x([E.Property(10)],S.prototype,"columns",void 0),x([E.Property(!1)],S.prototype,"inline",void 0),x([E.Property(!1)],S.prototype,"noColor",void 0),x([E.Property(!1)],S.prototype,"enablePersistence",void 0),x([E.Property(!0)],S.prototype,"enableOpacity",void 0),x([E.Property(!1)],S.prototype,"createPopupOnClick",void 0),x([E.Property(!1)],S.prototype,"showRecentColors",void 0),x([E.Event()],S.prototype,"select",void 0),x([E.Event()],S.prototype,"change",void 0),x([E.Event()],S.prototype,"beforeTileRender",void 0),x([E.Event()],S.prototype,"beforeOpen",void 0),x([E.Event()],S.prototype,"open",void 0),x([E.Event()],S.prototype,"beforeClose",void 0),x([E.Event()],S.prototype,"beforeModeSwitch",void 0),x([E.Event()],S.prototype,"onModeSwitch",void 0),x([E.Event()],S.prototype,"created",void 0),x([E.NotifyPropertyChanges],S));function S(t,e){t=Bs.call(this,t,e)||this;return t.recentColors=[],t}pn=function(t,e){return(pn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var pn,dn,x=function(t,e){function i(){this.constructor=t}pn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},T=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},x=(dn=E.Component,x(P,dn),P.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"floatLabelType":o.Input.removeFloating(this.textboxWrapper),o.Input.addFloating(this.respectiveElement,this.floatLabelType,this.placeholder);break;case"enabled":o.Input.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container),this.bindClearEvent();break;case"width":o.Input.setWidth(t.width,this.textboxWrapper.container);break;case"maxLength":this.maxLength&&this.element.setAttribute("maxlength",this.maxLength.toString());break;case"value":var n=this.isProtectedOnChange;this.isProtectedOnChange=!0,o.Input.isBlank(this.value)||(this.value=this.value.toString()),this.isProtectedOnChange=n,o.Input.setValue(this.value,this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value),this.inputPreviousValue=this.respectiveElement.value,(this.isAngular||this.isVue)&&!0===this.preventChange?(this.previousValue=this.isAngular?this.value:this.previousValue,this.preventChange=!1):(E.isNullOrUndefined(this.isAngular)||!this.isAngular||this.isAngular&&!this.preventChange||this.isAngular&&E.isNullOrUndefined(this.preventChange))&&this.raiseChangeEvent();break;case"htmlAttributes":this.updateHTMLAttributesToElement(),this.updateHTMLAttributesToWrapper(),this.checkAttributes(!0),this.multiline&&!E.isNullOrUndefined(this.textarea)?o.Input.validateInputType(this.textboxWrapper.container,this.textarea):o.Input.validateInputType(this.textboxWrapper.container,this.element);break;case"readonly":o.Input.setReadonly(this.readonly,this.respectiveElement);break;case"type":"TEXTAREA"!==this.respectiveElement.tagName&&(this.respectiveElement.setAttribute("type",this.type),o.Input.validateInputType(this.textboxWrapper.container,this.element),this.raiseChangeEvent());break;case"showClearButton":o.Input.setClearButton(this.showClearButton,this.respectiveElement,this.textboxWrapper),this.bindClearEvent();break;case"enableRtl":o.Input.setEnableRtl(this.enableRtl,[this.textboxWrapper.container]),this.handleFloatLabel();break;case"placeholder":o.Input.setPlaceholder(this.placeholder,this.respectiveElement,this.getModuleName()),o.Input.calculateWidth(this.respectiveElement,this.textboxWrapper.container);break;case"autocomplete":"on"!==this.autocomplete&&""!==this.autocomplete?this.respectiveElement.autocomplete=this.autocomplete:this.removeAttributes(["autocomplete"]);break;case"cssClass":o.Input.updateCssClass(t.cssClass,e.cssClass,this.textboxWrapper.container);break;case"locale":this.globalize=new E.Internationalization(this.locale),this.l10n.setLocale(this.locale);n=""===this.l10n.getConstant("placeholder")?this.placeholder:this.l10n.getConstant("placeholder");this.setProperties({placeholder:n},!0),o.Input.setPlaceholder(this.placeholder,this.respectiveElement);break;case"prependTemplate":this.updatePrependTemplate();break;case"appendTemplate":this.updateAppendTemplate()}},P.prototype.getModuleName=function(){return"textbox"},P.prototype.preRender=function(){if(this.cloneElement=this.element.cloneNode(!0),this.formElement=E.closest(this.element,"form"),E.isNullOrUndefined(this.formElement)||(this.isForm=!0),"EJS-TEXTBOX"===this.element.tagName){for(var t=E.getValue("ej2_instances",this.element),e=this.multiline?this.createElement("textarea"):this.createElement("input"),i=0;i<this.element.attributes.length;i++)"id"!==(n=this.element.attributes[i].nodeName)&&"class"!==n?(e.setAttribute(n,this.element.attributes[i].nodeValue),e.innerHTML=this.element.innerHTML,"name"===n&&this.element.removeAttribute("name")):"class"===n&&e.setAttribute(n,this.element.className.split(" ").filter(function(t){return 0!==t.indexOf("ng-")}).join(" "));this.element.appendChild(e),this.element=e,E.setValue("ej2_instances",t,this.element)}this.updateHTMLAttributesToElement(),this.checkAttributes(!1),!E.isNullOrUndefined(this.textboxOptions)&&void 0!==this.textboxOptions.value||""===this.element.value||this.setProperties({value:this.element.value},!0),"TEXTAREA"!==this.element.tagName&&this.element.setAttribute("type",this.type),("text"===this.type||"INPUT"===this.element.tagName&&this.multiline&&this.isReact)&&this.element.setAttribute("role","textbox"),this.globalize=new E.Internationalization(this.locale);t={placeholder:this.placeholder};if(this.l10n=new E.L10n("textbox",t,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.element.hasAttribute("id")||this.element.setAttribute("id",E.getUniqueID("textbox")),this.element.hasAttribute("name")||this.element.setAttribute("name",this.element.getAttribute("id")),this.maxLength&&this.element.setAttribute("maxlength",this.maxLength.toString()),"INPUT"===this.element.tagName&&this.multiline){this.isHiddenInput=!0,this.textarea=this.createElement("textarea"),this.element.parentNode.insertBefore(this.textarea,this.element),this.element.setAttribute("type","hidden"),this.textarea.setAttribute("name",this.element.getAttribute("name")),this.element.removeAttribute("name"),this.textarea.setAttribute("role",this.element.getAttribute("role")),this.element.removeAttribute("role"),this.textarea.setAttribute("id",E.getUniqueID("textarea"));for(var s=["placeholder","disabled","value","readonly","type","autocomplete"],i=0;i<this.element.attributes.length;i++){var n=this.element.attributes[i].nodeName;this.element.hasAttribute(n)&&D.indexOf(n)<0&&"id"!==n&&"type"!==n&&"e-mappinguid"!==n&&(this.textarea.setAttribute(n,this.element.attributes[i].nodeValue),s.indexOf(n)<0)&&(this.element.removeAttribute(n),i--)}}},P.prototype.checkAttributes=function(t){for(var e=0,i=t?E.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly","type","autocomplete"];e<i.length;e++){var s,n,a=i[e];if(!E.isNullOrUndefined(this.element.getAttribute(a)))switch(a){case"disabled":(E.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.enabled||t)&&(s="disabled"!==this.element.getAttribute(a)&&""!==this.element.getAttribute(a)&&"true"!==this.element.getAttribute(a),this.setProperties({enabled:s},!t));break;case"readonly":(E.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.readonly||t)&&(s="readonly"===this.element.getAttribute(a)||""===this.element.getAttribute(a)||"true"===this.element.getAttribute(a),this.setProperties({readonly:s},!t));break;case"placeholder":(E.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"autocomplete":(E.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.autocomplete||t)&&(n="off"===this.element.autocomplete?"off":"on",this.setProperties({autocomplete:n},!t));break;case"value":(E.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.value||t)&&""!==this.element.value&&this.setProperties({value:this.element.value},!t);break;case"type":(E.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.type||t)&&this.setProperties({type:this.element.type},!t)}}},P.prototype.render=function(){var t=this.cssClass;E.isNullOrUndefined(this.cssClass)||""===this.cssClass||(t=o.Input.getInputValidClassList(this.cssClass)),this.respectiveElement=this.isHiddenInput?this.textarea:this.element,this.textboxWrapper=o.Input.createInput({element:this.respectiveElement,floatLabelType:this.floatLabelType,properties:{enabled:this.enabled,enableRtl:this.enableRtl,cssClass:t,readonly:this.readonly,placeholder:this.placeholder,showClearButton:this.showClearButton}}),this.updateHTMLAttributesToWrapper(),this.isHiddenInput&&this.respectiveElement.parentNode.insertBefore(this.element,this.respectiveElement),this.wireEvents(),E.isNullOrUndefined(this.value)||(o.Input.setValue(this.value,this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value)),E.isNullOrUndefined(this.value)||(this.initialValue=this.value,this.setInitialValue()),"on"!==this.autocomplete&&""!==this.autocomplete?this.respectiveElement.autocomplete=this.autocomplete:E.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.autocomplete||this.removeAttributes(["autocomplete"]),this.previousValue=this.value,this.inputPreviousValue=this.value,this.respectiveElement.defaultValue=this.respectiveElement.value,o.Input.setWidth(this.width,this.textboxWrapper.container),!E.isNullOrUndefined(E.closest(this.element,"fieldset"))&&E.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.element.hasAttribute("aria-labelledby")||this.element.hasAttribute("placeholder")||this.element.hasAttribute("aria-label")||this.element.setAttribute("aria-label","textbox"),this.createPrependTemplate(),this.createAppendTemplate(),this.multiline&&"Auto"===this.floatLabelType&&(this.prependTemplate||this.appendTemplate)&&void 0!==window.ResizeObserver&&new window.ResizeObserver(function(t){for(var e=0,i=t;e<i.length;e++){var s=i[e],n=s.target&&s.target.parentElement?s.target.parentElement.querySelector(".e-float-text.e-label-bottom"):null;n&&n.classList.contains("e-label-bottom")?n.style.width=s.contentRect.width+"px":n&&n.classList.contains("e-label-top")&&(n.style.width="auto")}}).observe(this.textarea),this.renderComplete()},P.prototype.updateHTMLAttributesToWrapper=function(){o.Input.updateHTMLAttributesToWrapper(this.htmlAttributes,this.textboxWrapper.container)},P.prototype.updateHTMLAttributesToElement=function(){o.Input.updateHTMLAttributesToElement(this.htmlAttributes,this.respectiveElement||(this.multiline&&!E.isNullOrUndefined(this.textarea)?this.textarea:this.element))},P.prototype.setInitialValue=function(){this.isAngular||this.respectiveElement.setAttribute("value",this.initialValue)},P.prototype.updatePrependTemplate=function(){this.removePrependTemplate(),this.createPrependTemplate()},P.prototype.updateAppendTemplate=function(){this.removeAppendTemplate(),this.createAppendTemplate()},P.prototype.templateComplier=function(e){if(e)try{return"function"!=typeof e&&E.selectAll(e,document).length?E.compile(E.select(e,document).innerHTML.trim()):E.compile(e)}catch(t){return E.compile(e)}},P.prototype.createPrependTemplate=function(){var t,e;E.isNullOrUndefined(this.prependTemplate)||(t=this.textboxWrapper.container,this.prependedElement=this.createElement("div",{className:"e-prepend-template"}),this.iconTemplateFunction=this.templateComplier(this.prependTemplate),(e=this.iconTemplateFunction(null,this,"template",this.element.id+"Template",this.isStringTemplate,null,this.prependedElement))&&(e=[].slice.call(e),E.append(e,this.prependedElement)),e=t.querySelector("input"),t.classList.add("e-prepend-wrapper"),e?t.insertBefore(this.prependedElement,e):t.insertBefore(this.prependedElement,t.firstChild),this.handleFloatLabel(),this.renderReactTemplates())},P.prototype.createAppendTemplate=function(){var t,e;E.isNullOrUndefined(this.appendTemplate)||(t=this.textboxWrapper.container,this.appendedElement=this.createElement("div",{className:"e-append-template"}),this.iconTemplateFunction=this.templateComplier(this.appendTemplate),(e=this.iconTemplateFunction(null,this,"template",this.element.id+"Template",this.isStringTemplate,null,this.appendedElement))&&(e=[].slice.call(e),E.append(e,this.appendedElement)),t.classList.add("e-append-wrapper"),t.appendChild(this.appendedElement),this.handleFloatLabel(),this.renderReactTemplates())},P.prototype.handleFloatLabel=function(){var t=this.textboxWrapper.container.querySelector(".e-float-text");t&&"Auto"===this.floatLabelType&&setTimeout(function(){t&&this.prependedElement&&!this.enableRtl?(t.style.marginLeft=this.prependedElement.offsetWidth+"px",t.style.marginRight="0"):t&&this.prependedElement&&this.enableRtl&&(t.style.marginRight=this.prependedElement.offsetWidth+"px",t.style.marginLeft="0"),t&&t.classList.contains("e-label-bottom")&&(t.style.width=this.element.offsetWidth+"px")}.bind(this),5)},P.prototype.removePrependTemplate=function(){E.isNullOrUndefined(this.prependedElement)||(E.detach(this.prependedElement),this.prependedElement=null)},P.prototype.removeAppendTemplate=function(){E.isNullOrUndefined(this.appendedElement)||(E.detach(this.appendedElement),this.appendedElement=null)},P.prototype.wireEvents=function(){E.EventHandler.add(this.respectiveElement,"focus",this.focusHandler,this),E.EventHandler.add(this.respectiveElement,"blur",this.focusOutHandler,this),E.EventHandler.add(this.respectiveElement,"keydown",this.keydownHandler,this),E.EventHandler.add(this.respectiveElement,"input",this.inputHandler,this),E.EventHandler.add(this.respectiveElement,"change",this.changeHandler,this),this.isForm&&E.EventHandler.add(this.formElement,"reset",this.resetForm,this),this.bindClearEvent(),!E.isNullOrUndefined(this.textboxWrapper.container.querySelector(".e-float-text"))&&"Auto"===this.floatLabelType&&this.textboxWrapper.container.classList.contains("e-autofill")&&this.textboxWrapper.container.classList.contains("e-outline")&&E.EventHandler.add(this.textboxWrapper.container.querySelector(".e-float-text"),"animationstart",this.animationHandler,this)},P.prototype.animationHandler=function(){this.textboxWrapper.container.classList.add("e-valid-input");var t=this.textboxWrapper.container.querySelector(".e-float-text");E.isNullOrUndefined(t)||(t.classList.add("e-label-top"),t.classList.contains("e-label-bottom")&&t.classList.remove("e-label-bottom"))},P.prototype.resetValue=function(t){var e=this.isProtectedOnChange;this.isProtectedOnChange=!0,null!=(this.value=t)||!this.textboxWrapper.container.classList.contains("e-valid-input")||"Always"===this.floatLabelType&&this.textboxWrapper.container.classList.contains("e-outline")||this.textboxWrapper.container.classList.remove("e-valid-input"),this.isProtectedOnChange=e},P.prototype.resetForm=function(){var t;this.isAngular?this.resetValue(""):this.resetValue(this.initialValue),E.isNullOrUndefined(this.textboxWrapper)||(t=this.textboxWrapper.container.querySelector(".e-float-text"),E.isNullOrUndefined(t))||"Always"===this.floatLabelType||(E.isNullOrUndefined(this.initialValue)||""===this.initialValue?(t.classList.add("e-label-bottom"),t.classList.remove("e-label-top")):""!==this.initialValue&&(t.classList.add("e-label-top"),t.classList.remove("e-label-bottom")))},P.prototype.focusHandler=function(t){t={container:this.textboxWrapper.container,event:t,value:this.value};this.trigger("focus",t),"Auto"===this.floatLabelType&&(this.prependTemplate||this.appendTemplate)&&setTimeout(function(){var t=this.textboxWrapper?this.textboxWrapper.container.querySelector(".e-float-text"):null;t&&(t.style.width="auto")}.bind(this),5)},P.prototype.focusOutHandler=function(t){null===this.previousValue&&null===this.value&&""===this.respectiveElement.value||this.previousValue===this.value||this.raiseChangeEvent(t,!0);t={container:this.textboxWrapper.container,event:t,value:this.value};this.trigger("blur",t),"Auto"===this.floatLabelType&&(this.prependTemplate||this.appendTemplate)&&setTimeout(function(){var t=this.textboxWrapper?this.textboxWrapper.container.querySelector(".e-float-text.e-label-bottom"):null;t&&(t.style.width=this.multiline?this.textarea.offsetWidth:this.element.offsetWidth+"px")}.bind(this),5)},P.prototype.keydownHandler=function(t){var e=t.ctrlKey&&90===t.keyCode;(13===t.keyCode||9===t.keyCode||e)&&(null!==this.previousValue&&""!==this.previousValue||null!==this.value&&""!==this.value||""!==this.respectiveElement.value)&&this.setProperties({value:this.respectiveElement.value},!0)},P.prototype.inputHandler=function(t){var e={event:t,value:this.respectiveElement.value,previousValue:this.inputPreviousValue,container:this.textboxWrapper.container};this.inputPreviousValue=this.respectiveElement.value,this.isAngular&&(this.localChange({value:this.respectiveElement.value}),this.preventChange=!0),this.isVue&&(this.preventChange=!0),this.trigger("input",e),t.stopPropagation()},P.prototype.changeHandler=function(t){this.setProperties({value:this.respectiveElement.value},!0),this.previousValue!==this.value&&this.raiseChangeEvent(t,!0),t.stopPropagation()},P.prototype.raiseChangeEvent=function(t,e){t={event:t,value:this.value,previousValue:this.previousValue,container:this.textboxWrapper.container,isInteraction:e||!1,isInteracted:e||!1};this.preventChange=!1,this.trigger("change",t),this.previousValue=this.value,"INPUT"===this.element.tagName&&this.multiline&&"mozilla"===E.Browser.info.name&&(this.element.value=this.respectiveElement.value)},P.prototype.bindClearEvent=function(){this.showClearButton&&(this.enabled?E.EventHandler.add(this.textboxWrapper.clearButton,"mousedown touchstart",this.resetInputHandler,this):E.EventHandler.remove(this.textboxWrapper.clearButton,"mousedown touchstart",this.resetInputHandler))},P.prototype.resetInputHandler=function(t){var e;t.preventDefault(),this.textboxWrapper.clearButton.classList.contains("e-clear-icon-hide")&&!this.textboxWrapper.container.classList.contains("e-static-clear")||(o.Input.setValue("",this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value),this.setProperties({value:this.respectiveElement.value},!0),e={event:t,value:this.respectiveElement.value,previousValue:this.inputPreviousValue,container:this.textboxWrapper.container},this.trigger("input",e),this.inputPreviousValue=this.respectiveElement.value,this.raiseChangeEvent(t,!0),E.closest(this.element,"form")&&(e=this.element,(t=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),e.dispatchEvent(t)))},P.prototype.unWireEvents=function(){E.EventHandler.remove(this.respectiveElement,"focus",this.focusHandler),E.EventHandler.remove(this.respectiveElement,"blur",this.focusOutHandler),E.EventHandler.remove(this.respectiveElement,"keydown",this.keydownHandler),E.EventHandler.remove(this.respectiveElement,"input",this.inputHandler),E.EventHandler.remove(this.respectiveElement,"change",this.changeHandler),this.isForm&&E.EventHandler.remove(this.formElement,"reset",this.resetForm),!E.isNullOrUndefined(this.textboxWrapper.container.querySelector(".e-float-text"))&&"Auto"===this.floatLabelType&&this.textboxWrapper.container.classList.contains("e-outline")&&this.textboxWrapper.container.classList.contains("e-autofill")&&E.EventHandler.remove(this.textboxWrapper.container.querySelector(".e-float-text"),"animationstart",this.animationHandler)},P.prototype.destroy=function(){this.unWireEvents(),this.removePrependTemplate(),this.removeAppendTemplate(),this.clearTemplate(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),"INPUT"===this.element.tagName&&this.multiline&&(E.detach(this.textboxWrapper.container.getElementsByTagName("textarea")[0]),this.respectiveElement=this.element,this.element.removeAttribute("type")),this.respectiveElement.value=this.respectiveElement.defaultValue,this.respectiveElement.classList.remove("e-input"),this.removeAttributes(["aria-disabled","aria-readonly","aria-labelledby"]),E.isNullOrUndefined(this.textboxWrapper)||(this.textboxWrapper.container.insertAdjacentElement("afterend",this.respectiveElement),E.detach(this.textboxWrapper.container)),this.textboxWrapper=null,o.Input.destroy({element:this.respectiveElement,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),"EJS-TEXTBOX"===this.element.tagName&&E.setValue("ej2_instances",null,this.element),dn.prototype.destroy.call(this)},P.prototype.addIcon=function(t,e){o.Input.addIcon(t,e,this.textboxWrapper.container,this.respectiveElement,this.createElement);var t=this.textboxWrapper.container,e=t.querySelector("span.e-icons"),t=t.querySelector("label");e&&t&&(e=this.element.parentElement.offsetWidth-e.offsetWidth,t.style.width=e+"px")},P.prototype.getPersistData=function(){return this.addOnPersist(["value"])},P.prototype.addAttributes=function(t){for(var e=0,i=Object.keys(t);e<i.length;e++){var s=i[e];"disabled"===s?(this.setProperties({enabled:!1},!0),o.Input.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container)):"readonly"===s?(this.setProperties({readonly:!0},!0),o.Input.setReadonly(this.readonly,this.respectiveElement)):"class"===s?this.respectiveElement.classList.add(t[""+s]):"placeholder"===s?(this.setProperties({placeholder:t[""+s]},!0),o.Input.setPlaceholder(this.placeholder,this.respectiveElement)):("rows"===s&&this.respectiveElement.tagName,this.respectiveElement.setAttribute(s,t[""+s]))}},P.prototype.removeAttributes=function(t){for(var e=0,i=t;e<i.length;e++){var s=i[e];"disabled"===s?(this.setProperties({enabled:!0},!0),o.Input.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container)):"readonly"===s?(this.setProperties({readonly:!1},!0),o.Input.setReadonly(this.readonly,this.respectiveElement)):"placeholder"===s?(this.setProperties({placeholder:null},!0),o.Input.setPlaceholder(this.placeholder,this.respectiveElement)):this.respectiveElement.removeAttribute(s)}},P.prototype.focusIn=function(){document.activeElement!==this.respectiveElement&&this.enabled&&(this.respectiveElement.focus(),this.textboxWrapper.container.classList.contains("e-input-group")||this.textboxWrapper.container.classList.contains("e-outline")||this.textboxWrapper.container.classList.contains("e-filled"))&&E.addClass([this.textboxWrapper.container],[W])},P.prototype.focusOut=function(){document.activeElement===this.respectiveElement&&this.enabled&&(this.respectiveElement.blur(),this.textboxWrapper.container.classList.contains("e-input-group")||this.textboxWrapper.container.classList.contains("e-outline")||this.textboxWrapper.container.classList.contains("e-filled"))&&E.removeClass([this.textboxWrapper.container],[W])},T([E.Property("text")],P.prototype,"type",void 0),T([E.Property(!1)],P.prototype,"readonly",void 0),T([E.Property("")],P.prototype,"value",void 0),T([E.Property("Never")],P.prototype,"floatLabelType",void 0),T([E.Property("")],P.prototype,"cssClass",void 0),T([E.Property(null)],P.prototype,"placeholder",void 0),T([E.Property("on")],P.prototype,"autocomplete",void 0),T([E.Property({})],P.prototype,"htmlAttributes",void 0),T([E.Property(!1)],P.prototype,"multiline",void 0),T([E.Property(!0)],P.prototype,"enabled",void 0),T([E.Property(!1)],P.prototype,"showClearButton",void 0),T([E.Property(!1)],P.prototype,"enablePersistence",void 0),T([E.Property(null)],P.prototype,"width",void 0),T([E.Property(null)],P.prototype,"maxLength",void 0),T([E.Property(null)],P.prototype,"prependTemplate",void 0),T([E.Property(null)],P.prototype,"appendTemplate",void 0),T([E.Event()],P.prototype,"created",void 0),T([E.Event()],P.prototype,"destroyed",void 0),T([E.Event()],P.prototype,"change",void 0),T([E.Event()],P.prototype,"blur",void 0),T([E.Event()],P.prototype,"focus",void 0),T([E.Event()],P.prototype,"input",void 0),T([E.NotifyPropertyChanges],P));function P(t,e){e=dn.call(this,t,e)||this;return e.previousValue=null,e.isHiddenInput=!1,e.isForm=!1,e.inputPreviousValue=null,e.textboxOptions=t,e}un=function(t,e){return(un=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var un,cn,T=function(t,e){function i(){this.constructor=t}un(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},O=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},mn="e-auto-width",fn="e-resize-x",vn="e-resize-y",gn="e-resize-xy",yn="e-resize-none",T=(cn=E.Component,T(w,cn),w.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"floatLabelType":o.Input.removeFloating(this.textareaWrapper),o.Input.addFloating(this.element,this.floatLabelType,this.placeholder),"Never"===this.floatLabelType&&this.element.removeAttribute("aria-labelledby");break;case"enabled":o.Input.setEnabled(this.enabled,this.element,this.floatLabelType,this.textareaWrapper.container),this.bindClearEvent(),this.enabled||"None"===this.resizeMode?this.element.classList.add(this.getCurrentResizeClass(this.resizeMode)):(this.element.classList.remove(this.getCurrentResizeClass(this.resizeMode)),this.element.classList.add(yn));break;case"width":"None"!==this.resizeMode&&"Vertical"!==this.resizeMode?(this.setElementWidth(t.width),this.textareaWrapper.container.classList.add(mn)):(this.textareaWrapper.container.classList.contains(mn)&&this.textareaWrapper.container.classList.remove(mn),o.Input.setWidth(t.width,this.textareaWrapper.container));break;case"value":var n=this.isProtectedOnChange;this.isProtectedOnChange=!0,o.Input.isBlank(this.value)||(this.value=this.value.toString()),this.isProtectedOnChange=n,o.Input.setValue(this.value,this.element,this.floatLabelType,this.showClearButton),this.inputPreviousValue=this.element.value,(this.isAngular||this.isVue)&&!0===this.preventChange?(this.previousValue=this.isAngular?this.value:this.previousValue,this.preventChange=!1):(E.isNullOrUndefined(this.isAngular)||!this.isAngular||this.isAngular&&!this.preventChange||this.isAngular&&E.isNullOrUndefined(this.preventChange))&&this.raiseChangeEvent();break;case"htmlAttributes":this.updateHTMLAttributesToElement(),this.updateHTMLAttributesToWrapper(),this.checkAttributes(!0),o.Input.validateInputType(this.textareaWrapper.container,this.element);break;case"readonly":o.Input.setReadonly(this.readonly,this.element),this.readonly?this.element.setAttribute("aria-readonly","true"):this.element.removeAttribute("aria-readonly");break;case"showClearButton":o.Input.setClearButton(this.showClearButton,this.element,this.textareaWrapper),this.bindClearEvent();break;case"enableRtl":o.Input.setEnableRtl(this.enableRtl,[this.textareaWrapper.container]),this.handleAdornmentFloatLabel();break;case"placeholder":o.Input.setPlaceholder(this.placeholder,this.element,this.getModuleName()),o.Input.calculateWidth(this.element,this.textareaWrapper.container);break;case"cssClass":o.Input.updateCssClass(t.cssClass,e.cssClass,this.textareaWrapper.container);break;case"locale":this.globalize=new E.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),o.Input.setPlaceholder(this.placeholder,this.element);break;case"rows":this.rows&&this.element.setAttribute("rows",this.rows.toString());break;case"cols":this.cols&&(this.element.setAttribute("cols",this.cols.toString()),null==this.width)&&this.textareaWrapper.container.classList.add(mn);break;case"maxLength":this.maxLength&&this.element.setAttribute("maxlength",this.maxLength.toString());break;case"resizeMode":this.enabled&&(this.element.classList.contains(this.getCurrentResizeClass(e.resizeMode))&&this.element.classList.remove(this.getCurrentResizeClass(e.resizeMode)),this.element.classList.add(this.getCurrentResizeClass(this.resizeMode)),!this.element.style.width||"None"!==this.resizeMode&&"Vertical"!==this.resizeMode?(n=this.element.offsetWidth,this.element.style.width=n+"px",this.textareaWrapper.container.style.width&&(this.textareaWrapper.container.style.width="")):o.Input.setWidth(this.element.style.width,this.textareaWrapper.container),this.setWrapperWidth());break;case"prependTemplate":this.handleAdornmentDirection(),this.updatePrependTemplate();break;case"appendTemplate":this.handleAdornmentDirection(!0),this.updateAppendTemplate();break;case"adornmentFlow":case"adornmentOrientation":this.handleAdornmentDirection(),this.updatePrependTemplate(),this.updateAppendTemplate()}},w.prototype.preRender=function(){if(this.formElement=E.closest(this.element,"form"),E.isNullOrUndefined(this.formElement)||(this.isForm=!0),"EJS-TEXTAREA"===this.element.tagName||"EJS-SMARTTEXTAREA"===this.element.tagName){for(var t=E.getValue("ej2_instances",this.element),e=this.createElement("textarea"),i=0;i<this.element.attributes.length;i++){var s=this.element.attributes[i].nodeName;"id"!==s&&"class"!==s?(e.setAttribute(s,this.element.attributes[i].nodeValue),e.innerHTML=this.element.innerHTML,"name"===s&&this.element.removeAttribute("name")):"class"===s&&e.setAttribute(s,this.element.className.split(" ").filter(function(t){return 0!==t.indexOf("ng-")}).join(" "))}this.element.appendChild(e),this.element=e,E.setValue("ej2_instances",t,this.element)}this.updateHTMLAttributesToElement(),this.checkAttributes(!1),!E.isNullOrUndefined(this.textareaOptions)&&void 0!==this.textareaOptions.value||""===this.element.value||this.setProperties({value:this.element.value},!0),this.globalize=new E.Internationalization(this.locale);t={placeholder:this.placeholder};this.l10n=new E.L10n("textarea",t,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.element.hasAttribute("id")||this.element.setAttribute("id",E.getUniqueID("textbox")),this.element.hasAttribute("name")||this.element.setAttribute("name",this.element.getAttribute("id")),this.rows&&this.element.setAttribute("rows",this.rows.toString()),this.cols&&this.element.setAttribute("cols",this.cols.toString()),this.maxLength&&this.element.setAttribute("maxlength",this.maxLength.toString()),!this.element.style.resize&&this.enabled&&this.element.classList.add(this.getCurrentResizeClass(this.resizeMode)),this.enabled&&this.element.setAttribute("aria-multiline","true")},w.prototype.render=function(){var t=this.cssClass;E.isNullOrUndefined(this.cssClass)||""===this.cssClass||(t=o.Input.getInputValidClassList(this.cssClass)),this.textareaWrapper=o.Input.createInput({element:this.element,floatLabelType:this.floatLabelType,properties:{enabled:this.enabled,enableRtl:this.enableRtl,cssClass:t,readonly:this.readonly,placeholder:this.placeholder,showClearButton:this.showClearButton}}),this.updateHTMLAttributesToWrapper(),this.wireEvents(),E.isNullOrUndefined(this.value)||""===this.value||o.Input.setValue(this.value,this.element,this.floatLabelType,this.showClearButton),E.isNullOrUndefined(this.value)||""===this.value||(this.initialValue=this.value,this.isAngular)||this.element.setAttribute("value",this.initialValue),this.previousValue=this.value,this.inputPreviousValue=this.value,this.element.defaultValue=this.element.value,o.Input.setWidth(this.width,this.textareaWrapper.container),this.setWrapperWidth(),this.updateFloatLabelOverflowWidth(),this.handleAdornmentDirection(),this.createPrependTemplate(),this.createAppendTemplate(),this.renderComplete(),"Auto"===this.floatLabelType&&(this.prependTemplate||this.appendTemplate)&&void 0!==window.ResizeObserver&&new window.ResizeObserver(function(t){for(var e=0,i=t;e<i.length;e++){var s=i[e],n=s.target&&s.target.parentElement?s.target.parentElement.querySelector(".e-float-text"):null;n&&n.classList.contains("e-label-bottom")?n.style.width=s.contentRect.width+"px":n&&n.classList.contains("e-label-top")&&(n.style.width="auto")}}).observe(this.element)},w.prototype.updatePrependTemplate=function(){this.removePrependTemplate(),this.createPrependTemplate()},w.prototype.updateAppendTemplate=function(){this.removeAppendTemplate(),this.createAppendTemplate()},w.prototype.templateComplier=function(e){if(e)try{return"function"!=typeof e&&E.selectAll(e,document).length?E.compile(E.select(e,document).innerHTML.trim()):E.compile(e)}catch(t){return E.compile(e)}},w.prototype.createPrependTemplate=function(){var t,e;E.isNullOrUndefined(this.prependTemplate)||(t=this.textareaWrapper.container,this.prependedElement=this.createElement("div",{className:"e-prepend-template"}),this.iconTemplateFn=this.templateComplier(this.prependTemplate),(e=this.iconTemplateFn(null,this,"template",this.element.id+"Template",this.isStringTemplate,null,this.prependedElement))&&(e=[].slice.call(e),E.append(e,this.prependedElement)),e=t.querySelector("textarea"),t.classList.add("e-prepend-wrapper"),e?t.insertBefore(this.prependedElement,e):t.insertBefore(this.prependedElement,t.firstChild),this.handleAdornmentFloatLabel(),this.renderReactTemplates())},w.prototype.createAppendTemplate=function(){var t,e;E.isNullOrUndefined(this.appendTemplate)||(t=this.textareaWrapper.container,this.appendedElement=this.createElement("div",{className:"e-append-template"}),this.iconTemplateFn=this.templateComplier(this.appendTemplate),(e=this.iconTemplateFn(null,this,"template",this.element.id+"Template",this.isStringTemplate,null,this.appendedElement))&&(e=[].slice.call(e),E.append(e,this.appendedElement)),t.classList.add("e-append-wrapper"),t.appendChild(this.appendedElement),this.renderReactTemplates())},w.prototype.handleAdornmentDirection=function(t){var e=this.textareaWrapper.container.querySelector(".e-float-text");e&&"Auto"===this.floatLabelType&&!t&&(e.style.marginLeft="0",e.style.marginRight="0",e.style.marginTop="0"),"Vertical"===this.adornmentFlow&&(this.appendTemplate||this.prependTemplate)?(this.textareaWrapper.container.classList.add("e-adornment-flow-vertical"),this.textareaWrapper.container.classList.remove("e-adornment-flow-horizontal")):(this.appendTemplate||this.prependTemplate)&&(this.textareaWrapper.container.classList.add("e-adornment-flow-horizontal"),this.textareaWrapper.container.classList.remove("e-adornment-flow-vertical")),"Vertical"===this.adornmentOrientation&&(this.appendTemplate||this.prependTemplate)?(this.textareaWrapper.container.classList.add("e-adornment-orientation-vertical"),this.textareaWrapper.container.classList.remove("e-adornment-orientation-horizontal")):(this.appendTemplate||this.prependTemplate)&&(this.textareaWrapper.container.classList.add("e-adornment-orientation-horizontal"),this.textareaWrapper.container.classList.remove("e-adornment-orientation-vertical"))},w.prototype.handleAdornmentFloatLabel=function(){var t=this.textareaWrapper.container.querySelector(".e-float-text");t&&"Auto"===this.floatLabelType&&setTimeout(function(){t&&this.prependedElement&&"Vertical"!==this.adornmentFlow&&!this.enableRtl?(t.style.marginLeft=this.prependedElement.offsetWidth+"px",t.style.marginRight="0"):t&&this.prependedElement&&"Vertical"!==this.adornmentFlow&&this.enableRtl&&(t.style.marginRight=this.prependedElement.offsetWidth+"px",t.style.marginLeft="0"),"Vertical"===this.adornmentFlow&&"Vertical"===this.adornmentOrientation&&t&&this.prependedElement&&(t.style.marginTop=this.prependedElement.offsetHeight+"px"),"Vertical"===this.adornmentFlow&&"Horizontal"===this.adornmentOrientation&&t&&this.prependedElement&&(t.style.marginTop=this.prependedElement.offsetHeight+"px")}.bind(this),10)},w.prototype.removePrependTemplate=function(){E.isNullOrUndefined(this.prependedElement)||(E.detach(this.prependedElement),this.prependedElement=null)},w.prototype.removeAppendTemplate=function(){E.isNullOrUndefined(this.appendedElement)||(E.detach(this.appendedElement),this.appendedElement=null)},w.prototype.getModuleName=function(){return"textarea"},w.prototype.getPersistData=function(){return this.addOnPersist(["value"])},w.prototype.checkAttributes=function(t){for(var e=0,i=t?E.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly"];e<i.length;e++){var s,n=i[e];if(!E.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"disabled":(E.isNullOrUndefined(this.textareaOptions)||void 0===this.textareaOptions.enabled||t)&&(s="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n),this.setProperties({enabled:s},!t));break;case"readonly":(E.isNullOrUndefined(this.textareaOptions)||void 0===this.textareaOptions.readonly||t)&&(s="readonly"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n),this.setProperties({readonly:s},!t));break;case"placeholder":(E.isNullOrUndefined(this.textareaOptions)||void 0===this.textareaOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"value":(E.isNullOrUndefined(this.textareaOptions)||void 0===this.textareaOptions.value||t)&&""!==this.element.value&&this.setProperties({value:this.element.value},!t)}}},w.prototype.wireEvents=function(){E.EventHandler.add(this.element,"focus",this.focusHandler,this),E.EventHandler.add(this.element,"blur",this.focusOutHandler,this),E.EventHandler.add(this.element,"keydown",this.keydownHandler,this),E.EventHandler.add(this.element,"input",this.inputHandler,this),E.EventHandler.add(this.element,"change",this.changeHandler,this),this.isForm&&E.EventHandler.add(this.formElement,"reset",this.resetForm,this),this.bindClearEvent(),this.resizeHandler=this.windowResize.bind(this),window.addEventListener("resize",this.resizeHandler)},w.prototype.unWireEvents=function(){E.EventHandler.remove(this.element,"focus",this.focusHandler),E.EventHandler.remove(this.element,"blur",this.focusOutHandler),E.EventHandler.remove(this.element,"keydown",this.keydownHandler),E.EventHandler.remove(this.element,"input",this.inputHandler),E.EventHandler.remove(this.element,"change",this.changeHandler),this.isForm&&E.EventHandler.remove(this.formElement,"reset",this.resetForm),this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null)},w.prototype.destroy=function(){this.unWireEvents(),this.removePrependTemplate(),this.removeAppendTemplate(),this.clearTemplate(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),this.element.value=this.element.defaultValue,this.element.classList.remove("e-input",fn,vn,gn,yn),this.textareaWrapper.container.style.width.includes("%")&&E.EventHandler.remove(this.element,"mousemove",this.onMouseMove),this.removeAttributes(["aria-disabled","aria-readonly","aria-labelledby","aria-multiline"]),E.isNullOrUndefined(this.textareaWrapper)||(this.textareaWrapper.container.insertAdjacentElement("afterend",this.element),E.detach(this.textareaWrapper.container)),this.textareaWrapper=null,o.Input.destroy({element:this.element,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),this.formElement=null,"EJS-TEXTAREA"!==this.element.tagName&&"EJS-SMARTTEXTAREA"!==this.element.tagName||E.setValue("ej2_instances",null,this.element),cn.prototype.destroy.call(this)},w.prototype.windowResize=function(){this.updateFloatLabelOverflowWidth()},w.prototype.focusHandler=function(t){var e,t={container:this.textareaWrapper.container,event:t,value:this.value};"Never"!==this.floatLabelType&&this.textareaWrapper&&this.textareaWrapper.container&&(e=this.textareaWrapper.container.querySelector(".e-float-text"))&&e.removeAttribute("style"),this.trigger("focus",t),"Auto"===this.floatLabelType&&(this.prependTemplate||this.appendTemplate)&&setTimeout(function(){var t=this.textareaWrapper?this.textareaWrapper.container.querySelector(".e-float-text"):null;t&&(t.style.width="auto")}.bind(this),5)},w.prototype.focusOutHandler=function(t){null===this.previousValue&&null===this.value||this.previousValue===this.value||this.raiseChangeEvent(t,!0);t={container:this.textareaWrapper.container,event:t,value:this.value};this.updateFloatLabelOverflowWidth(),this.handleAdornmentFloatLabel(),this.trigger("blur",t)},w.prototype.keydownHandler=function(t){13!==t.keyCode&&9!==t.keyCode||!(null!==this.previousValue&&""!==this.previousValue||null!==this.value&&""!==this.value||""!==this.element.value)||this.setProperties({value:this.element.value},!0)},w.prototype.inputHandler=function(t){var e={event:t,value:this.element.value,previousValue:this.inputPreviousValue,container:this.textareaWrapper.container};this.inputPreviousValue=this.element.value,this.isAngular&&(this.localChange({value:this.element.value}),this.preventChange=!0),this.isVue&&(this.preventChange=!0),this.trigger("input",e),t.stopPropagation()},w.prototype.changeHandler=function(t){this.setProperties({value:this.element.value},!0),this.previousValue!==this.value&&this.raiseChangeEvent(t,!0),t.stopPropagation()},w.prototype.raiseChangeEvent=function(t,e){t={event:t,value:this.value,previousValue:this.previousValue,container:this.textareaWrapper.container,isInteraction:e||!1,isInteracted:e||!1};this.preventChange=!1,this.trigger("change",t),this.previousValue=this.value},w.prototype.updateHTMLAttributesToWrapper=function(){o.Input.updateHTMLAttributesToWrapper(this.htmlAttributes,this.textareaWrapper.container)},w.prototype.updateHTMLAttributesToElement=function(){o.Input.updateHTMLAttributesToElement(this.htmlAttributes,this.element)},w.prototype.bindClearEvent=function(){this.showClearButton&&(this.enabled?E.EventHandler.add(this.textareaWrapper.clearButton,"mousedown touchstart",this.resetInputHandler,this):E.EventHandler.remove(this.textareaWrapper.clearButton,"mousedown touchstart",this.resetInputHandler))},w.prototype.resetInputHandler=function(t){t.preventDefault(),this.textareaWrapper.clearButton.classList.contains("e-clear-icon-hide")&&!this.textareaWrapper.container.classList.contains("e-static-clear")||(o.Input.setValue("",this.element,this.floatLabelType,this.showClearButton),this.setProperties({value:this.element.value},!0));var e={event:t,value:this.element.value,previousValue:this.inputPreviousValue,container:this.textareaWrapper.container};this.trigger("input",e),this.inputPreviousValue=this.element.value,this.raiseChangeEvent(t,!0),E.closest(this.element,"form")&&(e=this.element,(t=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),e.dispatchEvent(t))},w.prototype.addAttributes=function(t){for(var e=0,i=Object.keys(t);e<i.length;e++){var s=i[e];"disabled"===s?(this.setProperties({enabled:!1},!0),o.Input.setEnabled(this.enabled,this.element,this.floatLabelType,this.textareaWrapper.container)):"readonly"===s?(this.setProperties({readonly:!0},!0),o.Input.setReadonly(this.readonly,this.element)):"class"===s?this.element.classList.add(t[""+s]):"placeholder"===s?(this.setProperties({placeholder:t[""+s]},!0),o.Input.setPlaceholder(this.placeholder,this.element)):this.element.setAttribute(s,t[""+s])}},w.prototype.removeAttributes=function(t){for(var e=0,i=t;e<i.length;e++){var s=i[e];"disabled"===s?(this.setProperties({enabled:!0},!0),o.Input.setEnabled(this.enabled,this.element,this.floatLabelType,this.textareaWrapper.container)):"readonly"===s?(this.setProperties({readonly:!1},!0),o.Input.setReadonly(this.readonly,this.element)):"placeholder"===s?(this.setProperties({placeholder:null},!0),o.Input.setPlaceholder(this.placeholder,this.element)):this.element.removeAttribute(s)}},w.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.element.focus(),this.textareaWrapper.container.classList.contains("e-input-group")||this.textareaWrapper.container.classList.contains("e-outline")||this.textareaWrapper.container.classList.contains("e-filled"))&&E.addClass([this.textareaWrapper.container],[W])},w.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.element.blur(),this.textareaWrapper.container.classList.contains("e-input-group")||this.textareaWrapper.container.classList.contains("e-outline")||this.textareaWrapper.container.classList.contains("e-filled"))&&E.removeClass([this.textareaWrapper.container],[W])},w.prototype.setWrapperWidth=function(){this.enabled&&("None"!==this.resizeMode&&"Vertical"!==this.resizeMode||this.cols||this.element.getAttribute("cols"))?("None"===this.resizeMode||"Vertical"===this.resizeMode||this.textareaWrapper.container.style.width.includes("%")||this.setElementWidth(this.textareaWrapper.container.style.width),this.textareaWrapper.container.style.width.includes("%")||(this.textareaWrapper.container.classList.add(mn),this.textareaWrapper.container.style.width=""),this.textareaWrapper.container.style.width.includes("%")&&E.EventHandler.add(this.element,"mousemove",this.onMouseMove,this)):this.textareaWrapper.container.classList.contains(mn)&&this.textareaWrapper.container.classList.remove(mn)},w.prototype.onMouseMove=function(){var e,i=this;"auto"!==this.textareaWrapper.container.style.width&&(e=this.element.style.width,setTimeout(function(){var t=i.element.style.width;e!==t&&(i.textareaWrapper.container.style.width="auto")},5))},w.prototype.resetForm=function(){var t;this.isAngular?this.resetValue(""):this.resetValue(this.initialValue),E.isNullOrUndefined(this.textareaWrapper)||(t=this.textareaWrapper.container.querySelector(".e-float-text"),E.isNullOrUndefined(t))||"Always"===this.floatLabelType||(E.isNullOrUndefined(this.initialValue)||""===this.initialValue?(t.classList.add("e-label-bottom"),t.classList.remove("e-label-top")):""!==this.initialValue&&(t.classList.add("e-label-top"),t.classList.remove("e-label-bottom")))},w.prototype.resetValue=function(t){var e=this.isProtectedOnChange;this.isProtectedOnChange=!0,null!=(this.value=t)||!this.textareaWrapper.container.classList.contains("e-valid-input")||"Always"===this.floatLabelType&&this.textareaWrapper.container.classList.contains("e-outline")||this.textareaWrapper.container.classList.remove("e-valid-input"),this.isProtectedOnChange=e},w.prototype.setElementWidth=function(t){"number"==typeof t?this.element.style.width=E.formatUnit(t):"string"==typeof t&&(this.element.style.width=t.match(/px|%|em/)?t:E.formatUnit(t))},w.prototype.getCurrentResizeClass=function(t){return"None"===t?yn:"Both"===t?gn:"Horizontal"===t?fn:vn},w.prototype.getRightIconsWidth=function(){for(var t=0,e=this.textareaWrapper.container.querySelectorAll(".e-input-group-icon, .e-clear-icon"),i=0;i<e.length;i++)t+=e[i].offsetWidth;return t},O([E.Property(!(w.prototype.updateFloatLabelOverflowWidth=function(){var e=this.textareaWrapper.container,t=e.querySelector(".e-float-text-overflow")||e.querySelector(".e-float-text"),i=e.clientWidth-this.getRightIconsWidth();!t||!i||this.cssClass&&-1!==this.cssClass.split(" ").indexOf("e-outline")||this.prependTemplate&&this.appendTemplate?"Auto"===this.floatLabelType&&(this.prependTemplate||this.appendTemplate)&&setTimeout(function(){var t=e?e.querySelector(".e-float-text.e-label-bottom"):null;t&&(t.style.width=this.element.offsetWidth+"px")}.bind(this),10):t.style.width=i+"px"}))],w.prototype,"readonly",void 0),O([E.Property("")],w.prototype,"value",void 0),O([E.Property("Never")],w.prototype,"floatLabelType",void 0),O([E.Property("")],w.prototype,"cssClass",void 0),O([E.Property(null)],w.prototype,"placeholder",void 0),O([E.Property({})],w.prototype,"htmlAttributes",void 0),O([E.Property(!0)],w.prototype,"enabled",void 0),O([E.Property(!1)],w.prototype,"showClearButton",void 0),O([E.Property(!1)],w.prototype,"enablePersistence",void 0),O([E.Property(null)],w.prototype,"width",void 0),O([E.Property("Both")],w.prototype,"resizeMode",void 0),O([E.Property(null)],w.prototype,"maxLength",void 0),O([E.Property(null)],w.prototype,"cols",void 0),O([E.Property(null)],w.prototype,"rows",void 0),O([E.Property(null)],w.prototype,"prependTemplate",void 0),O([E.Property(null)],w.prototype,"appendTemplate",void 0),O([E.Property("Horizontal")],w.prototype,"adornmentFlow",void 0),O([E.Property("Horizontal")],w.prototype,"adornmentOrientation",void 0),O([E.Event()],w.prototype,"created",void 0),O([E.Event()],w.prototype,"destroyed",void 0),O([E.Event()],w.prototype,"change",void 0),O([E.Event()],w.prototype,"blur",void 0),O([E.Event()],w.prototype,"focus",void 0),O([E.Event()],w.prototype,"input",void 0),O([E.NotifyPropertyChanges],w));function w(t,e){e=cn.call(this,t,e)||this;return e.previousValue=null,e.isForm=!1,e.inputPreviousValue=null,e.textareaOptions=t,e}Cn.createStyledDiv=function(e,t){var i=document.createElement("div"),s={position:"absolute",left:-9999,top:0,zIndex:-2e3},n=(this.properties.forEach(function(t){s[""+t]=getComputedStyle(e)[t]}),Object.keys(s).forEach(function(t){i.style[""+t]=s[""+t]}),e.offsetWidth-e.clientWidth);return i.style.width=e.clientWidth+n+"px",i.innerHTML=t,e&&e.parentNode&&e.parentNode.insertBefore(i,e.nextSibling),i},Cn.createCaretMarker=function(t,e){t=this.createStyledDiv(t,e),e=t.ownerDocument.getElementById("caret-position-marker"),e={left:e.offsetLeft,top:e.offsetTop,height:e.offsetHeight};return t&&t.parentNode&&t.parentNode.removeChild(t),e},Cn.escapeHtml=function(t){return t.replace(/<|>|`|"|&/g,"?").replace(/\r\n|\r|\n/g,"<br/>")},Cn.getCaretPosition=function(t){var e=t.selectionStart||0,i=t.value.slice(0,e),s=t.value.slice(e),i='<span style="position: relative; display: inline;">'+this.escapeHtml(i)+"</span>",s=(i=(i+='<span id="caret-position-marker" style="position: relative; display: inline;">|</span>')+('<span style="position: relative; display: inline;">'+this.escapeHtml(s)+"</span>"),this.createCaretMarker(t,i));return s.pos=e,s},Cn.adjustScrollToCaretPosition=function(t){var e=this.getCaretPosition(t),i=parseFloat(window.getComputedStyle(t).lineHeight);e.top>t.clientHeight+t.scrollTop-i&&(t.scrollTop=e.top-t.clientHeight+i)},Cn.getTextAreaPosition=function(t){var e=window.getComputedStyle(t),i=this.getCaretPosition(t);return{top:i.top+parseFloat(e.borderTopWidth)+t.offsetTop-t.scrollTop,left:i.left+parseFloat(e.borderLeftWidth)+t.offsetLeft-t.scrollLeft-.25,height:i.height,elemStyle:e}},Cn.insertCharacter=function(t,e){var i=t.selectionStart,s=t.selectionEnd;t.value=t.value.substring(0,i)+e+t.value.substring(s),i+=e.length,t.setSelectionRange(i,i)},Cn.properties=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopWidth","boxSizing","fontFamily","fontSize","fontWeight","height","letterSpacing","lineHeight","marginBottom","marginLeft","marginRight","marginTop","outlineWidth","overflow","overflowX","overflowY","paddingBottom","paddingLeft","paddingRight","paddingTop","textAlign","textOverflow","textTransform","whiteSpace","wordBreak","wordWrap","width"];var bn=Cn;function Cn(){}En=function(t,e){return(En=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var En,xn,O=function(t,e){function i(){this.constructor=t}En(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},Sn=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},Tn=function(a,l,r,o){return new(r=r||Promise)(function(t,e){function i(t){try{n(o.next(t))}catch(t){e(t)}}function s(t){try{n(o.throw(t))}catch(t){e(t)}}function n(e){e.done?t(e.value):new r(function(t){t(e.value)}).then(i,s)}n((o=o.apply(a,l||[])).next())})},Pn=function(s,n){var a,l,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(i){return function(t){var e=[i,t];if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,l&&(r=2&e[0]?l.return:e[0]?l.throw||((r=l.return)&&r.call(l),0):l.next)&&!(r=r.call(l,e[1])).done)return r;switch(l=0,(e=r?[2&e[0],r.value]:e)[0]){case 0:case 1:r=e;break;case 4:return o.label++,{value:e[1],done:!1};case 5:o.label++,l=e[1],e=[0];continue;case 7:e=o.ops.pop(),o.trys.pop();continue;default:if(!(r=0<(r=o.trys).length&&r[r.length-1])&&(6===e[0]||2===e[0])){o=0;continue}if(3===e[0]&&(!r||e[1]>r[0]&&e[1]<r[3]))o.label=e[1];else if(6===e[0]&&o.label<r[1])o.label=r[1],r=e;else{if(!(r&&o.label<r[2])){r[2]&&o.ops.pop(),o.trys.pop();continue}o.label=r[2],o.ops.push(e)}}e=n.call(s,o)}catch(t){e=[6,t],l=0}finally{a=r=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}},On=((On=o.ChatMessageRole||(o.ChatMessageRole={})).System="system",On.User="user",On.Assistant="assistant",O(L,xn=T),L.prototype.render=function(){var t,e;xn.prototype.render.call(this),this.element instanceof HTMLTextAreaElement&&(this.textArea=this.element,(t=E.createElement("smart-textarea")).classList.add("e-smart-textarea"),this.textArea.after(t),"None"!==this.showSuggestionOnPopup&&(e="Enable"===this.showSuggestionOnPopup?"false":"true",this.textArea.setAttribute("data-inline-suggestions",e)),this.suggestionDisplay=new(this.shouldShowInlineSuggestions(this.textArea)?wn:kn)(this,t,this.textArea))},L.prototype.wireEvents=function(){var t=this;xn.prototype.wireEvents.call(this),E.EventHandler.add(this.element,"keyup",this.handleKeyUp,this),E.EventHandler.add(this.element,"keydown",this.handleKeyDown,this),E.EventHandler.add(this.element,"mousedown",this.removeExistingOrPendingSuggestion,this),E.EventHandler.add(this.element,"focusout",this.removeExistingOrPendingSuggestion,this),this.element.addEventListener("scroll",function(){return t.suggestionDisplay.reject()},{passive:!0})},L.prototype.unWireEvents=function(){var t=this;xn.prototype.unWireEvents.call(this),E.EventHandler.remove(this.element,"keyup",this.handleKeyUp),E.EventHandler.remove(this.element,"keydown",this.handleKeyDown),E.EventHandler.remove(this.element,"mousedown",this.removeExistingOrPendingSuggestion),E.EventHandler.remove(this.element,"focusout",this.removeExistingOrPendingSuggestion),this.element.removeEventListener("scroll",function(){return t.suggestionDisplay.reject()})},L.prototype.keydownHandler=function(){},L.prototype.shouldShowInlineSuggestions=function(t){t=t.getAttribute("data-inline-suggestions");return t?"true"===t.toLowerCase():!("ontouchstart"in window)},L.prototype.handleKeyDown=function(t){switch(t.key){case"Tab":this.suggestionDisplay.isShowing()&&(this.suggestionDisplay.accept(),t.preventDefault());break;case"Alt":case"Control":case"Shift":case"Command":break;default:this.suggestionDisplay.isShowing()&&this.suggestionDisplay.currentSuggestion.startsWith(t.key)?(bn.insertCharacter(this.textArea,t.key),t.preventDefault(),this.suggestionDisplay.show(this.suggestionDisplay.currentSuggestion.substring(t.key.length)),bn.adjustScrollToCaretPosition(this.textArea)):this.removeExistingOrPendingSuggestion()}},L.prototype.handleKeyUp=function(){var t=this;this.suggestionDisplay.isShowing()||(clearTimeout(this.typingDebounceTimeout),this.typingDebounceTimeout=setTimeout(function(){return t.handleTypingPaused()},350))},L.prototype.handleTypingPaused=function(){return Tn(this,void 0,void 0,function(){return Pn(this,function(t){switch(t.label){case 0:return document.activeElement!==this.textArea?[2]:this.textArea.selectionStart!==this.textArea.selectionEnd||this.textArea.selectionStart!==this.textArea.value.length&&"\n"!==this.textArea.value[this.textArea.selectionStart]?[3,2]:[4,this.requestSuggestionAsync()];case 1:t.sent(),t.label=2;case 2:return[2]}})})},L.prototype.removeExistingOrPendingSuggestion=function(){clearTimeout(this.typingDebounceTimeout),this.pendingSuggestionAbort&&(this.pendingSuggestionAbort.abort(),this.pendingSuggestionAbort=null),this.suggestionDisplay.reject()},L.prototype.createSuggestionPrompt=function(t,e){var i="Predict what text the user in the given ROLE would insert at the cursor position indicated by ^^^.\nOnly give predictions for which you have an EXTREMELY high confidence that the user would insert that EXACT text.\nDo not make up new information. If you are not sure, just reply with NO_PREDICTION.\n\nRULES:\n1. Reply with OK:, then in square brackets the predicted text, then END_INSERTION, and no other output.\n2. When a specific value or quantity cannot be inferred and would need to be provided, use the word NEED_INFO.\n3. If there is not enough information to predict any words that the user would type next, just reply with the word NO_PREDICTION.\n4. NEVER invent new information. If you can not be sure what the user is about to type, ALWAYS stop the prediction with END_INSERTION.",s=this.UserPhrases;if(s&&0<s.length){i+="\nAlways try to use variations on the following phrases as part of the predictions:\n";for(var n=0,a=s;n<a.length;n++)i+="- "+a[n]+"\n"}return{messages:[{role:o.ChatMessageRole.System,content:i},{role:o.ChatMessageRole.User,content:"ROLE: Family member sending a text\nUSER_TEXT: Hey, it is a nice day - the weather is ^^^"},{role:o.ChatMessageRole.Assistant,content:"OK:[great!]END_INSERTION"},{role:o.ChatMessageRole.User,content:"ROLE: Customer service assistant\nUSER_TEXT: You can find more information on^^^\n\nAlternatively, phone us."},{role:o.ChatMessageRole.Assistant,content:"OK:[ our website at NEED_INFO]END_INSERTION"},{role:o.ChatMessageRole.User,content:"ROLE: Casual\nUSER_TEXT: Oh I see!\n\nWell sure thing, we can"},{role:o.ChatMessageRole.Assistant,content:"OK:[ help you out with that!]END_INSERTION"},{role:o.ChatMessageRole.User,content:"ROLE: Storyteller\nUSER_TEXT: Sir Digby Chicken Caesar, also know^^^"},{role:o.ChatMessageRole.Assistant,content:"OK:[n as NEED_INFO]END_INSERTION"},{role:o.ChatMessageRole.User,content:"ROLE: Customer support agent\nUSER_TEXT: Goodbye for now.^^^"},{role:o.ChatMessageRole.Assistant,content:"NO_PREDICTION END_INSERTION"},{role:o.ChatMessageRole.User,content:"ROLE: Pirate\nUSER_TEXT: Have you found^^^"},{role:o.ChatMessageRole.Assistant,content:"OK:[ the treasure, me hearties?]END_INSERTION"},{role:o.ChatMessageRole.User,content:"ROLE: "+this.userRole+"\nUSER_TEXT: "+t+"^^^"+e}],temperature:0,maxTokens:400,stopSequences:["END_INSERTION","NEED_INFO"],frequencyPenalty:0,presencePenalty:0}},L.prototype.requestSuggestionAsync=function(){return Tn(this,void 0,void 0,function(){var e,i,s,n,a;return Pn(this,function(t){switch(t.label){case 0:return this.pendingSuggestionAbort?(this.pendingSuggestionAbort.abort(),[2]):(this.pendingSuggestionAbort=new AbortController,e={textAreaValue:this.textArea.value,cursorPosition:this.textArea.selectionStart},i={textBefore:e.textAreaValue.substring(0,e.cursorPosition),textAfter:e.textAreaValue.substring(e.cursorPosition)},n=this.createSuggestionPrompt(i.textBefore,i.textAfter),"function"!=typeof this.aiSuggestionHandler?[3,2]:[4,this.aiSuggestionHandler(n)]);case 1:n=t.sent(),s=this.validateSuggestion(n,i.textBefore),t.label=2;case 2:if(s&&e.textAreaValue===this.textArea.value&&e.cursorPosition===this.textArea.selectionStart){if(s.endsWith(" ")||(s+=" "),a={text:s,cancel:!1},this.trigger("beforeSuggestionInsert",a),a.cancel)return[2];this.suggestionDisplay.show(a.text)}return[2]}})})},L.prototype.validateSuggestion=function(t,e){var i;return"string"!=typeof t||t.length<=5||0!==t.indexOf("OK:[")?"":(i=(t=0<(i=this.indexOfAny(t,[".","?","!"]))&&t.length>i+1&&" "===t[i+1]?t.substring(0,i+1):t).substring(4).replace(/[\]\s]+$/,""),0<e.length&&" "===e[e.length-1]?i.replace(/^\s+/,""):i)},L.prototype.indexOfAny=function(t,e){for(var i=0;i<t.length;i++)if(-1!==e.indexOf(t[""+i]))return i;return-1},L.prototype.getModuleName=function(){return"smarttextarea"},L.prototype.destroy=function(){xn.prototype.destroy.call(this),this.textArea=null,this.suggestionDisplay=null,this.typingDebounceTimeout=null},Sn([E.Event()],L.prototype,"beforeSuggestionInsert",void 0),Sn([E.Event()],L.prototype,"afterSuggestionInsert",void 0),Sn([E.Property("")],L.prototype,"userRole",void 0),Sn([E.Property([])],L.prototype,"UserPhrases",void 0),Sn([E.Property()],L.prototype,"aiSuggestionHandler",void 0),Sn([E.Property("None")],L.prototype,"showSuggestionOnPopup",void 0),L);function L(t,e){return xn.call(this,t,e)||this}Object.defineProperty(Ln.prototype,"value",{get:function(){var t=this.originalValueProperty.get.call(this.textArea);return this.isShowing()?t.substring(0,this.suggestionStartPos)+t.substring(this.suggestionEndPos):t},set:function(t){this.originalValueProperty.set.call(this.textArea,t)},enumerable:!0,configurable:!0}),Ln.prototype.getOriginalValueProperty=function(t,e){for(;t;){var i=Object.getOwnPropertyDescriptor(t,e);if(i)return i;t=Object.getPrototypeOf(t)}throw new Error("Property "+e+" not found on object or its prototype chain")},Object.defineProperty(Ln.prototype,"valueIncludingSuggestion",{get:function(){return this.originalValueProperty.get.call(this.textArea)},set:function(t){this.originalValueProperty.set.call(this.textArea,t)},enumerable:!0,configurable:!0}),Ln.prototype.isShowing=function(){return null!==this.suggestionStartPos},Ln.prototype.show=function(t){this.latestSuggestionText=t,this.suggestionStartPos=this.textArea.selectionStart,this.suggestionEndPos=this.suggestionStartPos+t.length,this.textArea.setAttribute("data-suggestion-visible",""),this.valueIncludingSuggestion=this.valueIncludingSuggestion.substring(0,this.suggestionStartPos)+t+this.valueIncludingSuggestion.substring(this.suggestionStartPos),this.textArea.setSelectionRange(this.suggestionStartPos,this.suggestionEndPos),this.virtualCaret||(this.virtualCaret=new Nn(this.owner,this.textArea)),this.virtualCaret.show()},Object.defineProperty(Ln.prototype,"currentSuggestion",{get:function(){return this.latestSuggestionText},enumerable:!0,configurable:!0}),Ln.prototype.accept=function(){var t=this.currentSuggestion;this.textArea.setSelectionRange(this.suggestionEndPos,this.suggestionEndPos),this.suggestionStartPos=null,this.suggestionEndPos=null,this.virtualCaret&&this.virtualCaret.hide(),this.textArea.removeAttribute("data-suggestion-visible"),bn.adjustScrollToCaretPosition(this.textArea),this.smartTextArea.trigger("afterSuggestionInsert",{insertedText:t})},Ln.prototype.reject=function(){var t,e;this.isShowing()&&(t=this.textArea.selectionStart,e=this.textArea.selectionEnd,this.valueIncludingSuggestion=this.valueIncludingSuggestion.substring(0,this.suggestionStartPos)+this.valueIncludingSuggestion.substring(this.suggestionEndPos),this.suggestionStartPos===t&&this.suggestionEndPos===e&&this.textArea.setSelectionRange(t,t),this.suggestionStartPos=null,this.suggestionEndPos=null,this.textArea.removeAttribute("data-suggestion-visible"),this.virtualCaret)&&this.virtualCaret.hide()};var wn=Ln;function Ln(t,e,i){this.smartTextArea=t,this.owner=e,this.textArea=i,this.latestSuggestionText="",this.suggestionStartPos=null,this.suggestionEndPos=null,this.virtualCaret=null,this.originalValueProperty=this.getOriginalValueProperty(i,"value")}Object.defineProperty(An.prototype,"currentSuggestion",{get:function(){return this.latestSuggestionText},enumerable:!0,configurable:!0}),An.prototype.show=function(t){this.latestSuggestionText=t,this.suggestionPrefixElement.textContent=" "!==t[0]?this.getPrefixText(this.textArea,20):"",this.suggestionTextElement.textContent=t;var t=bn.getTextAreaPosition(this.textArea),e=this.suggestionElement.style,t=(e.minWidth=null,this.suggestionElement.classList.add("smart-textarea-suggestion-overlay-visible"),e.zIndex=this.textArea.style.zIndex+1,e.top=t.top+"px",t.left-this.suggestionPrefixElement.offsetWidth),t=((!e.left||10<Math.abs(parseFloat(e.left)-t))&&(e.left=t+"px"),this.showing=!0,window.getComputedStyle(this.suggestionElement)),i=parseFloat(t.lineHeight),s=parseFloat(t.paddingTop),t=parseFloat(t.paddingBottom),s=Math.round((this.suggestionElement.offsetHeight-s-t)/i),i=(2<s&&(t=this.suggestionElement.offsetWidth,e.minWidth="calc(min(70vw, "+s*t/2+"px))"),this.suggestionElement.getBoundingClientRect());i.right>document.body.clientWidth-20&&(e.left="calc("+(parseFloat(e.left)-(i.right-document.body.clientWidth))+"px - 2rem)")},An.prototype.accept=function(){var t;this.showing&&(t=this.currentSuggestion,bn.insertCharacter(this.textArea,t),bn.adjustScrollToCaretPosition(this.textArea),this.hide(),this.smartTextArea.trigger("afterSuggestionInsert",{insertedText:t}))},An.prototype.reject=function(){this.hide()},An.prototype.hide=function(){this.showing&&(this.showing=!1,this.suggestionElement.classList.remove("smart-textarea-suggestion-overlay-visible"))},An.prototype.isShowing=function(){return this.showing},An.prototype.handleSuggestionClicked=function(t){t.preventDefault(),t.stopImmediatePropagation(),this.accept()},An.prototype.getPrefixText=function(t,e){for(var i=t.value,s=t.selectionStart,n=s-1;s-e<n;n--)if(n<0||/\s/.test(i[""+n]))return i.substring(n+1,s);return""};var kn=An;function An(t,e,i){var s=this,t=(this.latestSuggestionText="",this.showing=!1,this.smartTextArea=t,this.textArea=i,this.suggestionElement=document.createElement("div"),this.suggestionElement.classList.add("smart-textarea-suggestion-overlay"),this.suggestionElement.addEventListener("mousedown",function(t){return s.handleSuggestionClicked(t)}),this.suggestionElement.addEventListener("touchend",function(t){return s.handleSuggestionClicked(t)}),this.suggestionPrefixElement=document.createElement("span"),this.suggestionTextElement=document.createElement("span"),this.suggestionElement.appendChild(this.suggestionPrefixElement),this.suggestionElement.appendChild(this.suggestionTextElement),this.suggestionPrefixElement.style.opacity="0.3",window.getComputedStyle(this.textArea));this.suggestionElement.style.font=t.font,this.suggestionElement.style.marginTop=1.4*parseFloat(t.fontSize)+"px",e.appendChild(this.suggestionElement)}Hn.prototype.show=function(){var t=bn.getTextAreaPosition(this.textArea),e=this.caretDiv.style;e.display="block",e.top=t.top+"px",e.left=t.left+"px",e.height=t.height+"px",e.zIndex=this.textArea.style.zIndex,e.backgroundColor=t.elemStyle.caretColor},Hn.prototype.hide=function(){this.caretDiv.style.display="none"};var Nn=Hn;function Hn(t,e){this.textArea=e,this.caretDiv=document.createElement("div"),this.caretDiv.classList.add("smart-textarea-caret"),t.appendChild(this.caretDiv)}Bn=function(t,e){return(Bn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Bn,Rn,O=function(t,e){function i(){this.constructor=t}Bn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},Sn=(Rn=E.Component,O(k,Rn),k.prototype.initialize=function(t,e){this.clearArray=[],this.element=t,this.canvasContext=this.element.getContext("2d"),this.canvasContext.canvas.tabIndex=-1,e&&(this.dotnetRef=e,this.isBlazor=!0,this.signatureValue)&&this.loadPersistedSignature(),this.setHTMLProperties(),E.isNullOrUndefined(this.signatureValue)&&this.updateSnapCollection(!0),this.wireEvents(),this.isBlazor||this.trigger("created",null)},k.prototype.wireEvents=function(){!E.isNullOrUndefined(this.pointColl)||this.isReadOnly||this.disabled?this.pointColl&&(E.EventHandler.add(this.canvasContext.canvas,"mousemove touchmove",this.mouseMoveHandler,this),E.EventHandler.add(this.canvasContext.canvas,"mouseup touchend",this.mouseUpHandler,this),E.EventHandler.add(document,"mouseup",this.mouseUpHandler,this)):(E.EventHandler.add(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler,this),E.EventHandler.add(this.canvasContext.canvas,"keydown",this.keyboardHandler,this),this.boundResizeHandler=this.resizeHandler.bind(this),window.addEventListener("resize",this.boundResizeHandler))},k.prototype.unwireEvents=function(t){"mouseup"===t||"touchend"===t?(this.canvasContext&&(E.EventHandler.remove(this.canvasContext.canvas,"mousemove touchmove",this.mouseMoveHandler),E.EventHandler.remove(this.canvasContext.canvas,"mouseup touchend",this.mouseUpHandler)),E.EventHandler.remove(document,"mouseup",this.mouseUpHandler)):(this.canvasContext&&(E.EventHandler.remove(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler),E.EventHandler.remove(this.canvasContext.canvas,"keydown",this.keyboardHandler)),this.boundResizeHandler&&(window.removeEventListener("resize",this.boundResizeHandler),this.boundResizeHandler=null))},k.prototype.setHTMLProperties=function(){150===this.element.height&&300===this.element.width&&0!==this.element.offsetHeight&&0!==this.element.offsetWidth?(this.element.height=this.element.offsetHeight,this.element.width=this.element.offsetWidth,this.isResponsive=!0):this.element.height===this.element.offsetHeight-1&&this.element.width===this.element.offsetWidth-1||0===this.element.offsetHeight||0===this.element.offsetWidth||(this.element.height=this.element.offsetHeight,this.element.width=this.element.offsetWidth),this.canvasContext.fillStyle=this.strokeColor,this.tempCanvas=this.createElement("canvas",{className:"e-"+this.getModuleName()+"-temp"}),this.tempContext=this.tempCanvas.getContext("2d"),this.tempCanvas.width=this.element.width,this.tempCanvas.height=this.element.height,this.backgroundImage?(this.canvasContext.canvas.style.backgroundImage="url("+this.backgroundImage+")",this.canvasContext.canvas.style.backgroundRepeat="no-repeat",this.saveWithBackground&&this.setBackgroundImage(this.backgroundImage,"temp")):this.backgroundColor&&(this.canvasContext.canvas.style.backgroundColor=this.backgroundColor)},k.prototype.mouseDownHandler=function(t){1!==t.buttons&&2!==t.buttons&&"touchstart"!==t.type||("touchstart"===t.type&&(t.preventDefault(),t.stopPropagation()),this.beginStroke(t),this.wireEvents())},k.prototype.mouseMoveHandler=function(t){1!==t.buttons&&2!==t.buttons&&"touchmove"!==t.type||("touchmove"===t.type&&(t.preventDefault(),t.stopPropagation()),this.interval?this.updateStrokeWithThrottle(t):this.updateStroke(t))},k.prototype.mouseUpHandler=function(t){"touchstart"===t.type&&(t.preventDefault(),t.stopPropagation()),this.endDraw(),this.updateSnapCollection(),this.unwireEvents(t.type),this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","mouseUp"):this.trigger("change",{actionName:"strokeUpdate"}),this.signatureValue=this.snapColl[this.incStep];for(var e=0;e<this.signPointsColl.length;e++)this.signRatioPointsColl.push({x:this.signPointsColl[e].x/this.canvasContext.canvas.width,y:this.signPointsColl[e].y/this.canvasContext.canvas.height});this.signPointsColl=[]},k.prototype.keyboardHandler=function(t){var e=this,i={fileName:"Signature",type:"Png",cancel:!1};switch(t.key){case"Delete":this.clear();break;case t.ctrlKey&&"s":this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","beforeSave"):this.trigger("beforeSave",i,function(t){i.cancel||e.save(t.type,t.fileName)}),t.preventDefault(),t.stopImmediatePropagation();break;case t.ctrlKey&&"z":this.undo();break;case t.ctrlKey&&"y":this.redo()}},k.prototype.resizeHandler=function(){var t,e=this;if(this.isResponsive&&this.canRedraw&&this.canvasContext&&this.element){this.canvasContext.canvas.width=this.element.offsetWidth,this.canvasContext.canvas.height=this.element.offsetHeight,this.canvasContext.scale(1,1),this.canvasContext.fillStyle=this.strokeColor;for(var i=(this.minStrokeWidth+this.maxStrokeWidth)/2,s=0;s<this.signRatioPointsColl.length;s++)this.arcDraw(this.signRatioPointsColl[s].x*this.canvasContext.canvas.width,this.signRatioPointsColl[s].y*this.canvasContext.canvas.height,i);this.signPointsColl=[],this.canvasContext.closePath(),this.canvasContext.fill()}else this.canvasContext&&this.element&&((t=new Image).src=this.snapColl[this.incStep],t.onload=function(){e.canvasContext.clearRect(0,0,e.element.width,e.element.height),e.canvasContext.drawImage(t,0,0,e.element.width,e.element.height)})},k.prototype.beginStroke=function(t){this.internalRefresh(),this.updateStroke(t)},k.prototype.updateStroke=function(t){t=this.createPoint(t);this.addPoint(t)},k.prototype.updateStrokeWithThrottle=function(t){var e=Date.now(),i=this.interval-(e-this.previous);this.storedArgs=t,i<=0||i>this.interval?(this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.previous=e,this.updateStroke(this.storedArgs),this.timeout||(this.storedArgs=null)):this.timeout||(this.timeout=window.setTimeout(this.delay.bind(this),i))},k.prototype.delay=function(){this.previous=Date.now(),this.timeout=null,this.updateStroke(this.storedArgs),this.timeout||(this.storedArgs=null)},k.prototype.createPoint=function(t){var e=this.canvasContext.canvas.getBoundingClientRect();return"mousedown"===t.type||"mousemove"===t.type?this.point(t.clientX-e.left,t.clientY-e.top,(new Date).getTime()):this.point(t.touches[0].clientX-e.left,t.touches[0].clientY-e.top,(new Date).getTime())},k.prototype.point=function(t,e,i){return this.pointX=t,this.pointY=e,this.time=i||(new Date).getTime(),{x:this.pointX,y:this.pointY,time:this.time}},k.prototype.addPoint=function(t){var e=this.pointColl,i=0<e.length&&e[e.length-1],s=!!i&&this.distanceTo(i)<=this.minDistance;i&&s||(e.push(t),2<e.length&&(3===e.length&&e.unshift(e[0]),i=this.calculateCurveControlPoints(e[0],e[1],e[2]).controlPoint2,s=this.calculateCurveControlPoints(e[1],e[2],e[3]).controlPoint1,this.startPoint=e[1],this.controlPoint1=i,this.controlPoint2=s,this.endPoint=e[2],this.startDraw(),e.shift()))},k.prototype.startDraw=function(){var t=this.pointVelocityCalc(this.startPoint),e=(t=this.velocity*t+(1-this.velocity)*this.lastVelocity,Math.max(this.maxStrokeWidth/(1+t),this.minStrokeWidth));this.curveDraw(this.lastWidth,e),this.lastVelocity=t,this.lastWidth=e},k.prototype.endDraw=function(){var t,e;E.isNullOrUndefined(this.pointColl)||(t=2<this.pointColl.length,e=this.pointColl[0],!t&&e&&this.strokeDraw(e))},k.prototype.curveDraw=function(t,e){var i,s,n,a,l,r,o,h,p=this.canvasContext,d=e-t,e=this.bezierLengthCalc(),u=2*Math.ceil(e);for(p.beginPath(),i=0;i<u;i++)o=(h=(r=(l=1-(s=i/u))*l)*l)*this.startPoint.x,o=(o=(o+=3*r*s*this.controlPoint1.x)+3*l*(n=s*s)*this.controlPoint2.x)+(a=n*s)*this.endPoint.x,h=h*this.startPoint.y,h=(h=(h+=3*r*s*this.controlPoint1.y)+3*l*n*this.controlPoint2.y)+a*this.endPoint.y,r=Math.min(t+a*d,this.maxStrokeWidth),this.arcDraw(o,h,r);p.closePath(),p.fill(),this.isSignatureEmpty=!1},k.prototype.strokeDraw=function(t){var e=this.canvasContext,i=(this.minStrokeWidth+this.maxStrokeWidth)/2;e.beginPath(),this.arcDraw(t.x,t.y,i),e.closePath(),e.fill(),this.isSignatureEmpty=!1},k.prototype.arcDraw=function(t,e,i){this.signPointsColl.push({x:t,y:e});var s=this.canvasContext;s.moveTo(t,e),s.arc(t,e,i,0,2*Math.PI,!1)},k.prototype.calculateCurveControlPoints=function(t,e,i){var s=t.x-e.x,n=t.y-e.y,a=e.x-i.x,l=e.y-i.y,r=(t.x+e.x)/2,t=(t.y+e.y)/2,o=(e.x+i.x)/2,i=(e.y+i.y)/2,s=Math.sqrt(s*s+n*n),n=Math.sqrt(a*a+l*l),a=n/(s+n),l=o+(r-o)*a,s=i+(t-i)*a,n=e.x-l,a=e.y-s;return{controlPoint1:this.point(r+n,t+a,0),controlPoint2:this.point(o+n,i+a,0)}},k.prototype.bezierLengthCalc=function(){for(var t,e,i,s,n,a,l=0,r=0;r<=10;r++)t=this.bezierPointCalc(e=r/10,this.startPoint.x,this.controlPoint1.x,this.controlPoint2.x,this.endPoint.x),e=this.bezierPointCalc(e,this.startPoint.y,this.controlPoint1.y,this.controlPoint2.y,this.endPoint.y),0<r&&(n=t-i,a=e-s,l+=Math.sqrt(n*n+a*a)),i=t,s=e;return l},k.prototype.bezierPointCalc=function(t,e,i,s,n){return e*(1-t)*(1-t)*(1-t)+3*i*(1-t)*(1-t)*t+3*s*(1-t)*t*t+n*t*t*t},k.prototype.pointVelocityCalc=function(t){return this.time!==t.time?this.distanceTo(t)/(this.time-t.time):0},k.prototype.distanceTo=function(t){return Math.sqrt(Math.pow(this.pointX-t.x,2)+Math.pow(this.pointY-t.y,2))},k.prototype.isRead=function(t){t?E.EventHandler.remove(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler):this.disabled||E.EventHandler.add(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler,this)},k.prototype.enableOrDisable=function(t){(this.disabled=t)?(this.canvasContext.canvas.style.filter="opacity(0.5)",this.isRead(!0)):(this.canvasContext.canvas.style.filter="",this.isRead(!1))},k.prototype.updateSnapCollection=function(t){var e,i;E.isNullOrUndefined(this.incStep)?(this.incStep=-1,this.incStep++,this.snapColl=[],this.clearArray=[]):this.incStep++,this.incStep<this.snapColl.length&&(this.snapColl.length=this.incStep),0<this.incStep?(i=(e=this.createElement("canvas",{className:"e-"+this.getModuleName()+"-wrapper"})).getContext("2d"),this.canvasContext&&(e.width=this.canvasContext.canvas.width,e.height=this.canvasContext.canvas.height,i.drawImage(this.canvasContext.canvas,0,0,e.width,e.height),this.snapColl.push(e.toDataURL()))):this.snapColl.push(this.canvasContext.canvas.toDataURL()),t&&this.clearArray.push(this.incStep)},k.prototype.setBackgroundImage=function(t,e){var i=this,s=new Image;s.crossOrigin="anonymous",s.src=t,"temp"===e?s.onload=function(){i.tempContext.globalCompositeOperation="source-over",i.tempContext.drawImage(s,0,0,i.element.width,i.element.height)}:(s.onload=function(){i.canvasContext.globalCompositeOperation="source-over",i.canvasContext.drawImage(s,0,0,i.element.width,i.element.height),i.updateSnapCollection(),i.saveBackground(!0)},this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height))},k.prototype.setBackgroundColor=function(t){var e,i,s=this.canvasContext;for(s.strokeStyle=t,e=1;e<=s.canvas.width;e++)for(i=1;i<=s.canvas.height;i++)s.strokeRect(0,0,e,i);this.updateSnapCollection()},k.prototype.loadPersistedSignature=function(){var t,e;E.isNullOrUndefined(this.signatureValue)||(t=this,(e=new Image).src=this.signatureValue,e.onload=function(){t.canvasContext.clearRect(0,0,t.element.width,t.element.height),t.canvasContext.drawImage(e,0,0),t.updateSnapCollection()},this.isSignatureEmpty=!1)},k.prototype.getBlob=function(t){for(var t=t.split(","),e=t[0].match(/:(.*?);/)[1],i=atob(t[1]),s=i.length,n=new Uint8Array(s);s--;)n[s]=i.charCodeAt(s);return new Blob([n],{type:e})},k.prototype.download=function(t,e){var t=URL.createObjectURL(t),i=document.createElement("a");i.href=t,i.target="_parent",i.download=e,(document.body||document.documentElement).appendChild(i),i.click(),i.parentNode.removeChild(i)},k.prototype.internalRefresh=function(){this.pointColl=[],this.lastVelocity=0,this.lastWidth=(this.minStrokeWidth+this.maxStrokeWidth)/2},k.prototype.refresh=function(){this.isResponsive=!1,this.setHTMLProperties(),this.resizeHandler(),this.internalRefresh()},k.prototype.clear=function(){this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height),this.tempContext.clearRect(0,0,this.tempContext.canvas.width,this.tempContext.canvas.height),this.saveWithBackground&&this.backgroundImage&&this.setBackgroundImage(this.backgroundImage,"temp"),this.internalRefresh(),this.signRatioPointsColl=[],this.updateSnapCollection(!0),this.isSignatureEmpty=this.canRedraw=!0,this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","Clear"):this.trigger("change",{actionName:"clear"})},k.prototype.undo=function(){var t,e=this;0<this.incStep&&(this.incStep--,(t=new Image).src=this.snapColl[this.incStep],t.onload=function(){e.canvasContext.clearRect(0,0,e.element.width,e.element.height),e.canvasContext.drawImage(t,0,0,e.element.width,e.element.height)}),this.isClear(),this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","Undo"):this.trigger("change",{actionName:"undo"})},k.prototype.redo=function(){var t,e=this;this.incStep<this.snapColl.length-1&&(this.incStep++,(t=new Image).src=this.snapColl[this.incStep],t.onload=function(){e.canvasContext.clearRect(0,0,e.element.width,e.element.height),e.canvasContext.drawImage(t,0,0,e.element.width,e.element.height)}),this.isClear(),this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","Redo"):this.trigger("change",{actionName:"redo"})},k.prototype.isClear=function(){if(this.clearArray){for(var t=!1,e=0;e<this.clearArray.length;e++)this.clearArray[e]===this.incStep&&(t=this.isSignatureEmpty=!0);t||(this.isSignatureEmpty=!1)}},k.prototype.isEmpty=function(){return this.isSignatureEmpty},k.prototype.canUndo=function(){return 0<this.incStep},k.prototype.canRedo=function(){return this.incStep<this.snapColl.length-1},k.prototype.draw=function(t,e,i,s,n){this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height),this.canvasContext.font=(i=i||30)+"px "+(e=e||"Arial");var e=this.element.width/2,a=this.element.height/2;E.isNullOrUndefined(s)&&E.isNullOrUndefined(n)?(this.canvasContext.textAlign="center",this.canvasContext.textBaseline="middle"):(e=E.isNullOrUndefined(s)?e:s,a=E.isNullOrUndefined(n)?a+i/2:n+i/2),this.canvasContext.fillText(t,e,a),this.updateSnapCollection(),this.isSignatureEmpty=!1,this.trigger("change",{actionName:"draw-text"})},k.prototype.load=function(i,s,n){n=n||this.element.height,s=s||this.element.width,this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height);var a=this,t=new Image;"data"!==(t.src=i).slice(0,4)&&(t.crossOrigin="anonymous"),t.onload=function(){Promise.all([createImageBitmap(t,0,0,s,n)]).then(function(t){var e=document.createElement("canvas");e.width=s,e.height=n,e.getContext("2d").drawImage(t[0],0,0),"data"!==i.slice(0,4)&&(a.canvasContext.globalCompositeOperation="source-over"),a.canvasContext.drawImage(e,0,0,s,n,0,0,a.element.width,a.element.height),a.updateSnapCollection()})},this.isSignatureEmpty=this.canRedraw=!1},k.prototype.saveBackground=function(t){var e,i,s=t&&this.backgroundImage?this.snapColl[this.incStep-1]:this.snapColl[this.incStep];t||(this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height),this.backgroundImage?this.setBackgroundImage(this.backgroundImage):this.backgroundColor&&(this.setBackgroundColor(this.backgroundColor),t=!0)),t&&(e=this,(i=new Image).crossOrigin="anonymous",i.src=s,i.onload=function(){e.backgroundLoaded=!0,e.canvasContext.globalCompositeOperation="source-over",e.canvasContext.drawImage(i,0,0,e.element.width,e.element.height),e.save(e.fileType,e.fileName)})},k.prototype.save=function(t,e){var i;this.saveWithBackground&&null==this.backgroundLoaded&&(this.backgroundImage||this.backgroundColor)?(this.backgroundLoaded=!1,this.fileType=t,this.fileName=e,this.saveBackground(!1)):"Svg"===t?this.toSVG(e=e||"Signature"):"Jpeg"===t?(e=e||"Signature",!this.saveWithBackground||this.saveWithBackground&&!this.backgroundImage&&!this.backgroundColor?this.toJPEG(e):(i=this.canvasContext.canvas.toDataURL("image/jpeg"),this.download(this.getBlob(i),e+".jpeg"))):(e=e||"Signature",i=this.canvasContext.canvas.toDataURL("image/png"),this.download(this.getBlob(i),e+".png")),this.saveWithBackground&&this.backgroundLoaded&&this.resetSnap()},k.prototype.resetSnap=function(){this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height);var t=this,e=new Image;e.src=this.snapColl[this.incStep-1],e.onload=function(){t.canvasContext.drawImage(e,0,0,t.element.width,t.element.height),t.updateSnapCollection()},this.backgroundLoaded=null,this.snapColl.pop(),this.incStep--,this.snapColl.pop(),this.incStep--},k.prototype.toJPEG=function(e){var i=this,t=this.snapColl[this.incStep],s=(this.setBackgroundColor("#ffffff"),this),n=new Image;n.crossOrigin="anonymous",n.src=t,n.onload=function(){s.canvasContext.globalCompositeOperation="source-over",s.canvasContext.drawImage(n,0,0,s.element.width,s.element.height);var t=s.canvasContext.canvas.toDataURL("image/jpeg");s.download(s.getBlob(t),e+".jpeg"),s.canvasContext.clearRect(0,0,s.canvasContext.canvas.width,s.canvasContext.canvas.height),i.resizeHandler()},this.snapColl.pop(),this.incStep--},k.prototype.toSVG=function(t,e){var i=document.createElementNS("http://www.w3.org/2000/svg","svg"),s=(i.setAttribute("width",this.canvasContext.canvas.width.toString()),i.setAttribute("height",this.canvasContext.canvas.height.toString()),document.createElementNS("http://www.w3.org/2000/svg","image")),e=(s.setAttributeNS(null,"height",this.canvasContext.canvas.height.toString()),s.setAttributeNS(null,"width",this.canvasContext.canvas.width.toString()),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e),i.appendChild(s),'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+this.canvasContext.canvas.width+'" height="'+this.canvasContext.canvas.height+'">'),s=i.innerHTML,i="data:image/svg+xml;base64,"+btoa(e+s+"</svg>");return null==t?i:(this.download(this.getBlob(i),t+".svg"),null)},k.prototype.saveAsBlob=function(){return this.getBlob(this.canvasContext.canvas.toDataURL("image/png"))},k.prototype.getSignature=function(t){return this.saveWithBackground&&this.backgroundColor&&!this.backgroundImage?(this.tempContext.fillStyle=this.backgroundColor,this.tempContext.fillRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height)):this.backgroundColor||this.backgroundImage||"Jpeg"!==t||(this.tempContext.fillStyle="#fff",this.tempContext.fillRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height)),this.tempContext.drawImage(this.element,0,0),"Jpeg"===t?this.tempCanvas.toDataURL("image/jpeg"):"Svg"===t?this.toSVG(null,this.tempCanvas.toDataURL("image/png")):this.tempCanvas.toDataURL("image/png")},k.prototype.getModuleName=function(){return"signature"},k.prototype.getPersistData=function(){return this.signatureValue=this.snapColl[this.incStep],this.addOnPersist(["signatureValue"])},k.prototype.destroy=function(){"image-editor"!==this.getModuleName()&&(this.unwireEvents(null),E.removeClass([this.element],"e-"+this.getModuleName()),this.element.removeAttribute("tabindex"),this.pointColl=null,this.tempContext=null,this.tempCanvas=null,this.canvasContext=null),Rn.prototype.destroy.call(this),this.element=null},k.prototype.propertyChanged=function(t,e){var i=this.canvasContext;switch(t){case"backgroundColor":i.canvas.style.backgroundColor=e,this.backgroundColor=e;break;case"backgroundImage":i.canvas.style.backgroundImage="url("+e+")",this.backgroundImage=e,this.saveWithBackground&&this.setBackgroundImage(this.backgroundImage,"temp");break;case"strokeColor":i.fillStyle=e,this.strokeColor=e;break;case"saveWithBackground":this.saveWithBackground=e;break;case"maxStrokeWidth":this.maxStrokeWidth=e;break;case"minStrokeWidth":this.minStrokeWidth=e;break;case"velocity":this.velocity=e;break;case"isReadOnly":this.isRead(e);break;case"disabled":this.enableOrDisable(e)}},k);function k(){var t=null!==Rn&&Rn.apply(this,arguments)||this;return t.minDistance=5,t.previous=0,t.interval=30,t.timeout=null,t.isSignatureEmpty=!0,t.backgroundLoaded=null,t.isBlazor=!1,t.isResponsive=!1,t.signPointsColl=[],t.signRatioPointsColl=[],t.canRedraw=!0,t}Un=function(t,e){return(Un=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Un,A,O=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},O=(function(t,e){function i(){this.constructor=t}Un(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(N,A=Sn),N.prototype.preRender=function(){},N.prototype.render=function(){this.initialize()},N.prototype.initialize=function(){this.element.setAttribute("role","img"),this.element.setAttribute("aria-label","signature"),E.addClass([this.element],"e-"+this.getModuleName()),A.prototype.initialize.call(this,this.element),this.enablePersistence&&this.loadPersistedSignature()},N.prototype.getModuleName=function(){return A.prototype.getModuleName.call(this)},N.prototype.getPersistData=function(){return A.prototype.getPersistData.call(this)},N.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i];switch(n){case"backgroundColor":A.prototype.propertyChanged.call(this,n,t.backgroundColor);break;case"backgroundImage":A.prototype.propertyChanged.call(this,n,t.backgroundImage);break;case"strokeColor":t.strokeColor!==e.strokeColor&&A.prototype.propertyChanged.call(this,n,t.strokeColor);break;case"maxStrokeWidth":t.maxStrokeWidth!==e.maxStrokeWidth&&A.prototype.propertyChanged.call(this,n,t.maxStrokeWidth);break;case"minStrokeWidth":t.minStrokeWidth!==e.minStrokeWidth&&A.prototype.propertyChanged.call(this,n,t.minStrokeWidth);break;case"velocity":t.velocity!==e.velocity&&A.prototype.propertyChanged.call(this,n,t.velocity);break;case"saveWithBackground":A.prototype.propertyChanged.call(this,n,t.saveWithBackground);break;case"isReadOnly":A.prototype.propertyChanged.call(this,n,t.isReadOnly);break;case"disabled":A.prototype.propertyChanged.call(this,n,t.disabled)}}},O([E.Property("")],N.prototype,"backgroundColor",void 0),O([E.Property("")],N.prototype,"backgroundImage",void 0),O([E.Property(!1)],N.prototype,"disabled",void 0),O([E.Property(!1)],N.prototype,"isReadOnly",void 0),O([E.Property(!0)],N.prototype,"saveWithBackground",void 0),O([E.Property("#000000")],N.prototype,"strokeColor",void 0),O([E.Property(.5)],N.prototype,"minStrokeWidth",void 0),O([E.Property(2)],N.prototype,"maxStrokeWidth",void 0),O([E.Property(.7)],N.prototype,"velocity",void 0),O([E.Property("en-US")],N.prototype,"locale",void 0),O([E.Property(!1)],N.prototype,"enableRtl",void 0),O([E.Property(!1)],N.prototype,"enablePersistence",void 0),O([E.Event()],N.prototype,"beforeSave",void 0),O([E.Event()],N.prototype,"change",void 0),O([E.Event()],N.prototype,"created",void 0),O([E.NotifyPropertyChanges],N));function N(t,e){return A.call(this,t,e)||this}In=function(t,e){return(In=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var In,Fn,Vn=function(t,e){function i(){this.constructor=t}In(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},H=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},Mn="e-rating-icon e-icons e-star-filled",Dn="e-rating-item-list",Wn="e-rating-item-container",zn="e-rating-selected",qn="e-rating-intermediate",jn="e-rating-hidden",_n="e-disabled",Xn="e-rating-readonly",Kn="e-rating-animation",Yn="e-rating-full",Zn="e-rating-empty",Gn="e-selected-value",Jn=((Jn=o.LabelPosition||(o.LabelPosition={})).Top="Top",Jn.Bottom="Bottom",Jn.Left="Left",Jn.Right="Right",(Jn=o.PrecisionType||(o.PrecisionType={})).Full="Full",Jn.Half="Half",Jn.Quarter="Quarter",Jn.Exact="Exact",Fn=E.Component,Vn(B,Fn),B.prototype.preRender=function(){this.element.id||(this.element.id=E.getUniqueID("e-"+this.getModuleName())),this.keyConfigs={downarrow:"downarrow",leftarrow:"leftarrow",rightarrow:"rightarrow",uparrow:"uparrow",space:"space"},this.tooltipOpen=!1,this.isTouchSelected=!1,E.closest(this.element,"form")&&this.element.getAttribute("value")&&this.setProperties({value:this.element.getAttribute("value")},!0)},B.prototype.render=function(){this.initialize(),this.updateMinValue(),this.updateTemplateFunction(),this.triggerChange(null,this.value,!1,!0),this.renderItems(),this.displayLabel()},B.prototype.initialize=function(){this.wrapper=this.createElement("div",{className:"e-"+this.getModuleName()+"-container "}),this.element.parentNode.insertBefore(this.wrapper,this.element),this.wrapper.appendChild(this.element),null==this.element.getAttribute("name")&&this.element.setAttribute("name",this.element.id),E.attributes(this.element,{"aria-label":"rating"}),this.renderItemList(),this.updateReset(),this.readOnly&&this.wrapper.classList.add(Xn),this.visible||this.wrapper.classList.add(jn),this.enableRtl&&this.wrapper.classList.add("e-rtl"),this.enableAnimation&&this.wrapper.classList.add(Kn),this.cssClass&&E.addClass([this.wrapper],this.cssClass.split(" ")),this.updateTooltip(),this.wireKeyboardEvent(),this.updateDisabled()},B.prototype.updateDisabled=function(){this.wrapper.classList[this.disabled?"add":"remove"](_n),E.attributes(this.ratingItemList,{tabindex:this.disabled?"-1":"0"}),this.updateResetButton()},B.prototype.updateResetButton=function(){var t;this.allowReset&&(this.resetElement&&this.resetElement.blur(),t=this.value<=this.min||this.disabled,this.resetElement.classList[t?"add":"remove"](_n),E.attributes(this.resetElement,{tabindex:t?"-1":"0","aria-hidden":t.toString()}))},B.prototype.renderItemList=function(){var e=this;this.ratingItemList=this.createElement("div",{className:Dn,id:this.element.id+"_item-list"}),E.attributes(this.ratingItemList,{"aria-label":"rating",role:"slider"}),this.wrapper.appendChild(this.ratingItemList),E.EventHandler.add(this.ratingItemList,"touchmove",function(t){return e.touchMoveHandler(t)},this),E.EventHandler.add(this.ratingItemList,E.Browser.touchEndEvent,this.touchEndHandler,this)},B.prototype.touchMoveHandler=function(t){this.isTouchSelected||(this.wrapper.classList.add("e-rating-touch"),this.isTouchSelected=!0),this.wrapper.classList.add("e-touch-select");var e,i=this.ratingItemList.getBoundingClientRect(),i=(t.touches[0].clientX-i.x)/i.width*this.itemsCount,s=(i=(i=this.enableRtl?this.itemsCount-i:i)<this.min?this.min:i>this.itemsCount?this.itemsCount:i,0===(i=this.validateValue(i))?null:this.itemElements[parseInt((Math.ceil(i)-1).toString(),10)]);i===this.currentValue?this.showTooltip&&s&&this.openRatingTooltip(s,!1):(e=this.currentValue,this.triggerChange(t,i),this.updateCurrentValue(i),this.showTooltip&&(s?(Math.ceil(i)!==Math.ceil(e)&&this.closeRatingTooltip(),this.openRatingTooltip(s,!0)):this.closeRatingTooltip()))},B.prototype.touchEndHandler=function(){this.closeRatingTooltip(),this.wrapper.classList.remove("e-touch-select")},B.prototype.updateTemplateFunction=function(){this.emptyTemplateFunction=this.emptyTemplate?this.getTemplateString(this.emptyTemplate):null,this.fullTemplateFunction=this.fullTemplate?this.getTemplateString(this.fullTemplate):null},B.prototype.renderItems=function(){for(var e=this,t=0;t<this.itemsCount;t++){var i=this.createElement("span",{className:Wn}),s=this.createElement("span",{className:"e-rating-item"}),n=this.getRatingValue(this.value,t),n=(this.renderItemContent(s,n,t,!1),i.appendChild(s),this.wireItemsEvents(i,t+1),this.itemElements.push(i),{element:i,value:t+1});this.trigger("beforeItemRender",n,function(t){e.ratingItemList.appendChild(t.element)})}E.attributes(this.ratingItemList,{"aria-valuemax":this.itemsCount.toString()}),this.updateItemValue(!1)},B.prototype.renderItemContent=function(t,e,i,s){s&&this.removeItemContent(t),this.fullTemplate&&1===e?(t.classList.add(Yn),E.append(this.fullTemplateFunction({index:i,ratingValue:e},this,"ratingFullTemplate",this.element.id+"fullTemplate",this.isStringTemplate),t)):this.emptyTemplate?(t.classList.add(Zn),E.append(this.emptyTemplateFunction({index:i,ratingValue:e},this,"ratingEmptyTemplate",this.element.id+"emptyTemplate",this.isStringTemplate),t)):E.addClass([t],Mn.split(" "))},B.prototype.removeItemContent=function(t){t.classList.remove(Yn,Zn),E.removeClass([t],Mn.split(" ")),t.firstChild&&(t.innerHTML="")},B.prototype.updateTooltip=function(){this.showTooltip?(this.tooltipObj=new h.Tooltip({target:".e-rating-item-container",windowCollision:!0,opensOn:"Custom",cssClass:this.cssClass?"e-rating-tooltip "+this.cssClass:"e-rating-tooltip"}),this.tooltipObj.appendTo(this.ratingItemList)):E.isNullOrUndefined(this.tooltipObj)||(this.tooltipObj.destroy(),this.tooltipObj=null)},B.prototype.updateMinValue=function(){this.setProperties({min:this.validateValue(this.min)},!0),0<this.min&&this.value<this.min&&this.triggerChange(null,this.min,!1),E.attributes(this.ratingItemList,{"aria-valuemin":this.min.toString()})},B.prototype.validateValue=function(t){return t=t>this.itemsCount?this.itemsCount:t<0?0:this.precision===o.PrecisionType.Full||this.enableSingleSelection?Math.round(t):this.precision===o.PrecisionType.Half?Math.round(2*t)/2:this.precision===o.PrecisionType.Quarter?Math.round(4*t)/4:Math.round(10*t)/10},B.prototype.getRatingValue=function(t,e){return this.enableSingleSelection?e<t&&t<=e+1?1:0:e+1<=t?1:t<e?0:t-e},B.prototype.updateItemValue=function(t){void 0===t&&(t=!0);for(var e=0;e<this.itemsCount;e++){var i=this.itemElements[parseInt(e.toString(),10)],s=(i.classList.remove(zn,qn,Gn),this.getRatingValue(this.currentValue,e));1===s?i.classList.add(zn):0<s?i.classList.add(qn):this.precision===o.PrecisionType.Full&&e+1<=this.value&&!this.enableSingleSelection&&i.classList.add(Gn),t&&this.updateItemContent(s,e),i.style.setProperty("--rating-value",100*s+"%"),i.classList[0===this.value&&0===e||this.value===e+1||0<s&&s<1?"add":"remove"]("e-rating-focus")}t&&this.renderReactTemplates(),this.updateResetButton(),E.attributes(this.ratingItemList,{"aria-valuenow":this.currentValue.toString()}),E.attributes(this.element,{value:this.value.toString()})},B.prototype.updateItemContent=function(t,e){var i;(this.fullTemplate||this.emptyTemplate)&&(i=this.itemElements[parseInt(e.toString(),10)].querySelector(".e-rating-item"),this.fullTemplate&&1===t?i.classList.contains(Yn)||(this.removeItemContent(i),i.classList.add(Yn),E.append(this.fullTemplateFunction({ratingValue:t,index:e},this,"ratingFullTemplate",this.element.id+"fullTemplate"+e,this.isStringTemplate),i)):this.emptyTemplate?i.classList.contains(Zn)||(this.removeItemContent(i),i.classList.add(Zn),E.append(this.emptyTemplateFunction({ratingValue:t,index:e},this,"ratingEmptyTemplate",this.element.id+"emptyTemplate"+e,this.isStringTemplate),i)):(this.removeItemContent(i),E.addClass([i],Mn.split(" "))))},B.prototype.updateTooltipContent=function(t){var e,i,s=this;this.showTooltip&&(this.isReact&&this.clearTemplate(["ratingTooltipTemplate"]),this.tooltipTemplate?(e=this.createElement("span",{className:"e-rating-tooltip-content"}),i=this.getTemplateString(this.tooltipTemplate),E.append(i({value:this.currentValue},this,"ratingTooltipTemplate",this.element.id+"tooltipTemplate",this.isStringTemplate),e),this.tooltipObj.setProperties({content:e},t),this.isAngular&&setTimeout(function(){var t=s.ratingItemList.querySelectorAll("."+Wn+"."+zn);s.tooltipObj.refresh(t[t.length-1])})):(e=this.currentValue.toString(),this.tooltipObj.setProperties({content:E.initializeCSPTemplate(function(){return e})},t)),this.renderReactTemplates())},B.prototype.getTemplateString=function(e){var t,i="";try{i="function"!=typeof e&&(t=E.select(e))?"SCRIPT"===t.tagName?t.innerHTML:t.outerHTML:e}catch(t){i=e}return E.compile(i)},B.prototype.displayLabel=function(){this.showLabel?(this.spanLabel=this.createElement("span",{className:"e-rating-label"}),this.updateLabel(),this.updateLabelPosition()):this.wrapper.contains(this.spanLabel)&&(E.remove(this.spanLabel),this.spanLabel=null)},B.prototype.updateLabel=function(){var t;this.showLabel&&(this.labelTemplate?(this.isReact&&this.clearTemplate(["ratingLabelTemplate"]),this.spanLabel.firstChild&&(this.spanLabel.innerHTML=""),t=this.getTemplateString(this.labelTemplate),E.append(t({value:this.currentValue},this,"ratingLabelTemplate",this.element.id+"labelTemplate",this.isStringTemplate),this.spanLabel),this.renderReactTemplates()):this.spanLabel.textContent=this.currentValue+" / "+this.itemsCount)},B.prototype.updateReset=function(){this.allowReset?(this.resetElement=this.createElement("span",{className:"e-icons e-reset",attrs:{"aria-label":"resetbutton",role:"button"}}),this.updateResetButton(),E.EventHandler.add(this.resetElement,"click",this.resetClicked,this),this.wrapper.insertBefore(this.resetElement,this.ratingItemList)):this.wrapper.contains(this.resetElement)&&(E.remove(this.resetElement),this.resetElement=null)},B.prototype.updateLabelPosition=function(){this.clearLabelPosition(),this.spanLabel.classList.add("e-label-"+this.labelPosition.toLowerCase()),"Left"===this.labelPosition||"Top"===this.labelPosition?this.wrapper.firstChild.after(this.spanLabel):this.wrapper.appendChild(this.spanLabel)},B.prototype.clearLabelPosition=function(){var t=this.spanLabel.classList.value.match(/(e-label-[top|bottom|right|left]+)/g);t&&E.removeClass([this.spanLabel],t)},B.prototype.wireItemsEvents=function(t,e){var i=this;E.EventHandler.add(t,"click",function(t){return i.clickHandler(t)},this),E.EventHandler.add(t,"mousemove",function(t){return i.mouseMoveHandler(e,t)},this),E.EventHandler.add(t,"mouseleave",this.mouseLeaveHandler,this)},B.prototype.clickHandler=function(t){this.currentValue=0<this.min&&this.currentValue<this.min?this.min:this.currentValue,this.triggerChange(t,this.currentValue),this.updateItemValue(),this.updateLabel(),this.updateResetButton()},B.prototype.updateValueChange=function(t,e,i){this.triggerChange(t,e,i=void 0===i?!0:i),this.updateItemValue(),this.updateLabel()},B.prototype.triggerChange=function(t,e,i,s){void 0===i&&(i=!0),void 0===s&&(s=!1);e=this.validateValue(e),this.currentValue=e,this.currentValue===this.value||(t={event:t,isInteracted:i,value:e,previousValue:this.value},this.setProperties({value:e},!0),this.isAngular&&!s&&this.localChange({value:e}),s)||this.trigger("valueChanged",t)},B.prototype.mouseMoveHandler=function(t,e){this.isTouchSelected&&(this.wrapper.classList.remove("e-rating-touch"),this.isTouchSelected=!1);var i=this.calculateCurrentValue(t,e),i=this.validateValue(i),t=this.itemElements[parseInt((t-1).toString(),10)];i===this.currentValue?this.openRatingTooltip(t,!1):(this.updateCurrentValue(i),this.openRatingTooltip(t,!0),this.trigger("onItemHover",{element:t,event:e,value:i}))},B.prototype.openRatingTooltip=function(t,e){this.showTooltip&&(this.tooltipOpen?e&&(this.updateTooltipContent(!0),this.tooltipObj.refresh(t)):(this.updateTooltipContent(!1),this.tooltipObj.open(t),this.tooltipOpen=!0))},B.prototype.closeRatingTooltip=function(){this.tooltipOpen&&(this.tooltipObj.close(),this.tooltipOpen=!1)},B.prototype.updateCurrentValue=function(t){this.currentValue=t,this.updateItemValue(),this.updateLabel()},B.prototype.mouseLeaveHandler=function(){this.closeRatingTooltip(),this.updateCurrentValue(this.value)},B.prototype.calculateCurrentValue=function(t,e){var i=t;return this.enableSingleSelection||this.precision===o.PrecisionType.Full||(i=e.offsetX/this.itemElements[t-1].clientWidth,i=this.enableRtl?1-i:i,this.precision===o.PrecisionType.Quarter?i=i<=.25?.25:i<=.5?.5:i<.75?.75:1:this.precision===o.PrecisionType.Half&&(i=i<=.5?.5:1),i=i+t-1),i},B.prototype.reset=function(){this.resetClicked(null,!1)},B.prototype.resetClicked=function(t,e){this.updateValueChange(t,this.min,e=void 0===e?!0:e),this.updateResetButton()},B.prototype.wireKeyboardEvent=function(){this.keyboardModuleRating=new E.KeyboardEvents(this.wrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},B.prototype.keyActionHandler=function(t){if(t.preventDefault(),!this.disabled&&!this.readOnly){if(t.target.classList.contains(Dn))switch(t.action){case"uparrow":this.handleNavigation(t,!0);break;case"downarrow":this.handleNavigation(t,!1);break;case"leftarrow":this.handleNavigation(t,this.enableRtl);break;case"rightarrow":this.handleNavigation(t,!this.enableRtl)}this.allowReset&&t.target.classList.contains("e-reset")&&"space"===t.action&&this.resetClicked(t)}},B.prototype.handleNavigation=function(t,e){var i;(!e&&this.value>this.min||e&&this.value<this.itemsCount)&&(i=this.precision===o.PrecisionType.Full||this.enableSingleSelection?1:this.precision===o.PrecisionType.Half?.5:this.precision===o.PrecisionType.Quarter?.25:Math.round(1)/10,i=e?this.value+i:this.value-i,this.updateValueChange(t,i),this.updateResetButton())},B.prototype.updateContent=function(){for(var t=0;t<this.itemsCount;t++){var e=this.itemElements[parseInt(t.toString(),10)].firstElementChild;this.renderItemContent(e,this.getRatingValue(this.value,t),t,!0)}},B.prototype.getModuleName=function(){return"rating"},B.prototype.getPersistData=function(){return this.addOnPersist([])},B.prototype.removeItemElements=function(){for(var t=0;t<this.itemElements.length;t++)E.remove(this.itemElements[parseInt(t.toString(),10)]);this.itemElements=[]},B.prototype.destroy=function(){var e=this;Fn.prototype.destroy.call(this),this.removeItemElements(),this.clearTemplate(),this.spanLabel&&(E.remove(this.spanLabel),this.spanLabel=null),this.resetElement&&(E.remove(this.resetElement),this.resetElement=null),this.showTooltip&&(this.tooltipObj.destroy(),this.tooltipObj=null),E.remove(this.ratingItemList),this.ratingItemList=null,this.wrapper.parentNode.insertBefore(this.element,this.wrapper),E.remove(this.wrapper),this.wrapper=null,this.keyboardModuleRating.destroy(),this.keyboardModuleRating=null,["value","aria-label","name"].forEach(function(t){e.element.removeAttribute(t)})},H([E.Property(!(B.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"value":this.updateValueChange(null,this.value>this.min?this.value:this.min,!1);break;case"min":this.updateMinValue(),this.updateItemValue(),this.updateLabel();break;case"showLabel":this.displayLabel();break;case"visible":this.wrapper.classList[this.visible?"remove":"add"](jn);break;case"disabled":this.updateDisabled();break;case"readOnly":this.wrapper.classList[this.readOnly?"add":"remove"](Xn);break;case"allowReset":this.updateReset();break;case"enableRtl":this.wrapper.classList[this.enableRtl?"add":"remove"]("e-rtl");break;case"cssClass":e.cssClass&&E.removeClass([this.wrapper],e.cssClass.split(" ")),t.cssClass&&E.addClass([this.wrapper],t.cssClass.split(" ")),this.tooltipObj&&this.tooltipObj.setProperties({cssClass:this.cssClass?"e-rating-tooltip "+this.cssClass:"e-rating-tooltip"});break;case"labelPosition":this.updateLabelPosition();break;case"showTooltip":this.updateTooltip();break;case"precision":this.updateMinValue(),this.triggerChange(null,this.value,!1),this.updateItemValue(),this.updateLabel();break;case"enableSingleSelection":this.updateValueChange(null,this.currentValue,!1);break;case"enableAnimation":this.wrapper.classList[this.enableAnimation?"add":"remove"](Kn);break;case"emptyTemplate":case"fullTemplate":this.updateTemplateFunction(),this.updateContent();break;case"labelTemplate":this.updateLabel();break;case"itemsCount":this.removeItemElements(),this.renderItems(),this.updateLabel()}}))],B.prototype,"allowReset",void 0),H([E.Property("")],B.prototype,"cssClass",void 0),H([E.Property(!1)],B.prototype,"disabled",void 0),H([E.Property("")],B.prototype,"emptyTemplate",void 0),H([E.Property(!0)],B.prototype,"enableAnimation",void 0),H([E.Property(!1)],B.prototype,"enableSingleSelection",void 0),H([E.Property("")],B.prototype,"fullTemplate",void 0),H([E.Property(5)],B.prototype,"itemsCount",void 0),H([E.Property(o.LabelPosition.Right)],B.prototype,"labelPosition",void 0),H([E.Property("")],B.prototype,"labelTemplate",void 0),H([E.Property(0)],B.prototype,"min",void 0),H([E.Property(o.PrecisionType.Full)],B.prototype,"precision",void 0),H([E.Property(!1)],B.prototype,"readOnly",void 0),H([E.Property(!1)],B.prototype,"showLabel",void 0),H([E.Property(!0)],B.prototype,"showTooltip",void 0),H([E.Property("")],B.prototype,"tooltipTemplate",void 0),H([E.Property(0)],B.prototype,"value",void 0),H([E.Property(!0)],B.prototype,"visible",void 0),H([E.Event()],B.prototype,"beforeItemRender",void 0),H([E.Event()],B.prototype,"created",void 0),H([E.Event()],B.prototype,"onItemHover",void 0),H([E.Event()],B.prototype,"valueChanged",void 0),H([E.NotifyPropertyChanges],B));function B(t,e){t=Fn.call(this,t,e)||this;return t.itemElements=[],t}$n=function(t,e){return($n=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var $n,Qn,Vn=function(t,e){function i(){this.constructor=t}$n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},H=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},ta=((ta=o.OtpInputType||(o.OtpInputType={})).Number="number",ta.Text="text",ta.Password="password",(ta=o.OtpInputStyle||(o.OtpInputStyle={})).Outlined="outlined",ta.Underlined="underlined",ta.Filled="filled",(ta=o.TextTransform||(o.TextTransform={})).None="none",ta.Uppercase="uppercase",ta.Lowercase="lowercase",Qn=E.Component,Vn(R,Qn),R.prototype.preRender=function(){this.element.id||(this.element.id=E.getUniqueID("e-"+this.getModuleName()))},R.prototype.render=function(){this.initialize()},R.prototype.initialize=function(){E.attributes(this.element,{role:"group"}),this.renderInputs(),this.renderSeparator(1,this.inputs.length),this.addPlaceHolder(),this.updateCssClass(this.cssClass),this.updateVariantClass(),this.updateAriaLabel(this.ariaLabels),this.setElementAttributes(this.htmlAttributes,this.element),this.enableRtl&&this.element.classList.add("e-rtl"),this.previousValue=this.value.toString(),this.autoFocus&&this.focusIn()},R.prototype.renderInputs=function(){this.hiddenInputEle=this.createElement("input",{id:"otpInput_hidden",attrs:{name:this.element.id,type:"hidden",value:"number"===this.type?this.value.toString().replace(/\D/g,""):this.value.toString(),autoComplete:"off"}}),this.element.appendChild(this.hiddenInputEle);for(var t=0;t<this.length;t++)this.createOtpInput(t)},R.prototype.createOtpInput=function(t){var e=this.getDefaultValue(),i="",e=(e&&(e=e[parseInt(t.toString(),10)],"number"===this.type?isNaN(Number(e))||(i=e):i=e||""),this.createElement("input",{id:this.element.id+"-"+(t+1),className:"e-otp-input-field e-input",attrs:{maxlength:"1",type:this.type,inputmode:this.htmlAttributes.inputmode||("number"===this.type?"numeric":"text")}}));this.disabled&&e.setAttribute("disabled","disabled"),this.element.appendChild(e),this.inputs.push(e),i&&(e.value=i),this.wireEvents(e,t)},R.prototype.renderSeparator=function(t,e){if(0<this.separator.length)for(var i=t;i<e;i++){var s=this.createElement("span",{className:"e-otp-separator"});s.textContent=this.separator,this.separatorElements.push(s),this.element.insertBefore(s,this.inputs[parseInt(i.toString(),10)])}},R.prototype.updateSeparatorValue=function(){var e=this;""===this.separator?(this.separatorElements.forEach(function(t){return E.remove(t)}),this.separatorElements=[]):this.separatorElements.forEach(function(t){t.textContent=e.separator})},R.prototype.addPlaceHolder=function(){for(var t=0;t<this.inputs.length;t++){var e=this.placeholder.length<=1?this.placeholder:this.placeholder.charAt(t);this.setElementAttributes({placeholder:e},this.inputs[parseInt(t.toString(),10)])}},R.prototype.updateInputType=function(e){var i=this.htmlAttributes.inputmode||("number"===e?"numeric":"text");this.inputs.forEach(function(t){t.type=e,t.setAttribute("inputmode",i)})},R.prototype.getDefaultValue=function(){var t="number"==typeof this.value?this.value.toString():this.value,t=(t=this.textTransform?this.getTransformedText(t):t).replace(/\s/g,"");return 0<t.length?t.split(""):void 0},R.prototype.getTransformedText=function(t){return this.textTransform.toLowerCase()===o.TextTransform.Lowercase?t.toLowerCase():this.textTransform.toLowerCase()===o.TextTransform.Uppercase?t.toUpperCase():t},R.prototype.handleInputChange=function(t,e){var i=this.inputs[parseInt(t.toString(),10)],i=(i&&t<this.length-1&&0<i.value.length&&(i=this.inputs[parseInt(t.toString(),10)+1],this.shouldFireFocus=this.shouldFireBlur=!1,i.focus(),i)&&0<i.value.length&&i.select(),e.target);1<i.value.length&&(i.value=i.value.slice(0,1)),this.textTransform&&(i.value=this.getTransformedText(i.value)),this.triggerInputEvent(t,e),this.triggerValuechanged(e,!0)},R.prototype.handleKeyAction=function(t,e){1<e.key.length&&!(0===t&&"Backspace"===e.key||t===this.length-1&&"Delete"===e.key)&&(this.shouldFireFocus=this.shouldFireBlur=!1);var i,s=this.inputs[parseInt(t.toString(),10)],n=this.inputs[parseInt(t.toString(),10)-1],a=this.inputs[parseInt(t.toString(),10)+1];"Delete"===e.key?(i="",0<s.value.length?(i=s.value,s.value=""):t!==this.inputs.length-1&&(i=a.value,a.value="",a.focus()),0<i.length&&this.triggerInputEvent(t,e)):"Backspace"===e.key?0!==t&&0===s.value.length&&(i=n.value,n.value="",n.focus(),0<i.length)&&this.triggerInputEvent(t,e):"ArrowLeft"===e.key||"ArrowRight"===e.key?("ArrowLeft"===e.key&&0<t?(n.focus(),n.select()):"ArrowRight"===e.key&&t<this.inputs.length-1&&(a.focus(),a.select()),e.preventDefault()):"ArrowUp"===e.key||"ArrowDown"===e.key?e.preventDefault():"Tab"===e.key||e.shiftKey||e.ctrlKey||"number"===this.type&&/\D/.test(e.key.toLocaleLowerCase())&&e.preventDefault()},R.prototype.handleSelection=function(t){t=this.inputs[parseInt(t.toString(),10)];t.value&&t.select()},R.prototype.handleFocus=function(t,e){E.addClass([this.inputs[parseInt(t.toString(),10)]],"e-otp-input-focus"),this.shouldFireFocus&&(e={element:this.element,event:e,index:t,isInteracted:!this.isFocusInCalled,value:this.value},this.trigger("focus",e)),this.shouldFireFocus=!0},R.prototype.handleBlur=function(t,e){E.removeClass([this.inputs[parseInt(t.toString(),10)]],"e-otp-input-focus"),this.shouldFireBlur&&(e={element:this.element,event:e,value:this.value,index:t,isInteracted:!this.isFocusOutCalled},this.trigger("blur",e)),this.shouldFireBlur=!0},R.prototype.handlePaste=function(t,e){var i=e.clipboardData;if(i){e.preventDefault();for(var s=i.getData("text").split(""),n=0,a=t;a<this.inputs.length;a++)0<s.length&&s[parseInt(n.toString(),10)]&&(this.inputs[parseInt(a.toString(),10)].value=s[parseInt(n.toString(),10)],n++,this.updateValueProperty());this.focusIn(),this.triggerValuechanged(e,!0)}},R.prototype.triggerInputEvent=function(t,e){var i=this.value.toString(),e=(this.updateValueProperty(),{element:this.element,event:e,previousValue:i,value:this.value.toString(),index:t});this.trigger("input",e)},R.prototype.triggerValuechanged=function(t,e){this.length===this.value.toString().length&&this.previousValue!==this.value&&(t={element:this.element,event:t,isInteracted:e||!1,previousValue:this.previousValue,value:this.value},this.trigger("valueChanged",t),this.previousValue=this.value.toString())},R.prototype.wireEvents=function(t,e){E.EventHandler.add(t,"focus",this.handleFocus.bind(this,e),this),E.EventHandler.add(t,"blur",this.handleBlur.bind(this,e),this),E.EventHandler.add(t,"input",this.handleInputChange.bind(this,e),this),E.EventHandler.add(t,"keydown",this.handleKeyAction.bind(this,e),this),E.EventHandler.add(t,"click",this.handleSelection.bind(this,e),this),E.EventHandler.add(t,"paste",this.handlePaste.bind(this,e),this),E.EventHandler.add(t,"wheel",this.handleWheelEvent,this)},R.prototype.unWireEvents=function(){for(var t=0;t<this.inputs.length;t++){var e=this.inputs[parseInt(t.toString(),10)];E.EventHandler.remove(e,"focus",this.handleFocus.bind(this,t)),E.EventHandler.remove(e,"blur",this.handleBlur.bind(this,t)),E.EventHandler.remove(e,"input",this.handleInputChange.bind(this,t)),E.EventHandler.remove(e,"keydown",this.handleKeyAction.bind(this,t)),E.EventHandler.remove(e,"click",this.handleSelection.bind(this,t)),E.EventHandler.remove(e,"paste",this.handlePaste.bind(this,t)),E.EventHandler.remove(e,"wheel",this.handleWheelEvent)}},R.prototype.updateValueProperty=function(){var e="",t=(this.inputs.forEach(function(t){e+=t.value}),this.isProtectedOnChange);this.isProtectedOnChange=!0,this.value="number"==typeof this.value?parseInt(e,10):e,this.isProtectedOnChange=t,this.hiddenInputEle.value=this.value.toString()},R.prototype.updateInputValue=function(t){for(var e=this.value.toString(),i=(this.textTransform&&(e=this.getTransformedText(e)),t.toString()),s=0;s<this.inputs.length;s++)i.charAt(s)!==e.charAt(s)&&(this.inputs[parseInt(s.toString(),10)].value=e.charAt(s),this.hiddenInputEle.value=e);this.focusIn()},R.prototype.updateCssClass=function(t,e){var i;(e=void 0===e?"":e)&&(i=e.trim().split(" "),(e=this.element.classList).remove.apply(e,i)),t&&(i=t.trim().split(" "),(e=this.element.classList).add.apply(e,i))},R.prototype.updateVariantClass=function(){var t="outlined"===this.stylingMode.toLocaleLowerCase()?"outline":this.stylingMode.toLocaleLowerCase(),e=["underlined","filled","outline"];-1!==e.indexOf(t)&&(E.removeClass([this.element],e.map(function(t){return"e-"+t})),E.addClass([this.element],"e-"+t))},R.prototype.updateAriaLabel=function(s){this.inputs.forEach(function(t,e){var i="Enter Otp Character "+(e+1),e=s&&0<s.length&&s[parseInt(e.toString(),10)]||i;t.setAttribute("aria-label",e)})},R.prototype.updateDisabledState=function(){var e=this;this.inputs.forEach(function(t){e.disabled?t.setAttribute("disabled","disabled"):t.removeAttribute("disabled")})},R.prototype.setElementAttributes=function(t,e){if(!E.isNullOrUndefined(t))for(var i in t){var s;"class"===i?(s=t.class.replace(/\s+/g," ").trim())&&E.addClass([e],s.split(" ")):"inputmode"===i?this.setInputMode(t[""+i]):("name"===i&&this.element.id===e.id?this.hiddenInputEle:e).setAttribute(i,t[""+i])}},R.prototype.setInputMode=function(t){for(var e=0;e<this.inputs.length;e++)this.inputs[parseInt(e.toString(),10)].setAttribute("inputmode",t)},R.prototype.handleLengthChange=function(t,e){if(0<t-e){for(var i=e;i<t;i++)this.createOtpInput(i);this.renderSeparator(e,t),this.addPlaceHolder(),this.updateAriaLabel(this.ariaLabels)}else if(0<=t&&0<this.inputs.length){for(i=t;i<this.inputs.length;i++)E.remove(this.inputs[parseInt(i.toString(),10)]);if(this.inputs.splice(t),0<this.separatorElements.length){for(e=0===t?0:t-1,i=e;i<this.separatorElements.length;i++)E.remove(this.separatorElements[parseInt(i.toString(),10)]);this.separatorElements.splice(e)}}},R.prototype.getModuleName=function(){return"otpinput"},R.prototype.getPersistData=function(){return this.addOnPersist([])},R.prototype.destroy=function(){Qn.prototype.destroy.call(this),this.unWireEvents(),this.inputs.forEach(function(t){E.remove(t)}),this.separatorElements.forEach(function(t){E.remove(t)}),E.remove(this.hiddenInputEle),E.removeClass([this.element],["e-underlined","e-filled","e-outline","e-rtl"]),this.cssClass&&E.removeClass([this.element],this.cssClass.trim().split(" ")),this.element.removeAttribute("role"),this.inputs=[],this.separatorElements=[],this.hiddenInputEle=null},R.prototype.focusIn=function(){this.isFocusInCalled=!0;for(var t=this.inputs.length-1,e=0;e<this.inputs.length;e++)if(!(0<this.inputs[parseInt(e.toString(),10)].value.length)){t=e;break}this.inputs[parseInt(t.toString(),10)].focus(),this.isFocusInCalled=!1},R.prototype.focusOut=function(){this.isFocusOutCalled=!0,this.inputs.forEach(function(t){t.blur()}),this.isFocusOutCalled=!1},R.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"textTransform":this.updateInputValue(this.value);break;case"value":this.updateInputValue(e.value),this.triggerValuechanged();break;case"placeholder":this.addPlaceHolder();break;case"disabled":this.updateDisabledState();break;case"cssClass":this.updateCssClass(t.cssClass,e.cssClass);break;case"separator":""===e.separator?this.renderSeparator(1,this.inputs.length):this.updateSeparatorValue();break;case"htmlAttributes":this.setElementAttributes(t.htmlAttributes,this.element);break;case"type":this.updateInputType(t.type);break;case"stylingMode":this.updateVariantClass();break;case"ariaLabels":this.updateAriaLabel(t.ariaLabels);break;case"length":this.handleLengthChange(t.length,e.length);break;case"enableRtl":this.element.classList[this.enableRtl?"add":"remove"]("e-rtl");break;case"autoFocus":this.autoFocus&&this.focusIn()}},H([E.Property(4)],R.prototype,"length",void 0),H([E.Property("")],R.prototype,"value",void 0),H([E.Property(o.OtpInputType.Number)],R.prototype,"type",void 0),H([E.Property("")],R.prototype,"separator",void 0),H([E.Property("")],R.prototype,"placeholder",void 0),H([E.Property(o.OtpInputStyle.Outlined)],R.prototype,"stylingMode",void 0),H([E.Property(!1)],R.prototype,"disabled",void 0),H([E.Property("")],R.prototype,"cssClass",void 0),H([E.Property(!1)],R.prototype,"autoFocus",void 0),H([E.Property(o.TextTransform.None)],R.prototype,"textTransform",void 0),H([E.Property({})],R.prototype,"htmlAttributes",void 0),H([E.Property([])],R.prototype,"ariaLabels",void 0),H([E.Event()],R.prototype,"created",void 0),H([E.Event()],R.prototype,"valueChanged",void 0),H([E.Event()],R.prototype,"focus",void 0),H([E.Event()],R.prototype,"blur",void 0),H([E.Event()],R.prototype,"input",void 0),H([E.NotifyPropertyChanges],R));function R(t,e){t=Qn.call(this,t,e)||this;return t.inputs=[],t.previousValue="",t.separatorElements=[],t.shouldFireFocus=!0,t.shouldFireBlur=!0,t.isFocusInCalled=!1,t.isFocusOutCalled=!1,t.handleWheelEvent=function(t){t.preventDefault()},t}ea=function(t,e){return(ea=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var ea,ia,Vn=function(t,e){function i(){this.constructor=t}ea(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},H=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},sa=(ia=E.ChildProperty,Vn(na,ia),H([E.Property("")],na.prototype,"content",void 0),H([E.Property("")],na.prototype,"stopContent",void 0),H([E.Property("")],na.prototype,"iconCss",void 0),H([E.Property("")],na.prototype,"stopIconCss",void 0),H([E.Property("Left")],na.prototype,"iconPosition",void 0),H([E.Property(!1)],na.prototype,"isPrimary",void 0),na);function na(){return null!==ia&&ia.apply(this,arguments)||this}aa=E.ChildProperty,Vn(ra,aa),H([E.Property("Start listening")],ra.prototype,"content",void 0),H([E.Property("Stop listening")],ra.prototype,"stopContent",void 0),H([E.Property("TopCenter")],ra.prototype,"position",void 0);var aa,la=ra;function ra(){return null!==aa&&aa.apply(this,arguments)||this}(ha=o.SpeechToTextState||(o.SpeechToTextState={})).Inactive="Inactive",ha.Listening="Listening",ha.Stopped="Stopped";oa=E.Component,Vn(U,oa),U.prototype.preRender=function(){this.element.id||(this.element.id=E.getUniqueID("e-"+this.getModuleName()))},U.prototype.getDirective=function(){return"EJS-SPEECHTOTEXT"},U.prototype.getModuleName=function(){return"speech-to-text"},U.prototype.getPersistData=function(){return this.addOnPersist([])},U.prototype.render=function(){this.renderSpeechToText(),this.initializeSpeechRecognition(),E.isNullOrUndefined(this.listeningState)||this.handleStateChange(),this.wireEvents()},U.prototype.initializeLocale=function(){this.l10n=new E.L10n(this.getModuleName(),{abortedError:"Speech recognition was aborted.",audioCaptureError:"No microphone detected. Ensure your microphone is connected.",defaultError:"An unknown error occurred.",networkError:"Network error occurred. Check your internet connection.",noSpeechError:"No speech detected. Please speak into the microphone.",notAllowedError:"Microphone access denied. Allow microphone permissions.",serviceNotAllowedError:"Speech recognition service is not allowed in this context.",unsupportedBrowserError:"The browser does not support the SpeechRecognition API.",startAriaLabel:"Press to start speaking and transcribe your words",stopAriaLabel:"Press to stop speaking and end transcription",startTooltipText:"Start listening",stopTooltipText:"Stop listening"},this.locale)},U.prototype.renderSpeechToText=function(){this.initializeLocale();var t=E.isNullOrUndefined(this.buttonSettings.iconCss)||""===this.buttonSettings.iconCss?"e-icons e-listen-icon":this.buttonSettings.iconCss;this.buttonInst=new F.Button({iconCss:t,isPrimary:this.buttonSettings.isPrimary,cssClass:this.updateButtonCssClass(),disabled:this.disabled,content:this.buttonSettings.content,iconPosition:this.buttonSettings.iconPosition,enableRtl:this.enableRtl}),this.buttonInst.appendTo(this.element),this.updateTooltip(),this.updateCssClass(this.cssClass,""),this.updateAriaLabel(),E.isNullOrUndefined(this.htmlAttributes)||this.addHtmlAttributes(this.htmlAttributes)},U.prototype.updateAriaLabel=function(){var t=this.htmlAttributes&&this.htmlAttributes["aria-label"]?this.htmlAttributes["aria-label"]:this.micOn?this.l10n.getConstant("stopAriaLabel"):this.l10n.getConstant("startAriaLabel");this.element.setAttribute("aria-label",t)},U.prototype.updateCssClass=function(t,e){e&&E.removeClass([this.element],e.trim().split(" ")),t&&E.addClass([this.element],t.trim().split(" "))},U.prototype.updateButtonCssClass=function(){var t;return""===(this.isClicked?this.buttonSettings.stopContent:this.buttonSettings.content)&&(t="e-round"),this.micOn&&(t+=" e-listening-state"),t},U.prototype.updateTooltip=function(){this.showTooltip?(this.tooltipSettings&&("Start listening"===this.tooltipSettings.content&&(this.tooltipSettings.content=this.l10n.getConstant("startTooltipText")),"Stop listening"===this.tooltipSettings.stopContent)&&(this.tooltipSettings.stopContent=this.l10n.getConstant("stopTooltipText")),this.tooltipInst=new h.Tooltip({content:this.hasStarted?this.tooltipSettings.stopContent:this.tooltipSettings.content,position:this.tooltipSettings.position,windowCollision:!0,cssClass:this.cssClass?"e-speech-to-text-tooltip "+this.cssClass:"e-speech-to-text-tooltip",opensOn:"Hover",enableRtl:this.enableRtl}),this.tooltipInst.appendTo(this.element)):E.isNullOrUndefined(this.tooltipInst)||(this.tooltipInst.destroy(),this.tooltipInst=null)},U.prototype.handleStateChange=function(){var t;this.disabled||(this.listeningState===o.SpeechToTextState.Listening?(this.micOn=!0,this.startSpeechRecognition()):this.listeningState!==o.SpeechToTextState.Inactive&&this.listeningState!==o.SpeechToTextState.Stopped||(this.micOn?(this.micOn=!1,this.stopSpeechRecognition()):(t=this.isProtectedOnChange,this.isProtectedOnChange=!0,this.listeningState=o.SpeechToTextState.Inactive,this.isProtectedOnChange=t)))},U.prototype.addHtmlAttributes=function(t){if(t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&this.element.setAttribute(e,t[e])},U.prototype.removeHtmlAttributes=function(t){if(t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&this.element.removeAttribute(e)},U.prototype.wireEvents=function(){E.EventHandler.add(this.element,"click",this.handleButtonClick,this)},U.prototype.unWireEvents=function(){E.EventHandler.remove(this.element,"click",this.handleButtonClick)},U.prototype.handleButtonClick=function(t){this.isUserInteracted=!0,this.micOn=!this.micOn,this.micOn?this.startSpeechRecognition(t):this.stopSpeechRecognition(t)},U.prototype.triggerUnSupportedError=function(){var t={error:"unsupported-browser",errorMessage:this.l10n.getConstant("unsupportedBrowserError")};this.trigger("onError",t)},U.prototype.initializeSpeechRecognition=function(){var a=this,t=window,t=t.SpeechRecognition||t.webkitSpeechRecognition;t?(this.recognition=new t,this.recognition.continuous=!0,this.recognition.lang=this.lang,this.recognition.interimResults=this.allowInterimResults,this.recognition.onstart=function(t){var e=a.isProtectedOnChange,i=(a.isProtectedOnChange=!0,a.transcript=a.fullTranscript="",a.isProtectedOnChange=e,{cancel:!1,listeningState:o.SpeechToTextState.Listening,event:t,isInteracted:a.isUserInteracted});a.trigger("onStart",i,function(){i.cancel?(a.recognition.abort(),a.micOn=!1):a.handleStartRecognition()})},this.recognition.onend=function(t){a.hasStarted&&(a.micOn=!1,a.handleStopRecognition(t))},this.recognition.onerror=function(t){var e="";switch(t.error){case"not-allowed":e=a.l10n.getConstant("notAllowedError");break;case"audio-capture":e=a.l10n.getConstant("audioCaptureError");break;case"network":e=a.l10n.getConstant("networkError");break;case"no-speech":e=a.l10n.getConstant("noSpeechError");break;case"aborted":e=a.l10n.getConstant("abortedError");break;case"service-not-allowed":e=a.l10n.getConstant("serviceNotAllowedError");break;default:e=a.l10n.getConstant("defaultError")}t={event:t,error:t.error,errorMessage:e};a.trigger("onError",t),a.isUserInteracted=!1},this.recognition.onresult=function(t){var e=t.results[t.resultIndex],i="",s=a.isProtectedOnChange,n=(a.isProtectedOnChange=!0,e.isFinal?(a.fullTranscript+=e[0].transcript,a.transcript=a.fullTranscript):(i+=e[0].transcript,a.transcript=a.fullTranscript+i),{event:t,transcript:a.transcript,isInterimResult:!e.isFinal});a.trigger("transcriptChanged",n,function(){var t;n.transcript!==a.transcript&&(t=a.isProtectedOnChange,a.isProtectedOnChange=!0,a.transcript=a.fullTranscript=n.transcript,a.isProtectedOnChange=t)}),a.isProtectedOnChange=s}):this.triggerUnSupportedError()},U.prototype.handleStartRecognition=function(){var t=this.isProtectedOnChange,e=(this.isProtectedOnChange=!0,this.hasStarted=!0,this.listeningState=o.SpeechToTextState.Listening,E.isNullOrUndefined(this.tooltipInst)||(this.tooltipInst.content=this.tooltipSettings.stopContent),this.updateAriaLabel(),this.isClicked=!0,this.buttonInst.cssClass=this.updateButtonCssClass(),this.buttonInst.content=this.buttonSettings.stopContent,E.isNullOrUndefined(this.buttonSettings.stopIconCss)||""===this.buttonSettings.stopIconCss?"e-icons e-listen-stop":this.buttonSettings.stopIconCss);this.buttonInst.iconCss=e,this.isProtectedOnChange=t},U.prototype.triggerUnSupportedStart=function(t){var e=this,i=this.isProtectedOnChange,s=(this.isProtectedOnChange=!0,this.transcript="",this.isProtectedOnChange=i,{cancel:!1,listeningState:o.SpeechToTextState.Listening,event:t,isInteracted:this.isUserInteracted});this.trigger("onStart",s,function(){s.cancel||e.handleStartRecognition()})},U.prototype.startSpeechRecognition=function(t){this.hasStarted||(this.recognition?this.recognition.start():this.triggerUnSupportedStart(t))},U.prototype.stopSpeechRecognition=function(t){this.recognition?this.recognition.stop():this.handleStopRecognition(t)},U.prototype.handleStopRecognition=function(t){var e;this.hasStarted&&(e=this.isProtectedOnChange,this.isProtectedOnChange=!0,this.listeningState=o.SpeechToTextState.Stopped,E.isNullOrUndefined(this.tooltipInst)||(this.tooltipInst.content=this.tooltipSettings.content),this.updateAriaLabel(),this.isClicked=!1,this.buttonInst.cssClass=this.updateButtonCssClass(),this.buttonInst.content=this.buttonSettings.content,t={listeningState:o.SpeechToTextState.Stopped,event:t,isInteracted:this.isUserInteracted},this.trigger("onStop",t),this.listeningState=o.SpeechToTextState.Inactive,t=E.isNullOrUndefined(this.buttonSettings.iconCss)||""===this.buttonSettings.iconCss?"e-icons e-listen-icon":this.buttonSettings.iconCss,this.buttonInst.iconCss=t,this.hasStarted=!1,this.isProtectedOnChange=e)},U.prototype.buttonSettingsChanges=function(t,e){var i,s;t.content===e.content&&t.stopContent===e.stopContent||(this.buttonInst.content=this.hasStarted?this.buttonSettings.stopContent:this.buttonSettings.content,this.buttonInst.cssClass=this.updateButtonCssClass()),t.iconCss===e.iconCss&&t.stopIconCss===e.stopIconCss||(i=E.isNullOrUndefined(this.buttonSettings.iconCss)||""===this.buttonSettings.iconCss?"e-icons e-listen-icon":this.buttonSettings.iconCss,s=E.isNullOrUndefined(this.buttonSettings.stopIconCss)||""===this.buttonSettings.stopIconCss?"e-icons e-listen-stop":this.buttonSettings.stopIconCss,this.buttonInst.iconCss=this.hasStarted?s:i),t.iconPosition!==e.iconPosition&&(this.buttonInst.iconPosition=this.buttonSettings.iconPosition),t.isPrimary!==e.isPrimary&&(this.buttonInst.isPrimary=this.buttonSettings.isPrimary)},U.prototype.destroyAndNullify=function(t){t&&t.destroy()},U.prototype.destroy=function(){oa.prototype.destroy.call(this),this.unWireEvents(),this.destroyAndNullify(this.buttonInst),this.destroyAndNullify(this.tooltipInst),this.recognition=null,this.micOn=null,this.htmlAttributes=this.tooltipSettings=this.buttonSettings=null,this.element.classList.remove("e-rtl")},U.prototype.startListening=function(){this.disabled||this.isClicked||(this.isUserInteracted=!1,this.micOn=!0,this.startSpeechRecognition())},U.prototype.stopListening=function(){!this.disabled&&this.isClicked&&(this.isUserInteracted=!1,this.micOn=!1,this.stopSpeechRecognition())},U.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"lang":this.recognition&&(this.recognition.lang=this.lang);break;case"allowInterimResults":this.recognition&&(this.recognition.interimResults=this.allowInterimResults);break;case"buttonSettings":this.buttonSettingsChanges(e.buttonSettings,t.buttonSettings);break;case"cssClass":this.updateCssClass(t.cssClass,e.cssClass);break;case"disabled":this.buttonInst.disabled=this.disabled,this.handleStateChange();break;case"htmlAttributes":this.removeHtmlAttributes(e.htmlAttributes),this.addHtmlAttributes(t.htmlAttributes);break;case"listeningState":this.handleStateChange();break;case"tooltipSettings":case"showTooltip":this.updateTooltip();break;case"transcript":this.transcript=this.fullTranscript=t.transcript;break;case"enableRtl":this.buttonInst.enableRtl=this.tooltipInst.enableRtl=this.enableRtl;break;case"locale":this.l10n.setLocale(this.locale),this.updateAriaLabel(),this.updateTooltip()}},H([E.Property("")],U.prototype,"transcript",void 0),H([E.Property("")],U.prototype,"lang",void 0),H([E.Property(!0)],U.prototype,"allowInterimResults",void 0),H([E.Property(!0)],U.prototype,"showTooltip",void 0),H([E.Property("Inactive")],U.prototype,"listeningState",void 0),H([E.Complex({},sa)],U.prototype,"buttonSettings",void 0),H([E.Complex({},la)],U.prototype,"tooltipSettings",void 0),H([E.Property(!1)],U.prototype,"disabled",void 0),H([E.Property("")],U.prototype,"cssClass",void 0),H([E.Property({})],U.prototype,"htmlAttributes",void 0),H([E.Event()],U.prototype,"created",void 0),H([E.Event()],U.prototype,"onStart",void 0),H([E.Event()],U.prototype,"onStop",void 0),H([E.Event()],U.prototype,"onError",void 0),H([E.Event()],U.prototype,"transcriptChanged",void 0);var oa,ha=H([E.NotifyPropertyChanges],U);function U(t,e){t=oa.call(this,t,e)||this;return t.fullTranscript="",t.isClicked=!1,t.isUserInteracted=!1,t.hasStarted=!1,t}o.AsyncSettings=ks,o.ButtonSettings=sa,o.ButtonsProps=Os,o.ColorPicker=s,o.ColorRangeData=Be,o.FilesProp=Ss,o.FormValidator=Zi,o.LimitData=Ie,o.MaskUndo=Se,o.MaskedTextBox=Tt,o.NumericTextBox=Rt,o.OtpInput=ta,o.Rating=Jn,o.Signature=O,o.SignatureBase=Sn,o.Slider=ji,o.SmartTextArea=On,o.SpeechToText=ha,o.TEXTBOX_FOCUS=W,o.TextArea=T,o.TextBox=x,o.TicksData=Ae,o.TooltipData=Me,o.TooltipSettings=la,o.Uploader=t,o.applyMask=qt,o.bindClearEvent=Xt,o.containerAttributes=D,o.createMask=zt,o.escapeRegExp=ee,o.getMaskedVal=function(t){return Zt.call(xe(t),t.element)},o.getVal=function(t){return d.call(xe(t),t.element)},o.maskInput=function(t){var e=Ee(t),i=(qt.call(e),d.call(this,this.element));this.prevValue=i,this.value=i,t.mask&&(_t.call(e),jt.call(e))},o.maskInputBlurHandler=ie,o.maskInputDropHandler=ae,o.maskInputFocusHandler=Qt,o.maskInputMouseDownHandler=Jt,o.maskInputMouseUpHandler=$t,o.mobileRemoveFunction=oe,o.regex=Yi,o.regularExpressions=Wt,o.setElementValue=b,o.setMaskValue=Ce,o.strippedValue=d,o.triggerFocus=te,o.unstrippedValue=Zt,o.unwireEvents=_t,o.wireEvents=jt,Object.defineProperty(o,"__esModule",{value:!0})});
11
11
  //# sourceMappingURL=ej2-inputs.umd.min.js.map