@syncfusion/ej2-buttons
Version:
A package of feature-rich Essential JS 2 components such as Button, CheckBox, RadioButton and Switch.
10 lines • 107 kB
JavaScript
/*!
* filename: ej2-buttons.min.js
* version : 29.1.33
* Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
* Use of this code is subject to the terms of our license.
* A copy of the current license can be obtained at any time by e-mailing
* licensing@syncfusion.com. Any infringement will be prosecuted under
* applicable laws.
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionBase")):"function"==typeof define&&define.amd?define(["SyncfusionBase"],t):"object"==typeof exports?exports.SyncfusionButtons=t(require("SyncfusionBase")):e.SyncfusionButtons=t(e.SyncfusionBase)}(self,(e=>(()=>{"use strict";var t={766:t=>{t.exports=e}},i={};function s(e){var n=i[e];if(void 0!==n)return n.exports;var o=i[e]={exports:{}};return t[e](o,o.exports,s),o.exports}s.d=(e,t)=>{for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{s.r(n),s.d(n,{BeforeChangeEventArgs:()=>d,Button:()=>C,CheckBox:()=>M,Chip:()=>ne,ChipList:()=>se,Fab:()=>ge,FabPosition:()=>m,IconPosition:()=>h,LinearDirection:()=>me,RadialDirection:()=>ve,RadialSettings:()=>ht,RadioButton:()=>V,SmartPasteButton:()=>gt,SpeedDial:()=>ut,SpeedDialAnimationEffect:()=>ye,SpeedDialAnimationSettings:()=>ct,SpeedDialItem:()=>dt,SpeedDialMode:()=>fe,Switch:()=>$,buttonObserver:()=>v,classNames:()=>ie,createCheckBox:()=>l,destroy:()=>o,getTextNode:()=>i,preRender:()=>r,rippleMouseHandler:()=>a,setHiddenInput:()=>p,wrapperInitialize:()=>t});var e=s(766);function t(t,i,s,n,o,r){var l=n;if(n.tagName===i){var a=(0,e.getValue)("ej2_instances",n);l=t("input",{attrs:{type:s}});for(var p=["change","cssClass","label","labelPosition","id"],c=0,h=n.attributes.length;c<h;c++)-1===p.indexOf(n.attributes[c].nodeName)&&l.setAttribute(n.attributes[c].nodeName,n.attributes[c].nodeValue);(0,e.attributes)(n,{class:o}),n.appendChild(l),n.classList.add(r),n.classList.remove(r),(0,e.setValue)("ej2_instances",a,l),(0,e.deleteObject)(n,"ej2_instances")}return l}function i(e){for(var t,i=e.childNodes,s=0;s<i.length;s++)if(3===(t=i[s]).nodeType)return t;return null}function o(t,i,s){"INPUT"===s?(i.parentNode.insertBefore(t.element,i),(0,e.detach)(i),t.element.checked=!1,["name","value","disabled"].forEach((function(e){t.element.removeAttribute(e)}))):(["role","aria-checked","class"].forEach((function(e){i.removeAttribute(e)})),i.innerHTML="",t.element=i)}function r(i,s,n,o,r){o=t(i.createElement,s,"checkbox",o,n,r),i.element=o,"checkbox"!==i.element.getAttribute("type")&&i.element.setAttribute("type","checkbox"),i.element.id||(i.element.id=(0,e.getUniqueID)("e-"+r))}function l(t,i,s){void 0===i&&(i=!1),void 0===s&&(s={});var n=t("div",{className:"e-checkbox-wrapper e-css"});if(s.cssClass&&(0,e.addClass)([n],s.cssClass.split(" ")),s.enableRtl&&n.classList.add("e-rtl"),i){var o=t("span",{className:"e-ripple-container"});(0,e.rippleEffect)(o,{isCenterRipple:!0,duration:400}),n.appendChild(o)}var r=t("span",{className:"e-frame e-icons"});if(s.checked&&r.classList.add("e-check"),n.appendChild(r),s.label){var l=t("span",{className:"e-label"});s.disableHtmlEncode?l.textContent=s.label:l.innerHTML=s.label,n.appendChild(l)}return n}function a(e,t){if(t){var i=document.createEvent("MouseEvents");i.initEvent(e.type,!1,!0),t.dispatchEvent(i)}}function p(e,t){e.element.getAttribute("ejs-for")&&t.appendChild(e.createElement("input",{attrs:{name:e.name||e.element.name,value:"false",type:"hidden"}}))}var c,h,d=function(){},u=(c=function(e,t){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},c(e,t)},function(e,t){function i(){this.constructor=e}c(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),f=function(e,t,i,s){var n,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(r=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};!function(e){e.Left="Left",e.Right="Right",e.Top="Top",e.Bottom="Bottom"}(h||(h={}));var m,v=new e.Observer,y="e-rtl",g="e-btn",b="e-primary",E="e-icon-btn",C=function(t){function s(e,i){return t.call(this,e,i)||this}return u(s,t),s.prototype.preRender=function(){},s.prototype.render=function(){this.initialize(),this.removeRippleEffect=(0,e.rippleEffect)(this.element,{selector:"."+g}),this.renderComplete()},s.prototype.initialize=function(){if(this.cssClass&&(0,e.addClass)([this.element],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.isPrimary&&this.element.classList.add(b),!(0,e.isBlazor)()||(0,e.isBlazor)()&&"progress-btn"!==this.getModuleName()){if(this.content){var t=this.enableHtmlSanitizer?e.SanitizeHtmlHelper.sanitize(this.content):this.content;this.element.innerHTML=t}this.setIconCss()}this.enableRtl&&this.element.classList.add(y),this.disabled?this.controlStatus(this.disabled):this.wireEvents()},s.prototype.controlStatus=function(e){this.element.disabled=e},s.prototype.setIconCss=function(){if(this.iconCss){var e=this.createElement("span",{className:"e-btn-icon "+this.iconCss});this.element.textContent.trim()?(e.classList.add("e-icon-"+this.iconPosition.toLowerCase()),"Top"!==this.iconPosition&&"Bottom"!==this.iconPosition||this.element.classList.add("e-"+this.iconPosition.toLowerCase()+"-icon-btn")):this.element.classList.add(E);var t=this.element.childNodes[0];!t||"Left"!==this.iconPosition&&"Top"!==this.iconPosition?this.element.appendChild(e):this.element.insertBefore(e,t)}},s.prototype.wireEvents=function(){this.isToggle&&e.EventHandler.add(this.element,"click",this.btnClickHandler,this)},s.prototype.unWireEvents=function(){this.isToggle&&e.EventHandler.remove(this.element,"click",this.btnClickHandler)},s.prototype.btnClickHandler=function(){this.element.classList.contains("e-active")?this.element.classList.remove("e-active"):this.element.classList.add("e-active")},s.prototype.destroy=function(){var i=[b,y,E,"e-success","e-info","e-danger","e-warning","e-flat","e-outline","e-small","e-bigger","e-active","e-round","e-top-icon-btn","e-bottom-icon-btn"];this.cssClass&&(i=i.concat(this.cssClass.split(/\s+/).filter((function(e){return e.length>0})))),t.prototype.destroy.call(this),(0,e.removeClass)([this.element],i),this.element.getAttribute("class")||this.element.removeAttribute("class"),this.disabled&&this.element.removeAttribute("disabled"),this.content&&(this.element.innerHTML=this.element.innerHTML.replace(this.content,""));var s=this.element.querySelector("span.e-btn-icon");s&&(0,e.detach)(s),this.unWireEvents(),e.isRippleEnabled&&this.removeRippleEffect()},s.prototype.getModuleName=function(){return"btn"},s.prototype.getPersistData=function(){return this.addOnPersist([])},s.Inject=function(){},s.prototype.onPropertyChanged=function(t,s){for(var n=this.element.querySelector("span.e-btn-icon"),o=0,r=Object.keys(t);o<r.length;o++){switch(r[o]){case"isPrimary":t.isPrimary?this.element.classList.add(b):this.element.classList.remove(b);break;case"disabled":this.controlStatus(t.disabled);break;case"iconCss":(n=this.element.querySelector("span.e-btn-icon"))?t.iconCss?(n.className="e-btn-icon "+t.iconCss,this.element.textContent.trim()&&("Left"===this.iconPosition?n.classList.add("e-icon-left"):n.classList.add("e-icon-right"))):(0,e.detach)(n):this.setIconCss();break;case"iconPosition":(0,e.removeClass)([this.element],["e-top-icon-btn","e-bottom-icon-btn"]),(n=this.element.querySelector("span.e-btn-icon"))&&(0,e.detach)(n),this.setIconCss();break;case"cssClass":s.cssClass&&(0,e.removeClass)([this.element],s.cssClass.split(/\s+/).filter((function(e){return e.length>0}))),t.cssClass&&(0,e.addClass)([this.element],t.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":t.enableRtl?this.element.classList.add(y):this.element.classList.remove(y);break;case"content":i(this.element)||this.element.classList.remove(E),(!(0,e.isBlazor)()||(0,e.isBlazor)()&&!this.isServerRendered&&"progress-btn"!==this.getModuleName())&&(this.enableHtmlSanitizer&&(t.content=e.SanitizeHtmlHelper.sanitize(t.content)),this.element.innerHTML=t.content,this.setIconCss());break;case"isToggle":t.isToggle?e.EventHandler.add(this.element,"click",this.btnClickHandler,this):(e.EventHandler.remove(this.element,"click",this.btnClickHandler),(0,e.removeClass)([this.element],["e-active"]))}}},s.prototype.click=function(){this.element.click()},s.prototype.focusIn=function(){this.element.focus()},f([(0,e.Property)("Left")],s.prototype,"iconPosition",void 0),f([(0,e.Property)("")],s.prototype,"iconCss",void 0),f([(0,e.Property)(!1)],s.prototype,"disabled",void 0),f([(0,e.Property)(!1)],s.prototype,"isPrimary",void 0),f([(0,e.Property)("")],s.prototype,"cssClass",void 0),f([(0,e.Property)("")],s.prototype,"content",void 0),f([(0,e.Property)(!1)],s.prototype,"isToggle",void 0),f([(0,e.Property)()],s.prototype,"locale",void 0),f([(0,e.Property)(!0)],s.prototype,"enableHtmlSanitizer",void 0),f([(0,e.Event)()],s.prototype,"created",void 0),s=f([e.NotifyPropertyChanges],s)}(e.Component),k=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),L=function(e,t,i,s){var n,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(r=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},P="e-check",H="e-checkbox-disabled",A="e-frame",w="e-stop",x="e-label",S="e-ripple-container",T="e-ripple-check",R="e-ripple-stop",O="e-rtl",N="e-checkbox-wrapper",I=["title","class","style","disabled","readonly","name","value","id","tabindex","aria-label","required"],M=function(i){function s(e,t){var s=i.call(this,e,t)||this;return s.isFocused=!1,s.isMouseClick=!1,s.clickTriggered=!1,s.validCheck=!0,s.type="checkbox",s}return k(s,i),s.prototype.changeState=function(t,i,s){var n=this.getWrapper(),o=null,r=null;n&&(r=n.getElementsByClassName(A)[0],e.isRippleEnabled&&(o=n.getElementsByClassName(S)[0])),"check"===t?(r&&(r.classList.remove(w),r.classList.add(P)),o&&(o.classList.remove(R),o.classList.add(T)),this.element.checked=!0,(this.element.required||(0,e.closest)(this.element,"form")&&(0,e.closest)(this.element,"form").classList.contains("e-formvalidator"))&&this.validCheck&&!i&&s?(this.element.checked=!1,this.validCheck=!1):(this.element.required||(0,e.closest)(this.element,"form")&&(0,e.closest)(this.element,"form").classList.contains("e-formvalidator"))&&(this.validCheck=!0)):"uncheck"===t?(r&&(0,e.removeClass)([r],[P,w]),o&&(0,e.removeClass)([o],[T,R]),this.element.checked=!1,(this.element.required||(0,e.closest)(this.element,"form")&&(0,e.closest)(this.element,"form").classList.contains("e-formvalidator"))&&this.validCheck&&!i&&s?(this.element.checked=!0,this.validCheck=!1):(this.element.required||(0,e.closest)(this.element,"form")&&(0,e.closest)(this.element,"form").classList.contains("e-formvalidator"))&&(this.validCheck=!0)):(r&&(r.classList.remove(P),r.classList.add(w)),o&&(o.classList.remove(T),o.classList.add(R)),this.element.indeterminate=!0,this.indeterminate=!0)},s.prototype.clickHandler=function(t){if("INPUT"===t.target.tagName&&this.clickTriggered)return this.changeState(this.checked?"check":"uncheck"),void(this.clickTriggered=!1);("SPAN"===t.target.tagName||"LABEL"===t.target.tagName||(0,e.closest)(t.target,".e-label"))&&(this.clickTriggered=!0),this.isMouseClick&&(this.focusOutHandler(),this.isMouseClick=!1),this.indeterminate?(this.changeState(this.checked?"check":"uncheck",!1,!0),this.indeterminate=!1,this.element.indeterminate=!1):this.checked?(this.changeState("uncheck",!1,!0),this.checked=!1):(this.changeState("check",!1,!0),this.checked=!0);var i={checked:this.updateVueArrayModel(!1),event:t};this.trigger("change",i),t.stopPropagation()},s.prototype.destroy=function(){var t=this,s=this.getWrapper();i.prototype.destroy.call(this),this.wrapper&&(s=this.wrapper,this.disabled||this.unWireEvents(),"INPUT"===this.tagName?(this.getWrapper()&&s.parentNode&&s.parentNode.insertBefore(this.element,s),(0,e.detach)(s),this.element.checked=!1,this.indeterminate&&(this.element.indeterminate=!1),["name","value","disabled"].forEach((function(e){t.element.removeAttribute(e)}))):(["class"].forEach((function(e){s.removeAttribute(e)})),s.innerHTML="",this.element=s,this.refreshing&&(["e-control","e-checkbox","e-lib"].forEach((function(e){t.element.classList.add(e)})),(0,e.setValue)("ej2_instances",[this],this.element))))},s.prototype.focusHandler=function(){this.isFocused=!0},s.prototype.focusOutHandler=function(){var e=this.getWrapper();e&&e.classList.remove("e-focus"),this.isFocused=!1},s.prototype.getModuleName=function(){return"checkbox"},s.prototype.getPersistData=function(){return this.addOnPersist(["checked","indeterminate"])},s.prototype.getWrapper=function(){return this.element&&this.element.parentElement?this.element.parentElement.parentElement:null},s.prototype.getLabel=function(){return this.element?this.element.parentElement:null},s.prototype.initialize=function(){(0,e.isNullOrUndefined)(this.initialCheckedValue)&&(this.initialCheckedValue=this.checked),this.name&&this.element.setAttribute("name",this.name),this.element.setAttribute("tabindex","0"),this.value&&(this.element.setAttribute("value",this.value),this.isVue&&"boolean"==typeof this.value&&!0===this.value&&this.setProperties({checked:!0},!0)),this.checked&&this.changeState("check",!0),this.indeterminate&&this.changeState(),this.disabled&&this.setDisabled()},s.prototype.initWrapper=function(){var t=this.element.parentElement;t.classList.contains(N)||(t=this.createElement("div",{className:N}),this.element.parentNode&&this.element.parentNode.insertBefore(t,this.element));var i=this.createElement("label",{attrs:{for:this.htmlAttributes.id?this.htmlAttributes.id:this.element.id}}),s=this.createElement("span",{className:"e-icons "+A});if(t.classList.add("e-wrapper"),this.enableRtl&&t.classList.add(O),this.cssClass&&(0,e.addClass)([t],this.cssClass.replace(/\s+/g," ").trim().split(" ")),t.appendChild(i),i.appendChild(this.element),p(this,i),i.appendChild(s),e.isRippleEnabled){var n=this.createElement("span",{className:S});"Before"===this.labelPosition?i.appendChild(n):i.insertBefore(n,s),(0,e.rippleEffect)(n,{duration:400,isCenterRipple:!0})}this.label&&this.setText(this.label)},s.prototype.keyUpHandler=function(){this.isFocused&&this.getWrapper().classList.add("e-focus")},s.prototype.labelMouseDownHandler=function(e){this.isMouseClick=!0,a(e,this.getWrapper().getElementsByClassName(S)[0])},s.prototype.labelMouseLeaveHandler=function(e){var t=this.getLabel().getElementsByClassName(S)[0];if(t){for(var i=t.querySelectorAll(".e-ripple-element").length-1;i>0;i--)t.removeChild(t.childNodes[i]);a(e,t)}},s.prototype.labelMouseUpHandler=function(e){this.isMouseClick=!0;var t=this.getWrapper().getElementsByClassName(S)[0];if(t){for(var i=t.querySelectorAll(".e-ripple-element"),s=0;s<i.length-1;s++)t.removeChild(t.childNodes[s]);a(e,t)}},s.prototype.onPropertyChanged=function(t,i){for(var s=this.getWrapper(),n=0,o=Object.keys(t);n<o.length;n++){switch(o[n]){case"checked":this.indeterminate=!1,this.element.indeterminate=!1,this.changeState(t.checked?"check":"uncheck");break;case"indeterminate":t.indeterminate?this.changeState():(this.element.indeterminate=!1,this.changeState(this.checked?"check":"uncheck"));break;case"disabled":t.disabled?(this.setDisabled(),this.wrapper=this.getWrapper(),this.unWireEvents()):(this.element.disabled=!1,s.classList.remove(H),s.setAttribute("aria-disabled","false"),this.wireEvents());break;case"cssClass":i.cssClass&&(0,e.removeClass)([s],i.cssClass.split(/\s+/).filter((function(e){return e.length>0}))),t.cssClass&&(0,e.addClass)([s],t.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":t.enableRtl?s.classList.add(O):s.classList.remove(O);break;case"label":this.setText(t.label);break;case"labelPosition":var r=s.getElementsByClassName(x)[0],l=s.getElementsByTagName("label")[0];(0,e.detach)(r),"After"===t.labelPosition?l.appendChild(r):l.insertBefore(r,s.getElementsByClassName(A)[0]);break;case"name":this.element.setAttribute("name",t.name);break;case"value":if(this.isVue&&"object"==typeof t.value)break;this.element.setAttribute("value",t.value);break;case"htmlAttributes":this.updateHtmlAttributeToWrapper()}}},s.prototype.preRender=function(){var i=this.element;this.tagName=this.element.tagName,i=t(this.createElement,"EJS-CHECKBOX","checkbox",i,N,"checkbox"),this.element=i,"checkbox"!==this.element.getAttribute("type")&&this.element.setAttribute("type","checkbox"),this.element.id||(this.element.id=(0,e.getUniqueID)("e-"+this.getModuleName()))},s.prototype.render=function(){this.initWrapper(),this.initialize(),this.disabled||this.wireEvents(),this.updateHtmlAttributeToWrapper(),this.updateVueArrayModel(!0),this.renderComplete(),this.wrapper=this.getWrapper()},s.prototype.setDisabled=function(){var e=this.getWrapper();this.element.disabled=!0,e.classList.add(H),e.setAttribute("aria-disabled","true")},s.prototype.setText=function(t){var i=this.getWrapper();if(i){var s=i.getElementsByClassName(x)[0];if(s)s.innerHTML=this.enableHtmlSanitizer?e.SanitizeHtmlHelper.sanitize(t):t;else{t=this.enableHtmlSanitizer?e.SanitizeHtmlHelper.sanitize(t):t,s=this.createElement("span",{className:x,innerHTML:t});var n=i.getElementsByTagName("label")[0];"Before"===this.labelPosition?n.insertBefore(s,i.getElementsByClassName(A)[0]):n.appendChild(s)}}},s.prototype.changeHandler=function(e){e.stopPropagation()},s.prototype.formResetHandler=function(){this.checked=this.initialCheckedValue,this.element.checked=this.initialCheckedValue},s.prototype.unWireEvents=function(){var t=this.wrapper;e.EventHandler.remove(t,"click",this.clickHandler),e.EventHandler.remove(this.element,"keyup",this.keyUpHandler),e.EventHandler.remove(this.element,"focus",this.focusHandler),e.EventHandler.remove(this.element,"focusout",this.focusOutHandler);var i=t.getElementsByTagName("label")[0];i&&(e.EventHandler.remove(i,"mousedown",this.labelMouseDownHandler),e.EventHandler.remove(i,"mouseup",this.labelMouseUpHandler),e.EventHandler.remove(i,"mouseleave",this.labelMouseLeaveHandler));var s=(0,e.closest)(this.element,"form");s&&e.EventHandler.remove(s,"reset",this.formResetHandler),"EJS-CHECKBOX"===this.tagName&&e.EventHandler.remove(this.element,"change",this.changeHandler)},s.prototype.wireEvents=function(){var t=this.getWrapper();e.EventHandler.add(t,"click",this.clickHandler,this),e.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),e.EventHandler.add(this.element,"focus",this.focusHandler,this),e.EventHandler.add(this.element,"focusout",this.focusOutHandler,this);var i=t.getElementsByTagName("label")[0];e.EventHandler.add(i,"mousedown",this.labelMouseDownHandler,this),e.EventHandler.add(i,"mouseup",this.labelMouseUpHandler,this),e.EventHandler.add(i,"mouseleave",this.labelMouseLeaveHandler,this);var s=(0,e.closest)(this.element,"form");s&&e.EventHandler.add(s,"reset",this.formResetHandler,this),"EJS-CHECKBOX"===this.tagName&&e.EventHandler.add(this.element,"change",this.changeHandler,this)},s.prototype.updateVueArrayModel=function(e){if(this.isVue&&"object"==typeof this.value){var t=this.element.value;if(t&&this.value){if(!e){var i=this.value.indexOf(t);return this.checked?i<0&&this.value.push(t):i>-1&&this.value.splice(i,1),this.value}for(var s=0;s<this.value.length;s++)t===this.value[s]&&(this.changeState("check"),this.setProperties({checked:!0},!0))}}return this.validCheck?this.element.checked:!this.element.checked},s.prototype.updateHtmlAttributeToWrapper=function(){if(!(0,e.isNullOrUndefined)(this.htmlAttributes))for(var t=0,i=Object.keys(this.htmlAttributes);t<i.length;t++){var s=i[t],n=this.getWrapper();if(I.indexOf(s)>-1)if("class"===s)(0,e.addClass)([n],this.htmlAttributes[""+s].split(" "));else if("title"===s)n.setAttribute(s,this.htmlAttributes[""+s]);else if("style"===s){this.getWrapper().getElementsByClassName(A)[0].setAttribute(s,this.htmlAttributes[""+s])}else"disabled"===s?("true"===this.htmlAttributes[""+s]&&this.setDisabled(),this.element.setAttribute(s,this.htmlAttributes[""+s])):this.element.setAttribute(s,this.htmlAttributes[""+s]);else n.setAttribute(s,this.htmlAttributes[""+s])}},s.prototype.click=function(){this.element.click()},s.prototype.focusIn=function(){this.element.focus()},L([(0,e.Event)()],s.prototype,"change",void 0),L([(0,e.Event)()],s.prototype,"created",void 0),L([(0,e.Property)(!1)],s.prototype,"checked",void 0),L([(0,e.Property)("")],s.prototype,"cssClass",void 0),L([(0,e.Property)(!1)],s.prototype,"disabled",void 0),L([(0,e.Property)(!1)],s.prototype,"indeterminate",void 0),L([(0,e.Property)("")],s.prototype,"label",void 0),L([(0,e.Property)("After")],s.prototype,"labelPosition",void 0),L([(0,e.Property)("")],s.prototype,"name",void 0),L([(0,e.Property)("")],s.prototype,"value",void 0),L([(0,e.Property)(!0)],s.prototype,"enableHtmlSanitizer",void 0),L([(0,e.Property)({})],s.prototype,"htmlAttributes",void 0),s=L([e.NotifyPropertyChanges],s)}(e.Component),D=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),B=function(e,t,i,s){var n,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(r=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},j="e-label",F="e-ripple-container",U="e-rtl",W="e-radio-wrapper",_=["title","class","style","disabled","readonly","name","value","id"],V=function(i){function s(e,t){var s=i.call(this,e,t)||this;return s.isFocused=!1,s.type="radio",s}var n;return D(s,i),n=s,s.prototype.changeHandler=function(e){this.checked=!0,this.dataBind();var t=this.element.getAttribute("value");t=this.isVue&&t?this.element.value:this.value;var i=typeof this.value;this.isVue&&"boolean"===i&&(t="true"===t),this.trigger("change",{value:t,event:e}),this.isAngular&&e.stopPropagation()},s.prototype.updateChange=function(){for(var t,i,s=this.getRadioGroup(),o=0;o<s.length;o++)(t=s[o])!==this.element&&((i=(0,e.getInstance)(t,n)).checked=!1,"EJS-RADIOBUTTON"===this.tagName&&(i.angularValue=this.value))},s.prototype.destroy=function(){var t=this,s=this.wrapper;i.prototype.destroy.call(this),s&&(this.disabled||this.unWireEvents(),"INPUT"===this.tagName?(s.parentNode&&s.parentNode.insertBefore(this.element,s),(0,e.detach)(s),this.element.checked=!1,["name","value","disabled"].forEach((function(e){t.element.removeAttribute(e)}))):(["role","aria-checked","class"].forEach((function(e){s.removeAttribute(e)})),s.innerHTML="",this.element=this.wrapper,this.refreshing&&(["e-control","e-radio","e-lib"].forEach((function(e){t.element.classList.add(e)})),(0,e.setValue)("ej2_instances",[this],this.element))))},s.prototype.focusHandler=function(){this.isFocused=!0},s.prototype.focusOutHandler=function(){var e=this.getLabel();e&&e.classList.remove("e-focus")},s.prototype.getModuleName=function(){return"radio"},s.prototype.getSelectedValue=function(){for(var e,t=this.getRadioGroup(),i=0,s=t.length;i<s;i++)if((e=t[i]).checked)return e.value;return""},s.prototype.getRadioGroup=function(){return document.querySelectorAll('input.e-radio[name="'+this.element.getAttribute("name")+'"]')},s.prototype.getPersistData=function(){return this.addOnPersist(["checked"])},s.prototype.getWrapper=function(){return this.element.parentElement?this.element.parentElement:null},s.prototype.getLabel=function(){return this.element.nextElementSibling?this.element.nextElementSibling:null},s.prototype.initialize=function(){(0,e.isNullOrUndefined)(this.initialCheckedValue)&&(this.initialCheckedValue=this.checked),this.initWrapper(),this.updateHtmlAttribute(),this.name&&this.element.setAttribute("name",this.name);var t=this.element.getAttribute("value"),i=typeof this.value;this.isVue&&"boolean"===i&&(t="true"===t),(this.isVue?this.value&&"boolean"!==i&&!t:this.value)&&this.element.setAttribute("value",this.value),this.checked&&(this.element.checked=!0),this.disabled&&this.setDisabled()},s.prototype.initWrapper=function(){var t,i=this.element.parentElement;i.classList.contains(W)||(i=this.createElement("div",{className:W}),this.element.parentNode&&this.element.parentNode.insertBefore(i,this.element));var s=this.createElement("label",{attrs:{for:this.element.id}});i.appendChild(this.element),i.appendChild(s),e.isRippleEnabled&&(t=this.createElement("span",{className:F}),s.appendChild(t),(0,e.rippleEffect)(t,{duration:400,isCenterRipple:!0})),i.classList.add("e-wrapper"),this.enableRtl&&s.classList.add(U),this.cssClass&&(0,e.addClass)([i],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.label&&this.setText(this.label)},s.prototype.keyUpHandler=function(){this.isFocused&&this.getLabel().classList.add("e-focus")},s.prototype.labelMouseDownHandler=function(e){a(e,this.getLabel().getElementsByClassName(F)[0])},s.prototype.labelMouseLeaveHandler=function(e){var t=this.getLabel().getElementsByClassName(F)[0];if(t){for(var i=t.querySelectorAll(".e-ripple-element").length-1;i>0;i--)t.removeChild(t.childNodes[i]);a(e,t)}},s.prototype.labelMouseUpHandler=function(e){var t=this.getLabel().getElementsByClassName(F)[0];if(t){for(var i=t.querySelectorAll(".e-ripple-element").length-1;i>0;i--)t.removeChild(t.childNodes[i]);a(e,t)}},s.prototype.formResetHandler=function(){this.checked=this.initialCheckedValue,this.initialCheckedValue&&(0,e.attributes)(this.element,{checked:"true"})},s.prototype.onPropertyChanged=function(t,i){for(var s=this.getWrapper(),n=this.getLabel(),o=0,r=Object.keys(t);o<r.length;o++){switch(r[o]){case"checked":t.checked&&this.updateChange(),this.element.checked=t.checked;break;case"disabled":t.disabled?(this.setDisabled(),this.unWireEvents()):(this.element.disabled=!1,this.wireEvents());break;case"cssClass":i.cssClass&&(0,e.removeClass)([s],i.cssClass.split(/\s+/).filter((function(e){return e.length>0}))),t.cssClass&&(0,e.addClass)([s],t.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":t.enableRtl?n.classList.add(U):n.classList.remove(U);break;case"label":this.setText(t.label);break;case"labelPosition":"Before"===t.labelPosition?n.classList.add("e-right"):n.classList.remove("e-right");break;case"name":this.element.setAttribute("name",t.name);break;case"value":var l=typeof this.htmlAttributes.value;if(!(0,e.isNullOrUndefined)(this.htmlAttributes)&&(this.htmlAttributes.value||"boolean"===l&&!this.htmlAttributes.value))break;this.element.setAttribute("value",t.value);break;case"htmlAttributes":this.updateHtmlAttribute()}}},s.prototype.preRender=function(){var i=this.element;if(this.formElement=(0,e.closest)(this.element,"form"),this.tagName=this.element.tagName,i=t(this.createElement,"EJS-RADIOBUTTON","radio",i,W,"radio"),this.element=i,"radio"!==this.element.getAttribute("type")&&this.element.setAttribute("type","radio"),this.element.id||(this.element.id=(0,e.getUniqueID)("e-"+this.getModuleName())),"EJS-RADIOBUTTON"===this.tagName){var s=this.element.getAttribute("formcontrolname");s&&(this.setProperties({name:s},!0),this.element.setAttribute("name",s))}},s.prototype.render=function(){this.initialize(),this.disabled||this.wireEvents(),this.renderComplete(),this.wrapper=this.getWrapper()},s.prototype.setDisabled=function(){this.element.disabled=!0},s.prototype.setText=function(t){var i=this.getLabel(),s=i.getElementsByClassName(j)[0];s?s.textContent=t:(t=this.enableHtmlSanitizer?e.SanitizeHtmlHelper.sanitize(t):t,s=this.createElement("span",{className:j,innerHTML:t}),i.appendChild(s)),"Before"===this.labelPosition?this.getLabel().classList.add("e-right"):this.getLabel().classList.remove("e-right")},s.prototype.updateHtmlAttribute=function(){if(!(0,e.isNullOrUndefined)(this.htmlAttributes))for(var t=0,i=Object.keys(this.htmlAttributes);t<i.length;t++){var s=i[t],n=this.element.parentElement;_.indexOf(s)>-1?"class"===s?(0,e.addClass)([n],this.htmlAttributes[""+s].replace(/\s+/g," ").trim().split(" ")):"title"===s||"style"===s?n.setAttribute(s,this.htmlAttributes[""+s]):this.element.setAttribute(s,this.htmlAttributes[""+s]):n.setAttribute(s,this.htmlAttributes[""+s])}},s.prototype.unWireEvents=function(){var t=this.wrapper;e.EventHandler.remove(this.element,"change",this.changeHandler),e.EventHandler.remove(this.element,"focus",this.focusHandler),e.EventHandler.remove(this.element,"focusout",this.focusOutHandler),e.EventHandler.remove(this.element,"keyup",this.keyUpHandler);var i=t.getElementsByTagName("label")[0];i&&(e.EventHandler.remove(i,"mousedown",this.labelMouseDownHandler),e.EventHandler.remove(i,"mouseup",this.labelMouseUpHandler),e.EventHandler.remove(i,"mouseleave",this.labelMouseLeaveHandler)),this.formElement&&e.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},s.prototype.wireEvents=function(){var t=this.getLabel();e.EventHandler.add(this.element,"change",this.changeHandler,this),e.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),e.EventHandler.add(this.element,"focus",this.focusHandler,this),e.EventHandler.add(this.element,"focusout",this.focusOutHandler,this);var i=t.getElementsByClassName(j)[0];i&&(e.EventHandler.add(i,"mousedown",this.labelMouseDownHandler,this),e.EventHandler.add(i,"mouseup",this.labelMouseUpHandler,this),e.EventHandler.add(i,"mouseleave",this.labelMouseLeaveHandler,this)),this.formElement&&e.EventHandler.add(this.formElement,"reset",this.formResetHandler,this)},s.prototype.click=function(){this.element.click()},s.prototype.focusIn=function(){this.element.focus()},B([(0,e.Event)()],s.prototype,"change",void 0),B([(0,e.Event)()],s.prototype,"created",void 0),B([(0,e.Property)(!1)],s.prototype,"checked",void 0),B([(0,e.Property)("")],s.prototype,"cssClass",void 0),B([(0,e.Property)(!1)],s.prototype,"disabled",void 0),B([(0,e.Property)("")],s.prototype,"label",void 0),B([(0,e.Property)("After")],s.prototype,"labelPosition",void 0),B([(0,e.Property)("")],s.prototype,"name",void 0),B([(0,e.Property)("")],s.prototype,"value",void 0),B([(0,e.Property)(!0)],s.prototype,"enableHtmlSanitizer",void 0),B([(0,e.Property)({})],s.prototype,"htmlAttributes",void 0),s=n=B([e.NotifyPropertyChanges],s)}(e.Component),q=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),z=function(e,t,i,s){var n,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(r=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},K="e-switch-disabled",X="e-ripple-container",Y="e-ripple-check",J="e-rtl",G="e-switch-wrapper",Z="e-switch-active",Q=["title","class","style","disabled","readonly","name","value","aria-label","id","role","tabindex"],$=function(t){function i(e,i){var s=t.call(this,e,i)||this;return s.isFocused=!1,s.isDrag=!1,s.isWireEvents=!1,s}return q(i,t),i.prototype.changeState=function(t){var i=null,s=this.getWrapper(),n=s.querySelector(".e-switch-inner"),o=s.querySelector(".e-switch-handle");e.isRippleEnabled&&(i=s.getElementsByClassName(X)[0]),t?((0,e.addClass)([n,o],Z),this.element.checked=!0,this.checked=!0,i&&(0,e.addClass)([i],[Y])):((0,e.removeClass)([n,o],Z),this.element.checked=!1,this.checked=!1,i&&(0,e.removeClass)([i],[Y]))},i.prototype.clickHandler=function(e){this.isDrag=!1,this.focusOutHandler();var t={event:e,cancel:!1,checked:this.checked};if(this.trigger("beforeChange",t),!t.cancel){this.changeState(!t.checked),this.element.focus();var i={checked:this.element.checked,event:e};this.trigger("change",i)}},i.prototype.destroy=function(){var i=this;t.prototype.destroy.call(this),this.disabled||this.unWireEvents(),this.formElement&&e.EventHandler.remove(this.formElement,"reset",this.formResetHandler),o(this,this.getWrapper(),this.tagName),this.refreshing&&(["e-control","e-switch","e-lib"].forEach((function(e){i.element.classList.add(e)})),(0,e.setValue)("ej2_instances",[this],this.element))},i.prototype.focusHandler=function(){this.isFocused=!0},i.prototype.focusOutHandler=function(){this.getWrapper().classList.remove("e-focus")},i.prototype.getModuleName=function(){return"switch"},i.prototype.getPersistData=function(){return this.addOnPersist(["checked"])},i.prototype.getWrapper=function(){return this.element.parentElement?this.element.parentElement:null},i.prototype.initialize=function(){this.element.setAttribute("role","switch"),(0,e.isNullOrUndefined)(this.initialSwitchCheckedValue)&&(this.initialSwitchCheckedValue=this.checked),this.name&&this.element.setAttribute("name",this.name),this.value&&this.element.setAttribute("value",this.value),this.checked&&this.changeState(!0),this.disabled&&this.setDisabled(),(this.onLabel||this.offLabel)&&this.setLabel(this.onLabel,this.offLabel)},i.prototype.initWrapper=function(){var t=this.element.parentElement;t.classList.contains(G)||(t=this.createElement("div",{className:G}),this.element.parentNode.insertBefore(t,this.element));var i=this.createElement("span",{className:"e-switch-inner"}),s=this.createElement("span",{className:"e-switch-on"}),n=this.createElement("span",{className:"e-switch-off"}),o=this.createElement("span",{className:"e-switch-handle"});if(t.appendChild(this.element),p(this,t),i.appendChild(s),i.appendChild(n),t.appendChild(i),t.appendChild(o),e.isRippleEnabled){var r=this.createElement("span",{className:X});o.appendChild(r),(0,e.rippleEffect)(r,{duration:400,isCenterRipple:!0})}t.classList.add("e-wrapper"),this.enableRtl&&t.classList.add(J),this.cssClass&&(0,e.addClass)([t],this.cssClass.replace(/\s+/g," ").trim().split(" "))},i.prototype.onPropertyChanged=function(t,i){for(var s=this.getWrapper(),n=0,o=Object.keys(t);n<o.length;n++){switch(o[n]){case"checked":this.changeState(t.checked);break;case"disabled":t.disabled?(this.setDisabled(),this.unWireEvents(),this.isWireEvents=!1):(this.element.disabled=!1,s.classList.remove(K),s.setAttribute("aria-disabled","false"),this.isWireEvents||(this.wireEvents(),this.isWireEvents=!0));break;case"value":this.element.setAttribute("value",t.value);break;case"name":this.element.setAttribute("name",t.name);break;case"onLabel":case"offLabel":this.setLabel(t.onLabel,t.offLabel);break;case"enableRtl":t.enableRtl?s.classList.add(J):s.classList.remove(J);break;case"cssClass":i.cssClass&&(0,e.removeClass)([s],i.cssClass.split(/\s+/).filter((function(e){return e.length>0}))),t.cssClass&&(0,e.addClass)([s],t.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"htmlAttributes":this.updateHtmlAttribute()}}},i.prototype.preRender=function(){var t=this.element;this.formElement=(0,e.closest)(this.element,"form"),this.tagName=this.element.tagName,r(this,"EJS-SWITCH",G,t,this.getModuleName())},i.prototype.render=function(){this.initWrapper(),this.initialize(),this.disabled||this.wireEvents(),this.formElement&&e.EventHandler.add(this.formElement,"reset",this.formResetHandler,this),this.renderComplete(),this.updateHtmlAttribute()},i.prototype.rippleHandler=function(e){a(e,this.getWrapper().getElementsByClassName(X)[0]),"mousedown"===e.type&&e.currentTarget.classList.contains("e-switch-wrapper")&&1===e.which&&(this.isDrag=!0,this.isFocused=!1)},i.prototype.mouseLeaveHandler=function(e){var t=this.element.parentElement.getElementsByClassName(X)[0];if(t){for(var i=t.querySelectorAll(".e-ripple-element").length-1;i>0;i--)t.removeChild(t.childNodes[i]);a(e,t)}},i.prototype.rippleTouchHandler=function(e){var t=this.getWrapper().getElementsByClassName(X)[0];if(t){var i=document.createEvent("MouseEvents");i.initEvent(e,!1,!0),t.dispatchEvent(i)}},i.prototype.setDisabled=function(){var e=this.getWrapper();this.element.disabled=!0,e.classList.add(K),e.setAttribute("aria-disabled","true")},i.prototype.setLabel=function(e,t){var i=this.getWrapper();e&&(i.querySelector(".e-switch-on").textContent=e),t&&(i.querySelector(".e-switch-off").textContent=t)},i.prototype.updateHtmlAttribute=function(){if(!(0,e.isNullOrUndefined)(this.htmlAttributes))for(var t=0,i=Object.keys(this.htmlAttributes);t<i.length;t++){var s=i[t],n=this.getWrapper();Q.indexOf(s)>-1?"class"===s?(0,e.addClass)([n],this.htmlAttributes[""+s].split(" ")):"title"===s||"style"===s?n.setAttribute(s,this.htmlAttributes[""+s]):"disabled"===s?("true"===this.htmlAttributes[""+s]&&this.setDisabled(),this.element.setAttribute(s,this.htmlAttributes[""+s])):this.element.setAttribute(s,this.htmlAttributes[""+s]):n.setAttribute(s,this.htmlAttributes[""+s])}},i.prototype.switchFocusHandler=function(e){this.isFocused&&this.getWrapper().classList.add("e-focus"),e&&"keyup"===e.type&&"Space"===e.code&&this.isAngular&&(this.clickHandler(e),e.stopPropagation(),e.preventDefault())},i.prototype.switchMouseUp=function(e){var t=0,i=0,s=0,n=0,o=e.target;"touchmove"===e.type&&(e.preventDefault(),s=e.changedTouches[0].clientX,t=e.changedTouches[0].clientY,n=this.bTouchX-s,i=this.bTouchY-t,Math.abs(n)<Math.abs(i)?(this.isDrag=!1,this.rippleTouchHandler("mouseup")):this.isDrag=!0),"touchstart"===e.type&&(this.bTouchX=e.changedTouches[0].clientX,this.bTouchY=e.changedTouches[0].clientY,this.isDrag=!0,this.rippleTouchHandler("mousedown")),this.isDrag&&("mouseup"===e.type&&o.className.indexOf("e-switch")<0||"touchend"===e.type)&&(n=this.bTouchX-e.changedTouches[0].clientX,i=this.bTouchY-e.changedTouches[0].clientY,Math.abs(n)>=Math.abs(i)&&(this.clickHandler(e),this.rippleTouchHandler("mouseup"),e.preventDefault()))},i.prototype.formResetHandler=function(){this.checked=this.initialSwitchCheckedValue,this.element.checked=this.initialSwitchCheckedValue},i.prototype.toggle=function(){this.clickHandler()},i.prototype.wireEvents=function(){var t=this.getWrapper();this.delegateMouseUpHandler=this.switchMouseUp.bind(this),this.delegateKeyUpHandler=this.switchFocusHandler.bind(this),e.EventHandler.add(t,"click",this.clickHandler,this),e.EventHandler.add(this.element,"focus",this.focusHandler,this),e.EventHandler.add(this.element,"focusout",this.focusOutHandler,this),e.EventHandler.add(this.element,"mouseup",this.delegateMouseUpHandler,this),e.EventHandler.add(this.element,"keyup",this.delegateKeyUpHandler,this),e.EventHandler.add(t,"mousedown mouseup",this.rippleHandler,this),e.EventHandler.add(t,"mouseleave",this.mouseLeaveHandler,this),e.EventHandler.add(t,"touchstart touchmove touchend",this.switchMouseUp,this)},i.prototype.unWireEvents=function(){var t=this.getWrapper();e.EventHandler.remove(t,"click",this.clickHandler),e.EventHandler.remove(this.element,"focus",this.focusHandler),e.EventHandler.remove(this.element,"focusout",this.focusOutHandler),e.EventHandler.remove(this.element,"mouseup",this.delegateMouseUpHandler),e.EventHandler.remove(this.element,"keyup",this.delegateKeyUpHandler),e.EventHandler.remove(t,"mousedown mouseup",this.rippleHandler),e.EventHandler.remove(t,"mouseleave",this.mouseLeaveHandler),e.EventHandler.remove(t,"touchstart touchmove touchend",this.switchMouseUp)},i.prototype.click=function(){this.element.click()},i.prototype.focusIn=function(){this.element.focus()},z([(0,e.Event)()],i.prototype,"beforeChange",void 0),z([(0,e.Event)()],i.prototype,"change",void 0),z([(0,e.Event)()],i.prototype,"created",void 0),z([(0,e.Property)(!1)],i.prototype,"checked",void 0),z([(0,e.Property)("")],i.prototype,"cssClass",void 0),z([(0,e.Property)(!1)],i.prototype,"disabled",void 0),z([(0,e.Property)("")],i.prototype,"name",void 0),z([(0,e.Property)("")],i.prototype,"onLabel",void 0),z([(0,e.Property)("")],i.prototype,"offLabel",void 0),z([(0,e.Property)("")],i.prototype,"value",void 0),z([(0,e.Property)({})],i.prototype,"htmlAttributes",void 0),i=z([e.NotifyPropertyChanges],i)}(e.Component),ee=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),te=function(e,t,i,s){var n,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(r=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},ie={chipSet:"e-chip-set",chip:"e-chip",avatar:"e-chip-avatar",text:"e-chip-text",icon:"e-chip-icon",delete:"e-chip-delete",deleteIcon:"e-dlt-btn",multiSelection:"e-multi-selection",singleSelection:"e-selection",active:"e-active",chipWrapper:"e-chip-avatar-wrap",iconWrapper:"e-chip-icon-wrap",focused:"e-focused",disabled:"e-disabled",rtl:"e-rtl",template:"e-chip-template",chipList:"e-chip-list",customIcon:"e-icons",chipDrag:"e-chip-drag",dragAndDrop:"e-drag-and-drop",dropRestricted:"e-error-treeview",cloneChip:"e-clone-chip",dragIndicator:"e-drag-indicator"},se=function(t){function i(e,i){var s=t.call(this,e,i)||this;return s.multiSelectedChip=[],s}var s;return ee(i,t),s=i,i.prototype.preRender=function(){},i.prototype.chipType=function(){return this.chips&&this.chips.length&&this.chips.length>0},i.prototype.render=function(){this.type=!(0,e.isNullOrUndefined)(this.chips)&&this.chips.length?"chipset":this.text||this.element.innerText?"chip":"chipset",this.setAttributes(),this.createChip(),this.setRtl(),this.select(this.selectedChips),this.wireEvent(!1),this.rippleFunction=(0,e.rippleEffect)(this.element,{selector:"."+ie.chip}),this.renderComplete(),this.dragCollection=[],this.allowDragAndDrop&&this.enableDraggingChips()},i.prototype.enableDraggingChips=function(){var t,i=this;this.element.querySelectorAll("."+ie.chip).forEach((function(s,n){i.dragObj=new e.Draggable(s,{preventDefault:!1,clone:!0,dragArea:i.dragArea,helper:function(){return(t=s.cloneNode(!0)).classList.add(ie.cloneChip),i.element.appendChild(t),t},dragStart:function(s){i.dragIndicator=i.createElement("div",{className:ie.dragIndicator}),document.body.appendChild(i.dragIndicator);var o=i.find(s.element),r={cancel:!1,event:s.event,draggedItem:s.element,draggedItemData:o,dropTarget:null};i.trigger("dragStart",r,(function(){(0,e.isNullOrUndefined)(r.cancel)&&(r.cancel=!1)})),r.cancel?i.dragObj.intDestroy(s.event):t.setAttribute("drag-indicator-index",n.toString())},drag:function(s){var n=i.find(s.element),o={event:s.event,draggedItem:s.element,draggedItemData:n,dropTarget:null};i.trigger("dragging",o);var r=t.querySelector("."+ie.chipDrag);(0,e.isNullOrUndefined)(r)&&(r=i.createElement("span",{className:ie.customIcon+" "+ie.dragAndDrop+" "+ie.chipDrag}),t.prepend(r)),i.allowExternalDragging(s,t,r)},dragStop:function(s){var n=i.find(s.element),o={cancel:!1,event:s.event,draggedItem:s.element,draggedItemData:n,dropTarget:s.target};i.trigger("dragStop",o,(function(){(0,e.isNullOrUndefined)(o.cancel)&&(o.cancel=!1)})),o.cancel||i.allowExternalDrop(s,t),(0,e.isNullOrUndefined)(i.dragIndicator)||(0,e.remove)(i.dragIndicator),(0,e.isNullOrUndefined)(t)||t.remove()}}),-1===i.dragCollection.indexOf(i.dragObj)&&i.dragCollection.push(i.dragObj)}))},i.prototype.checkInstance=function(t,i){var s=!(0,e.isNullOrUndefined)(t.target.closest("."+ie.chipList))&&t.target.closest("."+ie.chipList).id!==i.element.id;return s&&(this.updatedInstance=t.target.closest("."+ie.chipList)),s},i.prototype.setIcons=function(e,t,i,s,n){var o=e.element.contains(i),r=i.closest(".e-droppable");!o&&!r||n?(t.classList.remove(ie.dragAndDrop),t.classList.add(ie.dropRestricted),s.style.display="none"):(t.classList.add(ie.dragAndDrop),t.classList.remove(ie.dropRestricted),r&&(s.style.display="none"))},i.prototype.allowExternalDragging=function(e,t,i){var s,n=null,o=1/0,r=-1,l=!1;if(this.checkInstance(e,this)){if(this.dragIndicator.style.display="none",(s=this.getCurrentInstance(e)).dragIndicator=this.dragIndicator,!s.allowDragAndDrop)return}else s=this;var a=s.dragIndicator;a.style.display="inline",l=this.dragAreaCheck(this.dragArea,e.target,l,i,a),this.setIcons(s,i,e.target,a,l),s.element.appendChild(t);var p=t.getBoundingClientRect(),c=Array.from(s.element.querySelectorAll("."+ie.chip));c.forEach((function(e,i){if(e!==t){var s=e.getBoundingClientRect(),l=Math.sqrt(Math.pow(p.left-s.left,2)+Math.pow(p.top-s.top,2));l<o&&(o=l,n=e,r=i)}})),-1===r&&(r=c.length);var h,d=this.getChipsDistance(s),u=t.getBoundingClientRect();(n||c.length>0)&&(h=(n||c[c.length-1]).getBoundingClientRect(),a.style.top=h.top+window.scrollY+"px",a.style.left=s.enableRtl?h.right+d+"px":h.left-d+window.scrollX+"px");s.enableRtl?u.left<h.left-h.width/2&&u.top>h.top&&(a.style.left=h.left-d+window.scrollX+"px"):u.left>h.left+h.width/2&&u.top>h.top&&(a.style.left=h.left+h.width+d+window.scrollX+"px")},i.prototype.dragAreaCheck=function(t,i,s,n,o){if((0,e.isNullOrUndefined)(t))return!1;var r="string"==typeof t,l=t instanceof HTMLElement,a=r?document.querySelector(t):t;return(0,e.isNullOrUndefined)(a)||!r&&!l||a.contains(i)||(s=!0,o.style.display="none",n.classList.add(ie.dropRestricted),n.classList.remove(ie.dragAndDrop)),s},i.prototype.getChipsDistance=function(e){if(e.chips.length<=1)return 4;var t=e.find(0).element.getBoundingClientRect(),i=e.find(1).element.getBoundingClientRect(),s=t.left;if(e.enableRtl){var n=i.right;return s<n?4:(s-n)/2}var o=t.width,r=i.left;return r<s+o?4:(r-(s+o))/2},i.prototype.getCurrentInstance=function(t){var i=t.target.closest("."+ie.chipList);if(!(0,e.isNullOrUndefined)(i)&&!(0,e.isNullOrUndefined)(i.ej2_instances))for(var n=0;n<i.ej2_instances.length;n++)if(i.ej2_instances[parseInt(n.toString(),10)]instanceof s)return i.ej2_instances[n];return null},i.prototype.allowExternalDrop=function(e,t){var i,s=parseInt(t.getAttribute("drag-indicator-index"),10),n=!1,o=!1;if(this.checkInstance(e,this)){if(o=!0,!(i=this.getCurrentInstance(e)).allowDragAndDrop)return}else i=this;var r=i.dragIndicator;if(r.style.display="inline",i.element.contains(e.target)&&!(n=this.dragAreaCheck(this.dragArea,e.target,n,t.querySelector("."+ie.chipDrag),r))){for(var l=r.getBoundingClientRect(),a=Array.from(i.element.querySelectorAll("."+ie.chip)),p=-1,c=!1,h=!1,d=!1,u=0;u<a.length;u++)if(a[u]!==t){var f=a[u].getBoundingClientRect();if(c=l.top<f.top+f.height/2,h=l.left<f.left+f.width/2,d=l.left>f.left+f.width/2,!i.enableRtl&&c&&h||i.enableRtl&&c&&d){p=u,u>s&&!o&&(p=u-1);break}}if(-1===p){var m=void 0;for(u=0;u<a.length;u++){if((f=a[u].getBoundingClientRect()).top>l.top||f.top===l.top&&f.left>l.left){m=u;break}}p=m!==a.length?m:a.length}var v=Array.from(this.chips);o?this.dropChip(v,s,i,p,!0):p!==s&&this.dropChip(v,s,i,p,!1)}},i.prototype.dropChip=function(e,t,i,s,n){var o=e.splice(t,1)[0];if(n){var r=Array.from(i.chips);r.splice(s,0,o),i.chips=r}else e.splice(s,0,o),i.chips=e;this.chips=e,i.dataBind(),this.dataBind(),i.enableDraggingChips()},i.prototype.createChip=function(){this.innerText=this.element.innerText&&0!==this.element.innerText.length?this.element.innerText.trim():this.element.innerText,this.element.innerHTML="",this.chipCreation("chip"===this.type?[this.innerText?this.innerText:this.text]:this.chips)},i.prototype.setAttributes=function(){"chip"===this.type?(this.enabled&&(this.element.tabIndex=0),this.element.setAttribute("role","button")):(this.element.classList.add(ie.chipSet),this.element.setAttribute("role","listbox"),"Multiple"===this.selection?(this.element.classList.add(ie.multiSelection),this.element.setAttribute("aria-multiselectable","true")):"Single"===this.selection?(this.element.classList.add(ie.singleSelection),this.element.setAttribute("aria-multiselectable","false")):this.element.setAttribute("aria-multiselectable","false"))},i.prototype.setRtl=function(){this.element.classList[this.enableRtl?"add":"remove"](ie.rtl)},i.prototype.renderTemplates=function(){this.isReact&&this.renderReactTemplates()},i.prototype.templateParser=function(t){if(t)try{return"function"!=typeof t&&document.querySelectorAll(t).length?(0,e.compile)(document.querySelector(t).innerHTML.trim()):(0,e.compile)(t)}catch(i){return(0,e.compile)(t)}},i.prototype.chipCreation=function(t){if(!(0,e.isNullOrUndefined)(t)){for(var i=[],s=[],n=0;n<t.length;n++){var o=this.getFieldValues(t[n]),r=o.htmlAttributes;s.push(r);var l=this.elementCreation(o),a=(ie.chip+" "+(o.enabled?" ":ie.disabled)+" "+(o.avatarIconCss||o.avatarText?ie.chipWrapper:o.leadingIconCss?ie.iconWrapper:" ")+" "+o.cssClass).split(" ").filter((function(e){return e}));if(this.chipType()&&"chip"!==this.type){var p=this.createElement("DIV",{className:a.join(" "),attrs:{tabIndex:"0",role:"option","aria-label":o.text,"aria-selected":"false"}});if(this.enableDelete&&p.setAttribute("aria-keyshortcuts","Press delete or backspace key to delete"),o.value&&p.setAttribute("data-value",o.value.toString()),o.enabled?p.setAt