@syncfusion/ej2-inputs 30.2.4 → 31.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ej2-inputs.min.js +2 -2
- package/dist/ej2-inputs.umd.min.js +2 -2
- package/dist/ej2-inputs.umd.min.js.map +1 -1
- package/dist/es6/ej2-inputs.es2015.js +1 -1
- package/dist/es6/ej2-inputs.es2015.js.map +1 -1
- package/dist/es6/ej2-inputs.es5.js +1 -1
- package/dist/es6/ej2-inputs.es5.js.map +1 -1
- package/dist/global/ej2-inputs.min.js +2 -2
- package/dist/global/ej2-inputs.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/dist/ts/color-picker/color-picker-model.d.ts +186 -0
- package/dist/ts/color-picker/color-picker.d.ts +398 -0
- package/dist/ts/color-picker/color-picker.ts +2209 -0
- package/dist/ts/color-picker/index.d.ts +5 -0
- package/dist/ts/color-picker/index.ts +5 -0
- package/dist/ts/common/index.d.ts +4 -0
- package/dist/ts/common/index.ts +4 -0
- package/dist/ts/common/signature-base.d.ts +340 -0
- package/dist/ts/common/signature-base.ts +1170 -0
- package/dist/ts/form-validator/form-validator-model.d.ts +121 -0
- package/dist/ts/form-validator/form-validator.d.ts +312 -0
- package/dist/ts/form-validator/form-validator.ts +1068 -0
- package/dist/ts/form-validator/index.d.ts +5 -0
- package/dist/ts/form-validator/index.ts +5 -0
- package/dist/ts/index.d.ts +18 -0
- package/dist/ts/index.ts +18 -0
- package/dist/ts/input/index.d.ts +4 -0
- package/dist/ts/input/index.ts +4 -0
- package/dist/ts/input/input.d.ts +345 -0
- package/dist/ts/input/input.ts +1277 -0
- package/dist/ts/maskedtextbox/base/index.d.ts +4 -0
- package/dist/ts/maskedtextbox/base/index.ts +4 -0
- package/dist/ts/maskedtextbox/base/mask-base.d.ts +134 -0
- package/dist/ts/maskedtextbox/base/mask-base.ts +1207 -0
- package/dist/ts/maskedtextbox/index.d.ts +5 -0
- package/dist/ts/maskedtextbox/index.ts +5 -0
- package/dist/ts/maskedtextbox/maskedtextbox/index.d.ts +5 -0
- package/dist/ts/maskedtextbox/maskedtextbox/index.ts +5 -0
- package/dist/ts/maskedtextbox/maskedtextbox/maskedtextbox-model.d.ts +167 -0
- package/dist/ts/maskedtextbox/maskedtextbox/maskedtextbox.d.ts +307 -0
- package/dist/ts/maskedtextbox/maskedtextbox/maskedtextbox.ts +709 -0
- package/dist/ts/numerictextbox/index.d.ts +5 -0
- package/dist/ts/numerictextbox/index.ts +5 -0
- package/dist/ts/numerictextbox/numerictextbox-model.d.ts +228 -0
- package/dist/ts/numerictextbox/numerictextbox.d.ts +431 -0
- package/dist/ts/numerictextbox/numerictextbox.ts +1672 -0
- package/dist/ts/otp-input/index.d.ts +5 -0
- package/dist/ts/otp-input/index.ts +5 -0
- package/dist/ts/otp-input/otp-input-model.d.ts +165 -0
- package/dist/ts/otp-input/otp-input.d.ts +365 -0
- package/dist/ts/otp-input/otp-input.ts +924 -0
- package/dist/ts/rating/index.d.ts +5 -0
- package/dist/ts/rating/index.ts +5 -0
- package/dist/ts/rating/rating-model.d.ts +239 -0
- package/dist/ts/rating/rating.d.ts +416 -0
- package/dist/ts/rating/rating.ts +1101 -0
- package/dist/ts/signature/index.d.ts +5 -0
- package/dist/ts/signature/index.ts +5 -0
- package/dist/ts/signature/signature-model.d.ts +131 -0
- package/dist/ts/signature/signature.d.ts +167 -0
- package/dist/ts/signature/signature.ts +266 -0
- package/dist/ts/slider/index.d.ts +5 -0
- package/dist/ts/slider/index.ts +5 -0
- package/dist/ts/slider/slider-model.d.ts +401 -0
- package/dist/ts/slider/slider.d.ts +721 -0
- package/dist/ts/slider/slider.ts +3497 -0
- package/dist/ts/smart-textarea/caret-helper.d.ts +17 -0
- package/dist/ts/smart-textarea/caret-helper.ts +95 -0
- package/dist/ts/smart-textarea/index.d.ts +5 -0
- package/dist/ts/smart-textarea/index.ts +5 -0
- package/dist/ts/smart-textarea/smart-textarea-model.d.ts +44 -0
- package/dist/ts/smart-textarea/smart-textarea.d.ts +80 -0
- package/dist/ts/smart-textarea/smart-textarea.ts +518 -0
- package/dist/ts/speech-to-text/index.d.ts +5 -0
- package/dist/ts/speech-to-text/index.ts +5 -0
- package/dist/ts/speech-to-text/speech-to-text-model.d.ts +270 -0
- package/dist/ts/speech-to-text/speech-to-text.d.ts +487 -0
- package/dist/ts/speech-to-text/speech-to-text.ts +1008 -0
- package/dist/ts/textarea/index.d.ts +5 -0
- package/dist/ts/textarea/index.ts +5 -0
- package/dist/ts/textarea/textarea-model.d.ts +161 -0
- package/dist/ts/textarea/textarea.d.ts +237 -0
- package/dist/ts/textarea/textarea.ts +812 -0
- package/dist/ts/textbox/index.d.ts +5 -0
- package/dist/ts/textbox/index.ts +5 -0
- package/dist/ts/textbox/textbox-model.d.ts +155 -0
- package/dist/ts/textbox/textbox.d.ts +288 -0
- package/dist/ts/textbox/textbox.ts +872 -0
- package/dist/ts/uploader/index.d.ts +5 -0
- package/dist/ts/uploader/index.ts +5 -0
- package/dist/ts/uploader/uploader-model.d.ts +555 -0
- package/dist/ts/uploader/uploader.d.ts +1216 -0
- package/dist/ts/uploader/uploader.ts +4391 -0
- package/package.json +62 -12
- package/src/input/input.js +1 -1
- package/styles/bootstrap5.3-lite.css +3 -3
- package/styles/bootstrap5.3.css +5 -5
- package/styles/input/_layout.scss +0 -1
- package/styles/input/tailwind3.css +0 -1
- package/styles/tailwind-dark-lite.css +3 -3
- package/styles/tailwind-dark.css +5 -5
- package/styles/tailwind-lite.css +3 -3
- package/styles/tailwind.css +5 -5
- package/styles/tailwind3-lite.css +0 -1
- package/styles/tailwind3.css +0 -1
- package/styles/uploader/_bootstrap5.3-definition.scss +1 -1
- package/styles/uploader/_tailwind-definition.scss +1 -1
- package/styles/uploader/bootstrap5.3.css +5 -5
- package/styles/uploader/tailwind-dark.css +5 -5
- package/styles/uploader/tailwind.css +5 -5
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: ej2-inputs.umd.min.js
|
|
3
|
-
* version :
|
|
3
|
+
* version : 31.1.17
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2024. 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,R,V){"use strict";var n,F,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"},M=["title","style","class"],D="e-input-focus";function z(i){W(i.floatLabelType,i.element);function t(){var t,e;((e=$((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=$((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(){W(i.floatLabelType,i.element)}i.element.addEventListener("focus",t),i.element.addEventListener("blur",e),i.element.addEventListener("input",s),i.element.__eventHandlers.inputFocusHandler={focusHandler:t},i.element.__eventHandlers.inputBlurHandler={blurHandler:e},i.element.__eventHandlers.inputHandler={inputHandler:s}}function W(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 q(){var t=$(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 j(){var t=$(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 _(t){t.addEventListener("focus",q),t.addEventListener("blur",j)}function X(t){E.isNullOrUndefined(t)||(t.removeEventListener("focus",q),t.removeEventListener("blur",j))}function K(t,e,i){var s,i=E.isNullOrUndefined(i)?E.createElement:i,n=("Auto"===t.floatLabelType&&_(t.element),E.isNullOrUndefined(e.container)?(e.container=et(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=it(t.element.placeholder),t.element.removeAttribute("placeholder")),E.isNullOrUndefined(t.properties)||E.isNullOrUndefined(t.properties.placeholder)||""===t.properties.placeholder||(i.innerText=it(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),J(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(){tt(t.element,t.floatLabelType)},t.element.addEventListener("input",n=function(){tt(t.element,t.floatLabelType)}),t.element.addEventListener("blur",s),t.element.__eventHandlers.floatInputHandler={inputFloatHandler:n},t.element.__eventHandlers.floatBlurHandler={blurFloatHandler:s}):Y(t),E.isNullOrUndefined(t.element.getAttribute("id"))||i.setAttribute("for",t.element.getAttribute("id"))}function Y(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.inputFloatHandler,i=t.element.__eventHandlers.floatBlurHandler.blurFloatHandler,t.element.removeEventListener("input",e),t.element.removeEventListener("blur",i),delete t.element.__eventHandlers.floatInputHandler,delete t.element.__eventHandlers.floatBlurHandler)}function Z(t,e){"Always"===t&&e.classList.contains("e-outline")&&e.classList.add("e-valid-input")}function G(t,e,i){E.isNullOrUndefined(e)||(t&&!i?E.removeClass([e],p.CLEARICONHIDE):E.addClass([e],p.CLEARICONHIDE))}function J(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 $(t){t=E.isNullOrUndefined(t.parentNode)?t:t.parentNode;return t=t&&t.classList.contains("e-input-in-wrap")?t.parentNode:t}function Q(s,n,t){function e(){G(s.value,n)}function i(){G(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 r;void 0!==F&&!F||(n.addEventListener("click",r=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={clickHandlerEvent:r});s.addEventListener("input",e),s.addEventListener("focus",i),s.addEventListener("blur",a),s.__eventHandlers.clearInputHandler={inputHandlerEvent:e},s.__eventHandlers.clearFocusHandler={focusHandlerEvent:i},s.__eventHandlers.clearBlurHandler={blurHandlerEvent:a}}function tt(t,e){$(t).classList.contains(p.FLOATINPUT)&&"Auto"===e&&(e=$(t).getElementsByClassName("e-float-text")[0],J(t.value,e,t))}function et(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 it(t){var e;return null==t||""===t?"":(e={"&":"&",""":'"',"'":"'","<":"<",">":">","é":"é"},t.replace(/&[a-zA-Z#0-9]+;/g,function(t){return e[t]||t}))}function st(t,e,i){E.isNullOrUndefined(i)||""===i||E.removeClass(e,i.split(" ")),E.isNullOrUndefined(t)||""===t||E.addClass(e,t.split(" "))}function nt(t,e,i){("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))&&(i="multiselect"===i?t:t.clientWidth-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"),i<e.getElementsByClassName("e-float-text-content")[0].clientWidth||i===e.getElementsByClassName("e-float-text-content")[0].clientWidth)&&e.getElementsByClassName("e-float-text-content")[0].classList.add("e-float-text-overflow")}function at(t,e){t=it(t);var i,s,n=$(e);n.classList.contains(p.FLOATINPUT)?E.isNullOrUndefined(t)||""===t?(n.classList.add(p.NOFLOATLABEL),(i=n.getElementsByClassName("e-float-text-content")[0])?i.children[0].textContent="":(s=n.getElementsByClassName(p.FLOATTEXT)[0],E.isNullOrUndefined(s)||(s.textContent=""))):((i=n.getElementsByClassName("e-float-text-content")[0])&&i.children[0]?i.children[0].textContent=t:(s=n.getElementsByClassName(p.FLOATTEXT)[0],E.isNullOrUndefined(s)||(s.textContent=t)),n.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)||tt(e,i)}function lt(t,e){t?E.addClass(e,p.RTL):E.removeClass(e,p.RTL)}function ot(t,e,i,s){var n={disabled:"","aria-disabled":"true"},a=!E.isNullOrUndefined(s);t?(e.classList.remove(p.DISABLE),pt(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)||tt(e,i)}function ht(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),Q(t,n),n.setAttribute("aria-label","close"),n):(E.remove(i.clearButton),i.clearButton=null)}function pt(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i],a=$(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=$(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 dt(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 ct(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",mt,!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",mt,this),n[parseInt(a.toString(),10)].removeEventListener("mouseup",vt,this)}function mt(){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 ft(t,e){e=e("span",{className:t});return e.classList.add("e-input-group-icon"),e}function gt(t,e,i,s){var s=E.isNullOrUndefined(s)?E.createElement:s,t=ft(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 r=0;r<a.length;r++){var l=a[parseInt(r.toString(),10)],o=n.parentElement;l.classList.contains("e-float-line")&&(o&&o.classList.contains("e-filled")||!o)||n.appendChild(l)}}return n.parentNode.insertBefore(t,n),ct(!0,e,t),t}function yt(t,e,i){t=ft(t,E.isNullOrUndefined(i)?E.createElement:i);return(e.classList.contains("e-float-icon-left")?e.querySelector(".e-input-in-wrap"):e).appendChild(t),ct(!0,e,t),t}function bt(t,e){"hidden"===e.type?t.classList.add("e-hidden"):t.classList.contains("e-hidden")&&t.classList.remove("e-hidden")}function Ct(t){var e=t;return e=E.isNullOrUndefined(t)||""===t?e:t.replace(/\s+/g," ").trim()}n=o.Input||(o.Input={}),F=!0,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,F=t.bindClearAction,E.isNullOrUndefined(t.floatLabelType)||"Never"===t.floatLabelType?(s.container=et(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)):K(t,s,i),z(t),E.isNullOrUndefined(t.properties)||E.isNullOrUndefined(t.properties.showClearButton)||!t.properties.showClearButton||(ht(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(yt(t.buttons[n],s.container,i));return E.isNullOrUndefined(t.element)||"TEXTAREA"!==t.element.tagName||E.addClass([s.container],p.TEXTAREA),bt(s.container,t.element),dt((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":st(t.properties.cssClass,[e.container]),Z(t.floatLabelType,e.container);break;case"enabled":ot(t.properties.enabled,t.element,t.floatLabelType,e.container);break;case"enableRtl":lt(t.properties.enableRtl,[e.container]);break;case"placeholder":at(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=_,n.wireClearBtnEvents=Q,n.destroy=function(t,e){var i,s,n,a,r;void 0===e&&(e=null),i=t,E.isNullOrUndefined(i.element)||E.isNullOrUndefined(i.element.__eventHandlers)||E.isNullOrUndefined(i.element.__eventHandlers.inputFocusHandler)||E.isNullOrUndefined(i.element.__eventHandlers.inputBlurHandler)||E.isNullOrUndefined(i.element.__eventHandlers.inputHandler)||(s=i.element.__eventHandlers.inputFocusHandler.focusHandler,n=i.element.__eventHandlers.inputBlurHandler.blurHandler,r=i.element.__eventHandlers.inputHandler.inputHandler,i.element.removeEventListener("focus",s),i.element.removeEventListener("blur",n),i.element.removeEventListener("input",r),delete i.element.__eventHandlers.inputFocusHandler,delete i.element.__eventHandlers.inputBlurHandler,delete i.element.__eventHandlers.inputHandler),"Auto"===t.floatLabelType&&Y(t),t.properties.showClearButton&&(s=t.element,n=e,E.isNullOrUndefined(s)||E.isNullOrUndefined(s.__eventHandlers)||(E.isNullOrUndefined(s.__eventHandlers.clearClickHandler)||(a=s.__eventHandlers.clearClickHandler.clickHandlerEvent,void 0!==F&&!F||E.isNullOrUndefined(n)||n.removeEventListener("click",a),delete s.__eventHandlers.clearClickHandler),E.isNullOrUndefined(s.__eventHandlers.clearInputHandler))||E.isNullOrUndefined(s.__eventHandlers.clearFocusHandler)||E.isNullOrUndefined(s.__eventHandlers.clearBlurHandler)||(n=s.__eventHandlers.clearInputHandler.inputHandlerEvent,a=s.__eventHandlers.clearFocusHandler.focusHandlerEvent,r=s.__eventHandlers.clearBlurHandler.blurHandlerEvent,s.removeEventListener("input",n),s.removeEventListener("focus",a),s.removeEventListener("blur",r),delete s.__eventHandlers.clearInputHandler,delete s.__eventHandlers.clearFocusHandler,delete s.__eventHandlers.clearBlurHandler)),E.isNullOrUndefined(t.buttons)||ct(!1,null,t.buttons),X(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&&nt(e,e.parentElement),E.isNullOrUndefined(i)||"Auto"!==i||tt(e,i),!E.isNullOrUndefined(s)&&s&&(t=$(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))),W(i,e)},n.setCssClass=st,n.calculateWidth=nt,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)),nt(e.firstChild,e)},n.setPlaceholder=at,n.setReadonly=rt,n.setEnableRtl=lt,n.setEnabled=ot,n.setClearButton=ht,n.removeAttributes=pt,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]),X(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,r=E.closest(t,"."+p.INPUTGROUP),l=r.tagName,l={element:t,floatLabelType:e,customTag:"DIV"!==l&&"SPAN"!==l?l:null,properties:{placeholder:i}};"Never"!==e?(i=r.querySelector(".e-clear-icon"),n={container:r},t.classList.remove(p.INPUT),K(l,n,s),dt(n.container,s),nt(l.element,n.container),s=r.classList.contains("e-float-icon-left"),E.isNullOrUndefined(i)&&(i=(s?r.querySelector(".e-input-in-wrap"):r).querySelector(".e-input-group-icon")),E.isNullOrUndefined(i)?s&&(i=r.querySelector(".e-input-group-icon")):(n=r.querySelector("."+p.FLOATLINE),a=r.querySelector("."+p.FLOATTEXT),(s=s?r.querySelector(".e-input-in-wrap"):r).insertBefore(t,i),s.insertBefore(n,i),s.insertBefore(a,i))):Y(l),Z(e,t.parentElement)},n.createSpanElement=dt,n.setRipple=function(t,e){for(var i=0;i<e.length;i++)ct(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,r=e;a<r.length;a++)yt(r[a],i,n);else for(var l=0,o=e;l<o.length;l++)gt(o[l],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=gt,n.appendSpan=yt,n.validateInputType=bt,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];M.indexOf(n)<0&&e.setAttribute(n,t[""+n])}},n.updateCssClass=function(t,e,i){st(Ct(t),[i],Ct(e))},n.getInputValidClassList=Ct,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<M.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)};Et=function(t,e){return(Et=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 Et,St,xt=function(t,e){function i(){this.constructor=t}Et(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,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},Pt="e-input-group-icon",Tt="e-spin-up",Ot="e-error",kt="increment",wt="decrement",Lt=new RegExp("^(-)?(\\d*)$"),At="e-input-focus",Nt=["title","style","class"],Ht=0,Bt=(St=E.Component,xt(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.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,r=i[e];if(!E.isNullOrUndefined(this.element.getAttribute(r)))switch(r){case"disabled":(E.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.enabled||t)&&(s="disabled"!==this.element.getAttribute(r)&&""!==this.element.getAttribute(r)&&"true"!==this.element.getAttribute(r),this.setProperties({enabled:s},!t));break;case"readonly":(E.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.readonly||t)&&(s="readonly"===this.element.getAttribute(r)||""===this.element.getAttribute(r)||"true"===this.element.getAttribute(r),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(r)),this.setProperties(E.setValue(r,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(r)))||isNaN(n)||this.setProperties(E.setValue(r,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(r)))||isNaN(a)||this.setProperties(E.setValue(r,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(r)))||isNaN(a)||this.setProperties(E.setValue(r,a,{}),!t);break;case"style":this.inputStyle=this.element.getAttribute(r);break;case"name":this.inputName=this.element.getAttribute(r);break;default:var l=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(r));(null===l||isNaN(l))&&"value"!==r||this.setProperties(E.setValue(r,l,{}),!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];Nt.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<Nt.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+" "+Tt,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],Ot):E.addClass([this.container],Ot),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.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)},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)},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.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,r=!!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&&!r?(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(kt,t);break;case 40:t.preventDefault(),this.action(wt,t)}},e.prototype.performAction=function(t,e,i){null!==t&&!isNaN(t)||(t=0);i=this.correctRounding(t,e,i===kt?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)&&(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 e=e||0,i=t.toString().split("e"),i=(t=Math.round(Number(i[0]+"e"+(i[1]?Number(i[1])+e:e)))).toString().split("e");return t=Number(i[0]+"e"+(i[1]?Number(i[1])-e:-e)),Number(t.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?Lt:(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;t.preventDefault(),t.wheelDelta?e=t.wheelDelta/120:t.detail&&(e=-t.detail/3),0<e?this.action(kt,t):e<0&&this.action(wt,t),this.cancelEvent(t)},e.prototype.focusHandler=function(t){var e,i=this;clearTimeout(Ht),this.focusEventArgs={event:t,value:this.value,container:this.container},this.trigger("focus",this.focusEventArgs),!this.enabled||this.readonly||(this.isFocused=!0,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,Ht=setTimeout(function(){i.element.setSelectionRange(0,e.length)},t)):this.element.setSelectionRange(0,e.length)),E.Browser.isDevice)||E.EventHandler.add(this.element,"mousewheel DOMMouseScroll",this.mouseWheel,this)},e.prototype.focusOutHandler=function(t){var e,i,s,n=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(){n.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)),E.closest(this.element,"form"))&&(t=this.element.nextElementSibling,(s=document.createEvent("FocusEvent")).initEvent("focusout",!1,!0),t.dispatchEvent(s))},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(Tt)?kt:wt,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(Tt)?kt:wt,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,kt)),this.raiseChangeEvent()},e.prototype.decrement=function(t){void 0===t&&(t=this.step),this.isInteract=!1,this.changeValue(this.performAction(this.value,t,wt)),this.raiseChangeEvent()},e.prototype.destroy=function(){this.unwireEvents(),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),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],[At]))},e.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.element.blur(),E.removeClass([this.container],[At]))},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]);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),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.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)}}},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.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("Never")],e.prototype,"floatLabelType",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",Rt="e-float-input",Vt="e-utility-mask",Ft="e-label-top",Mt="e-label-bottom",Dt={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]+"["),Zt.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):Zt.call(this,i[s]);else Zt.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 Wt(){b.call(this,this.promptMask),be.call(this,this.value)}function qt(){E.EventHandler.add(this.element,"keydown",re,this),E.EventHandler.add(this.element,"keypress",pe,this),E.EventHandler.add(this.element,"keyup",de,this),E.EventHandler.add(this.element,"input",ae,this),E.EventHandler.add(this.element,"focus",$t,this),E.EventHandler.add(this.element,"blur",ee,this),E.EventHandler.add(this.element,"paste",ie,this),E.EventHandler.add(this.element,"cut",se,this),E.EventHandler.add(this.element,"drop",ne,this),E.EventHandler.add(this.element,"mousedown",Gt,this),E.EventHandler.add(this.element,"mouseup",Jt,this),this.enabled&&(_t.call(this),this.formElement)&&E.EventHandler.add(this.formElement,"reset",Kt,this)}function jt(){E.EventHandler.remove(this.element,"keydown",re),E.EventHandler.remove(this.element,"keypress",pe),E.EventHandler.remove(this.element,"keyup",de),E.EventHandler.remove(this.element,"input",ae),E.EventHandler.remove(this.element,"focus",$t),E.EventHandler.remove(this.element,"blur",ee),E.EventHandler.remove(this.element,"paste",ie),E.EventHandler.remove(this.element,"cut",se),E.EventHandler.remove(this.element,"drop",ne),E.EventHandler.remove(this.element,"mousedown",Gt),E.EventHandler.remove(this.element,"mouseup",Jt),this.formElement&&E.EventHandler.remove(this.formElement,"reset",Kt)}function _t(){this.showClearButton&&E.EventHandler.add(this.inputObj.clearButton,"mousedown touchstart",Xt,this)}function Xt(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 Kt(){"EJS-MASKEDTEXTBOX"===this.element.tagName?b.call(this,this.promptMask):this.value=this.initInputValue}function Yt(t){return t.value}function u(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 r=0;r<this.customRegExpCollec.length;r++)n=n&&!1,">"!==this.customRegExpCollec[s]&&"<"!==this.customRegExpCollec[s]&&"|"!==this.customRegExpCollec[s]&&"\\"!==this.customRegExpCollec[s]||(--r,n=!0),n||a[r]!==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[r]),++s;return i=null===this.mask||""===this.mask&&void 0!==this.value?a:i}function Zt(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 Gt(){this.isClicked=!0}function Jt(){this.isClicked=!1}function $t(t){var i=this,s=this.element,e=0,n=u.call(this,s),a=!1,r=!1,l={selectionStart:s.selectionStart,event:t,value:this.value,maskedValue:s.value,container:E.isNullOrUndefined(this.inputObj)?this.inputObj:this.inputObj.container,selectionEnd:s.selectionEnd};if(this.isClicked||Qt.call(this,l,s),this.mask&&(null!==n&&""!==n||"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)a=!0;else for(var t=s.selectionStart;t<i.promptMask.length;t++){if(s.value[t]===i.promptChar){a=!0;break}if(s.value[t]!==i.promptMask[t]){a=!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===n||""===n)&&null!==this.placeholder&&""!==this.placeholder)){for(e=0;e<this.promptMask.length;e++)if(s.value[e]===this.promptChar){setTimeout(function(){(a||r)&&(s.selectionEnd=e,s.selectionStart=e),l={selectionStart:s.selectionStart,event:t,value:i.value,maskedValue:s.value,container:E.isNullOrUndefined(i.inputObj)?i.inputObj:i.inputObj.container,selectionEnd:s.selectionEnd},Qt.call(i,l,s)},110);break}E.isNullOrUndefined(s.value.match(te(this.promptChar)))&&(l={selectionStart:s.selectionStart,event:t,value:this.value,maskedValue:s.value,container:E.isNullOrUndefined(this.inputObj)?this.inputObj:this.inputObj.container,selectionEnd:s.selectionEnd},Qt.call(this,l,s)),this.isClicked=!1}}function Qt(t,e){this.trigger("focus",t,function(t){e.selectionStart=t.selectionStart,e.selectionEnd=t.selectionEnd})}function te(t){return E.isNullOrUndefined(t)?t:t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function ee(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.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(Ft)&&E.removeClass([t],Ft)}function ie(s){var n,a,r,l=this;this.mask&&!this.readonly&&(n=this.element.selectionStart,a=this.element.selectionEnd,r=this.element.value,b.call(this,""),this._callPasteHandler=!0,setTimeout(function(){var t=l.element.value.replace(/ /g,""),e=(0<l.redoCollec.length&&l.redoCollec[0].value===l.element.value&&(t=u.call(l,l.element)),b.call(l,r),l.element.selectionStart=n,l.element.selectionEnd=a,0);for(l.maskKeyPress=!0;me.call(l,t[e],!1,null),++e<t.length;);if(l.maskKeyPress=!1,l._callPasteHandler=!1,l.element.value===r){var i=0;for(l.maskKeyPress=!0;me.call(l,t[i],!1,null),++i<t.length;);l.maskKeyPress=!1}else ue.call(l,s,r)},1))}function se(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 ne(t){t.preventDefault()}function ae(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)&&!this._callPasteHandler||he.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);me.call(this,s[n],t.ctrlKey,t),++n<s.length;);this.element.value!==this.preEleVal&&ue.call(this,t,null)}i=u.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(),he.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 le(){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 oe(t,e,i){return"input"===i.type&&(t=!1,e=this.element.value,b.call(this,this.promptMask),be.call(this,e)),t}function he(t){var e,i=!1,s=!1,n=(this.element.value.length<this.promptMask.length&&(e=this.element.value,i=oe.call(this,i=!0,e,t),le.call(this)),this.element.value.length>=this.promptMask.length&&"input"===t.type&&(i=oe.call(this,i,e,t)),this.element.selectionStart),a=this.element.selectionEnd,r=this.element.selectionStart,l=this.element.selectionEnd,o=this.hiddenMask.replace(/[>|\\<]/g,""),h=o[r-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:l});var u=!1,d=this.element.value;if(0<r||(8===t.keyCode||46===t.keyCode)&&r<this.element.value.length&&this.element.selectionEnd-r!==this.element.value.length){var c=r;r!==l?(r=l,46===t.keyCode&&(u=!0)):46===t.keyCode?++c:--c;for(var m=r;8===t.keyCode||i||u?c<m:m<c;8===t.keyCode||i||u?m--:m++)for(var v=r;8===t.keyCode||i||u?0<v:v<this.element.value.length;8===t.keyCode||i||u?v--:v++){var f,g,y=void 0;(8===t.keyCode||u)&&(n!==a&&n!==r||n===a)||i?(h=o[v-1],y=r-1):(h=o[v],y=r,++r),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||u||++this.element.selectionStart):(f=this.element.value,g=this.promptChar,g=f.substring(0,y)+g+f.substring(r,f.length),b.call(this,g),t.preventDefault(),46!==t.keyCode||u||y++,this.element.selectionStart=this.element.selectionEnd=y,s=!0),r=this.element.selectionStart,!s&&8===t.keyCode||u||!s&&46!==t.keyCode?y=r-1:(y=r,s=!1),f=this.element.value[y],n!==a&&this.element.selectionStart===n||this.promptMask[y]===this.promptChar||f!==this.promptMask[y]&&this.promptMask[y]!==this.promptChar&&!E.isNullOrUndefined(this.customCharacters))break}}46===t.keyCode&&u&&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=r),this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),this.element.value!==d&&ue.call(this,t,e)}}function pe(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&&(me.call(this,i,t.ctrlKey,t),t.preventDefault()):(this.isIosInvalid=!0,me.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=u.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=u.call(this,this.element)}function de(t){var e,i,s,n,a,r,l,o;this.mask&&!this.readonly?(s=void 0,this.maskKeyPress||229!==t.keyCode?ye.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,l=s.value.substring(n-e,n),s=this.redoCollec[0],i=i.trim(),(r=E.Browser.isAndroid&&""===i)||l===i||s.value.substring(n-e,n)===i?r&&fe.call(this,t,n-1,this.element.selectionEnd-1,i,t.ctrlKey,!1):me.call(this,i,t.ctrlKey,t)):(a=this.promptMask,me.call(this,i,t.ctrlKey,t)),this.maskKeyPress=!1,ue.call(this,t,a))),l=u.call(this,this.element),(0!==this.element.selectionStart||this.promptMask!==this.element.value||""!==l||""===l&&this.value!==l)&&(this.prevValue=l,this.value=l)):ue.call(this,t),0===this.element.selectionStart&&0===this.element.selectionEnd&&(o=this.element,setTimeout(function(){o.setSelectionRange(0,0)},0))}function ce(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 me(t,e,i){if(ce.call(this,t),!E.isNullOrUndefined(this)&&!E.isNullOrUndefined(t))for(var s,n=u=this.element.selectionStart,a=!1,r=this.element.value,l=!1,o=!1,h=0;h<t.length;h++){var p=t[h],u=this.element.selectionStart;if(this.maskKeyPress||n!==u||(u+=h),!this.maskKeyPress||u<this.promptMask.length){for(var d,c,m=u;m<this.promptMask.length;m++){var v=this.escapeMaskValue[u];"\\"===this.hiddenMask[u]&&this.hiddenMask[u+1]===t&&(o=!0),(E.isNullOrUndefined(this.regExpCollec[""+v])&&(E.isNullOrUndefined(this.customCharacters)||!E.isNullOrUndefined(this.customCharacters)&&E.isNullOrUndefined(this.customCharacters[""+v]))&&this.hiddenMask[u]!==this.promptChar&&"["!==this.customRegExpCollec[u][0]&&"]"!==this.customRegExpCollec[u][this.customRegExpCollec[u].length-1]||this.promptMask[u]!==this.promptChar&&E.isNullOrUndefined(this.customCharacters)||this.promptChar===v&&this.escapeMaskValue===this.mask)&&(this.element.selectionStart=this.element.selectionEnd=u+1,u=this.element.selectionStart,v=this.hiddenMask[u])}if(E.isNullOrUndefined(this.customCharacters)||E.isNullOrUndefined(this.customCharacters[""+v]))(!E.isNullOrUndefined(this.regExpCollec[""+v])&&p.match(new RegExp(this.regExpCollec[""+v]))&&this.promptMask[u]===this.promptChar||this.promptMask[u]===this.promptChar&&"["===this.customRegExpCollec[u][0]&&"]"===this.customRegExpCollec[u][this.customRegExpCollec[u].length-1]&&p.match(new RegExp(this.customRegExpCollec[u])))&&(a=!0);else for(var f=this.customCharacters[""+v].split(","),m=0;m<f.length;m++)if(p.match(new RegExp("["+f[m]+"]"))){a=!0;break}(!this.maskKeyPress||u<this.hiddenMask.length)&&a?(0===h&&(this.maskKeyPress?this.undoCollec.push({value:r,startIndex:u,endIndex:u}):(d=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:u,endIndex:u}),s=this.promptMask,b.call(this,s)),this.element.selectionStart=d,this.element.selectionEnd=c)),u=this.element.selectionStart,ve.call(this,i,u,p,s,o),l=!0,h===t.length-1&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),a=!1):(u=this.element.selectionStart,fe.call(this,i,u,n,t,e,l)),h!==t.length-1||a||(!E.Browser.isAndroid||E.Browser.isAndroid&&u<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)||ge.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 fe(t,e,i,s,n,a){var r;this.maskKeyPress||(r=this.element.value,e>=this.promptMask.length?b.call(this,r.substring(0,e)):(i===e?b.call(this,r.substring(0,e)+r.substring(e+1,r.length)):this.promptMask.length===this.element.value.length?b.call(this,r.substring(0,e)+r.substring(e,r.length)):b.call(this,r.substring(0,i)+r.substring(i+1,r.length)),this.element.selectionStart=this.element.selectionEnd=a||this.element.value[i]!==this.promptChar?e:i),ge.call(this)),1!==s.length||n||E.isNullOrUndefined(t)||ge.call(this)}function ge(){var t=this,e=this.element.parentNode,i=200;e.classList.contains(It)||e.classList.contains(Rt)?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||ye.call(t)},i)}function ye(){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 be(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++)me.call(this,t[e],!1,null);var i=u.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(Ft)&&!this.isFocus&&(E.removeClass([i],Ft),E.addClass([i],Mt),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=u.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 Ce(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:Dt,customRegExpCollec:[],customCharacters:t.customCharacters,undoCollec:[],redoCollec:[],maskKeyPress:!1,prevValue:""};return zt.call(t),t}function Ee(t){var e;return e=!E.isNullOrUndefined(t)&&t.element.classList.contains(Vt)?Ce(t):e}function Se(){}xe=function(t,e){return(xe=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 xe,Pe,xt=function(t,e){function i(){this.constructor=t}xe(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,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},Te="e-input-focus",Oe=["title","style","class"],xt=(Pe=E.Component,xt(i,Pe),i.prototype.getModuleName=function(){return"maskedtextbox"},i.prototype.preRender=function(){this.promptMask="",this.hiddenMask="",this.escapeMaskValue="",this.regExpCollec=Dt,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.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];Oe.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<Oe.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),Wt.call(this),(null===this.mask||""===this.mask&&void 0!==this.value)&&b.call(this,this.value);var t=u.call(this,this.element);this.prevValue=t,this.value=t,this.isInitial||jt.call(this),qt.call(this)},i.prototype.setMaskPlaceholder=function(t,e){(e||this.placeholder)&&(o.Input.setPlaceholder(this.placeholder,this.element),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":be.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]);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),_t.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"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.updateValue=function(t){this.resetMaskedTextBox(),be.call(this,t)},i.prototype.getMaskedValue=function(){return Yt.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],[Te]))},i.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.isFocus=!1,this.element.blur(),E.removeClass([this.inputObj.container],[Te]))},i.prototype.destroy=function(){jt.call(this),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,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.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}ke=function(t,e){return(ke=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 ke,we,t=function(t,e){function i(){this.constructor=t}ke(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,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},Le=(we=E.ChildProperty,t(Ae,we),s([E.Property("None")],Ae.prototype,"placement",void 0),s([E.Property(10)],Ae.prototype,"largeStep",void 0),s([E.Property(1)],Ae.prototype,"smallStep",void 0),s([E.Property(!1)],Ae.prototype,"showSmallTicks",void 0),s([E.Property(null)],Ae.prototype,"format",void 0),Ae);function Ae(){return null!==we&&we.apply(this,arguments)||this}Ne=E.ChildProperty,t(Be,Ne),s([E.Property(null)],Be.prototype,"color",void 0),s([E.Property(null)],Be.prototype,"start",void 0),s([E.Property(null)],Be.prototype,"end",void 0);var Ne,He=Be;function Be(){return null!==Ne&&Ne.apply(this,arguments)||this}Ue=E.ChildProperty,t(Re,Ue),s([E.Property(!1)],Re.prototype,"enabled",void 0),s([E.Property(null)],Re.prototype,"minStart",void 0),s([E.Property(null)],Re.prototype,"minEnd",void 0),s([E.Property(null)],Re.prototype,"maxStart",void 0),s([E.Property(null)],Re.prototype,"maxEnd",void 0),s([E.Property(!1)],Re.prototype,"startHandleFixed",void 0),s([E.Property(!1)],Re.prototype,"endHandleFixed",void 0);var Ue,Ie=Re;function Re(){return null!==Ue&&Ue.apply(this,arguments)||this}Ve=E.ChildProperty,t(Me,Ve),s([E.Property("")],Me.prototype,"cssClass",void 0),s([E.Property("Before")],Me.prototype,"placement",void 0),s([E.Property("Focus")],Me.prototype,"showOn",void 0),s([E.Property(!1)],Me.prototype,"isVisible",void 0),s([E.Property(null)],Me.prototype,"format",void 0);var Ve,Fe=Me;function Me(){return null!==Ve&&Ve.apply(this,arguments)||this}var De,ze=1e-10,We="e-slider",qe="e-rtl",je="e-slider-input",_e="e-control-wrapper",Xe="e-handle",Ke="e-range",Ye="e-slider-button",Ze="e-first-button",Ge="e-second-button",Je="e-scale",$e="e-tick",Qe="e-large",ti="e-tick-value",ei="e-slider-tooltip",ii="e-slider-hover",si="e-handle-first",ni="e-handle-second",ai="e-disabled",ri="e-slider-container",li="e-slider-horizontal-before",oi="e-slider-horizontal-after",hi="e-slider-vertical-before",pi="e-slider-vertical-after",ui="e-material-tooltip-open",di="e-tooltip-active",ci="e-material-slider",mi="e-slider-track",vi="e-slider-horizantal-color",fi="e-slider-vertical-color",gi="e-handle-focused",yi="e-vertical",bi="e-horizontal",Ci="e-handle-start",Ei="e-material-tooltip-start",a="e-tab-handle",Si="e-button-icon",xi="e-small-size",Pi="e-tick-pos",Ti="e-first-tick",Oi="e-last-tick",ki="e-slider-btn",wi="e-tab-track",Li="e-tab-range",Ai="e-handle-active",Ni="e-material-handle",Hi="e-material-range",Bi="e-material-default",Ui="e-material-tooltip-show",Ii="e-material-tooltip-hide",Ri="e-read-only",Vi="e-limits",Fi="e-limit-bar",Mi="e-limit-first",Di="e-limit-second",zi="e-drag-horizontal",Wi="e-drag-vertical",qi=(De=E.Component,t(r,De),r.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()},r.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},r.prototype.initCultureFunc=function(){this.internationalization=new E.Internationalization(this.locale)},r.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},r.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}},r.prototype.formatNumber=function(t){var e=this.numberOfDecimals(t);return this.internationalization.getNumberFormat({maximumFractionDigits:e,minimumFractionDigits:e,useGrouping:!1})(t)},r.prototype.numberOfDecimals=function(t){t=t.toString().split(".")[1];return t&&t.length?t.length:0},r.prototype.makeRoundNumber=function(t,e){return Number(t.toFixed(e||0))},r.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)},r.prototype.initialize=function(){E.addClass([this.element],We),this.setCSSClass()},r.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)))},r.prototype.setCSSClass=function(t){t&&E.removeClass([this.element],t.split(" ")),this.cssClass&&E.addClass([this.element],this.cssClass.split(" "))},r.prototype.setEnabled=function(){this.enabled?(E.removeClass([this.sliderContainer],[ai]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.remove(ai),this.wireEvents()):(E.addClass([this.sliderContainer],[ai]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.add(ai),this.unwireEvents())},r.prototype.getTheme=function(t){return window.getComputedStyle(t,":after").getPropertyValue("content").replace(/['"]+/g,"")},r.prototype.initRender=function(){this.sliderContainer=this.createElement("div",{className:ri+" "+_e}),this.element.parentNode.insertBefore(this.sliderContainer,this.element),this.sliderContainer.appendChild(this.element),this.sliderTrack=this.createElement("div",{className:mi}),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*Math.random()).toFixed(0)+"slider",class:je}}),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],[ai]):E.addClass([this.sliderContainer],[ai]),this.readonly?E.addClass([this.sliderContainer],[Ri]):E.removeClass([this.sliderContainer],[Ri])},r.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},r.prototype.createRangeBar=function(){"Default"!==this.type&&(this.rangeBar=this.createElement("div",{attrs:{class:Ke}}),this.element.appendChild(this.rangeBar),this.drag)&&"Range"===this.type&&("Horizontal"===this.orientation?this.rangeBar.classList.add(zi):this.rangeBar.classList.add(Wi))},r.prototype.createLimitBar=function(){var t="Range"!==this.type?Fi:Mi;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:Di+" "+Vi}}),this.element.appendChild(this.limitBarSecond))},r.prototype.setOrientClass=function(){"Vertical"!==this.orientation?(this.sliderContainer.classList.remove(yi),this.sliderContainer.classList.add(bi),this.firstHandle.setAttribute("aria-orientation","horizontal"),"Range"===this.type&&this.secondHandle.setAttribute("aria-orientation","horizontal")):(this.sliderContainer.classList.remove(bi),this.sliderContainer.classList.add(yi),this.firstHandle.setAttribute("aria-orientation","vertical"),"Range"===this.type&&this.secondHandle.setAttribute("aria-orientation","vertical"))},r.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]})})},r.prototype.createSecondHandle=function(){this.secondHandle=this.createElement("div",{attrs:{class:Xe,role:"slider",tabIndex:"0","aria-label":"slider"}}),this.secondHandle.classList.add(ni),this.element.appendChild(this.secondHandle)},r.prototype.createFirstHandle=function(){this.firstHandle=this.createElement("div",{attrs:{class:Xe,role:"slider",tabIndex:"0","aria-label":"slider"}}),this.firstHandle.classList.add(si),this.element.appendChild(this.firstHandle),this.isMaterialTooltip&&(this.materialHandle=this.createElement("div",{attrs:{class:Xe+" "+Ni}}),this.element.appendChild(this.materialHandle))},r.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))},r.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))},r.prototype.handleStart=function(){"Range"!==this.type&&(this.firstHandle.classList[0===this.handlePos1?"add":"remove"](Ci),this.isMaterialTooltip)&&(this.materialHandle.classList[0===this.handlePos1?"add":"remove"](Ci),this.tooltipElement)&&this.tooltipElement.classList[0===this.handlePos1?"add":"remove"](Ei)},r.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())},r.prototype.handleFocusOut=function(){this.firstHandle.classList.contains(gi)&&this.firstHandle.classList.remove(gi),"Range"===this.type&&this.secondHandle.classList.contains(gi)&&this.secondHandle.classList.remove(gi)},r.prototype.handleFocus=function(t){this.focusSliderElement(),this.sliderBarClick(t),(t.currentTarget===this.firstHandle?(this.firstHandle.classList.add(gi),this.firstHandle):(this.secondHandle.classList.add(gi),this.secondHandle)).classList.add(a),E.EventHandler.add(document,"mousemove touchmove",this.sliderBarMove,this),E.EventHandler.add(document,"mouseup touchend",this.sliderBarUp,this)},r.prototype.handleOver=function(t){this.tooltip.isVisible&&"Hover"===this.tooltip.showOn&&this.tooltipToggle(t.currentTarget),"Default"===this.type&&this.tooltipToggle(this.getHandle())},r.prototype.handleLeave=function(t){!this.tooltip.isVisible||"Hover"!==this.tooltip.showOn||t.currentTarget.classList.contains(gi)||t.currentTarget.classList.contains(a)||this.closeTooltip()},r.prototype.setHandler=function(){this.createFirstHandle(),"Range"===this.type&&this.createSecondHandle()},r.prototype.setEnableRTL=function(){this.enableRtl&&"Vertical"!==this.orientation?E.addClass([this.sliderContainer],qe):E.removeClass([this.sliderContainer],qe);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()},r.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)},r.prototype.setTooltipContent=function(){var t=this.formatContent(this.tooltipFormatInfo,!1);this.tooltipObj.content=E.initializeCSPTemplate(function(){return t})},r.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},r.prototype.addTooltipClass=function(t){var e;this.isMaterialTooltip&&(t=t.toString().length,this.tooltipElement?(e=4<t?{oldCss:Bi,newCss:Hi}:{oldCss:Hi,newCss:Bi},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?Hi:Bi,this.tooltipObj.cssClass=ei+" "+e))},r.prototype.tooltipPlacement=function(){return"Horizontal"===this.orientation?"Before"===this.tooltip.placement?"TopCenter":"BottomCenter":"Before"===this.tooltip.placement?"LeftCenter":"RightCenter"},r.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())},r.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)}}},r.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)},r.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))},r.prototype.tooltipPositionCalculation=function(t){var e;switch(t){case"TopCenter":e=li;break;case"BottomCenter":e=oi;break;case"LeftCenter":e=hi;break;case"RightCenter":e=pi}return e},r.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===li?{rotate:"rotate(45deg)",translate:"translateY("+e+"px)"}:{rotate:"rotate(225deg)",translate:"translateY("+-e+"px)"}:t===hi?{rotate:"rotate(-45deg)",translate:"translateX("+e+"px)"}:{rotate:"rotate(-225deg)",translate:"translateX("+-e+"px)"}),e},r.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))},r.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))},r.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()},r.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)")},r.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:ei,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()},r.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(ci),this.tooltipValue(),this.tooltipObj.animation.close.effect="None",this.tooltipObj.open(this.firstHandle))},r.prototype.tooltipBeforeClose=function(){this.tooltipElement=void 0,this.tooltipCollidedPosition=void 0},r.prototype.setButtons=function(){this.firstBtn=this.createElement("div",{className:Ye+" "+Ze}),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:Ye+" "+Ge}),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(ki),this.sliderContainer.appendChild(this.firstBtn),this.sliderContainer.appendChild(this.secondBtn),this.sliderContainer.appendChild(this.element),this.buttonTitle()},r.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})},r.prototype.buttonFocusOut=function(){(this.isMaterial||this.isMaterial3)&&this.getHandle().classList.remove("e-large-thumb-size")},r.prototype.repeatButton=function(t){var e,i=this.handleValueUpdate(),s=this.enableRtl&&"Vertical"!==this.orientation;t.target.parentElement.classList.contains(Ze)||t.target.classList.contains(Ze)?e=s?this.add(i,parseFloat(this.step.toString()),!0):this.add(i,parseFloat(this.step.toString()),!1):(t.target.parentElement.classList.contains(Ge)||t.target.classList.contains(Ge))&&(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),this.tooltipToggle(this.getHandle()))},r.prototype.repeatHandlerMouse=function(t){t.preventDefault(),"mousedown"!==t.type&&"touchstart"!==t.type||(this.buttonClick(t),this.repeatInterval=setInterval(this.repeatButton.bind(this),180,t))},r.prototype.materialChange=function(){this.getHandle().classList.contains("e-large-thumb-size")||this.getHandle().classList.add("e-large-thumb-size")},r.prototype.focusHandle=function(){this.getHandle().classList.contains(a)||this.getHandle().classList.add(a)},r.prototype.repeatHandlerUp=function(t){this.changeEvent("changed",t),this.closeTooltip(),clearInterval(this.repeatInterval),this.getHandle().focus()},r.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},r.prototype.renderScale=function(){var t="Vertical"===this.orientation?"v":"h",e=(this.ul=this.createElement("ul",{className:Je+" e-"+t+"-scale "+$e+"-"+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,r=this.customTickCounter(a),l=!E.isNullOrUndefined(this.customValues)&&0<this.customValues.length?a*r+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/l;p===1/0&&(p=5);for(var u=0,d=!E.isNullOrUndefined(this.customValues)&&0<this.customValues.length?this.customValues.length-1:0,c=0;u<=l;u++){var m,v,f,g=this.createElement("li",{attrs:{class:$e,role:"presentation","aria-hidden":"true"}}),y=(!E.isNullOrUndefined(this.customValues)&&0<this.customValues.length?(m=u%(r+1)==0)&&("h"==t?(o=this.customValues[c],c++):(o=this.customValues[d],d--),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)?(f="h"==t?(o-parseFloat(this.min.toString()))%this.ticks.largeStep:Math.abs(o-parseFloat(this.max.toString()))%this.ticks.largeStep,Math.abs(f)<ze||Math.abs(this.ticks.largeStep-f)<ze):(v=this.ticks.largeStep,C=o,f="h"==t?(C-i)%v:Math.abs(C-parseFloat(s.toString()))%v,Math.abs(f)<ze||Math.abs(v-f)<ze)),m&&g.classList.add(Qe),"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)},r.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(Ti),this.lastChild.classList.add(Oi),this.sliderContainer.classList.add(Je+"-"+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()},r.prototype.createTick=function(t,e){var i=this.createElement("span",{className:ti+" "+$e+"-"+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()},r.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())})},r.prototype.scaleAlignment=function(){this.tickValuePosition(),"Vertical"===this.orientation?this.element.getBoundingClientRect().width<=15?this.sliderContainer.classList.add(xi):this.sliderContainer.classList.remove(xi):this.element.getBoundingClientRect().height<=15?this.sliderContainer.classList.add(xi):this.sliderContainer.classList.remove(xi)},r.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("."+$e+"."+Qe+" ."+ti)]),a="Both"===this.ticks.placement?[].slice.call(n[0],2):[].slice.call(n[0],1),r="Vertical"===this.orientation?2*i.height:2*i.width,l=0;l<this.firstChild.children.length;l++)"Vertical"===this.orientation?this.firstChild.children[l].style.top=-t.height/2+"px":this.enableRtl?this.firstChild.children[l].style.left=(r-this.firstChild.children[l].getBoundingClientRect().width)/2+"px":this.firstChild.children[l].style.left=-t.width/2+"px";for(l=0;l<a.length;l++)e=a[l].getBoundingClientRect(),"Vertical"===this.orientation?E.setStyleAttribute(a[l],{top:(r-e.height)/2+"px"}):E.setStyleAttribute(a[l],{left:(r-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(Oi),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(Oi),this.firstChild.style.left=this.firstHandle.style.left)),"Vertical"===this.orientation)&&this.firstChild.classList.remove(Oi)},r.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]})},r.prototype.handleValueUpdate=function(){var t="Range"!==this.type||1===this.activeHandle?this.handleVal1:this.handleVal2;return t},r.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]},r.prototype.focusSliderElement=function(){this.isElementFocused||(this.element.focus(),this.isElementFocused=!0)},r.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(Ze)?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(Ge)?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(Ze)?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(Ge)?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),!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(Ze)&&E.EventHandler.add(this.firstBtn,"mouseup touchend",this.buttonUp,this),t.currentTarget.classList.contains(Ge)&&E.EventHandler.add(this.secondBtn,"mouseup touchend",this.buttonUp,this)},r.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)},r.prototype.buttonUp=function(t){t.currentTarget.classList.contains(Ze)&&E.EventHandler.remove(this.firstBtn,"mouseup touchend",this.buttonUp),t.currentTarget.classList.contains(Ge)&&E.EventHandler.remove(this.secondBtn,"mouseup touchend",this.buttonUp)},r.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"}))},r.prototype.checkValidValueAndPos=function(t){return t=this.checkHandleValue(t),t=this.checkHandlePosition(t)},r.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"))},r.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))},r.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)]},r.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()},r.prototype.rangeValueUpdate=function(){null!==this.value&&"object"==typeof this.value||(this.value=[parseFloat(E.formatUnit(this.min)),parseFloat(E.formatUnit(this.max))])},r.prototype.validateRangeValue=function(){this.rangeValueUpdate(),this.setRangeValue()},r.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+"")},r.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)},r.prototype.getHandle=function(){return 1===this.activeHandle?this.firstHandle:this.secondHandle},r.prototype.setRangeValue=function(){this.updateRangeValue(),this.activeHandle=1,this.setHandlePosition(null),this.activeHandle=2,this.setHandlePosition(null),this.activeHandle=1},r.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()},r.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},r.prototype.setPreviousVal=function(t,e){"change"===t?this.previousVal=e:this.previousChanged=e},r.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)},r.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},r.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)},r.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()},r.prototype.changeHandleValue=function(t){var e=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&&(e=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&&(e=this.preHandlePos2=this.handlePos2)),this.modifyZindex(),null!==e&&("Default"!==this.type&&this.setRangeBar(),this.setHandlePosition(null))},r.prototype.tempStartEnd=function(){return this.min>this.max?{start:this.max,end:this.min}:{start:this.min,end:this.max}},r.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)},r.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},r.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},r.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)},r.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(Ai),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(Ai),this.handlePos1=this.preHandlePos1=i,this.handleVal1=s),this.modifyZindex(),this.firstHandle)).focus(),this.isMaterialTooltip&&this.tooltipElement.classList.add(di),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()},r.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)},r.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()},r.prototype.sliderBarUp=function(t){this.changeEvent("changed",t),this.handleFocusOut(),this.firstHandle.classList.remove(Ai),"Range"===this.type&&(this.initialTooltip=!1,this.secondHandle.classList.remove(Ai)),this.closeTooltip(),(this.isMaterial||this.isMaterial3)&&(this.getHandle().classList.remove("e-large-thumb-size"),this.isMaterialTooltip)&&this.tooltipElement.classList.remove(di),E.EventHandler.remove(document,"mousemove touchmove",this.sliderBarMove),E.EventHandler.remove(document,"mouseup touchend",this.sliderBarUp)},r.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(Ai)),"Range"===this.type&&(1===this.activeHandle?(this.firstHandle.classList.add(Ai),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(Ai),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()},r.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},r.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},r.prototype.refreshTooltip=function(t){this.tooltip.isVisible&&this.tooltipObj&&(this.tooltipValue(),t)&&(this.tooltipObj.refresh(t),this.tooltipTarget=t)},r.prototype.openTooltip=function(t){this.tooltip.isVisible&&this.tooltipObj&&!this.isMaterialTooltip&&(this.tooltipValue(),this.tooltipObj.open(t),this.tooltipTarget=t)},r.prototype.closeTooltip=function(){this.tooltip.isVisible&&this.tooltipObj&&"Always"!==this.tooltip.showOn&&!this.isMaterialTooltip&&(this.tooltipValue(),this.tooltipObj.close(),this.tooltipTarget=void 0)},r.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)}},r.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))},r.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))},r.prototype.elementClick=function(t){this.isDragComplete?this.isDragComplete=!1:(t.preventDefault(),this.focusSliderElement(),this.sliderBarClick(t),this.focusHandle())},r.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)},r.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)},r.prototype.formResetHandler=function(){this.setProperties({value:this.formResetValue},!0),this.setValue()},r.prototype.keyUp=function(t){var e;9===t.keyCode&&t.target.classList.contains(Xe)&&(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("."+mi).classList.add(wi),"Range"!==this.type&&"MinRange"!==this.type||e.querySelector("."+Ke).classList.add(Li)),"Range"===this.type&&((e=t.target.previousSibling)&&e.classList.contains(Xe)?this.activeHandle=2:this.activeHandle=1),this.getHandle().focus(),this.tooltipToggle(this.getHandle()))),this.closeTooltip(),this.changeEvent("changed",t)},r.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(ii):(this.sliderContainer.classList.remove(ii),t=t.currentTarget,this.tooltip.isVisible&&"Always"!==this.tooltip.showOn&&this.tooltipObj&&this.isMaterialTooltip&&!t.classList.contains(gi)&&!t.classList.contains(a)&&this.closeMaterialTooltip()))},r.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("."+wi)&&(this.element.querySelector("."+wi).classList.remove(wi),"Range"!==this.type&&"MinRange"!==this.type||!this.element.querySelector("."+Li)||this.element.querySelector("."+Li).classList.remove(Li)),this.hiddenInput.focus(),this.hiddenInput.blur(),this.isElementFocused=!1)},r.prototype.removeElement=function(t){t.parentNode&&t.parentNode.removeChild(t)},r.prototype.changeSliderType=function(t,e){this.isMaterialTooltip&&this.materialHandle&&(this.sliderContainer.classList.remove(ci),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(Ri),this.setReadOnly())},r.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"}))},r.prototype.changeOrientation=function(){this.changeSliderType(this.type,"null")},r.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()},r.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))},r.prototype.getPersistData=function(){return this.addOnPersist(["value"])},r.prototype.destroy=function(){De.prototype.destroy.call(this),this.unwireEvents(),window.removeEventListener("resize",this.onresize),E.removeClass([this.sliderContainer],[ai]),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},r.prototype.onPropertyChanged=function(t,e){for(var i=this,s=0,n=Object.keys(t);s<n.length;s++){var a,r=n[s];switch(r){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(r),this.showButtons)||this.wireEvents();break;case"type":E.isNullOrUndefined(e)||!Object.keys(e).length||E.isNullOrUndefined(e.type)||(this.changeSliderType(e.type,r),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("."+Je))||(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(ki),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()}}},r.prototype.setReadOnly=function(){this.readonly?(this.unwireEvents(),this.sliderContainer.classList.add(Ri)):(this.wireEvents(),this.sliderContainer.classList.remove(Ri))},r.prototype.setMinMaxValue=function(){var e=this;this.setValue(),this.refreshTooltip(this.tooltipTarget),E.isNullOrUndefined(this.sliderContainer.querySelector("."+Je))||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())},r.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+"")},r.prototype.setTooltip=function(t){this.changeSliderType(this.type,t)},r.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,r=0;r<this.colorRange.length;r++)E.isNullOrUndefined(this.colorRange[r].start)||E.isNullOrUndefined(this.colorRange[r].end)||this.colorRange[r].end>this.colorRange[r].start&&(this.colorRange[r].start<this.min&&(this.colorRange[r].start=this.min),this.colorRange[r].end>this.max&&(this.colorRange[r].end=this.max),s=this.checkHandlePosition(this.colorRange[r].start),n=this.checkHandlePosition(this.colorRange[r].end),(a=this.createElement("div")).style.backgroundColor=this.colorRange[r].color,a.style.border="1px solid "+this.colorRange[r].color,"Horizontal"===this.orientation?(e=vi,t=this.enableRtl?E.isNullOrUndefined(this.customValues)?this.checkHandlePosition(this.max)-this.checkHandlePosition(this.colorRange[r].end):this.checkHandlePosition(this.customValues.length-this.colorRange[r].end-1):this.checkHandlePosition(this.colorRange[r].start),a.style.width=n-s+"px",a.style.left=t+"px"):(e=fi,t=this.checkHandlePosition(this.colorRange[r].start),a.style.height=n-s+"px",a.style.bottom=t+"px"),a.classList.add(e),this.sliderTrack.appendChild(a))},r.prototype.getModuleName=function(){return"slider"},s([E.Property(null)],r.prototype,"value",void 0),s([E.Property(null)],r.prototype,"customValues",void 0),s([E.Property(1)],r.prototype,"step",void 0),s([E.Property(null)],r.prototype,"width",void 0),s([E.Property(0)],r.prototype,"min",void 0),s([E.Property(100)],r.prototype,"max",void 0),s([E.Property(!1)],r.prototype,"readonly",void 0),s([E.Property("Default")],r.prototype,"type",void 0),s([E.Collection([{}],He)],r.prototype,"colorRange",void 0),s([E.Complex({},Le)],r.prototype,"ticks",void 0),s([E.Complex({},Ie)],r.prototype,"limits",void 0),s([E.Property(!0)],r.prototype,"enabled",void 0),s([E.Complex({},Fe)],r.prototype,"tooltip",void 0),s([E.Property(!1)],r.prototype,"showButtons",void 0),s([E.Property(!0)],r.prototype,"enableAnimation",void 0),s([E.Property("Horizontal")],r.prototype,"orientation",void 0),s([E.Property("")],r.prototype,"cssClass",void 0),s([E.Property(!0)],r.prototype,"enableHtmlSanitizer",void 0),s([E.Event()],r.prototype,"created",void 0),s([E.Event()],r.prototype,"change",void 0),s([E.Event()],r.prototype,"changed",void 0),s([E.Event()],r.prototype,"renderingTicks",void 0),s([E.Event()],r.prototype,"renderedTicks",void 0),s([E.Event()],r.prototype,"tooltipChange",void 0),s([E.NotifyPropertyChanges],r));function r(t,e){t=De.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}ji=function(t,e){return(ji=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 ji,_i,Xi,t=function(t,e){function i(){this.constructor=t}ji(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,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},Ki={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}$")},Yi=((Yi=o.ErrorOption||(o.ErrorOption={}))[Yi.Message=0]="Message",Yi[Yi.Label=1]="Label",_i=E.Base,t(l,_i),(Xi=l).prototype.addRules=function(t,e){t&&(this.rules.hasOwnProperty(t)?E.extend(this.rules[""+t],e,{}):this.rules[""+t]=e)},l.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={}},l.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},l.prototype.reset=function(){this.element.reset(),this.clearForm()},l.prototype.getInputElement=function(t){return this.inputElement=E.select('[name="'+t+'"]',this.element),this.inputElement},l.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)}_i.prototype.destroy.call(this),this.infoElement=null,E.onIntlChange.off("notifyExternalChange",this.afterLocalization)},l.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)"locale"===s[i]&&this.localeFunc()},l.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}},l.prototype.getModuleName=function(){return"formvalidator"},l.prototype.afterLocalization=function(t){this.locale=t.locale,this.localeFunc()},l.prototype.refresh=function(){this.unwireEvents(),this.inputElements=E.selectAll(this.selectQuery,this.element),this.wireEvents()},l.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)}},l.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={},r=0,l=t;r<l.length;r++){var o=l[r];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)}},l.prototype.annotationRule=function(t,e,i,s){var n=i.split("-"),a=["required","creditcard","phone","maxlength","minlength","range","regex","equalto"],r=n[n.length-1],n=n[n.length-2];if(-1!==a.indexOf(r))switch(r){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 l=t.getAttribute("data-val-range-min"),o=t.getAttribute("data-val-range-max");this.defRule(t,e,"range",[l,o]);break;case"equalto":l=t.getAttribute(i).split(".");this.defRule(t,e,"equalTo",l[l.length-1]);break;case"regex":this.defRule(t,e,"regex",s)}},l.prototype.defRule=function(t,e,i,s){var n,a=t.getAttribute("data-"+i+"-message"),r=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]:r?s=[s,r]:n&&(s=[s,n]),e[""+i]=s},l.prototype.wireEvents=function(){for(var t=0,e=this.inputElements;t<e.length;t++){var i=e[t];Xi.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)},l.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)},l.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))},l.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)},l.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)},l.prototype.changeHandler=function(t){this.trigger("change",t);t=t.target;this.validate(t.name)},l.prototype.submitHandler=function(t){this.trigger("submit",t),this.allowSubmit||this.validate()?this.allowSubmit=!1:t.preventDefault()},l.prototype.resetHandler=function(){this.clearForm()},l.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 r=0,l=e;r<l.length;r++){var o=l[r],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 u=this.inputElement.parentElement,d=u.parentElement;(u.classList.contains("e-control-wrapper")||u.classList.contains("e-wrapper")||this.inputElement.classList.contains("e-input")&&u.classList.contains("e-input-group")?(u.classList.add(this.errorClass),u):null!=d&&(d.classList.contains("e-control-wrapper")||d.classList.contains("e-wrapper"))?(d.classList.add(this.errorClass),d):(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",(u.classList.contains("e-control-wrapper")||u.classList.contains("e-wrapper")||this.inputElement.classList.contains("e-input")&&u.classList.contains("e-input-group")?(u.classList.add(this.errorClass),u):null!=d&&(d.classList.contains("e-control-wrapper")||d.classList.contains("e-wrapper"))?(d.classList.add(this.errorClass),d):(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)}}}},l.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))},l.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}):Xi.isCheckable(this.inputElement)?"required"!==e||0<E.selectAll('input[name="'+t+'"]:checked',this.element).length:Xi.checkValidator[""+e](i))},l.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},l.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)},l.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},l.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)},l.prototype.showMessage=function(t){this.infoElement.style.display="block",this.infoElement.innerHTML=t.message,this.checkRequired(t.name)},l.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"))},l.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))},l.isCheckable=function(t){t=t.getAttribute("type");return t&&("checkbox"===t||"radio"===t||"submit"===t)},l.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 Ki.EMAIL.test(t.value)},url:function(t){return Ki.URL.test(t.value)},dateIso:function(t){return Ki.DATE_ISO.test(t.value)},tel:function(t){return Ki.PHONE.test(t.value)},creditcard:function(t){return Ki.CREDITCARD.test(t.value)},number:function(t){return!isNaN(Number(t.value))&&-1===String(t.value).indexOf(" ")},digits:function(t){return Ki.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("")],l.prototype,"locale",void 0),s([E.Property("e-hidden")],l.prototype,"ignore",void 0),s([E.Property()],l.prototype,"rules",void 0),s([E.Property("e-error")],l.prototype,"errorClass",void 0),s([E.Property("e-valid")],l.prototype,"validClass",void 0),s([E.Property("label")],l.prototype,"errorElement",void 0),s([E.Property("div")],l.prototype,"errorContainer",void 0),s([E.Property(o.ErrorOption.Label)],l.prototype,"errorOption",void 0),s([E.Event()],l.prototype,"focusout",void 0),s([E.Event()],l.prototype,"keyup",void 0),s([E.Event()],l.prototype,"click",void 0),s([E.Event()],l.prototype,"change",void 0),s([E.Event()],l.prototype,"submit",void 0),s([E.Event()],l.prototype,"validationBegin",void 0),s([E.Event()],l.prototype,"validationComplete",void 0),s([E.Event()],l.prototype,"customPlacement",void 0),Xi=s([E.NotifyPropertyChanges],l));function l(t,e){e=_i.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}Zi=function(t,e){return(Zi=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 Zi,Gi,t=function(t,e){function i(){this.constructor=t}Zi(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,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},Ji="e-file-select",$i="e-file-drop",Qi="e-upload-files",ts="e-upload-file-list",c="e-file-status",es="e-file-name",is="e-file-type",ss="e-file-size",m="e-file-remove-btn",d="e-file-delete-btn",ns="e-spinner-pane",v="e-file-abort-btn",as="e-file-reload-btn",rs="e-upload-drag-hover",ls="e-upload-progress-wrap",os="e-upload-progress-bar",hs="e-progress-bar-text",f="e-upload-progress",ps="e-upload-success",g="e-upload-fails",us="e-file-container",ds="e-validation-fails",cs="e-disabled",ms="e-rtl-container",vs="e-clear-icon-focus",y="e-file-pause-btn",fs="e-file-play-btn",gs="e-restrict-retry",ys=["title","style","class"],bs="e-form-upload",Cs="e-file-invalid",Es=(Gi=E.ChildProperty,t(Ss,Gi),s([E.Property("")],Ss.prototype,"name",void 0),s([E.Property(null)],Ss.prototype,"size",void 0),s([E.Property("")],Ss.prototype,"type",void 0),Ss);function Ss(){return null!==Gi&&Gi.apply(this,arguments)||this}xs=E.ChildProperty,t(Ts,xs),s([E.Property("Browse...")],Ts.prototype,"browse",void 0),s([E.Property("Upload")],Ts.prototype,"upload",void 0),s([E.Property("Clear")],Ts.prototype,"clear",void 0);var xs,Ps=Ts;function Ts(){return null!==xs&&xs.apply(this,arguments)||this}Os=E.ChildProperty,t(ws,Os),s([E.Property("")],ws.prototype,"saveUrl",void 0),s([E.Property("")],ws.prototype,"removeUrl",void 0),s([E.Property(0)],ws.prototype,"chunkSize",void 0),s([E.Property(3)],ws.prototype,"retryCount",void 0),s([E.Property(500)],ws.prototype,"retryAfterDelay",void 0);var Os,ks=ws;function ws(){return null!==Os&&Os.apply(this,arguments)||this}Ls=E.Component,t(C,Ls),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("."+$i))&&(this.uploadWrapper.querySelector("."+$i).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("."+Qi)))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(ps)&&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"))&&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:Ji});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("."+ds).length+this.uploadWrapper.querySelectorAll(".e-upload-fails:not(.e-upload-progress)").length+this.uploadWrapper.querySelectorAll("span."+ps).length+this.uploadWrapper.querySelectorAll("span."+f).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)}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:$i});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];ys.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<ys.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.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),E.EventHandler.add(document,"click",this.removeFocus,this),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),E.EventHandler.remove(document,"click",this.removeFocus),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(fs)?this.resumeUpload(this.getCurrentMetaData(null,t),t):s.classList.contains(as)?(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(v)||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,"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,r=0;r<t;r++)a+=+this.fileList[r].getAttribute("data-files-count");for(var l=a;l<a+n;l++)e.push(s[l]);return 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(v)&&!n?(s[0].statusCode="5",E.isNullOrUndefined(i)||(n=i.querySelector("."+v),h.createSpinner({target:n,width:"20px"}),h.showSpinner(n)),this.sequentialUpload&&this.uploadSequential(),i.classList.contains(gs)||this.checkActionComplete(!0)):E.closest(t.target,"."+ns)||this.remove(s,!1,!1,!0,t),this.isForm&&i&&i.classList.contains(Cs)&&(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")))},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="",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,r=new E.Ajax(this.asyncSettings.removeUrl,"POST",!0,null),l=(r.emitError=!1,new FormData);r.beforeSend=function(e){t.currentRequest=r.httpRequest,s?n.removingEventCallback(t,l,a,i):n.trigger("removing",t,function(t){t.cancel?e.cancel=!0:n.removingEventCallback(t,l,a,i)})},r.onLoad=function(t){return n.removeCompleted(t,a,e),{}},r.onError=function(t){return n.removeFailed(t,a,e),{}},r.send(l)},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("."+d))&&E.isNullOrUndefined(s.querySelector("."+m))||(s=s.querySelector("."+d)?s.querySelector("."+d):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")},i=(i||(i=this.filesData.indexOf(e),(i=this.fileList[i])&&(i.classList.remove(ps),i.classList.add(g),i=i.querySelector("."+c))&&(i.classList.remove(ps),i.classList.add(g)),this.checkActionButtonStatus()),this.trigger("failure",t),this.getLiElement(e));E.isNullOrUndefined(i)||E.isNullOrUndefined(i.querySelector("."+d))||(t=i.querySelector("."+d),h.hideSpinner(t),E.detach(i.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 r=[];this.multiple||(this.clearData(!0),e=[e[this.actionCompleteCount=0]]);for(var l=0;l<e.length;l++){var o=i?e[l].file:e[l];this.updateInitialFileDetails(t,e,o,l,r,i,s)}if(a.filesData=r,!E.isNullOrUndefined(this.allowedExtensions)&&-1<this.allowedExtensions.indexOf("*")&&(this.allTypes=!0),this.enableHtmlSanitizer)for(l=0;l<r.length;l++){for(var h=E.SanitizeHtmlHelper.beforeSanitize(),h=E.SanitizeHtmlHelper.serializeValue(h,r[parseInt(l.toString(),10)].name),p=r[parseInt(l.toString(),10)].name,u=!1,d=0;d<p.length;d++)if(127<p.charCodeAt(d)){u=!0;break}var c=/<([a-z][a-z0-9]*)\b[^>]*>(.*?)<\/\1>/i.test(p);h===r[parseInt(l.toString(),10)].name||u&&!c||(h=e[parseInt(l.toString(),10)].name.replace(/[\u00A0-\u9999<>\\&]/g,function(t){return"&#"+t.charCodeAt(0)+";"}),r[parseInt(l.toString(),10)].name=h,r[parseInt(l.toString(),10)].status=this.localizedTexts("invalidFileName"),r[parseInt(l.toString(),10)].statusCode="0")}this.allTypes||(r=this.checkExtension(r)),this.trigger("selected",a,function(t){n._internalRenderSelect(t,r)})}},C.prototype.updateInitialFileDetails=function(t,e,i,s,n,a,r){a={name:a?e[s].path.substring(1,e[s].path.length):r?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)};r&&(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){E.isNullOrUndefined(this.listParent)||(E.detach(this.listParent),this.listParent=null),"msie"===this.browserName||t||(this.element.value=""),this.fileList=[],this.filesData=[],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))}this.removeActionButtons();var a=[].slice.call(e.childNodes);this.createParentUL();for(var r=0;r<t.length;r++){for(var l=0;l<this.filesData.length;l++)this.filesData[l].name===t[r].name&&(this.listParent.appendChild(a[l]),E.EventHandler.add(a[l].querySelector(".e-icons"),"click",this.removeFiles,this),this.fileList.push(a[l]),i=r);i!==r&&this.internalCreateFileList([t[r]])}}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 r=0;r<t.length;r++){var l=-1!==t[r].type.indexOf(".")?t[r].type.replace(".",""):t[r].type;-1!==i[0].indexOf("/*")?this.checkGenericExtension(i[0],l)||(t[r].status=this.localizedTexts("invalidFileType"),t[r].statusCode="0"):-1===i.indexOf(("."+l).toLocaleLowerCase())&&(t[r].status=this.localizedTexts("invalidFileType"),t[r].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:ts,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)),r={element:n,fileInfo:s,index:a,isPreload:this.isPreLoadFile(s)},a={element:n,fileInfo:s,index:a,isPreload:this.isPreLoadFile(s)};this.trigger("rendering",r),this.trigger("fileListRendering",a),this.listParent.appendChild(n),this.fileList.push(n)}this.renderReactTemplates()},C.prototype.createParentUL=function(){E.isNullOrUndefined(this.listParent)&&(this.listParent=this.createElement("ul",{className:Qi}),this.uploadWrapper.appendChild(this.listParent))},C.prototype.formFileList=function(t,e){for(var i,s=this.createElement("li",{className:ts}),n=(s.setAttribute("data-files-count",t.length+""),this.createElement("span",{className:us})),a=0,r=t;a<r.length;a++){var l=r[a],o=this.createElement("span",{className:es}),h=(o.innerHTML=this.getFileNameOnly(l.name),this.createElement("span",{className:is})),p=this.getFileType(l.name);h.innerHTML="."+p,p||h.classList.add("e-hidden"),this.enableRtl?((p=this.createElement("span",{className:ms})).appendChild(h),p.appendChild(o),n.appendChild(p)):(n.appendChild(o),n.appendChild(h)),this.truncateName(o),i=this.formValidateFileInfo(l,s)}s.appendChild(n),this.setListToFileInfo(t,s);var u=this.listParent.querySelectorAll("li").length,d=this.createElement("span"),d=(s.classList.contains(Cs)?(d.classList.add(c),d.classList.add(Cs),d.innerText=1<t.length?this.localizedTexts("invalidFileSelection"):i):(d.classList.add(1<t.length?"e-file-information":ss),d.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(d),E.isNullOrUndefined(s.querySelector(".e-icons"))&&(d=this.createElement("span",{className:"e-icons",attrs:{tabindex:this.btnTabIndex}}),"msie"===this.browserName&&d.classList.add("e-msie"),d.setAttribute("title",this.localizedTexts("remove")),s.appendChild(n),s.appendChild(d),E.EventHandler.add(d,"click",this.removeFiles,this),d.classList.add(m)),{element:s,fileInfo:this.mergeFileInfo(t,s),index:u,isPreload:this.isPreLoadFile(this.mergeFileInfo(t,s))}),u={element:s,fileInfo:this.mergeFileInfo(t,s),index:u,isPreload:this.isPreLoadFile(this.mergeFileInfo(t,s))};this.trigger("rendering",d),this.trigger("fileListRendering",u),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(Cs)},C.prototype.createFormInput=function(t){if("safari"!==this.browserName){var e=this.element.cloneNode(!0);e.classList.add("e-hidden-file-input");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("."+Ji).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,r=t;a<r.length;a++){var l=r[a];s.push(l.name),n=l.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],r=a.status,l=this.validatedFileSize(a.size),l=(""===l.minSize&&""===l.maxSize||(i=!1,r=""!==l.minSize?this.localizedTexts("invalidMinFileSize"):""!==l.maxSize?this.localizedTexts("invalidMaxFileSize"):r),this.checkExtension(this.getFilesInArray(a))[0].status);l===this.localizedTexts("invalidFileType")&&(i=!1,r=l)}return r=i?this.localizedTexts("totalFiles")+": "+t.length+" , "+this.localizedTexts("size")+": "+this.bytesToSize(this.getFileSize(t)):(e.classList.add(Cs),1<t.length?this.localizedTexts("invalidFileSelection"):r)},C.prototype.formCustomFileList=function(t,e){this.createParentUL();var i=this.createElement("li",{className:ts}),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(Cs)||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(bs),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:ts,attrs:{"data-file-name":s.name,"data-files-count":"1"}}),a=this.createElement("span",{className:us}),r=this.createElement("span",{className:es,attrs:{title:s.name}}),l=(r.innerHTML=this.getFileNameOnly(s.name),this.createElement("span",{className:is})),o=this.getFileType(s.name),o=(l.innerHTML="."+o,o||l.classList.add("e-hidden"),this.enableRtl?((o=this.createElement("span",{className:ms})).appendChild(l),o.appendChild(r),a.appendChild(o)):(a.appendChild(r),a.appendChild(l)),this.createElement("span",{className:ss})),l=(o.innerHTML=this.bytesToSize(s.size),a.appendChild(o),this.createElement("span",{className:c})),o=(a.appendChild(l),l.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?(l.classList.add(ps),o.classList.add(d),o.setAttribute("title",this.localizedTexts("delete")),o.setAttribute("aria-label",this.localizedTexts("delete"))):"1"!==s.statusCode&&(l.classList.remove(ps),l.classList.add(ds)),this.autoUpload&&"1"===s.statusCode&&""!==this.asyncSettings.saveUrl&&(l.innerHTML=""),o.classList.contains(d)||(o.classList.add(m),o.setAttribute("aria-label",this.localizedTexts("remove"))),t.indexOf(s)),l={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",l),this.trigger("fileListRendering",o),this.listParent.appendChild(n),this.fileList.push(n),this.truncateName(r),this.flag);this.isPreLoadFile(s)&&(this.flag=!1,this.checkActionComplete(!0),this.flag=a)}else this.isFormUpload()?(this.uploadWrapper.classList.add(bs),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(ps))&&(this.showFileList||"File uploaded successfully"===t[s].status)||i.push(t[s]);return 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)),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:ls}),i=this.createElement("progressbar",{className:os,attrs:{value:"0",max:"100"}}),s=this.createElement("span",{className:"e-progress-inner-wrap"}),n=(i.setAttribute("style","width: 0%"),this.createElement("span",{className:hs}));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("."+os))||!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("."+os).setAttribute("style","width:"+e),t.querySelector("."+hs).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("."+ls).length||!n.querySelector("."+c)||(n.querySelector("."+c).classList.add(f),this.createProgressBar(n),this.updateProgressBarClasses(n,f),n.querySelector("."+c).classList.remove(g)),this.updateProgressbar(t,n),i=n.querySelector("."+m),E.isNullOrUndefined(i)||(i.classList.add(v,f),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,r){var l=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(r)||(t=r.querySelector("."+v),E.isNullOrUndefined(t))||(h.hideSpinner(t),E.detach(r.querySelector(".e-spinner-pane")))):(a.emitError=!1,a.httpRequest.abort(),t=new FormData,"5"===n.statusCode&&(i=l.element.getAttribute("name"),t.append(i,n.name),t.append("cancel-uploading",n.name),l.updateFormData(t,e.customFormData),(s=new E.Ajax(l.asyncSettings.removeUrl,"POST",!0,null)).emitError=!1,s.beforeSend=function(t){e.currentRequest&&l.updateCustomheader(s.httpRequest,e.currentRequest)},s.onLoad=function(t){return l.removecanceledFile(t,n),{}},s.send(t)))})},C.prototype.removecanceledFile=function(t,e){var i,s=this.getLiElement(e);E.isNullOrUndefined(s)||s.querySelector("."+as)||E.isNullOrUndefined(s.querySelector("."+v))||(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("."+v));E.isNullOrUndefined(n)||(n.classList.remove(v,f),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("."+as).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("."+as))||E.detach(i.querySelector("."+as)),this.pauseButton=null),E.isNullOrUndefined(i)||i.classList.add(gs),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,ps),this.removeProgressbar(s,"success"),i=s.querySelector("."+v),E.isNullOrUndefined(i))||(i.classList.add(d),i.setAttribute("title",this.localizedTexts("delete")),i.setAttribute("aria-label",this.localizedTexts("delete")),i.classList.remove(v),i.classList.remove(f)),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("."+ns),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(gs)?i.getLiElement(e).classList.remove(gs):(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("."+os);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("."+ls))||(this.progressAnimation=new E.Animation({duration:1250}),this.progressAnimation.animate(t.querySelector("."+ls),{name:"FadeOut"}),this.progressAnimation.animate(t.querySelector("."+hs),{name:"FadeOut"}),setTimeout(function(){i.animateProgressBar(t,e)},750))},C.prototype.animateProgressBar=function(t,e){"success"===e?(t.classList.add(ps),E.isNullOrUndefined(t.querySelector("."+c))||(t.querySelector("."+c).classList.remove(f),this.progressAnimation.animate(t.querySelector("."+c),{name:"FadeIn"}),t.querySelector("."+c).classList.add(ps))):E.isNullOrUndefined(t.querySelector("."+c))||(t.querySelector("."+c).classList.remove(f),this.progressAnimation.animate(t.querySelector("."+c),{name:"FadeIn"}),t.querySelector("."+c).classList.add(g)),t.querySelector("."+ls)&&E.detach(t.querySelector("."+ls))},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(cs)&&this.uploadWrapper.classList.remove(cs),!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(cs),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,r=i.rawFile.slice(s.start,s.end),r=(a.append(this.uploaderName,r,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)),l=(a.append("total-chunk",r.toString()),a.append("totalChunk",r.toString()),new E.Ajax({url:this.asyncSettings.saveUrl,type:"POST",async:!0,contentType:null})),o=(l.emitError=!1,l.onLoad=function(t){return n.chunkUploadComplete(t,s,e),{}},l.onUploadProgress=function(t){return n.chunkUploadInProgress(t,s,e),{}},{fileData:i,customFormData:[],cancel:!1,chunkSize:0===this.asyncSettings.chunkSize?null:this.asyncSettings.chunkSize});l.beforeSend=function(e){o.currentRequest=l.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)})},l.onError=function(t){return n.chunkUploadFailed(t,s,e),{}},l.send(a),s.request=l},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())},C.prototype.checkChunkUpload=function(){return!(this.asyncSettings.chunkSize<=0||E.isNullOrUndefined(this.asyncSettings.chunkSize))},C.prototype.chunkUploadComplete=function(t,s,n){var a,e,i,r=this,l=t.target;4===l.readyState&&200<=l.status&&l.status<300?(i=t&&t.currentTarget?this.getResponse(t):null,e=Math.max(Math.ceil(s.file.size/this.asyncSettings.chunkSize),1),i={event:t,file:s.file,chunkIndex:s.chunkIndex,totalChunk:e,chunkSize:this.asyncSettings.chunkSize,response:i},this.trigger("chunkSuccess",i),!E.isNullOrUndefined(n)&&n||(a=this.getLiElement(s.file)),this.updateMetaData(s),s.end===s.file.size&&(s.file.statusCode="3"),"5"===s.file.statusCode?(i={event:t,fileData:s.file,cancel:!1,customFormData:[]},this.trigger("canceling",i,function(t){var e,i;t.cancel?(s.file.statusCode="3",e=a.querySelector("."+v),E.isNullOrUndefined(a)||E.isNullOrUndefined(e)||(h.hideSpinner(e),E.detach(a.querySelector(".e-spinner-pane"))),r.sendNextRequest(s)):(s.request.emitError=!1,l.abort(),e=new FormData,i=r.element.getAttribute("name"),e.append(i,s.file.name),e.append("cancel-uploading",s.file.name),e.append("cancelUploading",s.file.name),r.updateFormData(e,t.customFormData),(i=new E.Ajax(r.asyncSettings.removeUrl,"POST",!0,null)).emitError=!1,i.onLoad=function(t){return r.removeChunkFile(t,s,n),{}},i.send(e))})):e-1===s.chunkIndex&&e>s.chunkIndex?(0<=(i=this.pausedData.indexOf(s))&&this.pausedData.splice(i,1),E.isNullOrUndefined(this.template)&&(E.isNullOrUndefined(n)||!n)&&a&&(a&&!E.isNullOrUndefined(a.querySelector("."+y))&&E.detach(a.querySelector("."+y)),this.removeChunkProgressBar(s)),this.raiseSuccessEvent(t,s.file)):"4"!==s.file.statusCode&&this.sendNextRequest(s)):this.chunkUploadFailed(t,s)},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("."+v),this.updateStatus(e.file,this.localizedTexts("fileUploadCancel"),"5"),this.updateProgressBarClasses(i,g),this.removeProgressbar(i,"failure"),s&&(s.classList.remove(v),s.classList.add(m),s.setAttribute("title",this.localizedTexts("remove"))),(e=i.querySelector("."+y))&&(e.classList.add(as),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(fs),e.setAttribute("title",this.localizedTexts("resume")),e.nextElementSibling.classList.add(m),e.nextElementSibling.classList.remove(v),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("."+fs)),E.isNullOrUndefined(s)||!E.isNullOrUndefined(i)&&i||(s.classList.remove(fs),s.classList.add(y),s.setAttribute("title",this.localizedTexts("pause")),s.nextElementSibling.classList.remove(m),s.nextElementSibling.classList.add(v),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,ps),this.removeProgressbar(t,"success"),t=t.querySelector("."+v),E.isNullOrUndefined(t))||(t.classList.add(d),t.setAttribute("title",this.localizedTexts("delete")),t.classList.remove(v,f))},C.prototype.chunkUploadFailed=function(i,s,n){var a,r=this,t=Math.max(Math.ceil(s.file.size/this.asyncSettings.chunkSize),1),l=(!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:l};this.trigger("chunkFailure",t,function(t){var e;t.cancel||(s.retryCount<r.asyncSettings.retryCount?setTimeout(function(){r.retryRequest(a,s,n)},r.asyncSettings.retryAfterDelay):(E.isNullOrUndefined(a)||(t=a.querySelector("."+y)?a.querySelector("."+y):a.querySelector("."+fs),E.isNullOrUndefined(t)||(t.classList.add(as),t.classList.remove(y,fs)),r.updateProgressBarClasses(a,g),r.removeProgressbar(a,"failure"),a.querySelector(".e-icons").classList.remove(f),(t=a.querySelector("."+v)?a.querySelector("."+v):a.querySelector("."+m)).classList.remove(v),E.isNullOrUndefined(a.querySelector("."+y))||E.detach(a.querySelector("."+y)),0<s.start?(t.classList.add(d),t.setAttribute("title",r.localizedTexts("delete"))):(t.classList.add(m),t.setAttribute("title",r.localizedTexts("remove")))),s.retryCount=0,e=s.file,t=r.localizedTexts("uploadFailedMessage"),t={e:i,response:l,operation:"upload",file:r.updateStatus(e,t,"0",!1),statusText:t},r.trigger("failure",t,function(t){r.updateStatus(e,t.statusText,"0"),r.uploadSequential(),r.checkActionComplete(!0)})))})},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(fs)?this.resumeUpload(i,t):e.classList.contains(as)&&(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(gs)},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("."+as),E.isNullOrUndefined(n)||(n.classList.add(y),n.setAttribute("title",this.localizedTexts("pause")),n.classList.remove(as)),E.isNullOrUndefined(s)||(0<s.querySelectorAll("."+ls).length||(n=s.querySelector("."+c),E.isNullOrUndefined(this.template)&&(n.classList.add(f),n.classList.remove(g),this.createProgressBar(s),this.updateProgressBarClasses(s,f)),n=s.querySelector("."+m)?s.querySelector("."+m):s.querySelector("."+d),E.isNullOrUndefined(n))||(n.classList.add(v),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("."+d))&&(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("."+v)).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,r=i.sort();a<r.length;a++)for(var l=r[a],s=0;s<e.length;s++)l===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.uploadWrapper=null,this.uploadWrapper=null,this.browseButton=null,this.dropAreaWrapper=null,this.dropZoneElement=null,this.dropArea=null,this.keyboardModule=null,this.clearButton=null,this.uploadButton=null,Ls.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,r,l){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(r,r+l))}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(),r=new E.Ajax(this.asyncSettings.saveUrl,"POST",!0,null),l=(r.emitError=!1,{fileData:i[s],customFormData:[],cancel:!1}),o=new FormData;r.beforeSend=function(e){l.currentRequest=r.httpRequest,n.trigger("uploading",l,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):(r.onLoad=function(t){return l.cancel||n.uploadComplete(t,i[s],e),{}},r.onUploadProgress=function(t){return l.cancel||n.uploadInProgress(t,i[s],e,r),{}},r.onError=function(t){return n.uploadFailed(t,i[s]),{}},r.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(r,a,l,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=r,h.trigger("removing",p,function(t){if(!t.cancel)for(var e=!1,i=void 0,s=0,n=h.getFilesInArray(r);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=((r=E.isNullOrUndefined(r)?h.filesData:r)instanceof Array?t=r:t.push(r),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,l,a):l?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("."+v),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({},Ps)],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([{}],Es)],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 Ls,t=s([E.NotifyPropertyChanges],C);function C(t,e){e=Ls.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}As=function(t,e){return(As=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 As,Ns,s=function(t,e){function i(){this.constructor=t}As(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,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},Hs="e-apply",Bs="e-cancel",Us="e-current",Is="e-ctrl-btn",Rs="e-switch-ctrl-btn",Vs="e-disabled",Fs="e-value-switch-btn",Ms="e-handler",Ds="e-hide-hex-value",zs="e-hide-opacity",Ws="e-hide-switchable-value",qs="e-hide-value",js="e-hide-valueswitcher",_s="e-hsv-color",Xs="e-hsv-container",Ks="e-selected-value",Ys="e-mode-switch-btn",Zs="e-nocolor-item",Gs="e-opacity-value",Js="e-palette",$s="e-color-palette",Qs="e-color-picker",tn="e-preview-container",en="e-previous",sn="e-show-value",nn="e-selected",an="e-split-preview",rn="e-tile",ln=["#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=(Ns=E.Component,s(x,Ns),x.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"},this.locale),t.getAttribute("ejs-for")&&!t.getAttribute("name")&&t.setAttribute("name",t.id)},x.prototype.render=function(){this.initWrapper(),this.inline?this.createWidget():this.createSplitBtn(),this.enableOpacity||E.addClass([this.container.parentElement],zs),this.renderComplete()},x.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:"."+rn}),this.ctrlBtnRipple=E.rippleEffect(this.container,{selector:".e-btn"})},x.prototype.getWrapper=function(){return this.element.parentElement},x.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()},x.prototype.createSplitBtn=function(){var e=this,t=this.createElement("button",{className:"e-split-colorpicker"}),i=(this.getWrapper().appendChild(t),this.splitBtn=new R.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.splitBtn.appendTo(t),this.splitBtn.element.setAttribute("aria-label","colorpicker"),this.createElement("span",{className:an})),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()},x.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"))},x.prototype.getPopupInst=function(){return E.getInstance(this.getPopupEle(),h.Popup)},x.prototype.bindCallBackEvent=function(){var a=this;this.splitBtn.beforeOpen=function(s){var n=new R.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",document.body.insertBefore(a.modal,e),document.body.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 R.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}},x.prototype.onPopupClose=function(){this.unWireEvents(),this.destroyOtherComp(),this.container.style.width="",E.select("."+an,this.splitBtn.element).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value)),this.container.innerHTML="",E.removeClass([this.container],[Qs,$s]),E.Browser.isDevice&&this.modal&&(E.removeClass([document.body],"e-colorpicker-overflow"),this.modal.style.display="none",this.modal.outerHTML="",this.modal=null)},x.prototype.createPalette=function(){if(E.classList(this.container,[$s],[Qs]),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(ln,"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)},x.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)}},x.prototype.firstPaletteFocus=function(){E.select("."+nn,this.container.children[0])||E.selectAll("."+Js,this.container)[0].focus()},x.prototype.appendPalette=function(t,e,i){var s,n,a,r=this.createElement("div",{className:Js,attrs:{tabindex:"0",role:"grid"}});"recent-color"===e&&r.classList.add("e-recent-palette"),i?i.appendChild(r):this.appendElement(r);for(var l=0,o=t.length;l<o;l++)0!==l&&l%this.columns!=0||(s=this.createElement("div",{className:"e-row",attrs:{role:"row"}}),r.appendChild(s)),a=this.roundValue(t[l]).toLowerCase(),n=this.createElement("span",{className:rn,attrs:{role:"gridcell","aria-label":a,"aria-selected":"false"}}),this.trigger("beforeTileRender",{element:n,presetName:e,value:t[l]}),s.appendChild(n),this.value===a&&"recent-color"!==e&&(this.addTileSelection(n),r.focus()),n.style.backgroundColor=this.convertToRgbString(this.hexToRgb(a))},x.prototype.setNoColor=function(){var e=this.container.querySelector(".e-row").children[0];e.classList.add(Zs),this.value||(e.classList.add(nn),E.closest(e,"."+Js).focus()),["aria-selected","aria-label"].forEach(function(t){e.removeAttribute(t)}),e.style.backgroundColor=""},x.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)},x.prototype.addTileSelection=function(t){t&&(t.classList.add(nn),t.setAttribute("aria-selected","true"))},x.prototype.createPicker=function(){E.classList(this.container,[Qs],[$s]);var t=this.createElement("div",{className:Xs}),e=(this.appendElement(t),t.appendChild(this.createElement("div",{className:_s})),this.createElement("span",{className:Ms,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()},x.prototype.setHsvContainerBg=function(t){void 0===t&&(t=this.hsv[0]),this.getHsvContainer().style.backgroundColor=this.convertToRgbString(this.hsvToRgb(t,100,100,1))},x.prototype.getHsvContainer=function(){return E.select("."+Xs,this.container)},x.prototype.setHandlerPosition=function(){var t=this.getDragHandler(),e=E.select("."+_s,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)},x.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 qi({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))},x.prototype.createOpacitySlider=function(t){this.opacitySlider=new qi({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()},x.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%)")},x.prototype.hueChange=function(t){this.hsv[0]=t.value,this.setHsvContainerBg(),this.convertToOtherFormat()},x.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)},x.prototype.updateOpacityInput=function(t){var e;this.enableOpacity&&!this.getWrapper().classList.contains(qs)&&((e=E.getInstance(E.select("."+Gs,this.container),Bt)).value=t,e.dataBind())},x.prototype.createPreview=function(t){var e=this.createElement("div",{className:tn}),t=(t.appendChild(e),this.createElement("span",{className:"e-preview "+Us})),i=(e.appendChild(t),this.convertToRgbString(this.rgb));t.style.backgroundColor=i,t=this.createElement("span",{className:"e-preview "+en}),e.appendChild(t),t.style.backgroundColor=i},x.prototype.isPicker=function(){return!this.container.classList.contains($s)},x.prototype.getPopupEle=function(){return this.container.parentElement},x.prototype.createNumericInput=function(t,e,i,s){var n=this,e=new Bt({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)},x.prototype.createInput=function(){var t=this.isPicker(),e=this.getWrapper();if(t&&!e.classList.contains(qs)||!t&&e.classList.contains(sn)){var i=this.createElement("div",{className:Ks}),s=(t?this.appendElement(i,2):this.appendElement(i,1),this.createElement("div",{className:"e-input-container"}));if(i.appendChild(s),e.classList.contains(js)||this.appendValueSwitchBtn(i),e.classList.contains(Ds)||(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(Ws)){for(var n=void 0,a=void 0,a=this.isRgb?(n="RGB",this.rgb):(n="HSV",this.hsv),r=["rh","gs","bv"],l=0;l<3;l++)this.createNumericInput(s.appendChild(this.createElement("input",{className:"e-"+r[l]+"-value"})),a[l],n[l],255);this.enableOpacity&&this.appendOpacityValue(s)}}},x.prototype.appendOpacityValue=function(t){this.createNumericInput(t.appendChild(this.createElement("input",{className:Gs})),100*this.rgb[3],"A",100)},x.prototype.appendValueSwitchBtn=function(t){var e=this.createElement("button",{className:"e-icons e-css e-btn e-flat e-icon-btn "+Fs,attrs:{title:"Toggle format"}});t.appendChild(e),this.isPicker()&&!this.getWrapper().classList.contains(Ws)&&e.addEventListener("click",this.formatSwitchHandler.bind(this))},x.prototype.createCtrlBtn=function(){var t,e;(this.modeSwitcher||this.showButtons)&&(this.l10n.setLocale(this.locale),e=this.createElement("div",{className:Rs}),this.container.appendChild(e),this.showButtons&&(t=this.createElement("div",{className:Is}),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 "+Hs,attrs:{title:e}})),e=this.l10n.getConstant("Cancel"),t.appendChild(this.createElement("button",{innerHTML:e,className:"e-btn e-css e-flat e-small "+Bs,attrs:{title:e}}))),this.modeSwitcher)&&this.appendModeSwitchBtn()},x.prototype.appendModeSwitchBtn=function(){var t=this.createElement("button",{className:"e-icons e-btn e-flat e-icon-btn "+Ys,attrs:{title:this.l10n.getConstant("ModeSwitcher")}});E.select("."+Rs,this.container).insertBefore(t,E.select("."+Is,this.container))},x.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"}))},x.prototype.getTooltipInst=function(){return E.getInstance(this.container,h.Tooltip)},x.prototype.setTooltipOffset=function(t){this.getTooltipInst().offsetY=t},x.prototype.toggleDisabled=function(e){e?this.getWrapper().classList.add(Vs):this.getWrapper().classList.remove(Vs),this.showButtons&&[].slice.call(E.selectAll(".e-btn",this.container)).forEach(function(t){e?E.attributes(t,{disabled:""}):t.removeAttribute("disabled")})},x.prototype.convertToRgbString=function(t){return t.length?4===t.length?"rgba("+t.join()+")":"rgb("+t.join()+")":""},x.prototype.convertToHsvString=function(t){return 4===t.length?"hsva("+t.join()+")":"hsv("+t.join()+")"},x.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()},x.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)},x.prototype.updateInput=function(t){var e=this.getWrapper();e.classList.contains(qs)||(e.classList.contains(Ds)||o.Input.setValue(t.substr(0,7),E.select(".e-hex",this.container)),e.classList.contains(Ws))||(this.isRgb?this.updateValue(this.rgb,!1):this.updateValue(this.hsv,!1))},x.prototype.updatePreview=function(t){this.enableOpacity&&this.updateOpacitySliderBg(),E.select(".e-tip-transparent",this.tooltipEle).style.backgroundColor=t,E.select("."+tn+" ."+Us,this.container).style.backgroundColor=t,E.select("."+tn+" ."+en,this.container).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value))},x.prototype.getDragHandler=function(){return E.select("."+Ms,this.container)},x.prototype.removeTileSelection=function(){[].slice.call(E.selectAll("."+nn,this.container)).forEach(function(t){t.classList.remove(nn),t.setAttribute("aria-selected","false")})},x.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)})},x.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")},x.prototype.toggle=function(){this.container.parentElement.classList.contains("e-popup-close")?this.splitBtn.toggle():this.closePopup(null)},x.prototype.getModuleName=function(){return"colorpicker"},x.prototype.getPersistData=function(){return this.addOnPersist(["value"])},x.prototype.wireEvents=function(){var t;this.isPicker()?(t=this.getDragHandler(),E.EventHandler.add(t,"keydown",this.pickerKeyDown,this),(t=E.select("."+Is,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("."+en,this.container),"click",this.previewHandler,this)):(E.EventHandler.add(this.container,"click",this.paletteClickHandler,this),E.EventHandler.add(this.container,"keydown",this.paletteKeyDown,this))},x.prototype.formResetHandler=function(){this.value=this.initialInputValue,E.attributes(this.element,{value:this.initialInputValue})},x.prototype.addCtrlSwitchEvent=function(){var t=E.select("."+Rs,this.container);t&&E.EventHandler.add(t,"click",this.btnClickHandler,this)},x.prototype.ctrlBtnKeyDown=function(t){13===t.keyCode&&(E.select("."+Hs,this.container)&&(t=this.rgbToHex(this.rgb),this.triggerChangeEvent(t)),this.splitBtn.element.focus())},x.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)}},x.prototype.enterKeyHandler=function(t){this.triggerChangeEvent(t),this.inline||this.splitBtn.element.focus()},x.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())})},x.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"},x.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)},x.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)},x.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("."+_s,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"))},x.prototype.setHsv=function(t,e){var i=E.select("."+_s,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},x.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("."+_s,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)},x.prototype.btnClickHandler=function(t){var e=t.target;E.closest(e,"."+Ys)?(t.stopPropagation(),this.switchToPalette()):(e.classList.contains(Hs)||e.classList.contains(Bs))&&this.ctrlBtnClick(e,t)},x.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(qs)||E.remove(E.select("."+Ks,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"})},x.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)},x.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))},x.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)},x.prototype.updateValue=function(t,e,i,s){for(var n,a=["e-rh-value","e-gs-value","e-bv-value"],r=0,l=a.length;r<l;r++)(n=E.getInstance(E.select("."+a[r],this.container),Bt)).value=Math.round(t[r]),e&&(n.placeholder=a[r].substr(i,1).toUpperCase(),n.max=s?s[r]:255),n.dataBind()},x.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("."+tn+" ."+Us,this.container).style.backgroundColor=this.convertToRgbString(this.rgb),this.triggerEvent(e,i,this.convertToRgbString(this.rgb),!1,t)},x.prototype.paletteClickHandler=function(t){t.preventDefault();var e,i,s=t.target;s.classList.contains(rn)?(this.removeTileSelection(),this.addTileSelection(s),s.classList.contains(Zs)?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(sn)&&this.updateInput(e),this.triggerEvent(e,i,this.convertToRgbString(this.rgb),!1,t)),this.inline||this.showButtons||this.closePopup(t)):E.closest(s,"."+Ys)?this.switchToPicker():s.classList.contains(Hs)||s.classList.contains(Bs)?this.ctrlBtnClick(s,t):this.getWrapper().classList.contains(sn)&&E.closest(s,"."+Fs)&&this.formatSwitchHandler()},x.prototype.noColorTile=function(t){void 0===t&&(t=!1);var e=this.rgbToHex(this.rgb);this.rgb=[],this.hsv=[],this.triggerEvent("",e,"",t)},x.prototype.switchToPicker=function(){var t=this.getWrapper(),t=(this.trigger("beforeModeSwitch",{element:this.container,mode:"Picker"}),this.unWireEvents(),[].slice.call(E.selectAll("."+Js,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(sn)&&E.detach(E.select("."+Ks,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"})},x.prototype.ctrlBtnClick=function(t,e){var i;t.classList.contains(Hs)&&(i=this.rgbToHex(this.rgb),this.triggerChangeEvent(i,e)),this.inline?t.classList.contains(Bs)&&(i={element:this.container,event:e,cancel:!1},this.trigger("beforeClose",i)):(this.closePopup(e),this.splitBtn.element.focus())},x.prototype.paletteKeyDown=function(t){var e=t.target;if(e.classList.contains(Js)){var i,s,n=[].slice.call(E.selectAll("."+rn,e)),a=n.filter(function(t){return t.classList.contains("e-selected")}).pop();switch(!t.altKey&&t.keyCode){case 39:t.preventDefault(),i=a?n[this.tilePosition(n,a,this.enableRtl?-1:1)]:n[this.enableRtl?n.length-1:0],this.keySelectionChanges(i);break;case 37:t.preventDefault(),i=a?n[this.tilePosition(n,a,this.enableRtl?1:-1)]:n[this.enableRtl?0:n.length-1],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||""))}}},x.prototype.keySelectionChanges=function(t){var e;this.removeTileSelection(),this.addTileSelection(t),t.classList.contains(Zs)?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(sn)&&this.updateInput(t),this.triggerEvent(t,e,this.convertToRgbString(this.rgb),!0))},x.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},x.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)}},x.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)},x.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")},x.prototype.destroy=function(){var e=this,t=this.getWrapper();Ns.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()),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)},x.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],Bt).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}},x.prototype.isPopupOpen=function(){return this.getPopupEle().classList.contains("e-popup-open")},x.prototype.unWireEvents=function(){var t;this.isPicker()?(t=this.getDragHandler(),E.EventHandler.remove(t,"keydown",this.pickerKeyDown),(t=E.select("."+Is,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("."+Rs,this.container),"click",this.btnClickHandler),E.EventHandler.remove(E.select("."+en,this.container),"click",this.previewHandler)):(E.EventHandler.remove(this.container,"click",this.paletteClickHandler),E.EventHandler.remove(this.container,"keydown",this.paletteKeyDown))},x.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},x.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},x.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),r=Math.min(t,e,i),l=a,o=a-r,h=0===a?0:o/a;if(a===r)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}r=[Math.round(360*n),Math.round(1e3*h)/10,Math.round(1e3*l)/10];return E.isNullOrUndefined(s)||r.push(s),r},x.prototype.hsvToRgb=function(t,e,i,s){var n,a,r;if(i/=100,0===(e/=100))return n=a=r=i,[Math.round(255*n),Math.round(255*a),Math.round(255*r),s];t/=60;var l=Math.floor(t),t=t-l,o=i*(1-e),h=i*(1-e*t),p=i*(1-e*(1-t));switch(l){case 0:n=i,a=p,r=o;break;case 1:n=h,a=i,r=o;break;case 2:n=o,a=i,r=p;break;case 3:n=o,a=h,r=i;break;case 4:n=p,a=o,r=i;break;default:n=i,a=o,r=h}e=[Math.round(255*n),Math.round(255*a),Math.round(255*r)];return E.isNullOrUndefined(s)||e.push(s),e},x.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"):""},x.prototype.hex=function(t){return("0"+t.toString(16)).slice(-2)},x.prototype.changeModeSwitcherProp=function(t){var e=E.select("."+Rs,this.container);t?e?this.appendModeSwitchBtn():(this.createCtrlBtn(),this.isPicker()&&!this.disabled&&this.addCtrlSwitchEvent()):e&&(this.showButtons?E.detach(E.select("."+Ys,e)):E.remove(e))},x.prototype.changeShowBtnProps=function(t){var e=E.select("."+Rs,this.container);t?(e&&E.remove(e),this.createCtrlBtn(),this.isPicker()&&!this.disabled&&this.addCtrlSwitchEvent()):this.modeSwitcher?E.detach(E.select("."+Is,e)):E.remove(e)},x.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))},x.prototype.setInputEleProps=function(){E.remove(E.select("."+Ks,this.container)),this.createInput()},x.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())},x.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(" "))},x.prototype.changeRtlProps=function(t){t?E.addClass([this.getWrapper()],"e-rtl"):E.removeClass([this.getWrapper()],"e-rtl")},x.prototype.changePaletteProps=function(){E.detach(this.container.children[0]),this.container.style.width="",this.createPalette()},x.prototype.changeOpacityProps=function(t){var e=this.getWrapper();t?(E.removeClass([this.container.parentElement],zs),this.createOpacitySlider(E.select(".e-colorpicker-slider",this.container).appendChild(this.createElement("div",{className:"e-opacity-slider"}))),e.classList.contains(qs)||e.classList.contains(Ws)||this.appendOpacityValue(E.select(".e-input-container",this.container))):(E.addClass([this.container.parentElement],zs),this.opacitySlider.destroy(),E.remove(this.opacitySlider.element),this.opacitySlider=null,e.classList.contains(qs)||e.classList.contains(Ws)||E.remove(E.select("."+Gs,this.container).parentElement))},x.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("."+an,this.splitBtn.element))&&(e.style.backgroundColor=this.convertToRgbString(this.hexToRgb(s.value)))):this.noColor&&"Palette"===this.mode&&""===this.value?(e=this.splitBtn&&E.select("."+an,this.splitBtn.element)).style.backgroundColor="":this.value=n.value),!this.inline&&E.isNullOrUndefined(s.inline))if(this.splitBtn.setProperties(R.getModel(s,["disabled","enableRtl"])),!this.isPopupOpen())return this.changeCssClassProps(s.cssClass,n.cssClass),void this.changeRtlProps(s.enableRtl);for(var r=this,i=0,l=Object.keys(s);i<l.length;i++)!function(t){switch(t){case"inline":s.inline?(r.getWrapper().appendChild(r.container),r.splitBtn.destroy(),E.detach(r.element.nextElementSibling),r.container.children.length||r.createWidget()):(r.destroyOtherComp(),r.unWireEvents(),r.container.innerHTML="",r.createSplitBtn());break;case"cssClass":r.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!==qs&&t!==js&&t!==sn&&t!==Ds&&t!==Ws||(E.select("."+Ks,a.container)&&E.remove(E.select("."+Ks,a.container)),a.createInput(),i++)});break;case"enableRtl":r.isPicker()&&(r.hueSlider.enableRtl=s.enableRtl,r.enableOpacity&&(r.opacitySlider.enableRtl=s.enableRtl),r.setInputEleProps()),r.changeRtlProps(s.enableRtl);break;case"disabled":r.changeDisabledProp(s.disabled);break;case"value":r.value!==n.value&&r.changeValueProp(s.value);break;case"showButtons":r.changeShowBtnProps(s.showButtons);break;case"mode":"Picker"===s.mode?r.switchToPicker():r.switchToPalette();break;case"modeSwitcher":r.changeModeSwitcherProp(s.modeSwitcher);break;case"columns":case"presetColors":r.isPicker()||r.changePaletteProps();break;case"noColor":s.noColor?"Palette"!==r.mode||r.modeSwitcher||r.setNoColor():r.changePaletteProps();break;case"enableOpacity":r.changeOpacityProps(s.enableOpacity);break;case"showRecentColors":s.showRecentColors||(e=r.container.querySelector(".e-clr-pal-rec-wpr"))&&E.detach(e),r.recentColors=[]}}(l[i])},x.prototype.focusIn=function(){this.element.parentElement.focus()},S([E.Property("#008000ff")],x.prototype,"value",void 0),S([E.Property("")],x.prototype,"cssClass",void 0),S([E.Property(!1)],x.prototype,"disabled",void 0),S([E.Property("Picker")],x.prototype,"mode",void 0),S([E.Property(!0)],x.prototype,"modeSwitcher",void 0),S([E.Property(null)],x.prototype,"presetColors",void 0),S([E.Property(!0)],x.prototype,"showButtons",void 0),S([E.Property(10)],x.prototype,"columns",void 0),S([E.Property(!1)],x.prototype,"inline",void 0),S([E.Property(!1)],x.prototype,"noColor",void 0),S([E.Property(!1)],x.prototype,"enablePersistence",void 0),S([E.Property(!0)],x.prototype,"enableOpacity",void 0),S([E.Property(!1)],x.prototype,"createPopupOnClick",void 0),S([E.Property(!1)],x.prototype,"showRecentColors",void 0),S([E.Event()],x.prototype,"select",void 0),S([E.Event()],x.prototype,"change",void 0),S([E.Event()],x.prototype,"beforeTileRender",void 0),S([E.Event()],x.prototype,"beforeOpen",void 0),S([E.Event()],x.prototype,"open",void 0),S([E.Event()],x.prototype,"beforeClose",void 0),S([E.Event()],x.prototype,"beforeModeSwitch",void 0),S([E.Event()],x.prototype,"onModeSwitch",void 0),S([E.Event()],x.prototype,"created",void 0),S([E.NotifyPropertyChanges],x));function x(t,e){t=Ns.call(this,t,e)||this;return t.recentColors=[],t}on=function(t,e){return(on=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 on,hn,S=function(t,e){function i(){this.constructor=t}on(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},P=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},S=(hn=E.Component,S(T,hn),T.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"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]);break;case"placeholder":o.Input.setPlaceholder(this.placeholder,this.respectiveElement),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),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),o.Input.setPlaceholder(this.placeholder,this.respectiveElement)}},T.prototype.getModuleName=function(){return"textbox"},T.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")),"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)&&M.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--)}}},T.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)}}},T.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.renderComplete()},T.prototype.updateHTMLAttributesToWrapper=function(){o.Input.updateHTMLAttributesToWrapper(this.htmlAttributes,this.textboxWrapper.container)},T.prototype.updateHTMLAttributesToElement=function(){o.Input.updateHTMLAttributesToElement(this.htmlAttributes,this.respectiveElement||(this.multiline&&!E.isNullOrUndefined(this.textarea)?this.textarea:this.element))},T.prototype.setInitialValue=function(){this.isAngular||this.respectiveElement.setAttribute("value",this.initialValue)},T.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)},T.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"))},T.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},T.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")))},T.prototype.focusHandler=function(t){t={container:this.textboxWrapper.container,event:t,value:this.value};this.trigger("focus",t)},T.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)},T.prototype.keydownHandler=function(t){13!==t.keyCode&&9!==t.keyCode||!(null!==this.previousValue&&""!==this.previousValue||null!==this.value&&""!==this.value||""!==this.respectiveElement.value)||this.setProperties({value:this.respectiveElement.value},!0)},T.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()},T.prototype.changeHandler=function(t){this.setProperties({value:this.respectiveElement.value},!0),this.previousValue!==this.value&&this.raiseChangeEvent(t,!0),t.stopPropagation()},T.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)},T.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))},T.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)))},T.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)},T.prototype.destroy=function(){this.unWireEvents(),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),hn.prototype.destroy.call(this)},T.prototype.addIcon=function(t,e){o.Input.addIcon(t,e,this.textboxWrapper.container,this.respectiveElement,this.createElement)},T.prototype.getPersistData=function(){return this.addOnPersist(["value"])},T.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]))}},T.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)}},T.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],[D])},T.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],[D])},P([E.Property("text")],T.prototype,"type",void 0),P([E.Property(!1)],T.prototype,"readonly",void 0),P([E.Property(null)],T.prototype,"value",void 0),P([E.Property("Never")],T.prototype,"floatLabelType",void 0),P([E.Property("")],T.prototype,"cssClass",void 0),P([E.Property(null)],T.prototype,"placeholder",void 0),P([E.Property("on")],T.prototype,"autocomplete",void 0),P([E.Property({})],T.prototype,"htmlAttributes",void 0),P([E.Property(!1)],T.prototype,"multiline",void 0),P([E.Property(!0)],T.prototype,"enabled",void 0),P([E.Property(!1)],T.prototype,"showClearButton",void 0),P([E.Property(!1)],T.prototype,"enablePersistence",void 0),P([E.Property(null)],T.prototype,"width",void 0),P([E.Event()],T.prototype,"created",void 0),P([E.Event()],T.prototype,"destroyed",void 0),P([E.Event()],T.prototype,"change",void 0),P([E.Event()],T.prototype,"blur",void 0),P([E.Event()],T.prototype,"focus",void 0),P([E.Event()],T.prototype,"input",void 0),P([E.NotifyPropertyChanges],T));function T(t,e){e=hn.call(this,t,e)||this;return e.previousValue=null,e.isHiddenInput=!1,e.isForm=!1,e.inputPreviousValue=null,e.textboxOptions=t,e}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,un,P=function(t,e){function i(){this.constructor=t}pn(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,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},dn="e-auto-width",cn="e-resize-x",mn="e-resize-y",vn="e-resize-xy",fn="e-resize-none",P=(un=E.Component,P(k,un),k.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(fn));break;case"width":"None"!==this.resizeMode&&"Vertical"!==this.resizeMode?(this.setElementWidth(t.width),this.textareaWrapper.container.classList.add(dn)):(this.textareaWrapper.container.classList.contains(dn)&&this.textareaWrapper.container.classList.remove(dn),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]);break;case"placeholder":o.Input.setPlaceholder(this.placeholder,this.element),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(dn);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())}},k.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")},k.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)||o.Input.setValue(this.value,this.element,this.floatLabelType,this.showClearButton),E.isNullOrUndefined(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.renderComplete()},k.prototype.getModuleName=function(){return"textarea"},k.prototype.getPersistData=function(){return this.addOnPersist(["value"])},k.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)}}},k.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()},k.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)},k.prototype.destroy=function(){this.unWireEvents(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),this.element.value=this.element.defaultValue,this.element.classList.remove("e-input",cn,mn,vn,fn),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,un.prototype.destroy.call(this)},k.prototype.focusHandler=function(t){t={container:this.textareaWrapper.container,event:t,value:this.value};this.trigger("focus",t)},k.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.trigger("blur",t)},k.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)},k.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()},k.prototype.changeHandler=function(t){this.setProperties({value:this.element.value},!0),this.previousValue!==this.value&&this.raiseChangeEvent(t,!0),t.stopPropagation()},k.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},k.prototype.updateHTMLAttributesToWrapper=function(){o.Input.updateHTMLAttributesToWrapper(this.htmlAttributes,this.textareaWrapper.container)},k.prototype.updateHTMLAttributesToElement=function(){o.Input.updateHTMLAttributesToElement(this.htmlAttributes,this.element)},k.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))},k.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))},k.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])}},k.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)}},k.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],[D])},k.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],[D])},k.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(dn),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(dn)&&this.textareaWrapper.container.classList.remove(dn)},k.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))},k.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")))},k.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},k.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))},O([E.Property(!(k.prototype.getCurrentResizeClass=function(t){return"None"===t?fn:"Both"===t?vn:"Horizontal"===t?cn:mn}))],k.prototype,"readonly",void 0),O([E.Property(null)],k.prototype,"value",void 0),O([E.Property("Never")],k.prototype,"floatLabelType",void 0),O([E.Property("")],k.prototype,"cssClass",void 0),O([E.Property(null)],k.prototype,"placeholder",void 0),O([E.Property({})],k.prototype,"htmlAttributes",void 0),O([E.Property(!0)],k.prototype,"enabled",void 0),O([E.Property(!1)],k.prototype,"showClearButton",void 0),O([E.Property(!1)],k.prototype,"enablePersistence",void 0),O([E.Property(null)],k.prototype,"width",void 0),O([E.Property("Both")],k.prototype,"resizeMode",void 0),O([E.Property(null)],k.prototype,"maxLength",void 0),O([E.Property(null)],k.prototype,"cols",void 0),O([E.Property(null)],k.prototype,"rows",void 0),O([E.Event()],k.prototype,"created",void 0),O([E.Event()],k.prototype,"destroyed",void 0),O([E.Event()],k.prototype,"change",void 0),O([E.Event()],k.prototype,"blur",void 0),O([E.Event()],k.prototype,"focus",void 0),O([E.Event()],k.prototype,"input",void 0),O([E.NotifyPropertyChanges],k));function k(t,e){e=un.call(this,t,e)||this;return e.previousValue=null,e.isForm=!1,e.inputPreviousValue=null,e.textareaOptions=t,e}yn.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},yn.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},yn.escapeHtml=function(t){return t.replace(/<|>|`|"|&/g,"?").replace(/\r\n|\r|\n/g,"<br/>")},yn.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},yn.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)},yn.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}},yn.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)},yn.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 gn=yn;function yn(){}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,Cn,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)},En=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},Sn=function(a,r,l,o){return new(l=l||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 l(function(t){t(e.value)}).then(i,s)}n((o=o.apply(a,r||[])).next())})},xn=function(s,n){var a,r,l,o={label:0,sent:function(){if(1&l[0])throw l[1];return l[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,r&&(l=2&e[0]?r.return:e[0]?r.throw||((l=r.return)&&l.call(r),0):r.next)&&!(l=l.call(r,e[1])).done)return l;switch(r=0,(e=l?[2&e[0],l.value]:e)[0]){case 0:case 1:l=e;break;case 4:return o.label++,{value:e[1],done:!1};case 5:o.label++,r=e[1],e=[0];continue;case 7:e=o.ops.pop(),o.trys.pop();continue;default:if(!(l=0<(l=o.trys).length&&l[l.length-1])&&(6===e[0]||2===e[0])){o=0;continue}if(3===e[0]&&(!l||e[1]>l[0]&&e[1]<l[3]))o.label=e[1];else if(6===e[0]&&o.label<l[1])o.label=l[1],l=e;else{if(!(l&&o.label<l[2])){l[2]&&o.ops.pop(),o.trys.pop();continue}o.label=l[2],o.ops.push(e)}}e=n.call(s,o)}catch(t){e=[6,t],r=0}finally{a=l=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}},Pn=((Pn=o.ChatMessageRole||(o.ChatMessageRole={})).System="system",Pn.User="user",Pn.Assistant="assistant",O(w,Cn=P),w.prototype.render=function(){var t,e;Cn.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)?Tn:kn)(t,this.textArea))},w.prototype.wireEvents=function(){var t=this;Cn.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})},w.prototype.unWireEvents=function(){var t=this;Cn.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()})},w.prototype.keydownHandler=function(){},w.prototype.shouldShowInlineSuggestions=function(t){t=t.getAttribute("data-inline-suggestions");return t?"true"===t.toLowerCase():!("ontouchstart"in window)},w.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)?(gn.insertCharacter(this.textArea,t.key),t.preventDefault(),this.suggestionDisplay.show(this.suggestionDisplay.currentSuggestion.substring(t.key.length)),gn.adjustScrollToCaretPosition(this.textArea)):this.removeExistingOrPendingSuggestion()}},w.prototype.handleKeyUp=function(){var t=this;this.suggestionDisplay.isShowing()||(clearTimeout(this.typingDebounceTimeout),this.typingDebounceTimeout=setTimeout(function(){return t.handleTypingPaused()},350))},w.prototype.handleTypingPaused=function(){return Sn(this,void 0,void 0,function(){return xn(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]}})})},w.prototype.removeExistingOrPendingSuggestion=function(){clearTimeout(this.typingDebounceTimeout),this.pendingSuggestionAbort&&(this.pendingSuggestionAbort.abort(),this.pendingSuggestionAbort=null),this.suggestionDisplay.reject()},w.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}},w.prototype.requestSuggestionAsync=function(){return Sn(this,void 0,void 0,function(){var e,i,s,n;return xn(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:return s&&e.textAreaValue===this.textArea.value&&e.cursorPosition===this.textArea.selectionStart&&(s.endsWith(" ")||(s+=" "),this.suggestionDisplay.show(s)),[2]}})})},w.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)},w.prototype.indexOfAny=function(t,e){for(var i=0;i<t.length;i++)if(-1!==e.indexOf(t[""+i]))return i;return-1},w.prototype.getModuleName=function(){return"smarttextarea"},w.prototype.destroy=function(){Cn.prototype.destroy.call(this),this.textArea=null,this.suggestionDisplay=null,this.typingDebounceTimeout=null},En([E.Property("")],w.prototype,"userRole",void 0),En([E.Property([])],w.prototype,"UserPhrases",void 0),En([E.Property()],w.prototype,"aiSuggestionHandler",void 0),En([E.Property("None")],w.prototype,"showSuggestionOnPopup",void 0),w);function w(t,e){return Cn.call(this,t,e)||this}Object.defineProperty(On.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}),On.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(On.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}),On.prototype.isShowing=function(){return null!==this.suggestionStartPos},On.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 Ln(this.owner,this.textArea)),this.virtualCaret.show()},Object.defineProperty(On.prototype,"currentSuggestion",{get:function(){return this.latestSuggestionText},enumerable:!0,configurable:!0}),On.prototype.accept=function(){this.textArea.setSelectionRange(this.suggestionEndPos,this.suggestionEndPos),this.suggestionStartPos=null,this.suggestionEndPos=null,this.virtualCaret&&this.virtualCaret.hide(),this.textArea.removeAttribute("data-suggestion-visible"),gn.adjustScrollToCaretPosition(this.textArea)},On.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 Tn=On;function On(t,e){this.owner=t,this.textArea=e,this.latestSuggestionText="",this.suggestionStartPos=null,this.suggestionEndPos=null,this.virtualCaret=null,this.originalValueProperty=this.getOriginalValueProperty(e,"value")}Object.defineProperty(wn.prototype,"currentSuggestion",{get:function(){return this.latestSuggestionText},enumerable:!0,configurable:!0}),wn.prototype.show=function(t){this.latestSuggestionText=t,this.suggestionPrefixElement.textContent=" "!==t[0]?this.getPrefixText(this.textArea,20):"",this.suggestionTextElement.textContent=t;var t=gn.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)")},wn.prototype.accept=function(){this.showing&&(gn.insertCharacter(this.textArea,this.currentSuggestion),gn.adjustScrollToCaretPosition(this.textArea),this.hide())},wn.prototype.reject=function(){this.hide()},wn.prototype.hide=function(){this.showing&&(this.showing=!1,this.suggestionElement.classList.remove("smart-textarea-suggestion-overlay-visible"))},wn.prototype.isShowing=function(){return this.showing},wn.prototype.handleSuggestionClicked=function(t){t.preventDefault(),t.stopImmediatePropagation(),this.accept()},wn.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=wn;function wn(t,e){var i=this,e=(this.latestSuggestionText="",this.showing=!1,this.textArea=e,this.suggestionElement=document.createElement("div"),this.suggestionElement.classList.add("smart-textarea-suggestion-overlay"),this.suggestionElement.addEventListener("mousedown",function(t){return i.handleSuggestionClicked(t)}),this.suggestionElement.addEventListener("touchend",function(t){return i.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=e.font,this.suggestionElement.style.marginTop=1.4*parseFloat(e.fontSize)+"px",t.appendChild(this.suggestionElement)}An.prototype.show=function(){var t=gn.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},An.prototype.hide=function(){this.caretDiv.style.display="none"};var Ln=An;function An(t,e){this.textArea=e,this.caretDiv=document.createElement("div"),this.caretDiv.classList.add("smart-textarea-caret"),t.appendChild(this.caretDiv)}Nn=function(t,e){return(Nn=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 Nn,Hn,O=function(t,e){function i(){this.constructor=t}Nn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},En=(Hn=E.Component,O(L,Hn),L.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)},L.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),window.addEventListener("resize",this.resizeHandler.bind(this)))},L.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)),window.removeEventListener("resize",this.resizeHandler))},L.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)},L.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())},L.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))},L.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=[]},L.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()}},L.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)})},L.prototype.beginStroke=function(t){this.internalRefresh(),this.updateStroke(t)},L.prototype.updateStroke=function(t){t=this.createPoint(t);this.addPoint(t)},L.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))},L.prototype.delay=function(){this.previous=Date.now(),this.timeout=null,this.updateStroke(this.storedArgs),this.timeout||(this.storedArgs=null)},L.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())},L.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}},L.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()))},L.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},L.prototype.endDraw=function(){var t,e;E.isNullOrUndefined(this.pointColl)||(t=2<this.pointColl.length,e=this.pointColl[0],!t&&e&&this.strokeDraw(e))},L.prototype.curveDraw=function(t,e){var i,s,n,a,r,l,o,h,p=this.canvasContext,u=e-t,e=this.bezierLengthCalc(),d=2*Math.ceil(e);for(p.beginPath(),i=0;i<d;i++)o=(h=(l=(r=1-(s=i/d))*r)*r)*this.startPoint.x,o=(o=(o+=3*l*s*this.controlPoint1.x)+3*r*(n=s*s)*this.controlPoint2.x)+(a=n*s)*this.endPoint.x,h=h*this.startPoint.y,h=(h=(h+=3*l*s*this.controlPoint1.y)+3*r*n*this.controlPoint2.y)+a*this.endPoint.y,l=Math.min(t+a*u,this.maxStrokeWidth),this.arcDraw(o,h,l);p.closePath(),p.fill(),this.isSignatureEmpty=!1},L.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},L.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)},L.prototype.calculateCurveControlPoints=function(t,e,i){var s=t.x-e.x,n=t.y-e.y,a=e.x-i.x,r=e.y-i.y,l=(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+r*r),a=n/(s+n),r=o+(l-o)*a,s=i+(t-i)*a,n=e.x-r,a=e.y-s;return{controlPoint1:this.point(l+n,t+a,0),controlPoint2:this.point(o+n,i+a,0)}},L.prototype.bezierLengthCalc=function(){for(var t,e,i,s,n,a,r=0,l=0;l<=10;l++)t=this.bezierPointCalc(e=l/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<l&&(n=t-i,a=e-s,r+=Math.sqrt(n*n+a*a)),i=t,s=e;return r},L.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},L.prototype.pointVelocityCalc=function(t){return this.time!==t.time?this.distanceTo(t)/(this.time-t.time):0},L.prototype.distanceTo=function(t){return Math.sqrt(Math.pow(this.pointX-t.x,2)+Math.pow(this.pointY-t.y,2))},L.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)},L.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))},L.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)},L.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))},L.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()},L.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)},L.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})},L.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)},L.prototype.internalRefresh=function(){this.pointColl=[],this.lastVelocity=0,this.lastWidth=(this.minStrokeWidth+this.maxStrokeWidth)/2},L.prototype.refresh=function(){this.isResponsive=!1,this.setHTMLProperties(),this.resizeHandler(),this.internalRefresh()},L.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"})},L.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"})},L.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"})},L.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)}},L.prototype.isEmpty=function(){return this.isSignatureEmpty},L.prototype.canUndo=function(){return 0<this.incStep},L.prototype.canRedo=function(){return this.incStep<this.snapColl.length-1},L.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"})},L.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},L.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)})},L.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()},L.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--},L.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--},L.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)},L.prototype.saveAsBlob=function(){return this.getBlob(this.canvasContext.canvas.toDataURL("image/png"))},L.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")},L.prototype.getModuleName=function(){return"signature"},L.prototype.getPersistData=function(){return this.signatureValue=this.snapColl[this.incStep],this.addOnPersist(["signatureValue"])},L.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),Hn.prototype.destroy.call(this),this.element=null},L.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)}},L);function L(){var t=null!==Hn&&Hn.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}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,A,O=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},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)}(N,A=En),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}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,In,Rn=function(t,e){function i(){this.constructor=t}Un(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,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},Vn="e-rating-icon e-icons e-star-filled",Fn="e-rating-item-list",Mn="e-rating-item-container",Dn="e-rating-selected",zn="e-rating-intermediate",Wn="e-rating-hidden",qn="e-disabled",jn="e-rating-readonly",_n="e-rating-animation",Xn="e-rating-full",Kn="e-rating-empty",Yn="e-selected-value",Zn=((Zn=o.LabelPosition||(o.LabelPosition={})).Top="Top",Zn.Bottom="Bottom",Zn.Left="Left",Zn.Right="Right",(Zn=o.PrecisionType||(o.PrecisionType={})).Full="Full",Zn.Half="Half",Zn.Quarter="Quarter",Zn.Exact="Exact",In=E.Component,Rn(B,In),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(jn),this.visible||this.wrapper.classList.add(Wn),this.enableRtl&&this.wrapper.classList.add("e-rtl"),this.enableAnimation&&this.wrapper.classList.add(_n),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"](qn),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"](qn),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:Fn,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:Mn}),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(Xn),E.append(this.fullTemplateFunction({index:i,ratingValue:e},this,"ratingFullTemplate",this.element.id+"fullTemplate",this.isStringTemplate),t)):this.emptyTemplate?(t.classList.add(Kn),E.append(this.emptyTemplateFunction({index:i,ratingValue:e},this,"ratingEmptyTemplate",this.element.id+"emptyTemplate",this.isStringTemplate),t)):E.addClass([t],Vn.split(" "))},B.prototype.removeItemContent=function(t){t.classList.remove(Xn,Kn),E.removeClass([t],Vn.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(Dn,zn,Yn),this.getRatingValue(this.currentValue,e));1===s?i.classList.add(Dn):0<s?i.classList.add(zn):this.precision===o.PrecisionType.Full&&e+1<=this.value&&!this.enableSingleSelection&&i.classList.add(Yn),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(Xn)||(this.removeItemContent(i),i.classList.add(Xn),E.append(this.fullTemplateFunction({ratingValue:t,index:e},this,"ratingFullTemplate",this.element.id+"fullTemplate"+e,this.isStringTemplate),i)):this.emptyTemplate?i.classList.contains(Kn)||(this.removeItemContent(i),i.classList.add(Kn),E.append(this.emptyTemplateFunction({ratingValue:t,index:e},this,"ratingEmptyTemplate",this.element.id+"emptyTemplate"+e,this.isStringTemplate),i)):(this.removeItemContent(i),E.addClass([i],Vn.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("."+Mn+"."+Dn);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(Fn))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;In.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"](Wn);break;case"disabled":this.updateDisabled();break;case"readOnly":this.wrapper.classList[this.readOnly?"add":"remove"](jn);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"](_n);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=In.call(this,t,e)||this;return t.itemElements=[],t}Gn=function(t,e){return(Gn=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 Gn,Jn,Rn=function(t,e){function i(){this.constructor=t}Gn(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,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},$n=(($n=o.OtpInputType||(o.OtpInputType={})).Number="number",$n.Text="text",$n.Password="password",($n=o.OtpInputStyle||(o.OtpInputStyle={})).Outlined="outlined",$n.Underlined="underlined",$n.Filled="filled",($n=o.TextTransform||(o.TextTransform={})).None="none",$n.Uppercase="uppercase",$n.Lowercase="lowercase",Jn=E.Component,Rn(U,Jn),U.prototype.preRender=function(){this.element.id||(this.element.id=E.getUniqueID("e-"+this.getModuleName()))},U.prototype.render=function(){this.initialize()},U.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()},U.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)},U.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)},U.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)])}},U.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})},U.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)])}},U.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)})},U.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},U.prototype.getTransformedText=function(t){return this.textTransform.toLowerCase()===o.TextTransform.Lowercase?t.toLowerCase():this.textTransform.toLowerCase()===o.TextTransform.Uppercase?t.toUpperCase():t},U.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)},U.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()},U.prototype.handleSelection=function(t){t=this.inputs[parseInt(t.toString(),10)];t.value&&t.select()},U.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},U.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},U.prototype.handlePaste=function(t,e){var i=e.clipboardData;if(i){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)}},U.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)},U.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())},U.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)},U.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)}},U.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()},U.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()},U.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))},U.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))},U.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)})},U.prototype.updateDisabledState=function(){var e=this;this.inputs.forEach(function(t){e.disabled?t.setAttribute("disabled","disabled"):t.removeAttribute("disabled")})},U.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])}},U.prototype.setInputMode=function(t){for(var e=0;e<this.inputs.length;e++)this.inputs[parseInt(e.toString(),10)].setAttribute("inputmode",t)},U.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)}}},U.prototype.getModuleName=function(){return"otpinput"},U.prototype.getPersistData=function(){return this.addOnPersist([])},U.prototype.destroy=function(){Jn.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},U.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},U.prototype.focusOut=function(){this.isFocusOutCalled=!0,this.inputs.forEach(function(t){t.blur()}),this.isFocusOutCalled=!1},U.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)],U.prototype,"length",void 0),H([E.Property("")],U.prototype,"value",void 0),H([E.Property(o.OtpInputType.Number)],U.prototype,"type",void 0),H([E.Property("")],U.prototype,"separator",void 0),H([E.Property("")],U.prototype,"placeholder",void 0),H([E.Property(o.OtpInputStyle.Outlined)],U.prototype,"stylingMode",void 0),H([E.Property(!1)],U.prototype,"disabled",void 0),H([E.Property("")],U.prototype,"cssClass",void 0),H([E.Property(!1)],U.prototype,"autoFocus",void 0),H([E.Property(o.TextTransform.None)],U.prototype,"textTransform",void 0),H([E.Property({})],U.prototype,"htmlAttributes",void 0),H([E.Property([])],U.prototype,"ariaLabels",void 0),H([E.Event()],U.prototype,"created",void 0),H([E.Event()],U.prototype,"valueChanged",void 0),H([E.Event()],U.prototype,"focus",void 0),H([E.Event()],U.prototype,"blur",void 0),H([E.Event()],U.prototype,"input",void 0),H([E.NotifyPropertyChanges],U));function U(t,e){t=Jn.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}Qn=function(t,e){return(Qn=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 Qn,ta,Rn=function(t,e){function i(){this.constructor=t}Qn(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,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},ea=(ta=E.ChildProperty,Rn(ia,ta),H([E.Property("")],ia.prototype,"content",void 0),H([E.Property("")],ia.prototype,"stopContent",void 0),H([E.Property("")],ia.prototype,"iconCss",void 0),H([E.Property("")],ia.prototype,"stopIconCss",void 0),H([E.Property("Left")],ia.prototype,"iconPosition",void 0),H([E.Property(!1)],ia.prototype,"isPrimary",void 0),ia);function ia(){return null!==ta&&ta.apply(this,arguments)||this}sa=E.ChildProperty,Rn(aa,sa),H([E.Property("Start listening")],aa.prototype,"content",void 0),H([E.Property("Stop listening")],aa.prototype,"stopContent",void 0),H([E.Property("TopCenter")],aa.prototype,"position",void 0);var sa,na=aa;function aa(){return null!==sa&&sa.apply(this,arguments)||this}(la=o.SpeechToTextState||(o.SpeechToTextState={})).Inactive="Inactive",la.Listening="Listening",la.Stopped="Stopped";ra=E.Component,Rn(I,ra),I.prototype.preRender=function(){this.element.id||(this.element.id=E.getUniqueID("e-"+this.getModuleName()))},I.prototype.getDirective=function(){return"EJS-SPEECHTOTEXT"},I.prototype.getModuleName=function(){return"speech-to-text"},I.prototype.getPersistData=function(){return this.addOnPersist([])},I.prototype.render=function(){this.renderSpeechToText(),this.initializeSpeechRecognition(),E.isNullOrUndefined(this.listeningState)||this.handleStateChange(),this.wireEvents()},I.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)},I.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 V.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)},I.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)},I.prototype.updateCssClass=function(t,e){e&&E.removeClass([this.element],e.trim().split(" ")),t&&E.addClass([this.element],t.trim().split(" "))},I.prototype.updateButtonCssClass=function(){var t;return""===(this.isClicked?this.buttonSettings.stopContent:this.buttonSettings.content)&&(t="e-round"),this.micOn&&(t+=" e-listening-state"),t},I.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)},I.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)))},I.prototype.addHtmlAttributes=function(t){if(t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&this.element.setAttribute(e,t[e])},I.prototype.removeHtmlAttributes=function(t){if(t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&this.element.removeAttribute(e)},I.prototype.wireEvents=function(){E.EventHandler.add(this.element,"click",this.handleButtonClick,this)},I.prototype.unWireEvents=function(){E.EventHandler.remove(this.element,"click",this.handleButtonClick)},I.prototype.handleButtonClick=function(t){this.isUserInteracted=!0,this.micOn=!this.micOn,this.micOn?this.startSpeechRecognition(t):this.stopSpeechRecognition(t)},I.prototype.triggerUnSupportedError=function(){var t={error:"unsupported-browser",errorMessage:this.l10n.getConstant("unsupportedBrowserError")};this.trigger("onError",t)},I.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()},I.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},I.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()})},I.prototype.startSpeechRecognition=function(t){this.hasStarted||(this.recognition?this.recognition.start():this.triggerUnSupportedStart(t))},I.prototype.stopSpeechRecognition=function(t){this.recognition?this.recognition.stop():this.handleStopRecognition(t)},I.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)},I.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)},I.prototype.destroyAndNullify=function(t){t&&t.destroy()},I.prototype.destroy=function(){ra.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")},I.prototype.startListening=function(){this.disabled||this.isClicked||(this.isUserInteracted=!1,this.micOn=!0,this.startSpeechRecognition())},I.prototype.stopListening=function(){!this.disabled&&this.isClicked&&(this.isUserInteracted=!1,this.micOn=!1,this.stopSpeechRecognition())},I.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("")],I.prototype,"transcript",void 0),H([E.Property("")],I.prototype,"lang",void 0),H([E.Property(!0)],I.prototype,"allowInterimResults",void 0),H([E.Property(!0)],I.prototype,"showTooltip",void 0),H([E.Property("Inactive")],I.prototype,"listeningState",void 0),H([E.Complex({},ea)],I.prototype,"buttonSettings",void 0),H([E.Complex({},na)],I.prototype,"tooltipSettings",void 0),H([E.Property(!1)],I.prototype,"disabled",void 0),H([E.Property("")],I.prototype,"cssClass",void 0),H([E.Property({})],I.prototype,"htmlAttributes",void 0),H([E.Event()],I.prototype,"created",void 0),H([E.Event()],I.prototype,"onStart",void 0),H([E.Event()],I.prototype,"onStop",void 0),H([E.Event()],I.prototype,"onError",void 0),H([E.Event()],I.prototype,"transcriptChanged",void 0);var ra,la=H([E.NotifyPropertyChanges],I);function I(t,e){t=ra.call(this,t,e)||this;return t.fullTranscript="",t.isClicked=!1,t.isUserInteracted=!1,t.hasStarted=!1,t}o.AsyncSettings=ks,o.ButtonSettings=ea,o.ButtonsProps=Ps,o.ColorPicker=s,o.ColorRangeData=He,o.FilesProp=Es,o.FormValidator=Yi,o.LimitData=Ie,o.MaskUndo=Se,o.MaskedTextBox=xt,o.NumericTextBox=Bt,o.OtpInput=$n,o.Rating=Zn,o.Signature=O,o.SignatureBase=En,o.Slider=qi,o.SmartTextArea=Pn,o.SpeechToText=la,o.TEXTBOX_FOCUS=D,o.TextArea=P,o.TextBox=S,o.TicksData=Le,o.TooltipData=Fe,o.TooltipSettings=na,o.Uploader=t,o.applyMask=Wt,o.bindClearEvent=_t,o.containerAttributes=M,o.createMask=zt,o.escapeRegExp=te,o.getMaskedVal=function(t){return Yt.call(Ee(t),t.element)},o.getVal=function(t){return u.call(Ee(t),t.element)},o.maskInput=function(t){var e=Ce(t),i=(Wt.call(e),u.call(this,this.element));this.prevValue=i,this.value=i,t.mask&&(jt.call(e),qt.call(e))},o.maskInputBlurHandler=ee,o.maskInputDropHandler=ne,o.maskInputFocusHandler=$t,o.maskInputMouseDownHandler=Gt,o.maskInputMouseUpHandler=Jt,o.mobileRemoveFunction=le,o.regex=Ki,o.regularExpressions=Dt,o.setElementValue=b,o.setMaskValue=be,o.strippedValue=u,o.triggerFocus=Qt,o.unstrippedValue=Yt,o.unwireEvents=jt,o.wireEvents=qt,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,R,V){"use strict";var n,F,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"},M=["title","style","class"],D="e-input-focus";function z(i){W(i.floatLabelType,i.element);function t(){var t,e;((e=$((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=$((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(){W(i.floatLabelType,i.element)}i.element.addEventListener("focus",t),i.element.addEventListener("blur",e),i.element.addEventListener("input",s),i.element.__eventHandlers.inputFocusHandler={focusHandler:t},i.element.__eventHandlers.inputBlurHandler={blurHandler:e},i.element.__eventHandlers.inputHandler={inputHandler:s}}function W(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 q(){var t=$(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 j(){var t=$(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 _(t){t.addEventListener("focus",q),t.addEventListener("blur",j)}function X(t){E.isNullOrUndefined(t)||(t.removeEventListener("focus",q),t.removeEventListener("blur",j))}function K(t,e,i){var s,i=E.isNullOrUndefined(i)?E.createElement:i,n=("Auto"===t.floatLabelType&&_(t.element),E.isNullOrUndefined(e.container)?(e.container=et(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=it(t.element.placeholder),t.element.removeAttribute("placeholder")),E.isNullOrUndefined(t.properties)||E.isNullOrUndefined(t.properties.placeholder)||""===t.properties.placeholder||(i.innerText=it(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),J(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(){tt(t.element,t.floatLabelType)},t.element.addEventListener("input",n=function(){tt(t.element,t.floatLabelType)}),t.element.addEventListener("blur",s),t.element.__eventHandlers.floatInputHandler={inputFloatHandler:n},t.element.__eventHandlers.floatBlurHandler={blurFloatHandler:s}):Y(t),E.isNullOrUndefined(t.element.getAttribute("id"))||i.setAttribute("for",t.element.getAttribute("id"))}function Y(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.inputFloatHandler,i=t.element.__eventHandlers.floatBlurHandler.blurFloatHandler,t.element.removeEventListener("input",e),t.element.removeEventListener("blur",i),delete t.element.__eventHandlers.floatInputHandler,delete t.element.__eventHandlers.floatBlurHandler)}function Z(t,e){"Always"===t&&e.classList.contains("e-outline")&&e.classList.add("e-valid-input")}function G(t,e,i){E.isNullOrUndefined(e)||(t&&!i?E.removeClass([e],p.CLEARICONHIDE):E.addClass([e],p.CLEARICONHIDE))}function J(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 $(t){t=E.isNullOrUndefined(t.parentNode)?t:t.parentNode;return t=t&&t.classList.contains("e-input-in-wrap")?t.parentNode:t}function Q(s,n,t){function e(){G(s.value,n)}function i(){G(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 r;void 0!==F&&!F||(n.addEventListener("click",r=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={clickHandlerEvent:r});s.addEventListener("input",e),s.addEventListener("focus",i),s.addEventListener("blur",a),s.__eventHandlers.clearInputHandler={inputHandlerEvent:e},s.__eventHandlers.clearFocusHandler={focusHandlerEvent:i},s.__eventHandlers.clearBlurHandler={blurHandlerEvent:a}}function tt(t,e){$(t).classList.contains(p.FLOATINPUT)&&"Auto"===e&&(e=$(t).getElementsByClassName("e-float-text")[0],J(t.value,e,t))}function et(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 it(t){var e;return null==t||""===t?"":(e={"&":"&",""":'"',"'":"'","<":"<",">":">","é":"é"},t.replace(/&[a-zA-Z#0-9]+;/g,function(t){return e[t]||t}))}function st(t,e,i){E.isNullOrUndefined(i)||""===i||E.removeClass(e,i.split(" ")),E.isNullOrUndefined(t)||""===t||E.addClass(e,t.split(" "))}function nt(t,e,i){("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))&&(i="multiselect"===i?t:t.clientWidth-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"),i<e.getElementsByClassName("e-float-text-content")[0].clientWidth||i===e.getElementsByClassName("e-float-text-content")[0].clientWidth)&&e.getElementsByClassName("e-float-text-content")[0].classList.add("e-float-text-overflow")}function at(t,e){t=it(t);var i,s,n=$(e);n.classList.contains(p.FLOATINPUT)?E.isNullOrUndefined(t)||""===t?(n.classList.add(p.NOFLOATLABEL),(i=n.getElementsByClassName("e-float-text-content")[0])&&i.children[0]?i.children[0].textContent="":(s=n.getElementsByClassName(p.FLOATTEXT)[0],E.isNullOrUndefined(s)||(s.textContent=""))):((i=n.getElementsByClassName("e-float-text-content")[0])&&i.children[0]?i.children[0].textContent=t:(s=n.getElementsByClassName(p.FLOATTEXT)[0],E.isNullOrUndefined(s)||(s.textContent=t)),n.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)||tt(e,i)}function lt(t,e){t?E.addClass(e,p.RTL):E.removeClass(e,p.RTL)}function ot(t,e,i,s){var n={disabled:"","aria-disabled":"true"},a=!E.isNullOrUndefined(s);t?(e.classList.remove(p.DISABLE),pt(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)||tt(e,i)}function ht(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),Q(t,n),n.setAttribute("aria-label","close"),n):(E.remove(i.clearButton),i.clearButton=null)}function pt(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i],a=$(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=$(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 dt(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 ct(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",mt,!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",mt,this),n[parseInt(a.toString(),10)].removeEventListener("mouseup",vt,this)}function mt(){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 ft(t,e){e=e("span",{className:t});return e.classList.add("e-input-group-icon"),e}function gt(t,e,i,s){var s=E.isNullOrUndefined(s)?E.createElement:s,t=ft(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 r=0;r<a.length;r++){var l=a[parseInt(r.toString(),10)],o=n.parentElement;l.classList.contains("e-float-line")&&(o&&o.classList.contains("e-filled")||!o)||n.appendChild(l)}}return n.parentNode.insertBefore(t,n),ct(!0,e,t),t}function yt(t,e,i){t=ft(t,E.isNullOrUndefined(i)?E.createElement:i);return(e.classList.contains("e-float-icon-left")?e.querySelector(".e-input-in-wrap"):e).appendChild(t),ct(!0,e,t),t}function bt(t,e){"hidden"===e.type?t.classList.add("e-hidden"):t.classList.contains("e-hidden")&&t.classList.remove("e-hidden")}function Ct(t){var e=t;return e=E.isNullOrUndefined(t)||""===t?e:t.replace(/\s+/g," ").trim()}n=o.Input||(o.Input={}),F=!0,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,F=t.bindClearAction,E.isNullOrUndefined(t.floatLabelType)||"Never"===t.floatLabelType?(s.container=et(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)):K(t,s,i),z(t),E.isNullOrUndefined(t.properties)||E.isNullOrUndefined(t.properties.showClearButton)||!t.properties.showClearButton||(ht(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(yt(t.buttons[n],s.container,i));return E.isNullOrUndefined(t.element)||"TEXTAREA"!==t.element.tagName||E.addClass([s.container],p.TEXTAREA),bt(s.container,t.element),dt((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":st(t.properties.cssClass,[e.container]),Z(t.floatLabelType,e.container);break;case"enabled":ot(t.properties.enabled,t.element,t.floatLabelType,e.container);break;case"enableRtl":lt(t.properties.enableRtl,[e.container]);break;case"placeholder":at(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=_,n.wireClearBtnEvents=Q,n.destroy=function(t,e){var i,s,n,a,r;void 0===e&&(e=null),i=t,E.isNullOrUndefined(i.element)||E.isNullOrUndefined(i.element.__eventHandlers)||E.isNullOrUndefined(i.element.__eventHandlers.inputFocusHandler)||E.isNullOrUndefined(i.element.__eventHandlers.inputBlurHandler)||E.isNullOrUndefined(i.element.__eventHandlers.inputHandler)||(s=i.element.__eventHandlers.inputFocusHandler.focusHandler,n=i.element.__eventHandlers.inputBlurHandler.blurHandler,r=i.element.__eventHandlers.inputHandler.inputHandler,i.element.removeEventListener("focus",s),i.element.removeEventListener("blur",n),i.element.removeEventListener("input",r),delete i.element.__eventHandlers.inputFocusHandler,delete i.element.__eventHandlers.inputBlurHandler,delete i.element.__eventHandlers.inputHandler),"Auto"===t.floatLabelType&&Y(t),t.properties.showClearButton&&(s=t.element,n=e,E.isNullOrUndefined(s)||E.isNullOrUndefined(s.__eventHandlers)||(E.isNullOrUndefined(s.__eventHandlers.clearClickHandler)||(a=s.__eventHandlers.clearClickHandler.clickHandlerEvent,void 0!==F&&!F||E.isNullOrUndefined(n)||n.removeEventListener("click",a),delete s.__eventHandlers.clearClickHandler),E.isNullOrUndefined(s.__eventHandlers.clearInputHandler))||E.isNullOrUndefined(s.__eventHandlers.clearFocusHandler)||E.isNullOrUndefined(s.__eventHandlers.clearBlurHandler)||(n=s.__eventHandlers.clearInputHandler.inputHandlerEvent,a=s.__eventHandlers.clearFocusHandler.focusHandlerEvent,r=s.__eventHandlers.clearBlurHandler.blurHandlerEvent,s.removeEventListener("input",n),s.removeEventListener("focus",a),s.removeEventListener("blur",r),delete s.__eventHandlers.clearInputHandler,delete s.__eventHandlers.clearFocusHandler,delete s.__eventHandlers.clearBlurHandler)),E.isNullOrUndefined(t.buttons)||ct(!1,null,t.buttons),X(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&&nt(e,e.parentElement),E.isNullOrUndefined(i)||"Auto"!==i||tt(e,i),!E.isNullOrUndefined(s)&&s&&(t=$(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))),W(i,e)},n.setCssClass=st,n.calculateWidth=nt,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)),nt(e.firstChild,e)},n.setPlaceholder=at,n.setReadonly=rt,n.setEnableRtl=lt,n.setEnabled=ot,n.setClearButton=ht,n.removeAttributes=pt,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]),X(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,r=E.closest(t,"."+p.INPUTGROUP),l=r.tagName,l={element:t,floatLabelType:e,customTag:"DIV"!==l&&"SPAN"!==l?l:null,properties:{placeholder:i}};"Never"!==e?(i=r.querySelector(".e-clear-icon"),n={container:r},t.classList.remove(p.INPUT),K(l,n,s),dt(n.container,s),nt(l.element,n.container),s=r.classList.contains("e-float-icon-left"),E.isNullOrUndefined(i)&&(i=(s?r.querySelector(".e-input-in-wrap"):r).querySelector(".e-input-group-icon")),E.isNullOrUndefined(i)?s&&(i=r.querySelector(".e-input-group-icon")):(n=r.querySelector("."+p.FLOATLINE),a=r.querySelector("."+p.FLOATTEXT),(s=s?r.querySelector(".e-input-in-wrap"):r).insertBefore(t,i),s.insertBefore(n,i),s.insertBefore(a,i))):Y(l),Z(e,t.parentElement)},n.createSpanElement=dt,n.setRipple=function(t,e){for(var i=0;i<e.length;i++)ct(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,r=e;a<r.length;a++)yt(r[a],i,n);else for(var l=0,o=e;l<o.length;l++)gt(o[l],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=gt,n.appendSpan=yt,n.validateInputType=bt,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];M.indexOf(n)<0&&e.setAttribute(n,t[""+n])}},n.updateCssClass=function(t,e,i){st(Ct(t),[i],Ct(e))},n.getInputValidClassList=Ct,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<M.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)};Et=function(t,e){return(Et=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 Et,St,xt=function(t,e){function i(){this.constructor=t}Et(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,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},Pt="e-input-group-icon",Tt="e-spin-up",Ot="e-error",kt="increment",wt="decrement",Lt=new RegExp("^(-)?(\\d*)$"),At="e-input-focus",Nt=["title","style","class"],Ht=0,Bt=(St=E.Component,xt(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.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,r=i[e];if(!E.isNullOrUndefined(this.element.getAttribute(r)))switch(r){case"disabled":(E.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.enabled||t)&&(s="disabled"!==this.element.getAttribute(r)&&""!==this.element.getAttribute(r)&&"true"!==this.element.getAttribute(r),this.setProperties({enabled:s},!t));break;case"readonly":(E.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.readonly||t)&&(s="readonly"===this.element.getAttribute(r)||""===this.element.getAttribute(r)||"true"===this.element.getAttribute(r),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(r)),this.setProperties(E.setValue(r,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(r)))||isNaN(n)||this.setProperties(E.setValue(r,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(r)))||isNaN(a)||this.setProperties(E.setValue(r,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(r)))||isNaN(a)||this.setProperties(E.setValue(r,a,{}),!t);break;case"style":this.inputStyle=this.element.getAttribute(r);break;case"name":this.inputName=this.element.getAttribute(r);break;default:var l=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(r));(null===l||isNaN(l))&&"value"!==r||this.setProperties(E.setValue(r,l,{}),!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];Nt.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<Nt.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+" "+Tt,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],Ot):E.addClass([this.container],Ot),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.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)},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)},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.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,r=!!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&&!r?(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(kt,t);break;case 40:t.preventDefault(),this.action(wt,t)}},e.prototype.performAction=function(t,e,i){null!==t&&!isNaN(t)||(t=0);i=this.correctRounding(t,e,i===kt?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)&&(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 e=e||0,i=t.toString().split("e"),i=(t=Math.round(Number(i[0]+"e"+(i[1]?Number(i[1])+e:e)))).toString().split("e");return t=Number(i[0]+"e"+(i[1]?Number(i[1])-e:-e)),Number(t.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?Lt:(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;t.preventDefault(),t.wheelDelta?e=t.wheelDelta/120:t.detail&&(e=-t.detail/3),0<e?this.action(kt,t):e<0&&this.action(wt,t),this.cancelEvent(t)},e.prototype.focusHandler=function(t){var e,i=this;clearTimeout(Ht),this.focusEventArgs={event:t,value:this.value,container:this.container},this.trigger("focus",this.focusEventArgs),!this.enabled||this.readonly||(this.isFocused=!0,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,Ht=setTimeout(function(){i.element.setSelectionRange(0,e.length)},t)):this.element.setSelectionRange(0,e.length)),E.Browser.isDevice)||E.EventHandler.add(this.element,"mousewheel DOMMouseScroll",this.mouseWheel,this)},e.prototype.focusOutHandler=function(t){var e,i,s,n=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(){n.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)),E.closest(this.element,"form"))&&(t=this.element.nextElementSibling,(s=document.createEvent("FocusEvent")).initEvent("focusout",!1,!0),t.dispatchEvent(s))},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(Tt)?kt:wt,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(Tt)?kt:wt,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,kt)),this.raiseChangeEvent()},e.prototype.decrement=function(t){void 0===t&&(t=this.step),this.isInteract=!1,this.changeValue(this.performAction(this.value,t,wt)),this.raiseChangeEvent()},e.prototype.destroy=function(){this.unwireEvents(),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),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],[At]))},e.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.element.blur(),E.removeClass([this.container],[At]))},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]);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),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.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)}}},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.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("Never")],e.prototype,"floatLabelType",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",Rt="e-float-input",Vt="e-utility-mask",Ft="e-label-top",Mt="e-label-bottom",Dt={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]+"["),Zt.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):Zt.call(this,i[s]);else Zt.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 Wt(){b.call(this,this.promptMask),be.call(this,this.value)}function qt(){E.EventHandler.add(this.element,"keydown",re,this),E.EventHandler.add(this.element,"keypress",pe,this),E.EventHandler.add(this.element,"keyup",de,this),E.EventHandler.add(this.element,"input",ae,this),E.EventHandler.add(this.element,"focus",$t,this),E.EventHandler.add(this.element,"blur",ee,this),E.EventHandler.add(this.element,"paste",ie,this),E.EventHandler.add(this.element,"cut",se,this),E.EventHandler.add(this.element,"drop",ne,this),E.EventHandler.add(this.element,"mousedown",Gt,this),E.EventHandler.add(this.element,"mouseup",Jt,this),this.enabled&&(_t.call(this),this.formElement)&&E.EventHandler.add(this.formElement,"reset",Kt,this)}function jt(){E.EventHandler.remove(this.element,"keydown",re),E.EventHandler.remove(this.element,"keypress",pe),E.EventHandler.remove(this.element,"keyup",de),E.EventHandler.remove(this.element,"input",ae),E.EventHandler.remove(this.element,"focus",$t),E.EventHandler.remove(this.element,"blur",ee),E.EventHandler.remove(this.element,"paste",ie),E.EventHandler.remove(this.element,"cut",se),E.EventHandler.remove(this.element,"drop",ne),E.EventHandler.remove(this.element,"mousedown",Gt),E.EventHandler.remove(this.element,"mouseup",Jt),this.formElement&&E.EventHandler.remove(this.formElement,"reset",Kt)}function _t(){this.showClearButton&&E.EventHandler.add(this.inputObj.clearButton,"mousedown touchstart",Xt,this)}function Xt(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 Kt(){"EJS-MASKEDTEXTBOX"===this.element.tagName?b.call(this,this.promptMask):this.value=this.initInputValue}function Yt(t){return t.value}function u(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 r=0;r<this.customRegExpCollec.length;r++)n=n&&!1,">"!==this.customRegExpCollec[s]&&"<"!==this.customRegExpCollec[s]&&"|"!==this.customRegExpCollec[s]&&"\\"!==this.customRegExpCollec[s]||(--r,n=!0),n||a[r]!==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[r]),++s;return i=null===this.mask||""===this.mask&&void 0!==this.value?a:i}function Zt(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 Gt(){this.isClicked=!0}function Jt(){this.isClicked=!1}function $t(t){var i=this,s=this.element,e=0,n=u.call(this,s),a=!1,r=!1,l={selectionStart:s.selectionStart,event:t,value:this.value,maskedValue:s.value,container:E.isNullOrUndefined(this.inputObj)?this.inputObj:this.inputObj.container,selectionEnd:s.selectionEnd};if(this.isClicked||Qt.call(this,l,s),this.mask&&(null!==n&&""!==n||"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)a=!0;else for(var t=s.selectionStart;t<i.promptMask.length;t++){if(s.value[t]===i.promptChar){a=!0;break}if(s.value[t]!==i.promptMask[t]){a=!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===n||""===n)&&null!==this.placeholder&&""!==this.placeholder)){for(e=0;e<this.promptMask.length;e++)if(s.value[e]===this.promptChar){setTimeout(function(){(a||r)&&(s.selectionEnd=e,s.selectionStart=e),l={selectionStart:s.selectionStart,event:t,value:i.value,maskedValue:s.value,container:E.isNullOrUndefined(i.inputObj)?i.inputObj:i.inputObj.container,selectionEnd:s.selectionEnd},Qt.call(i,l,s)},110);break}E.isNullOrUndefined(s.value.match(te(this.promptChar)))&&(l={selectionStart:s.selectionStart,event:t,value:this.value,maskedValue:s.value,container:E.isNullOrUndefined(this.inputObj)?this.inputObj:this.inputObj.container,selectionEnd:s.selectionEnd},Qt.call(this,l,s)),this.isClicked=!1}}function Qt(t,e){this.trigger("focus",t,function(t){e.selectionStart=t.selectionStart,e.selectionEnd=t.selectionEnd})}function te(t){return E.isNullOrUndefined(t)?t:t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function ee(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.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(Ft)&&E.removeClass([t],Ft)}function ie(s){var n,a,r,l=this;this.mask&&!this.readonly&&(n=this.element.selectionStart,a=this.element.selectionEnd,r=this.element.value,b.call(this,""),this._callPasteHandler=!0,setTimeout(function(){var t=l.element.value.replace(/ /g,""),e=(0<l.redoCollec.length&&l.redoCollec[0].value===l.element.value&&(t=u.call(l,l.element)),b.call(l,r),l.element.selectionStart=n,l.element.selectionEnd=a,0);for(l.maskKeyPress=!0;me.call(l,t[e],!1,null),++e<t.length;);if(l.maskKeyPress=!1,l._callPasteHandler=!1,l.element.value===r){var i=0;for(l.maskKeyPress=!0;me.call(l,t[i],!1,null),++i<t.length;);l.maskKeyPress=!1}else ue.call(l,s,r)},1))}function se(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 ne(t){t.preventDefault()}function ae(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)&&!this._callPasteHandler||he.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);me.call(this,s[n],t.ctrlKey,t),++n<s.length;);this.element.value!==this.preEleVal&&ue.call(this,t,null)}i=u.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(),he.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 le(){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 oe(t,e,i){return"input"===i.type&&(t=!1,e=this.element.value,b.call(this,this.promptMask),be.call(this,e)),t}function he(t){var e,i=!1,s=!1,n=(this.element.value.length<this.promptMask.length&&(e=this.element.value,i=oe.call(this,i=!0,e,t),le.call(this)),this.element.value.length>=this.promptMask.length&&"input"===t.type&&(i=oe.call(this,i,e,t)),this.element.selectionStart),a=this.element.selectionEnd,r=this.element.selectionStart,l=this.element.selectionEnd,o=this.hiddenMask.replace(/[>|\\<]/g,""),h=o[r-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:l});var u=!1,d=this.element.value;if(0<r||(8===t.keyCode||46===t.keyCode)&&r<this.element.value.length&&this.element.selectionEnd-r!==this.element.value.length){var c=r;r!==l?(r=l,46===t.keyCode&&(u=!0)):46===t.keyCode?++c:--c;for(var m=r;8===t.keyCode||i||u?c<m:m<c;8===t.keyCode||i||u?m--:m++)for(var v=r;8===t.keyCode||i||u?0<v:v<this.element.value.length;8===t.keyCode||i||u?v--:v++){var f,g,y=void 0;(8===t.keyCode||u)&&(n!==a&&n!==r||n===a)||i?(h=o[v-1],y=r-1):(h=o[v],y=r,++r),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||u||++this.element.selectionStart):(f=this.element.value,g=this.promptChar,g=f.substring(0,y)+g+f.substring(r,f.length),b.call(this,g),t.preventDefault(),46!==t.keyCode||u||y++,this.element.selectionStart=this.element.selectionEnd=y,s=!0),r=this.element.selectionStart,!s&&8===t.keyCode||u||!s&&46!==t.keyCode?y=r-1:(y=r,s=!1),f=this.element.value[y],n!==a&&this.element.selectionStart===n||this.promptMask[y]===this.promptChar||f!==this.promptMask[y]&&this.promptMask[y]!==this.promptChar&&!E.isNullOrUndefined(this.customCharacters))break}}46===t.keyCode&&u&&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=r),this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),this.element.value!==d&&ue.call(this,t,e)}}function pe(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&&(me.call(this,i,t.ctrlKey,t),t.preventDefault()):(this.isIosInvalid=!0,me.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=u.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=u.call(this,this.element)}function de(t){var e,i,s,n,a,r,l,o;this.mask&&!this.readonly?(s=void 0,this.maskKeyPress||229!==t.keyCode?ye.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,l=s.value.substring(n-e,n),s=this.redoCollec[0],i=i.trim(),(r=E.Browser.isAndroid&&""===i)||l===i||s.value.substring(n-e,n)===i?r&&fe.call(this,t,n-1,this.element.selectionEnd-1,i,t.ctrlKey,!1):me.call(this,i,t.ctrlKey,t)):(a=this.promptMask,me.call(this,i,t.ctrlKey,t)),this.maskKeyPress=!1,ue.call(this,t,a))),l=u.call(this,this.element),(0!==this.element.selectionStart||this.promptMask!==this.element.value||""!==l||""===l&&this.value!==l)&&(this.prevValue=l,this.value=l)):ue.call(this,t),0===this.element.selectionStart&&0===this.element.selectionEnd&&(o=this.element,setTimeout(function(){o.setSelectionRange(0,0)},0))}function ce(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 me(t,e,i){if(ce.call(this,t),!E.isNullOrUndefined(this)&&!E.isNullOrUndefined(t))for(var s,n=u=this.element.selectionStart,a=!1,r=this.element.value,l=!1,o=!1,h=0;h<t.length;h++){var p=t[h],u=this.element.selectionStart;if(this.maskKeyPress||n!==u||(u+=h),!this.maskKeyPress||u<this.promptMask.length){for(var d,c,m=u;m<this.promptMask.length;m++){var v=this.escapeMaskValue[u];"\\"===this.hiddenMask[u]&&this.hiddenMask[u+1]===t&&(o=!0),(E.isNullOrUndefined(this.regExpCollec[""+v])&&(E.isNullOrUndefined(this.customCharacters)||!E.isNullOrUndefined(this.customCharacters)&&E.isNullOrUndefined(this.customCharacters[""+v]))&&this.hiddenMask[u]!==this.promptChar&&"["!==this.customRegExpCollec[u][0]&&"]"!==this.customRegExpCollec[u][this.customRegExpCollec[u].length-1]||this.promptMask[u]!==this.promptChar&&E.isNullOrUndefined(this.customCharacters)||this.promptChar===v&&this.escapeMaskValue===this.mask)&&(this.element.selectionStart=this.element.selectionEnd=u+1,u=this.element.selectionStart,v=this.hiddenMask[u])}if(E.isNullOrUndefined(this.customCharacters)||E.isNullOrUndefined(this.customCharacters[""+v]))(!E.isNullOrUndefined(this.regExpCollec[""+v])&&p.match(new RegExp(this.regExpCollec[""+v]))&&this.promptMask[u]===this.promptChar||this.promptMask[u]===this.promptChar&&"["===this.customRegExpCollec[u][0]&&"]"===this.customRegExpCollec[u][this.customRegExpCollec[u].length-1]&&p.match(new RegExp(this.customRegExpCollec[u])))&&(a=!0);else for(var f=this.customCharacters[""+v].split(","),m=0;m<f.length;m++)if(p.match(new RegExp("["+f[m]+"]"))){a=!0;break}(!this.maskKeyPress||u<this.hiddenMask.length)&&a?(0===h&&(this.maskKeyPress?this.undoCollec.push({value:r,startIndex:u,endIndex:u}):(d=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:u,endIndex:u}),s=this.promptMask,b.call(this,s)),this.element.selectionStart=d,this.element.selectionEnd=c)),u=this.element.selectionStart,ve.call(this,i,u,p,s,o),l=!0,h===t.length-1&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),a=!1):(u=this.element.selectionStart,fe.call(this,i,u,n,t,e,l)),h!==t.length-1||a||(!E.Browser.isAndroid||E.Browser.isAndroid&&u<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)||ge.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 fe(t,e,i,s,n,a){var r;this.maskKeyPress||(r=this.element.value,e>=this.promptMask.length?b.call(this,r.substring(0,e)):(i===e?b.call(this,r.substring(0,e)+r.substring(e+1,r.length)):this.promptMask.length===this.element.value.length?b.call(this,r.substring(0,e)+r.substring(e,r.length)):b.call(this,r.substring(0,i)+r.substring(i+1,r.length)),this.element.selectionStart=this.element.selectionEnd=a||this.element.value[i]!==this.promptChar?e:i),ge.call(this)),1!==s.length||n||E.isNullOrUndefined(t)||ge.call(this)}function ge(){var t=this,e=this.element.parentNode,i=200;e.classList.contains(It)||e.classList.contains(Rt)?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||ye.call(t)},i)}function ye(){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 be(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++)me.call(this,t[e],!1,null);var i=u.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(Ft)&&!this.isFocus&&(E.removeClass([i],Ft),E.addClass([i],Mt),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=u.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 Ce(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:Dt,customRegExpCollec:[],customCharacters:t.customCharacters,undoCollec:[],redoCollec:[],maskKeyPress:!1,prevValue:""};return zt.call(t),t}function Ee(t){var e;return e=!E.isNullOrUndefined(t)&&t.element.classList.contains(Vt)?Ce(t):e}function Se(){}xe=function(t,e){return(xe=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 xe,Pe,xt=function(t,e){function i(){this.constructor=t}xe(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,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},Te="e-input-focus",Oe=["title","style","class"],xt=(Pe=E.Component,xt(i,Pe),i.prototype.getModuleName=function(){return"maskedtextbox"},i.prototype.preRender=function(){this.promptMask="",this.hiddenMask="",this.escapeMaskValue="",this.regExpCollec=Dt,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.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];Oe.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<Oe.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),Wt.call(this),(null===this.mask||""===this.mask&&void 0!==this.value)&&b.call(this,this.value);var t=u.call(this,this.element);this.prevValue=t,this.value=t,this.isInitial||jt.call(this),qt.call(this)},i.prototype.setMaskPlaceholder=function(t,e){(e||this.placeholder)&&(o.Input.setPlaceholder(this.placeholder,this.element),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":be.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]);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),_t.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"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.updateValue=function(t){this.resetMaskedTextBox(),be.call(this,t)},i.prototype.getMaskedValue=function(){return Yt.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],[Te]))},i.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.isFocus=!1,this.element.blur(),E.removeClass([this.inputObj.container],[Te]))},i.prototype.destroy=function(){jt.call(this),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,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.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}ke=function(t,e){return(ke=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 ke,we,t=function(t,e){function i(){this.constructor=t}ke(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,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},Le=(we=E.ChildProperty,t(Ae,we),s([E.Property("None")],Ae.prototype,"placement",void 0),s([E.Property(10)],Ae.prototype,"largeStep",void 0),s([E.Property(1)],Ae.prototype,"smallStep",void 0),s([E.Property(!1)],Ae.prototype,"showSmallTicks",void 0),s([E.Property(null)],Ae.prototype,"format",void 0),Ae);function Ae(){return null!==we&&we.apply(this,arguments)||this}Ne=E.ChildProperty,t(Be,Ne),s([E.Property(null)],Be.prototype,"color",void 0),s([E.Property(null)],Be.prototype,"start",void 0),s([E.Property(null)],Be.prototype,"end",void 0);var Ne,He=Be;function Be(){return null!==Ne&&Ne.apply(this,arguments)||this}Ue=E.ChildProperty,t(Re,Ue),s([E.Property(!1)],Re.prototype,"enabled",void 0),s([E.Property(null)],Re.prototype,"minStart",void 0),s([E.Property(null)],Re.prototype,"minEnd",void 0),s([E.Property(null)],Re.prototype,"maxStart",void 0),s([E.Property(null)],Re.prototype,"maxEnd",void 0),s([E.Property(!1)],Re.prototype,"startHandleFixed",void 0),s([E.Property(!1)],Re.prototype,"endHandleFixed",void 0);var Ue,Ie=Re;function Re(){return null!==Ue&&Ue.apply(this,arguments)||this}Ve=E.ChildProperty,t(Me,Ve),s([E.Property("")],Me.prototype,"cssClass",void 0),s([E.Property("Before")],Me.prototype,"placement",void 0),s([E.Property("Focus")],Me.prototype,"showOn",void 0),s([E.Property(!1)],Me.prototype,"isVisible",void 0),s([E.Property(null)],Me.prototype,"format",void 0);var Ve,Fe=Me;function Me(){return null!==Ve&&Ve.apply(this,arguments)||this}var De,ze=1e-10,We="e-slider",qe="e-rtl",je="e-slider-input",_e="e-control-wrapper",Xe="e-handle",Ke="e-range",Ye="e-slider-button",Ze="e-first-button",Ge="e-second-button",Je="e-scale",$e="e-tick",Qe="e-large",ti="e-tick-value",ei="e-slider-tooltip",ii="e-slider-hover",si="e-handle-first",ni="e-handle-second",ai="e-disabled",ri="e-slider-container",li="e-slider-horizontal-before",oi="e-slider-horizontal-after",hi="e-slider-vertical-before",pi="e-slider-vertical-after",ui="e-material-tooltip-open",di="e-tooltip-active",ci="e-material-slider",mi="e-slider-track",vi="e-slider-horizantal-color",fi="e-slider-vertical-color",gi="e-handle-focused",yi="e-vertical",bi="e-horizontal",Ci="e-handle-start",Ei="e-material-tooltip-start",a="e-tab-handle",Si="e-button-icon",xi="e-small-size",Pi="e-tick-pos",Ti="e-first-tick",Oi="e-last-tick",ki="e-slider-btn",wi="e-tab-track",Li="e-tab-range",Ai="e-handle-active",Ni="e-material-handle",Hi="e-material-range",Bi="e-material-default",Ui="e-material-tooltip-show",Ii="e-material-tooltip-hide",Ri="e-read-only",Vi="e-limits",Fi="e-limit-bar",Mi="e-limit-first",Di="e-limit-second",zi="e-drag-horizontal",Wi="e-drag-vertical",qi=(De=E.Component,t(r,De),r.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()},r.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},r.prototype.initCultureFunc=function(){this.internationalization=new E.Internationalization(this.locale)},r.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},r.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}},r.prototype.formatNumber=function(t){var e=this.numberOfDecimals(t);return this.internationalization.getNumberFormat({maximumFractionDigits:e,minimumFractionDigits:e,useGrouping:!1})(t)},r.prototype.numberOfDecimals=function(t){t=t.toString().split(".")[1];return t&&t.length?t.length:0},r.prototype.makeRoundNumber=function(t,e){return Number(t.toFixed(e||0))},r.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)},r.prototype.initialize=function(){E.addClass([this.element],We),this.setCSSClass()},r.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)))},r.prototype.setCSSClass=function(t){t&&E.removeClass([this.element],t.split(" ")),this.cssClass&&E.addClass([this.element],this.cssClass.split(" "))},r.prototype.setEnabled=function(){this.enabled?(E.removeClass([this.sliderContainer],[ai]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.remove(ai),this.wireEvents()):(E.addClass([this.sliderContainer],[ai]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.add(ai),this.unwireEvents())},r.prototype.getTheme=function(t){return window.getComputedStyle(t,":after").getPropertyValue("content").replace(/['"]+/g,"")},r.prototype.initRender=function(){this.sliderContainer=this.createElement("div",{className:ri+" "+_e}),this.element.parentNode.insertBefore(this.sliderContainer,this.element),this.sliderContainer.appendChild(this.element),this.sliderTrack=this.createElement("div",{className:mi}),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*Math.random()).toFixed(0)+"slider",class:je}}),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],[ai]):E.addClass([this.sliderContainer],[ai]),this.readonly?E.addClass([this.sliderContainer],[Ri]):E.removeClass([this.sliderContainer],[Ri])},r.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},r.prototype.createRangeBar=function(){"Default"!==this.type&&(this.rangeBar=this.createElement("div",{attrs:{class:Ke}}),this.element.appendChild(this.rangeBar),this.drag)&&"Range"===this.type&&("Horizontal"===this.orientation?this.rangeBar.classList.add(zi):this.rangeBar.classList.add(Wi))},r.prototype.createLimitBar=function(){var t="Range"!==this.type?Fi:Mi;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:Di+" "+Vi}}),this.element.appendChild(this.limitBarSecond))},r.prototype.setOrientClass=function(){"Vertical"!==this.orientation?(this.sliderContainer.classList.remove(yi),this.sliderContainer.classList.add(bi),this.firstHandle.setAttribute("aria-orientation","horizontal"),"Range"===this.type&&this.secondHandle.setAttribute("aria-orientation","horizontal")):(this.sliderContainer.classList.remove(bi),this.sliderContainer.classList.add(yi),this.firstHandle.setAttribute("aria-orientation","vertical"),"Range"===this.type&&this.secondHandle.setAttribute("aria-orientation","vertical"))},r.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]})})},r.prototype.createSecondHandle=function(){this.secondHandle=this.createElement("div",{attrs:{class:Xe,role:"slider",tabIndex:"0","aria-label":"slider"}}),this.secondHandle.classList.add(ni),this.element.appendChild(this.secondHandle)},r.prototype.createFirstHandle=function(){this.firstHandle=this.createElement("div",{attrs:{class:Xe,role:"slider",tabIndex:"0","aria-label":"slider"}}),this.firstHandle.classList.add(si),this.element.appendChild(this.firstHandle),this.isMaterialTooltip&&(this.materialHandle=this.createElement("div",{attrs:{class:Xe+" "+Ni}}),this.element.appendChild(this.materialHandle))},r.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))},r.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))},r.prototype.handleStart=function(){"Range"!==this.type&&(this.firstHandle.classList[0===this.handlePos1?"add":"remove"](Ci),this.isMaterialTooltip)&&(this.materialHandle.classList[0===this.handlePos1?"add":"remove"](Ci),this.tooltipElement)&&this.tooltipElement.classList[0===this.handlePos1?"add":"remove"](Ei)},r.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())},r.prototype.handleFocusOut=function(){this.firstHandle.classList.contains(gi)&&this.firstHandle.classList.remove(gi),"Range"===this.type&&this.secondHandle.classList.contains(gi)&&this.secondHandle.classList.remove(gi)},r.prototype.handleFocus=function(t){this.focusSliderElement(),this.sliderBarClick(t),(t.currentTarget===this.firstHandle?(this.firstHandle.classList.add(gi),this.firstHandle):(this.secondHandle.classList.add(gi),this.secondHandle)).classList.add(a),E.EventHandler.add(document,"mousemove touchmove",this.sliderBarMove,this),E.EventHandler.add(document,"mouseup touchend",this.sliderBarUp,this)},r.prototype.handleOver=function(t){this.tooltip.isVisible&&"Hover"===this.tooltip.showOn&&this.tooltipToggle(t.currentTarget),"Default"===this.type&&this.tooltipToggle(this.getHandle())},r.prototype.handleLeave=function(t){!this.tooltip.isVisible||"Hover"!==this.tooltip.showOn||t.currentTarget.classList.contains(gi)||t.currentTarget.classList.contains(a)||this.closeTooltip()},r.prototype.setHandler=function(){this.createFirstHandle(),"Range"===this.type&&this.createSecondHandle()},r.prototype.setEnableRTL=function(){this.enableRtl&&"Vertical"!==this.orientation?E.addClass([this.sliderContainer],qe):E.removeClass([this.sliderContainer],qe);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()},r.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)},r.prototype.setTooltipContent=function(){var t=this.formatContent(this.tooltipFormatInfo,!1);this.tooltipObj.content=E.initializeCSPTemplate(function(){return t})},r.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},r.prototype.addTooltipClass=function(t){var e;this.isMaterialTooltip&&(t=t.toString().length,this.tooltipElement?(e=4<t?{oldCss:Bi,newCss:Hi}:{oldCss:Hi,newCss:Bi},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?Hi:Bi,this.tooltipObj.cssClass=ei+" "+e))},r.prototype.tooltipPlacement=function(){return"Horizontal"===this.orientation?"Before"===this.tooltip.placement?"TopCenter":"BottomCenter":"Before"===this.tooltip.placement?"LeftCenter":"RightCenter"},r.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())},r.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)}}},r.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)},r.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))},r.prototype.tooltipPositionCalculation=function(t){var e;switch(t){case"TopCenter":e=li;break;case"BottomCenter":e=oi;break;case"LeftCenter":e=hi;break;case"RightCenter":e=pi}return e},r.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===li?{rotate:"rotate(45deg)",translate:"translateY("+e+"px)"}:{rotate:"rotate(225deg)",translate:"translateY("+-e+"px)"}:t===hi?{rotate:"rotate(-45deg)",translate:"translateX("+e+"px)"}:{rotate:"rotate(-225deg)",translate:"translateX("+-e+"px)"}),e},r.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))},r.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))},r.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()},r.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)")},r.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:ei,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()},r.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(ci),this.tooltipValue(),this.tooltipObj.animation.close.effect="None",this.tooltipObj.open(this.firstHandle))},r.prototype.tooltipBeforeClose=function(){this.tooltipElement=void 0,this.tooltipCollidedPosition=void 0},r.prototype.setButtons=function(){this.firstBtn=this.createElement("div",{className:Ye+" "+Ze}),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:Ye+" "+Ge}),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(ki),this.sliderContainer.appendChild(this.firstBtn),this.sliderContainer.appendChild(this.secondBtn),this.sliderContainer.appendChild(this.element),this.buttonTitle()},r.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})},r.prototype.buttonFocusOut=function(){(this.isMaterial||this.isMaterial3)&&this.getHandle().classList.remove("e-large-thumb-size")},r.prototype.repeatButton=function(t){var e,i=this.handleValueUpdate(),s=this.enableRtl&&"Vertical"!==this.orientation;t.target.parentElement.classList.contains(Ze)||t.target.classList.contains(Ze)?e=s?this.add(i,parseFloat(this.step.toString()),!0):this.add(i,parseFloat(this.step.toString()),!1):(t.target.parentElement.classList.contains(Ge)||t.target.classList.contains(Ge))&&(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),this.tooltipToggle(this.getHandle()))},r.prototype.repeatHandlerMouse=function(t){t.preventDefault(),"mousedown"!==t.type&&"touchstart"!==t.type||(this.buttonClick(t),this.repeatInterval=setInterval(this.repeatButton.bind(this),180,t))},r.prototype.materialChange=function(){this.getHandle().classList.contains("e-large-thumb-size")||this.getHandle().classList.add("e-large-thumb-size")},r.prototype.focusHandle=function(){this.getHandle().classList.contains(a)||this.getHandle().classList.add(a)},r.prototype.repeatHandlerUp=function(t){this.changeEvent("changed",t),this.closeTooltip(),clearInterval(this.repeatInterval),this.getHandle().focus()},r.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},r.prototype.renderScale=function(){var t="Vertical"===this.orientation?"v":"h",e=(this.ul=this.createElement("ul",{className:Je+" e-"+t+"-scale "+$e+"-"+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,r=this.customTickCounter(a),l=!E.isNullOrUndefined(this.customValues)&&0<this.customValues.length?a*r+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/l;p===1/0&&(p=5);for(var u=0,d=!E.isNullOrUndefined(this.customValues)&&0<this.customValues.length?this.customValues.length-1:0,c=0;u<=l;u++){var m,v,f,g=this.createElement("li",{attrs:{class:$e,role:"presentation","aria-hidden":"true"}}),y=(!E.isNullOrUndefined(this.customValues)&&0<this.customValues.length?(m=u%(r+1)==0)&&("h"==t?(o=this.customValues[c],c++):(o=this.customValues[d],d--),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)?(f="h"==t?(o-parseFloat(this.min.toString()))%this.ticks.largeStep:Math.abs(o-parseFloat(this.max.toString()))%this.ticks.largeStep,Math.abs(f)<ze||Math.abs(this.ticks.largeStep-f)<ze):(v=this.ticks.largeStep,C=o,f="h"==t?(C-i)%v:Math.abs(C-parseFloat(s.toString()))%v,Math.abs(f)<ze||Math.abs(v-f)<ze)),m&&g.classList.add(Qe),"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)},r.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(Ti),this.lastChild.classList.add(Oi),this.sliderContainer.classList.add(Je+"-"+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()},r.prototype.createTick=function(t,e){var i=this.createElement("span",{className:ti+" "+$e+"-"+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()},r.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())})},r.prototype.scaleAlignment=function(){this.tickValuePosition(),"Vertical"===this.orientation?this.element.getBoundingClientRect().width<=15?this.sliderContainer.classList.add(xi):this.sliderContainer.classList.remove(xi):this.element.getBoundingClientRect().height<=15?this.sliderContainer.classList.add(xi):this.sliderContainer.classList.remove(xi)},r.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("."+$e+"."+Qe+" ."+ti)]),a="Both"===this.ticks.placement?[].slice.call(n[0],2):[].slice.call(n[0],1),r="Vertical"===this.orientation?2*i.height:2*i.width,l=0;l<this.firstChild.children.length;l++)"Vertical"===this.orientation?this.firstChild.children[l].style.top=-t.height/2+"px":this.enableRtl?this.firstChild.children[l].style.left=(r-this.firstChild.children[l].getBoundingClientRect().width)/2+"px":this.firstChild.children[l].style.left=-t.width/2+"px";for(l=0;l<a.length;l++)e=a[l].getBoundingClientRect(),"Vertical"===this.orientation?E.setStyleAttribute(a[l],{top:(r-e.height)/2+"px"}):E.setStyleAttribute(a[l],{left:(r-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(Oi),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(Oi),this.firstChild.style.left=this.firstHandle.style.left)),"Vertical"===this.orientation)&&this.firstChild.classList.remove(Oi)},r.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]})},r.prototype.handleValueUpdate=function(){var t="Range"!==this.type||1===this.activeHandle?this.handleVal1:this.handleVal2;return t},r.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]},r.prototype.focusSliderElement=function(){this.isElementFocused||(this.element.focus(),this.isElementFocused=!0)},r.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(Ze)?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(Ge)?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(Ze)?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(Ge)?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),!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(Ze)&&E.EventHandler.add(this.firstBtn,"mouseup touchend",this.buttonUp,this),t.currentTarget.classList.contains(Ge)&&E.EventHandler.add(this.secondBtn,"mouseup touchend",this.buttonUp,this)},r.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)},r.prototype.buttonUp=function(t){t.currentTarget.classList.contains(Ze)&&E.EventHandler.remove(this.firstBtn,"mouseup touchend",this.buttonUp),t.currentTarget.classList.contains(Ge)&&E.EventHandler.remove(this.secondBtn,"mouseup touchend",this.buttonUp)},r.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"}))},r.prototype.checkValidValueAndPos=function(t){return t=this.checkHandleValue(t),t=this.checkHandlePosition(t)},r.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"))},r.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))},r.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)]},r.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()},r.prototype.rangeValueUpdate=function(){null!==this.value&&"object"==typeof this.value||(this.value=[parseFloat(E.formatUnit(this.min)),parseFloat(E.formatUnit(this.max))])},r.prototype.validateRangeValue=function(){this.rangeValueUpdate(),this.setRangeValue()},r.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+"")},r.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)},r.prototype.getHandle=function(){return 1===this.activeHandle?this.firstHandle:this.secondHandle},r.prototype.setRangeValue=function(){this.updateRangeValue(),this.activeHandle=1,this.setHandlePosition(null),this.activeHandle=2,this.setHandlePosition(null),this.activeHandle=1},r.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()},r.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},r.prototype.setPreviousVal=function(t,e){"change"===t?this.previousVal=e:this.previousChanged=e},r.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)},r.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},r.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)},r.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()},r.prototype.changeHandleValue=function(t){var e=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&&(e=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&&(e=this.preHandlePos2=this.handlePos2)),this.modifyZindex(),null!==e&&("Default"!==this.type&&this.setRangeBar(),this.setHandlePosition(null))},r.prototype.tempStartEnd=function(){return this.min>this.max?{start:this.max,end:this.min}:{start:this.min,end:this.max}},r.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)},r.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},r.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},r.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)},r.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(Ai),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(Ai),this.handlePos1=this.preHandlePos1=i,this.handleVal1=s),this.modifyZindex(),this.firstHandle)).focus(),this.isMaterialTooltip&&this.tooltipElement.classList.add(di),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()},r.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)},r.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()},r.prototype.sliderBarUp=function(t){this.changeEvent("changed",t),this.handleFocusOut(),this.firstHandle.classList.remove(Ai),"Range"===this.type&&(this.initialTooltip=!1,this.secondHandle.classList.remove(Ai)),this.closeTooltip(),(this.isMaterial||this.isMaterial3)&&(this.getHandle().classList.remove("e-large-thumb-size"),this.isMaterialTooltip)&&this.tooltipElement.classList.remove(di),E.EventHandler.remove(document,"mousemove touchmove",this.sliderBarMove),E.EventHandler.remove(document,"mouseup touchend",this.sliderBarUp)},r.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(Ai)),"Range"===this.type&&(1===this.activeHandle?(this.firstHandle.classList.add(Ai),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(Ai),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()},r.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},r.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},r.prototype.refreshTooltip=function(t){this.tooltip.isVisible&&this.tooltipObj&&(this.tooltipValue(),t)&&(this.tooltipObj.refresh(t),this.tooltipTarget=t)},r.prototype.openTooltip=function(t){this.tooltip.isVisible&&this.tooltipObj&&!this.isMaterialTooltip&&(this.tooltipValue(),this.tooltipObj.open(t),this.tooltipTarget=t)},r.prototype.closeTooltip=function(){this.tooltip.isVisible&&this.tooltipObj&&"Always"!==this.tooltip.showOn&&!this.isMaterialTooltip&&(this.tooltipValue(),this.tooltipObj.close(),this.tooltipTarget=void 0)},r.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)}},r.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))},r.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))},r.prototype.elementClick=function(t){this.isDragComplete?this.isDragComplete=!1:(t.preventDefault(),this.focusSliderElement(),this.sliderBarClick(t),this.focusHandle())},r.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)},r.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)},r.prototype.formResetHandler=function(){this.setProperties({value:this.formResetValue},!0),this.setValue()},r.prototype.keyUp=function(t){var e;9===t.keyCode&&t.target.classList.contains(Xe)&&(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("."+mi).classList.add(wi),"Range"!==this.type&&"MinRange"!==this.type||e.querySelector("."+Ke).classList.add(Li)),"Range"===this.type&&((e=t.target.previousSibling)&&e.classList.contains(Xe)?this.activeHandle=2:this.activeHandle=1),this.getHandle().focus(),this.tooltipToggle(this.getHandle()))),this.closeTooltip(),this.changeEvent("changed",t)},r.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(ii):(this.sliderContainer.classList.remove(ii),t=t.currentTarget,this.tooltip.isVisible&&"Always"!==this.tooltip.showOn&&this.tooltipObj&&this.isMaterialTooltip&&!t.classList.contains(gi)&&!t.classList.contains(a)&&this.closeMaterialTooltip()))},r.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("."+wi)&&(this.element.querySelector("."+wi).classList.remove(wi),"Range"!==this.type&&"MinRange"!==this.type||!this.element.querySelector("."+Li)||this.element.querySelector("."+Li).classList.remove(Li)),this.hiddenInput.focus(),this.hiddenInput.blur(),this.isElementFocused=!1)},r.prototype.removeElement=function(t){t.parentNode&&t.parentNode.removeChild(t)},r.prototype.changeSliderType=function(t,e){this.isMaterialTooltip&&this.materialHandle&&(this.sliderContainer.classList.remove(ci),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(Ri),this.setReadOnly())},r.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"}))},r.prototype.changeOrientation=function(){this.changeSliderType(this.type,"null")},r.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()},r.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))},r.prototype.getPersistData=function(){return this.addOnPersist(["value"])},r.prototype.destroy=function(){De.prototype.destroy.call(this),this.unwireEvents(),window.removeEventListener("resize",this.onresize),E.removeClass([this.sliderContainer],[ai]),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},r.prototype.onPropertyChanged=function(t,e){for(var i=this,s=0,n=Object.keys(t);s<n.length;s++){var a,r=n[s];switch(r){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(r),this.showButtons)||this.wireEvents();break;case"type":E.isNullOrUndefined(e)||!Object.keys(e).length||E.isNullOrUndefined(e.type)||(this.changeSliderType(e.type,r),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("."+Je))||(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(ki),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()}}},r.prototype.setReadOnly=function(){this.readonly?(this.unwireEvents(),this.sliderContainer.classList.add(Ri)):(this.wireEvents(),this.sliderContainer.classList.remove(Ri))},r.prototype.setMinMaxValue=function(){var e=this;this.setValue(),this.refreshTooltip(this.tooltipTarget),E.isNullOrUndefined(this.sliderContainer.querySelector("."+Je))||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())},r.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+"")},r.prototype.setTooltip=function(t){this.changeSliderType(this.type,t)},r.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,r=0;r<this.colorRange.length;r++)E.isNullOrUndefined(this.colorRange[r].start)||E.isNullOrUndefined(this.colorRange[r].end)||this.colorRange[r].end>this.colorRange[r].start&&(this.colorRange[r].start<this.min&&(this.colorRange[r].start=this.min),this.colorRange[r].end>this.max&&(this.colorRange[r].end=this.max),s=this.checkHandlePosition(this.colorRange[r].start),n=this.checkHandlePosition(this.colorRange[r].end),(a=this.createElement("div")).style.backgroundColor=this.colorRange[r].color,a.style.border="1px solid "+this.colorRange[r].color,"Horizontal"===this.orientation?(e=vi,t=this.enableRtl?E.isNullOrUndefined(this.customValues)?this.checkHandlePosition(this.max)-this.checkHandlePosition(this.colorRange[r].end):this.checkHandlePosition(this.customValues.length-this.colorRange[r].end-1):this.checkHandlePosition(this.colorRange[r].start),a.style.width=n-s+"px",a.style.left=t+"px"):(e=fi,t=this.checkHandlePosition(this.colorRange[r].start),a.style.height=n-s+"px",a.style.bottom=t+"px"),a.classList.add(e),this.sliderTrack.appendChild(a))},r.prototype.getModuleName=function(){return"slider"},s([E.Property(null)],r.prototype,"value",void 0),s([E.Property(null)],r.prototype,"customValues",void 0),s([E.Property(1)],r.prototype,"step",void 0),s([E.Property(null)],r.prototype,"width",void 0),s([E.Property(0)],r.prototype,"min",void 0),s([E.Property(100)],r.prototype,"max",void 0),s([E.Property(!1)],r.prototype,"readonly",void 0),s([E.Property("Default")],r.prototype,"type",void 0),s([E.Collection([{}],He)],r.prototype,"colorRange",void 0),s([E.Complex({},Le)],r.prototype,"ticks",void 0),s([E.Complex({},Ie)],r.prototype,"limits",void 0),s([E.Property(!0)],r.prototype,"enabled",void 0),s([E.Complex({},Fe)],r.prototype,"tooltip",void 0),s([E.Property(!1)],r.prototype,"showButtons",void 0),s([E.Property(!0)],r.prototype,"enableAnimation",void 0),s([E.Property("Horizontal")],r.prototype,"orientation",void 0),s([E.Property("")],r.prototype,"cssClass",void 0),s([E.Property(!0)],r.prototype,"enableHtmlSanitizer",void 0),s([E.Event()],r.prototype,"created",void 0),s([E.Event()],r.prototype,"change",void 0),s([E.Event()],r.prototype,"changed",void 0),s([E.Event()],r.prototype,"renderingTicks",void 0),s([E.Event()],r.prototype,"renderedTicks",void 0),s([E.Event()],r.prototype,"tooltipChange",void 0),s([E.NotifyPropertyChanges],r));function r(t,e){t=De.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}ji=function(t,e){return(ji=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 ji,_i,Xi,t=function(t,e){function i(){this.constructor=t}ji(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,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},Ki={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}$")},Yi=((Yi=o.ErrorOption||(o.ErrorOption={}))[Yi.Message=0]="Message",Yi[Yi.Label=1]="Label",_i=E.Base,t(l,_i),(Xi=l).prototype.addRules=function(t,e){t&&(this.rules.hasOwnProperty(t)?E.extend(this.rules[""+t],e,{}):this.rules[""+t]=e)},l.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={}},l.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},l.prototype.reset=function(){this.element.reset(),this.clearForm()},l.prototype.getInputElement=function(t){return this.inputElement=E.select('[name="'+t+'"]',this.element),this.inputElement},l.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)}_i.prototype.destroy.call(this),this.infoElement=null,E.onIntlChange.off("notifyExternalChange",this.afterLocalization)},l.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)"locale"===s[i]&&this.localeFunc()},l.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}},l.prototype.getModuleName=function(){return"formvalidator"},l.prototype.afterLocalization=function(t){this.locale=t.locale,this.localeFunc()},l.prototype.refresh=function(){this.unwireEvents(),this.inputElements=E.selectAll(this.selectQuery,this.element),this.wireEvents()},l.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)}},l.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={},r=0,l=t;r<l.length;r++){var o=l[r];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)}},l.prototype.annotationRule=function(t,e,i,s){var n=i.split("-"),a=["required","creditcard","phone","maxlength","minlength","range","regex","equalto"],r=n[n.length-1],n=n[n.length-2];if(-1!==a.indexOf(r))switch(r){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 l=t.getAttribute("data-val-range-min"),o=t.getAttribute("data-val-range-max");this.defRule(t,e,"range",[l,o]);break;case"equalto":l=t.getAttribute(i).split(".");this.defRule(t,e,"equalTo",l[l.length-1]);break;case"regex":this.defRule(t,e,"regex",s)}},l.prototype.defRule=function(t,e,i,s){var n,a=t.getAttribute("data-"+i+"-message"),r=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]:r?s=[s,r]:n&&(s=[s,n]),e[""+i]=s},l.prototype.wireEvents=function(){for(var t=0,e=this.inputElements;t<e.length;t++){var i=e[t];Xi.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)},l.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)},l.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))},l.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)},l.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)},l.prototype.changeHandler=function(t){this.trigger("change",t);t=t.target;this.validate(t.name)},l.prototype.submitHandler=function(t){this.trigger("submit",t),this.allowSubmit||this.validate()?this.allowSubmit=!1:t.preventDefault()},l.prototype.resetHandler=function(){this.clearForm()},l.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 r=0,l=e;r<l.length;r++){var o=l[r],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 u=this.inputElement.parentElement,d=u.parentElement;(u.classList.contains("e-control-wrapper")||u.classList.contains("e-wrapper")||this.inputElement.classList.contains("e-input")&&u.classList.contains("e-input-group")?(u.classList.add(this.errorClass),u):null!=d&&(d.classList.contains("e-control-wrapper")||d.classList.contains("e-wrapper"))?(d.classList.add(this.errorClass),d):(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",(u.classList.contains("e-control-wrapper")||u.classList.contains("e-wrapper")||this.inputElement.classList.contains("e-input")&&u.classList.contains("e-input-group")?(u.classList.add(this.errorClass),u):null!=d&&(d.classList.contains("e-control-wrapper")||d.classList.contains("e-wrapper"))?(d.classList.add(this.errorClass),d):(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)}}}},l.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))},l.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}):Xi.isCheckable(this.inputElement)?"required"!==e||0<E.selectAll('input[name="'+t+'"]:checked',this.element).length:Xi.checkValidator[""+e](i))},l.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},l.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)},l.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},l.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)},l.prototype.showMessage=function(t){this.infoElement.style.display="block",this.infoElement.innerHTML=t.message,this.checkRequired(t.name)},l.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"))},l.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))},l.isCheckable=function(t){t=t.getAttribute("type");return t&&("checkbox"===t||"radio"===t||"submit"===t)},l.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 Ki.EMAIL.test(t.value)},url:function(t){return Ki.URL.test(t.value)},dateIso:function(t){return Ki.DATE_ISO.test(t.value)},tel:function(t){return Ki.PHONE.test(t.value)},creditcard:function(t){return Ki.CREDITCARD.test(t.value)},number:function(t){return!isNaN(Number(t.value))&&-1===String(t.value).indexOf(" ")},digits:function(t){return Ki.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("")],l.prototype,"locale",void 0),s([E.Property("e-hidden")],l.prototype,"ignore",void 0),s([E.Property()],l.prototype,"rules",void 0),s([E.Property("e-error")],l.prototype,"errorClass",void 0),s([E.Property("e-valid")],l.prototype,"validClass",void 0),s([E.Property("label")],l.prototype,"errorElement",void 0),s([E.Property("div")],l.prototype,"errorContainer",void 0),s([E.Property(o.ErrorOption.Label)],l.prototype,"errorOption",void 0),s([E.Event()],l.prototype,"focusout",void 0),s([E.Event()],l.prototype,"keyup",void 0),s([E.Event()],l.prototype,"click",void 0),s([E.Event()],l.prototype,"change",void 0),s([E.Event()],l.prototype,"submit",void 0),s([E.Event()],l.prototype,"validationBegin",void 0),s([E.Event()],l.prototype,"validationComplete",void 0),s([E.Event()],l.prototype,"customPlacement",void 0),Xi=s([E.NotifyPropertyChanges],l));function l(t,e){e=_i.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}Zi=function(t,e){return(Zi=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 Zi,Gi,t=function(t,e){function i(){this.constructor=t}Zi(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,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},Ji="e-file-select",$i="e-file-drop",Qi="e-upload-files",ts="e-upload-file-list",c="e-file-status",es="e-file-name",is="e-file-type",ss="e-file-size",m="e-file-remove-btn",d="e-file-delete-btn",ns="e-spinner-pane",v="e-file-abort-btn",as="e-file-reload-btn",rs="e-upload-drag-hover",ls="e-upload-progress-wrap",os="e-upload-progress-bar",hs="e-progress-bar-text",f="e-upload-progress",ps="e-upload-success",g="e-upload-fails",us="e-file-container",ds="e-validation-fails",cs="e-disabled",ms="e-rtl-container",vs="e-clear-icon-focus",y="e-file-pause-btn",fs="e-file-play-btn",gs="e-restrict-retry",ys=["title","style","class"],bs="e-form-upload",Cs="e-file-invalid",Es=(Gi=E.ChildProperty,t(Ss,Gi),s([E.Property("")],Ss.prototype,"name",void 0),s([E.Property(null)],Ss.prototype,"size",void 0),s([E.Property("")],Ss.prototype,"type",void 0),Ss);function Ss(){return null!==Gi&&Gi.apply(this,arguments)||this}xs=E.ChildProperty,t(Ts,xs),s([E.Property("Browse...")],Ts.prototype,"browse",void 0),s([E.Property("Upload")],Ts.prototype,"upload",void 0),s([E.Property("Clear")],Ts.prototype,"clear",void 0);var xs,Ps=Ts;function Ts(){return null!==xs&&xs.apply(this,arguments)||this}Os=E.ChildProperty,t(ws,Os),s([E.Property("")],ws.prototype,"saveUrl",void 0),s([E.Property("")],ws.prototype,"removeUrl",void 0),s([E.Property(0)],ws.prototype,"chunkSize",void 0),s([E.Property(3)],ws.prototype,"retryCount",void 0),s([E.Property(500)],ws.prototype,"retryAfterDelay",void 0);var Os,ks=ws;function ws(){return null!==Os&&Os.apply(this,arguments)||this}Ls=E.Component,t(C,Ls),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("."+$i))&&(this.uploadWrapper.querySelector("."+$i).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("."+Qi)))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(ps)&&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"))&&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:Ji});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("."+ds).length+this.uploadWrapper.querySelectorAll(".e-upload-fails:not(.e-upload-progress)").length+this.uploadWrapper.querySelectorAll("span."+ps).length+this.uploadWrapper.querySelectorAll("span."+f).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)}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:$i});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];ys.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<ys.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.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),E.EventHandler.add(document,"click",this.removeFocus,this),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),E.EventHandler.remove(document,"click",this.removeFocus),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(fs)?this.resumeUpload(this.getCurrentMetaData(null,t),t):s.classList.contains(as)?(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(v)||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,"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,r=0;r<t;r++)a+=+this.fileList[r].getAttribute("data-files-count");for(var l=a;l<a+n;l++)e.push(s[l]);return 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(v)&&!n?(s[0].statusCode="5",E.isNullOrUndefined(i)||(n=i.querySelector("."+v),h.createSpinner({target:n,width:"20px"}),h.showSpinner(n)),this.sequentialUpload&&this.uploadSequential(),i.classList.contains(gs)||this.checkActionComplete(!0)):E.closest(t.target,"."+ns)||this.remove(s,!1,!1,!0,t),this.isForm&&i&&i.classList.contains(Cs)&&(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")))},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="",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,r=new E.Ajax(this.asyncSettings.removeUrl,"POST",!0,null),l=(r.emitError=!1,new FormData);r.beforeSend=function(e){t.currentRequest=r.httpRequest,s?n.removingEventCallback(t,l,a,i):n.trigger("removing",t,function(t){t.cancel?e.cancel=!0:n.removingEventCallback(t,l,a,i)})},r.onLoad=function(t){return n.removeCompleted(t,a,e),{}},r.onError=function(t){return n.removeFailed(t,a,e),{}},r.send(l)},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("."+d))&&E.isNullOrUndefined(s.querySelector("."+m))||(s=s.querySelector("."+d)?s.querySelector("."+d):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")},i=(i||(i=this.filesData.indexOf(e),(i=this.fileList[i])&&(i.classList.remove(ps),i.classList.add(g),i=i.querySelector("."+c))&&(i.classList.remove(ps),i.classList.add(g)),this.checkActionButtonStatus()),this.trigger("failure",t),this.getLiElement(e));E.isNullOrUndefined(i)||E.isNullOrUndefined(i.querySelector("."+d))||(t=i.querySelector("."+d),h.hideSpinner(t),E.detach(i.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 r=[];this.multiple||(this.clearData(!0),e=[e[this.actionCompleteCount=0]]);for(var l=0;l<e.length;l++){var o=i?e[l].file:e[l];this.updateInitialFileDetails(t,e,o,l,r,i,s)}if(a.filesData=r,!E.isNullOrUndefined(this.allowedExtensions)&&-1<this.allowedExtensions.indexOf("*")&&(this.allTypes=!0),this.enableHtmlSanitizer)for(l=0;l<r.length;l++){for(var h=E.SanitizeHtmlHelper.beforeSanitize(),h=E.SanitizeHtmlHelper.serializeValue(h,r[parseInt(l.toString(),10)].name),p=r[parseInt(l.toString(),10)].name,u=!1,d=0;d<p.length;d++)if(127<p.charCodeAt(d)){u=!0;break}var c=/<([a-z][a-z0-9]*)\b[^>]*>(.*?)<\/\1>/i.test(p);h===r[parseInt(l.toString(),10)].name||u&&!c||(h=e[parseInt(l.toString(),10)].name.replace(/[\u00A0-\u9999<>\\&]/g,function(t){return"&#"+t.charCodeAt(0)+";"}),r[parseInt(l.toString(),10)].name=h,r[parseInt(l.toString(),10)].status=this.localizedTexts("invalidFileName"),r[parseInt(l.toString(),10)].statusCode="0")}this.allTypes||(r=this.checkExtension(r)),this.trigger("selected",a,function(t){n._internalRenderSelect(t,r)})}},C.prototype.updateInitialFileDetails=function(t,e,i,s,n,a,r){a={name:a?e[s].path.substring(1,e[s].path.length):r?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)};r&&(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){E.isNullOrUndefined(this.listParent)||(E.detach(this.listParent),this.listParent=null),"msie"===this.browserName||t||(this.element.value=""),this.fileList=[],this.filesData=[],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))}this.removeActionButtons();var a=[].slice.call(e.childNodes);this.createParentUL();for(var r=0;r<t.length;r++){for(var l=0;l<this.filesData.length;l++)this.filesData[l].name===t[r].name&&(this.listParent.appendChild(a[l]),E.EventHandler.add(a[l].querySelector(".e-icons"),"click",this.removeFiles,this),this.fileList.push(a[l]),i=r);i!==r&&this.internalCreateFileList([t[r]])}}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 r=0;r<t.length;r++){var l=-1!==t[r].type.indexOf(".")?t[r].type.replace(".",""):t[r].type;-1!==i[0].indexOf("/*")?this.checkGenericExtension(i[0],l)||(t[r].status=this.localizedTexts("invalidFileType"),t[r].statusCode="0"):-1===i.indexOf(("."+l).toLocaleLowerCase())&&(t[r].status=this.localizedTexts("invalidFileType"),t[r].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:ts,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)),r={element:n,fileInfo:s,index:a,isPreload:this.isPreLoadFile(s)},a={element:n,fileInfo:s,index:a,isPreload:this.isPreLoadFile(s)};this.trigger("rendering",r),this.trigger("fileListRendering",a),this.listParent.appendChild(n),this.fileList.push(n)}this.renderReactTemplates()},C.prototype.createParentUL=function(){E.isNullOrUndefined(this.listParent)&&(this.listParent=this.createElement("ul",{className:Qi}),this.uploadWrapper.appendChild(this.listParent))},C.prototype.formFileList=function(t,e){for(var i,s=this.createElement("li",{className:ts}),n=(s.setAttribute("data-files-count",t.length+""),this.createElement("span",{className:us})),a=0,r=t;a<r.length;a++){var l=r[a],o=this.createElement("span",{className:es}),h=(o.innerHTML=this.getFileNameOnly(l.name),this.createElement("span",{className:is})),p=this.getFileType(l.name);h.innerHTML="."+p,p||h.classList.add("e-hidden"),this.enableRtl?((p=this.createElement("span",{className:ms})).appendChild(h),p.appendChild(o),n.appendChild(p)):(n.appendChild(o),n.appendChild(h)),this.truncateName(o),i=this.formValidateFileInfo(l,s)}s.appendChild(n),this.setListToFileInfo(t,s);var u=this.listParent.querySelectorAll("li").length,d=this.createElement("span"),d=(s.classList.contains(Cs)?(d.classList.add(c),d.classList.add(Cs),d.innerText=1<t.length?this.localizedTexts("invalidFileSelection"):i):(d.classList.add(1<t.length?"e-file-information":ss),d.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(d),E.isNullOrUndefined(s.querySelector(".e-icons"))&&(d=this.createElement("span",{className:"e-icons",attrs:{tabindex:this.btnTabIndex}}),"msie"===this.browserName&&d.classList.add("e-msie"),d.setAttribute("title",this.localizedTexts("remove")),s.appendChild(n),s.appendChild(d),E.EventHandler.add(d,"click",this.removeFiles,this),d.classList.add(m)),{element:s,fileInfo:this.mergeFileInfo(t,s),index:u,isPreload:this.isPreLoadFile(this.mergeFileInfo(t,s))}),u={element:s,fileInfo:this.mergeFileInfo(t,s),index:u,isPreload:this.isPreLoadFile(this.mergeFileInfo(t,s))};this.trigger("rendering",d),this.trigger("fileListRendering",u),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(Cs)},C.prototype.createFormInput=function(t){if("safari"!==this.browserName){var e=this.element.cloneNode(!0);e.classList.add("e-hidden-file-input");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("."+Ji).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,r=t;a<r.length;a++){var l=r[a];s.push(l.name),n=l.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],r=a.status,l=this.validatedFileSize(a.size),l=(""===l.minSize&&""===l.maxSize||(i=!1,r=""!==l.minSize?this.localizedTexts("invalidMinFileSize"):""!==l.maxSize?this.localizedTexts("invalidMaxFileSize"):r),this.checkExtension(this.getFilesInArray(a))[0].status);l===this.localizedTexts("invalidFileType")&&(i=!1,r=l)}return r=i?this.localizedTexts("totalFiles")+": "+t.length+" , "+this.localizedTexts("size")+": "+this.bytesToSize(this.getFileSize(t)):(e.classList.add(Cs),1<t.length?this.localizedTexts("invalidFileSelection"):r)},C.prototype.formCustomFileList=function(t,e){this.createParentUL();var i=this.createElement("li",{className:ts}),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(Cs)||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(bs),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:ts,attrs:{"data-file-name":s.name,"data-files-count":"1"}}),a=this.createElement("span",{className:us}),r=this.createElement("span",{className:es,attrs:{title:s.name}}),l=(r.innerHTML=this.getFileNameOnly(s.name),this.createElement("span",{className:is})),o=this.getFileType(s.name),o=(l.innerHTML="."+o,o||l.classList.add("e-hidden"),this.enableRtl?((o=this.createElement("span",{className:ms})).appendChild(l),o.appendChild(r),a.appendChild(o)):(a.appendChild(r),a.appendChild(l)),this.createElement("span",{className:ss})),l=(o.innerHTML=this.bytesToSize(s.size),a.appendChild(o),this.createElement("span",{className:c})),o=(a.appendChild(l),l.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?(l.classList.add(ps),o.classList.add(d),o.setAttribute("title",this.localizedTexts("delete")),o.setAttribute("aria-label",this.localizedTexts("delete"))):"1"!==s.statusCode&&(l.classList.remove(ps),l.classList.add(ds)),this.autoUpload&&"1"===s.statusCode&&""!==this.asyncSettings.saveUrl&&(l.innerHTML=""),o.classList.contains(d)||(o.classList.add(m),o.setAttribute("aria-label",this.localizedTexts("remove"))),t.indexOf(s)),l={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",l),this.trigger("fileListRendering",o),this.listParent.appendChild(n),this.fileList.push(n),this.truncateName(r),this.flag);this.isPreLoadFile(s)&&(this.flag=!1,this.checkActionComplete(!0),this.flag=a)}else this.isFormUpload()?(this.uploadWrapper.classList.add(bs),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(ps))&&(this.showFileList||"File uploaded successfully"===t[s].status)||i.push(t[s]);return 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)),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:ls}),i=this.createElement("progressbar",{className:os,attrs:{value:"0",max:"100"}}),s=this.createElement("span",{className:"e-progress-inner-wrap"}),n=(i.setAttribute("style","width: 0%"),this.createElement("span",{className:hs}));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("."+os))||!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("."+os).setAttribute("style","width:"+e),t.querySelector("."+hs).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("."+ls).length||!n.querySelector("."+c)||(n.querySelector("."+c).classList.add(f),this.createProgressBar(n),this.updateProgressBarClasses(n,f),n.querySelector("."+c).classList.remove(g)),this.updateProgressbar(t,n),i=n.querySelector("."+m),E.isNullOrUndefined(i)||(i.classList.add(v,f),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,r){var l=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(r)||(t=r.querySelector("."+v),E.isNullOrUndefined(t))||(h.hideSpinner(t),E.detach(r.querySelector(".e-spinner-pane")))):(a.emitError=!1,a.httpRequest.abort(),t=new FormData,"5"===n.statusCode&&(i=l.element.getAttribute("name"),t.append(i,n.name),t.append("cancel-uploading",n.name),l.updateFormData(t,e.customFormData),(s=new E.Ajax(l.asyncSettings.removeUrl,"POST",!0,null)).emitError=!1,s.beforeSend=function(t){e.currentRequest&&l.updateCustomheader(s.httpRequest,e.currentRequest)},s.onLoad=function(t){return l.removecanceledFile(t,n),{}},s.send(t)))})},C.prototype.removecanceledFile=function(t,e){var i,s=this.getLiElement(e);E.isNullOrUndefined(s)||s.querySelector("."+as)||E.isNullOrUndefined(s.querySelector("."+v))||(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("."+v));E.isNullOrUndefined(n)||(n.classList.remove(v,f),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("."+as).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("."+as))||E.detach(i.querySelector("."+as)),this.pauseButton=null),E.isNullOrUndefined(i)||i.classList.add(gs),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,ps),this.removeProgressbar(s,"success"),i=s.querySelector("."+v),E.isNullOrUndefined(i))||(i.classList.add(d),i.setAttribute("title",this.localizedTexts("delete")),i.setAttribute("aria-label",this.localizedTexts("delete")),i.classList.remove(v),i.classList.remove(f)),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("."+ns),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(gs)?i.getLiElement(e).classList.remove(gs):(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("."+os);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("."+ls))||(this.progressAnimation=new E.Animation({duration:1250}),this.progressAnimation.animate(t.querySelector("."+ls),{name:"FadeOut"}),this.progressAnimation.animate(t.querySelector("."+hs),{name:"FadeOut"}),setTimeout(function(){i.animateProgressBar(t,e)},750))},C.prototype.animateProgressBar=function(t,e){"success"===e?(t.classList.add(ps),E.isNullOrUndefined(t.querySelector("."+c))||(t.querySelector("."+c).classList.remove(f),this.progressAnimation.animate(t.querySelector("."+c),{name:"FadeIn"}),t.querySelector("."+c).classList.add(ps))):E.isNullOrUndefined(t.querySelector("."+c))||(t.querySelector("."+c).classList.remove(f),this.progressAnimation.animate(t.querySelector("."+c),{name:"FadeIn"}),t.querySelector("."+c).classList.add(g)),t.querySelector("."+ls)&&E.detach(t.querySelector("."+ls))},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(cs)&&this.uploadWrapper.classList.remove(cs),!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(cs),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,r=i.rawFile.slice(s.start,s.end),r=(a.append(this.uploaderName,r,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)),l=(a.append("total-chunk",r.toString()),a.append("totalChunk",r.toString()),new E.Ajax({url:this.asyncSettings.saveUrl,type:"POST",async:!0,contentType:null})),o=(l.emitError=!1,l.onLoad=function(t){return n.chunkUploadComplete(t,s,e),{}},l.onUploadProgress=function(t){return n.chunkUploadInProgress(t,s,e),{}},{fileData:i,customFormData:[],cancel:!1,chunkSize:0===this.asyncSettings.chunkSize?null:this.asyncSettings.chunkSize});l.beforeSend=function(e){o.currentRequest=l.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)})},l.onError=function(t){return n.chunkUploadFailed(t,s,e),{}},l.send(a),s.request=l},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())},C.prototype.checkChunkUpload=function(){return!(this.asyncSettings.chunkSize<=0||E.isNullOrUndefined(this.asyncSettings.chunkSize))},C.prototype.chunkUploadComplete=function(t,s,n){var a,e,i,r=this,l=t.target;4===l.readyState&&200<=l.status&&l.status<300?(i=t&&t.currentTarget?this.getResponse(t):null,e=Math.max(Math.ceil(s.file.size/this.asyncSettings.chunkSize),1),i={event:t,file:s.file,chunkIndex:s.chunkIndex,totalChunk:e,chunkSize:this.asyncSettings.chunkSize,response:i},this.trigger("chunkSuccess",i),!E.isNullOrUndefined(n)&&n||(a=this.getLiElement(s.file)),this.updateMetaData(s),s.end===s.file.size&&(s.file.statusCode="3"),"5"===s.file.statusCode?(i={event:t,fileData:s.file,cancel:!1,customFormData:[]},this.trigger("canceling",i,function(t){var e,i;t.cancel?(s.file.statusCode="3",e=a.querySelector("."+v),E.isNullOrUndefined(a)||E.isNullOrUndefined(e)||(h.hideSpinner(e),E.detach(a.querySelector(".e-spinner-pane"))),r.sendNextRequest(s)):(s.request.emitError=!1,l.abort(),e=new FormData,i=r.element.getAttribute("name"),e.append(i,s.file.name),e.append("cancel-uploading",s.file.name),e.append("cancelUploading",s.file.name),r.updateFormData(e,t.customFormData),(i=new E.Ajax(r.asyncSettings.removeUrl,"POST",!0,null)).emitError=!1,i.onLoad=function(t){return r.removeChunkFile(t,s,n),{}},i.send(e))})):e-1===s.chunkIndex&&e>s.chunkIndex?(0<=(i=this.pausedData.indexOf(s))&&this.pausedData.splice(i,1),E.isNullOrUndefined(this.template)&&(E.isNullOrUndefined(n)||!n)&&a&&(a&&!E.isNullOrUndefined(a.querySelector("."+y))&&E.detach(a.querySelector("."+y)),this.removeChunkProgressBar(s)),this.raiseSuccessEvent(t,s.file)):"4"!==s.file.statusCode&&this.sendNextRequest(s)):this.chunkUploadFailed(t,s)},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("."+v),this.updateStatus(e.file,this.localizedTexts("fileUploadCancel"),"5"),this.updateProgressBarClasses(i,g),this.removeProgressbar(i,"failure"),s&&(s.classList.remove(v),s.classList.add(m),s.setAttribute("title",this.localizedTexts("remove"))),(e=i.querySelector("."+y))&&(e.classList.add(as),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(fs),e.setAttribute("title",this.localizedTexts("resume")),e.nextElementSibling.classList.add(m),e.nextElementSibling.classList.remove(v),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("."+fs)),E.isNullOrUndefined(s)||!E.isNullOrUndefined(i)&&i||(s.classList.remove(fs),s.classList.add(y),s.setAttribute("title",this.localizedTexts("pause")),s.nextElementSibling.classList.remove(m),s.nextElementSibling.classList.add(v),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,ps),this.removeProgressbar(t,"success"),t=t.querySelector("."+v),E.isNullOrUndefined(t))||(t.classList.add(d),t.setAttribute("title",this.localizedTexts("delete")),t.classList.remove(v,f))},C.prototype.chunkUploadFailed=function(i,s,n){var a,r=this,t=Math.max(Math.ceil(s.file.size/this.asyncSettings.chunkSize),1),l=(!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:l};this.trigger("chunkFailure",t,function(t){var e;t.cancel||(s.retryCount<r.asyncSettings.retryCount?setTimeout(function(){r.retryRequest(a,s,n)},r.asyncSettings.retryAfterDelay):(E.isNullOrUndefined(a)||(t=a.querySelector("."+y)?a.querySelector("."+y):a.querySelector("."+fs),E.isNullOrUndefined(t)||(t.classList.add(as),t.classList.remove(y,fs)),r.updateProgressBarClasses(a,g),r.removeProgressbar(a,"failure"),a.querySelector(".e-icons").classList.remove(f),(t=a.querySelector("."+v)?a.querySelector("."+v):a.querySelector("."+m)).classList.remove(v),E.isNullOrUndefined(a.querySelector("."+y))||E.detach(a.querySelector("."+y)),0<s.start?(t.classList.add(d),t.setAttribute("title",r.localizedTexts("delete"))):(t.classList.add(m),t.setAttribute("title",r.localizedTexts("remove")))),s.retryCount=0,e=s.file,t=r.localizedTexts("uploadFailedMessage"),t={e:i,response:l,operation:"upload",file:r.updateStatus(e,t,"0",!1),statusText:t},r.trigger("failure",t,function(t){r.updateStatus(e,t.statusText,"0"),r.uploadSequential(),r.checkActionComplete(!0)})))})},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(fs)?this.resumeUpload(i,t):e.classList.contains(as)&&(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(gs)},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("."+as),E.isNullOrUndefined(n)||(n.classList.add(y),n.setAttribute("title",this.localizedTexts("pause")),n.classList.remove(as)),E.isNullOrUndefined(s)||(0<s.querySelectorAll("."+ls).length||(n=s.querySelector("."+c),E.isNullOrUndefined(this.template)&&(n.classList.add(f),n.classList.remove(g),this.createProgressBar(s),this.updateProgressBarClasses(s,f)),n=s.querySelector("."+m)?s.querySelector("."+m):s.querySelector("."+d),E.isNullOrUndefined(n))||(n.classList.add(v),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("."+d))&&(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("."+v)).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,r=i.sort();a<r.length;a++)for(var l=r[a],s=0;s<e.length;s++)l===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.uploadWrapper=null,this.uploadWrapper=null,this.browseButton=null,this.dropAreaWrapper=null,this.dropZoneElement=null,this.dropArea=null,this.keyboardModule=null,this.clearButton=null,this.uploadButton=null,Ls.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,r,l){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(r,r+l))}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(),r=new E.Ajax(this.asyncSettings.saveUrl,"POST",!0,null),l=(r.emitError=!1,{fileData:i[s],customFormData:[],cancel:!1}),o=new FormData;r.beforeSend=function(e){l.currentRequest=r.httpRequest,n.trigger("uploading",l,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):(r.onLoad=function(t){return l.cancel||n.uploadComplete(t,i[s],e),{}},r.onUploadProgress=function(t){return l.cancel||n.uploadInProgress(t,i[s],e,r),{}},r.onError=function(t){return n.uploadFailed(t,i[s]),{}},r.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(r,a,l,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=r,h.trigger("removing",p,function(t){if(!t.cancel)for(var e=!1,i=void 0,s=0,n=h.getFilesInArray(r);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=((r=E.isNullOrUndefined(r)?h.filesData:r)instanceof Array?t=r:t.push(r),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,l,a):l?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("."+v),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({},Ps)],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([{}],Es)],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 Ls,t=s([E.NotifyPropertyChanges],C);function C(t,e){e=Ls.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}As=function(t,e){return(As=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 As,Ns,s=function(t,e){function i(){this.constructor=t}As(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,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},Hs="e-apply",Bs="e-cancel",Us="e-current",Is="e-ctrl-btn",Rs="e-switch-ctrl-btn",Vs="e-disabled",Fs="e-value-switch-btn",Ms="e-handler",Ds="e-hide-hex-value",zs="e-hide-opacity",Ws="e-hide-switchable-value",qs="e-hide-value",js="e-hide-valueswitcher",_s="e-hsv-color",Xs="e-hsv-container",Ks="e-selected-value",Ys="e-mode-switch-btn",Zs="e-nocolor-item",Gs="e-opacity-value",Js="e-palette",$s="e-color-palette",Qs="e-color-picker",tn="e-preview-container",en="e-previous",sn="e-show-value",nn="e-selected",an="e-split-preview",rn="e-tile",ln=["#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=(Ns=E.Component,s(x,Ns),x.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"},this.locale),t.getAttribute("ejs-for")&&!t.getAttribute("name")&&t.setAttribute("name",t.id)},x.prototype.render=function(){this.initWrapper(),this.inline?this.createWidget():this.createSplitBtn(),this.enableOpacity||E.addClass([this.container.parentElement],zs),this.renderComplete()},x.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:"."+rn}),this.ctrlBtnRipple=E.rippleEffect(this.container,{selector:".e-btn"})},x.prototype.getWrapper=function(){return this.element.parentElement},x.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()},x.prototype.createSplitBtn=function(){var e=this,t=this.createElement("button",{className:"e-split-colorpicker"}),i=(this.getWrapper().appendChild(t),this.splitBtn=new R.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.splitBtn.appendTo(t),this.splitBtn.element.setAttribute("aria-label","colorpicker"),this.createElement("span",{className:an})),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()},x.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"))},x.prototype.getPopupInst=function(){return E.getInstance(this.getPopupEle(),h.Popup)},x.prototype.bindCallBackEvent=function(){var a=this;this.splitBtn.beforeOpen=function(s){var n=new R.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",document.body.insertBefore(a.modal,e),document.body.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 R.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}},x.prototype.onPopupClose=function(){this.unWireEvents(),this.destroyOtherComp(),this.container.style.width="",E.select("."+an,this.splitBtn.element).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value)),this.container.innerHTML="",E.removeClass([this.container],[Qs,$s]),E.Browser.isDevice&&this.modal&&(E.removeClass([document.body],"e-colorpicker-overflow"),this.modal.style.display="none",this.modal.outerHTML="",this.modal=null)},x.prototype.createPalette=function(){if(E.classList(this.container,[$s],[Qs]),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(ln,"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)},x.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)}},x.prototype.firstPaletteFocus=function(){E.select("."+nn,this.container.children[0])||E.selectAll("."+Js,this.container)[0].focus()},x.prototype.appendPalette=function(t,e,i){var s,n,a,r=this.createElement("div",{className:Js,attrs:{tabindex:"0",role:"grid"}});"recent-color"===e&&r.classList.add("e-recent-palette"),i?i.appendChild(r):this.appendElement(r);for(var l=0,o=t.length;l<o;l++)0!==l&&l%this.columns!=0||(s=this.createElement("div",{className:"e-row",attrs:{role:"row"}}),r.appendChild(s)),a=this.roundValue(t[l]).toLowerCase(),n=this.createElement("span",{className:rn,attrs:{role:"gridcell","aria-label":a,"aria-selected":"false"}}),this.trigger("beforeTileRender",{element:n,presetName:e,value:t[l]}),s.appendChild(n),this.value===a&&"recent-color"!==e&&(this.addTileSelection(n),r.focus()),n.style.backgroundColor=this.convertToRgbString(this.hexToRgb(a))},x.prototype.setNoColor=function(){var e=this.container.querySelector(".e-row").children[0];e.classList.add(Zs),this.value||(e.classList.add(nn),E.closest(e,"."+Js).focus()),["aria-selected","aria-label"].forEach(function(t){e.removeAttribute(t)}),e.style.backgroundColor=""},x.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)},x.prototype.addTileSelection=function(t){t&&(t.classList.add(nn),t.setAttribute("aria-selected","true"))},x.prototype.createPicker=function(){E.classList(this.container,[Qs],[$s]);var t=this.createElement("div",{className:Xs}),e=(this.appendElement(t),t.appendChild(this.createElement("div",{className:_s})),this.createElement("span",{className:Ms,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()},x.prototype.setHsvContainerBg=function(t){void 0===t&&(t=this.hsv[0]),this.getHsvContainer().style.backgroundColor=this.convertToRgbString(this.hsvToRgb(t,100,100,1))},x.prototype.getHsvContainer=function(){return E.select("."+Xs,this.container)},x.prototype.setHandlerPosition=function(){var t=this.getDragHandler(),e=E.select("."+_s,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)},x.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 qi({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))},x.prototype.createOpacitySlider=function(t){this.opacitySlider=new qi({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()},x.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%)")},x.prototype.hueChange=function(t){this.hsv[0]=t.value,this.setHsvContainerBg(),this.convertToOtherFormat()},x.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)},x.prototype.updateOpacityInput=function(t){var e;this.enableOpacity&&!this.getWrapper().classList.contains(qs)&&((e=E.getInstance(E.select("."+Gs,this.container),Bt)).value=t,e.dataBind())},x.prototype.createPreview=function(t){var e=this.createElement("div",{className:tn}),t=(t.appendChild(e),this.createElement("span",{className:"e-preview "+Us})),i=(e.appendChild(t),this.convertToRgbString(this.rgb));t.style.backgroundColor=i,t=this.createElement("span",{className:"e-preview "+en}),e.appendChild(t),t.style.backgroundColor=i},x.prototype.isPicker=function(){return!this.container.classList.contains($s)},x.prototype.getPopupEle=function(){return this.container.parentElement},x.prototype.createNumericInput=function(t,e,i,s){var n=this,e=new Bt({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)},x.prototype.createInput=function(){var t=this.isPicker(),e=this.getWrapper();if(t&&!e.classList.contains(qs)||!t&&e.classList.contains(sn)){var i=this.createElement("div",{className:Ks}),s=(t?this.appendElement(i,2):this.appendElement(i,1),this.createElement("div",{className:"e-input-container"}));if(i.appendChild(s),e.classList.contains(js)||this.appendValueSwitchBtn(i),e.classList.contains(Ds)||(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(Ws)){for(var n=void 0,a=void 0,a=this.isRgb?(n="RGB",this.rgb):(n="HSV",this.hsv),r=["rh","gs","bv"],l=0;l<3;l++)this.createNumericInput(s.appendChild(this.createElement("input",{className:"e-"+r[l]+"-value"})),a[l],n[l],255);this.enableOpacity&&this.appendOpacityValue(s)}}},x.prototype.appendOpacityValue=function(t){this.createNumericInput(t.appendChild(this.createElement("input",{className:Gs})),100*this.rgb[3],"A",100)},x.prototype.appendValueSwitchBtn=function(t){var e=this.createElement("button",{className:"e-icons e-css e-btn e-flat e-icon-btn "+Fs,attrs:{title:"Toggle format"}});t.appendChild(e),this.isPicker()&&!this.getWrapper().classList.contains(Ws)&&e.addEventListener("click",this.formatSwitchHandler.bind(this))},x.prototype.createCtrlBtn=function(){var t,e;(this.modeSwitcher||this.showButtons)&&(this.l10n.setLocale(this.locale),e=this.createElement("div",{className:Rs}),this.container.appendChild(e),this.showButtons&&(t=this.createElement("div",{className:Is}),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 "+Hs,attrs:{title:e}})),e=this.l10n.getConstant("Cancel"),t.appendChild(this.createElement("button",{innerHTML:e,className:"e-btn e-css e-flat e-small "+Bs,attrs:{title:e}}))),this.modeSwitcher)&&this.appendModeSwitchBtn()},x.prototype.appendModeSwitchBtn=function(){var t=this.createElement("button",{className:"e-icons e-btn e-flat e-icon-btn "+Ys,attrs:{title:this.l10n.getConstant("ModeSwitcher")}});E.select("."+Rs,this.container).insertBefore(t,E.select("."+Is,this.container))},x.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"}))},x.prototype.getTooltipInst=function(){return E.getInstance(this.container,h.Tooltip)},x.prototype.setTooltipOffset=function(t){this.getTooltipInst().offsetY=t},x.prototype.toggleDisabled=function(e){e?this.getWrapper().classList.add(Vs):this.getWrapper().classList.remove(Vs),this.showButtons&&[].slice.call(E.selectAll(".e-btn",this.container)).forEach(function(t){e?E.attributes(t,{disabled:""}):t.removeAttribute("disabled")})},x.prototype.convertToRgbString=function(t){return t.length?4===t.length?"rgba("+t.join()+")":"rgb("+t.join()+")":""},x.prototype.convertToHsvString=function(t){return 4===t.length?"hsva("+t.join()+")":"hsv("+t.join()+")"},x.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()},x.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)},x.prototype.updateInput=function(t){var e=this.getWrapper();e.classList.contains(qs)||(e.classList.contains(Ds)||o.Input.setValue(t.substr(0,7),E.select(".e-hex",this.container)),e.classList.contains(Ws))||(this.isRgb?this.updateValue(this.rgb,!1):this.updateValue(this.hsv,!1))},x.prototype.updatePreview=function(t){this.enableOpacity&&this.updateOpacitySliderBg(),E.select(".e-tip-transparent",this.tooltipEle).style.backgroundColor=t,E.select("."+tn+" ."+Us,this.container).style.backgroundColor=t,E.select("."+tn+" ."+en,this.container).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value))},x.prototype.getDragHandler=function(){return E.select("."+Ms,this.container)},x.prototype.removeTileSelection=function(){[].slice.call(E.selectAll("."+nn,this.container)).forEach(function(t){t.classList.remove(nn),t.setAttribute("aria-selected","false")})},x.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)})},x.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")},x.prototype.toggle=function(){this.container.parentElement.classList.contains("e-popup-close")?this.splitBtn.toggle():this.closePopup(null)},x.prototype.getModuleName=function(){return"colorpicker"},x.prototype.getPersistData=function(){return this.addOnPersist(["value"])},x.prototype.wireEvents=function(){var t;this.isPicker()?(t=this.getDragHandler(),E.EventHandler.add(t,"keydown",this.pickerKeyDown,this),(t=E.select("."+Is,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("."+en,this.container),"click",this.previewHandler,this)):(E.EventHandler.add(this.container,"click",this.paletteClickHandler,this),E.EventHandler.add(this.container,"keydown",this.paletteKeyDown,this))},x.prototype.formResetHandler=function(){this.value=this.initialInputValue,E.attributes(this.element,{value:this.initialInputValue})},x.prototype.addCtrlSwitchEvent=function(){var t=E.select("."+Rs,this.container);t&&E.EventHandler.add(t,"click",this.btnClickHandler,this)},x.prototype.ctrlBtnKeyDown=function(t){13===t.keyCode&&(E.select("."+Hs,this.container)&&(t=this.rgbToHex(this.rgb),this.triggerChangeEvent(t)),this.splitBtn.element.focus())},x.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)}},x.prototype.enterKeyHandler=function(t){this.triggerChangeEvent(t),this.inline||this.splitBtn.element.focus()},x.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())})},x.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"},x.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)},x.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)},x.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("."+_s,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"))},x.prototype.setHsv=function(t,e){var i=E.select("."+_s,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},x.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("."+_s,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)},x.prototype.btnClickHandler=function(t){var e=t.target;E.closest(e,"."+Ys)?(t.stopPropagation(),this.switchToPalette()):(e.classList.contains(Hs)||e.classList.contains(Bs))&&this.ctrlBtnClick(e,t)},x.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(qs)||E.remove(E.select("."+Ks,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"})},x.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)},x.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))},x.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)},x.prototype.updateValue=function(t,e,i,s){for(var n,a=["e-rh-value","e-gs-value","e-bv-value"],r=0,l=a.length;r<l;r++)(n=E.getInstance(E.select("."+a[r],this.container),Bt)).value=Math.round(t[r]),e&&(n.placeholder=a[r].substr(i,1).toUpperCase(),n.max=s?s[r]:255),n.dataBind()},x.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("."+tn+" ."+Us,this.container).style.backgroundColor=this.convertToRgbString(this.rgb),this.triggerEvent(e,i,this.convertToRgbString(this.rgb),!1,t)},x.prototype.paletteClickHandler=function(t){t.preventDefault();var e,i,s=t.target;s.classList.contains(rn)?(this.removeTileSelection(),this.addTileSelection(s),s.classList.contains(Zs)?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(sn)&&this.updateInput(e),this.triggerEvent(e,i,this.convertToRgbString(this.rgb),!1,t)),this.inline||this.showButtons||this.closePopup(t)):E.closest(s,"."+Ys)?this.switchToPicker():s.classList.contains(Hs)||s.classList.contains(Bs)?this.ctrlBtnClick(s,t):this.getWrapper().classList.contains(sn)&&E.closest(s,"."+Fs)&&this.formatSwitchHandler()},x.prototype.noColorTile=function(t){void 0===t&&(t=!1);var e=this.rgbToHex(this.rgb);this.rgb=[],this.hsv=[],this.triggerEvent("",e,"",t)},x.prototype.switchToPicker=function(){var t=this.getWrapper(),t=(this.trigger("beforeModeSwitch",{element:this.container,mode:"Picker"}),this.unWireEvents(),[].slice.call(E.selectAll("."+Js,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(sn)&&E.detach(E.select("."+Ks,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"})},x.prototype.ctrlBtnClick=function(t,e){var i;t.classList.contains(Hs)&&(i=this.rgbToHex(this.rgb),this.triggerChangeEvent(i,e)),this.inline?t.classList.contains(Bs)&&(i={element:this.container,event:e,cancel:!1},this.trigger("beforeClose",i)):(this.closePopup(e),this.splitBtn.element.focus())},x.prototype.paletteKeyDown=function(t){var e=t.target;if(e.classList.contains(Js)){var i,s,n=[].slice.call(E.selectAll("."+rn,e)),a=n.filter(function(t){return t.classList.contains("e-selected")}).pop();switch(!t.altKey&&t.keyCode){case 39:t.preventDefault(),i=a?n[this.tilePosition(n,a,this.enableRtl?-1:1)]:n[this.enableRtl?n.length-1:0],this.keySelectionChanges(i);break;case 37:t.preventDefault(),i=a?n[this.tilePosition(n,a,this.enableRtl?1:-1)]:n[this.enableRtl?0:n.length-1],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||""))}}},x.prototype.keySelectionChanges=function(t){var e;this.removeTileSelection(),this.addTileSelection(t),t.classList.contains(Zs)?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(sn)&&this.updateInput(t),this.triggerEvent(t,e,this.convertToRgbString(this.rgb),!0))},x.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},x.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)}},x.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)},x.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")},x.prototype.destroy=function(){var e=this,t=this.getWrapper();Ns.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()),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)},x.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],Bt).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}},x.prototype.isPopupOpen=function(){return this.getPopupEle().classList.contains("e-popup-open")},x.prototype.unWireEvents=function(){var t;this.isPicker()?(t=this.getDragHandler(),E.EventHandler.remove(t,"keydown",this.pickerKeyDown),(t=E.select("."+Is,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("."+Rs,this.container),"click",this.btnClickHandler),E.EventHandler.remove(E.select("."+en,this.container),"click",this.previewHandler)):(E.EventHandler.remove(this.container,"click",this.paletteClickHandler),E.EventHandler.remove(this.container,"keydown",this.paletteKeyDown))},x.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},x.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},x.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),r=Math.min(t,e,i),l=a,o=a-r,h=0===a?0:o/a;if(a===r)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}r=[Math.round(360*n),Math.round(1e3*h)/10,Math.round(1e3*l)/10];return E.isNullOrUndefined(s)||r.push(s),r},x.prototype.hsvToRgb=function(t,e,i,s){var n,a,r;if(i/=100,0===(e/=100))return n=a=r=i,[Math.round(255*n),Math.round(255*a),Math.round(255*r),s];t/=60;var l=Math.floor(t),t=t-l,o=i*(1-e),h=i*(1-e*t),p=i*(1-e*(1-t));switch(l){case 0:n=i,a=p,r=o;break;case 1:n=h,a=i,r=o;break;case 2:n=o,a=i,r=p;break;case 3:n=o,a=h,r=i;break;case 4:n=p,a=o,r=i;break;default:n=i,a=o,r=h}e=[Math.round(255*n),Math.round(255*a),Math.round(255*r)];return E.isNullOrUndefined(s)||e.push(s),e},x.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"):""},x.prototype.hex=function(t){return("0"+t.toString(16)).slice(-2)},x.prototype.changeModeSwitcherProp=function(t){var e=E.select("."+Rs,this.container);t?e?this.appendModeSwitchBtn():(this.createCtrlBtn(),this.isPicker()&&!this.disabled&&this.addCtrlSwitchEvent()):e&&(this.showButtons?E.detach(E.select("."+Ys,e)):E.remove(e))},x.prototype.changeShowBtnProps=function(t){var e=E.select("."+Rs,this.container);t?(e&&E.remove(e),this.createCtrlBtn(),this.isPicker()&&!this.disabled&&this.addCtrlSwitchEvent()):this.modeSwitcher?E.detach(E.select("."+Is,e)):E.remove(e)},x.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))},x.prototype.setInputEleProps=function(){E.remove(E.select("."+Ks,this.container)),this.createInput()},x.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())},x.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(" "))},x.prototype.changeRtlProps=function(t){t?E.addClass([this.getWrapper()],"e-rtl"):E.removeClass([this.getWrapper()],"e-rtl")},x.prototype.changePaletteProps=function(){E.detach(this.container.children[0]),this.container.style.width="",this.createPalette()},x.prototype.changeOpacityProps=function(t){var e=this.getWrapper();t?(E.removeClass([this.container.parentElement],zs),this.createOpacitySlider(E.select(".e-colorpicker-slider",this.container).appendChild(this.createElement("div",{className:"e-opacity-slider"}))),e.classList.contains(qs)||e.classList.contains(Ws)||this.appendOpacityValue(E.select(".e-input-container",this.container))):(E.addClass([this.container.parentElement],zs),this.opacitySlider.destroy(),E.remove(this.opacitySlider.element),this.opacitySlider=null,e.classList.contains(qs)||e.classList.contains(Ws)||E.remove(E.select("."+Gs,this.container).parentElement))},x.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("."+an,this.splitBtn.element))&&(e.style.backgroundColor=this.convertToRgbString(this.hexToRgb(s.value)))):this.noColor&&"Palette"===this.mode&&""===this.value?(e=this.splitBtn&&E.select("."+an,this.splitBtn.element)).style.backgroundColor="":this.value=n.value),!this.inline&&E.isNullOrUndefined(s.inline))if(this.splitBtn.setProperties(R.getModel(s,["disabled","enableRtl"])),!this.isPopupOpen())return this.changeCssClassProps(s.cssClass,n.cssClass),void this.changeRtlProps(s.enableRtl);for(var r=this,i=0,l=Object.keys(s);i<l.length;i++)!function(t){switch(t){case"inline":s.inline?(r.getWrapper().appendChild(r.container),r.splitBtn.destroy(),E.detach(r.element.nextElementSibling),r.container.children.length||r.createWidget()):(r.destroyOtherComp(),r.unWireEvents(),r.container.innerHTML="",r.createSplitBtn());break;case"cssClass":r.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!==qs&&t!==js&&t!==sn&&t!==Ds&&t!==Ws||(E.select("."+Ks,a.container)&&E.remove(E.select("."+Ks,a.container)),a.createInput(),i++)});break;case"enableRtl":r.isPicker()&&(r.hueSlider.enableRtl=s.enableRtl,r.enableOpacity&&(r.opacitySlider.enableRtl=s.enableRtl),r.setInputEleProps()),r.changeRtlProps(s.enableRtl);break;case"disabled":r.changeDisabledProp(s.disabled);break;case"value":r.value!==n.value&&r.changeValueProp(s.value);break;case"showButtons":r.changeShowBtnProps(s.showButtons);break;case"mode":"Picker"===s.mode?r.switchToPicker():r.switchToPalette();break;case"modeSwitcher":r.changeModeSwitcherProp(s.modeSwitcher);break;case"columns":case"presetColors":r.isPicker()||r.changePaletteProps();break;case"noColor":s.noColor?"Palette"!==r.mode||r.modeSwitcher||r.setNoColor():r.changePaletteProps();break;case"enableOpacity":r.changeOpacityProps(s.enableOpacity);break;case"showRecentColors":s.showRecentColors||(e=r.container.querySelector(".e-clr-pal-rec-wpr"))&&E.detach(e),r.recentColors=[]}}(l[i])},x.prototype.focusIn=function(){this.element.parentElement.focus()},S([E.Property("#008000ff")],x.prototype,"value",void 0),S([E.Property("")],x.prototype,"cssClass",void 0),S([E.Property(!1)],x.prototype,"disabled",void 0),S([E.Property("Picker")],x.prototype,"mode",void 0),S([E.Property(!0)],x.prototype,"modeSwitcher",void 0),S([E.Property(null)],x.prototype,"presetColors",void 0),S([E.Property(!0)],x.prototype,"showButtons",void 0),S([E.Property(10)],x.prototype,"columns",void 0),S([E.Property(!1)],x.prototype,"inline",void 0),S([E.Property(!1)],x.prototype,"noColor",void 0),S([E.Property(!1)],x.prototype,"enablePersistence",void 0),S([E.Property(!0)],x.prototype,"enableOpacity",void 0),S([E.Property(!1)],x.prototype,"createPopupOnClick",void 0),S([E.Property(!1)],x.prototype,"showRecentColors",void 0),S([E.Event()],x.prototype,"select",void 0),S([E.Event()],x.prototype,"change",void 0),S([E.Event()],x.prototype,"beforeTileRender",void 0),S([E.Event()],x.prototype,"beforeOpen",void 0),S([E.Event()],x.prototype,"open",void 0),S([E.Event()],x.prototype,"beforeClose",void 0),S([E.Event()],x.prototype,"beforeModeSwitch",void 0),S([E.Event()],x.prototype,"onModeSwitch",void 0),S([E.Event()],x.prototype,"created",void 0),S([E.NotifyPropertyChanges],x));function x(t,e){t=Ns.call(this,t,e)||this;return t.recentColors=[],t}on=function(t,e){return(on=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 on,hn,S=function(t,e){function i(){this.constructor=t}on(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},P=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},S=(hn=E.Component,S(T,hn),T.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"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]);break;case"placeholder":o.Input.setPlaceholder(this.placeholder,this.respectiveElement),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),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),o.Input.setPlaceholder(this.placeholder,this.respectiveElement)}},T.prototype.getModuleName=function(){return"textbox"},T.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")),"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)&&M.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--)}}},T.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)}}},T.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.renderComplete()},T.prototype.updateHTMLAttributesToWrapper=function(){o.Input.updateHTMLAttributesToWrapper(this.htmlAttributes,this.textboxWrapper.container)},T.prototype.updateHTMLAttributesToElement=function(){o.Input.updateHTMLAttributesToElement(this.htmlAttributes,this.respectiveElement||(this.multiline&&!E.isNullOrUndefined(this.textarea)?this.textarea:this.element))},T.prototype.setInitialValue=function(){this.isAngular||this.respectiveElement.setAttribute("value",this.initialValue)},T.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)},T.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"))},T.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},T.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")))},T.prototype.focusHandler=function(t){t={container:this.textboxWrapper.container,event:t,value:this.value};this.trigger("focus",t)},T.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)},T.prototype.keydownHandler=function(t){13!==t.keyCode&&9!==t.keyCode||!(null!==this.previousValue&&""!==this.previousValue||null!==this.value&&""!==this.value||""!==this.respectiveElement.value)||this.setProperties({value:this.respectiveElement.value},!0)},T.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()},T.prototype.changeHandler=function(t){this.setProperties({value:this.respectiveElement.value},!0),this.previousValue!==this.value&&this.raiseChangeEvent(t,!0),t.stopPropagation()},T.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)},T.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))},T.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)))},T.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)},T.prototype.destroy=function(){this.unWireEvents(),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),hn.prototype.destroy.call(this)},T.prototype.addIcon=function(t,e){o.Input.addIcon(t,e,this.textboxWrapper.container,this.respectiveElement,this.createElement)},T.prototype.getPersistData=function(){return this.addOnPersist(["value"])},T.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]))}},T.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)}},T.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],[D])},T.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],[D])},P([E.Property("text")],T.prototype,"type",void 0),P([E.Property(!1)],T.prototype,"readonly",void 0),P([E.Property(null)],T.prototype,"value",void 0),P([E.Property("Never")],T.prototype,"floatLabelType",void 0),P([E.Property("")],T.prototype,"cssClass",void 0),P([E.Property(null)],T.prototype,"placeholder",void 0),P([E.Property("on")],T.prototype,"autocomplete",void 0),P([E.Property({})],T.prototype,"htmlAttributes",void 0),P([E.Property(!1)],T.prototype,"multiline",void 0),P([E.Property(!0)],T.prototype,"enabled",void 0),P([E.Property(!1)],T.prototype,"showClearButton",void 0),P([E.Property(!1)],T.prototype,"enablePersistence",void 0),P([E.Property(null)],T.prototype,"width",void 0),P([E.Event()],T.prototype,"created",void 0),P([E.Event()],T.prototype,"destroyed",void 0),P([E.Event()],T.prototype,"change",void 0),P([E.Event()],T.prototype,"blur",void 0),P([E.Event()],T.prototype,"focus",void 0),P([E.Event()],T.prototype,"input",void 0),P([E.NotifyPropertyChanges],T));function T(t,e){e=hn.call(this,t,e)||this;return e.previousValue=null,e.isHiddenInput=!1,e.isForm=!1,e.inputPreviousValue=null,e.textboxOptions=t,e}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,un,P=function(t,e){function i(){this.constructor=t}pn(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,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},dn="e-auto-width",cn="e-resize-x",mn="e-resize-y",vn="e-resize-xy",fn="e-resize-none",P=(un=E.Component,P(k,un),k.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(fn));break;case"width":"None"!==this.resizeMode&&"Vertical"!==this.resizeMode?(this.setElementWidth(t.width),this.textareaWrapper.container.classList.add(dn)):(this.textareaWrapper.container.classList.contains(dn)&&this.textareaWrapper.container.classList.remove(dn),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]);break;case"placeholder":o.Input.setPlaceholder(this.placeholder,this.element),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(dn);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())}},k.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")},k.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)||o.Input.setValue(this.value,this.element,this.floatLabelType,this.showClearButton),E.isNullOrUndefined(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.renderComplete()},k.prototype.getModuleName=function(){return"textarea"},k.prototype.getPersistData=function(){return this.addOnPersist(["value"])},k.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)}}},k.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()},k.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)},k.prototype.destroy=function(){this.unWireEvents(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),this.element.value=this.element.defaultValue,this.element.classList.remove("e-input",cn,mn,vn,fn),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,un.prototype.destroy.call(this)},k.prototype.focusHandler=function(t){t={container:this.textareaWrapper.container,event:t,value:this.value};this.trigger("focus",t)},k.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.trigger("blur",t)},k.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)},k.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()},k.prototype.changeHandler=function(t){this.setProperties({value:this.element.value},!0),this.previousValue!==this.value&&this.raiseChangeEvent(t,!0),t.stopPropagation()},k.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},k.prototype.updateHTMLAttributesToWrapper=function(){o.Input.updateHTMLAttributesToWrapper(this.htmlAttributes,this.textareaWrapper.container)},k.prototype.updateHTMLAttributesToElement=function(){o.Input.updateHTMLAttributesToElement(this.htmlAttributes,this.element)},k.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))},k.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))},k.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])}},k.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)}},k.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],[D])},k.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],[D])},k.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(dn),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(dn)&&this.textareaWrapper.container.classList.remove(dn)},k.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))},k.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")))},k.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},k.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))},O([E.Property(!(k.prototype.getCurrentResizeClass=function(t){return"None"===t?fn:"Both"===t?vn:"Horizontal"===t?cn:mn}))],k.prototype,"readonly",void 0),O([E.Property(null)],k.prototype,"value",void 0),O([E.Property("Never")],k.prototype,"floatLabelType",void 0),O([E.Property("")],k.prototype,"cssClass",void 0),O([E.Property(null)],k.prototype,"placeholder",void 0),O([E.Property({})],k.prototype,"htmlAttributes",void 0),O([E.Property(!0)],k.prototype,"enabled",void 0),O([E.Property(!1)],k.prototype,"showClearButton",void 0),O([E.Property(!1)],k.prototype,"enablePersistence",void 0),O([E.Property(null)],k.prototype,"width",void 0),O([E.Property("Both")],k.prototype,"resizeMode",void 0),O([E.Property(null)],k.prototype,"maxLength",void 0),O([E.Property(null)],k.prototype,"cols",void 0),O([E.Property(null)],k.prototype,"rows",void 0),O([E.Event()],k.prototype,"created",void 0),O([E.Event()],k.prototype,"destroyed",void 0),O([E.Event()],k.prototype,"change",void 0),O([E.Event()],k.prototype,"blur",void 0),O([E.Event()],k.prototype,"focus",void 0),O([E.Event()],k.prototype,"input",void 0),O([E.NotifyPropertyChanges],k));function k(t,e){e=un.call(this,t,e)||this;return e.previousValue=null,e.isForm=!1,e.inputPreviousValue=null,e.textareaOptions=t,e}yn.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},yn.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},yn.escapeHtml=function(t){return t.replace(/<|>|`|"|&/g,"?").replace(/\r\n|\r|\n/g,"<br/>")},yn.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},yn.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)},yn.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}},yn.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)},yn.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 gn=yn;function yn(){}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,Cn,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)},En=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},Sn=function(a,r,l,o){return new(l=l||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 l(function(t){t(e.value)}).then(i,s)}n((o=o.apply(a,r||[])).next())})},xn=function(s,n){var a,r,l,o={label:0,sent:function(){if(1&l[0])throw l[1];return l[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,r&&(l=2&e[0]?r.return:e[0]?r.throw||((l=r.return)&&l.call(r),0):r.next)&&!(l=l.call(r,e[1])).done)return l;switch(r=0,(e=l?[2&e[0],l.value]:e)[0]){case 0:case 1:l=e;break;case 4:return o.label++,{value:e[1],done:!1};case 5:o.label++,r=e[1],e=[0];continue;case 7:e=o.ops.pop(),o.trys.pop();continue;default:if(!(l=0<(l=o.trys).length&&l[l.length-1])&&(6===e[0]||2===e[0])){o=0;continue}if(3===e[0]&&(!l||e[1]>l[0]&&e[1]<l[3]))o.label=e[1];else if(6===e[0]&&o.label<l[1])o.label=l[1],l=e;else{if(!(l&&o.label<l[2])){l[2]&&o.ops.pop(),o.trys.pop();continue}o.label=l[2],o.ops.push(e)}}e=n.call(s,o)}catch(t){e=[6,t],r=0}finally{a=l=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}},Pn=((Pn=o.ChatMessageRole||(o.ChatMessageRole={})).System="system",Pn.User="user",Pn.Assistant="assistant",O(w,Cn=P),w.prototype.render=function(){var t,e;Cn.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)?Tn:kn)(t,this.textArea))},w.prototype.wireEvents=function(){var t=this;Cn.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})},w.prototype.unWireEvents=function(){var t=this;Cn.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()})},w.prototype.keydownHandler=function(){},w.prototype.shouldShowInlineSuggestions=function(t){t=t.getAttribute("data-inline-suggestions");return t?"true"===t.toLowerCase():!("ontouchstart"in window)},w.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)?(gn.insertCharacter(this.textArea,t.key),t.preventDefault(),this.suggestionDisplay.show(this.suggestionDisplay.currentSuggestion.substring(t.key.length)),gn.adjustScrollToCaretPosition(this.textArea)):this.removeExistingOrPendingSuggestion()}},w.prototype.handleKeyUp=function(){var t=this;this.suggestionDisplay.isShowing()||(clearTimeout(this.typingDebounceTimeout),this.typingDebounceTimeout=setTimeout(function(){return t.handleTypingPaused()},350))},w.prototype.handleTypingPaused=function(){return Sn(this,void 0,void 0,function(){return xn(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]}})})},w.prototype.removeExistingOrPendingSuggestion=function(){clearTimeout(this.typingDebounceTimeout),this.pendingSuggestionAbort&&(this.pendingSuggestionAbort.abort(),this.pendingSuggestionAbort=null),this.suggestionDisplay.reject()},w.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}},w.prototype.requestSuggestionAsync=function(){return Sn(this,void 0,void 0,function(){var e,i,s,n;return xn(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:return s&&e.textAreaValue===this.textArea.value&&e.cursorPosition===this.textArea.selectionStart&&(s.endsWith(" ")||(s+=" "),this.suggestionDisplay.show(s)),[2]}})})},w.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)},w.prototype.indexOfAny=function(t,e){for(var i=0;i<t.length;i++)if(-1!==e.indexOf(t[""+i]))return i;return-1},w.prototype.getModuleName=function(){return"smarttextarea"},w.prototype.destroy=function(){Cn.prototype.destroy.call(this),this.textArea=null,this.suggestionDisplay=null,this.typingDebounceTimeout=null},En([E.Property("")],w.prototype,"userRole",void 0),En([E.Property([])],w.prototype,"UserPhrases",void 0),En([E.Property()],w.prototype,"aiSuggestionHandler",void 0),En([E.Property("None")],w.prototype,"showSuggestionOnPopup",void 0),w);function w(t,e){return Cn.call(this,t,e)||this}Object.defineProperty(On.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}),On.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(On.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}),On.prototype.isShowing=function(){return null!==this.suggestionStartPos},On.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 Ln(this.owner,this.textArea)),this.virtualCaret.show()},Object.defineProperty(On.prototype,"currentSuggestion",{get:function(){return this.latestSuggestionText},enumerable:!0,configurable:!0}),On.prototype.accept=function(){this.textArea.setSelectionRange(this.suggestionEndPos,this.suggestionEndPos),this.suggestionStartPos=null,this.suggestionEndPos=null,this.virtualCaret&&this.virtualCaret.hide(),this.textArea.removeAttribute("data-suggestion-visible"),gn.adjustScrollToCaretPosition(this.textArea)},On.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 Tn=On;function On(t,e){this.owner=t,this.textArea=e,this.latestSuggestionText="",this.suggestionStartPos=null,this.suggestionEndPos=null,this.virtualCaret=null,this.originalValueProperty=this.getOriginalValueProperty(e,"value")}Object.defineProperty(wn.prototype,"currentSuggestion",{get:function(){return this.latestSuggestionText},enumerable:!0,configurable:!0}),wn.prototype.show=function(t){this.latestSuggestionText=t,this.suggestionPrefixElement.textContent=" "!==t[0]?this.getPrefixText(this.textArea,20):"",this.suggestionTextElement.textContent=t;var t=gn.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)")},wn.prototype.accept=function(){this.showing&&(gn.insertCharacter(this.textArea,this.currentSuggestion),gn.adjustScrollToCaretPosition(this.textArea),this.hide())},wn.prototype.reject=function(){this.hide()},wn.prototype.hide=function(){this.showing&&(this.showing=!1,this.suggestionElement.classList.remove("smart-textarea-suggestion-overlay-visible"))},wn.prototype.isShowing=function(){return this.showing},wn.prototype.handleSuggestionClicked=function(t){t.preventDefault(),t.stopImmediatePropagation(),this.accept()},wn.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=wn;function wn(t,e){var i=this,e=(this.latestSuggestionText="",this.showing=!1,this.textArea=e,this.suggestionElement=document.createElement("div"),this.suggestionElement.classList.add("smart-textarea-suggestion-overlay"),this.suggestionElement.addEventListener("mousedown",function(t){return i.handleSuggestionClicked(t)}),this.suggestionElement.addEventListener("touchend",function(t){return i.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=e.font,this.suggestionElement.style.marginTop=1.4*parseFloat(e.fontSize)+"px",t.appendChild(this.suggestionElement)}An.prototype.show=function(){var t=gn.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},An.prototype.hide=function(){this.caretDiv.style.display="none"};var Ln=An;function An(t,e){this.textArea=e,this.caretDiv=document.createElement("div"),this.caretDiv.classList.add("smart-textarea-caret"),t.appendChild(this.caretDiv)}Nn=function(t,e){return(Nn=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 Nn,Hn,O=function(t,e){function i(){this.constructor=t}Nn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},En=(Hn=E.Component,O(L,Hn),L.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)},L.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),window.addEventListener("resize",this.resizeHandler.bind(this)))},L.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)),window.removeEventListener("resize",this.resizeHandler))},L.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)},L.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())},L.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))},L.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=[]},L.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()}},L.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)})},L.prototype.beginStroke=function(t){this.internalRefresh(),this.updateStroke(t)},L.prototype.updateStroke=function(t){t=this.createPoint(t);this.addPoint(t)},L.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))},L.prototype.delay=function(){this.previous=Date.now(),this.timeout=null,this.updateStroke(this.storedArgs),this.timeout||(this.storedArgs=null)},L.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())},L.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}},L.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()))},L.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},L.prototype.endDraw=function(){var t,e;E.isNullOrUndefined(this.pointColl)||(t=2<this.pointColl.length,e=this.pointColl[0],!t&&e&&this.strokeDraw(e))},L.prototype.curveDraw=function(t,e){var i,s,n,a,r,l,o,h,p=this.canvasContext,u=e-t,e=this.bezierLengthCalc(),d=2*Math.ceil(e);for(p.beginPath(),i=0;i<d;i++)o=(h=(l=(r=1-(s=i/d))*r)*r)*this.startPoint.x,o=(o=(o+=3*l*s*this.controlPoint1.x)+3*r*(n=s*s)*this.controlPoint2.x)+(a=n*s)*this.endPoint.x,h=h*this.startPoint.y,h=(h=(h+=3*l*s*this.controlPoint1.y)+3*r*n*this.controlPoint2.y)+a*this.endPoint.y,l=Math.min(t+a*u,this.maxStrokeWidth),this.arcDraw(o,h,l);p.closePath(),p.fill(),this.isSignatureEmpty=!1},L.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},L.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)},L.prototype.calculateCurveControlPoints=function(t,e,i){var s=t.x-e.x,n=t.y-e.y,a=e.x-i.x,r=e.y-i.y,l=(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+r*r),a=n/(s+n),r=o+(l-o)*a,s=i+(t-i)*a,n=e.x-r,a=e.y-s;return{controlPoint1:this.point(l+n,t+a,0),controlPoint2:this.point(o+n,i+a,0)}},L.prototype.bezierLengthCalc=function(){for(var t,e,i,s,n,a,r=0,l=0;l<=10;l++)t=this.bezierPointCalc(e=l/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<l&&(n=t-i,a=e-s,r+=Math.sqrt(n*n+a*a)),i=t,s=e;return r},L.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},L.prototype.pointVelocityCalc=function(t){return this.time!==t.time?this.distanceTo(t)/(this.time-t.time):0},L.prototype.distanceTo=function(t){return Math.sqrt(Math.pow(this.pointX-t.x,2)+Math.pow(this.pointY-t.y,2))},L.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)},L.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))},L.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)},L.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))},L.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()},L.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)},L.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})},L.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)},L.prototype.internalRefresh=function(){this.pointColl=[],this.lastVelocity=0,this.lastWidth=(this.minStrokeWidth+this.maxStrokeWidth)/2},L.prototype.refresh=function(){this.isResponsive=!1,this.setHTMLProperties(),this.resizeHandler(),this.internalRefresh()},L.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"})},L.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"})},L.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"})},L.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)}},L.prototype.isEmpty=function(){return this.isSignatureEmpty},L.prototype.canUndo=function(){return 0<this.incStep},L.prototype.canRedo=function(){return this.incStep<this.snapColl.length-1},L.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"})},L.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},L.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)})},L.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()},L.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--},L.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--},L.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)},L.prototype.saveAsBlob=function(){return this.getBlob(this.canvasContext.canvas.toDataURL("image/png"))},L.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")},L.prototype.getModuleName=function(){return"signature"},L.prototype.getPersistData=function(){return this.signatureValue=this.snapColl[this.incStep],this.addOnPersist(["signatureValue"])},L.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),Hn.prototype.destroy.call(this),this.element=null},L.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)}},L);function L(){var t=null!==Hn&&Hn.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}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,A,O=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},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)}(N,A=En),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}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,In,Rn=function(t,e){function i(){this.constructor=t}Un(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,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},Vn="e-rating-icon e-icons e-star-filled",Fn="e-rating-item-list",Mn="e-rating-item-container",Dn="e-rating-selected",zn="e-rating-intermediate",Wn="e-rating-hidden",qn="e-disabled",jn="e-rating-readonly",_n="e-rating-animation",Xn="e-rating-full",Kn="e-rating-empty",Yn="e-selected-value",Zn=((Zn=o.LabelPosition||(o.LabelPosition={})).Top="Top",Zn.Bottom="Bottom",Zn.Left="Left",Zn.Right="Right",(Zn=o.PrecisionType||(o.PrecisionType={})).Full="Full",Zn.Half="Half",Zn.Quarter="Quarter",Zn.Exact="Exact",In=E.Component,Rn(B,In),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(jn),this.visible||this.wrapper.classList.add(Wn),this.enableRtl&&this.wrapper.classList.add("e-rtl"),this.enableAnimation&&this.wrapper.classList.add(_n),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"](qn),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"](qn),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:Fn,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:Mn}),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(Xn),E.append(this.fullTemplateFunction({index:i,ratingValue:e},this,"ratingFullTemplate",this.element.id+"fullTemplate",this.isStringTemplate),t)):this.emptyTemplate?(t.classList.add(Kn),E.append(this.emptyTemplateFunction({index:i,ratingValue:e},this,"ratingEmptyTemplate",this.element.id+"emptyTemplate",this.isStringTemplate),t)):E.addClass([t],Vn.split(" "))},B.prototype.removeItemContent=function(t){t.classList.remove(Xn,Kn),E.removeClass([t],Vn.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(Dn,zn,Yn),this.getRatingValue(this.currentValue,e));1===s?i.classList.add(Dn):0<s?i.classList.add(zn):this.precision===o.PrecisionType.Full&&e+1<=this.value&&!this.enableSingleSelection&&i.classList.add(Yn),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(Xn)||(this.removeItemContent(i),i.classList.add(Xn),E.append(this.fullTemplateFunction({ratingValue:t,index:e},this,"ratingFullTemplate",this.element.id+"fullTemplate"+e,this.isStringTemplate),i)):this.emptyTemplate?i.classList.contains(Kn)||(this.removeItemContent(i),i.classList.add(Kn),E.append(this.emptyTemplateFunction({ratingValue:t,index:e},this,"ratingEmptyTemplate",this.element.id+"emptyTemplate"+e,this.isStringTemplate),i)):(this.removeItemContent(i),E.addClass([i],Vn.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("."+Mn+"."+Dn);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(Fn))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;In.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"](Wn);break;case"disabled":this.updateDisabled();break;case"readOnly":this.wrapper.classList[this.readOnly?"add":"remove"](jn);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"](_n);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=In.call(this,t,e)||this;return t.itemElements=[],t}Gn=function(t,e){return(Gn=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 Gn,Jn,Rn=function(t,e){function i(){this.constructor=t}Gn(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,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},$n=(($n=o.OtpInputType||(o.OtpInputType={})).Number="number",$n.Text="text",$n.Password="password",($n=o.OtpInputStyle||(o.OtpInputStyle={})).Outlined="outlined",$n.Underlined="underlined",$n.Filled="filled",($n=o.TextTransform||(o.TextTransform={})).None="none",$n.Uppercase="uppercase",$n.Lowercase="lowercase",Jn=E.Component,Rn(U,Jn),U.prototype.preRender=function(){this.element.id||(this.element.id=E.getUniqueID("e-"+this.getModuleName()))},U.prototype.render=function(){this.initialize()},U.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()},U.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)},U.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)},U.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)])}},U.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})},U.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)])}},U.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)})},U.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},U.prototype.getTransformedText=function(t){return this.textTransform.toLowerCase()===o.TextTransform.Lowercase?t.toLowerCase():this.textTransform.toLowerCase()===o.TextTransform.Uppercase?t.toUpperCase():t},U.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)},U.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()},U.prototype.handleSelection=function(t){t=this.inputs[parseInt(t.toString(),10)];t.value&&t.select()},U.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},U.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},U.prototype.handlePaste=function(t,e){var i=e.clipboardData;if(i){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)}},U.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)},U.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())},U.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)},U.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)}},U.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()},U.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()},U.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))},U.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))},U.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)})},U.prototype.updateDisabledState=function(){var e=this;this.inputs.forEach(function(t){e.disabled?t.setAttribute("disabled","disabled"):t.removeAttribute("disabled")})},U.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])}},U.prototype.setInputMode=function(t){for(var e=0;e<this.inputs.length;e++)this.inputs[parseInt(e.toString(),10)].setAttribute("inputmode",t)},U.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)}}},U.prototype.getModuleName=function(){return"otpinput"},U.prototype.getPersistData=function(){return this.addOnPersist([])},U.prototype.destroy=function(){Jn.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},U.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},U.prototype.focusOut=function(){this.isFocusOutCalled=!0,this.inputs.forEach(function(t){t.blur()}),this.isFocusOutCalled=!1},U.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)],U.prototype,"length",void 0),H([E.Property("")],U.prototype,"value",void 0),H([E.Property(o.OtpInputType.Number)],U.prototype,"type",void 0),H([E.Property("")],U.prototype,"separator",void 0),H([E.Property("")],U.prototype,"placeholder",void 0),H([E.Property(o.OtpInputStyle.Outlined)],U.prototype,"stylingMode",void 0),H([E.Property(!1)],U.prototype,"disabled",void 0),H([E.Property("")],U.prototype,"cssClass",void 0),H([E.Property(!1)],U.prototype,"autoFocus",void 0),H([E.Property(o.TextTransform.None)],U.prototype,"textTransform",void 0),H([E.Property({})],U.prototype,"htmlAttributes",void 0),H([E.Property([])],U.prototype,"ariaLabels",void 0),H([E.Event()],U.prototype,"created",void 0),H([E.Event()],U.prototype,"valueChanged",void 0),H([E.Event()],U.prototype,"focus",void 0),H([E.Event()],U.prototype,"blur",void 0),H([E.Event()],U.prototype,"input",void 0),H([E.NotifyPropertyChanges],U));function U(t,e){t=Jn.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}Qn=function(t,e){return(Qn=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 Qn,ta,Rn=function(t,e){function i(){this.constructor=t}Qn(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,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},ea=(ta=E.ChildProperty,Rn(ia,ta),H([E.Property("")],ia.prototype,"content",void 0),H([E.Property("")],ia.prototype,"stopContent",void 0),H([E.Property("")],ia.prototype,"iconCss",void 0),H([E.Property("")],ia.prototype,"stopIconCss",void 0),H([E.Property("Left")],ia.prototype,"iconPosition",void 0),H([E.Property(!1)],ia.prototype,"isPrimary",void 0),ia);function ia(){return null!==ta&&ta.apply(this,arguments)||this}sa=E.ChildProperty,Rn(aa,sa),H([E.Property("Start listening")],aa.prototype,"content",void 0),H([E.Property("Stop listening")],aa.prototype,"stopContent",void 0),H([E.Property("TopCenter")],aa.prototype,"position",void 0);var sa,na=aa;function aa(){return null!==sa&&sa.apply(this,arguments)||this}(la=o.SpeechToTextState||(o.SpeechToTextState={})).Inactive="Inactive",la.Listening="Listening",la.Stopped="Stopped";ra=E.Component,Rn(I,ra),I.prototype.preRender=function(){this.element.id||(this.element.id=E.getUniqueID("e-"+this.getModuleName()))},I.prototype.getDirective=function(){return"EJS-SPEECHTOTEXT"},I.prototype.getModuleName=function(){return"speech-to-text"},I.prototype.getPersistData=function(){return this.addOnPersist([])},I.prototype.render=function(){this.renderSpeechToText(),this.initializeSpeechRecognition(),E.isNullOrUndefined(this.listeningState)||this.handleStateChange(),this.wireEvents()},I.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)},I.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 V.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)},I.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)},I.prototype.updateCssClass=function(t,e){e&&E.removeClass([this.element],e.trim().split(" ")),t&&E.addClass([this.element],t.trim().split(" "))},I.prototype.updateButtonCssClass=function(){var t;return""===(this.isClicked?this.buttonSettings.stopContent:this.buttonSettings.content)&&(t="e-round"),this.micOn&&(t+=" e-listening-state"),t},I.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)},I.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)))},I.prototype.addHtmlAttributes=function(t){if(t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&this.element.setAttribute(e,t[e])},I.prototype.removeHtmlAttributes=function(t){if(t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&this.element.removeAttribute(e)},I.prototype.wireEvents=function(){E.EventHandler.add(this.element,"click",this.handleButtonClick,this)},I.prototype.unWireEvents=function(){E.EventHandler.remove(this.element,"click",this.handleButtonClick)},I.prototype.handleButtonClick=function(t){this.isUserInteracted=!0,this.micOn=!this.micOn,this.micOn?this.startSpeechRecognition(t):this.stopSpeechRecognition(t)},I.prototype.triggerUnSupportedError=function(){var t={error:"unsupported-browser",errorMessage:this.l10n.getConstant("unsupportedBrowserError")};this.trigger("onError",t)},I.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()},I.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},I.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()})},I.prototype.startSpeechRecognition=function(t){this.hasStarted||(this.recognition?this.recognition.start():this.triggerUnSupportedStart(t))},I.prototype.stopSpeechRecognition=function(t){this.recognition?this.recognition.stop():this.handleStopRecognition(t)},I.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)},I.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)},I.prototype.destroyAndNullify=function(t){t&&t.destroy()},I.prototype.destroy=function(){ra.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")},I.prototype.startListening=function(){this.disabled||this.isClicked||(this.isUserInteracted=!1,this.micOn=!0,this.startSpeechRecognition())},I.prototype.stopListening=function(){!this.disabled&&this.isClicked&&(this.isUserInteracted=!1,this.micOn=!1,this.stopSpeechRecognition())},I.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("")],I.prototype,"transcript",void 0),H([E.Property("")],I.prototype,"lang",void 0),H([E.Property(!0)],I.prototype,"allowInterimResults",void 0),H([E.Property(!0)],I.prototype,"showTooltip",void 0),H([E.Property("Inactive")],I.prototype,"listeningState",void 0),H([E.Complex({},ea)],I.prototype,"buttonSettings",void 0),H([E.Complex({},na)],I.prototype,"tooltipSettings",void 0),H([E.Property(!1)],I.prototype,"disabled",void 0),H([E.Property("")],I.prototype,"cssClass",void 0),H([E.Property({})],I.prototype,"htmlAttributes",void 0),H([E.Event()],I.prototype,"created",void 0),H([E.Event()],I.prototype,"onStart",void 0),H([E.Event()],I.prototype,"onStop",void 0),H([E.Event()],I.prototype,"onError",void 0),H([E.Event()],I.prototype,"transcriptChanged",void 0);var ra,la=H([E.NotifyPropertyChanges],I);function I(t,e){t=ra.call(this,t,e)||this;return t.fullTranscript="",t.isClicked=!1,t.isUserInteracted=!1,t.hasStarted=!1,t}o.AsyncSettings=ks,o.ButtonSettings=ea,o.ButtonsProps=Ps,o.ColorPicker=s,o.ColorRangeData=He,o.FilesProp=Es,o.FormValidator=Yi,o.LimitData=Ie,o.MaskUndo=Se,o.MaskedTextBox=xt,o.NumericTextBox=Bt,o.OtpInput=$n,o.Rating=Zn,o.Signature=O,o.SignatureBase=En,o.Slider=qi,o.SmartTextArea=Pn,o.SpeechToText=la,o.TEXTBOX_FOCUS=D,o.TextArea=P,o.TextBox=S,o.TicksData=Le,o.TooltipData=Fe,o.TooltipSettings=na,o.Uploader=t,o.applyMask=Wt,o.bindClearEvent=_t,o.containerAttributes=M,o.createMask=zt,o.escapeRegExp=te,o.getMaskedVal=function(t){return Yt.call(Ee(t),t.element)},o.getVal=function(t){return u.call(Ee(t),t.element)},o.maskInput=function(t){var e=Ce(t),i=(Wt.call(e),u.call(this,this.element));this.prevValue=i,this.value=i,t.mask&&(jt.call(e),qt.call(e))},o.maskInputBlurHandler=ee,o.maskInputDropHandler=ne,o.maskInputFocusHandler=$t,o.maskInputMouseDownHandler=Gt,o.maskInputMouseUpHandler=Jt,o.mobileRemoveFunction=le,o.regex=Ki,o.regularExpressions=Dt,o.setElementValue=b,o.setMaskValue=be,o.strippedValue=u,o.triggerFocus=Qt,o.unstrippedValue=Yt,o.unwireEvents=jt,o.wireEvents=qt,Object.defineProperty(o,"__esModule",{value:!0})});
|
|
11
11
|
//# sourceMappingURL=ej2-inputs.umd.min.js.map
|