@syncfusion/ej2-calendars
Version:
A complete package of date or time components with built-in features such as date formatting, inline editing, multiple (range) selection, range restriction, month and year selection, strict mode, and globalization.
12 lines • 384 kB
JavaScript
/*!
* filename: ej2-calendars.umd.min.js
* version : 32.1.24
* Copyright Syncfusion Inc. 2001 - 2025. 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&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-lists")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-popups","@syncfusion/ej2-inputs","@syncfusion/ej2-buttons","@syncfusion/ej2-lists"],t):t((e=e||self).ej={},e.ej2Base,e.ej2Popups,e.ej2Inputs,e.ej2Buttons,e.ej2Lists)}(this,function(i,O,H,u,W,F){"use strict";L=function(e,t){return(L=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)};var L,B,j=function(e,t){function i(){this.constructor=e}L(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},e=function(e,t,i,s){var a,n=arguments.length,r=n<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;0<=l;l--)(a=e[l])&&(r=(n<3?a(r):3<n?a(t,i,r):a(t,i))||r);return 3<n&&r&&Object.defineProperty(t,i,r),r},N="e-other-month",Y="e-other-year",R="e-calendar",z="e-device",q="e-rtl",K="e-year",G="e-month",_="e-decade",Z="e-icons",I="e-disabled",X="e-overlay",J="e-week-number",T="e-selected",y="e-focused-date",$="e-focused-cell",Q="e-month-hide",ee="e-today",te="e-day",ie="e-cell",se="e-zoomin",ae="e-calendar-day-header-lg",ne=864e5,re=(B=O.Component,j(t,B),t.prototype.render=function(){this.rangeValidation(this.min,this.max),this.calendarEleCopy=this.element.cloneNode(!0),"Islamic"===this.calendarMode&&(+this.min.setSeconds(0)==+new Date(1900,0,1,0,0,0)&&(this.min=new Date(1941,12,18)),+this.max==+new Date(2099,11,31))&&(this.max=new Date(2068,2,4)),this.globalize=new O.Internationalization(this.locale),(O.isNullOrUndefined(this.firstDayOfWeek)||6<this.firstDayOfWeek||this.firstDayOfWeek<0)&&this.setProperties({firstDayOfWeek:this.globalize.getFirstDayOfWeek()},!0),this.todayDisabled=!1,this.todayDate=new Date((new Date).setHours(0,0,0,0)),"calendar"===this.getModuleName()?(this.element.classList.add(R),this.enableRtl&&this.element.classList.add(q),O.Browser.isDevice&&this.element.classList.add(z),O.attributes(this.element,{"data-role":"calendar"}),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.setAttribute("tabindex",this.tabIndex)):(this.calendarElement=this.createElement("div"),this.calendarElement.classList.add(R),this.enableRtl&&this.calendarElement.classList.add(q),O.Browser.isDevice&&this.calendarElement.classList.add(z),O.attributes(this.calendarElement,{"data-role":"calendar"})),!O.isNullOrUndefined(O.closest(this.element,"fieldset"))&&O.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.createHeader(),this.createContent(),this.wireEvents()},t.prototype.rangeValidation=function(e,t){O.isNullOrUndefined(e)&&this.setProperties({min:new Date(1900,0,1)},!0),O.isNullOrUndefined(t)&&this.setProperties({max:new Date(2099,11,31)},!0)},t.prototype.getDefaultKeyConfig=function(){return this.defaultKeyConfigs={controlUp:"ctrl+38",controlDown:"ctrl+40",moveDown:"downarrow",moveUp:"uparrow",moveLeft:"leftarrow",moveRight:"rightarrow",select:"enter",home:"home",end:"end",pageUp:"pageup",pageDown:"pagedown",shiftPageUp:"shift+pageup",shiftPageDown:"shift+pagedown",controlHome:"ctrl+home",controlEnd:"ctrl+end",altUpArrow:"alt+uparrow",spacebar:"space",altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"},this.defaultKeyConfigs},t.prototype.validateDate=function(e){this.setProperties({min:this.checkDateValue(new Date(this.checkValue(this.min)))},!0),this.setProperties({max:this.checkDateValue(new Date(this.checkValue(this.max)))},!0),this.currentDate=this.currentDate||new Date((new Date).setHours(0,0,0,0)),!O.isNullOrUndefined(e)&&this.min<=this.max&&e>=this.min&&e<=this.max&&(this.currentDate=new Date(this.checkValue(e)))},t.prototype.setOverlayIndex=function(e,t,i,s){!s||O.isNullOrUndefined(t)||O.isNullOrUndefined(i)||O.isNullOrUndefined(e)||(s=parseInt(t.style.zIndex,10)?parseInt(t.style.zIndex,10):1e3,i.style.zIndex=(s-1).toString(),e.style.zIndex=s.toString())},t.prototype.minMaxUpdate=function(e){this.min=O.isNullOrUndefined(this.min)||!+this.min?this.min=new Date(1900,0,1):this.min,this.max=O.isNullOrUndefined(this.max)||!+this.max?this.max=new Date(2099,11,31):this.max,+this.min<=+this.max?O.removeClass([this.element],X):(this.setProperties({min:this.min},!0),O.addClass([this.element],X)),+this.min<=+this.max&&e&&+e<=+this.max&&+e>=+this.min?this.currentDate=new Date(this.checkValue(e)):+this.min<=+this.max&&!e&&+this.currentDate>+this.max?this.currentDate=new Date(this.checkValue(this.max)):+this.currentDate<+this.min&&(this.currentDate=new Date(this.checkValue(this.min)))},t.prototype.createHeader=function(){var e={tabindex:"0"},t=(this.headerElement=this.createElement("div",{className:"e-header"}),this.createElement("div",{className:"e-icon-container"}));this.previousIcon=this.createElement("button",{className:"e-prev",attrs:{type:"button"}}),O.rippleEffect(this.previousIcon,{duration:400,selector:".e-prev",isCenterRipple:!0}),O.attributes(this.previousIcon,{"aria-disabled":"false","aria-label":"previous month"}),O.attributes(this.previousIcon,e),this.nextIcon=this.createElement("button",{className:"e-next",attrs:{type:"button"}}),O.rippleEffect(this.nextIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),"daterangepicker"===this.getModuleName()&&(O.attributes(this.previousIcon,{tabIndex:"-1"}),O.attributes(this.nextIcon,{tabIndex:"-1"})),O.attributes(this.nextIcon,{"aria-disabled":"false","aria-label":"next month"}),O.attributes(this.nextIcon,e),this.headerTitleElement=this.createElement("div",{className:te+" e-title"}),O.attributes(this.headerTitleElement,{"aria-atomic":"true","aria-live":"assertive"}),O.attributes(this.headerTitleElement,e),this.headerElement.appendChild(this.headerTitleElement),this.previousIcon.appendChild(this.createElement("span",{className:"e-date-icon-prev "+Z})),this.nextIcon.appendChild(this.createElement("span",{className:"e-date-icon-next "+Z})),t.appendChild(this.previousIcon),t.appendChild(this.nextIcon),this.headerElement.appendChild(t),("calendar"===this.getModuleName()?this.element:this.calendarElement).appendChild(this.headerElement),this.adjustLongHeaderSize()},t.prototype.createContent=function(){this.contentElement=this.createElement("div",{className:"e-content"}),this.table=this.createElement("table",{attrs:{class:"e-calendar-content-table",tabIndex:"0",role:"grid","aria-activedescendant":"","aria-labelledby":this.element.id}}),("calendar"===this.getModuleName()?this.element:this.calendarElement).appendChild(this.contentElement),this.contentElement.appendChild(this.table),this.createContentHeader(),this.createContentBody(),this.showTodayButton&&this.createContentFooter(),"daterangepicker"!==this.getModuleName()&&(O.EventHandler.add(this.table,"focus",this.addContentFocus,this),O.EventHandler.add(this.table,"blur",this.removeContentFocus,this))},t.prototype.addContentFocus=function(e){var t=this.tableBodyElement.querySelector("tr td.e-focused-date"),i=this.tableBodyElement.querySelector("tr td.e-selected");O.isNullOrUndefined(i)?O.isNullOrUndefined(t)||t.classList.add($):i.classList.add($)},t.prototype.removeContentFocus=function(e){var t=O.isNullOrUndefined(this.tableBodyElement)?null:this.tableBodyElement.querySelector("tr td.e-focused-date"),i=O.isNullOrUndefined(this.tableBodyElement)?null:this.tableBodyElement.querySelector("tr td.e-selected");O.isNullOrUndefined(i)?O.isNullOrUndefined(t)||t.classList.remove($):i.classList.remove($)},t.prototype.getCultureValues=function(){var e=[],t=O.isNullOrUndefined(this.dayHeaderFormat)?null:"days.stand-alone."+this.dayHeaderFormat.toLowerCase(),i="en"!==this.locale&&"en-US"!==this.locale||O.isNullOrUndefined(t)?this.getCultureObjects(O.cldrData,""+this.locale):O.getValue(t,O.getDefaultDateObject());if(!O.isNullOrUndefined(i))for(var s=0,a=Object.keys(i);s<a.length;s++){var n=a[s];e.push(O.getValue(n,i))}return e},t.prototype.toCapitalize=function(e){return!O.isNullOrUndefined(e)&&e.length?e[0].toUpperCase()+e.slice(1):e},t.prototype.createContentHeader=function(){"calendar"===this.getModuleName()?O.isNullOrUndefined(this.element.querySelectorAll(".e-content .e-week-header")[0])||O.detach(this.element.querySelectorAll(".e-content .e-week-header")[0]):O.isNullOrUndefined(this.calendarElement.querySelectorAll(".e-content .e-week-header")[0])||O.detach(this.calendarElement.querySelectorAll(".e-content .e-week-header")[0]);var e="",t=((6<this.firstDayOfWeek||this.firstDayOfWeek<0)&&this.setProperties({firstDayOfWeek:0},!0),this.tableHeadElement=this.createElement("thead",{className:"e-week-header"}),this.weekNumber&&(e+='<th class="e-week-number" aria-hidden="true"></th>',"calendar"===this.getModuleName()?O.addClass([this.element],J):O.addClass([this.calendarElement],J)),0<this.getCultureValues().length&&this.getCultureValues()?this.shiftArray(0<this.getCultureValues().length&&this.getCultureValues(),this.firstDayOfWeek):null);if(!O.isNullOrUndefined(t))for(var i=0;i<=6;i++)e+='<th class="">'+this.toCapitalize(t[i])+"</th>";this.tableHeadElement.innerHTML=e="<tr>"+e+"</tr>",this.table.appendChild(this.tableHeadElement)},t.prototype.createContentBody=function(){switch("calendar"===this.getModuleName()?O.isNullOrUndefined(this.element.querySelectorAll(".e-content tbody")[0])||O.detach(this.element.querySelectorAll(".e-content tbody")[0]):O.isNullOrUndefined(this.calendarElement.querySelectorAll(".e-content tbody")[0])||O.detach(this.calendarElement.querySelectorAll(".e-content tbody")[0]),this.start){case"Year":this.renderYears();break;case"Decade":this.renderDecades();break;default:this.renderMonths()}},t.prototype.updateFooter=function(){this.todayElement.textContent=this.l10.getConstant("today"),this.todayElement.setAttribute("aria-label",this.l10.getConstant("today")),this.todayElement.setAttribute("tabindex","0")},t.prototype.createContentFooter=function(){var e,t;this.showTodayButton&&(e=new Date(+this.min),t=new Date(+this.max),this.globalize=new O.Internationalization(this.locale),this.l10=new O.L10n(this.getModuleName(),{today:"Today"},this.locale),this.todayElement=this.createElement("button",{attrs:{role:"button"}}),O.rippleEffect(this.todayElement),this.updateFooter(),O.addClass([this.todayElement],["e-btn",ee,"e-flat","e-primary","e-css"]),+new Date(e.setHours(0,0,0,0))<=+this.todayDate&&+this.todayDate<=+new Date(t.setHours(0,0,0,0))&&!this.todayDisabled||O.addClass([this.todayElement],I),this.footer=this.createElement("div",{className:"e-footer-container"}),this.footer.appendChild(this.todayElement),"calendar"===this.getModuleName()&&this.element.appendChild(this.footer),"datepicker"===this.getModuleName()&&this.calendarElement.appendChild(this.footer),"datetimepicker"===this.getModuleName()&&this.calendarElement.appendChild(this.footer),this.todayElement.classList.contains(I)||O.EventHandler.add(this.todayElement,"click",this.todayButtonClick,this))},t.prototype.wireEvents=function(e,t,i,s){O.EventHandler.add(this.headerTitleElement,"click",this.navigateTitle,this),this.defaultKeyConfigs=O.extend(this.defaultKeyConfigs,this.keyConfigs),"calendar"===this.getModuleName()?this.keyboardModule=new O.KeyboardEvents(this.element,{eventName:"keydown",keyAction:this.keyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs}):this.keyboardModule=new O.KeyboardEvents(this.calendarElement,{eventName:"keydown",keyAction:this.keyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})},t.prototype.dateWireEvents=function(e,t,i,s){this.defaultKeyConfigs=this.getDefaultKeyConfig(),this.defaultKeyConfigs=O.extend(this.defaultKeyConfigs,i),this.serverModuleName=s},t.prototype.todayButtonClick=function(e,t,i){this.showTodayButton&&(this.currentView()===this.depth?this.effect="":this.effect="e-zoomin",this.getViewNumber(this.start)>=this.getViewNumber(this.depth)?this.navigateTo(this.depth,new Date(this.checkValue(t)),i):this.navigateTo("Month",new Date(this.checkValue(t)),i))},t.prototype.resetCalendar=function(){this.calendarElement&&O.detach(this.calendarElement),this.tableBodyElement&&O.detach(this.tableBodyElement),this.table&&O.detach(this.table),this.tableHeadElement&&O.detach(this.tableHeadElement),this.nextIcon&&O.detach(this.nextIcon),this.previousIcon&&O.detach(this.previousIcon),this.footer&&O.detach(this.footer),this.todayElement=null,this.renderDayCellArgs=null,this.calendarElement=this.tableBodyElement=this.footer=this.tableHeadElement=this.nextIcon=this.previousIcon=this.table=null},t.prototype.keyActionHandle=function(e,t,i){if(null!==this.calendarElement||"escape"!==e.action){var s,a,n=this.tableBodyElement.querySelector("tr td.e-focused-date"),r=!i||O.isNullOrUndefined(n)||+t!==parseInt(n.getAttribute("id").split("_")[0],10)?this.tableBodyElement.querySelector("tr td.e-selected"):n,l=this.getViewNumber(this.currentView()),i=this.getViewNumber(this.depth),o=l===i&&this.getViewNumber(this.start)>=i;switch(this.effect="",e.action){case"moveLeft":"daterangepicker"===this.getModuleName()||O.isNullOrUndefined(e.target)||(this.keyboardNavigate(-1,l,e,this.max,this.min),e.preventDefault());break;case"moveRight":"daterangepicker"===this.getModuleName()||O.isNullOrUndefined(e.target)||(this.keyboardNavigate(1,l,e,this.max,this.min),e.preventDefault());break;case"moveUp":"daterangepicker"===this.getModuleName()||O.isNullOrUndefined(e.target)||(0===l?this.keyboardNavigate(-7,l,e,this.max,this.min):this.keyboardNavigate(-4,l,e,this.max,this.min),e.preventDefault());break;case"moveDown":"daterangepicker"===this.getModuleName()||O.isNullOrUndefined(e.target)||(0===l?this.keyboardNavigate(7,l,e,this.max,this.min):this.keyboardNavigate(4,l,e,this.max,this.min),e.preventDefault());break;case"select":e.target===this.headerTitleElement?this.navigateTitle(e):e.target!==this.previousIcon||e.target.className.includes(I)?e.target!==this.nextIcon||e.target.className.includes(I)?e.target!==this.todayElement||e.target.className.includes(I)?(s=O.isNullOrUndefined(n)?r:n,O.isNullOrUndefined(s)||s.classList.contains(I)||(o?(a=new Date(parseInt(""+s.id,0)),this.selectDate(e,a,s),"datepicker"!==this.getModuleName()&&"datetimepicker"!==this.getModuleName()||(this.isAngular?this.inputElement:this.element).focus()):e.target.className.includes(I)||this.contentClick(null,--l,s,t))):(this.todayButtonClick(e,t),"datepicker"!==this.getModuleName()&&"datetimepicker"!==this.getModuleName()||(this.isAngular?this.inputElement:this.element).focus()):this.navigateNext(e):this.navigatePrevious(e);break;case"controlUp":this.title(),e.preventDefault();break;case"controlDown":(O.isNullOrUndefined(n)||o)&&(O.isNullOrUndefined(r)||o)||this.contentClick(null,--l,n||r,t),e.preventDefault();break;case"home":this.currentDate=this.firstDay(this.currentDate),O.detach(this.tableBodyElement),0===l?this.renderMonths(e):1===l?this.renderYears(e):this.renderDecades(e),e.preventDefault();break;case"end":this.currentDate=this.lastDay(this.currentDate,l),O.detach(this.tableBodyElement),0===l?this.renderMonths(e):1===l?this.renderYears(e):this.renderDecades(e),e.preventDefault();break;case"pageUp":this.addMonths(this.currentDate,-1),this.navigateTo("Month",this.currentDate),e.preventDefault();break;case"pageDown":this.addMonths(this.currentDate,1),this.navigateTo("Month",this.currentDate),e.preventDefault();break;case"shiftPageUp":this.addYears(this.currentDate,-1),this.navigateTo("Month",this.currentDate),e.preventDefault();break;case"shiftPageDown":this.addYears(this.currentDate,1),this.navigateTo("Month",this.currentDate),e.preventDefault();break;case"controlHome":this.navigateTo("Month",new Date(this.currentDate.getFullYear(),0,1)),e.preventDefault();break;case"controlEnd":this.navigateTo("Month",new Date(this.currentDate.getFullYear(),11,31)),e.preventDefault();break;case"tab":"datepicker"!==this.getModuleName()&&"datetimepicker"!==this.getModuleName()||(this.showTodayButton&&!O.isNullOrUndefined(this.todayElement)?e.target===this.todayElement:e.target===this.table)&&(e.preventDefault(),(this.isAngular?this.inputElement:this.element).focus(),this.hide());break;case"shiftTab":"datepicker"!==this.getModuleName()&&"datetimepicker"!==this.getModuleName()||e.target!==this.headerTitleElement||(e.preventDefault(),(this.isAngular?this.inputElement:this.element).focus(),this.hide());break;case"escape":"datepicker"!==this.getModuleName()&&"datetimepicker"!==this.getModuleName()||e.target!==this.headerTitleElement&&e.target!==this.previousIcon&&e.target!==this.nextIcon&&e.target!==this.todayElement||this.hide()}}},t.prototype.keyboardNavigate=function(e,t,i,s,a){var n=new Date(this.checkValue(this.currentDate));switch(t){case 2:this.addYears(this.currentDate,e),this.isMonthYearRange(this.currentDate)?(O.detach(this.tableBodyElement),this.renderDecades(i)):this.currentDate=n;break;case 1:this.addMonths(this.currentDate,e),this.calendarMode,this.isMonthYearRange(this.currentDate)?(O.detach(this.tableBodyElement),this.renderYears(i)):this.currentDate=n;break;case 0:this.addDay(this.currentDate,e,i,s,a),this.isMinMaxRange(this.currentDate)?(O.detach(this.tableBodyElement),this.renderMonths(i)):this.currentDate=n}},t.prototype.preRender=function(e){var t=this;this.navigatePreviousHandler=this.navigatePrevious.bind(this),this.navigateNextHandler=this.navigateNext.bind(this),this.defaultKeyConfigs=this.getDefaultKeyConfig(),this.navigateHandler=function(e){t.triggerNavigate(e)}},t.prototype.minMaxDate=function(e){var t=new Date(new Date(+e).setHours(0,0,0,0)),i=new Date(new Date(+this.min).setHours(0,0,0,0)),s=new Date(new Date(+this.max).setHours(0,0,0,0));return+t!=+i&&+t!=+s||+(e=+e<+this.min?new Date(+this.min):e)>+this.max&&(e=new Date(+this.max)),e},t.prototype.renderMonths=function(e,t,i){var s=this.weekNumber?8:7,i="Gregorian"===this.calendarMode?this.renderDays(this.currentDate,t,null,null,i,e):O.isNullOrUndefined(this.islamicModule)?null:this.islamicModule.islamicRenderDays(this.currentDate,t);this.createContentHeader(),"Gregorian"===this.calendarMode?this.renderTemplate(i,s,G,e,t):O.isNullOrUndefined(this.islamicModule)||this.islamicModule.islamicRenderTemplate(i,s,G,e,t)},t.prototype.renderDays=function(e,t,i,s,a,n){for(var r=[],l=a?new Date(+e):this.getDate(new Date,this.timezone),o=(h=new Date(this.checkValue(e))).getMonth(),a=(this.titleUpdate(e,"days"),h),h=new Date(a.getFullYear(),a.getMonth(),0,a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds());h.getDay()!==this.firstDayOfWeek;)this.setStartDate(h,-1*ne);for(var u=0;u<42;++u){var d,p=this.createElement("td",{className:ie}),c=this.createElement("span"),c=(u%7==0&&this.weekNumber&&(d="FirstDay"===this.weekRule?6:"FirstFourDayWeek"===this.weekRule?3:0,d=new Date(h.getFullYear(),h.getMonth(),h.getDate()+d),c.textContent=""+this.getWeek(d),p.appendChild(c),O.addClass([p],J),r.push(p)),d=new Date(+h),h=this.minMaxDate(h),{type:"dateTime",skeleton:"full"}),m=this.globalize.parseDate(this.globalize.formatDate(h,c),c),f=this.dayCell(h),p=this.globalize.formatDate(h,{type:"date",skeleton:"full"}),c=this.createElement("span"),v=(c.textContent=this.globalize.formatDate(h,{format:"d",type:"date",skeleton:"yMd"}),this.min>h||this.max<h),g=(v?(O.addClass([f],I),O.addClass([f],X)):c.setAttribute("title",""+p),o!==h.getMonth()&&(O.addClass([f],N),c.setAttribute("aria-disabled","true")),0!==h.getDay()&&6!==h.getDay()||O.addClass([f],"e-weekend"),f.appendChild(c),this.renderDayCellArgs={date:h,isDisabled:!1,element:f,isOutOfRange:v,currentView:this.currentView()},this.renderDayCellArgs);if(this.renderDayCellEvent(g),g.isDisabled){p=new Date(this.checkValue(t)),v=new Date(this.checkValue(g.date));if(i){if(!O.isNullOrUndefined(s)&&0<s.length)for(var y=0;y<s.length;y++)+new Date(this.globalize.formatDate(g.date,{type:"date",skeleton:"yMd"}))===+new Date(this.globalize.formatDate(s[y],{type:"date",skeleton:"yMd"}))&&(s.splice(y,1),y=-1)}else p&&+p==+v&&this.setProperties({value:null},!0)}this.renderDayCellArgs.isDisabled&&!f.classList.contains(T)&&(O.addClass([f],I),O.addClass([f],X),c.setAttribute("aria-disabled","true"),+this.renderDayCellArgs.date==+this.todayDate)&&(this.todayDisabled=!0);var b=f.classList.contains(N),D=f.classList.contains(I),E=(D||O.EventHandler.add(f,"click",this.clickHandler,this),void 0);if(O.isNullOrUndefined(n)||"click"!==n.type||(E=n.currentTarget),!i||O.isNullOrUndefined(s)||D)!D&&this.getDateVal(h,t)&&O.addClass([f],T);else{for(var C=0;C<s.length;C++){var k={format:null,type:"date",skeleton:"short",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"};if((this.globalize.formatDate(h,k)===this.globalize.formatDate(s[C],k)&&this.getDateVal(h,s[C])||this.getDateVal(h,t))&&O.addClass([f],T),!O.isNullOrUndefined(E)&&E.innerText===f.innerText&&this.previousDates&&f.classList.contains(T)&&E.classList.contains(T)){O.removeClass([f],T),this.previousDates=!1;for(var w=this.copyValues(s),M=0;M<w.length;M++){var V={format:null,type:"date",skeleton:"short",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"};this.globalize.formatDate(m,V)===this.globalize.formatDate(w[M],V)&&(y=w.indexOf(w[M]),w.splice(y,1),s.splice(y,1))}this.setProperties({values:w},!0)}else this.updateFocus(b,D,h,f,e)}s.length<=0&&this.updateFocus(b,D,h,f,e)}this.updateFocus(b,D,h,f,e),O.isNullOrUndefined(m)||m.getFullYear()!==l.getFullYear()||m.getMonth()!==l.getMonth()||m.getDate()!==l.getDate()||O.addClass([f],ee),r.push(this.renderDayCellArgs.element),h=new Date(+d),this.addDay(h,1,null,this.max,this.min)}return r},t.prototype.updateFocus=function(e,t,i,s,a){(a.getDate()===i.getDate()&&!e&&!t||(a>=this.max&&parseInt(s.id,0)===+this.max&&!e&&!t&&O.addClass([s],y),a<=this.min&&parseInt(s.id,0)===+this.min&&!e&&!t))&&O.addClass([s],y)},t.prototype.renderYears=function(e,t){this.removeTableHeadElement();var i=[],s=O.isNullOrUndefined(t),a=new Date(this.checkValue(this.currentDate)),n=a.getMonth(),r=a.getFullYear(),l=a,o=l.getFullYear(),h=new Date(this.checkValue(this.min)).getFullYear(),u=new Date(this.checkValue(this.min)).getMonth(),d=new Date(this.checkValue(this.max)).getFullYear(),p=new Date(this.checkValue(this.max)).getMonth();l.setMonth(0),this.titleUpdate(this.currentDate,"months"),l.setDate(1);for(var c=0;c<12;++c){var m=this.dayCell(l),f=this.createElement("span"),v=t&&t.getMonth()===l.getMonth(),v=t&&t.getFullYear()===r&&v,g=this.globalize.formatDate(l,{type:"date",format:"MMM y"});f.textContent=this.toCapitalize(this.globalize.formatDate(l,{format:null,type:"dateTime",skeleton:"MMM"})),this.min&&(o<h||c<u&&o===h)||this.max&&(d<o||p<c&&d<=o)?O.addClass([m],I):!s&&v?O.addClass([m],T):l.getMonth()===n&&this.currentDate.getMonth()===n&&O.addClass([m],y),l.setDate(1),l.setMonth(l.getMonth()+1),m.classList.contains(I)||(O.EventHandler.add(m,"click",this.clickHandler,this),f.setAttribute("title",""+g)),m.appendChild(f),i.push(m)}this.renderTemplate(i,4,K,e,t)},t.prototype.renderDecades=function(e,t){this.removeTableHeadElement();var i=[],s=new Date(this.checkValue(this.currentDate)),a=(s.setMonth(0),s.setDate(1),s.getFullYear()),n=new Date(s.setFullYear(a-a%10)),r=new Date(s.setFullYear(a-a%10+9)),l=n.getFullYear(),o=r.getFullYear(),n=this.globalize.formatDate(n,{format:null,type:"dateTime",skeleton:"y"}),r=this.globalize.formatDate(r,{format:null,type:"dateTime",skeleton:"y"});this.headerTitleElement.textContent=n+" - "+r;for(var h=new Date(a-a%10-1,0,1).getFullYear(),u=0;u<12;++u){var d=h+u,p=(s.setFullYear(d),this.dayCell(s)),c=this.createElement("span");c.textContent=this.globalize.formatDate(s,{format:null,type:"dateTime",skeleton:"y"}),d<l||o<d?(O.addClass([p],Y),c.setAttribute("aria-disabled","true"),O.isNullOrUndefined(t)||s.getFullYear()!==t.getFullYear()||O.addClass([p],T),(d<new Date(this.checkValue(this.min)).getFullYear()||d>new Date(this.checkValue(this.max)).getFullYear())&&O.addClass([p],I)):d<new Date(this.checkValue(this.min)).getFullYear()||d>new Date(this.checkValue(this.max)).getFullYear()?O.addClass([p],I):O.isNullOrUndefined(t)||s.getFullYear()!==t.getFullYear()?s.getFullYear()!==this.currentDate.getFullYear()||p.classList.contains(I)||O.addClass([p],y):O.addClass([p],T),p.classList.contains(I)||(O.EventHandler.add(p,"click",this.clickHandler,this),c.setAttribute("title",""+c.textContent)),p.appendChild(c),i.push(p)}this.renderTemplate(i,4,"e-decade",e,t)},t.prototype.dayCell=function(e){var t,i={skeleton:"full",type:"dateTime",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"},e=this.globalize.parseDate(this.globalize.formatDate(e,i),i),i=(O.isNullOrUndefined(e)||(t=e.valueOf()),{className:ie,attrs:{id:""+O.getUniqueID(""+t)}});return this.createElement("td",i)},t.prototype.firstDay=function(e){var t="Decade"!==this.currentView()?this.tableBodyElement.querySelectorAll("td:not(."+N+"):not(."+J+")"):this.tableBodyElement.querySelectorAll("td:not(."+Y);if(t.length)for(var i=0;i<t.length;i++)if(!t[i].classList.contains(I)){e=new Date(parseInt(t[i].id,0));break}return e},t.prototype.lastDay=function(e,t){var i=new Date(e.getFullYear(),e.getMonth()+1,0);return 2!==t?((t=Math.abs(i.getTimezoneOffset()-this.firstDay(e).getTimezoneOffset()))&&i.setHours(this.firstDay(e).getHours()+t/60),this.findLastDay(i)):this.findLastDay(this.firstDay(i))},t.prototype.checkDateValue=function(e){return!O.isNullOrUndefined(e)&&e instanceof Date&&!isNaN(+e)?e:null},t.prototype.findLastDay=function(e){var t="Decade"===this.currentView()?this.tableBodyElement.querySelectorAll("td:not(."+Y):this.tableBodyElement.querySelectorAll("td:not(."+N+"):not(."+J+")");if(t.length)for(var i=t.length-1;0<=i;i--)if(!t[i].classList.contains(I)){e=new Date(parseInt(t[i].id,0));break}return e},t.prototype.removeTableHeadElement=function(){"calendar"===this.getModuleName()?O.isNullOrUndefined(this.element.querySelectorAll(".e-content table thead")[0])||O.detach(this.tableHeadElement):O.isNullOrUndefined(this.calendarElement.querySelectorAll(".e-content table thead")[0])||O.detach(this.tableHeadElement)},t.prototype.renderTemplate=function(e,t,i,s,a){for(var n,r=this.getViewNumber(this.currentView()),l=(this.tableBodyElement=this.createElement("tbody"),this.table.appendChild(this.tableBodyElement),O.removeClass([this.contentElement,this.headerElement],[G,_,K]),O.addClass([this.contentElement,this.headerElement],[i]),t),o=0,h=0;h<e.length/t;++h){for(n=this.createElement("tr"),o=0+o;o<l;o++)e[o].classList.contains("e-week-number")||O.isNullOrUndefined(e[o].children[0])||(O.addClass([e[o].children[0]],[te]),O.rippleEffect(e[o].children[0],{duration:600,isCenterRipple:!0})),n.appendChild(e[o]),this.weekNumber&&7===o&&e[7].classList.contains(N)&&O.addClass([n],Q),!this.weekNumber&&6===o&&e[6].classList.contains(N)&&O.addClass([n],Q),this.weekNumber?41===o&&e[41].classList.contains(N)&&O.addClass([n],Q):35===o&&e[35].classList.contains(N)&&O.addClass([n],Q);l+=t,o+=0,this.tableBodyElement.appendChild(n)}this.table.querySelector("tbody").className=this.effect,"Gregorian"===this.calendarMode?this.iconHandler():this.islamicModule.islamicIconHandler(),(r!==this.getViewNumber(this.currentView())||0===r&&r!==this.getViewNumber(this.currentView()))&&this.navigateHandler(s),this.setAriaActiveDescendant()},t.prototype.clickHandler=function(e,t){this.clickEventEmitter(e);var i=e.currentTarget,s=this.getViewNumber(this.currentView());i.classList.contains(N)?this.contentClick(e,0,null,t):s===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth)||2===s?this.contentClick(e,1,null,t):i.classList.contains(N)||0!==s?this.contentClick(e,0,i,t):this.selectDate(e,this.getIdValue(e,null),null),"calendar"===this.getModuleName()&&this.table.focus()},t.prototype.clickEventEmitter=function(e){e.preventDefault()},t.prototype.contentClick=function(e,t,i,s){var a,n=this.getViewNumber(this.currentView()),r=this.getIdValue(e,i);switch(t){case 0:n===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth)?(O.detach(this.tableBodyElement),this.currentDate=r,this.effect=se):("Gregorian"===this.calendarMode?(this.currentDate.setMonth(r.getMonth()),0<r.getMonth()&&this.currentDate.getMonth()!==r.getMonth()&&this.currentDate.setDate(0),this.currentDate.setFullYear(r.getFullYear())):this.currentDate=r,this.effect=se,O.detach(this.tableBodyElement)),this.renderMonths(e);break;case 1:n===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth)?this.selectDate(e,r,null):("Gregorian"===this.calendarMode?this.currentDate.setFullYear(r.getFullYear()):(this.islamicPreviousHeader=this.headerElement.textContent,a=this.islamicModule.getIslamicDate(r),this.currentDate=this.islamicModule.toGregorian(a.year,a.month,1)),this.effect=se,O.detach(this.tableBodyElement),this.renderYears(e))}},t.prototype.switchView=function(e,t,i,s){switch(e){case 0:O.detach(this.tableBodyElement),this.renderMonths(t,null,s);break;case 1:O.detach(this.tableBodyElement),this.renderYears(t);break;case 2:O.detach(this.tableBodyElement),this.renderDecades(t)}},t.prototype.getModuleName=function(){return"calendar"},t.prototype.requiredModules=function(){var e=[];return"Islamic"===this.calendarMode&&e.push({args:[this],member:"islamic",name:"Islamic"}),e},t.prototype.getPersistData=function(){return this.addOnPersist(["value"])},t.prototype.onPropertyChanged=function(e,t,i,s){this.effect="";for(var a=0,n=Object.keys(e);a<n.length;a++){var r=n[a];switch(r){case"enableRtl":e.enableRtl?("calendar"===this.getModuleName()?this.element:this.calendarElement).classList.add("e-rtl"):("calendar"===this.getModuleName()?this.element:this.calendarElement).classList.remove("e-rtl");break;case"dayHeaderFormat":this.getCultureValues(),("datepicker"!==this.getModuleName()||this.calendarElement)&&this.createContentHeader(),this.adjustLongHeaderSize();break;case"min":case"max":this.rangeValidation(this.min,this.max),"min"===r?this.setProperties({min:this.checkDateValue(new Date(this.checkValue(e.min)))},!0):this.setProperties({max:this.checkDateValue(new Date(this.checkValue(e.max)))},!0),this.setProperties({start:this.currentView()},!0),this.tableBodyElement&&O.detach(this.tableBodyElement),this.minMaxUpdate(),i&&this.validateValues(i,s),("datepicker"!==this.getModuleName()||this.calendarElement)&&this.createContentBody(),(this.todayDate<this.min||this.max<this.todayDate)&&this.footer&&this.todayElement?(O.detach(this.todayElement),O.detach(this.footer),this.todayElement=this.footer=null,this.createContentFooter()):this.footer&&this.todayElement&&this.todayElement.classList.contains("e-disabled")&&(O.removeClass([this.todayElement],I),O.detach(this.todayElement),O.detach(this.footer),this.todayElement=this.footer=null,this.createContentFooter());break;case"start":case"depth":case"weekNumber":case"firstDayOfWeek":case"weekRule":this.checkView(),("datepicker"!==this.getModuleName()||this.calendarElement)&&(this.createContentHeader(),this.createContentBody());break;case"locale":this.globalize=new O.Internationalization(this.locale),("datepicker"!==this.getModuleName()||this.calendarElement)&&(this.createContentHeader(),this.createContentBody()),"calendar"===this.getModuleName()&&(this.l10=new O.L10n(this.getModuleName(),{today:"Today"},this.locale)),this.l10.setLocale(this.locale),this.showTodayButton&&this.updateFooter();break;case"showTodayButton":e.showTodayButton?this.createContentFooter():O.isNullOrUndefined(this.todayElement)||O.isNullOrUndefined(this.footer)||(O.detach(this.todayElement),O.detach(this.footer),this.todayElement=this.footer=void 0),this.setProperties({showTodayButton:e.showTodayButton},!0)}}},t.prototype.validateValues=function(e,t){if(e&&!O.isNullOrUndefined(t)&&0<t.length){for(var i=this.copyValues(t),s=0;s<i.length;s++){var a=i[s],n="Gregorian"===this.calendarMode?"gregorian":"islamic",r=void 0,l=void 0,o=void 0,o=(l="Gregorian"===this.calendarMode?this.globalize.formatDate(a,r={type:"date",skeleton:"yMd"}):this.globalize.formatDate(a,r={type:"date",skeleton:"yMd",calendar:"islamic"}),this.globalize.parseDate(l,r)),a={type:"date",skeleton:"yMd",calendar:n},l=this.globalize.formatDate(this.min,a),r={type:"date",skeleton:"yMd",calendar:n},n=this.globalize.formatDate(this.max,r),l=this.globalize.parseDate(l,a),a=this.globalize.parseDate(n,r);(+o<+l||+a<+o)&&(i.splice(s,1),s=-1)}this.setProperties({values:i},!0)}},t.prototype.setValueUpdate=function(){O.isNullOrUndefined(this.tableBodyElement)||(O.detach(this.tableBodyElement),this.setProperties({start:this.currentView()},!0),this.createContentBody())},t.prototype.copyValues=function(e){var t=[];if(!O.isNullOrUndefined(e)&&0<e.length)for(var i=0;i<e.length;i++)t.push(new Date(+e[i]));return t},t.prototype.titleUpdate=function(e,t){var i,s=new O.Internationalization(this.locale),a="Gregorian"===this.calendarMode?"gregorian":"islamic",n="Gregorian"===this.calendarMode?(i=s.formatDate(e,{type:"dateTime",skeleton:"yMMMM",calendar:a}),s.formatDate(e,{format:null,type:"dateTime",skeleton:"y",calendar:a})):(i=s.formatDate(e,{type:"dateTime",format:"MMMM y",calendar:a}),s.formatDate(e,{type:"dateTime",format:"y",calendar:a}));switch(t){case"days":this.headerTitleElement.textContent=this.toCapitalize(i);break;case"months":this.headerTitleElement.textContent=n}},t.prototype.setActiveDescendant=function(){var e,t=this.tableBodyElement.querySelector("tr td.e-focused-date"),i=this.tableBodyElement.querySelector("tr td.e-selected"),s="Gregorian"===this.calendarMode?"gregorian":"islamic",a=this.currentView(),a="Month"===a?this.globalize.formatDate(this.currentDate,{type:"date",skeleton:"full",calendar:s}):"Year"===a?"islamic"!=s?this.globalize.formatDate(this.currentDate,{type:"date",skeleton:"yMMMM",calendar:s}):this.globalize.formatDate(this.currentDate,{type:"date",skeleton:"GyMMM",calendar:s}):this.globalize.formatDate(this.currentDate,{format:null,type:"date",skeleton:"y",calendar:s});return(i||t)&&(O.isNullOrUndefined(i)||i.setAttribute("aria-selected","true"),(t||i).setAttribute("aria-label",a),e=(t||i).getAttribute("id")),e},t.prototype.iconHandler=function(){switch(new Date(this.checkValue(this.currentDate)).setDate(1),this.currentView()){case"Month":this.previousIconHandler(this.compareMonth(new Date(this.checkValue(this.currentDate)),this.min)<1),this.nextIconHandler(-1<this.compareMonth(new Date(this.checkValue(this.currentDate)),this.max));break;case"Year":this.previousIconHandler(this.compareYear(new Date(this.checkValue(this.currentDate)),this.min)<1),this.nextIconHandler(-1<this.compareYear(new Date(this.checkValue(this.currentDate)),this.max));break;case"Decade":this.previousIconHandler(this.compareDecade(new Date(this.checkValue(this.currentDate)),this.min)<1),this.nextIconHandler(-1<this.compareDecade(new Date(this.checkValue(this.currentDate)),this.max))}},t.prototype.destroy=function(){("calendar"===this.getModuleName()&&this.element||this.calendarElement&&this.element)&&O.removeClass([this.element],[R]),"calendar"===this.getModuleName()&&this.element&&(O.isNullOrUndefined(this.headerTitleElement)||O.EventHandler.remove(this.headerTitleElement,"click",this.navigateTitle),this.todayElement&&O.EventHandler.remove(this.todayElement,"click",this.todayButtonClick),this.previousIconHandler(!0),this.nextIconHandler(!0),this.keyboardModule.destroy(),this.element.removeAttribute("data-role"),O.isNullOrUndefined(this.calendarEleCopy.getAttribute("tabindex"))?this.element.removeAttribute("tabindex"):this.element.setAttribute("tabindex",this.tabIndex)),this.element&&(this.element.innerHTML=""),this.todayElement=null,this.tableBodyElement=null,this.todayButtonEvent=null,this.renderDayCellArgs=null,this.headerElement=null,this.nextIcon=null,this.table=null,this.tableHeadElement=null,this.previousIcon=null,this.headerTitleElement=null,this.footer=null,this.contentElement=null,B.prototype.destroy.call(this)},t.prototype.title=function(e){var t=this.getViewNumber(this.currentView());this.effect=se,this.switchView(++t,e)},t.prototype.getViewNumber=function(e){return"Month"===e?0:"Year"===e?1:2},t.prototype.navigateTitle=function(e){e.preventDefault(),this.title(e)},t.prototype.previous=function(){this.effect="";var e=this.getViewNumber(this.currentView());switch(this.currentView()){case"Month":this.addMonths(this.currentDate,-1),this.switchView(e);break;case"Year":this.addYears(this.currentDate,-1),this.switchView(e);break;case"Decade":this.addYears(this.currentDate,-10),this.switchView(e)}},t.prototype.navigatePrevious=function(e){O.Browser.isDevice||e.preventDefault(),"Gregorian"===this.calendarMode?this.previous():this.islamicModule.islamicPrevious(),this.triggerNavigate(e)},t.prototype.next=function(){this.effect="";var e=this.getViewNumber(this.currentView());switch(this.currentView()){case"Month":this.addMonths(this.currentDate,1),this.switchView(e);break;case"Year":this.addYears(this.currentDate,1),this.switchView(e);break;case"Decade":this.addYears(this.currentDate,10),this.switchView(e)}},t.prototype.navigateNext=function(e){O.Browser.isDevice||e.preventDefault(),"Gregorian"===this.calendarMode?this.next():this.islamicModule.islamicNext(),this.triggerNavigate(e)},t.prototype.navigateTo=function(e,t,i){+t>=+this.min&&+t<=+this.max&&(this.currentDate=t),+t<=+this.min&&(this.currentDate=new Date(this.checkValue(this.min))),+t>=+this.max&&(this.currentDate=new Date(this.checkValue(this.max))),this.getViewNumber(this.depth)>=this.getViewNumber(e)&&(this.getViewNumber(this.depth)<=this.getViewNumber(this.start)||this.getViewNumber(this.depth)===this.getViewNumber(e))&&(e=this.depth),this.switchView(this.getViewNumber(e),null,null,i)},t.prototype.currentView=function(){return!O.isNullOrUndefined(this.contentElement)&&this.contentElement.classList.contains(K)?"Year":!O.isNullOrUndefined(this.contentElement)&&this.contentElement.classList.contains(_)?"Decade":"Month"},t.prototype.getDateVal=function(e,t){return!O.isNullOrUndefined(t)&&e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()},t.prototype.getCultureObjects=function(e,t){var i=O.isNullOrUndefined(this.dayHeaderFormat)?null:".dates.calendars.gregorian.days.format."+this.dayHeaderFormat.toLowerCase(),s=O.isNullOrUndefined(this.dayHeaderFormat)?null:".dates.calendars.islamic.days.format."+this.dayHeaderFormat.toLowerCase();return"Gregorian"===this.calendarMode?O.getValue("main."+this.locale+i,e):O.getValue("main."+this.locale+s,e)},t.prototype.getWeek=function(e){var t=new Date(this.checkValue(e)).valueOf(),e=new Date(e.getFullYear(),0,1).valueOf();return Math.ceil((t-e+ne)/ne/7)},t.prototype.setStartDate=function(e,t){var i=e.getTimezoneOffset(),t=new Date(e.getTime()+t),i=t.getTimezoneOffset()-i;e.setTime(t.getTime()+6e4*i)},t.prototype.addMonths=function(e,t){var i;"Gregorian"===this.calendarMode?(i=e.getDate(),e.setDate(1),e.setMonth(e.getMonth()+t),e.setDate(Math.min(i,this.getMaxDays(e)))):(i=this.islamicModule.getIslamicDate(e),this.currentDate=this.islamicModule.toGregorian(i.year,i.month+t,1))},t.prototype.addYears=function(e,t){var i;"Gregorian"===this.calendarMode?(i=e.getDate(),e.setDate(1),e.setFullYear(e.getFullYear()+t),e.setDate(Math.min(i,this.getMaxDays(e)))):(i=this.islamicModule.getIslamicDate(e),this.currentDate=this.islamicModule.toGregorian(i.year+t,i.month,1))},t.prototype.getIdValue=function(e,t){e=e?e.currentTarget:t,t={type:"dateTime",skeleton:"full",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"},e=this.globalize.formatDate(new Date(parseInt(""+e.getAttribute("id"),0)),t),e=this.globalize.parseDate(e,t),t=e.valueOf()-e.valueOf()%1e3;return new Date(t)},t.prototype.adjustLongHeaderSize=function(){O.removeClass([this.element],ae),"Wide"===this.dayHeaderFormat&&O.addClass(["calendar"===this.getModuleName()?this.element:this.calendarElement],ae)},t.prototype.selectDate=function(e,t,i,s,a){var n=i||e.currentTarget,r=(this.isDateSelected=!1,"Decade"===this.currentView()?this.setDateDecade(this.currentDate,t.getFullYear()):"Year"===this.currentView()?this.setDateYear(this.currentDate,t):(s&&!this.checkPresentDate(t,a)?(l=this.copyValues(a),!O.isNullOrUndefined(a)&&0<l.length?(l.push(new Date(this.checkValue(t))),this.setProperties({values:l},!0),this.setProperties({value:a[a.length-1]},!0)):this.setProperties({values:[new Date(this.checkValue(t))]},!0)):this.setProperties({value:new Date(this.checkValue(t))},!0),this.currentDate=new Date(this.checkValue(t))),O.closest(n,"."+R));if(O.isNullOrUndefined(r)&&(r=this.tableBodyElement),s||O.isNullOrUndefined(r.querySelector("."+T))||O.removeClass([r.querySelector("."+T)],T),s||O.isNullOrUndefined(r.querySelector("."+y))||O.removeClass([r.querySelector("."+y)],y),s||O.isNullOrUndefined(r.querySelector("."+$))||O.removeClass([r.querySelector("."+$)],$),s){for(var l=this.copyValues(a),o=Array.prototype.slice.call(this.tableBodyElement.querySelectorAll("td")),h=0;h<o.length;h++){var u=r.querySelectorAll("td."+y)[0],d=r.querySelectorAll("td."+T)[0];o[h]===u&&O.removeClass([o[h]],y),o[h]!==d||this.checkPresentDate(new Date(parseInt(d.getAttribute("id").split("_")[0],10)),a)||O.removeClass([o[h]],T)}if(n.classList.contains(T)){O.removeClass([n],T);for(var p=0;p<l.length;p++){var c={format:null,type:"date",skeleton:"short",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"};this.globalize.formatDate(t,c)===this.globalize.formatDate(l[p],c)&&(h=l.indexOf(l[p]),l.splice(h,1),O.addClass([n],y))}this.setProperties({values:l},!0)}else O.addClass([n],T)}else O.addClass([n],T);this.isDateSelected=!0},t.prototype.checkPresentDate=function(e,t){var i=!1;if(!O.isNullOrUndefined(t))for(var s=0;s<t.length;s++){var a="Gregorian"===this.calendarMode?"gregorian":"islamic";this.globalize.formatDate(e,{format:null,type:"date",skeleton:"short",calendar:a})===this.globalize.formatDate(t[s],{format:null,type:"date",skeleton:"short",calendar:a})&&(i=!0)}return i},t.prototype.setAriaActiveDescendant=function(){O.attributes(this.table,{"aria-activedescendant":""+this.setActiveDescendant()})},t.prototype.previousIconHandler=function(e){e?O.isNullOrUndefined(this.previousIcon)||(O.EventHandler.remove(this.previousIcon,"click",this.navigatePreviousHandler),O.addClass([this.previousIcon],I),O.addClass([this.previousIcon],X),this.previousIcon.setAttribute("aria-disabled","true")):(O.EventHandler.add(this.previousIcon,"click",this.navigatePreviousHandler),O.removeClass([this.previousIcon],I),O.removeClass([this.previousIcon],X),this.previousIcon.setAttribute("aria-disabled","false"))},t.prototype.renderDayCellEvent=function(e){O.extend(this.renderDayCellArgs,{name:"renderDayCell"}),this.trigger("renderDayCell",e)},t.prototype.navigatedEvent=function(e){O.extend(this.navigatedArgs,{name:"navigated",event:e}),this.trigger("navigated",this.navigatedArgs)},t.prototype.triggerNavigate=function(e){this.navigatedArgs={view:this.currentView(),date:this.currentDate},this.navigatedEvent(e)},t.prototype.nextIconHandler=function(e){e?O.isNullOrUndefined(this.previousIcon)||(O.EventHandler.remove(this.nextIcon,"click",this.navigateNextHandler),O.addClass([this.nextIcon],I),O.addClass([this.nextIcon],X),this.nextIcon.setAttribute("aria-disabled","true")):(O.EventHandler.add(this.nextIcon,"click",this.navigateNextHandler),O.removeClass([this.nextIcon],I),O.removeClass([this.nextIcon],X),this.nextIcon.setAttribute("aria-disabled","false"))},t.prototype.compare=function(e,t,i){var t=t.getFullYear(),s=t,a=0;return i&&(s=(t-=t%i)-t%i+i-1),e.getFullYear()>s?a=1:e.getFullYear()<t&&(a=-1),a},t.prototype.isMinMaxRange=function(e){return+e>=+this.min&&+e<=+this.max},t.prototype.isMonthYearRange=function(e){return"Gregorian"===this.calendarMode?e.getMonth()>=this.min.getMonth()&&e.getFullYear()>=this.min.getFullYear()&&e.getMonth()<=this.max.getMonth()&&e.getFullYear()<=this.max.getFullYear():(e=this.islamicModule.getIslamicDate(e)).month>=this.islamicModule.getIslamicDate(new Date(1941,12,18)).month&&e.year>=this.islamicModule.getIslamicDate(new Date(1941,12,18)).year&&e.month<=this.islamicModule.getIslamicDate(new Date(2068,2,4)).month&&e.year<=this.islamicModule.getIslamicDate(new Date(2068,2,4)).year},t.prototype.compareYear=function(e,t){return this.compare(e,t,0)},t.prototype.compareDecade=function(e,t){return this.compare(e,t,10)},t.prototype.shiftArray=function(e,t){return e.slice(t).concat(e.slice(0,t))},t.prototype.addDay=function(e,t,i,s,a){var n=t,r=new Date(+e);if(!O.isNullOrUndefined(this.tableBodyElement)&&!O.isNullOrUndefined(i)){for(;this.findNextTD(new Date(+e),n,s,a);)n+=t;i=new Date(r.setDate(r.getDate()+n)),n=+s<+i||+i<+a?n===t?t-t:t:n}e.setDate(e.getDate()+n)},t.prototype.findNextTD=function(e,t,i,s){var a=new Date(e.setDate(e.getDate()+t)),n=[],r=!1;if(n=(!O.isNullOrUndefined(a)&&a.getMonth())===(!O.isNullOrUndefined(this.currentDate)&&this.currentDate.getMonth())?("Gregorian"===this.calendarMode?this.renderDays(a):this.islamicModule.islamicRenderDays(this.currentDate,a)).filter(function(e){return e.classList.contains(I)}):this.tableBodyElement.querySelectorAll("td."+I),+a<=+i&&+s<=+a&&n.length)for(var l=0;l<n.length&&!(r=+a==+new Date(parseInt(n[l].id,0)));l++);return r},t.prototype.getMaxDays=function(e){for(var t=new Date(this.checkValue(e)),i=28,s=t.getMonth();t.getMonth()===s;)t.setDate(++i);return i-1},t.prototype.setDateDecade=function(e,t){e.setFullYear(t),this.setProperties({value:new Date(this.checkValue(e))},!0)},t.prototype.setDateYear=function(e,t){e.setFullYear(t.getFullYear(),t.getMonth(),e.getDate()),t.getMonth()!==e.getMonth()&&(e.setDate(0),this.currentDate=new Date(this.checkValue(t))),this.setProperties({value:new Date(this.checkValue(e))},!0)},t.prototype.compareMonth=function(e,t){e=e.getFullYear()>t.getFullYear()?1:e.getFullYear()<t.getFullYear()?-1:e.getMonth()===t.getMonth()?0:e.getMonth()>t.getMonth()?1:-1;return e},t.prototype.checkValue=function(e){return e instanceof Date?e.toUTCString():""+e},t.prototype.checkView=function(){"Decade"!==this.start&&"Year"!==this.start&&this.setProperties({start:"Month"},!0),"Decade"!==this.depth&&"Year"!==this.depth&&this.setProperties({depth:"Month"},!0),this.getViewNumber(this.depth)>this.getViewNumber(this.start)&&this.setProperties({depth:"Month"},!0)},t.prototype.getDate=function(e,t){return e=t?new Date(e.toLocaleString("en-US",{timeZone:t})):e},e([O.Property(new Date(1900,0,1))],t.prototype,"min",void 0),e([O.Property(!0)],t.prototype,"enabled",void 0),e([O.Property(null)],t.prototype,"cssClass",void 0),e([O.Property(new Date(2099,11,31))],t.prototype,"max",void 0),e([O.Property(null)],t.prototype,"firstDayOfWeek",void 0),e([O.Property("Gregorian")],t.prototype,"calendarMode",void 0),e([O.Property("Month")],t.prototype,"start",void 0),e([O.Property("Month")],t.prototype,"depth",void 0),e([O.Property(!1)],t.prototype,"weekNumber",void 0),e([O.Property("FirstDay")],t.prototype,"weekRule",void 0),e([O.Property(!0)],t.prototype,"showTodayButton",void 0),e([O.Property("Short")],t.prototype,"dayHeaderFormat",void 0),e([O.Property(!1)],t.prototype,"enablePersistence",void 0),e([O.Property(null)],t.prototype,"keyConfigs",void 0),e([O.Property(null)],t.prototype,"serverTimezoneOffset",void 0),e([O.Event()],t.prototype,"created",void 0),e([O.Event()],t.prototype,"destroyed",void 0),e([O.Event()],t.prototype,"navigated",void 0),e([O.Event()],t.prototype,"renderDayCell",void 0),e([O.NotifyPropertyChanges],t));function t(e,t){e=B.call(this,e,t)||this;return e.effect="",e.isPopupClicked=!1,e.isDateSelected=!0,e.isTodayClicked=!1,e.preventChange=!1,e.previousDates=!1,e}j(s,l=re),s.prototype.render=function(){if("Islamic"===this.calendarMode&&void 0===this.islamicModule&&O.throwError("Requires the injectable Islamic modules to render Calendar in Islamic mode"),this.isMultiSelection&&"object"==typeof this.values&&!O.isNullOrUndefined(this.values)&&0<this.values.length){for(var e=[],t=[],i=0;i<this.values.length;i++)-1===e.indexOf(+this.values[i])&&(e.push(+this.values[i]),t.push(this.values[i]));this.setProperties({values:t},!0);for(var s,a=0;a<this.values.length;a++)this.checkDateValue(this.values[a])||("string"==typeof this.values[a]&&this.checkDateValue(new Date(this.checkValue(this.values[a])))?(s=new Date(this.checkValue(this.values[a])),this.values.splice(a,1),this.values.splice(a,0,s)):this.values.splice(a,1));this.setProperties({value:this.values[this.values.length-1]},!0),this.previousValues=this.values.length}var n;this.validateDate(),this.minMaxUpdate(),"calendar"===this.getModuleName()&&(this.setEnable(this.enabled),this.setClass(this.cssClass)),l.prototype.render.call(this),"calendar"===this.getModuleName()&&((n=O.closest(this.element,"form"))&&O.EventHandler.add(n,"reset",this.formResetHandler.bind(this)),this.setTimeZone(this.serverTimezoneOffset)),this.renderComplete()},s.prototype.setEnable=function(e){e?O.removeClass([this.element],I):O.addClass([this.element],I)},s.prototype.setClass=function(e,t){O.isNullOrUndefined(t)||(t=t.replace(/\s+/g," ").trim()),O.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),O.isNullOrUndefined(t)||""===t||O.removeClass([this.element],t.split(" ")),O.isNullOrUndefined(e)||O.addClass([this.element],e.split(" "))},s.prototype.isDayLightSaving=function(){var e=new Date(this.value.getFullYear(),6,1).getTimezoneOffset(),t=new Date(this.value.getFullYear(),0,1).getTimezoneOffset();return this.value.getTimezoneOffset()<Math.max(t,e)},s.prototype.setTimeZone=function(e){!O.isNullOrUndefined(this.serverTimezoneOffset)&&this.value&&(e=e+(new Date).getTimezoneOffset()/60,e=this.isDayLightSaving()?e--:e,this.value=new Date(this.value.getTime()+60*e*60*1e3))},s.prototype.formResetHandler=function(){this.setProperties({value:null},!0)},s.prototype.validateDate=function(){"string"==typeof this.value&&this.setProperties({value:this.checkDateValue(new Date(this.checkValue(this.value)))},!0),l.prototype.validateDate.call(this,this.value),!O.isNullOrUndefined(this.value)&&this.min<=this.max&&this.value>=this.min&&this.value<=this.max&&(this.currentDate=new Date(this.checkValue(this.value))),isNaN(+this.value)&&this.setProperties({value:null},!0)},s.prototype.minMaxUpdate=function(){"calendar"===this.getModuleName()&&(!O.isNullOrUndefined(this.value)&&this.value<=this.min&&this.min<=this.max?(this.setProperties({value:this.min},!0),this.changedArgs={value:this.value}):!O.isNullOrUndefined(this.value)&&this.value>=this.max&&this.min<=this.max&&(this.setProperties({value:this.max},!0),this.changedArgs={value:this.value})),"calendar"===this.getModuleName()||O.isNullOrUndefined(this.value)?l.prototype.minMaxUpdate.call(this,this.value):!O.isNullOrUndefined(this.value)&&this.value<this.min&&this.min<=this.max?l.prototype.minMaxUpdate.call(this,this.min):!O.isNullOrUndefined(this.value)&&this.value>this.max&&this.min<=this.max&&l.prototype.minMaxUpdate.call(this,this.max)},s.prototype.generateTodayVal=function(e){var t=new Date;return O.isNullOrUndefined(this.timezone)||(t=l.prototype.getDate.call(this,t,this.timezone)),e&&O.isNullOrUndefined(this.timezone)?(t.setHours(e.getHours()),t.setMinutes(e.getMinutes()),t.setSeconds(e.getSeconds()),t.setMilliseconds(e.getMilliseconds())):t=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0),t},s.prototype.todayButtonClick=function(e){var t,i;this.showTodayButton&&(t=this.generateTodayVal(this.value),this.setProperties({value:t},!0),this.isTodayClicked=!0,this.todayButtonEvent=e,this.isMultiSelection&&(i=this.copyValues(this.values),l.prototype.checkPresentDate.call(this,t,this.values)||(i.push(t),this.setProperties({values:i}))),l.prototype.todayButtonClick.call(this,e,new Date(+this.value)))},s.prototype.keyActionHandle=function(e){l.prototype.keyActionHandle.call(this,e,this.value,this.isMultiSelection)},s.prototype.preRender=function(){var t=this;this.changeHandler=function(e){t.triggerChange(e)},this.checkView(),l.prototype.preRender.call(this,this.value)},s.prototype.createContent=function(){this.previousDate=this.value,this.previousDateTime=this.value,l.prototype.createContent.call(this)},s.prototype.minMaxDate=function(e){return l.prototype.minMaxDate.call(this,e)},s.prototype.renderMonths=function(e,t,i){l.prototype.renderMonths.call(this,e,this.value,i)},s.prototype.renderDays=function(e,t,i,s,a,n){e=l.prototype.renderDays.call(this,e,this.value,this.isMultiSelection,this.values,a,n);return this.isMultiSelection&&l.prototype.validateValues.call(this,this.isMultiSelection,this.values),e},s.prototype.renderYears=function(e){"Gregorian"===this.calendarMode?l.prototype.renderYears.call(this,e,this.value):this.islamicModule.islamicRenderYears(e,this.value)},s.prototype.renderDecades=function(e){"Gregorian"===this.calendarMode?l.prototype.renderDecades.call(this,e,this.value):this.islamicModule.islamicRenderDecade(e,this.value)},s.prototype.renderTemplate=function(e,t,i,s){"Gregorian"===this.calendarMode?l.prototype.renderTemplate.call(this,e,t,i,s,this.value):this.islamicModule.islamicRenderTemplate(e,t,i,s,this.value),this.changedArgs={value:this.value,values:this.values},s&&"click"===s.type&&s.currentTarget.classList.contains(N)?this.changeHandler(s):this.changeHandler()},s.prototype.clickHandler=function(e){var t=e.currentTarget,t=(this.isPopupClicked=!0,t.classList.contains(N)&&(this.isMultiSelection?-1===(t=this.copyValues(this.values)).toString().indexOf(this.getIdValue(e,null).toString())?(t.push(this.getIdValue(e,null)),this.setProperties({values:t},!0),this.setProperties({value:this.values[this.values.length-1]},!0)):this.previousDates=!0:this.setProperties({value:this.getIdValue(e,null)},!0)),this.currentView());l.prototype.clickHandler.call(this,e,this.value),this.isMultiSelection&&this.currentDate!==this.value&&!O.isNullOrUndefined(this.tableBodyElement.querySelectorAll("."+y)[0])&&"Year"===t&&this.tableBodyElement.querySelectorAll("."+y)[0].classList.remove(y)},s.prototype.switchView=function(e,t,i,s){l.prototype.switchView.call(this,e,t,this.isMultiSelection,s)},s.prototype.getModuleName=function(){return l.prototype.getModuleName.call(this),"calendar"},s.prototype.getPersistData=function(){l.prototype.getPersistData.call(this);return this.addOnPersist(["value","values"])},s.prototype.onPropertyChanged=function(e,t){this.effect="",this.rangeValidation(this.min,this.max);for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"value":this.isDateSelected&&("string"==typeof e.value?this.setProperties({value:new Date(this.checkValue(e.value))},!0):e.value=new Date(this.checkValue(e.value)),isNaN(+this.value)&&this.setProperties({value:t.value},!0),this.update());break;case"values":if(this.isDateSelected){if("string"==typeof e.values||"number"==typeof e.values)this.setProperties({values:null},!0);else{for(var a=this.copyValues(this.values),n=0;n<a.length;n++){var r=a[n];this.checkDateValue(r)&&!l.prototype.checkPresentDate.call(this,r,a)&&a.push(r)}this.setProperties({values:a},!0),0<this.values.length&&this.setProperties({value:e.values[e.values.length-1]},!0)}this.validateValues(this.isMultiSelection,this.values),this.update()}break;case"isMultiSelection":this.isDateSelected&&(this.setProperties({isMultiSelection:e.isMultiSelection},!0),this.update());break;case"enabled":this.setEnable(this.enabled);break;case"cssClass":"calendar"===this.getModuleName()&&this.setClass(e.cssClass,t.cssClass);break;default:l.prototype.onPropertyChanged.call(this,e,t,this.isMultiSelection,this.values)}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange},s.prototype.destroy=function(){var e;l.prototype.destroy.call(this),"calendar"===this.getModuleName()&&(this.changedArgs=null,e=O.closest(this.element,"form"))&&O.EventHandler.remove(e,"reset",this.formResetHandler.bind(this))},s.prototype.navigateTo=function(e,t,i){this.minMaxUpdate(),l.prototype.navigateTo.call(this,e,t,i)},s.prototype.currentView=function(){return l.prototype.currentView.call(this)},s.prototype.addDate=function(e){if("string"!=typeof e&&"number"!=typeof e){var t=this.copyValues(this.values);if("object"==typeof e&&0<e.length)for(var i=e,s=0;s<i.length;s++)this.checkDateValue(i[s])&&!l.prototype.checkPresentDate.call(this,i[s],t)&&(!O.isNullOrUndefined(t)&&0<t.length?t.push(i[s]):t=[new Date(+i[s])]);else this.checkDateValue(e)&&!l.prototype.checkPresentDate.call(this,e,t)&&(!O.isNullOrUndefined(t)&&0<t.length?t.push(e):t=[new Date(+e)]);this.setProperties({values:t},!0),this.isMultiSelection&&this.setProperties({value:this.values[this.values.length-1]},!0),this.validateValues(this.isMultiSelection,t),this.update(),this.changedArgs={value:this.value,values:this.values},this.changeHandler()}},s.prototype.removeDate=function(e){if("string"!=typeof e&&"number"!=typeof e&&!O.isNullOrUndefined(this.values)&&0<this.values.length){var t=this.copyValues(this.values);if("object"==typeof e&&0<e.length)for(var i=e,s=0;s<i.length;s++)for(var a=0;a<t.length;a++)+t[a]==+i[s]&&t.splice(a,1);else for(a=0;a<t.length;a++)+t[a]==+e&&t.splice(a,1);this.setProperties({values:t},!1),this.update(),this.isMultiSelection&&this.setProperties({value:this.values[this.values.length-1]},!0),this.changedArgs={value:this.value,values:this.values},this.changeHandler()}},s.prototype.setTodayDate=function(e){e=new Date(+e);this.setProperties({value:e},!0),l.prototype.todayButtonClick.call(this,null,e,!0)},s.prototype.update=function(){this.validateDate(),this.minMaxUpdate(),l.prototype.setValueUpdate.call(this)},s.prototype.selectDate=function(e,t,i){l.prototype.selectDate.call(this,e,t,i,this.isMultiSelection,this.values),this.isMultiSelection&&!O.isNullOrUndefined(this.values)&&0<this.values.length&&this.setProperties({value:this.values[this.values.length-1]},!0),this.changedArgs={value:this.value,values:this.values},this.changeHandler(e)},s.prototype.changeEvent=function(e){(this.value&&this.value.valueOf())===(this.previousDate&&+this.previousDate.valueOf())&&!this.isMultiSelection||(this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",this.changedArgs),this.previousDate=new Date(+this.value))},s.prototype.triggerChange=function(e){!O.isNullOrUndefined(this.todayButtonEvent)&&this.isTodayClicked&&(e=this.todayButtonEvent,this.isTodayClicked=!1),this.changedArgs.event=e||null,this.changedArgs.isInteracted=!O.isNullOrUndefined(e),O.isNullOrUndefined(this.value)||this.setProperties({value:this.value},!0),this.isMultiSelection||+this.value===Number.NaN||(O.isNullOrUndefined(this.value)||O.isNullOrUndefined(this.previousDate))&&(null!==this.previousDate||isNaN(+this.value))?O.isNullOrUndefined(this.values)||this.previousValues===this.values.length||(this.changeEvent(e),this.previousValues=this.values.length):this.changeEvent(e)},e([O.Property(null)],s.prototype,"value",void 0),e([O.Property(null)],s.prototype,"values",void 0),e([O.Property(!1)],s.prototype,"isMultiSelection",void 0),e([O.Event()],s.prototype,"change",void 0);var l,j=e([O.NotifyPropertyChanges],s);function s(e,t){return l.call(this,e,t)||this}var le="e-other-month",oe="e-year",he="e-disabled",ue="e-overlay",de="e-selected",pe="e-focused-date",ce="e-month-hide",e=(a.prototype.getModuleName=function(){return"islamic"},a.prototype.islamicTitleUpdate=function(e,t){var i=new O.Internationalization(this.calendarInstance.locale);switch(t){case"days":this.calendarInstance.headerTitleElement.textContent=i.formatDate(e,{type:"dateTime",format:"MMMMyyyy",calendar:"islamic"});break;case"months":this.calendarInstance.headerTitleElement.textContent=i.formatDate(e,{type:"dateTime",format:"yyyy",calendar:"islamic"})}},a.prototype.islamicRenderDays=function(e,t,i,s){for(var a=[],n=new Date(this.islamicInValue(e)),r=(this.islamicTitleUpdate(e,"days"),this.getIslamicDate(n)),l=this.toGregorian(r.year,r.month,1),o=r.month,n=l;n.getDay()!==this.calendarInstance.firstDayOfWeek;)this.calendarInstance.setStartDate(n,-864e5);for(var h=0;h<42;++h){var u=this.calendarInstance.createElement("td",{className:"e-cell"}),d=this.calendarInstance.createElement("span"),u=(h%7==0&&this.calendarInstance.weekNumber&&(d.textContent=""+this.calendarInstance.getWeek(n),u.appendChild(d),O.addClass([u],"e-week-number"),a.push(u)),d=new Date(+n),n=this.calendarInstance.minMaxDate(n),{type:"dateTime",skeleton:"full",calendar:"islamic"}),u=this.calendarInstance.globalize.parseDate(this.calendarInstance.globalize.formatDate(n,u),u),p=this.islamicDayCell(n),c=this.calendarInstance.globalize.formatDate(n,{type:"date",skeleton:"full",calendar:"islamic"}),m=this.calendarInstance.createElement("span"),f=(m.textContent=this.calendarInstance.globalize.formatDate(n,{type:"date",skeleton:"d",calendar:"islamic"}),this.calendarInstance.min>n||this.calendarInstance.max<n);f?(O.addClass([p],he),O.addClass([p],ue)):m.setAttribute("title",""+c);o!==this.getIslamicDate(n).month&&O.addClass([p],le),0!==n.getDay()&&6!==n.getDay()||O.addClass([p],"e-weekend"),p.appendChild(m),this.calendarInstance.renderDayCellArgs={date:n,isDisabled:!1,element:p,isOutOfRange:f};var v=this.calendarInstance.renderDayCellArgs;if(this.calendarInstance.renderDayCellEvent(v),v.isDisabled)if(this.calendarInstance.isMultiSelection){if(!O.isNullOrUndefined(this.calendarInstance.values)&&0<this.calendarInstance.values.length)for(var g=0;g<s.length;g++)+new Date(this.calendarInstance.globalize.formatDate(v.date,{type:"date",skeleton:"yMd",calendar:"islamic"}))===+new Date(this.calendarInstance.globalize.formatDate(this.calendarInstance.values[g],{type:"date",skeleton:"yMd",calendar:"islamic"}))&&(this.calendarInstance.values.splice(g,1),g=-1)}else t&&+t==+v.date&&this.calendarInstance.setProperties({value:null},!0);this.calendarInstance.renderDayCellArgs.isDisabled&&!p.classList.contains(de)&&(O.addClass([p],he),O.addClass([p],ue),+this.calendarInstance.renderDayCellArgs.date==+this.calendarInstance.todayDate)&&(this.calendarInstance.todayDisabled=!0);var y=p.classList.contains(le),b=p.classList.contains(he);if(b||O.EventHandler.add(p,"click",this.calendarInstance.clickHandler,this.calendarInstance),!this.calendarInstance.isMultiSelection||O.isNullOrUndefined(this.calendarInstance.values)||y||b)y||b||!this.calendarInstance.getDateVal(n,t)?this.calendarInstance.updateFocus(y,b,n,p,e):O.addClass([p],de);else{for(var D=0;D<this.calendarInstance.values.length;D++)this.calendarInstance.globalize.formatDate(n,{type:"date",skeleton:"short",calendar:"islamic"})===this.calendarInstance.globalize.formatDate(this.calendarInstance.values[D],{type:"date",skeleton:"short",calendar:"islamic"})&&this.calendarInstance.getDateVal(n,this.calendarInstance.values[D])?O.addClass([p],de):this.calendarInstance.updateFocus(y,b,n,p,e);this.calendarInstance.values.length<=0&&this.calendarInstance.updateFocus(y,b,n,p,e)}u.getDate()===(new Date).getDate()&&u.getMonth()===(new Date).getMonth()&&u.getFullYear()===(new Date).getFullYear()&&O.addClass([p],"e-today"),n=new Date(+d),a.push(this.calendarInstance.renderDayCellArgs.element),this.calendarInstance.addDay(n,1,null,this.calendarInstance.max,this.calendarInstance.min)}return a},a.prototype.islamicIconHandler=function(){new Date(this.islamicInValue(this.calendarInstance.currentDate)).setDate(1);var e=new Date(this.islamicInValue(this.calendarInstance.currentDate));switch(this.calendarInstance.currentView()){case"Month":var t=this.islamicCompareMonth(e,this.calendarInstance.min)<1,i=-1<this.islamicCompareMonth(e,this.calendarInstance.max);this.calendarInstance.previousIconHandler(t),this.calendarInstance.nextIconHandler(i);break;case"Year":t=this.hijriCompareYear(e,this.calendarInstance.min)<1,i=-1<this.hijriCompareYear(e,this.calendarInstance.max);this.calendarInstance.previousIconHandler(t),this.calendarInstance.nextIconHandler(i);break;case"Decade":var t=O.HijriParser.toGregorian(1361,1,1),i=this.hijriCompareDecade(e,this.calendarInstance.min)<1,s=-1<this.hijriCompareDecade(e,this.calendarInstance.max),i=O.HijriParser.toGregorian(this.calendarInstance.headerTitleElement.textContent.split("-")[0].trim(),1,1).getFullYear()===t.getFullYear()||i;this.calendarInstance.previousIconHandler(i),this.calendarInstance.nextIconHandler(s)}},a.prototype.islamicNext=function(){this.calendarInstance.effect="";var e=this.calendarInstance.getViewNumber(this.calendarInstance.currentView()),t=this.getIslamicDate(this.calendarInstance.currentDate);switch(this.calendarInstance.currentView()){case"Year":this.calendarInstance.currentDate=this.toGregorian(t.year+1,t.month,1),this.calendarInstance.switchView(e);break;case"Month":this.calendarInstance.currentDate=this.toGregorian(t.year,t.month+1,1),this.calendarInstance.switchView(e);break;case"Decade":this.calendarInstance.nextIconClicked=!0,t.year-this.calendarInstance.headerElement.textContent.split("-")[0].trim()==1&&(t.year=t.year-this.calendarInstance.headerElement.textContent.split("-")[0].trim()==1?t.year+1:t.year),this.calendarInstance.currentDate=this.toGregorian(t.year+10,t.month,1),this.calendarInstance.switchView(e)}},a.prototype.islamicPrevious=function(){var e=this.calendarInstance.getViewNumber(this.calendarInstance.currentView()),t=(this.calendarInstance.effect="",this.getIslamicDate(this.calendarInstance.currentDate));switch(this.calendarInstance.currentView()){case"Month":this.calendarInstance.currentDate=this.toGregorian(t.year,t.month-1,1),this.calendarInstance.switchView(e);break;case"Year":this.calendarInstance.currentDate=this.toGregorian(t.year-1,t.month,1),this.calendarInstance.switchView(e);break;case"Decade":this.calendarInstance.previousIconClicked=!0,this.calendarInstance.currentDate=this.toGregorian(t.year-10,t.month-1,1),this.calendarInstance.switchView(e)}},a.prototype.islamicRenderYears=function(e,t){this.calendarInstance.removeTableHeadElement();var i=[],s=O.isNullOrUndefined(t),a=new Date(this.islamicInValue(this.calendarInstance.currentDate)),n=this.getIslamicDate(a),r=(a=O.HijriParser.toGregorian(n.year,1,1),n.month),l=n.year,o=n.year,h=this.getIslamicDate(this.calendarInstance.min).year,u=this.getIslamicDate(this.calendarInstance.min).month,d=this.getIslamicDate(this.calendarInstance.max).year,p=this.getIslamicDate(this.calendarInstance.max).month;this.islamicTitleUpdate(this.calendarInstance.currentDate,"months");for(var c=1;c<=12;++c){var m=this.getIslamicDate(a),a=O.HijriParser.toGregorian(m.year,c,1),m=this.islamicDayCell(a),f=this.calendarInstance.createElement("span"),v=t&&this.getIslamicDate(t).month===this.getIslamicDate(a).month,v=t&&this.getIslamicDate(t).year===l&&v;f.textContent=this.calendarInstance.globalize.formatDate(a,{type:"dateTime",format:"MMM",calendar:"islamic"}),this.calendarInstance.min&&(o<h||c<u&&o===h)||this.calendarInstance.max&&(d<o||p<c&&d<=o)?O.addClass([m],he):!s&&v?O.addClass([m],de):this.getIslamicDate(a).month===r&&this.getIslamicDate(this.calendarInstance.currentDate).month===r&&O.addClass([m],pe),m.classList.contains(he)||O.EventHandler.add(m,"click",this.calendarInstance.clickHandler,this.calendarInstance),m.appendChild(f),i.push(m)}this.islamicRenderTemplate(i,4,oe,e,t)},a.prototype.islamicRenderDecade=function(e,t){this.calendarInstance.removeTableHeadElement();var i=[],s=new Date(this.islamicInValue(this.calendarInstance.currentDate)),a=this.getIslamicDate(s),n=(s=O.HijriParser.toGregorian(a.year,1,1)).getFullYear(),r=new Date(this.islamicInValue(n-n%10)),n=new Date(this.islamicInValue(n-n%10+9)),l=(r.getFullYear(),n.getFullYear(),this.calendarInstance.globalize.formatDate(r,{type:"dateTime",format:"y",calendar:"islamic"})),o=this.calendarInstance.globalize.formatDate(n,{type:"dateTime",format:"y",calendar:"islamic"}),h=(a.year%10==1?(l=a.year,o=a.year+9):1<a.year%10?o=(l=a.year-(a.year%10-1))+9:a.year%10==0&&(l=a.year-9,o=a.year),"ar"===this.calendarInstance.locale&&(l=Number(l.toString().replace(/[٠١٢٣٤٥٦٧٨٩]/g,function(e){return String.fromCharCode(e.charCodeAt(0)-1632+48)})),o=Number(o.toString().replace(/[٠١٢٣٤٥٦٧٨٩]/g,function(e){return String.fromCharCode(e.charCodeAt(0)-1632+48)}))),this.calendarInstance.headerElement.textContent.split("-"));if((!O.isNullOrUndefined(e)&&h[0]!==l&&"home"===e.action||!O.isNullOrUndefined(e)&&"keydown"===e.type&&"end"===e.action)&&(l=this.calendarInstance.headerElement.textContent.split("-")[0].trim(),o=this.calendarInstance.headerElement.textContent.split("-")[1].trim()),this.calendarInstance.islamicPreviousHeader&&(l=this.calendarInstance.islamicPreviousHeader.split("-")[0].trim(),o=this.calendarInstance.islamicPreviousHeader.split("-")[1].trim(),this.calendarInstance.islamicPreviousHeader=null),this.calendarInstance.previousIconClicked){var u=0;for(u=0;u<=h.length;u++)(o=o-h[u]==2||h[u]-o==2?(parseInt(o,10)+1).toString():o-h[u]==3||h[u]-o==3?(parseInt(o,10)+2).toString():o-h[u]==4||h[u]-o==4?(parseInt(o,10)+3).toString():o-h[u]==5||h[u]-o==5?(parseInt(o,10)+4).toString():o)-h[u]!=0&&h[u]-o!=0||(o=(parseInt(o,10)-1).toString());o-h[u]!=8&&h[u]-o!=8||(o=(parseInt(o,10)-9).toString(),l=(parseInt(o,10)-9).toString()),o-h[u]!=7&&h[u]-o!=7||(o=(parseInt(o,10)-8).toString(),l=(parseInt(o,10)-9).toString()),o-(l=o-l==10?(parseInt(l,10)+1).toString():o-l==11?(parseInt(l,10)+2).toString():o-l==12?(parseInt(l,10)+3).toString():l)==8&&(l=(parseInt(l,10)-1).toString())}if(this.calendarInstance.nextIconClicked){for(u=0;u<=h.length;u++)(l=l-h[u]!=0&&h[u]-l!=0?l:(parseInt(l,10)+1).toString())-h[u]==2&&l>h[u].trim()&&(l=(parseInt(l,10)-1).toString()),h[u]-l==1&&l<h[u].trim()&&(l=(parseInt(l,10)+2).toString());1<l-this.calendarInstance.headerTitleElement.textContent.split("-")[1].trim()&&(l=(parseInt(this.calendarInstance.headerTitleElement.textContent.split("-")[1].trim(),10)+1).toString(),o=(parseInt(l,10)+9).toString()),o=(o=o-l==10?(parseInt(o,10)-1).toString():o)-l==7?(parseInt(o,10)+2).toString():o-l==8?(parseInt(o,10)+1).toString():o}"ar"===this.calendarInstance.locale?(r=this.calendarInstance.globalize.formatDate(r,{type:"dateTime",format:"y",calendar:"islamic"}),n=this.calendarInstance.globalize.formatDate(n,{type:"dateTime",format:"y",calendar:"islamic"}),this.calendarInstance.headerTitleElement.textContent=r+" - "+n):this.calendarInstance.headerTitleElement.textContent=l+" - "+o,this.calendarInstance.nextIconClicked=this.calendarInstance.previousIconClicked=!1;for(var r=(parseInt(l,10)-2).toString(),d=Math.round(.97*parseInt(l,10)+622),p=Math.round(.97*parseInt(o,10)+622),c=Math.round(.97*parseInt(r,10)+622),m=1;m<=12;++m){var f,v,g=c+m,a=(s.setFullYear(g),s.setDate(1),s.setMonth(0),1<this.getIslamicDate(s).year-a.year&&(s.setMonth(1),m-=1,s.setFullYear(s.getFullYear()-1)),this.getIslamicDate(s)),s=O.HijriParser.toGregorian(a.year,1,1);(a.year===parseInt(l,10)-1||a.year>=l&&a.year<=p||a.year===parseInt(o,10)+1)&&(f=this.islamicDayCell(s),O.attributes(f,{role:"gridcell"}),(v=this.calendarInstance.createElement("span")).textContent=this.calendarInstance.globalize.formatDate(s,{type:"dateTime",format:"y",calendar:"islamic"}),a.year===parseInt(l,10)-1||g<d||p<g&&a.year!==parseInt(o,10)?(O.addClass([f],le),(g<=new Date(this.islamicInValue(this.calendarInstance.min)).getFullYear()||g>=new Date(this.islamicInValue(this.calendarInstance.max)).getFullYear())&&O.addClass([f],he)):g<new Date(this.islamicInValue(this.calendarInstance.min)).getFullYear()||g>new Date(this.islamicInValue(this.calendarInstance.max)).getFullYear()?O.addClass([f],he):O.isNullOrUndefined(t)||this.getIslamicDate(s).year!==this.getIslamicDate(t).year?this.getIslamicDate(s).year!==this.getIslamicDate(this.calendarInstance.currentDate).year||f.classList.contains(he)||O.addClass([f],pe):O.addClass([f],de),f.classList.contains(he)||O.EventHandler.add(f,"click",this.calendarInstance.clickHandler,this.calendarInstance),f.appendChild(v),(!O.isNullOrUndefined(e)&&"home"===e.action&&a.year.toString()===l||!O.isNullOrUndefined(e)&&"end"===e.action&&a.year.toString()===o)&&O.addClass([f],pe),i.push(f))}this.islamicRenderTemplate(i,4,"e-decade",e,t)},a.prototype.islamicDayCell=function(e){var t={skeleton:"full",type:"dateTime",calendar:"islamic"},e=this.calendarInstance.globalize.formatDate(e,t),e=this.calendarInstance.globalize.parseDate(e,t).valueOf(),t={className:"e-cell",attrs:{id:""+O.getUniqueID(""+e),"aria-selected":"false",role:"gridcell"}};return this.calendarInstance.createElement("td",t)},a.prototype.islamicRenderTemplate=function(e,t,i,s,a){for(var n,r=this.calendarInstance.getViewNumber(this.calendarInstance.currentView()),l=(this.calendarInstance.tableBodyElement=this.calendarInstance.createElement("tbody"),this.calendarInstance.table.appendChild(this.calendarInstance.tableBodyElement),O.removeClass([this.calendarInstance.contentElement,this.calendarInstance.headerElement],["e-month","e-decade",oe]),O.addClass([this.calendarInstance.contentElement,this.calendarInstance.headerElement],[i]),t),o=0,h=0;h<Math.round(e.length/t);++h){for(n=this.calendarInstance.createElement("tr",{attrs:{role:"row"}}),o=0+o;o<l;o++)e[o].classList.contains("e-week-number")||O.isNullOrUndefined(e[o].children[0])||(O.addClass([e[o].children[0]],["e-day"]),O.rippleEffect(e[o].children[0],{duration:600,isCenterRipple:!0})),n.appendChild(e[o]),this.calendarInstance.weekNumber&&7===o&&e[7].classList.contains(le)&&O.addClass([n],ce),!this.calendarInstance.weekNumber&&6===o&&e[6].classList.contains(le)&&O.addClass([n],ce),this.calendarInstance.weekNumber?41===o&&e[41].classList.contains(le)&&O.addClass([n],ce):35===o&&e[35].classList.contains(le)&&O.addClass([n],ce);l+=t,o+=0,this.calendarInstance.tableBodyElement.appendChild(n)}this.calendarInstance.table.querySelector("tbody").className=this.calendarInstance.effect,this.islamicIconHandler(),(r!==this.calendarInstance.getViewNumber(this.calendarInstance.currentView())||0===r&&r!==this.calendarInstance.getViewNumber(this.calendarInstance.currentView()))&&this.calendarInstance.navigateHandler(s),this.calendarInstance.setAriaActiveDescendant(),this.calendarInstance.changedArgs={value:this.calendarInstance.value,values:this.calendarInstance.values},this.calendarInstance.changeHandler()},a.prototype.islamicCompareMonth=function(e,t){e=this.getIslamicDate(e),t=this.getIslamicDate(t),e=e.year>t.year?1:e.year<t.year?-1:e.month===t.month?0:e.month>t.month?1:-1;return e},a.prototype.islamicCompare=function(e,t,i){var s=this.getIslamicDate(e),t=this.getIslamicDate(t).year,a=t,n=0;return i&&(a=(t-=t%i)-t%i+i-1),s.year>a?n=1:("Decade"===this.calendarInstance.currentView()&&s.year<t&&!(2058<=e.getFullYear()&&e.getFullYear()<=2069)||s.year<t&&"Year"===this.calendarInstance.currentView())&&(n=-1),n},a.prototype.getIslamicDate=function(e){return O.HijriParser.getHijriDate(e)},a.prototype.toGregorian=function(e,t,i){return O.HijriParser.toGregorian(e,t,i)},a.prototype.hijriCompareYear=function(e,t){return this.islamicCompare(e,t,0)},a.prototype.hijriCompareDecade=function(e,t){return this.islamicCompare(e,t,10)},a.prototype.destroy=function(){this.calendarInstance=null},a.prototype.islamicInValue=function(e){return e instanceof Date?e.toUTCString():""+e},a);function a(e){this.calendarInstance=e}me=function(e,t){return(me=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)};var me,n,r=function(e,t,i,s){var a,n=arguments.length,r=n<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;0<=l;l--)(a=e[l])&&(r=(n<3?a(r):3<n?a(t,i,r):a(t,i))||r);return 3<n&&r&&Object.defineProperty(t,i,r),r},fe="e-datepicker",ve="e-popup-wrapper",ge="e-input-focus",ye="e-error",be="e-active",De="e-date-overflow",Ee="e-selected",Ce="e-non-edit",ke=["title","class","style"],r=(function(e,t){function i(){this.constructor=e}me(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(o,n=j),o.prototype.render=function(){this.initialize(),this.bindEvents(),"Never"!==this.floatLabelType&&u.Input.calculateWidth(this.inputElement,this.inputWrapper.container),O.isNullOrUndefined(this.inputWrapper.buttons[0])||O.isNullOrUndefined(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon"),!O.isNullOrUndefined(O.closest(this.element,"fieldset"))&&O.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.initTimeZone=(new Date).getTimezoneOffset(),this.renderComplete(),this.setTimeZone(this.serverTimezoneOffset)},o.prototype.setTimeZone=function(e){!O.isNullOrUndefined(this.serverTimezoneOffset)&&this.value&&(e=e+(new Date).getTimezoneOffset()/60,e=this.isDayLightSaving()?e--:e,this.value=new Date(this.value.getTime()+60*e*60*1e3),this.updateInput(),this.changeTrigger(null))},o.prototype.isDayLightSaving=function(){var e=new Date(this.value.getFullYear(),0,1).getTimezoneOffset(),t=new Date(this.value.getFullYear(),6,1).getTimezoneOffset();return this.value.getTimezoneOffset()<Math.max(e,t)},o.prototype.setAllowEdit=function(){this.allowEdit?this.readonly||this.inputElement.removeAttribute("readonly"):O.attributes(this.inputElement,{readonly:""}),this.updateIconState()},o.prototype.updateIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&O.removeClass([this.inputWrapper.container],[Ce]):""===this.inputElement.value?O.removeClass([this.inputWrapper.container],[Ce]):O.addClass([this.inputWrapper.container],[Ce])},o.prototype.initialize=function(){this.checkInvalidValue(this.value),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"}),this.createInput(),this.updateHtmlAttributeToWrapper(),this.setAllowEdit(),!this.enableMask||this.value||!this.maskedDateValue||"Always"!==this.floatLabelType&&this.floatLabelType&&this.placeholder?this.enableMask||this.updateInput(!0):(this.updateInput(!0),this.updateInputValue(this.maskedDateValue)),this.previousElementValue=this.inputElement.value,this.previousDate=O.isNullOrUndefined(this.value)?null:new Date(+this.value),this.inputElement.setAttribute("value",this.inputElement.value),this.inputValueCopy=this.value},o.prototype.createInput=function(){"datepicker"===this.getModuleName()&&(e={placeholder:this.placeholder},this.globalize=new O.Internationalization(this.locale),this.l10n=new O.L10n("datepicker",e,this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0)),this.fullScreenMode&&O.Browser.isDevice&&(this.cssClass+=" e-popup-expand");var e=this.cssClass,t=(O.isNullOrUndefined(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),!this.enableMask);this.inputWrapper=u.Input.createInput({element:this.inputElement,floatLabelType:this.floatLabelType,bindClearAction:t,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:e,enabled:this.enabled,enableRtl:this.enableRtl,showClearButton:this.showClearButton},buttons:["e-input-group-icon e-date-icon e-icons"]},this.createElement),this.setWidth(this.width),""!==this.inputElement.name?this.inputElement.setAttribute("name",""+this.inputElement.getAttribute("name")):this.inputElement.setAttribute("name",""+this.element.id),O.attributes(this.inputElement,{"aria-atomic":"true","aria-expanded":"false",role:"combobox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-invalid":"false"}),this.inputElement.hasAttribute("aria-label")||this.inputElement.setAttribute("aria-label",this.getModuleName()),this.enabled?(this.inputElement.setAttribute("aria-disabled","false"),this.inputElement.setAttribute("tabindex",this.tabIndex)):(this.inputElement.setAttribute("aria-disabled","true"),this.inputElement.tabIndex=-1),u.Input.addAttributes({"aria-label":"select",role:"button"},this.inputWrapper.buttons[0]),O.addClass([this.inputWrapper.container],"e-date-wrapper")},o.prototype.updateInput=function(e,t){var i;void 0===e&&(e=!1),void 0===t&&(t=!1),this.value&&!this.isCalendar()&&this.disabledDates(e,t),isNaN(+new Date(this.checkValue(this.value)))&&this.setProperties({value:null},!0),this.strictMode&&(n.prototype.validateDate.call(this),this.minMaxUpdates(),n.prototype.minMaxUpdate.call(this)),!O.isNullOrUndefined(this.value)&&(e=this.value,t=void 0,i=O.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString,t="datetimepicker"===this.getModuleName()?"Gregorian"===this.calendarMode?this.globalize.formatDate(this.value,{format:i,type:"dateTime",skeleton:"yMd"}):this.globalize.formatDate(this.value,{format:i,type:"dateTime",skeleton:"yMd",calendar:"islamic"}):(i="Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"},this.globalize.formatDate(this.value,i)),+e<=+this.max&&+e>=+this.min||(i=+e>=+this.max||!+this.value||!+this.value||+e<=+this.min,!this.strictMode&&i))&&this.updateInputValue(t),O.isNullOrUndefined(this.value)&&this.strictMode&&(this.enableMask?(this.updateInputValue(this.maskedDateValue),this.notify("createMask",{module:"MaskedDateTime"})):this.updateInputValue("")),!this.strictMode&&O.isNullOrUndefined(this.value)&&this.invalidValueString&&this.updateInputValue(this.invalidValueString),this.changedArgs={value:this.value},this.errorClass(),this.updateIconState()},o.prototype.minMaxUpdates=function(){!O.isNullOrUndefined(this.value)&&this.value<this.min&&this.min<=this.max&&this.strictMode?(this.setProperties({value:this.min},!0),this.changedArgs={value:this.value}):!O.isNullOrUndefined(this.value)&&this.value>this.max&&this.min<=this.max&&this.strictMode&&(this.setProperties({value:this.max},!0),this.changedArgs={value:this.value})},o.prototype.checkStringValue=function(e){var t,i=null,s=null,a=null;return"datetimepicker"===this.getModuleName()?(t=new O.Internationalization(this.locale),a="Gregorian"===this.calendarMode?(s={format:this.dateTimeFormat,type:"dateTime",skeleton:"yMd"},{format:t.getDatePattern({skeleton:"yMd"}),type:"dateTime"}):(s={format:this.dateTimeFormat,type:"dateTime",skeleton:"yMd",calendar:"islamic"},{format:t.getDatePattern({skeleton:"yMd"}),type:"dateTime",calendar:"islamic"})):s="Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"},i=this.checkDateValue(this.globalize.parseDate(this.getAmPmValue(e),s)),i=O.isNullOrUndefined(i)&&"datetimepicker"===this.getModuleName()?this.checkDateValue(this.globalize.parseDate(this.getAmPmValue(e),a)):i},o.prototype.checkInvalidValue=function(e){var t,i,s;e instanceof Date||O.isNullOrUndefined(e)||(t=null,"number"==typeof(i=e)&&(i=e.toString()),"datetimepicker"===this.getModuleName()?(e=new O.Internationalization(this.locale),"Gregorian"===this.calendarMode?(this.dateTimeFormat,e.getDatePattern({skeleton:"yMd"})):(this.dateTimeFormat,e.getDatePattern({skeleton:"yMd"}))):"Gregorian"===this.calendarMode?this.formatString:this.formatString,e=!1,"string"!=typeof i?e=!(i=null):("string"==typeof i&&(i=i.trim()),(t=this.checkStringValue(i))||(s=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,!/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/.test(i)&&!s.test(i)||/^[a-zA-Z0-9- ]*$/.test(i)||isNaN(+new Date(this.checkValue(i)))?e=!0:t=new Date(i))),e?(this.strictMode||(this.invalidValueString=i),this.setProperties({value:null},!0)):this.setProperties({value:t},!0))},o.prototype.bindInputEvent=function(){O.isNullOrUndefined(this.formatString)&&!this.enableMask||(this.enableMask||-1===this.formatString.indexOf("y")?O.EventHandler.add(this.inputElement,"input",this.inputHandler,this):O.EventHandler.remove(this.inputElement,"input",this.inputHandler))},o.prototype.bindEvents=function(){O.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.dateIconHandler,this),O.EventHandler.add(this.inputElement,"mouseup",this.mouseUpHandler,this),O.EventHandler.add(this.inputElement,"focus",this.inputFocusHandler,this),O.EventHandler.add(this.inputElement,"blur",this.inputBlurHandler,this),O.EventHandler.add(this.inputElement,"keyup",this.keyupHandler,this),this.enableMask&&O.EventHandler.add(this.inputElement,"keydown",this.keydownHandler,this),this.bindInputEvent(),O.EventHandler.add(this.inputElement,"change",this.inputChangeHandler,this),this.showClearButton&&this.inputWrapper.clearButton&&O.EventHandler.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this),this.formElement&&O.EventHandler.add(this.formElement,"reset",this.resetFormHandler,this),this.defaultKeyConfigs=O.extend(this.defaultKeyConfigs,this.keyConfigs),this.keyboardModules=new O.KeyboardEvents(this.inputElement,{eventName:"keydown",keyAction:this.inputKeyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})},o.prototype.keydownHandler=function(e){switch(e.code){case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"ArrowDown":case"Home":case"End":case"Backspace":case"Delete":!this.enableMask||this.popupObj||this.readonly||("Delete"!==e.code&&"Backspace"!==e.code&&e.preventDefault(),this.notify("keyDownHandler",{module:"MaskedDateTime",e:e}))}},o.prototype.unBindEvents=function(){O.isNullOrUndefined(this.inputWrapper)||O.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.dateIconHandler),O.EventHandler.remove(this.inputElement,"mouseup",this.mouseUpHandler),O.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),O.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),O.EventHandler.remove(this.inputElement,"change",this.inputChangeHandler),O.EventHandler.remove(this.inputElement,"keyup",this.keyupHandler),this.enableMask&&O.EventHandler.remove(this.inputElement,"keydown",this.keydownHandler),this.showClearButton&&this.inputWrapper.clearButton&&O.EventHandler.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler),this.formElement&&O.EventHandler.remove(this.formElement,"reset",this.resetFormHandler)},o.prototype.resetFormHandler=function(){var e;this.enabled&&!this.inputElement.disabled&&(e=this.inputElement.getAttribute("value"),"EJS-DATEPICKER"!==this.element.tagName&&"EJS-DATETIMEPICKER"!==this.element.tagName||(e="",this.inputValueCopy=null,this.inputElement.setAttribute("value","")),this.setProperties({value:this.inputValueCopy},!0),this.restoreValue(),this.inputElement)&&(this.updateInputValue(e),this.errorClass())},o.prototype.restoreValue=function(){this.currentDate=this.value||new Date,this.previousDate=this.value,this.previousElementValue=O.isNullOrUndefined(this.inputValueCopy)?"":this.globalize.formatDate(this.inputValueCopy,{format:this.formatString,type:"dateTime",skeleton:"yMd"})},o.prototype.inputChangeHandler=function(e){this.enabled&&e.stopPropagation()},o.prototype.bindClearEvent=function(){this.showClearButton&&this.inputWrapper.clearButton&&O.EventHandler.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this)},o.prototype.resetHandler=function(e){this.enabled&&(e.preventDefault(),this.clear(e))},o.prototype.mouseUpHandler=function(e){this.enableMask&&(e.preventDefault(),this.notify("setMaskSelection",{module:"MaskedDateTime"}))},o.prototype.clear=function(e){var t;this.setProperties({value:null},!0),this.enableMask||this.updateInputValue(""),O.isNullOrUndefined(this.value)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0))),this.trigger("cleared",{event:e}),this.invalidValueString="",this.updateInput(),this.popupUpdate(),this.changeEvent(e),this.enableMask&&this.notify("clearHandler",{module:"MaskedDateTime"}),O.closest(this.element,"form")&&(e=this.element,(t=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),e.dispatchEvent(t))},o.prototype.preventEventBubbling=function(e){e.preventDefault(),this.interopAdaptor.invokeMethodAsync("OnDateIconClick")},o.prototype.updateInputValue=function(e){u.Input.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton)},o.prototype.dateIconHandler=function(e){this.enabled&&(this.isIconClicked=!0,O.Browser.isDevice&&(this.inputElement.setAttribute("readonly",""),this.inputElement.blur()),e.preventDefault(),this.readonly||(this.isCalendar()?this.hide(e):(this.isDateIconClicked=!0,this.show(null,e),"datetimepicker"===this.getModuleName()&&this.inputElement.focus(),this.inputElement.focus(),O.addClass([this.inputWrapper.container],[ge]),O.addClass(this.inputWrapper.buttons,be))),this.isIconClicked=!1)},o.prototype.updateHtmlAttributeToWrapper=function(){if(!O.isNullOrUndefined(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i,s=t[e];O.isNullOrUndefined(this.htmlAttributes[""+s])||-1<ke.indexOf(s)&&("class"===s?""!==(i=this.htmlAttributes[""+s].replace(/\s+/g," ").trim())&&O.addClass([this.inputWrapper.container],i.split(" ")):"style"===s?(i=this.inputWrapper.container.getAttribute(s),O.isNullOrUndefined(i)?i=this.htmlAttributes[""+s]:";"===i.charAt(i.length-1)?i+=this.htmlAttributes[""+s]:i=i+";"+this.htmlAttributes[""+s],this.inputWrapper.container.setAttribute(s,i)):this.inputWrapper.container.setAttribute(s,this.htmlAttributes[""+s]))}},o.prototype.updateHtmlAttributeToElement=function(){if(!O.isNullOrUndefined(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i=t[e];ke.indexOf(i)<0&&this.inputElement.setAttribute(i,this.htmlAttributes[""+i])}},o.prototype.updateCssClass=function(e,t){O.isNullOrUndefined(t)||(t=t.replace(/\s+/g," ").trim()),O.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),u.Input.setCssClass(e,[this.inputWrapper.container],t),this.popupWrapper&&u.Input.setCssClass(e,[this.popupWrapper],t)},o.prototype.calendarKeyActionHandle=function(e){switch(e.action){case"escape":this.isCalendar()?this.hide(e):this.inputWrapper.container.children[this.index].blur();break;case"enter":this.isCalendar()?+this.value==+this.currentDate||this.isCalendar()||this.inputWrapper.container.children[this.index].focus():this.show(null,e),"datetimepicker"===this.getModuleName()&&this.inputElement.focus()}},o.prototype.inputFocusHandler=function(){var e;this.isFocused=!0,this.enabled&&(this.initTimeZone!==(new Date).getTimezoneOffset()&&this.strictModeUpdate(!0),this.enableMask&&!this.inputElement.value&&this.placeholder&&this.maskedDateValue&&!this.value&&("Auto"===this.floatLabelType||"Never"===this.floatLabelType||this.placeholder)&&(this.updateInputValue(this.maskedDateValue),this.inputElement.selectionStart=0,this.inputElement.selectionEnd=this.inputElement.value.length),this.enableMask&&this.showClearButton&&this.inputElement&&this.inputElement.value===this.maskedDateValue&&this.inputWrapper&&this.inputWrapper.clearButton&&!this.inputWrapper.clearButton.classList.contains("e-clear-icon-hide")&&this.inputWrapper.clearButton.classList.add("e-clear-icon-hide"),this.isDateIconClicked=!(e={model:this}),this.trigger("focus",e),this.updateIconState(),this.clearFloatLabelOverflowWidth(),this.openOnFocus)&&!this.isIconClicked&&this.show()},o.prototype.inputHandler=function(e){this.isPopupClicked=!1,this.enableMask&&(O.isNullOrUndefined(e)||O.isNullOrUndefined(e.inputType)||"insertFromPaste"!==e.inputType?this.notify("inputHandler",{module:"MaskedDateTime"}):this.notify("maskPasteInputHandler",{module:"MaskedDateTime"}))},o.prototype.inputBlurHandler=function(e){this.updateFloatLabelOverflowWidth(),this.enabled&&(this.strictModeUpdate(),""===this.inputElement.value&&O.isNullOrUndefined(this.value)&&(this.invalidValueString=null,this.updateInputValue("")),this.isBlur=!0,this.updateInput(!1,!0),this.isBlur=!1,this.popupUpdate(),this.changeTrigger(e),this.enableMask&&this.maskedDateValue&&this.placeholder&&"Always"!==this.floatLabelType&&(this.inputElement.value!==this.maskedDateValue||this.value||"Auto"!==this.floatLabelType&&"Never"!==this.floatLabelType&&!this.placeholder||this.updateInputValue("")),this.errorClass(),this.isCalendar()&&document.activeElement===this.inputElement&&this.hide(e),"datepicker"===this.getModuleName()&&this.trigger("blur",{model:this}),this.isCalendar()&&(this.defaultKeyConfigs=O.extend(this.defaultKeyConfigs,this.keyConfigs),this.calendarKeyboardModules=new O.KeyboardEvents(this.calendarElement.children[1].firstElementChild,{eventName:"keydown",keyAction:this.calendarKeyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})),this.isPopupClicked=!1)},o.prototype.documentHandler=function(e){O.isNullOrUndefined(this.popupObj)||O.isNullOrUndefined(this.inputWrapper)||!(this.inputWrapper.container.contains(e.target)&&"mousedown"!==e.type||this.popupObj.element&&this.popupObj.element.contains(e.target))||"touchstart"===e.type||e.preventDefault();var t=e.target;O.closest(t,".e-datepicker.e-popup-wrapper")||O.isNullOrUndefined(this.inputWrapper)||O.closest(t,".e-input-group")===this.inputWrapper.container||t.classList.contains("e-day")?O.closest(t,".e-datepicker.e-popup-wrapper")&&(t.classList.contains("e-day")&&!O.isNullOrUndefined(e.target.parentElement)&&e.target.parentElement.classList.contains("e-selected")&&O.closest(t,".e-content")&&O.closest(t,".e-content").classList.contains("e-"+this.depth.toLowerCase())||O.closest(t,".e-footer-container")&&t.classList.contains("e-today")&&t.classList.contains("e-btn")&&+new Date(+this.value)==+n.prototype.generateTodayVal.call(this,this.value))&&this.hide(e):(this.hide(e),t.classList.contains("e-dlg-overlay")?e.preventDefault():this.focusOut())},o.prototype.inputKeyActionHandle=function(e){var t=this.currentView();switch(e.action){case"altUpArrow":this.isAltKeyPressed=!1,this.hide(e),this.inputElement.focus();break;case"altDownArrow":this.isAltKeyPressed=!0,this.strictModeUpdate(),this.updateInput(),this.changeTrigger(e),"datepicker"===this.getModuleName()&&this.show(null,e);break;case"escape":this.hide(e);break;case"enter":var i=this.inputElement.value===this.previousElementValue,s=this.value instanceof Date&&this.previousDate instanceof Date?this.value.getTime()===this.previousDate.getTime():this.value===this.previousDate;i&&s||(this.strictModeUpdate(),this.updateInput(),this.popupUpdate(),this.changeTrigger(e),this.errorClass()),this.isCalendar()||document.activeElement!==this.inputElement||this.hide(e),this.isCalendar()&&(e.preventDefault(),e.stopPropagation());break;case"tab":case"shiftTab":var a,i=this.inputElement.selectionStart,s=this.inputElement.selectionEnd;!this.enableMask||this.popupObj||this.readonly||(a=this.inputElement.value.length,(0===i&&s===a||s!==a&&"tab"===e.action||0!==i&&"shiftTab"===e.action)&&e.preventDefault(),this.notify("keyDownHandler",{module:"MaskedDateTime",e:e}),i=this.inputElement.selectionStart,s=this.inputElement.selectionEnd),this.strictModeUpdate(),this.updateInput(),this.popupUpdate(),this.changeTrigger(e),this.errorClass(),this.enableMask&&(this.inputElement.selectionStart=i,this.inputElement.selectionEnd=s),"tab"===e.action&&e.target===this.inputElement&&this.isCalendar()&&document.activeElement===this.inputElement&&(e.preventDefault(),this.headerTitleElement.focus()),"shiftTab"===e.action&&e.target===this.inputElement&&this.isCalendar()&&document.activeElement===this.inputElement&&this.hide(e);break;default:this.defaultAction(e),"select"===e.action&&t===this.depth&&this.hide(e)}},o.prototype.defaultAction=function(e){this.previousDate=!O.isNullOrUndefined(this.value)&&new Date(+this.value)||null,this.isCalendar()&&(n.prototype.keyActionHandle.call(this,e),this.isCalendar())&&O.attributes(this.inputElement,{"aria-activedescendant":""+this.setActiveDescendant()})},o.prototype.popupUpdate=function(){var e;(O.isNullOrUndefined(this.value)&&!O.isNullOrUndefined(this.previousDate)||"datetimepicker"!==this.getModuleName()&&+this.value!=+this.previousDate||"datetimepicker"===this.getModuleName()&&+this.value!=+this.previousDateTime)&&(this.popupObj&&0<this.popupObj.element.querySelectorAll("."+Ee).length&&O.removeClass(this.popupObj.element.querySelectorAll("."+Ee),[Ee]),O.isNullOrUndefined(this.value)||+this.value>=+this.min&&+this.value<=+this.max&&(e=new Date(this.checkValue(this.value)),n.prototype.navigateTo.call(this,"Month",e)))},o.prototype.strictModeUpdate=function(e){var t,i,s,a;if("datetimepicker"===this.getModuleName()?t=O.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString:/^y/.test(this.formatString)&&!/[^a-zA-Z]/.test(this.formatString)||(t=O.isNullOrUndefined(this.formatString)?this.formatString:this.formatString.replace("dd","d")),O.isNullOrUndefined(t)?t=this.formatString:t.split("M").length-1<3&&(t=t.replace("MM","M")),s="datetimepicker"===this.getModuleName()?"Gregorian"===this.calendarMode?{format:O.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:O.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}:i="Gregorian"===this.calendarMode?{format:t,type:"dateTime",skeleton:"yMd"}:{format:t,type:"dateTime",skeleton:"yMd",calendar:"islamic"},"string"==typeof this.inputElement.value&&(this.inputElement.value=this.inputElement.value.trim()),"datetimepicker"===this.getModuleName()){if(a=this.checkDateValue(this.globalize.parseDate(this.getAmPmValue(this.inputElement.value),s))?this.globalize.parseDate(this.getAmPmValue(this.inputElement.value),s):(i="Gregorian"===this.calendarMode?{format:t,type:"dateTime",skeleton:"yMd"}:{format:t,type:"dateTime",skeleton:"yMd",calendar:"islamic"},this.globalize.parseDate(this.getAmPmValue(this.inputElement.value),i)),(O.isNullOrUndefined(a)||"object"==typeof a&&isNaN(a.getTime()))&&!O.isNullOrUndefined(this.inputFormatsString))for(var n=0,r=this.inputFormatsString;n<r.length;n++){var l=r[n],o=void 0;if(o="Gregorian"===this.calendarMode?{format:l,type:"dateTime",skeleton:"yMd"}:{format:l,type:"dateTime",skeleton:"yMd",calendar:"islamic"},a=this.globalize.parseDate(this.getAmPmValue(this.inputElement.value),o),!O.isNullOrUndefined(a)&&a instanceof Date&&!isNaN(a.getTime()))break}}else{if(a=this.globalize.parseDate(this.getAmPmValue(this.inputElement.value),s),(O.isNullOrUndefined(a)||"object"==typeof a&&isNaN(a.getTime()))&&!O.isNullOrUndefined(this.inputFormatsString))for(var h=0,u=this.inputFormatsString;h<u.length;h++){var d=u[h],o=void 0;if(o="Gregorian"===this.calendarMode?{format:d,type:"dateTime",skeleton:"yMd"}:{format:d,type:"dateTime",skeleton:"yMd",calendar:"islamic"},a=this.globalize.parseDate(this.getAmPmValue(this.inputElement.value),o),!O.isNullOrUndefined(a)&&a instanceof Date&&!isNaN(a.getTime()))break}a=!O.isNullOrUndefined(a)&&isNaN(+a)?null:a,!O.isNullOrUndefined(this.formatString)&&""!==this.inputElement.value&&this.strictMode&&(this.isPopupClicked||!this.isPopupClicked&&this.inputElement.value===this.previousElementValue)&&-1===this.formatString.indexOf("y")&&a.setFullYear(this.value.getFullYear())}"datepicker"===this.getModuleName()&&this.value&&!isNaN(+this.value)&&a&&!e&&a.setHours(this.value.getHours(),this.value.getMinutes(),this.value.getSeconds(),this.value.getMilliseconds()),this.strictMode&&a?(this.updateInputValue(this.globalize.formatDate(a,s)),this.inputElement.value===this.previousElementValue&&!e||this.setProperties({value:a},!0)):this.strictMode||this.inputElement.value===this.previousElementValue&&!e||this.setProperties({value:a},!0),this.strictMode&&!a&&this.inputElement.value===(this.enableMask?this.maskedDateValue:"")&&this.setProperties({value:null},!0),isNaN(+this.value)&&this.setProperties({value:null},!0),O.isNullOrUndefined(this.value)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0)))},o.prototype.createCalendar=function(){var e=this;this.popupWrapper=this.createElement("div",{className:fe+" "+ve,id:this.inputElement.id+"_options"}),this.popupWrapper.setAttribute("aria-label",this.element.id),this.popupWrapper.setAttribute("role","dialog"),O.isNullOrUndefined(this.cssClass)||(this.popupWrapper.className+=" "+this.cssClass),O.Browser.isDevice&&(this.modelHeader(),this.modal=this.createElement("div"),this.modal.className=fe+" e-date-modal",document.body.className+=" "+De,this.modal.style.display="block",document.body.appendChild(this.modal)),this.calendarElement.querySelector("table tbody").className="",this.popupObj=new H.Popup(this.popupWrapper,{content:this.calendarElement,relateTo:O.Browser.isDevice?document.body:this.inputWrapper.container,position:O.Browser.isDevice?{X:"center",Y:"center"}:this.enableRtl?{X:"right",Y:"bottom"}:{X:"left",Y:"bottom"},offsetY:4,targetType:"container",enableRtl:this.enableRtl,zIndex:this.zIndex,collision:O.Browser.isDevice?{X:"fit",Y:"fit"}:this.enableRtl?{X:"fit",Y:"flip"}:{X:"flip",Y:"flip"},open:function(){O.Browser.isDevice&&e.fullScreenMode&&(e.iconRight=16<parseInt(window.getComputedStyle(e.calendarElement.querySelector(".e-header.e-month .e-prev")).marginRight,10),e.touchModule=new O.Touch(e.calendarElement.querySelector(".e-content.e-month"),{swipe:e.CalendarSwipeHandler.bind(e)}),O.EventHandler.add(e.calendarElement.querySelector(".e-content.e-month"),"touchstart",e.TouchStartHandler,e)),"datetimepicker"!==e.getModuleName()&&document.activeElement!==e.inputElement&&(e.defaultKeyConfigs=O.extend(e.defaultKeyConfigs,e.keyConfigs),e.calendarElement.children[1].firstElementChild.focus(),e.calendarKeyboardModules=new O.KeyboardEvents(e.calendarElement.children[1].firstElementChild,{eventName:"keydown",keyAction:e.calendarKeyActionHandle.bind(e),keyConfigs:e.defaultKeyConfigs}),e.calendarKeyboardModules=new O.KeyboardEvents(e.inputWrapper.container.children[e.index],{eventName:"keydown",keyAction:e.calendarKeyActionHandle.bind(e),keyConfigs:e.defaultKeyConfigs})),O.Browser.isDevice&&e.allowEdit&&!e.readonly&&O.Browser.isIos&&e.inputElement.blur()},close:function(){e.isDateIconClicked&&e.inputWrapper.container.children[e.index].focus(),e.value&&e.disabledDates(),e.popupObj&&e.popupObj.destroy(),e.resetCalendar(),O.detach(e.popupWrapper),e.popupObj=e.popupWrapper=null,e.preventArgs=null,e.calendarKeyboardModules=null,e.setAriaAttributes()},targetExitViewport:function(){O.Browser.isDevice||e.hide()}}),this.popupObj.element.className+=" "+this.cssClass,this.setAriaAttributes()},o.prototype.getAmPmValue=function(e){try{return"string"==typeof e&&""!==e.trim()?e.replace(/(am|pm|Am|aM|pM|Pm)/g,function(e){return e.toLocaleUpperCase()}):""}catch(e){return console.error("Error occurred while processing date:",e),""}},o.prototype.CalendarSwipeHandler=function(e){var t=0;if(this.iconRight)switch(e.swipeDirection){case"Left":t=1;break;case"Right":t=-1}else switch(e.swipeDirection){case"Up":t=1;break;case"Down":t=-1}this.touchStart&&(1===t?this.navigateNext(e):-1===t&&this.navigatePrevious(e),this.touchStart=!1)},o.prototype.TouchStartHandler=function(e){this.touchStart=!0},o.prototype.setAriaDisabled=function(){this.enabled?(this.inputElement.setAttribute("aria-disabled","false"),this.inputElement.setAttribute("tabindex",this.tabIndex)):(this.inputElement.setAttribute("aria-disabled","true"),this.inputElement.tabIndex=-1)},o.prototype.modelHeader=function(){var e,t=this.createElement("div",{className:"e-model-header"}),i=this.createElement("h1",{className:"e-model-year"}),s=this.createElement("div"),a=this.createElement("span",{className:"e-model-day"}),n=this.createElement("span",{className:"e-model-month"}),r="Gregorian"===this.calendarMode?{format:"y",skeleton:"dateTime"}:{format:"y",skeleton:"dateTime",calendar:"islamic"};i.textContent=""+this.globalize.formatDate(this.value||new Date,r),r="Gregorian"===this.calendarMode?{format:"E",skeleton:"dateTime"}:{format:"E",skeleton:"dateTime",calendar:"islamic"},a.textContent=this.globalize.formatDate(this.value||new Date,r)+", ",r="Gregorian"===this.calendarMode?{format:"MMM d",skeleton:"dateTime"}:{format:"MMM d",skeleton:"dateTime",calendar:"islamic"},n.textContent=""+this.globalize.formatDate(this.value||new Date,r),this.fullScreenMode&&(r=this.createElement("span",{className:"e-popup-close"}),O.EventHandler.add(r,"mousedown touchstart",this.modelCloseHandler,this),e=this.showTodayButton?this.calendarElement.querySelector("button.e-today"):null,s.classList.add("e-day-wrapper"),t.appendChild(r),e)&&(e.classList.add("e-outline"),t.appendChild(e)),this.fullScreenMode||t.appendChild(i),s.appendChild(a),s.appendChild(n),t.appendChild(s),this.calendarElement.insertBefore(t,this.calendarElement.firstElementChild)},o.prototype.modelCloseHandler=function(e){this.hide()},o.prototype.changeTrigger=function(e){this.inputElement.value!==this.previousElementValue&&(this.previousDate&&this.previousDate.valueOf())!==(this.value&&this.value.valueOf())&&(this.isDynamicValueChanged&&this.isCalendar()&&this.popupUpdate(),this.changedArgs.value=this.value,this.changedArgs.event=e||null,this.changedArgs.element=this.element,this.changedArgs.isInteracted=!O.isNullOrUndefined(e),this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",this.changedArgs),this.previousElementValue=this.inputElement.value,this.previousDate=isNaN(+new Date(this.checkValue(this.value)))?null:new Date(this.checkValue(this.value)),this.isInteracted=!0),this.isKeyAction=!1},o.prototype.navigatedEvent=function(e){O.extend(this.navigatedArgs,{name:"navigated",event:e}),this.trigger("navigated",this.navigatedArgs)},o.prototype.keyupHandler=function(e){this.isKeyAction=this.inputElement.value!==this.previousElementValue,this.enableMask&&this.showClearButton&&this.inputElement&&this.inputElement.value===this.maskedDateValue&&this.inputWrapper&&this.inputWrapper.clearButton&&!this.inputWrapper.clearButton.classList.contains("e-clear-icon-hide")&&this.inputWrapper.clearButton.classList.add("e-clear-icon-hide")},o.prototype.changeEvent=function(e){this.isIconClicked||this.isBlur||this.isKeyAction||this.selectCalendar(e),(this.previousDate&&this.previousDate.valueOf())!==(this.value&&this.value.valueOf())?(this.changedArgs.event=e||null,this.changedArgs.element=this.element,this.changedArgs.isInteracted=this.isInteracted,this.isDynamicValueChanged||(this.isAngular&&(this.previousDate=this.value&&new Date(+this.value)),this.trigger("change",this.changedArgs)),this.previousDate=this.value&&new Date(+this.value),this.isDynamicValueChanged||this.hide(e),this.previousElementValue=this.inputElement.value,this.errorClass()):e&&this.hide(e),this.isKeyAction=!1},o.prototype.requiredModules=function(){var e=[];return"Islamic"===this.calendarMode&&e.push({args:[this],member:"islamic",name:"Islamic"}),this.enableMask&&e.push({args:[this],member:"MaskedDateTime"}),e},o.prototype.selectCalendar=function(e){var t,i="datetimepicker"===this.getModuleName()&&O.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString;this.value&&(t=(i="datetimepicker"===this.getModuleName()?"Gregorian"===this.calendarMode?{format:i,type:"dateTime",skeleton:"yMd"}:{format:i,type:"dateTime",skeleton:"yMd",calendar:"islamic"}:"Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"},this.globalize.formatDate(this.changedArgs.value,i)),this.enableMask)&&this.notify("createMask",{module:"MaskedDateTime"}),O.isNullOrUndefined(t)||(this.updateInputValue(t),this.enableMask&&this.notify("setMaskSelection",{module:"MaskedDateTime"}))},o.prototype.isCalendar=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains(ve))},o.prototype.setWidth=function(e){this.inputWrapper.container.style.width="number"==typeof e?O.formatUnit(this.width):"string"==typeof e?e.match(/px|%|em/)?this.width:O.formatUnit(this.width):"100%",this.updateFloatLabelOverflowWidth()},o.prototype.show=function(e,t){var i,s,a=this;this.enabled&&this.readonly||!this.enabled||this.popupObj||(i=!0,s=void 0,O.isNullOrUndefined(this.value)||+this.value>=+new Date(this.checkValue(this.min))&&+this.value<=+new Date(this.checkValue(this.max))?s=this.value||null:(s=new Date(this.checkValue(this.value)),this.setProperties({value:null},!0)),this.isCalendar()||(n.prototype.render.call(this),this.setProperties({value:s||null},!0),this.previousDate=s,this.createCalendar()),O.Browser.isDevice&&(this.mobilePopupWrapper=this.createElement("div",{className:"e-datepick-mob-popup-wrap"}),document.body.appendChild(this.mobilePopupWrapper)),this.preventArgs={preventDefault:function(){i=!1},popup:this.popupObj,event:t||null,cancel:!1,appendTo:O.Browser.isDevice?this.mobilePopupWrapper:document.body},s=this.preventArgs,this.trigger("open",s,function(e){a.preventArgs=e,i&&!a.preventArgs.cancel?(O.addClass(a.inputWrapper.buttons,be),a.preventArgs.appendTo.appendChild(a.popupWrapper),a.popupObj.refreshPosition(a.inputElement),e={name:"FadeIn",duration:O.Browser.isDevice?0:300},1e3===a.zIndex?a.popupObj.show(new O.Animation(e),a.element):a.popupObj.show(new O.Animation(e),null),n.prototype.setOverlayIndex.call(a,a.mobilePopupWrapper,a.popupObj.element,a.modal,O.Browser.isDevice),a.setAriaAttributes(),O.Browser.isDevice&&((e=a.createElement("div",{className:"e-dlg-overlay"})).style.zIndex=(a.zIndex-1).toString(),a.mobilePopupWrapper.appendChild(e))):(a.popupObj.destroy(),a.popupWrapper=a.popupObj=null),O.isNullOrUndefined(a.inputElement)||""!==a.inputElement.value||!O.isNullOrUndefined(a.tableBodyElement)&&0<a.tableBodyElement.querySelectorAll("td.e-selected").length&&(O.addClass([a.tableBodyElement.querySelector("td.e-selected")],"e-focused-date"),O.removeClass(a.tableBodyElement.querySelectorAll("td.e-selected"),Ee)),O.EventHandler.add(document,"mousedown touchstart",a.documentHandler,a)}))},o.prototype.hide=function(e){var t,i=this;O.isNullOrUndefined(this.popupWrapper)?(O.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit()):(t=!0,this.preventArgs={preventDefault:function(){t=!1},popup:this.popupObj,event:e||null,cancel:!1},O.removeClass(this.inputWrapper.buttons,be),O.removeClass([document.body],De),e=this.preventArgs,this.isCalendar()?this.trigger("close",e,function(e){i.closeEventCallback(t,e)}):this.closeEventCallback(t,e))},o.prototype.closeEventCallback=function(e,t){var i=this;this.preventArgs=t,this.isCalendar()&&e&&!this.preventArgs.cancel&&(this.popupObj.hide(),this.isAltKeyPressed=!1,this.keyboardModule.destroy(),O.removeClass(this.inputWrapper.buttons,be)),this.setAriaAttributes(),O.Browser.isDevice&&this.modal&&(this.modal.style.display="none",this.modal.outerHTML="",this.modal=null),!O.Browser.isDevice||O.isNullOrUndefined(this.mobilePopupWrapper)||!e||!O.isNullOrUndefined(this.preventArgs)&&this.preventArgs.cancel||(this.mobilePopupWrapper.remove(),this.mobilePopupWrapper=null),O.EventHandler.remove(document,"mousedown touchstart",this.documentHandler),O.Browser.isDevice&&this.allowEdit&&!this.readonly&&(this.inputElement.removeAttribute("readonly"),O.Browser.isIos)&&setTimeout(function(){i.inputElement.focus()},1),this.setAllowEdit()},o.prototype.focusIn=function(e){document.activeElement!==this.inputElement&&this.enabled&&(this.inputElement.focus(),O.addClass([this.inputWrapper.container],[ge]))},o.prototype.focusOut=function(){document.activeElement===this.inputElement&&(O.removeClass([this.inputWrapper.container],[ge]),this.inputElement.blur())},o.prototype.currentView=function(){var e;return e=this.calendarElement?n.prototype.currentView.call(this):e},o.prototype.navigateTo=function(e,t){this.calendarElement&&n.prototype.navigateTo.call(this,e,t)},o.prototype.destroy=function(){this.unBindEvents(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),n.prototype.destroy.call(this),u.Input.destroy({element:this.inputElement,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),O.isNullOrUndefined(this.keyboardModules)||this.keyboardModules.destroy(),this.popupObj&&this.popupObj.element.classList.contains("e-popup")&&n.prototype.destroy.call(this);this.inputElement.hasAttribute("aria-label")&&this.inputElement.removeAttribute("aria-label"),this.inputElement&&(u.Input.removeAttributes({"aria-atomic":"true","aria-disabled":"true","aria-expanded":"false",role:"combobox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false"},this.inputElement),O.isNullOrUndefined(this.inputElementCopy.getAttribute("tabindex"))?this.inputElement.removeAttribute("tabindex"):this.inputElement.setAttribute("tabindex",this.tabIndex),O.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),O.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),this.ensureInputAttribute()),this.isCalendar()&&(this.popupWrapper&&O.detach(this.popupWrapper),this.popupObj=this.popupWrapper=null,this.keyboardModule.destroy()),null===this.ngTag&&(this.inputElement&&(O.isNullOrUndefined(this.inputWrapper)||this.inputWrapper.container.insertAdjacentElement("afterend",this.inputElement),O.removeClass([this.inputElement],["e-input"])),O.removeClass([this.element],[fe]),O.isNullOrUndefined(this.inputWrapper)||O.detach(this.inputWrapper.container)),this.formElement&&O.EventHandler.remove(this.formElement,"reset",this.resetFormHandler),this.inputWrapper=null,this.keyboardModules=null},o.prototype.ensureInputAttribute=function(){for(var e=[],t=0;t<this.inputElement.attributes.length;t++)e[t]=this.inputElement.attributes[t].name;for(t=0;t<e.length;t++)O.isNullOrUndefined(this.inputElementCopy.getAttribute(e[t]))?("value"===e[t].toLowerCase()&&(this.inputElement.value=""),this.inputElement.removeAttribute(e[t])):("value"===e[t].toLowerCase()&&(this.inputElement.value=this.inputElementCopy.getAttribute(e[t])),this.inputElement.setAttribute(e[t],this.inputElementCopy.getAttribute(e[t])))},o.prototype.preRender=function(){this.inputElementCopy=this.element.cloneNode(!0),O.removeClass([this.inputElementCopy],[fe,"e-control","e-lib"]),this.inputElement=this.element,this.formElement=O.closest(this.inputElement,"form"),this.index=this.showClearButton?2:1,this.ngTag=null,"EJS-DATEPICKER"!==this.element.tagName&&"EJS-DATETIMEPICKER"!==this.element.tagName||(this.ngTag=this.element.tagName,this.inputElement=this.createElement("input"),this.element.appendChild(this.inputElement)),this.element.getAttribute("id")?null!==this.ngTag&&(this.inputElement.id=this.element.getAttribute("id")+"_input"):("datetimepicker"===this.getModuleName()?this.element.id=O.getUniqueID("ej2-datetimepicker"):this.element.id=O.getUniqueID("ej2-datepicker"),null!==this.ngTag&&O.attributes(this.inputElement,{id:this.element.id+"_input"})),null!==this.ngTag&&this.validationAttribute(this.element,this.inputElement),this.updateHtmlAttributeToElement(),this.defaultKeyConfigs=this.getDefaultKeyConfig(),this.checkHtmlAttributes(!1),this.inputFormats&&this.checkInputFormats(),(null!==this.ngTag?(this.tabIndex=this.inputElement.hasAttribute("tabindex")?this.inputElement.getAttribute("tabindex"):"0",this.inputElement):(this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element)).removeAttribute("tabindex"),n.prototype.preRender.call(this)},o.prototype.getDefaultKeyConfig=function(){return this.defaultKeyConfigs={altUpArrow:"alt+uparrow",altDownArrow:"alt+downarrow",escape:"escape",enter:"enter",controlUp:"ctrl+38",controlDown:"ctrl+40",moveDown:"downarrow",moveUp:"uparrow",moveLeft:"leftarrow",moveRight:"rightarrow",select:"enter",home:"home",end:"end",pageUp:"pageup",pageDown:"pagedown",shiftPageUp:"shift+pageup",shiftPageDown:"shift+pagedown",controlHome:"ctrl+home",controlEnd:"ctrl+end",shiftTab:"shift+tab",tab:"tab"},this.defaultKeyConfigs},o.prototype.validationAttribute=function(e,t){for(var i,s=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id"),a=(t.setAttribute("name",s),e.removeAttribute("name"),["required","aria-required","form"]),n=0;n<a.length;n++)O.isNullOrUndefined(e.getAttribute(a[n]))||(i=e.getAttribute(a[n]),t.setAttribute(a[n],i),e.removeAttribute(a[n]))},o.prototype.checkFormat=function(){var e,t=new O.Internationalization(this.locale);this.format?"string"==typeof this.format?this.formatString=this.format:""===this.format.skeleton||O.isNullOrUndefined(this.format.skeleton)?"datetimepicker"===this.getModuleName()?this.formatString=this.dateTimeFormat:this.formatString=null:(e=this.format.skeleton,"datetimepicker"===this.getModuleName()?this.formatString=t.getDatePattern({skeleton:e,type:"dateTime"}):this.formatString=t.getDatePattern({skeleton:e,type:"date"})):this.formatString=null},o.prototype.checkInputFormats=function(){var e=new O.Internationalization(this.locale);if(this.inputFormatsString=[],this.inputFormats){for(var t=0,i=this.inputFormats;t<i.length;t++){var s=i[t],a="";"string"==typeof s?a=s:""===s.skeleton||O.isNullOrUndefined(s.skeleton)||(s=s.skeleton,a="datetimepicker"===this.getModuleName()?e.getDatePattern({skeleton:s,type:"dateTime"}):e.getDatePattern({skeleton:s,type:"date"})),a&&this.inputFormatsString.push(a)}0===this.inputFormatsString.length&&(this.inputFormatsString=null)}else this.inputFormatsString=null},o.prototype.checkHtmlAttributes=function(e){this.globalize=new O.Internationalization(this.locale),this.checkFormat(),this.checkView();for(var t=e?O.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["value","min","max","disabled","readonly","style","name","placeholder","type"],i="datetimepicker"===this.getModuleName()?"Gregorian"===this.calendarMode?{format:O.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:O.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}:"Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"},s=0,a=t;s<a.length;s++){var n,r,l,o=a[s];if(!O.isNullOrUndefined(this.inputElement.getAttribute(o)))switch(o){case"disabled":(O.isNullOrUndefined(this.datepickerOptions)||void 0===this.datepickerOptions.enabled||e)&&(n="disabled"!==this.inputElement.getAttribute(o)&&""!==this.inputElement.getAttribute(o)&&"true"!==this.inputElement.getAttribute(o),this.setProperties({enabled:n},!e));break;case"readonly":(O.isNullOrUndefined(this.datepickerOptions)||void 0===this.datepickerOptions.readonly||e)&&(n="readonly"===this.inputElement.getAttribute(o)||""===this.inputElement.getAttribute(o)||"true"===this.inputElement.getAttribute(o),this.setProperties({readonly:n},!e));break;case"placeholder":(O.isNullOrUndefined(this.datepickerOptions)||void 0===this.datepickerOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(o)},!e);break;case"style":this.inputElement.setAttribute("style",""+this.inputElement.getAttribute(o));break;case"name":this.inputElement.setAttribute("name",""+this.inputElement.getAttribute(o));break;case"value":(O.isNullOrUndefined(this.datepickerOptions)||void 0===this.datepickerOptions.value||e)&&(r=this.inputElement.getAttribute(o),this.setProperties(O.setValue(o,this.globalize.parseDate(this.getAmPmValue(r),i),{}),!e));break;case"min":+this.min!=+new Date(1900,0,1)&&!e||(r=this.inputElement.getAttribute(o),this.setProperties(O.setValue(o,this.globalize.parseDate(this.getAmPmValue(r),i),{}),!e));break;case"max":+this.max!=+new Date(2099,11,31)&&!e||(l=this.inputElement.getAttribute(o),this.setProperties(O.setValue(o,this.globalize.parseDate(this.getAmPmValue(l),i),{}),!e));break;case"type":"text"!==this.inputElement.getAttribute(o)&&this.inputElement.setAttribute("type","text")}}},o.prototype.getModuleName=function(){return"datepicker"},o.prototype.updateFloatLabelOverflowWidth=function(){for(var e=this.inputWrapper.container,t=e.querySelector(".e-float-text.e-label-bottom"),i=0,s=e.querySelectorAll(".e-input-group-icon, .e-clear-icon"),a=0;a<s.length;a++)i+=s[a].offsetWidth;!t||!(e=this.element.parentElement.offsetWidth-i)||this.cssClass&&-1!==this.cssClass.split(" ").indexOf("e-outline")||(t.style.width=e+"px")},o.prototype.clearFloatLabelOverflowWidth=function(){var e=this.inputWrapper.container.querySelector(".e-float-text.e-label-top");e&&e.removeAttribute("style")},o.prototype.disabledDates=function(e,t){void 0===e&&(e=!1),void 0===t&&(t=!1);var i=this.checkDateValue(this.value)?new Date(+this.value):new Date(this.checkValue(this.value)),s=this.previousDate;this.minMaxUpdates(),e&&O.isNullOrUndefined(this.renderDayCell)||n.prototype.render.call(this),this.previousDate=s;var e='*[id^="/id"]'.replace("/id",""+(i&&+i));this.strictMode||("string"==typeof this.value||"object"==typeof this.value&&+this.value!=+i)&&this.setProperties({value:i},!0),O.isNullOrUndefined(this.calendarElement)||O.isNullOrUndefined(this.calendarElement.querySelectorAll(e)[0])||!this.calendarElement.querySelectorAll(e)[0].classList.contains("e-disabled")||this.strictMode||(this.currentDate=new Date((new Date).setHours(0,0,0,0))),e="datetimepicker"===this.getModuleName()?"Gregorian"===this.calendarMode?this.globalize.formatDate(i,{format:O.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd"}):this.globalize.formatDate(i,{format:O.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}):(s="Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"},this.globalize.formatDate(i,s)),this.popupObj||(this.updateInputValue(e),this.enableMask&&(this.updateInputValue(this.maskedDateValue),this.notify("createMask",{module:"MaskedDateTime",isBlur:t})))},o.prototype.setAriaAttributes=function(){this.isCalendar()?(u.Input.addAttributes({"aria-expanded":"true"},this.inputElement),O.attributes(this.inputElement,{"aria-owns":this.inputElement.id+"_options"}),O.attributes(this.inputElement,{"aria-controls":this.inputElement.id}),this.value&&O.attributes(this.inputElement,{"aria-activedescendant":""+this.setActiveDescendant()})):(u.Input.addAttributes({"aria-expanded":"false"},this.inputElement),this.inputElement.removeAttribute("aria-owns"),this.inputElement.removeAttribute("aria-controls"),this.inputElement.removeAttribute("aria-activedescendant"))},o.prototype.errorClass=function(){var e='*[id^="/id"]'.replace("/id",""+ +this.value),e=this.calendarElement&&this.calendarElement.querySelectorAll(e)[0]&&this.calendarElement.querySelectorAll(e)[0].classList.contains("e-disabled");!(O.isNullOrUndefined(this.value)||O.isNullOrUndefined(this.min)||O.isNullOrUndefined(this.max)||new Date(this.value).setMilliseconds(0)>=new Date(this.min).setMilliseconds(0)&&new Date(this.value).setMilliseconds(0)<=new Date(this.max).setMilliseconds(0))||!this.strictMode&&""!==this.inputElement.value&&this.inputElement.value!==this.maskedDateValue&&O.isNullOrUndefined(this.value)||e||!this.isValidTime(this.value)?(O.addClass([this.inputWrapper.container],ye),O.attributes(this.inputElement,{"aria-invalid":"true"})):O.isNullOrUndefined(this.inputWrapper)||(O.removeClass([this.inputWrapper.container],ye),O.attributes(this.inputElement,{"aria-invalid":"false"}))},o.prototype.isValidTime=function(e){return!0},o.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){var a=s[i];switch(0<["blur","change","cleared","close","created","destroyed","focus","navigated","open","renderDayCell"].indexOf(a)&&this.isReact&&(this.isDynamicValueChanged=!0),a){case"value":this.isDynamicValueChanged=!0,this.isInteracted=!1,this.invalidValueString=null,this.checkInvalidValue(e.value),e.value=this.value,this.previousElementValue=this.inputElement.value,O.isNullOrUndefined(this.value)&&(this.enableMask?this.updateInputValue(this.maskedDateValue):this.updateInputValue(""),this.currentDate=new Date((new Date).setHours(0,0,0,0))),this.updateInput(!0),+this.previousDate!=+this.value&&this.changeTrigger(null),this.isInteracted=!0,this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange,this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"});break;case"format":this.checkFormat(),this.bindInputEvent(),this.updateInput(),this.enableMask&&(this.notify("createMask",{module:"MaskedDateTime"}),this.value||this.updateInputValue(this.maskedDateValue));break;case"inputFormats":this.checkInputFormats();break;case"allowEdit":this.setAllowEdit();break;case"placeholder":u.Input.setPlaceholder(this.placeholder,this.inputElement);break;case"readonly":u.Input.setReadonly(this.readonly,this.inputElement);break;case"enabled":u.Input.setEnabled(this.enabled,this.inputElement),this.setAriaDisabled();break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.checkHtmlAttributes(!0);break;case"locale":this.globalize=new O.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.datepickerOptions&&null==this.datepickerOptions.placeholder&&(this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),u.Input.setPlaceholder(this.placeholder,this.inputElement)),this.updateInput(),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"});break;case"enableRtl":u.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]);break;case"start":case"depth":this.checkView(),this.calendarElement&&n.prototype.onPropertyChanged.call(this,e,t);break;case"zIndex":this.setProperties({zIndex:e.zIndex},!0);break;case"cssClass":this.updateCssClass(e.cssClass,t.cssClass);break;case"showClearButton":u.Input.setClearButton(this.showClearButton,this.inputElement,this.inputWrapper),this.bindClearEvent(),this.index=this.showClearButton?2:1;break;case"strictMode":this.invalidValueString=null,this.updateInput();break;case"width":this.setWidth(e.width),u.Input.calculateWidth(this.inputElement,this.inputWrapper.container),O.isNullOrUndefined(this.inputWrapper.buttons[0])||O.isNullOrUndefined(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon");break;case"floatLabelType":this.floatLabelType=e.floatLabelType,u.Input.removeFloating(this.inputWrapper),u.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder),O.isNullOrUndefined(this.inputWrapper.buttons[0])||O.isNullOrUndefined(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon");break;case"enableMask":this.enableMask?(this.notify("createMask",{module:"MaskedDateTime"}),this.updateInputValue(this.maskedDateValue),this.bindInputEvent()):this.inputElement.value===this.maskedDateValue&&this.updateInputValue("");break;case"min":case"max":"min"===a&&O.isNullOrUndefined(this.min)&&(this.min=new Date(1900,0,1)),"max"===a&&O.isNullOrUndefined(this.max)&&(this.max=new Date(2099,11,31)),this.errorClass();break;default:this.calendarElement&&this.isCalendar()&&n.prototype.onPropertyChanged.call(this,e,t)}this.isDynamicValueChanged||this.hide(null),this.isDynamicValueChanged=!1}},o.prototype.addDate=function(e){},r([O.Property(null)],o.prototype,"width",void 0),r([O.Property(null)],o.prototype,"value",void 0),r([O.Property(null)],o.prototype,"cssClass",void 0),r([O.Property(!1)],o.prototype,"strictMode",void 0),r([O.Property(null)],o.prototype,"format",void 0),r([O.Property(null)],o.prototype,"inputFormats",void 0),r([O.Property(!0)],o.prototype,"enabled",void 0),r([O.Property(!1)],o.prototype,"fullScreenMode",void 0),r([O.Property({})],o.prototype,"htmlAttributes",void 0),r([O.Property(null)],o.prototype,"values",void 0),r([O.Property(!1)],o.prototype,"isMultiSelection",void 0),r([O.Property(!0)],o.prototype,"showClearButton",void 0),r([O.Property(!0)],o.prototype,"allowEdit",void 0),r([O.Property(null)],o.prototype,"keyConfigs",void 0),r([O.Property(!1)],o.prototype,"enablePersistence",void 0),r([O.Property(1e3)],o.prototype,"zIndex",void 0),r([O.Property(!1)],o.prototype,"readonly",void 0),r([O.Property(null)],o.prototype,"placeholder",void 0),r([O.Property("Never")],o.prototype,"floatLabelType",void 0),r([O.Property(null)],o.prototype,"serverTimezoneOffset",void 0),r([O.Property(!1)],o.prototype,"openOnFocus",void 0),r([O.Property(!1)],o.prototype,"enableMask",void 0),r([O.Property({day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"})],o.prototype,"maskPlaceholder",void 0),r([O.Event()],o.prototype,"open",void 0),r([O.Event()],o.prototype,"cleared",void 0),r([O.Event()],o.prototype,"close",void 0),r([O.Event()],o.prototype,"blur",void 0),r([O.Event()],o.prototype,"focus",void 0),r([O.Event()],o.prototype,"created",void 0),r([O.Event()],o.prototype,"destroyed",void 0),r([O.NotifyPropertyChanges],o));function o(e,t){t=n.call(this,e,t)||this;return t.isDateIconClicked=!1,t.isAltKeyPressed=!1,t.isInteracted=!0,t.invalidValueString=null,t.checkPreviousValue=null,t.maskedDateValue="",t.preventChange=!1,t.isIconClicked=!1,t.isDynamicValueChanged=!1,t.moduleName=t.getModuleName(),t.isFocused=!1,t.isBlur=!1,t.isKeyAction=!1,t.datepickerOptions=e,t}we=function(e,t){return(we=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)};var we,Me,Ve=function(e,t){function i(){this.constructor=e}we(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},h=function(e,t,i,s){var a,n=arguments.length,r=n<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;0<=l;l--)(a=e[l])&&(r=(n<3?a(r):3<n?a(t,i,r):a(t,i))||r);return 3<n&&r&&Object.defineProperty(t,i,r),r},Oe="e-input-group",Ne="e-popup",b="e-left-calendar",D="e-right-calendar",Ie="e-daterangepicker",Te="e-error",g="e-active",E="e-start-date",C="e-end-date",xe="e-start-btn",Se="e-input-focus",Pe="e-range-hover",Ae="e-other-month",Ue="e-start-label",He="e-end-label",k="e-disabled",w="e-selected",d="e-calendar",We="e-next",Fe="e-prev",p="e-header",Le="e-title",Be="e-icon-container",je="e-date-range-container",Ye="e-presets",Re="e-today",ze="e-focused-date",qe="e-content",Ke="e-day-span",Ge="e-week-number",_e="e-date-disabled",c="e-icon-disabled",Ze="e-device",m="e-overlay",Xe="e-list-item",f="e-hover",Je="e-range-overflow",$e="e-non-edit",Qe="e-daterange-hidden",et=["title","class","style"],tt=(Me=O.ChildProperty,Ve(it,Me),h([O.Property()],it.prototype,"label",void 0),h([O.Property()],it.prototype,"start",void 0),h([O.Property()],it.prototype,"end",void 0),it);function it(){return null!==Me&&Me.apply(this,arguments)||this}Ve(v,M=re),v.prototype.render=function(){this.initialize(),this.setProperties({startDate:this.startValue},!0),this.setProperties({endDate:this.endValue},!0),this.setModelValue(),this.setDataAttribute(!1),this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),"Never"!==this.floatLabelType&&u.Input.calculateWidth(this.inputElement,this.inputWrapper.container),O.isNullOrUndefined(this.inputWrapper.buttons[0])||O.isNullOrUndefined(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon"),!O.isNullOrUndefined(O.closest(this.element,"fieldset"))&&O.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete()},v.prototype.preRender=function(){var e;this.keyInputConfigs={altDownArrow:"alt+downarrow",escape:"escape",enter:"enter",tab:"tab",altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow",moveUp:"uparrow",moveDown:"downarrow",spacebar:"space"},this.defaultConstant={placeholder:this.placeholder,startLabel:"Start Date",endLabel:"End Date",customRange:"Custom Range",applyText:"Apply",cancelText:"Cancel",selectedDays:"Selected Days",days:"days"},this.isMobile=!!O.Browser.isDevice||window.matchMedia("(max-width:550px)").matches,this.inputElement=this.element,this.angularTag=null,"EJS-DATERANGEPICKER"===this.element.tagName&&(this.angularTag=this.element.tagName,this.inputElement=this.createElement("input"),this.element.appendChild(this.inputElement)),this.cloneElement=this.element.cloneNode(!0),O.removeClass([this.cloneElement],[Ie,"e-control","e-lib"]),this.updateHtmlAttributeToElement(),this.element.getAttribute("id")?null!==this.angularTag&&(this.inputElement.id=this.element.getAttribute("id")+"_input"):(this.element.id=O.getUniqueID("ej2-datetimepicker"),null!==this.angularTag&&O.attributes(this.inputElement,{id:this.element.id+"_input"})),this.checkInvalidRange(this.value),this.invalidValueString||"string"!=typeof this.value||(e=this.value.split(" "+this.separator+" "),this.value=[new Date(e[0]),new Date(e[1])]),this.initProperty(),this.inputFormats&&this.checkInputFormats(),(null!==this.angularTag?(this.tabIndex=this.inputElement.hasAttribute("tabindex")?this.inputElement.getAttribute("tabindex"):"0",this.inputElement):(this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element)).removeAttribute("tabindex"),M.prototype.preRender.call(this),this.navNextFunction=this.navNextMonth.bind(this),this.navPrevFunction=this.navPrevMonth.bind(this),this.deviceNavNextFunction=this.deviceNavNext.bind(this),this.deviceNavPrevFunction=this.deviceNavPrevious.bind(this),this.initStartDate=this.checkDateValue(this.startValue),this.initEndDate=this.checkDateValue(this.endValue),this.formElement=O.closest(this.element,"form")},v.prototype.updateValue=function(){this.value&&0<this.value.length?(this.value[0]instanceof Date&&!isNaN(+this.value[0])?(this.setProperties({startDate:this.value[0]},!0),this.startValue=this.value[0]):"string"!=typeof this.value[0]||0==+this.value[0]||isNaN(+new Date(this.checkValue(this.value[0])))?(this.startValue=null,this.setValue()):(this.setProperties({startDate:new Date(this.checkValue(this.value[0]))},!0),this.startValue=new Date(this.checkValue(this.value[0]))),this.value[1]instanceof Date&&!isNaN(+this.value[1])?(this.setProperties({endDate:this.value[1]},!0),this.endValue=this.value[1]):("string"!=typeof this.value[1]||0==+this.value[0]||isNaN(+new Date(this.checkValue(this.value[0])))?(this.setProperties({endDate:null},!0),this.endValue=null):(this.setProperties({endDate:new Date(this.checkValue(this.value[1]))},!0),this.endValue=new Date(this.checkValue(this.value[1]))),this.setValue())):this.value&&this.value.start?(this.value.start instanceof Date&&!isNaN(+this.value.start)?(this.setProperties({startDate:this.value.start},!0),this.startValue=this.value.start):"string"==typeof this.value.start?(this.setProperties({startDate:new Date(this.checkValue(this.value.start))},!0),this.startValue=new Date(this.checkValue(this.value.start))):(this.startValue=null,this.setValue()),this.value.end instanceof Date&&!isNaN(+this.value.end)?(this.setProperties({endDate:this.value.end},!0),this.endValue=this.value.end):("string"==typeof this.value.end?(this.setProperties({endDate:new Date(this.checkValue(this.value.end))},!0),this.endValue=new Date(this.checkValue(this.value.end))):(this.setProperties({endDate:null},!0),this.endValue=null),this.setValue())):O.isNullOrUndefined(this.value)&&(this.endValue=this.checkDateValue(new Date(this.checkValue(this.endDate))),this.startValue=this.checkDateValue(new Date(this.checkValue(this.startDate))),this.setValue())},v.prototype.initProperty=function(){this.globalize=new O.Internationalization(this.locale),this.checkFormat(),this.checkView(),(O.isNullOrUndefined(this.firstDayOfWeek)||6<this.firstDayOfWeek||this.firstDayOfWeek<0)&&this.setProperties({firstDayOfWeek:this.globalize.getFirstDayOfWeek()},!0),this.updateValue()},v.prototype.checkFormat=function(){var e;this.format?"string"==typeof this.format?this.formatString=this.format:""===this.format.skeleton||O.isNullOrUndefined(this.format.skeleton)?this.formatString=null:(e=this.format.skeleton,this.formatString=this.globalize.getDatePattern({skeleton:e,type:"date"})):this.formatString=null},v.prototype.checkInputFormats=function(){if(this.inputFormatsString=[],this.inputFormats){for(var e=0,t=this.inputFormats;e<t.length;e++){var i=t[e],s="";"string"==typeof i?s=i:""===i.skeleton||O.isNullOrUndefined(i.skeleton)||(i=i.skeleton,s=this.globalize.getDatePattern({skeleton:i,type:"date"})),s&&this.inputFormatsString.push(s)}0===this.inputFormatsString.length&&(this.inputFormatsString=null)}else this.inputFormatsString=null},v.prototype.initialize=function(){null!==this.angularTag&&this.validationAttribute(this.element,this.inputElement),this.checkHtmlAttributes(!1),O.merge(this.defaultKeyConfigs,{shiftTab:"shift+tab",tab:"tab"});var e=this.checkDateValue(new Date(this.checkValue(this.startValue)));this.setProperties({startDate:e},!0),this.setProperties({endValue:this.checkDateValue(new Date(this.checkValue(this.endValue)))},!0),this.setValue(),this.setProperties({min:this.checkDateValue(new Date(this.checkValue(this.min)))},!0),this.setProperties({max:this.checkDateValue(new Date(this.checkValue(this.max)))},!0),this.l10n=new O.L10n("daterangepicker",this.defaultConstant,this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.processPresets(),this.createInput(),this.updateHtmlAttributeToWrapper(),this.setRangeAllowEdit(),this.bindEvents()},v.prototype.setDataAttribute=function(e){var t={};if(e)t=this.htmlAttributes;else for(var i=0;i<this.element.attributes.length;i++)t[this.element.attributes[i].name]=this.element.getAttribute(this.element.attributes[i].name);for(var s=0,a=Object.keys(t);s<a.length;s++){var n=a[s];0===n.indexOf("data")&&(this.firstHiddenChild.setAttribute(n,t[""+n]),this.secondHiddenChild.setAttribute(n,t[""+n]))}},v.prototype.setRangeAllowEdit=function(){this.allowEdit?this.readonly||this.inputElement.removeAttribute("readonly"):O.attributes(this.inputElement,{readonly:""}),this.updateClearIconState()},v.prototype.updateClearIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&O.removeClass([this.inputWrapper.container],[$e]):""===this.inputElement.value?O.removeClass([this.inputWrapper.container],[$e]):O.addClass([this.inputWrapper.container],[$e])},v.prototype.validationAttribute=function(e,t){for(var i,s=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id"),a=(t.setAttribute("name",s),e.removeAttribute("name"),["required","aria-required","form"]),n=0;n<a.length;n++)O.isNullOrUndefined(e.getAttribute(a[n]))||(i=e.getAttribute(a[n]),t.setAttribute(a[n],i),e.removeAttribute(a[n]))},v.prototype.updateHtmlAttributeToWrapper=function(){if(!O.isNullOrUndefined(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i,s=t[e];-1<et.indexOf(s)&&("class"===s?""!==(i=this.htmlAttributes[""+s].replace(/\s+/g," ").trim())&&O.addClass([this.inputWrapper.container],i.split(" ")):"style"===s?(i=this.inputWrapper.container.getAttribute(s),i=O.isNullOrUndefined(i)?this.htmlAttributes[""+s]:i+this.htmlAttributes[""+s],this.inputWrapper.container.setAttribute(s,i)):this.inputWrapper.container.setAttribute(s,this.htmlAttributes[""+s]))}},v.prototype.updateHtmlAttributeToElement=function(){if(!O.isNullOrUndefined(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i=t[e];et.indexOf(i)<0&&this.inputElement.setAttribute(i,this.htmlAttributes[""+i])}},v.prototype.updateCssClass=function(e,t){O.isNullOrUndefined(t)||(t=t.replace(/\s+/g," ").trim()),O.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),u.Input.setCssClass(e,[this.inputWrapper.container],t),this.popupWrapper&&u.Input.setCssClass(e,[this.popupWrapper],t)},v.prototype.processPresets=function(){this.presetsItem=[];var e=0;if(!O.isNullOrUndefined(this.presets[0])&&!O.isUndefined(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)){for(var t=0,i=this.presets;t<i.length;t++){var s=i[t],a=s.label.replace(/\s+/g,"")+"_"+ ++e;"string"==typeof s.end?this.presetsItem.push({id:a,text:s.label,end:new Date(this.checkValue(s.end)),start:new Date(this.checkValue(s.start))}):this.presetsItem.push({id:a,text:s.label,start:s.start,end:s.end})}var n=O.isNullOrUndefined(this.startValue)?null:new Date(+this.startValue),r=O.isNullOrUndefined(this.endValue)?null:new Date(+this.endValue);this.presetsItem.push({id:"custom_range",text:this.l10n.getConstant("customRange"),start:n,end:r}),O.isNullOrUndefined(this.startValue)||O.isNullOrUndefined(this.endValue)||(this.isCustomRange=!0,this.activeIndex=this.presetsItem.length-1)}},v.prototype.bindEvents=function(){O.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler,this),O.EventHandler.add(this.inputElement,"focus",this.inputFocusHandler,this),O.EventHandler.add(this.inputElement,"blur",this.inputBlurHandler,this),O.EventHandler.add(this.inputElement,"change",this.inputChangeHandler,this),this.showClearButton&&this.inputWrapper.clearButton&&O.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this),this.isMobile||(this.keyInputConfigs=O.extend(this.keyInputConfigs,this.keyConfigs),this.inputKeyboardModule=new O.KeyboardEvents(this.inputElement,{eventName:"keydown",keyAction:this.inputHandler.bind(this),keyConfigs:this.keyInputConfigs})),this.formElement&&O.EventHandler.add(this.formElement,"reset",this.formResetHandler,this),this.enabled?this.inputElement.setAttribute("tabindex",this.tabIndex):this.inputElement.tabIndex=-1},v.prototype.unBindEvents=function(){O.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler),O.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),O.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),O.EventHandler.remove(this.inputElement,"change",this.inputChangeHandler),this.showClearButton&&this.inputWrapper.clearButton&&O.EventHandler.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler),this.isMobile||O.isNullOrUndefined(this.inputKeyboardModule)||this.inputKeyboardModule.destroy(),this.formElement&&O.EventHandler.remove(this.formElement,"reset",this.formResetHandler),this.inputElement.tabIndex=-1},v.prototype.updateHiddenInput=function(){var e;this.firstHiddenChild&&this.secondHiddenChild&&(e={format:this.formatString,type:"datetime",skeleton:"yMd"},"string"==typeof this.startDate&&(this.startDate=this.globalize.parseDate(this.getAmPmValue(this.startDate),e)),"string"==typeof this.endDate&&(this.endDate=this.globalize.parseDate(this.getAmPmValue(this.endDate),e)),this.firstHiddenChild.value=this.startDate&&this.globalize.formatDate(this.startDate,e)||this.inputElement.value,this.secondHiddenChild.value=this.endDate&&this.globalize.formatDate(this.endDate,e)||this.inputElement.value,this.dispatchEvent(this.firstHiddenChild,"focusout"),this.dispatchEvent(this.firstHiddenChild,"change"))},v.prototype.inputChangeHandler=function(e){this.enabled&&(e.stopPropagation(),this.updateHiddenInput())},v.prototype.bindClearEvent=function(){this.showClearButton&&this.inputWrapper.clearButton&&O.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this)},v.prototype.resetHandler=function(e){var t;this.enabled&&(this.valueType=this.value,e.preventDefault(),this.clear(),t={event:e},this.setProperties({endDate:this.checkDateValue(this.endValue)},!0),this.setProperties({startDate:this.checkDateValue(this.startValue)},!0),this.trigger("cleared",t),this.changeTrigger(e),this.clearRange(),this.hide(e),O.closest(this.element,"form"))&&(t=this.firstHiddenChild,(e=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),t.dispatchEvent(e))},v.prototype.restoreValue=function(){this.previousEleValue=this.inputElement.value,this.previousStartValue=this.startValue,this.previousEndValue=this.endValue,this.valueType=null,this.initStartDate=this.checkDateValue(this.startValue),this.initEndDate=this.checkDateValue(this.endValue),this.setValue(),this.setModelValue()},v.prototype.formResetHandler=function(e){this.enabled&&this.formElement&&e.target===this.formElement&&!this.inputElement.disabled&&(e=this.inputElement.getAttribute("value"),O.isNullOrUndefined(this.startCopy)?(this.setProperties({value:null,startDate:null,endDate:null},!0),this.startValue=this.endValue=null):(O.isNullOrUndefined(this.value)||O.isNullOrUndefined(this.value.start)?(this.setProperties({value:[this.startCopy,this.endCopy]},!0),this.startValue=this.value[0],this.endValue=this.value[1]):(this.setProperties({value:{start:this.startCopy,end:this.endCopy}},!0),this.startValue=this.value.start,this.endValue=this.value.end),this.setProperties({startDate:this.startValue,endDate:this.endValue},!0)),"EJS-DATERANGEPICKER"===this.element.tagName&&(this.setProperties({value:null,startDate:null,endDate:null},!0),e="",this.startValue=this.endValue=null,this.inputElement.setAttribute("value","")),this.restoreValue(),this.inputElement)&&(u.Input.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton),this.errorClass())},v.prototype.clear=function(){null!==this.startValue&&(this.startValue=null),null!==this.endValue&&(this.endValue=null),this.value&&this.value.start&&this.setProperties({value:{start:null,end:null}},!0),null!==this.value&&0<this.value.length&&this.setProperties({value:null},!0),u.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),O.isNullOrUndefined(this.applyButton)||(this.applyButton.disabled=this.applyButton.element.disabled=!0),this.removeSelection()},v.prototype.rangeIconHandler=function(e){this.enabled&&(this.isMobile&&this.inputElement.setAttribute("readonly",""),e.preventDefault(),this.targetElement=null,this.isPopupOpen()&&document.body.contains(this.popupObj.element)?this.applyFunction(e):(this.isRangeIconClicked=!0,this.inputWrapper.container.children[0].focus(),this.show(null,e),this.isMobile||O.isNullOrUndefined(this.leftCalendar)||(this.isRangeIconClicked=!1,this.calendarFocus(),this.isRangeIconClicked=!0),O.addClass([this.inputWrapper.container],[Se])))},v.prototype.checkHtmlAttributes=function(e){this.globalize=new O.Internationalization(this.locale);for(var t=e?O.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["startDate","endDate","minDays","maxDays","min","max","disabled","readonly","style","name","placeholder","type","value"],i={format:this.formatString,type:"date",skeleton:"yMd"},s=0,a=t;s<a.length;s++){var n,r,l,o=a[s];if(!O.isNullOrUndefined(this.inputElement.getAttribute(o)))switch(o){case"disabled":(O.isNullOrUndefined(this.dateRangeOptions)||void 0===this.dateRangeOptions.enabled||e)&&(n="disabled"===this.inputElement.getAttribute(o)||""===this.inputElement.getAttribute(o)||"true"===this.inputElement.getAttribute(o),this.setProperties({enabled:!n},!e));break;case"readonly":(O.isNullOrUndefined(this.dateRangeOptions)||void 0===this.dateRangeOptions.readonly||e)&&(n="readonly"===this.inputElement.getAttribute(o)||"true"===this.inputElement.getAttribute(o)||""===this.inputElement.getAttribute(o),this.setProperties({readonly:n},!e));break;case"placeholder":(O.isNullOrUndefined(this.dateRangeOptions)||void 0===this.dateRangeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(o)},!e);break;case"value":(O.isNullOrUndefined(this.dateRangeOptions)||void 0===this.dateRangeOptions.value||e)&&(r=this.inputElement.getAttribute(o),this.setProperties(O.setValue(o,r,{}),!e));break;case"style":this.inputElement.setAttribute("style",""+this.inputElement.getAttribute(o));break;case"min":(O.isNullOrUndefined(this.min)||+this.min==+new Date(1900,0,1)||e)&&(l=this.globalize.parseDate(this.getAmPmValue(this.inputElement.getAttribute(o)),i),this.setProperties(O.setValue(o,l,{}),!e));break;case"name":this.inputElement.setAttribute("name",""+this.inputElement.getAttribute(o));break;case"max":(O.isNullOrUndefined(this.max)||+this.max==+new Date(2099,11,31)||e)&&(l=this.globalize.parseDate(this.getAmPmValue(this.inputElement.getAttribute(o)),i),this.setProperties(O.setValue(o,l,{}),!e));break;case"startDate":O.isNullOrUndefined(this.startDate)&&(l=this.globalize.parseDate(this.getAmPmValue(this.inputElement.getAttribute(o)),i),this.startValue=l,this.setValue());break;case"endDate":O.isNullOrUndefined(this.endDate)&&(l=this.globalize.parseDate(this.getAmPmValue(this.inputElement.getAttribute(o)),i),this.endValue=l,this.setValue());break;case"minDays":O.isNullOrUndefined(this.minDays)&&this.setProperties(O.setValue(o,parseInt(this.inputElement.getAttribute(o),10),{}),!0);break;case"maxDays":O.isNullOrUndefined(this.maxDays)&&this.setProperties(O.setValue(o,parseInt(this.inputElement.getAttribute(o),10),{}),!0);break;case"type":"text"!==this.inputElement.getAttribute(o)&&this.inputElement.setAttribute("type","text")}}},v.prototype.createPopup=function(){for(var e=0;e<this.presetsItem.length;e++)e!==this.presetsItem.length-1&&"custom_range"===this.presetsItem[e].id&&this.presetsItem.splice(e,1);this.activeIndex=this.presetsItem.length-1,this.isCustomRange=!0;for(e=0;e<=this.presetsItem.length-2;e++){var t=this.presetsItem[e].start,i=this.presetsItem[e].end;this.startValue&&this.endValue&&t.getDate()===this.startValue.getDate()&&t.getMonth()===this.startValue.getMonth()&&t.getFullYear()===this.startValue.getFullYear()&&i.getDate()===this.endValue.getDate()&&i.getMonth()===this.endValue.getMonth()&&i.getFullYear()===this.endValue.getFullYear()&&(this.activeIndex=e,this.isCustomRange=!1)}this.popupWrapper=O.createElement("div",{id:this.element.id+"_popup",className:Ie+" "+Ne}),this.popupWrapper.setAttribute("aria-label",this.element.id),this.popupWrapper.setAttribute("role","dialog"),this.adjustLongHeaderWidth();var s=!this.isCustomRange||this.isMobile;!O.isUndefined(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)&&s?(this.isCustomWindow=!1,this.createPresets(),this.listRippleEffect(),this.renderPopup()):(this.isCustomWindow=!0,this.renderControl())},v.prototype.renderControl=function(){this.createControl(),this.bindCalendarEvents(),this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar]),O.isNullOrUndefined(this.endValue)||O.isNullOrUndefined(this.startValue)||O.isNullOrUndefined(this.renderDayCellArgs)||!this.renderDayCellArgs.isDisabled||this.disabledDateRender(),this.updateHeader()},v.prototype.clearCalendarEvents=function(){this.leftCalPrevIcon&&this.leftCalNextIcon&&this.rightCalPrevIcon&&this.rightCalNextIcon&&(O.EventHandler.clearEvents(this.leftCalPrevIcon),O.EventHandler.clearEvents(this.leftCalNextIcon),O.EventHandler.clearEvents(this.rightCalPrevIcon),O.EventHandler.clearEvents(this.rightCalNextIcon))},v.prototype.updateNavIcons=function(){M.prototype.iconHandler.call(this)},v.prototype.calendarIconEvent=function(){this.clearCalendarEvents(),this.leftCalPrevIcon&&!this.leftCalPrevIcon.classList.contains(k)&&O.EventHandler.add(this.leftCalPrevIcon,"mousedown",this.navPrevFunction),this.leftCalNextIcon&&!this.leftCalNextIcon.classList.contains(k)&&O.EventHandler.add(this.leftCalNextIcon,"mousedown",this.navNextFunction),this.rightCalPrevIcon&&!this.rightCalPrevIcon.classList.contains(k)&&O.EventHandler.add(this.rightCalPrevIcon,"mousedown",this.navPrevFunction),this.rightCalNextIcon&&!this.rightCalNextIcon.classList.contains(k)&&O.EventHandler.add(this.rightCalNextIcon,"mousedown",this.navNextFunction)},v.prototype.bindCalendarEvents=function(){this.isMobile?(this.deviceCalendarEvent(),O.EventHandler.add(this.startButton.element,"click",this.deviceHeaderClick,this),O.EventHandler.add(this.endButton.element,"click",this.deviceHeaderClick,this)):(this.updateNavIcons(),this.calendarIconEvent(),this.calendarIconRipple(),this.headerTitleElement=this.popupObj.element.querySelector("."+D+" ."+p+" ."+Le),this.headerTitleElement=this.popupObj.element.querySelector("."+b+" ."+p+" ."+Le),this.defaultKeyConfigs=O.extend(this.defaultKeyConfigs,this.keyConfigs),this.leftKeyboardModule=new O.KeyboardEvents(this.leftCalendar,{eventName:"keydown",keyAction:this.keyInputHandler.bind(this),keyConfigs:this.defaultKeyConfigs}),this.rightKeyboardModule=new O.KeyboardEvents(this.rightCalendar,{eventName:"keydown",keyAction:this.keyInputHandler.bind(this),keyConfigs:this.defaultKeyConfigs})),this.start===this.depth&&this.bindCalendarCellEvents(),this.removeFocusedDate()},v.prototype.calendarIconRipple=function(){O.rippleEffect(this.leftCalPrevIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),O.rippleEffect(this.leftCalNextIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),O.rippleEffect(this.rightCalPrevIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),O.rippleEffect(this.rightCalNextIcon,{selector:".e-next",duration:400,isCenterRipple:!0})},v.prototype.deviceCalendarEvent=function(){O.EventHandler.clearEvents(this.nextIcon),O.EventHandler.clearEvents(this.previousIcon),O.rippleEffect(this.nextIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),O.rippleEffect(this.previousIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),this.nextIcon&&!this.nextIcon.classList.contains(k)&&O.EventHandler.add(this.nextIcon,"mousedown",this.deviceNavNextFunction),this.previousIcon&&!this.previousIcon.classList.contains(k)&&O.EventHandler.add(this.previousIcon,"mousedown",this.deviceNavPrevFunction)},v.prototype.deviceNavNext=function(e){var t=O.closest(e.target,"."+d);this.updateDeviceCalendar(t),this.navigateNext(e),this.deviceNavigation()},v.prototype.deviceNavPrevious=function(e){var t=O.closest(e.target,"."+d);this.updateDeviceCalendar(t),this.navigatePrevious(e),this.deviceNavigation()},v.prototype.updateDeviceCalendar=function(e){e&&(this.previousIcon=e.querySelector("."+Fe),this.nextIcon=e.querySelector("."+We),this.calendarElement=e,this.deviceCalendar=e,this.contentElement=e.querySelector("."+qe),this.tableBodyElement=O.select("."+qe+" tbody",e),this.table=e.querySelector("."+qe).getElementsByTagName("table")[0],this.headerTitleElement=e.querySelector("."+p+" ."+Le),this.headerElement=e.querySelector("."+p))},v.prototype.deviceHeaderClick=function(e){var t;e.currentTarget.classList.contains(xe)&&!O.isNullOrUndefined(this.startValue)?(this.endButton.element.classList.remove(g),this.startButton.element.classList.add(g),t=this.popupObj.element.querySelector("."+d),this.updateDeviceCalendar(t),O.isNullOrUndefined(this.calendarElement.querySelector("."+E+":not(.e-other-month)"))&&(this.currentDate=new Date(+this.startValue),O.remove(this.tableBodyElement),this.createContentBody(),this.deviceNavigation()),this.removeClassDisabled()):O.isNullOrUndefined(this.startValue)||O.isNullOrUndefined(this.endValue)||(this.startButton.element.classList.remove(g),this.endButton.element.classList.add(g),t=this.popupObj.element.querySelector("."+d),this.updateDeviceCalendar(t),O.isNullOrUndefined(this.calendarElement.querySelector("."+C+":not(.e-other-month)"))&&(this.currentDate=new Date(+this.endValue),O.remove(this.tableBodyElement),this.createContentBody(),this.deviceNavigation()),this.updateMinMaxDays(this.popupObj.element.querySelector("."+d)),this.selectableDates())},v.prototype.inputFocusHandler=function(){this.enabled&&(this.preventBlur=!1,this.preventFocus||this.trigger("focus",{model:this}),this.updateClearIconState(),this.clearFloatLabelOverflowWidth(),this.openOnFocus&&!this.preventFocus?(this.preventFocus=!0,this.show()):this.preventFocus=!0)},v.prototype.inputBlurHandler=function(e){if(this.updateFloatLabelOverflowWidth(),this.enabled){if(!this.preventBlur){var t=this.inputElement.value;if(O.isNullOrUndefined(this.presetsItem)||0<this.presetsItem.length&&this.previousEleValue!==this.inputElement.value&&(this.activeIndex=this.presetsItem.length-1,this.isCustomRange=!0),!O.isNullOrUndefined(t)&&""!==t.trim()){var i=t.split(" "+this.separator+" ");if(1<i.length){this.invalidValueString=null;var s,a={format:this.formatString,type:"date",skeleton:"yMd"},n=this.globalize.parseDate(this.getAmPmValue(i[0]).trim(),a),r=this.globalize.parseDate(this.getAmPmValue(i[1]).trim(),a);if("Decade"!==this.start&&"Year"===this.start&&"Month"!==this.depth&&(r=this.inputElement.defaultValue!==t?this.getStartEndDate(r,!0):r)>=this.max&&(r=this.max),(O.isNullOrUndefined(n)||"object"==typeof n&&isNaN(n.getTime())||O.isNullOrUndefined(r)||"object"==typeof r&&isNaN(r.getTime()))&&!O.isNullOrUndefined(this.inputFormatsString))for(var l=0,o=this.inputFormatsString;l<o.length;l++){var h={format:o[l],type:"date",skeleton:"yMd"};if((O.isNullOrUndefined(n)||"object"==typeof n&&isNaN(n.getTime()))&&(n=this.globalize.parseDate(this.getAmPmValue(i[0]).trim(),h)),(O.isNullOrUndefined(r)||"object"==typeof r&&isNaN(r.getTime()))&&(r=this.globalize.parseDate(this.getAmPmValue(i[1]).trim(),h)),!O.isNullOrUndefined(n)&&n instanceof Date&&!isNaN(n.getTime())&&!O.isNullOrUndefined(r)&&r instanceof Date&&!isNaN(r.getTime()))break}if(!(O.isNullOrUndefined(n)||isNaN(+n)||O.isNullOrUndefined(r)||isNaN(+r)))return a=this.startValue,this.startValue=n,s=this.endValue,this.endValue=r,this.setValue(),this.refreshControl(),t!==this.previousEleValue&&this.changeTrigger(e),this.preventBlur||document.activeElement===this.inputElement||(this.preventFocus=!1,this.trigger("blur",{model:this})),this.updateHiddenInput(),void(this.isMobile&&this.isPopupOpen()&&(this.startValue=a,this.endValue=s))}this.strictMode||(this.startValue=null,this.endValue=null,this.setValue())}this.strictMode?(O.isNullOrUndefined(t)||""!==t.trim()||(this.startValue=null,this.endValue=null),u.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.updateInput()):(O.isNullOrUndefined(this.popupObj)&&(this.currentDate=null),this.previousStartValue=this.previousEndValue=null,this.startValue=null,this.endValue=null,this.setValue()),this.errorClass(),this.changeTrigger(e),this.preventBlur||document.activeElement===this.inputElement||(this.preventFocus=!1,this.trigger("blur",{model:this}))}this.updateHiddenInput()}},v.prototype.getStartEndDate=function(e,t){return"Year"===this.currentView()&&!O.isNullOrUndefined(e)||"Year"===this.depth?new Date(e.getFullYear(),e.getMonth()+(t?1:0),t?0:1):"Decade"!==this.currentView()||O.isNullOrUndefined(e)?null:new Date(e.getFullYear(),t?11:0,t?31:1)},v.prototype.clearRange=function(){this.previousStartValue=this.previousEndValue=null,this.currentDate=null},v.prototype.errorClass=function(){var e=O.isNullOrUndefined(this.inputElement.value)?null:this.inputElement.value.trim();(O.isNullOrUndefined(this.endValue)&&O.isNullOrUndefined(this.startValue)&&""!==e||!O.isNullOrUndefined(this.startValue)&&+this.startValue<+this.min||!O.isNullOrUndefined(this.startValue)&&!O.isNullOrUndefined(this.endValue)&&+this.startValue>+this.endValue||!O.isNullOrUndefined(this.endValue)&&+this.endValue>+this.max||this.startValue&&this.isDateDisabled(this.startValue)||this.endValue&&this.isDateDisabled(this.endValue))&&""!==e?(O.addClass([this.inputWrapper.container],Te),O.attributes(this.inputElement,{"aria-invalid":"true"})):this.inputWrapper&&(O.removeClass([this.inputWrapper.container],Te),O.attributes(this.inputElement,{"aria-invalid":"false"}))},v.prototype.keyCalendarUpdate=function(e,t,i){return(i=void 0===i?!0:i)&&this.removeFocusedDate(),t=e?(this.leftCalCurrentDate=new Date(+this.currentDate),this.leftCalendar):(this.rightCalCurrentDate=new Date(+this.currentDate),this.rightCalendar),this.updateCalendarElement(t),this.table.focus(),t},v.prototype.navInCalendar=function(e,t,i,s,a){var n,r=this.getViewNumber(this.currentView()),l=this.min,o=O.isNullOrUndefined(this.maxDays)||!this.isMaxDaysClicked||O.isNullOrUndefined(this.startValue)?this.max:new Date(new Date(+this.startValue).setDate(this.startValue.getDate()+(this.maxDays-1)));switch(e.action){case"moveRight":n=new Date(+this.currentDate),this.addDay(n,1,e,o,l),t&&+n==+s&&(a=this.keyCalendarUpdate(!1,a)),this.keyboardNavigate(1,r,e,o,l),this.keyNavigation(a,e);break;case"moveLeft":n=new Date(+this.currentDate),this.addDay(n,-1,e,o,l),t||+n==+i&&(a=this.keyCalendarUpdate(!0,a)),this.keyboardNavigate(-1,r,e,o,l),this.keyNavigation(a,e);break;case"moveUp":0===r?(n=new Date(+this.currentDate),this.addDay(n,-7,e,o,l),+n<=+i&&!t&&(a=this.keyCalendarUpdate(!0,a)),this.keyboardNavigate(-7,r,e,o,l)):this.keyboardNavigate(-4,r,e,this.max,this.min),this.keyNavigation(a,e);break;case"moveDown":0===r?(n=new Date(+this.currentDate),this.addDay(n,7,e,o,l),t&&+s<=+n&&(a=this.keyCalendarUpdate(!1,a)),this.keyboardNavigate(7,r,e,o,l)):this.keyboardNavigate(4,r,e,this.max,this.min),this.keyNavigation(a,e);break;case"home":this.currentDate=this.firstDay(this.currentDate),O.remove(this.tableBodyElement),0===r?this.renderMonths(e):1===r?this.renderYears(e):this.renderDecades(e),this.keyNavigation(a,e);break;case"end":this.currentDate=this.lastDay(this.currentDate,r),O.remove(this.tableBodyElement),0===r?this.renderMonths(e):1===r?this.renderYears(e):this.renderDecades(e),this.keyNavigation(a,e);break;case"tab":this.tabKeyValidation(a,b)&&(a=this.keyCalendarUpdate(!1,a,!1),this.currentDate=this.firstCellToFocus(this.rightCalendar),r=this.getViewNumber(this.currentView()),this.keyboardNavigate(0,r,e,o,l),this.keyNavigation(a,e));break;case"shiftTab":this.tabKeyValidation(a,D)&&(a=this.keyCalendarUpdate(!0,a,!1),this.currentDate=this.firstCellToFocus(this.leftCalendar),this.keyboardNavigate(0,r,e,o,l),this.keyNavigation(a,e))}},v.prototype.firstCellToFocus=function(e){var e=2===this.getViewNumber(this.currentView())?e.children[1].firstElementChild.querySelector("td.e-cell:not(.e-week-number):not(.e-disabled):not(.e-other-year)"):e.children[1].firstElementChild.querySelector("td.e-cell:not(.e-week-number):not(.e-disabled):not(.e-other-month)"),e=e&&e.id?e.id.split("_")[0]:null,t=new Date(this.currentDate.getFullYear(),this.currentDate.getMonth(),1);return e?new Date(+e):t},v.prototype.keyInputHandler=function(e,t){var i,s,a=this.getViewNumber(this.currentView()),n=new Date(this.rightCalCurrentDate.getFullYear(),this.rightCalCurrentDate.getMonth(),1),r=new Date(this.leftCalCurrentDate.getFullYear(),this.leftCalCurrentDate.getMonth()+1,0),l=O.closest(e.target,"."+D),o=(l=O.isNullOrUndefined(l)?this.leftCalendar:l).classList.contains(b),h=(this.updateCalendarElement(l),this.tableBodyElement.querySelector("tr td.e-selected")),u=l.querySelector("tr td."+ze),d=l.querySelector("tr td."+E),p=l.querySelector("tr td."+C),c=this.getViewNumber(this.depth),m=a===c&&this.getViewNumber(this.start)>=c,f=O.closest(e.target,"."+b),v=O.closest(e.target,"."+D),g=O.closest(e.target,"."+Ye);switch(O.isNullOrUndefined(u)?O.isNullOrUndefined(p)||this.dateDisabled?O.isNullOrUndefined(d)||this.dateDisabled?this.dateDisabled||this.currentDate.setDate(1):this.currentDate=new Date(+this.startValue):this.currentDate=new Date(+this.endValue):this.currentDate=this.currentDate,this.effect="",e.action){case"altUpArrow":this.isPopupOpen()&&(this.hide(e),this.preventFocus=!0,this.inputElement.focus(),O.addClass([this.inputWrapper.container],[Se]));break;case"select":m?(s=O.isNullOrUndefined(u)?d:u,O.isNullOrUndefined(s)||s.classList.contains(k)||this.selectRange(null,s)):(O.isNullOrUndefined(h)||m)&&O.isNullOrUndefined(u)||(O.isNullOrUndefined(this.value)||(t=this.calendarElement.classList.contains(b)?this.startDate:this.endDate),this.controlDown=e,this.contentClick(null,--a,u||h,t)),e.preventDefault();break;case"controlHome":var y=new Date(this.currentDate.getFullYear(),0,1);!o&&+y<+r&&(l=this.keyCalendarUpdate(!0,l)),M.prototype.navigateTo.call(this,"Month",new Date(this.currentDate.getFullYear(),0,1)),this.keyNavigation(l,e);break;case"altRightArrow":O.isNullOrUndefined(f)?O.isNullOrUndefined(v)?O.isNullOrUndefined(g)||this.cancelButton.element.focus():O.isNullOrUndefined(this.presetElement)?this.cancelButton.element.focus():(this.presetElement.focus(),this.removeFocusedDate()):this.rightCalendar.children[1].firstElementChild.focus(),e.preventDefault();break;case"altLeftArrow":O.isNullOrUndefined(f)?O.isNullOrUndefined(v)||this.leftCalendar.children[1].firstElementChild.focus():(!0!==this.applyButton.element.disabled?this.applyButton:this.cancelButton).element.focus(),e.preventDefault();break;case"controlUp":this.calendarElement.classList.contains(b),this.calendarNavigation(e,this.calendarElement),e.preventDefault();break;case"controlDown":O.isNullOrUndefined(h)&&O.isNullOrUndefined(u)||m||(O.isNullOrUndefined(this.value)||(t=this.calendarElement.classList.contains(b)?this.startDate:this.endDate),this.controlDown=e,this.contentClick(null,--a,h||u,t)),e.preventDefault();break;case"controlEnd":y=new Date(this.currentDate.getFullYear(),11,31);o&&+n<+y&&(l=this.keyCalendarUpdate(!1,l)),M.prototype.navigateTo.call(this,"Month",new Date(this.currentDate.getFullYear(),11,31)),this.keyNavigation(l,e);break;case"pageUp":i=new Date(+this.currentDate),this.addMonths(i,-1),!o&&+i<=+r&&(l=this.keyCalendarUpdate(!0,l)),this.addMonths(this.currentDate,-1),M.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(l,e);break;case"pageDown":i=new Date(+this.currentDate),this.addMonths(i,1),o&&+n<=+i&&(l=this.keyCalendarUpdate(!1,l)),this.addMonths(this.currentDate,1),M.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(l,e);break;case"shiftPageUp":i=new Date(+this.currentDate),this.addYears(i,-1),!o&&+i<=+r&&(l=this.keyCalendarUpdate(!0,l)),this.addYears(this.currentDate,-1),M.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(l,e);break;case"shiftPageDown":i=new Date(+this.currentDate),this.addYears(i,1),o&&+n<=+i&&(l=this.keyCalendarUpdate(!1,l)),this.addYears(this.currentDate,1),M.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(l,e);break;case"shiftTab":O.isNullOrUndefined(this.presetElement)||(this.presetElement.setAttribute("tabindex","0"),this.presetElement.focus(),this.removeFocusedDate()),o&&e.preventDefault(),this.tabKeyValidation(l,D)&&(this.currentDate=new Date(+this.leftCalCurrentDate),this.navInCalendar(e,o,r,n,l));break;case"spacebar":this.applyButton&&!this.applyButton.disabled&&this.applyFunction(e);break;case"tab":this.tabKeyValidation(l,b)&&(this.currentDate=new Date(+this.rightCalCurrentDate),this.navInCalendar(e,o,r,n,l));break;default:this.navInCalendar(e,o,r,n,l),this.checkMinMaxDays()}this.presetHeight()},v.prototype.tabKeyValidation=function(e,t){var e=e.classList.contains(t),t=this.rightCalendar.querySelector(".e-header"),i=this.leftCalendar.querySelector(".e-header"),s=!!t&&t.classList.contains("e-month"),a=!!i&&i.classList.contains("e-month"),n=!!t&&t.classList.contains("e-year"),r=!!i&&i.classList.contains("e-year"),t=!!t&&t.classList.contains("e-decade"),i=!!i&&i.classList.contains("e-decade");return e&&(a||r||i)&&(s||n||t)&&!this.isMobile},v.prototype.keyNavigation=function(e,t){this.bindCalendarCellEvents(e),e.classList.contains(b)?this.leftCalCurrentDate=new Date(+this.currentDate):this.rightCalCurrentDate=new Date(+this.currentDate),this.updateNavIcons(),this.calendarIconEvent(),this.updateRange([e]),this.dateDisabled=this.isDateDisabled(this.currentDate),t.preventDefault()},v.prototype.inputHandler=function(e){switch(e.action){case"altDownArrow":this.isPopupOpen()||(""===this.inputElement.value&&(this.clear(),this.changeTrigger(e),this.clearRange()),this.show(null,e),this.isRangeIconClicked=!1,this.isMobile||O.isNullOrUndefined(this.leftCalendar)||this.calendarFocus(),this.isKeyPopup=!0);break;case"escape":this.isPopupOpen()&&this.hide(e);break;case"enter":document.activeElement===this.inputElement&&(this.inputBlurHandler(e),this.hide(e));break;case"tab":document.activeElement===this.inputElement&&this.isPopupOpen()&&(this.hide(e),e.preventDefault())}},v.prototype.bindCalendarCellEvents=function(e){for(var e=(e||this.popupObj.element).querySelectorAll("."+d+" td"),t=0,i=e;t<i.length;t++){var s=i[t];O.EventHandler.clearEvents(s),s.classList.contains(k)||s.classList.contains(_e)||s.classList.contains(Ge)||(this.isMobile||O.EventHandler.add(s,"mouseover",this.hoverSelection,this),O.EventHandler.add(s,"mousedown",this.selectRange,this))}},v.prototype.removeFocusedDate=function(){for(var e=!O.isNullOrUndefined(this.startValue)||!O.isNullOrUndefined(this.endValue),t=0,i=this.popupObj.element.querySelectorAll("."+d+" ."+ze);t<i.length;t++){var s=i[t],a=new Date,n=this.getIdValue(null,s);("Month"===this.depth&&"Month"===this.currentView()&&(!s.classList.contains(Re)||s.classList.contains(Re)&&e)||"Year"===this.depth&&"Year"===this.currentView()&&(!this.isSameMonth(a,n)&&!this.isSameYear(a,n)||e)||"Decade"===this.depth&&"Decade"===this.currentView()&&(!this.isSameYear(a,n)||e))&&(s.classList.remove(ze),s.classList.contains(E)||s.classList.contains(C)||s.removeAttribute("aria-label"))}},v.prototype.hoverSelection=function(e,t){var t=t||e.currentTarget,i=this.getIdValue(null,t);if(!O.isNullOrUndefined(this.startValue)&&+this.startValue>=+this.min&&+this.startValue<=+this.max&&(!this.isDateDisabled(this.endValue)&&!this.isDateDisabled(this.startValue)&&O.isNullOrUndefined(this.endValue)&&O.isNullOrUndefined(this.startValue)||!O.isNullOrUndefined(this.startValue)&&O.isNullOrUndefined(this.endValue)))for(var s=0,a=this.popupObj.element.querySelectorAll("."+d+" td");s<a.length;s++){var n,r=a[s],l=!r.classList.contains(k)||r.classList.contains(_e);!r.classList.contains(Ge)&&l&&(l=this.getIdValue(null,r),n="Month"===this.currentView()?new Date(+this.startValue):this.getStartEndDate(new Date(+this.startValue),!1),new Date(+l).setHours(0,0,0,0)>=n.setHours(0,0,0,0)&&+l<=+i?O.addClass([r],Pe):O.removeClass([r],[Pe]))}},v.prototype.isSameStartEnd=function(e,t){var i=!1;return"Month"===this.depth?e.setHours(0,0,0,0)===t.setHours(0,0,0,0)&&(i=!0):"Year"===this.depth?e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&(i=!0):"Decade"===this.depth&&e.getFullYear()===t.getFullYear()&&(i=!0),i},v.prototype.updateRange=function(e){if(!O.isNullOrUndefined(this.startValue))for(var t=0,i=e;t<i.length;t++)for(var s=0,a=i[t].querySelectorAll("."+d+" td");s<a.length;s++){var n,r,l,o,h=a[s];h.classList.contains(Ge)||h.classList.contains(k)||(n=this.getIdValue(null,h),o=this.getIdValue(null,h),O.isNullOrUndefined(this.endValue)?O.removeClass([h],[Pe]):(r="Month"===this.currentView()?new Date(+this.startValue):this.getStartEndDate(new Date(+this.startValue),!1),l="Month"===this.currentView()?new Date(+this.endValue):this.getStartEndDate(new Date(+this.endValue),!0),this.currentView()===this.depth&&+o.setHours(0,0,0,0)>=+r.setHours(0,0,0,0)&&+o.setHours(0,0,0,0)<=+l.setHours(0,0,0,0)&&!this.isSameStartEnd(new Date(+this.startValue),new Date(+this.endValue))&&+new Date(+this.startValue).setHours(0,0,0,0)>=+this.min&&+new Date(+this.endValue).setHours(0,0,0,0)<=+this.max&&!this.isDateDisabled(this.startValue)&&!this.isDateDisabled(this.endValue)&&O.addClass([h],Pe)),h.classList.contains(w)&&h.classList.contains(C)&&+o!=+this.endValue&&(O.removeClass([h],[w]),O.removeClass([h],[C])),h.classList.contains(Pe)&&+o>+this.endValue&&O.removeClass([h],[Pe]),h.classList.contains(Ae))||(r="Month"===this.currentView()?new Date(+this.startValue):this.getStartEndDate(new Date(+this.startValue),!1),l=new Date(+n),this.currentView()===this.depth&&+l.setHours(0,0,0,0)==+r.setHours(0,0,0,0)&&+l.setHours(0,0,0,0)>=+r.setHours(0,0,0,0)&&+this.startValue>=+this.min&&!this.inputWrapper.container.classList.contains("e-error")&&!this.isDateDisabled(this.startValue)&&!this.isDateDisabled(this.endValue)&&(O.addClass([h],[E,w]),this.addSelectedAttributes(h,this.startValue,!0)),o="Month"===this.currentView()?new Date(+this.endValue):this.getStartEndDate(new Date(+this.endValue),!0),"Year"===this.currentView()?l=new Date(l.getFullYear(),l.getMonth()+1,0):"Decade"===this.currentView()&&(l=new Date(l.getFullYear(),11,31)),this.currentView()===this.depth&&!O.isNullOrUndefined(this.endValue)&&+l.setHours(0,0,0,0)==+o.setHours(0,0,0,0)&&+l.setHours(0,0,0,0)<=+o.setHours(0,0,0,0)&&+this.startValue>=+this.min&&!this.inputWrapper.container.classList.contains("e-error")&&!this.isDateDisabled(this.startValue)&&!this.isDateDisabled(this.endValue)&&(O.addClass([h],[C,w]),this.addSelectedAttributes(h,this.startValue,!1)),+n!=+this.startValue)||O.isNullOrUndefined(this.endValue)||+n!=+this.endValue||this.addSelectedAttributes(h,this.endValue,!1,!0)}},v.prototype.checkMinMaxDays=function(){(!O.isNullOrUndefined(this.minDays)&&0<this.minDays||!O.isNullOrUndefined(this.maxDays)&&0<this.maxDays)&&(this.isMobile?this.updateMinMaxDays(this.popupObj.element.querySelector("."+d)):(this.updateMinMaxDays(this.popupObj.element.querySelector("."+b)),this.updateMinMaxDays(this.popupObj.element.querySelector("."+D))))},v.prototype.rangeArgs=function(e){var t,i=O.isNullOrUndefined(this.startValue)?null:this.globalize.formatDate(this.startValue,{format:this.formatString,type:"date",skeleton:"yMd"}),s=O.isNullOrUndefined(this.endValue)?null:this.globalize.formatDate(this.endValue,{format:this.formatString,type:"date",skeleton:"yMd"}),i=O.isNullOrUndefined(this.endValue)||O.isNullOrUndefined(this.startValue)?(t="",0):(t=i+" "+this.separator+" "+s,Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1);return{value:this.value,startDate:this.startValue,endDate:this.endValue,daySpan:i,event:e||null,element:this.element,isInteracted:!O.isNullOrUndefined(e),text:t}},v.prototype.otherMonthSelect=function(e,t,i){var s=+this.getIdValue(null,e),s='*[id^="/id"]:not(.e-other-month)'.replace("/id",""+s),s=this.popupObj&&this.popupObj.element.querySelector(s);O.isNullOrUndefined(s)||(t?(O.addClass([s],[E,w]),this.addSelectedAttributes(s,this.startValue,!0)):(O.addClass([s],[C,w]),this.addSelectedAttributes(s,this.endValue,!0)),i&&this.addSelectedAttributes(e,this.endValue,!1,!0))},v.prototype.selectRange=function(e,t){e&&e.preventDefault();var i,s,a=this.inputElement.value,a=(O.isNullOrUndefined(a)||""===a.trim()||1<(a=a.split(" "+this.separator+" ")).length&&("Year"===this.currentView()&&"Year"===this.depth||"Decade"===this.currentView()&&"Decade"===this.depth)&&(u={format:this.formatString,type:"date",skeleton:"yMd"},o=this.globalize.parseDate(this.getAmPmValue(a[0]).trim(),u),u=this.globalize.parseDate(this.getAmPmValue(a[1]).trim(),u),h=!0),O.isNullOrUndefined(e)?this.getIdValue(null,t):this.getIdValue(e,null)),n=(O.isNullOrUndefined(this.startValue)||("Year"===this.currentView()&&"Year"===this.depth?a=new Date(a.getFullYear(),a.getMonth(),this.startValue.getDate()):"Decade"===this.currentView()&&"Decade"===this.depth&&(a=new Date(a.getFullYear(),this.startValue.getMonth(),this.startValue.getDate()))),a.getFullYear()),r=a.getMonth(),l=h&&"Year"!==this.start?new Date(n,r,o.getDate(),o.getHours(),o.getMinutes(),o.getSeconds()):new Date(n,r,1),r=h&&"Year"!==this.start?new Date(n,r,u.getDate(),u.getHours(),u.getMinutes(),u.getSeconds()):new Date(n,r+1,0),o=h&&"Year"!==this.start?new Date(n,o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),o.getSeconds()):new Date(n,0,1),h=h&&"Year"!==this.start?new Date(n,u.getMonth(),u.getDate(),u.getHours(),u.getMinutes(),u.getSeconds()):new Date(n,11,31),u=(O.isNullOrUndefined(this.endValue)||O.isNullOrUndefined(this.startValue)?this.isMobile&&this.startButton.element.classList.contains(g)&&this.removeSelection():this.isMobile&&(!this.isMobile||this.endButton.element.classList.contains(g))||this.removeSelection(),t||e.currentTarget);if(O.isNullOrUndefined(this.startValue))O.isNullOrUndefined(this.previousStartValue)||(a.setHours(this.previousStartValue.getHours()),a.setMinutes(this.previousStartValue.getMinutes()),a.setSeconds(this.previousStartValue.getSeconds())),this.startValue="Month"===this.depth?new Date(this.checkValue(a)):"Year"===this.depth?l:o,this.endValue=null,this.setValue(),O.addClass([u],E),this.addSelectedAttributes(u,this.startValue,!0),u.classList.contains(Ae)&&this.otherMonthSelect(u,!0),this.checkMinMaxDays(),this.applyButton.disabled=!0,this.applyButton.element.disabled=!0,this.isMobile&&(this.endButton.element.classList.add(g),this.startButton.element.classList.remove(g),this.endButton.element.removeAttribute("disabled"),this.selectableDates()),this.trigger("select",this.rangeArgs(e));else if(+a==+this.startValue||+a>+this.startValue){if(+a==+this.startValue&&!O.isNullOrUndefined(this.minDays)&&1<this.minDays)return;this.endValue=null,this.setValue(),(this.isMobile||t)&&this.hoverSelection(e,t),O.isNullOrUndefined(this.previousEndValue)||(a.setHours(this.previousEndValue.getHours()),a.setMinutes(this.previousEndValue.getMinutes()),a.setSeconds(this.previousEndValue.getSeconds())),this.endValue="Month"===this.depth?new Date(this.checkValue(a)):"Year"===this.depth?r:h,this.setValue();n=this.popupObj.element.querySelectorAll("."+C);if(this.isMobile){this.startButton.element.classList.remove(g),this.endButton.element.classList.add(g);for(var d=0,p=n;d<p.length;d++){var c=p[d];c.removeAttribute("aria-label"),c.classList.contains(E)?(this.addSelectedAttributes(c,this.startValue,!0),O.removeClass([c],[C])):(c.setAttribute("aria-selected","false"),O.removeClass([c],[C,w]))}}O.addClass([u],C),+this.endValue==+this.startValue?this.addSelectedAttributes(u,this.endValue,!1,!0):this.addSelectedAttributes(u,this.endValue,!1),u.classList.contains(Ae)&&(+this.endValue==+this.startValue?this.otherMonthSelect(u,!1,!0):this.otherMonthSelect(u,!1));for(var m=0,f=this.popupObj.element.querySelectorAll("."+C);m<f.length;m++){var v=f[m];v.classList.contains(E)&&O.removeClass([v],[Pe])}this.applyButton.disabled=!1,this.applyButton.element.disabled=!1,this.isMobile||this.removeClassDisabled(),!O.isNullOrUndefined(this.renderDayCellArgs)&&this.renderDayCellArgs.isDisabled&&this.disabledDateRender(),this.trigger("select",this.rangeArgs(e))}else+a<+this.startValue&&(this.removeClassDisabled(),this.startValue="Month"===this.depth?new Date(this.checkValue(a)):"Year"===this.depth?l:o,this.setValue(),this.removeSelectedAttributes(),O.removeClass(this.popupObj.element.querySelectorAll("."+E),[E,w]),O.addClass([u],E),this.addSelectedAttributes(u,this.startValue,!0),u.classList.contains(Ae)&&this.otherMonthSelect(u,!0),this.checkMinMaxDays());t=this.min.getTime()!==new Date(1900,0,1).getTime(),r=this.max.getTime()!==new Date(2099,11,31).getTime();"Year"===this.currentView()&&"Year"===this.depth?(h=new Date(this.min.getFullYear(),this.min.getMonth(),1),!O.isNullOrUndefined(this.startValue)&&t&&+this.startValue<=+h&&(this.startValue=this.min),n=new Date(this.max.getFullYear(),this.max.getMonth()+1,0),!O.isNullOrUndefined(this.endValue)&&r&&+this.endValue>=+n&&(this.endValue=this.max)):"Decade"===this.currentView()&&"Decade"===this.depth&&(!O.isNullOrUndefined(this.startValue)&&t&&this.startValue.getFullYear()<=this.min.getFullYear()?this.startValue=this.min:t&&this.startValue.getFullYear()>this.min.getFullYear()&&(this.startValue=new Date(this.startValue.getFullYear(),0,1)),!O.isNullOrUndefined(this.endValue))&&r&&this.endValue.getFullYear()>=this.max.getFullYear()&&(this.endValue=this.max),e&&(i=O.closest(e.target,"."+b)),O.isNullOrUndefined(i)?(e&&(s=e&&O.closest(e.target,"."+D)),O.isNullOrUndefined(s)||this.rightCalendar.children[1].firstElementChild.focus()):this.leftCalendar.children[1].firstElementChild.focus(),O.addClass([u],w),this.calendarIconEvent(),this.updateHeader(),this.removeFocusedDate()},v.prototype.selectableDates=function(){if(!O.isNullOrUndefined(this.startValue)){var e=this.calendarElement.querySelectorAll("."+d+" td"),t=!1;if(this.currentView()===this.depth){for(var i=0,s=e;i<s.length;i++){var a=s[i];if(!a.classList.contains(E)&&!a.classList.contains(Ge)&&!a.classList.contains(k)){if(+this.getIdValue(null,a)<+this.startValue){O.addClass([a],[_e,k,m]),O.EventHandler.clearEvents(a);continue}break}if(a.classList.contains(E)&&!a.classList.contains(Ae)){t=!0;break}}!t||this.previousIcon.classList.contains(k)||O.addClass([this.previousIcon],[c,k,m])}else{for(var n=0,r=e;n<r.length;n++){var a=r[n],l=this.startValue.getMonth(),o=this.startValue.getFullYear(),h=this.getIdValue(null,a);if(this.startButton.element.classList.contains(g)||!("Year"===this.currentView()&&h.getMonth()<l&&h.getFullYear()<=o||"Decade"===this.currentView()&&h.getMonth()<=l&&h.getFullYear()<o))break;O.addClass([a],[k])}e[0].classList.contains(k)?this.previousIconHandler(!0):e[e.length-1].classList.contains(k)&&this.nextIconHandler(!0)}}},v.prototype.updateMinMaxDays=function(e){if(!O.isNullOrUndefined(this.startValue)&&O.isNullOrUndefined(this.endValue)||this.isMobile&&this.endButton&&this.endButton.element.classList.contains(g)){if(!O.isNullOrUndefined(this.minDays)&&0<this.minDays||!O.isNullOrUndefined(this.maxDays)&&0<this.maxDays){var t=this.removeTimeValueFromDate(this.startValue),i=new Date(new Date(+t).setDate(t.getDate()+(this.minDays-1))),s=new Date(new Date(+t).setDate(t.getDate()+(this.maxDays-1))),i=!O.isNullOrUndefined(this.minDays)&&0<this.minDays?i:null,s=!O.isNullOrUndefined(this.maxDays)&&0<this.maxDays?s:null;"Year"===this.currentView()?(i=O.isNullOrUndefined(i)?null:new Date(i.getFullYear(),i.getMonth(),0),s=O.isNullOrUndefined(s)?null:new Date(s.getFullYear(),s.getMonth(),1)):"Decade"===this.currentView()&&(i=O.isNullOrUndefined(i)?null:new Date(i.getFullYear()-1,11,1),s=O.isNullOrUndefined(s)?null:new Date(s.getFullYear(),0,1));for(var a=void 0,n=0,r=e.querySelectorAll("."+d+" td");n<r.length;n++){var l,o=r[n];o.classList.contains(E)||o.classList.contains(Ge)||(l=this.getIdValue(null,o),l=this.removeTimeValueFromDate(l),!O.isNullOrUndefined(i)&&+l==+i&&o.classList.contains(k)&&i.setDate(i.getDate()+1),o.classList.contains(k))||+l<=+t||(!O.isNullOrUndefined(i)&&+l<+i&&(O.addClass([o],[_e,k,m]),O.EventHandler.clearEvents(o)),!O.isNullOrUndefined(s)&&+s<+l&&(O.addClass([o],[_e,k,m]),this.isMaxDaysClicked=!0,O.EventHandler.clearEvents(o),O.isNullOrUndefined(a))&&!o.classList.contains(Ae)&&(a=o))}O.isNullOrUndefined(a)||(this.isMobile?this.nextIcon.classList.contains(k)||O.addClass([this.nextIcon],[c,k,m]):(e=O.closest(a,"."+D),(e=O.isNullOrUndefined(e)?this.leftCalendar:e).classList.contains(b)?(this.rightCalNextIcon.classList.contains(k)||O.addClass([this.rightCalNextIcon],[c,k,m]),this.leftCalNextIcon.classList.contains(k)||O.addClass([this.leftCalNextIcon],[c,k,m]),this.rightCalPrevIcon.classList.contains(k)||O.addClass([this.rightCalPrevIcon],[c,k,m])):this.rightCalNextIcon.classList.contains(k)||O.addClass([this.rightCalNextIcon],[c,k,m])))}}else this.isMaxDaysClicked=!1},v.prototype.removeTimeValueFromDate=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())},v.prototype.removeClassDisabled=function(){for(var e=0,t=this.popupObj.element.querySelectorAll("."+d+" td."+_e);e<t.length;e++){var i=t[e];i.classList.contains(_e)&&(O.removeClass([i],[_e,k,m]),O.EventHandler.add(i,"click",this.selectRange,this),this.isMobile||O.EventHandler.add(i,"mouseover",this.hoverSelection,this))}this.isMobile?(this.nextIcon.classList.contains(c)&&O.removeClass([this.nextIcon],[c,k,m]),this.previousIcon.classList.contains(c)&&O.removeClass([this.previousIcon],[c,k,m])):(this.rightCalNextIcon.classList.contains(c)&&O.removeClass([this.rightCalNextIcon],[c,k,m]),this.rightCalPrevIcon.classList.contains(c)&&O.removeClass([this.rightCalPrevIcon],[c,k,m]),this.leftCalNextIcon.classList.contains(c)&&O.removeClass([this.leftCalNextIcon],[c,k,m]))},v.prototype.updateHeader=function(){var e,t={type:"date",skeleton:"yMMMd"};O.isNullOrUndefined(this.endValue)||O.isNullOrUndefined(this.startValue)?this.popupObj.element.querySelector("."+Ke).textContent=this.l10n.getConstant("selectedDays"):(e=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1,O.isNullOrUndefined(this.disabledDayCnt)||(e-=this.disabledDayCnt,this.disabledDayCnt=null),this.popupObj.element.querySelector("."+Ke).textContent=e.toString()+" "+this.l10n.getConstant("days")),this.isMobile?(O.isNullOrUndefined(this.startValue)?this.startButton.element.textContent=this.l10n.getConstant("startLabel"):this.startButton.element.textContent=this.globalize.formatDate(this.startValue,t),O.isNullOrUndefined(this.endValue)||O.isNullOrUndefined(this.startValue)?this.endButton.element.textContent=this.l10n.getConstant("endLabel"):this.endButton.element.textContent=this.globalize.formatDate(this.endValue,t)):(O.isNullOrUndefined(this.endValue)||O.isNullOrUndefined(this.startValue)?this.popupObj.element.querySelector("."+He).textContent=this.l10n.getConstant("endLabel"):this.popupObj.element.querySelector("."+He).textContent=this.globalize.formatDate(this.endValue,t),O.isNullOrUndefined(this.startValue)?this.popupObj.element.querySelector("."+Ue).textContent=this.l10n.getConstant("startLabel"):this.popupObj.element.querySelector("."+Ue).textContent=this.globalize.formatDate(this.startValue,t)),(this.isDateDisabled(this.startValue)||this.isDateDisabled(this.endValue)||!O.isNullOrUndefined(this.startValue)&&+this.startValue<+this.min||!O.isNullOrUndefined(this.endValue)&&+this.endValue>+this.max||!O.isNullOrUndefined(this.startValue)&&!O.isNullOrUndefined(this.endValue)&&+this.startValue>+this.endValue)&&(this.isMobile?(this.startButton.element.textContent=this.l10n.getConstant("startLabel"),this.endButton.element.textContent=this.l10n.getConstant("endLabel"),this.popupObj.element.querySelector("."+Ke).textContent=this.l10n.getConstant("selectedDays")):(this.popupObj.element.querySelector("."+Ke).textContent=this.l10n.getConstant("selectedDays"),this.popupObj.element.querySelector("."+Ue).textContent=this.l10n.getConstant("startLabel"),this.popupObj.element.querySelector("."+He).textContent=this.l10n.getConstant("endLabel"))),this.popupObj.element.querySelector("#custom_range")&&(this.popupObj.element.querySelector("#custom_range").textContent=""!==this.l10n.getConstant("customRange")?this.l10n.getConstant("customRange"):"Custom Range")},v.prototype.removeSelection=function(){this.startValue=null,this.endValue=null,this.setValue(),this.removeSelectedAttributes(),this.popupObj&&(0<this.popupObj.element.querySelectorAll("."+w).length&&O.removeClass(this.popupObj.element.querySelectorAll("."+w),[E,C,w]),0<this.popupObj.element.querySelectorAll("."+ze).length&&O.removeClass(this.popupObj.element.querySelectorAll("."+ze),ze),0<this.popupObj.element.querySelectorAll("."+Pe).length)&&O.removeClass(this.popupObj.element.querySelectorAll("."+Pe),[Pe])},v.prototype.addSelectedAttributes=function(e,t,i,s){e&&(t=this.globalize.formatDate(t,{type:"date",skeleton:"full"}),!O.isNullOrUndefined(s)&&s?e.setAttribute("aria-label","The current start and end date is "+t):e.setAttribute("aria-label","The current "+(i?"start":"end")+" date is "+t),e.setAttribute("aria-selected","true"))},v.prototype.removeSelectedAttributes=function(){if(this.popupObj){for(var e=0,t=this.popupObj.element.querySelectorAll("."+E);e<t.length;e++)(i=t[e]).setAttribute("aria-selected","false"),i.removeAttribute("aria-label");for(var i,s=0,a=this.popupObj.element.querySelectorAll("."+C);s<a.length;s++)(i=a[s]).setAttribute("aria-selected","false"),i.removeAttribute("aria-label")}},v.prototype.updateCalendarElement=function(e){e.classList.contains(b)?(this.calendarElement=this.leftCalendar,this.currentDate=this.leftCalCurrentDate,this.previousIcon=this.leftCalPrevIcon,this.nextIcon=this.leftCalNextIcon):(this.calendarElement=this.rightCalendar,this.currentDate=this.rightCalCurrentDate,this.previousIcon=this.rightCalPrevIcon,this.nextIcon=this.rightCalNextIcon),this.contentElement=e.querySelector("."+qe),this.tableBodyElement=O.select("."+qe+" tbody",e),this.table=e.querySelector("."+qe).getElementsByTagName("table")[0],this.headerTitleElement=e.querySelector("."+p+" ."+Le),this.headerElement=e.querySelector("."+p)},v.prototype.navPrevMonth=function(e){e.preventDefault();var t=O.closest(e.target,"."+b),t=O.isNullOrUndefined(t)?O.closest(e.target,"."+D):t;this.updateCalendarElement(t),this.navigatePrevious(e),!O.isNullOrUndefined(this.startValue)&&O.isNullOrUndefined(this.endValue)&&this.updateMinMaxDays(t),this.updateControl(t)},v.prototype.deviceNavigation=function(e){this.deviceCalendarEvent(),this.updateRange([this.popupObj.element.querySelector("."+d)]),this.endButton.element.classList.contains(g)&&this.updateMinMaxDays(this.popupObj.element.querySelector("."+d)),this.endButton.element.classList.contains(g)&&this.selectableDates(),this.currentView()===this.depth&&this.bindCalendarCellEvents(),this.removeFocusedDate()},v.prototype.updateControl=function(e,t){void 0===t&&(t=null),e.classList.contains(D)?this.rightCalCurrentDate=new Date(+(t||this.currentDate)):this.leftCalCurrentDate=new Date(+this.currentDate),this.calendarIconEvent(),("Month"===this.depth&&this.leftCalendar.querySelector(".e-content").classList.contains("e-month")&&this.rightCalendar.querySelector(".e-content").classList.contains("e-month")||"Year"===this.depth&&this.leftCalendar.querySelector(".e-content").classList.contains("e-year")&&this.rightCalendar.querySelector(".e-content").classList.contains("e-year")||"Decade"===this.depth&&this.leftCalendar.querySelector(".e-content").classList.contains("e-decade")&&this.rightCalendar.querySelector(".e-content").classList.contains("e-decade")||this.isMobile)&&this.bindCalendarCellEvents(),this.removeFocusedDate(),this.updateRange([e])},v.prototype.navNextMonth=function(e){e.preventDefault();var t=O.closest(e.target,"."+b),t=O.isNullOrUndefined(t)?O.closest(e.target,"."+D):t;this.updateCalendarElement(t),this.navigateNext(e),!O.isNullOrUndefined(this.startValue)&&O.isNullOrUndefined(this.endValue)&&this.updateMinMaxDays(t),this.updateControl(t)},v.prototype.isPopupOpen=function(){return!(O.isNullOrUndefined(this.popupObj)||!this.popupObj.element.classList.contains(Ne))},v.prototype.createRangeHeader=function(){var e,t,i,s=this.createElement("div",{className:"e-start-end"});return this.isMobile?(t=this.createElement("button",{className:"e-end-btn"}),e=this.createElement("button",{className:xe}),this.startButton=new W.Button({content:this.l10n.getConstant("startLabel")},e),this.endButton=new W.Button({content:this.l10n.getConstant("endLabel")},t),s.appendChild(e),s.appendChild(t)):(e=this.createElement("a",{className:Ue}),t=this.createElement("a",{className:He}),i=this.createElement("span",{className:"e-change-icon e-icons"}),O.attributes(e,{"aria-atomic":"true","aria-live":"assertive","aria-label":"Start Date",role:"button"}),O.attributes(t,{"aria-atomic":"true","aria-live":"assertive","aria-label":"End Date",role:"button"}),s.appendChild(e),s.appendChild(i),s.appendChild(t),e.textContent=this.l10n.getConstant("startLabel"),t.textContent=this.l10n.getConstant("endLabel")),s},v.prototype.disableInput=function(){this.strictMode?O.isNullOrUndefined(this.previousStartValue)||O.isNullOrUndefined(this.previousEndValue)||(this.startValue=this.previousStartValue,this.endValue=this.previousEndValue,this.setValue(),this.updateInput()):(this.updateInput(),this.clearRange(),this.setProperties({startDate:null},!0),this.setProperties({endDate:null},!0),this.startValue=null,this.endValue=null,this.setValue(),this.errorClass()),this.setProperties({enabled:!1},!0),u.Input.setEnabled(this.enabled,this.inputElement),this.bindEvents()},v.prototype.validateMinMax=function(){this.min=O.isNullOrUndefined(this.min)||!+this.min?this.min=new Date(1900,0,1):this.min,this.max=O.isNullOrUndefined(this.max)||!+this.max?this.max=new Date(2099,11,31):this.max,this.min<=this.max?(O.isNullOrUndefined(this.minDays)||O.isNullOrUndefined(this.maxDays)||0<this.maxDays&&0<this.minDays&&this.minDays>this.maxDays&&(this.maxDays=null),!O.isNullOrUndefined(this.minDays)&&this.minDays<0&&(this.minDays=null),!O.isNullOrUndefined(this.maxDays)&&this.maxDays<0&&(this.maxDays=null)):this.disableInput()},v.prototype.validateRangeStrict=function(){O.isNullOrUndefined(this.startValue)||(+this.startValue<=+this.min?(this.startValue=this.min,this.setValue()):+this.startValue>=+this.min&&+this.startValue>=+this.max&&(this.startValue=this.max)),O.isNullOrUndefined(this.endValue)||(+this.endValue>+this.max?(this.endValue=this.max,this.setValue()):+this.endValue<+this.min&&(this.endValue=this.min,this.setValue())),this.validateMinMaxDays()},v.prototype.validateRange=function(){this.validateMinMaxDays()},v.prototype.validateMinMaxDays=function(){var e,t;O.isNullOrUndefined(this.startValue)||O.isNullOrUndefined(this.endValue)||(e=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1,O.isNullOrUndefined(this.minDays)||!(0<this.minDays)||e>=this.minDays||(this.strictMode?((t=new Date(+this.startValue)).setDate(t.getDate()+(this.minDays-1)),+t>+this.max?this.endValue=this.max:this.endValue=t):(this.startValue=null,this.endValue=null),this.setValue()),O.isNullOrUndefined(this.maxDays))||!(0<this.maxDays)||e<=this.maxDays||(this.strictMode?(this.endValue=new Date(+this.startValue),this.endValue.setDate(this.endValue.getDate()+(this.maxDays-1))):(this.startValue=null,this.endValue=null),this.setValue())},v.prototype.renderCalendar=function(){this.calendarElement=this.createElement("div"),this.calendarElement.classList.add(d),this.enableRtl&&this.calendarElement.classList.add("e-rtl"),O.attributes(this.calendarElement,{"data-role":"calendar"}),M.prototype.createHeader.call(this),M.prototype.createContent.call(this)},v.prototype.isSameMonth=function(e,t){return e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()},v.prototype.isSameYear=function(e,t){return e.getFullYear()===t.getFullYear()},v.prototype.isSameDecade=function(e,t){e=e.getFullYear(),t=t.getFullYear();return e-e%10==t-t%10},v.prototype.startMonthCurrentDate=function(){this.isSameMonth(this.min,this.max)||+this.currentDate>+this.max||this.isSameMonth(this.currentDate,this.max)?(this.currentDate=new Date(+this.max),this.currentDate.setDate(1),this.currentDate.setMonth(this.currentDate.getMonth()-1)):this.currentDate<this.min&&(this.currentDate=new Date(this.checkValue(this.min)))},v.prototype.selectNextMonth=function(){var e;O.isNullOrUndefined(this.endValue)||O.isNullOrUndefined(this.startValue)||this.isSameMonth(this.endValue,this.currentDate)||this.isDateDisabled(this.endValue)||this.isDateDisabled(this.startValue)?(this.currentDate.setDate(1),this.currentDate.setMonth(this.currentDate.getMonth()+1)):(this.currentDate=new Date(+this.endValue),(!O.isNullOrUndefined(this.startValue)&&+this.startValue<+this.min||!O.isNullOrUndefined(this.endValue)&&+this.endValue>+this.max||!O.isNullOrUndefined(this.startValue)&&!O.isNullOrUndefined(this.endValue)&&+this.startValue>+this.endValue)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.currentDate.setDate(1),e=this.currentDate.getMonth()+1,this.currentDate.setMonth(e)))},v.prototype.selectNextYear=function(){var e;O.isNullOrUndefined(this.endValue)||O.isNullOrUndefined(this.startValue)||this.isSameYear(this.endValue,this.currentDate)||this.isDateDisabled(this.endValue)||this.isDateDisabled(this.startValue)?(this.currentDate.setMonth(0),e=this.currentDate.getFullYear()+1,this.currentDate.setFullYear(e)):(this.currentDate=new Date(+this.endValue),(!O.isNullOrUndefined(this.endValue)&&+this.endValue>+this.max||!O.isNullOrUndefined(this.startValue)&&!O.isNullOrUndefined(this.endValue)&&+this.startValue>+this.endValue||!O.isNullOrUndefined(this.startValue)&&+this.startValue<+this.min)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.currentDate.setMonth(0),this.currentDate.setFullYear(this.currentDate.getFullYear()+1)))},v.prototype.selectNextDecade=function(){var e;O.isNullOrUndefined(this.endValue)||O.isNullOrUndefined(this.startValue)||this.isSameDecade(this.endValue,this.currentDate)||this.isDateDisabled(this.endValue)||this.isDateDisabled(this.startValue)?(e=this.currentDate.getFullYear()+10,this.currentDate.setFullYear(e)):(this.currentDate=new Date(+this.endValue),(!O.isNullOrUndefined(this.startValue)&&!O.isNullOrUndefined(this.endValue)&&+this.startValue>+this.endValue||!O.isNullOrUndefined(this.endValue)&&+this.endValue>+this.max||!O.isNullOrUndefined(this.startValue)&&+this.startValue<+this.min)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.currentDate.setFullYear(this.currentDate.getFullYear()+10)))},v.prototype.selectStartMonth=function(){O.isNullOrUndefined(this.startValue)?(this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.startMonthCurrentDate()):!O.isNullOrUndefined(this.max)&&this.isSameMonth(this.startValue,this.max)?(this.currentDate=new Date(+this.max),this.currentDate.setDate(1),this.currentDate.setMonth(this.currentDate.getMonth()-1)):this.startValue>=this.min&&this.startValue<=this.max&&!this.isDateDisabled(this.startValue)?this.currentDate=new Date(+this.startValue):this.currentDate=new Date((new Date).setHours(0,0,0,0)),(!O.isNullOrUndefined(this.endValue)&&+this.endValue>+this.max||!O.isNullOrUndefined(this.startValue)&&+this.startValue<+this.min||!O.isNullOrUndefined(this.startValue)&&!O.isNullOrUndefined(this.endValue)&&+this.startValue>+this.endValue)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0))),this.startMonthCurrentDate()},v.prototype.createCalendar=function(){var e,t,i=this.createElement("div",{className:"e-calendar-container"});return this.isMobile?(O.isNullOrUndefined(this.startValue)||(this.currentDate=new Date(+this.startValue)),M.prototype.validateDate.call(this),M.prototype.minMaxUpdate.call(this),M.prototype.render.call(this),t=this.calendarElement.querySelector("."+d+" ."+Fe),e=this.calendarElement.querySelector("."+d+" ."+We),O.remove(this.calendarElement.querySelector("."+d+" ."+Be)),this.calendarElement.querySelector("."+d+" ."+p).appendChild(e),this.calendarElement.querySelector("."+d+" ."+p).appendChild(t),O.prepend([t],this.calendarElement.querySelector("."+d+" ."+p)),this.deviceCalendar=this.calendarElement,i.appendChild(this.calendarElement),this.headerTitleElement=this.calendarElement.querySelector("."+d+" ."+p+" ."+Le)):(this.selectStartMonth(),this.renderCalendar(),this.leftCalCurrentDate=new Date(+this.currentDate),this.calendarElement.classList.add(b),this.leftCalPrevIcon=this.calendarElement.querySelector("."+b+" ."+Fe),this.leftCalNextIcon=this.calendarElement.querySelector("."+b+" ."+We),this.leftTitle=this.calendarElement.querySelector("."+b+" ."+Le),O.remove(this.calendarElement.querySelector("."+b+" ."+Be)),this.calendarElement.querySelector("."+b+" ."+p).appendChild(this.leftCalNextIcon),this.calendarElement.querySelector("."+b+" ."+p).appendChild(this.leftCalPrevIcon),O.prepend([this.leftCalPrevIcon],this.calendarElement.querySelector("."+b+" ."+p)),this.leftCalendar=this.calendarElement,e=this.createElement("div",{className:"e-left-container"}),t=this.createElement("div",{className:"e-right-container"}),e.appendChild(this.leftCalendar),i.appendChild(e),this.isMobile||O.EventHandler.add(this.leftTitle,"click",this.leftNavTitle,this),"Month"===this.start&&this.selectNextMonth(),"Year"===this.start&&this.selectNextYear(),"Decade"===this.start&&this.selectNextDecade(),this.renderCalendar(),this.rightCalCurrentDate=new Date(+this.currentDate),O.addClass([this.calendarElement],D),this.rightCalendar=this.calendarElement,O.removeClass([this.leftCalendar&&this.leftCalendar.querySelector(".e-content tbody")],"e-zoomin"),O.removeClass([this.rightCalendar&&this.rightCalendar.querySelector(".e-content tbody")],"e-zoomin"),this.rightCalPrevIcon=this.calendarElement.querySelector("."+D+" ."+Fe),this.rightCalNextIcon=this.calendarElement.querySelector("."+D+" ."+We),this.rightTitle=this.calendarElement.querySelector("."+D+" ."+Le),O.remove(this.calendarElement.querySelector("."+D+" ."+Be)),this.calendarElement.querySelector("table").setAttribute("tabindex","0"),this.calendarElement.querySelector("."+D+" ."+p).appendChild(this.rightCalNextIcon),this.calendarElement.querySelector("."+D+" ."+p).appendChild(this.rightCalPrevIcon),O.prepend([this.rightCalPrevIcon],this.calendarElement.querySelector("."+D+" ."+p)),t.appendChild(this.rightCalendar),i.appendChild(t),this.isMobile||O.EventHandler.add(this.rightTitle,"click",this.rightNavTitle,this)),i},v.prototype.leftNavTitle=function(e){this.isPopupOpen()&&(this.calendarElement=this.leftCalendar,this.calendarNavigation(e,this.calendarElement))},v.prototype.calendarNavigation=function(e,t){this.table=t.querySelector("table"),this.headerTitleElement=t.querySelector(".e-title"),this.tableBodyElement=t.querySelector("tbody"),this.tableHeadElement=t.querySelector("thead"),this.contentElement=t.querySelector(".e-content"),this.updateCalendarElement(t),M.prototype.navigateTitle.call(this,e),this.updateNavIcons()},v.prototype.rightNavTitle=function(e){this.isPopupOpen()&&(this.calendarElement=this.rightCalendar,this.calendarNavigation(e,this.calendarElement))},v.prototype.clickEventEmitter=function(e){this.isMobile||(O.closest(e.target,".e-calendar.e-left-calendar")?(this.calendarElement=this.leftCalendar,this.updateCalendarElement(this.leftCalendar)):(this.calendarElement=this.rightCalendar,this.updateCalendarElement(this.rightCalendar)))},v.prototype.currentView=function(){return M.prototype.currentView.call(this)},v.prototype.getCalendarView=function(e){return"Year"===e?"Year":"Decade"===e?"Decade":"Month"},v.prototype.navigatedEvent=function(e){var t;this.trigger("navigated",this.navigatedArgs),O.isNullOrUndefined(this.popupObj)||(t=this.getCalendarView(this.currentView()),this.isMobile?t===this.depth?(this.bindCalendarCellEvents(),this.deviceNavigation(),this.removeFocusedDate(),this.checkMinMaxDays()):this.selectableDates():this.isMobile||t!==this.depth?(this.updateNavIcons(),this.calendarIconEvent()):((this.calendarElement.classList.contains("e-left-calendar")?this.leftCalendar:this.rightCalendar)!==this.leftCalendar||(!e||e.currentTarget.children[0].classList.contains("e-icons"))&&O.isNullOrUndefined(this.controlDown)?(!e||e.currentTarget.children[0].classList.contains("e-icons"))&&O.isNullOrUndefined(this.controlDown)||(this.rightCalCurrentDate=new Date(+this.currentDate),this.effect="",this.currentDate=this.rightCalCurrentDate,this.updateCalendarElement(this.rightCalendar),this.updateControl(this.rightCalendar),this.updateCalendarElement(this.leftCalendar),this.startValue&&O.isNullOrUndefined(this.endValue)&&("Month"===t&&this.startValue.getMonth()<this.rightCalCurrentDate.getMonth()&&this.startValue.getFullYear()<=this.rightCalCurrentDate.getFullYear()||"Year"===t&&this.startValue.getFullYear()<this.rightCalCurrentDate.getFullYear())?M.prototype.navigateTo.call(this,t,new Date(+this.startValue)):M.prototype.navigateTo.call(this,t,this.leftCalCurrentDate),this.updateControl(this.leftCalendar),this.updateNavIcons(),this.calendarIconEvent(),this.calendarIconRipple(),this.controlDown=null):(this.leftCalCurrentDate=new Date(+this.currentDate),this.effect="",this.currentDate=this.leftCalCurrentDate,this.updateCalendarElement(this.leftCalendar),this.updateControl(this.leftCalendar),this.updateCalendarElement(this.rightCalendar),M.prototype.navigateTo.call(this,t,this.rightCalCurrentDate),e=this.rightCalCurrentDate||this.currentDate,this.updateControl(this.rightCalendar,e),this.updateNavIcons(),this.calendarIconEvent(),this.calendarIconRipple(),this.controlDown=null),this.checkMinMaxDays()))},v.prototype.createControl=function(){var e=this.createElement("div",{className:je}),t=this.createElement("div",{className:"e-range-header"}),i=(this.isMobile&&this.fullScreenMode&&(a=this.createElement("div",{className:"e-model-header-wrapper"}),i=this.createElement("span",{className:"e-popup-close"}),O.EventHandler.add(i,"mousedown touchstart",this.modelRangeCloseHandler,this),s=this.createElement("span",{className:"e-apply"}),O.EventHandler.add(s,"mousedown touchstart",this.applyFunction,this),a.appendChild(i),a.appendChild(s),t.appendChild(a)),this.createRangeHeader()),s=(t.appendChild(i),this.createElement("div",{className:Ke})),a=(s.textContent=this.l10n.getConstant("selectedDays"),t.appendChild(s),this.createElement("div",{className:"e-separator"})),i=this.createCalendar(),s=(e.appendChild(t),e.appendChild(a),e.appendChild(i),this.createElement("div",{className:"e-footer"})),t=this.createElement("button",{className:"e-cancel e-flat e-css"}),a=this.createElement("button"),i=(O.addClass([a],["e-apply","e-flat","e-primary","e-css"]),s.appendChild(a),s.appendChild(t),!O.isNullOrUndefined(this.startValue)&&!O.isNullOrUndefined(this.endValue));this.cancelButton=new W.Button({content:this.l10n.getConstant("cancelText")},t),this.applyButton=new W.Button({content:this.l10n.getConstant("applyText"),disabled:!i},a),O.EventHandler.add(a,"click",this.applyFunction,this),O.EventHandler.add(t,"click",this.cancelFunction,this),this.popupWrapper.appendChild(e),this.isMobile||O.isUndefined(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)||(this.createPresets(),this.listRippleEffect(),O.addClass([e],"e-range-border"),O.addClass([this.popupWrapper],"e-preset-wrapper"),this.popupWrapper.querySelector("."+Ye).style.height=this.popupWrapper.querySelector("."+je).getBoundingClientRect().height+"px"),this.popupWrapper.appendChild(s),this.isMobile&&this.deviceHeaderUpdate(),this.renderPopup()},v.prototype.modelRangeCloseHandler=function(e){this.hide()},v.prototype.cancelFunction=function(e){document.activeElement!==this.inputElement&&(this.preventFocus=!0,this.inputElement.focus(),O.addClass([this.inputWrapper.container],[Se])),e.preventDefault(),this.isKeyPopup&&(this.inputElement.focus(),this.isKeyPopup=!1),this.startValue=null,this.endValue=null,this.removeSelection(),this.hide(e)},v.prototype.deviceHeaderUpdate=function(){O.isNullOrUndefined(this.startValue)&&O.isNullOrUndefined(this.endValue)?(this.endButton.element.setAttribute("disabled",""),this.startButton.element.classList.add(g)):O.isNullOrUndefined(this.startValue)||this.startButton.element.classList.add(g)},v.prototype.applyFunction=function(e){var t=!1;"touchstart"!==e.type&&e.preventDefault(),this.closeEventArgs&&this.closeEventArgs.cancel&&(this.startValue=this.popupWrapper.querySelector(".e-start-date")&&this.getIdValue(null,this.popupWrapper.querySelector(".e-start-date")),this.endValue=this.popupWrapper.querySelector(".e-end-date")&&this.getIdValue(null,this.popupWrapper.querySelector(".e-end-date")),this.setValue()),document.activeElement!==this.inputElement&&(this.preventFocus=!0,this.inputElement.focus(),O.addClass([this.inputWrapper.container],[Se])),"touchstart"!==e.type&&this.closeEventArgs&&!this.closeEventArgs.cancel&&e.preventDefault(),O.isNullOrUndefined(this.startValue)||O.isNullOrUndefined(this.endValue)?this.hide(e||null):(this.previousStartValue&&this.previousEndValue&&this.startValue.getDate()===this.previousStartValue.getDate()&&this.startValue.getMonth()===this.previousStartValue.getMonth()&&this.startValue.getFullYear()===this.previousStartValue.getFullYear()&&this.endValue.getDate()===this.previousEndValue.getDate()&&this.endValue.getMonth()===this.previousEndValue.getMonth()&&this.endValue.getFullYear()===this.previousEndValue.getFullYear()||u.Input.setValue(this.rangeArgs(e).text,this.inputElement,this.floatLabelType,this.showClearButton),this.previousStartValue=new Date(+this.startValue),this.previousEndValue=new Date(+this.endValue),this.previousEleValue=this.inputElement.value,+this.initStartDate==+this.startValue&&+this.initEndDate==+this.endValue||(t=!0),this.changeTrigger(e),this.hide(e||null),this.errorClass(),t=!0),O.closest(e.target,"."+Oe)||t||this.focusOut(),this.isMobile||(this.isKeyPopup=!1,this.isRangeIconClicked&&(this.inputWrapper.container.children[1].focus(),this.keyInputConfigs=O.extend(this.keyInputConfigs,this.keyConfigs),this.popupKeyboardModule=new O.KeyboardEvents(this.inputWrapper.container.children[1],{eventName:"keydown",keyConfigs:this.keyInputConfigs,keyAction:this.popupKeyActionHandle.bind(this)})))},v.prototype.onMouseClick=function(e,t){var i;"touchstart"===e.type||(t=t||e.target,i=(t=O.closest(t,"."+Xe))&&t.classList.contains(g),t&&t.classList.contains(Xe)&&this.setListSelection(t,e),this.preventFocus=!0,this.inputElement.focus(),this.isMobile)||(this.preventFocus=!0,t&&t.classList.contains(Xe)&&"custom_range"===t.getAttribute("id")?this.leftCalendar.children[1].firstElementChild.focus():i||"keydown"!==e.type||this.inputElement.focus())},v.prototype.onMouseOver=function(e){e=O.closest(e.target,"."+Xe);e&&e.classList.contains(Xe)&&!e.classList.contains(f)&&O.addClass([e],f)},v.prototype.onMouseLeave=function(e){e=O.closest(e.target,"."+f);O.isNullOrUndefined(e)||O.removeClass([e],f)},v.prototype.setListSelection=function(e,t){if(e&&(!e.classList.contains(g)||this.isMobile&&e.classList.contains(g))){if(this.isMobile&&e.classList.contains(g))return this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(e),"custom_range"===this.presetsItem[this.activeIndex].id?void this.renderCustomPopup():void 0;this.removeListSelection(),this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(e),O.addClass([e],g),e.setAttribute("aria-selected","true");e=this.presetsItem[this.activeIndex];"custom_range"===e.id?this.renderCustomPopup():this.applyPresetRange(e,t)}},v.prototype.removeListSelection=function(){var e=this.presetElement.querySelector("."+g);O.isNullOrUndefined(e)||(O.removeClass([e],g),e.removeAttribute("aria-selected"))},v.prototype.setValue=function(){this.modelValue=[this.startValue,this.endValue]},v.prototype.applyPresetRange=function(e,t){this.hide(null),this.presetsItem[this.presetsItem.length-1].start=null,this.presetsItem[this.presetsItem.length-1].end=null,this.startValue=e.start,this.endValue=e.end,this.setValue(),this.refreshControl(),this.trigger("select",this.rangeArgs(t)),this.changeTrigger(t),this.previousEleValue=this.inputElement.value,this.isCustomRange=!1,this.leftCalendar=this.rightCalendar=null,this.isKeyPopup&&(this.isRangeIconClicked=!1,this.inputElement.focus())},v.prototype.showPopup=function(e,t){this.presetHeight(),1e3===this.zIndex?this.popupObj.show(null,this.element):this.popupObj.show(null,null),this.isMobile&&this.popupObj.refreshPosition()},v.prototype.renderCustomPopup=function(){var t=this,e=(this.isCustomWindow=!0,this.popupObj.hide(),this.popupWrapper=this.createElement("div",{id:this.element.id+"_popup",className:Ie+" "+Ne}),this.renderControl(),this.openEventArgs={popup:this.popupObj||null,cancel:!1,date:this.inputElement.value,model:this,event:event||null,appendTo:this.isMobile||O.Browser.isDevice?this.mobileRangePopupWrap:document.body},this.openEventArgs);this.trigger("open",e,function(e){t.openEventArgs=e,t.openEventArgs.cancel}),this.openEventArgs.appendTo.appendChild(this.popupWrapper),this.showPopup(),this.isCustomRange=!0,this.isMobile||this.calendarFocus()},v.prototype.listRippleEffect=function(){for(var e=0,t=this.liCollections;e<t.length;e++){var i=t[e];O.rippleEffect(i)}},v.prototype.createPresets=function(){var e,t,i,s,a;O.isUndefined(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)||(this.presetElement=this.createElement("div",{className:Ye,attrs:{tabindex:"0"}}),e=F.ListBase.createList(this.createElement,this.presetsItem,null,!0),O.attributes(e,{role:"listbox","aria-hidden":"false",id:this.element.id+"_options",tabindex:"0","aria-label":"daterangepicker-preset"}),this.presetElement.appendChild(e),this.popupWrapper.appendChild(this.presetElement),e=this.presetElement.querySelector("#custom_range"),O.isNullOrUndefined(e)||(e.textContent=""!==this.l10n.getConstant("customRange")?this.l10n.getConstant("customRange"):"Custom Range"),this.liCollections=this.presetElement.querySelectorAll("."+Xe),this.wireListEvents(),this.isMobile&&(this.fullScreenMode?(e=O.createElement("div",{className:"e-range-mob-popup-wrap"}),t=this.createElement("div",{className:"e-model-header"}),(i=this.createElement("span",{className:"e-model-title"})).textContent="Select Preset",s=this.createElement("span",{className:"e-popup-close"}),O.EventHandler.add(s,"mousedown touchstart",this.modelRangeCloseHandler,this),a=this.presetElement,t.appendChild(s),t.appendChild(i),e.appendChild(t),e.appendChild(a),this.popupWrapper.insertBefore(e,this.popupWrapper.firstElementChild),this.presetElement.style.width="100%"):this.presetElement.style.width=this.inputWrapper.container.getBoundingClientRect().width+"px"),!O.isNullOrUndefined(this.activeIndex)&&-1<this.activeIndex&&O.addClass([this.liCollections[this.activeIndex]],g))},v.prototype.wireListEvents=function(){O.EventHandler.add(this.presetElement,"click",this.onMouseClick,this),this.isMobile||(O.EventHandler.add(this.presetElement,"mouseover",this.onMouseOver,this),O.EventHandler.add(this.presetElement,"mouseout",this.onMouseLeave,this))},v.prototype.unWireListEvents=function(){O.isNullOrUndefined(this.presetElement)||(O.EventHandler.remove(this.presetElement,"click touchstart",this.onMouseClick),this.isMobile)||(O.EventHandler.remove(this.presetElement,"mouseover",this.onMouseOver),O.EventHandler.remove(this.presetElement,"mouseout",this.onMouseLeave))},v.prototype.renderPopup=function(){var t=this,e=(this.popupWrapper.classList.add("e-control"),this.popupWrapper.getBoundingClientRect().width);O.isNullOrUndefined(this.cssClass)||""===this.cssClass.trim()||(this.popupWrapper.className+=" "+this.cssClass),this.isMobile&&this.isCustomWindow&&(this.modal=this.createElement("div"),document.body.appendChild(this.modal)),this.popupObj=new H.Popup(this.popupWrapper,{relateTo:this.isMobile&&this.isCustomWindow?document.body:O.isNullOrUndefined(this.targetElement)?this.inputWrapper.container:this.targetElement,position:this.isMobile?O.isUndefined(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)||this.isCustomWindow?{X:"center",Y:"center"}:{X:"left",Y:"bottom"}:this.enableRtl?{X:"left",Y:"bottom"}:{X:"right",Y:"bottom"},offsetX:this.isMobile||this.enableRtl?0:-e,offsetY:4,collision:this.isMobile?O.isUndefined(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)||this.isCustomWindow?{X:"fit",Y:"fit"}:{X:"fit"}:{X:"fit",Y:"flip"},targetType:this.isMobile&&this.isCustomWindow?"container":"relative",enableRtl:this.enableRtl,zIndex:this.zIndex,open:function(){t.isMobile&&t.fullScreenMode&&(t.iconRangeRight=t.calendarElement&&window.getComputedStyle(t.calendarElement.querySelector(".e-header.e-month .e-prev")).cssFloat,t.iconRangeRight)&&(t.touchRangeModule=new O.Touch(t.calendarElement.querySelector(".e-content.e-month"),{swipe:t.dateRangeSwipeHandler.bind(t)}),O.EventHandler.add(t.calendarElement.querySelector(".e-content.e-month"),"touchstart",t.touchStartRangeHandler,t)),O.attributes(t.inputElement,{"aria-expanded":"true","aria-owns":t.element.id,"aria-controls":t.inputElement.id}),t.value?O.attributes(t.inputElement,{"aria-activedescendant":t.inputElement.id}):t.inputElement.removeAttribute("aria-activedescendant"),O.addClass([t.inputWrapper.buttons[0]],g),t.isMobile||(t.cancelButton&&(t.btnKeyboardModule=new O.KeyboardEvents(t.cancelButton.element,{eventName:"keydown",keyAction:t.popupKeyActionHandle.bind(t),keyConfigs:{tab:"tab",altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}}),t.btnKeyboardModule=new O.KeyboardEvents(t.applyButton.element,{eventName:"keydown",keyAction:t.popupKeyActionHandle.bind(t),keyConfigs:{altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}})),O.isNullOrUndefined(t.leftCalendar)||t.isRangeIconClicked||t.calendarFocus(),O.isNullOrUndefined(t.presetElement)||(t.keyInputConfigs=O.extend(t.keyInputConfigs,t.keyConfigs),t.presetKeyboardModule=new O.KeyboardEvents(t.presetElement,{eventName:"keydown",keyAction:t.presetKeyActionHandler.bind(t),keyConfigs:t.keyInputConfigs}),t.presetKeyboardModule=new O.KeyboardEvents(t.presetElement,{eventName:"keydown",keyAction:t.popupKeyActionHandle.bind(t),keyConfigs:{altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}}),O.isNullOrUndefined(t.leftCalendar)?(t.preventBlur=!0,t.presetElement.focus()):t.presetElement.setAttribute("tabindex","-1")),t.popupKeyBoardHandler()),t.isMobile&&!O.Browser.isDevice&&O.EventHandler.add(document,"keydown",t.popupCloseHandler,t)},close:function(){O.attributes(t.inputElement,{"aria-expanded":"false"}),t.inputElement.removeAttribute("aria-owns"),t.inputElement.removeAttribute("aria-controls"),t.inputElement.removeAttribute("aria-activedescendant"),O.removeClass([t.inputWrapper.buttons[0]],g),t.isRangeIconClicked&&t.inputWrapper.container.children[1].focus(),O.isUndefined(t.presets[0].start&&t.presets[0].end&&t.presets[0].label)||t.unWireListEvents(),t.applyButton&&t.applyButton.destroy(),t.cancelButton&&t.cancelButton.destroy(),t.isMobile&&t.endButton&&t.endButton.destroy(),t.isMobile&&t.startButton&&t.startButton.destroy(),O.isNullOrUndefined(t.popupObj)||(O.isNullOrUndefined(t.popupObj.element.parentElement)||O.detach(t.popupObj.element),t.popupObj.destroy(),t.popupObj=null),t.isMobile&&!O.Browser.isDevice&&O.EventHandler.remove(document,"keydown",t.popupCloseHandler)},targetExitViewport:function(){var e=t.popupObj&&t.popupObj.element;!O.Browser.isDevice&&e&&e.getBoundingClientRect().height<window.innerHeight&&t.hide()}}),this.isMobile&&this.popupObj.element.classList.add(Ze),this.isMobile&&this.isCustomWindow&&(O.addClass([this.modal],[Ze,Ie,"e-range-modal"]),document.body.className+=" "+Je,this.modal.style.display="block"),O.EventHandler.add(document,"mousedown touchstart",this.documentHandler,this)},v.prototype.dateRangeSwipeHandler=function(e){var t=0;if("left"===this.iconRangeRight)switch(e.swipeDirection){case"Left":t=1;break;case"Right":t=-1}else switch(e.swipeDirection){case"Up":t=1;break;case"Down":t=-1}this.touchRangeStart&&(1===t?this.navigateNext(e):-1===t&&this.navigatePrevious(e),this.touchRangeStart=!1)},v.prototype.touchStartRangeHandler=function(e){this.touchRangeStart=!0},v.prototype.popupCloseHandler=function(e){27===e.keyCode&&this.hide(e)},v.prototype.calendarFocus=function(){var e,t=this.popupObj&&this.popupObj.element.querySelector("."+E);t?(e=O.closest(t,"."+D),e=O.isNullOrUndefined(e)?this.leftCalendar:e,(this.isRangeIconClicked?this.inputWrapper.container:(this.preventBlur=!0,e.children[1].firstElementChild)).focus(),O.addClass([t],ze)):(this.isRangeIconClicked?this.inputWrapper.container:(this.preventBlur=!0,this.leftCalendar.children[1].firstElementChild)).focus()},v.prototype.presetHeight=function(){var e=this.popupObj&&this.popupObj.element.querySelector("."+Ye),t=this.popupObj&&this.popupObj.element.querySelector("."+je);O.isNullOrUndefined(e)||O.isNullOrUndefined(t)||(e.style.height=t.getBoundingClientRect().height+"px")},v.prototype.presetKeyActionHandler=function(e){switch(e.action){case"moveDown":this.listMoveDown(e),this.setScrollPosition(),e.preventDefault();break;case"moveUp":this.listMoveUp(e),this.setScrollPosition(),e.preventDefault();break;case"enter":var t=this.getHoverLI(),i=this.getActiveLI();if(!O.isNullOrUndefined(this.leftCalendar)&&!O.isNullOrUndefined(i))if(O.isNullOrUndefined(t)||!O.isNullOrUndefined(i)&&i===t)if(this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(i),"custom_range"===this.presetsItem[this.activeIndex].id)return this.calendarFocus(),i.classList.remove(f),void e.preventDefault();O.isNullOrUndefined(t)&&O.isNullOrUndefined(i)||this.onMouseClick(e,t||i),e.preventDefault();break;case"tab":this.leftCalendar?(t=this.getHoverLI(),O.isNullOrUndefined(t)||t.classList.remove(f)):(this.hide(e),e.preventDefault())}},v.prototype.listMoveDown=function(e){var t,i=this.getHoverLI(),s=this.getActiveLI();O.isNullOrUndefined(i)?O.isNullOrUndefined(s)?O.addClass([this.liCollections[0]],f):(t=s.nextElementSibling,!O.isNullOrUndefined(t)&&t.classList.contains(Xe)&&O.addClass([t],f)):(t=i.nextElementSibling,!O.isNullOrUndefined(t)&&t.classList.contains(Xe)&&(O.removeClass([i],f),O.addClass([t],f)))},v.prototype.listMoveUp=function(e){var t,i=this.getHoverLI(),s=this.getActiveLI();O.isNullOrUndefined(i)?O.isNullOrUndefined(s)||(t=s.previousElementSibling,!O.isNullOrUndefined(t)&&t.classList.contains(Xe)&&O.addClass([t],f)):(t=i.previousElementSibling,!O.isNullOrUndefined(t)&&t.classList.contains(Xe)&&(O.removeClass([i],f),O.addClass([t],f)))},v.prototype.getHoverLI=function(){return this.presetElement.querySelector("."+f)},v.prototype.getActiveLI=function(){return this.presetElement.querySelector("."+g)},v.prototype.popupKeyBoardHandler=function(){this.popupKeyboardModule=new O.KeyboardEvents(this.popupWrapper,{eventName:"keydown",keyAction:this.popupKeyActionHandle.bind(this),keyConfigs:{escape:"escape"}}),this.keyInputConfigs=O.extend(this.keyInputConfigs,this.keyConfigs),this.popupKeyboardModule=new O.KeyboardEvents(this.inputWrapper.container.children[1],{eventName:"keydown",keyAction:this.popupKeyActionHandle.bind(this),keyConfigs:this.keyInputConfigs})},v.prototype.setScrollPosition=function(){var e,t,i=this.presetElement.getBoundingClientRect().height,s=this.presetElement.querySelector("."+f),a=this.presetElement.querySelector("."+g),a=O.isNullOrUndefined(s)?a:s;O.isNullOrUndefined(a)||(e=((s=a.nextElementSibling)||a).offsetTop,t=a.getBoundingClientRect().height,e+a.offsetTop>i?this.presetElement.scrollTop=s?e-(i/2+t/2):e:this.presetElement.scrollTop=0)},v.prototype.popupKeyActionHandle=function(e){var t=O.closest(e.target,"."+Ye);switch(e.action){case"escape":this.isPopupOpen()?(this.isKeyPopup&&(this.inputElement.focus(),this.isKeyPopup=!1),this.hide(e)):this.inputWrapper.container.children[1].blur();break;case"enter":this.isPopupOpen()?this.inputWrapper.container.children[1].focus():this.show(null,e);break;case"tab":this.hide(e);break;case"altRightArrow":(O.isNullOrUndefined(t)?document.activeElement===this.cancelButton.element&&!0!==this.applyButton.element.disabled?this.applyButton.element:this.leftCalendar.children[1].firstElementChild:this.cancelButton.element).focus(),e.preventDefault();break;case"altLeftArrow":(O.isNullOrUndefined(t)?document.activeElement===this.applyButton.element&&!0!==this.applyButton.element.disabled?this.cancelButton.element:O.isNullOrUndefined(this.presetElement)||document.activeElement!==this.cancelButton.element?this.rightCalendar.children[1].firstElementChild:this.presetElement:this.rightCalendar.children[1].firstElementChild).focus(),e.preventDefault()}},v.prototype.documentHandler=function(e){var t;O.isNullOrUndefined(this.popupObj)||(t=e.target,this.inputWrapper.container.contains(t)&&(O.isNullOrUndefined(this.popupObj)||O.closest(t,'[id="'+this.popupWrapper.id+'"]')||"mousedown"===e.type)||"touchstart"!==e.type&&("mousedown"===e.type||this.closeEventArgs&&!this.closeEventArgs.cancel)&&e.preventDefault(),!O.isNullOrUndefined(this.targetElement)&&(O.isNullOrUndefined(this.targetElement)||t===this.targetElement))||O.closest(t,'[id="'+this.popupWrapper.id+'"]')||O.closest(t,"."+Oe)===this.inputWrapper.container||O.closest(t,".e-daterangepicker.e-popup")&&!t.classList.contains("e-day")||t.classList.contains("e-dlg-overlay")||(this.preventBlur=!1,this.isPopupOpen()&&document.body.contains(this.popupObj.element)&&(this.applyFunction(e),this.isMobile||(this.isRangeIconClicked=!1)))},v.prototype.createInput=function(){this.fullScreenMode&&this.isMobile&&(this.cssClass+=" e-popup-expand");var e=this.cssClass;O.isNullOrUndefined(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),this.inputWrapper=u.Input.createInput({floatLabelType:this.floatLabelType,element:this.inputElement,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:e,enabled:this.enabled,enableRtl:this.enableRtl,showClearButton:this.showClearButton},buttons:["e-input-group-icon e-range-icon e-icons"]},this.createElement),O.attributes(this.inputElement,{tabindex:"0","aria-expanded":"false",role:"combobox",autocomplete:"off","aria-disabled":this.enabled?"false":"true",autocapitalize:"off",spellcheck:"false"}),O.Browser.isIos&&O.attributes(this.inputElement,{autocorrect:"off"}),u.Input.addAttributes({"aria-label":"select",role:"button"},this.inputWrapper.buttons[0]),this.setEleWidth(this.width),O.addClass([this.inputWrapper.container],"e-date-range-wrapper"),O.isNullOrUndefined(this.inputElement.getAttribute("name"))&&O.attributes(this.inputElement,{name:this.element.id}),"hidden"===this.inputElement.type&&(this.inputWrapper.container.style.display="none"),this.refreshControl(),this.previousEleValue=this.inputElement.value,this.inputElement.setAttribute("value",this.inputElement.value),this.startCopy=this.startDate,this.endCopy=this.endDate},v.prototype.setEleWidth=function(e){this.inputWrapper.container.style.width="string"==typeof e?this.width:"number"==typeof e?O.formatUnit(this.width):"100%",this.updateFloatLabelOverflowWidth()},v.prototype.adjustLongHeaderWidth=function(){"Wide"===this.dayHeaderFormat&&O.addClass([this.popupWrapper],"e-daterange-day-header-lg")},v.prototype.refreshControl=function(){this.validateMinMax(),this.strictMode&&this.validateRangeStrict();var e=this.disabledDates();this.strictMode&&e&&(this.startValue=this.previousStartValue,this.setProperties({startDate:this.startValue},!0),this.endValue=this.previousEndValue,this.setProperties({endDate:this.endValue},!0),this.setValue()),this.updateInput(),this.strictMode||this.validateRange(),!this.strictMode&&e&&this.clearRange(),O.isNullOrUndefined(this.endValue)||O.isNullOrUndefined(this.startValue)||e||O.isNullOrUndefined(this.renderDayCellArgs)||!this.renderDayCellArgs.isDisabled||this.disabledDateRender(),this.errorClass(),this.previousStartValue=O.isNullOrUndefined(this.startValue)||isNaN(+this.startValue)?null:new Date(+this.startValue),this.previousEndValue=O.isNullOrUndefined(this.endValue)||isNaN(+this.endValue)?null:new Date(+this.endValue)},v.prototype.updateInput=function(){var e,t;O.isNullOrUndefined(this.endValue)||O.isNullOrUndefined(this.startValue)||(t={format:this.formatString,type:"date",skeleton:"yMd"},e=this.globalize.formatDate(this.startValue,t),t=this.globalize.formatDate(this.endValue,t),u.Input.setValue(e+" "+this.separator+" "+t,this.inputElement,this.floatLabelType,this.showClearButton),this.previousStartValue=new Date(+this.startValue),this.previousEndValue=new Date(+this.endValue)),!this.strictMode&&O.isNullOrUndefined(this.value)&&this.invalidValueString&&u.Input.setValue(this.invalidValueString,this.inputElement,this.floatLabelType,this.showClearButton)},v.prototype.checkInvalidRange=function(e){var t,i,s,a,n,r,l,o,h,u;!O.isNullOrUndefined(e)&&(s=i=void 0,r=n=a=null,h=o=l=t=!1,"string"==typeof e?2===(u=e.split(" "+this.separator+" ")).length?(a=u[0],n=u[1]):(t=!0,r=e):(s=0<e.length?(i=e[0],e[1]):(i=e.start,e.end),i instanceof Date||"object"==typeof i?i instanceof Date?l=!0:O.isNullOrUndefined(i)||(h=!0):a=this.getstringvalue(i),s instanceof Date||"object"==typeof s?s instanceof Date?o=!0:O.isNullOrUndefined(s)||(h=!0):n=this.getstringvalue(s)),(O.isNullOrUndefined(a)&&!l&&!O.isNullOrUndefined(n)||!O.isNullOrUndefined(a)&&!o&&O.isNullOrUndefined(n))&&(t=!0),h&&(t=!(a=n=r=null)),a&&(t=t||this.checkInvalidValue(a)),t=n?t||this.checkInvalidValue(n):t)&&(l&&!h&&(a=i.toLocaleDateString()),o&&!h&&(n=s.toLocaleDateString()),O.isNullOrUndefined(a)||O.isNullOrUndefined(n)?O.isNullOrUndefined(a)?O.isNullOrUndefined(n)||(r=n):r=a:r=a+" "+this.separator+" "+n,this.invalidValueString=r,this.setProperties({value:null},!0),this.setProperties({startValue:null},!0),this.setProperties({endValue:null},!0),this.startDate=null,this.endDate=null)},v.prototype.getstringvalue=function(e){var t=null;return O.isNullOrUndefined(e)||"number"!=typeof e?O.isNullOrUndefined(e)||"string"!=typeof e||(t=""+e):t=e.toString(),t},v.prototype.checkInvalidValue=function(e){var t,i=!1,s={format:this.formatString,type:"date",skeleton:"yMd"};return i="string"==typeof e&&(t=new O.Internationalization(this.locale),this.checkDateValue(t.parseDate(e,s))||(t=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,(/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/.test(e)||t.test(e))&&!/^[a-zA-Z0-9- ]*$/.test(e)&&!isNaN(+new Date(this.checkValue(e)))))?i:!0},v.prototype.isDateDisabled=function(e){if(O.isNullOrUndefined(e))return!1;e=new Date(+e);if(+e<+this.min||+e>+this.max)return!0;this.virtualRenderCellArgs={date:e,isDisabled:!1};e=this.virtualRenderCellArgs;return this.virtualRenderCellEvent(e),!!e.isDisabled},v.prototype.disabledDateRender=function(){this.disabledDays=[],this.disabledDayCnt=null;for(var e=new Date(+this.startValue),t=0;+e<=+this.endValue&&+this.endValue<=+this.max;){this.virtualRenderCellArgs={date:e,isDisabled:!1};var i=this.virtualRenderCellArgs;this.virtualRenderCellEvent(i),i.isDisabled&&(this.disabledDays.push(new Date(+i.date)),+e>+this.startValue)&&+e<+this.endValue&&t++,this.addDay(e,1,null,this.max,this.min)}this.disabledDayCnt=t},v.prototype.virtualRenderCellEvent=function(e){O.extend(this.virtualRenderCellArgs,{name:"renderDayCell"}),this.trigger("renderDayCell",e)},v.prototype.disabledDates=function(){var e=!1,t=!1;return O.isNullOrUndefined(this.endValue)||O.isNullOrUndefined(this.startValue)||(e=this.isDateDisabled(this.startValue),t=this.isDateDisabled(this.endValue),this.isPopupOpen()||(this.currentDate=null),this.setValue()),e||t},v.prototype.setModelValue=function(){this.value||null!==this.startDate||null!==this.endDate?null===this.value||null===this.value.start?null===this.value?this.setProperties({value:[this.startDate,this.endDate]},!0):null===this.value.start&&this.setProperties({value:{start:this.startDate,end:this.endDate}},!0):this.value&&0<this.value.length||this.valueType&&0<this.valueType.length?(+this.startDate==+this.value[0]&&+this.endDate==+this.value[1]||this.setProperties({value:[this.startDate,this.endDate]},!0),this.value&&null==this.value[0]&&null==this.value[1]&&this.setProperties({value:null},!0)):this.value&&this.value.start&&this.setProperties({value:{start:this.startDate,end:this.endDate}},!0):this.setProperties({value:null},!0),this.createHiddenInput()},v.prototype.dispatchEvent=function(e,t){var i=document.createEvent("HTMLEvents");i.initEvent(t,!1,!0),e.dispatchEvent(i),this.firstHiddenChild.dispatchEvent(i)},v.prototype.changeTrigger=function(e){+this.initStartDate==+this.startValue&&+this.initEndDate==+this.endValue||(this.setProperties({endDate:this.checkDateValue(this.endValue)},!0),this.setProperties({startDate:this.checkDateValue(this.startValue)},!0),this.setModelValue(),this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",this.rangeArgs(e))),this.previousEleValue=this.inputElement.value,this.initStartDate=this.checkDateValue(this.startValue),this.initEndDate=this.checkDateValue(this.endValue)},v.prototype.navigateTo=function(e,t){if(this.isPopupOpen()){if("month"===e.toLowerCase())e="Month";else if("year"===e.toLowerCase())e="Year";else{if("decade"!==e.toLowerCase())return;e="Decade"}this.getViewNumber(e)<this.getViewNumber(this.depth)&&(e=this.depth),this.isMobile?M.prototype.navigateTo.call(this,e,t):(t<this.min?t=new Date(+this.min):t>=this.max&&(t=new Date(+this.max)),"Month"===e&&this.isSameMonth(t,this.max)?t=new Date(this.max.getFullYear(),this.max.getMonth()-1,this.min.getDate()):"Year"===e&&this.isSameYear(t,this.max)?t=new Date(this.max.getFullYear()-1,this.max.getMonth(),this.max.getDate()):"Decade"===e&&this.isSameDecade(t,this.max)&&(t=new Date(this.max.getFullYear()-10,this.max.getMonth(),this.max.getDate())),this.leftCalCurrentDate=t,this.navigate(this.leftCalendar,this.leftCalCurrentDate,e),t="Month"===e?new Date(this.currentDate.setMonth(this.currentDate.getMonth()+1)):"Year"===e?new Date(this.currentDate.setFullYear(this.currentDate.getFullYear()+1)):new Date(this.currentDate.setFullYear(this.currentDate.getFullYear()+10)),this.rightCalCurrentDate=t,this.navigate(this.rightCalendar,this.rightCalCurrentDate,e),this.leftKeyboardModule=this.rightKeyboardModule=null,this.updateNavIcons()),this.currentView()===this.depth&&this.bindCalendarCellEvents(),this.removeFocusedDate(),this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar])}},v.prototype.navigate=function(e,t,i){this.calendarElement=e,this.table=e.querySelector("table"),this.tableBodyElement=e.querySelector("tbody"),this.headerTitleElement=e.querySelector(".e-title"),this.tableHeadElement=e.querySelector("thead"),this.contentElement=e.querySelector(".e-content"),this.previousIcon=e.querySelector(".e-prev"),this.nextIcon=e.querySelector(".e-next"),this.effect="e-zoomin",M.prototype.navigateTo.call(this,i,t)},v.prototype.focusIn=function(){document.activeElement!==this.inputElement&&this.enabled&&(O.addClass([this.inputWrapper.container],[Se]),this.inputElement.focus())},v.prototype.focusOut=function(){var e=this.preventBlur;document.activeElement===this.inputElement&&(O.removeClass([this.inputWrapper.container],[Se]),this.preventBlur=!1,this.inputElement.blur(),this.preventBlur=e)},v.prototype.destroy=function(){this.unBindEvents(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),this.hide(null);var e={tabindex:"0","aria-expanded":"false",role:"combobox",autocomplete:"off","aria-disabled":this.enabled?"false":"true",autocorrect:"off",autocapitalize:"off","aria-invalid":"false",spellcheck:"false"};this.inputElement&&(O.removeClass([this.inputElement],[Ie]),O.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),u.Input.removeAttributes(e,this.inputElement),O.isNullOrUndefined(this.cloneElement.getAttribute("tabindex"))?this.inputElement.removeAttribute("tabindex"):this.inputElement.setAttribute("tabindex",this.tabIndex),this.ensureInputAttribute(),this.inputElement.classList.remove("e-input"),O.isNullOrUndefined(this.inputWrapper)||(O.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler),null===this.angularTag&&this.inputWrapper.container.parentElement.appendChild(this.inputElement),O.detach(this.inputWrapper.container))),O.isNullOrUndefined(this.inputKeyboardModule)||this.isMobile||this.inputKeyboardModule.destroy(),this.popupObj&&!this.isMobile&&this.clearCalendarEvents(),u.Input.destroy({element:this.inputElement,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),M.prototype.destroy.call(this),this.inputWrapper=this.popupWrapper=this.popupObj=this.cloneElement=this.presetElement=null,this.formElement&&O.EventHandler.remove(this.formElement,"reset",this.formResetHandler),O.isNullOrUndefined(this.firstHiddenChild)||O.isNullOrUndefined(this.secondHiddenChild)||(O.detach(this.firstHiddenChild),O.detach(this.secondHiddenChild),this.firstHiddenChild=this.secondHiddenChild=null,this.inputElement.setAttribute("name",this.element.getAttribute("data-name")),this.inputElement.removeAttribute("data-name")),this.closeEventArgs=null,this.leftCalendar=null,this.rightTitle=null,this.leftTitle=null,this.openEventArgs=null,this.leftCalNextIcon=null,this.rightCalendar=null,this.closeEventArgs=null,this.rightCalPrevIcon=null,this.leftCalPrevIcon=null,this.popupKeyboardModule=null,this.cancelButton=null,this.applyButton=null,this.calendarElement=null,this.leftKeyboardModule=null,this.rightCalNextIcon=null,this.leftCalNextIcon=null,this.btnKeyboardModule=null,this.rightKeyboardModule=null,this.leftKeyboardModule=null,this.presetKeyboardModule=null,this.liCollections=null,this.popupObj=null,this.popupWrapper=null},v.prototype.ensureInputAttribute=function(){for(var e=[],t=0;t<this.inputElement.attributes.length;t++)e[t]=this.inputElement.attributes[t].name;for(t=0;t<e.length;t++)O.isNullOrUndefined(this.cloneElement.getAttribute(e[t]))?("value"===e[t].toLowerCase()&&(this.inputElement.value=""),this.inputElement.removeAttribute(e[t])):("value"===e[t].toLowerCase()&&(this.inputElement.value=this.cloneElement.getAttribute(e[t])),this.inputElement.setAttribute(e[t],this.cloneElement.getAttribute(e[t])))},v.prototype.getModuleName=function(){return"daterangepicker"},v.prototype.updateFloatLabelOverflowWidth=function(){for(var e=this.inputWrapper.container,t=e.querySelector(".e-float-text.e-label-bottom"),i=0,s=e.querySelectorAll(".e-input-group-icon, .e-clear-icon"),a=0;a<s.length;a++)i+=s[a].offsetWidth;!t||!(e=this.element.parentElement.offsetWidth-i)||this.cssClass&&-1!==this.cssClass.split(" ").indexOf("e-outline")||(t.style.width=e+"px")},v.prototype.clearFloatLabelOverflowWidth=function(){var e=this.inputWrapper.container.querySelector(".e-float-text.e-label-top");e&&e.removeAttribute("style")},v.prototype.getPersistData=function(){return this.addOnPersist(["startDate","endDate","value"])},v.prototype.getSelectedRange=function(){var e;return O.isNullOrUndefined(this.startValue)||O.isNullOrUndefined(this.endValue)?e=0:(e=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1,!O.isNullOrUndefined(this.renderDayCellArgs)&&this.renderDayCellArgs.isDisabled&&this.disabledDateRender(),O.isNullOrUndefined(this.disabledDayCnt)||(e-=this.disabledDayCnt,this.disabledDayCnt=null)),{startDate:this.startValue,endDate:this.endValue,daySpan:e}},v.prototype.show=function(t,i){var e,s=this;this.isMobile&&this.popupObj&&this.popupObj.refreshPosition(),this.enabled&&this.readonly||!this.enabled||this.popupObj||this.isPopupOpen()||(t&&(this.targetElement=t),this.createPopup(),(this.isMobile||O.Browser.isDevice)&&(this.mobileRangePopupWrap=this.createElement("div",{className:"e-daterangepick-mob-popup-wrap"}),document.body.appendChild(this.mobileRangePopupWrap)),this.openEventArgs={popup:this.popupObj||null,cancel:!1,date:this.inputElement.value,model:this,event:i||null,appendTo:this.isMobile||O.Browser.isDevice?this.mobileRangePopupWrap:document.body},e=this.openEventArgs,this.trigger("open",e,function(e){s.openEventArgs=e,s.openEventArgs.cancel||(s.openEventArgs.appendTo.appendChild(s.popupWrapper),s.showPopup(t,i),e=!s.isCustomRange||s.isMobile&&s.isCustomRange,!O.isUndefined(s.presets[0].start&&s.presets[0].end&&s.presets[0].label)&&e&&s.setScrollPosition(),s.checkMinMaxDays(),s.isMobile&&!O.isNullOrUndefined(s.startDate)&&O.isNullOrUndefined(s.endDate)&&(s.endButton.element.classList.add(g),s.startButton.element.classList.remove(g),s.endButton.element.removeAttribute("disabled"),s.selectableDates()),M.prototype.setOverlayIndex.call(s,s.mobileRangePopupWrap,s.popupObj.element,s.modal,s.isMobile||O.Browser.isDevice),O.isNullOrUndefined(s.mobileRangePopupWrap)||O.isNullOrUndefined(s.popupObj)||O.isNullOrUndefined(s.popupObj.element)||!O.isNullOrUndefined(s.modal)||O.isUndefined(s.presets[0].start&&s.presets[0].end&&s.presets[0].label)||!e||!s.isMobile&&!O.Browser.isDevice||s.isCustomWindow||(e=parseInt(s.popupObj.element.style.zIndex,10)?parseInt(s.popupObj.element.style.zIndex,10):1e3,s.mobileRangePopupWrap.style.zIndex=e.toString()),O.Browser.isDevice&&((e=s.createElement("div",{className:"e-dlg-overlay"})).style.zIndex=(s.zIndex-1).toString(),s.mobileRangePopupWrap.appendChild(e)))}))},v.prototype.hide=function(e){var t=this;this.popupObj?(O.isNullOrUndefined(this.previousEndValue)&&O.isNullOrUndefined(this.previousStartValue)?this.clearRange():(O.isNullOrUndefined(this.previousStartValue)?(this.startValue=null,this.setValue()):(this.startValue=new Date(this.checkValue(this.previousStartValue)),this.setValue(),this.currentDate=new Date(this.checkValue(this.startValue))),O.isNullOrUndefined(this.previousEndValue)?this.endValue=null:this.endValue=new Date(this.checkValue(this.previousEndValue)),this.setValue()),this.isPopupOpen()&&(this.closeEventArgs={cancel:!1,popup:this.popupObj,date:this.inputElement.value,model:this,event:e||null},e=this.closeEventArgs,this.trigger("close",e,function(e){t.closeEventArgs=e,t.closeEventArgs.cancel?O.removeClass([t.inputWrapper.buttons[0]],g):(!t.isMobile||O.isNullOrUndefined(t.startButton)||O.isNullOrUndefined(t.endButton)||(O.EventHandler.remove(t.startButton.element,"click touchstart",t.deviceHeaderClick),O.EventHandler.remove(t.endButton.element,"click touchstart",t.deviceHeaderClick)),t.popupObj&&(t.popupObj.hide(),t.preventBlur)&&(t.inputElement.focus(),O.addClass([t.inputWrapper.container],[Se])),t.isMobile||(O.isNullOrUndefined(t.leftKeyboardModule)||O.isNullOrUndefined(t.rightKeyboardModule)||(t.leftKeyboardModule.destroy(),t.rightKeyboardModule.destroy()),O.isNullOrUndefined(t.presetElement)||t.presetKeyboardModule.destroy(),O.isNullOrUndefined(t.cancelButton))||t.btnKeyboardModule.destroy(),t.targetElement=null,O.removeClass([document.body],Je),O.EventHandler.remove(document,"mousedown touchstart",t.documentHandler),t.isMobile&&t.modal&&(t.modal.style.display="none",t.modal.outerHTML="",t.modal=null),!t.isMobile&&!O.Browser.isDevice||O.isNullOrUndefined(t.mobileRangePopupWrap)||(t.mobileRangePopupWrap.remove(),t.mobileRangePopupWrap=null),t.isKeyPopup=t.dateDisabled=!1),t.updateClearIconState(),t.updateHiddenInput(),t.isMobile&&t.allowEdit&&!t.readonly&&t.inputElement.removeAttribute("readonly")}))):(this.updateClearIconState(),this.updateHiddenInput(),this.isMobile&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"))},v.prototype.setLocale=function(){this.globalize=new O.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.dateRangeOptions&&null==this.dateRangeOptions.placeholder&&(this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),u.Input.setPlaceholder(this.placeholder,this.inputElement)),this.updateInput(),this.updateHiddenInput(),this.changeTrigger()},v.prototype.refreshChange=function(){this.checkView(),this.refreshControl(),this.changeTrigger()},v.prototype.setDate=function(){u.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.refreshChange()},v.prototype.enableInput=function(){+this.min<=+this.max&&(this.setProperties({enabled:!0},!0),u.Input.setEnabled(this.enabled,this.inputElement),this.element.hasAttribute("disabled"))&&this.bindEvents()},v.prototype.clearModelvalue=function(e,t){this.setProperties({startDate:null},!0),this.setProperties({endDate:null},!0),t.value&&0<t.value.length?this.setProperties({value:null},!0):(t.value&&t.value.start||t.value&&!t.value.start)&&this.setProperties({value:{start:null,end:null}},!0),this.updateValue(),this.setDate()},v.prototype.createHiddenInput=function(){O.isNullOrUndefined(this.firstHiddenChild)&&O.isNullOrUndefined(this.secondHiddenChild)&&(this.firstHiddenChild=this.createElement("input"),this.secondHiddenChild=this.createElement("input")),O.isNullOrUndefined(this.inputElement.getAttribute("name"))||(this.inputElement.setAttribute("data-name",this.inputElement.getAttribute("name")),this.inputElement.removeAttribute("name")),O.attributes(this.firstHiddenChild,{type:"text",name:this.inputElement.getAttribute("data-name"),class:Qe}),O.attributes(this.secondHiddenChild,{type:"text",name:this.inputElement.getAttribute("data-name"),class:Qe});var e={format:this.formatString,type:"datetime",skeleton:"yMd"};this.firstHiddenChild.value=this.startDate&&this.globalize.formatDate(this.startDate,e),this.secondHiddenChild.value=this.endDate&&this.globalize.formatDate(this.endDate,e),this.inputElement.parentElement.appendChild(this.firstHiddenChild),this.inputElement.parentElement.appendChild(this.secondHiddenChild)},v.prototype.setMinMaxDays=function(){this.isPopupOpen()&&(this.removeClassDisabled(),this.checkMinMaxDays(),this.isMobile&&this.selectableDates(),!this.strictMode&&O.isNullOrUndefined(this.startValue)&&O.isNullOrUndefined(this.endValue)?this.removeSelection():this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar]),this.updateHeader())},v.prototype.getAmPmValue=function(e){try{return"string"==typeof e&&""!==e.trim()?e.replace(/(am|pm|Am|aM|pM|Pm)/g,function(e){return e.toLocaleUpperCase()}):""}catch(e){return console.error("Error occurred while processing date:",e),""}},v.prototype.getStartEndValue=function(e,t){return"Month"===this.depth?this.checkDateValue(new Date(this.checkValue(e))):"Year"===this.depth?new Date(e.getFullYear(),e.getMonth()+(t?1:0),t?0:1):new Date(e.getFullYear(),t?11:0,t?31:1)},v.prototype.onPropertyChanged=function(e,t){for(var i={format:this.formatString,type:"date",skeleton:"yMd"},s=!1,a=0,n=Object.keys(e);a<n.length;a++){var r=n[a];switch(0<["blur","change","cleared","close","created","destroyed","focus","navigated","open","renderDayCell","select"].indexOf(r)&&this.isReact&&(s=!0),r){case"width":this.setEleWidth(this.width),u.Input.calculateWidth(this.inputElement,this.inputWrapper.container),O.isNullOrUndefined(this.inputWrapper.buttons[0])||O.isNullOrUndefined(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon");break;case"separator":this.previousEleValue=this.inputElement.value,this.setProperties({separator:e.separator},!0),this.updateInput(),this.changeTrigger();break;case"placeholder":u.Input.setPlaceholder(e.placeholder,this.inputElement),this.setProperties({placeholder:e.placeholder},!0);break;case"readonly":u.Input.setReadonly(this.readonly,this.inputElement),this.setRangeAllowEdit();break;case"cssClass":this.updateCssClass(e.cssClass,t.cssClass);break;case"enabled":this.setProperties({enabled:e.enabled},!0),u.Input.setEnabled(this.enabled,this.inputElement),this.enabled?this.inputElement.setAttribute("tabindex",this.tabIndex):this.inputElement.tabIndex=-1;break;case"allowEdit":this.setRangeAllowEdit();break;case"enableRtl":this.setProperties({enableRtl:e.enableRtl},!0),u.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]);break;case"zIndex":this.setProperties({zIndex:e.zIndex},!0);break;case"format":this.setProperties({format:e.format},!0),this.checkFormat(),this.updateInput(),this.changeTrigger();break;case"inputFormats":this.checkInputFormats();break;case"locale":this.globalize=new O.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.dateRangeOptions&&null==this.dateRangeOptions.placeholder&&(this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),u.Input.setPlaceholder(this.placeholder,this.inputElement)),this.setLocale();break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.setDataAttribute(!0),this.checkHtmlAttributes(!0);break;case"showClearButton":u.Input.setClearButton(this.showClearButton,this.inputElement,this.inputWrapper),this.bindClearEvent();break;case"startDate":"string"==typeof e.startDate&&(e.startDate=this.globalize.parseDate(this.getAmPmValue(e.startDate),i)),+this.initStartDate!=+e.startDate&&(this.startValue=this.getStartEndValue(e.startDate,!1),this.setDate(),this.setValue());break;case"endDate":"string"==typeof e.endDate&&(e.endDate=this.globalize.parseDate(this.getAmPmValue(e.endDate),i)),+this.initEndDate!=+e.endDate&&(this.endValue=this.getStartEndValue(e.endDate,!0),this.setDate(),this.setValue());break;case"value":var l,s=!0;if(this.invalidValueString=null,this.checkInvalidRange(e.value),"string"==typeof e.value?this.invalidValueString?this.clearModelvalue(e,t):(l=e.value.split(" "+this.separator+" "),this.value=[new Date(l[0]),new Date(l[1])],this.updateValue(),this.setDate()):!O.isNullOrUndefined(e.value)&&0<e.value.length||!O.isNullOrUndefined(e.value)&&e.value.start?(this.valueType=e.value,null===e.value[0]||null===e.value.start?1!==e.value.length&&!e.value.start&&null!==e.value[1]&&null!==e.value.start||this.clearModelvalue(e,t):+this.initStartDate==+e.value[0]&&+this.initEndDate==+e.value[1]&&+this.initStartDate==+(e.value.start||+this.initEndDate!=+e.value.start)||(1!==e.value.length&&!e.value.start||(this.modelValue=e.value),this.updateValue(),this.setDate())):!O.isNullOrUndefined(this.value)&&null!=e.value.start||(this.valueType=e.value,this.startValue=null,this.endValue=null,this.clearModelvalue(e,t)),this.isPopupOpen()){if(O.isNullOrUndefined(this.startValue)&&O.isNullOrUndefined(this.endValue))return this.removeSelection(),void(this.isMobile&&this.deviceHeaderUpdate());this.isMobile?(this.navigate(this.deviceCalendar,this.startValue,this.currentView()),this.deviceHeaderUpdate()):(this.navigate(this.leftCalendar,this.startValue,this.currentView()),this.updateControl(this.leftCalendar),this.navigate(this.rightCalendar,this.endValue,this.currentView()),this.updateControl(this.rightCalendar)),this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar]),this.updateHeader(),this.applyButton.disabled=this.applyButton.element.disabled=!1}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange;break;case"minDays":this.setProperties({minDays:e.minDays},s=!0),this.refreshChange(),this.setMinMaxDays();break;case"maxDays":this.setProperties({maxDays:e.maxDays},s=!0),this.refreshChange(),this.setMinMaxDays();break;case"min":this.setProperties({min:this.checkDateValue(new Date(this.checkValue(e.min)))},!0),this.previousEleValue=this.inputElement.value,this.enableInput(),this.refreshChange();break;case"max":this.setProperties({max:this.checkDateValue(new Date(this.checkValue(e.max)))},!0),this.enableInput(),this.refreshChange();break;case"strictMode":this.invalidValueString=null,this.setProperties({strictMode:e.strictMode},!0),this.refreshChange();break;case"presets":this.setProperties({presets:e.presets},!0),this.processPresets();break;case"floatLabelType":this.floatLabelType=e.floatLabelType,u.Input.removeFloating(this.inputWrapper),u.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder),O.isNullOrUndefined(this.inputWrapper.buttons[0])||O.isNullOrUndefined(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon");break;case"start":this.setProperties({start:e.start},!0),this.refreshChange();break;case"depth":this.setProperties({depth:e.depth},!0),this.refreshChange()}s||this.hide(null)}},h([O.Property(null)],v.prototype,"value",void 0),h([O.Property(!1)],v.prototype,"enablePersistence",void 0),h([O.Property(new Date(1900,0,1))],v.prototype,"min",void 0),h([O.Property(new Date(2099,11,31))],v.prototype,"max",void 0),h([O.Property(null)],v.prototype,"locale",void 0),h([O.Property(null)],v.prototype,"firstDayOfWeek",void 0),h([O.Property(!1)],v.prototype,"weekNumber",void 0),h([O.Property("Gregorian")],v.prototype,"calendarMode",void 0),h([O.Property(!1)],v.prototype,"openOnFocus",void 0),h([O.Property(!1)],v.prototype,"fullScreenMode",void 0),h([O.Event()],v.prototype,"created",void 0),h([O.Event()],v.prototype,"destroyed",void 0),h([O.Event()],v.prototype,"change",void 0),h([O.Event()],v.prototype,"cleared",void 0),h([O.Event()],v.prototype,"navigated",void 0),h([O.Event()],v.prototype,"renderDayCell",void 0),h([O.Property(null)],v.prototype,"startDate",void 0),h([O.Property(null)],v.prototype,"endDate",void 0),h([O.Collection([{}],tt)],v.prototype,"presets",void 0),h([O.Property("")],v.prototype,"width",void 0),h([O.Property(1e3)],v.prototype,"zIndex",void 0),h([O.Property(!0)],v.prototype,"showClearButton",void 0),h([O.Property(!0)],v.prototype,"showTodayButton",void 0),h([O.Property("Month")],v.prototype,"start",void 0),h([O.Property("Month")],v.prototype,"depth",void 0),h([O.Property("")],v.prototype,"cssClass",void 0),h([O.Property("-")],v.prototype,"separator",void 0),h([O.Property(null)],v.prototype,"minDays",void 0),h([O.Property(null)],v.prototype,"maxDays",void 0),h([O.Property(!1)],v.prototype,"strictMode",void 0),h([O.Property(null)],v.prototype,"keyConfigs",void 0),h([O.Property(null)],v.prototype,"format",void 0),h([O.Property(null)],v.prototype,"inputFormats",void 0),h([O.Property(!0)],v.prototype,"enabled",void 0),h([O.Property(!1)],v.prototype,"readonly",void 0),h([O.Property(!0)],v.prototype,"allowEdit",void 0),h([O.Property("Never")],v.prototype,"floatLabelType",void 0),h([O.Property(null)],v.prototype,"placeholder",void 0),h([O.Property({})],v.prototype,"htmlAttributes",void 0),h([O.Event()],v.prototype,"open",void 0),h([O.Event()],v.prototype,"close",void 0),h([O.Event()],v.prototype,"select",void 0),h([O.Event()],v.prototype,"focus",void 0),h([O.Event()],v.prototype,"blur",void 0);var M,Ve=h([O.NotifyPropertyChanges],v);function v(e,t){t=M.call(this,e,t)||this;return t.isCustomRange=!1,t.isCustomWindow=!1,t.presetsItem=[],t.liCollections=[],t.previousEleValue="",t.isKeyPopup=!1,t.dateDisabled=!1,t.isRangeIconClicked=!1,t.isMaxDaysClicked=!1,t.disabledDays=[],t.preventBlur=!1,t.preventFocus=!1,t.invalidValueString=null,t.preventChange=!1,t.dateRangeOptions=e,t}st=function(e,t){return(st=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)};var st,at,h=function(e,t){function i(){this.constructor=e}st(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},V=function(e,t,i,s){var a,n=arguments.length,r=n<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;0<=l;l--)(a=e[l])&&(r=(n<3?a(r):3<n?a(t,i,r):a(t,i))||r);return 3<n&&r&&Object.defineProperty(t,i,r),r},nt="e-error",rt=(new Date).getDate(),lt=(new Date).getMonth(),ot=(new Date).getFullYear(),ht="e-timepicker",ut="e-active",dt="e-hover",pt="e-navigation",ct="e-disabled",mt="e-input-focus",ft="e-list-item",vt="e-time-overflow",gt="e-non-edit",yt=["title","class","style"],bt=((i.TimePickerBase||(i.TimePickerBase={})).createListItems=function(e,t,i,s,a,n){this.calendarMode;for(var r=6e4*n,l=[],o=[],h=+t.setMilliseconds(0),u=+i.setMilliseconds(0);h<=u;)o.push(h),l.push(s.formatDate(new Date(h),{format:a,type:"time"})),h+=r;return{collection:o,list:F.ListBase.createList(e,l,null,!0)}},at=O.ChildProperty,h(Dt,at),V([O.Property("day")],Dt.prototype,"day",void 0),V([O.Property("month")],Dt.prototype,"month",void 0),V([O.Property("year")],Dt.prototype,"year",void 0),V([O.Property("day of the week")],Dt.prototype,"dayOfTheWeek",void 0),V([O.Property("hour")],Dt.prototype,"hour",void 0),V([O.Property("minute")],Dt.prototype,"minute",void 0),V([O.Property("second")],Dt.prototype,"second",void 0),Dt);function Dt(){return null!==at&&at.apply(this,arguments)||this}Et=O.Component,h(x,Et),x.prototype.preRender=function(){this.keyConfigure={enter:"enter",escape:"escape",end:"end",tab:"tab",home:"home",down:"downarrow",up:"uparrow",left:"leftarrow",right:"rightarrow",open:"alt+downarrow",close:"alt+uparrow"},this.cloneElement=this.element.cloneNode(!0),O.removeClass([this.cloneElement],[ht,"e-control","e-lib"]),this.inputElement=this.element,this.angularTag=null,this.formElement=O.closest(this.element,"form"),"EJS-TIMEPICKER"===this.element.tagName&&(this.angularTag=this.element.tagName,this.inputElement=this.createElement("input"),this.element.appendChild(this.inputElement)),this.openPopupEventArgs={appendTo:document.body}},x.prototype.render=function(){this.initialize(),this.createInputElement(),this.updateHtmlAttributeToWrapper(),this.setTimeAllowEdit(),this.setEnable(),this.validateInterval(),this.bindEvents(),this.validateDisable(),this.setTimeZone(),this.setValue(this.getFormattedValue(this.value)),!this.enableMask||this.value||!this.maskedDateValue||"Always"!==this.floatLabelType&&this.floatLabelType&&this.placeholder||(this.updateInputValue(this.maskedDateValue),this.checkErrorState(this.maskedDateValue)),this.anchor=this.inputElement,this.inputElement.setAttribute("value",this.inputElement.value),this.inputEleValue=this.getDateObject(this.inputElement.value),O.isNullOrUndefined(this.inputWrapper.buttons[0])||O.isNullOrUndefined(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon"),!O.isNullOrUndefined(O.closest(this.element,"fieldset"))&&O.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete()},x.prototype.setTimeZone=function(){var e;!O.isNullOrUndefined(this.serverTimezoneOffset)&&this.value&&(e=(new Date).getTimezoneOffset()/60,e=this.serverTimezoneOffset+e,e=this.isDayLightSaving()?e--:e,this.value=new Date(this.value.getTime()+60*e*60*1e3))},x.prototype.isDayLightSaving=function(){var e=new Date(this.value.getFullYear(),0,1).getTimezoneOffset(),t=new Date(this.value.getFullYear(),6,1).getTimezoneOffset();return this.value.getTimezoneOffset()<Math.max(e,t)},x.prototype.setTimeAllowEdit=function(){this.allowEdit?this.readonly||this.inputElement.removeAttribute("readonly"):O.attributes(this.inputElement,{readonly:""}),this.clearIconState()},x.prototype.clearIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&O.removeClass([this.inputWrapper.container],[gt]):""===this.inputElement.value?O.removeClass([this.inputWrapper.container],[gt]):O.addClass([this.inputWrapper.container],[gt])},x.prototype.validateDisable=function(){this.setMinMax(this.initMin,this.initMax),O.isNullOrUndefined(this.value)||(this.popupCreation(),this.popupObj.destroy(),this.popupWrapper=this.popupObj=null),isNaN(+this.value)||null===this.value||this.valueIsDisable(this.value)||(this.strictMode&&this.resetState(),this.initValue=null,this.initMax=this.getDateObject(this.initMax),this.initMin=this.getDateObject(this.initMin),this.timeCollections=this.liCollections=[],this.setMinMax(this.initMin,this.initMax))},x.prototype.validationAttribute=function(e,t){for(var i,s=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id"),a=(t.setAttribute("name",s),e.removeAttribute("name"),["required","aria-required","form"]),n=0;n<a.length;n++)O.isNullOrUndefined(e.getAttribute(a[n]))||(i=e.getAttribute(a[n]),t.setAttribute(a[n],i),e.removeAttribute(a[n]))},x.prototype.initialize=function(){this.globalize=new O.Internationalization(this.locale),this.defaultCulture=new O.Internationalization("en"),this.checkTimeFormat(),this.checkInvalidValue(this.value),this.setProperties({value:this.checkDateValue(new Date(this.checkInValue(this.value)))},!0),this.setProperties({min:this.checkDateValue(new Date(this.checkInValue(this.min)))},!0),this.setProperties({max:this.checkDateValue(new Date(this.checkInValue(this.max)))},!0),this.setProperties({scrollTo:this.checkDateValue(new Date(this.checkInValue(this.scrollTo)))},!0),null!==this.angularTag&&this.validationAttribute(this.element,this.inputElement),this.updateHtmlAttributeToElement(),this.checkAttributes(!1);var e={placeholder:this.placeholder};this.l10n=new O.L10n("timepicker",e,this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),(null!==this.angularTag?(this.tabIndex=this.inputElement.hasAttribute("tabindex")?this.inputElement.getAttribute("tabindex"):"0",this.inputElement):(this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element)).removeAttribute("tabindex"),this.initValue=this.checkDateValue(this.value),this.initMin=this.checkDateValue(this.min),this.initMax=this.checkDateValue(this.max),this.isNavigate=this.isPreventBlur=this.isTextSelected=!1,this.activeIndex=this.valueWithMinutes=this.prevDate=null,O.isNullOrUndefined(this.element.getAttribute("id"))?(this.element.id=O.getUniqueID("ej2_timepicker"),null!==this.angularTag&&O.attributes(this.inputElement,{id:this.element.id+"_input"})):null!==this.angularTag&&(this.inputElement.id=this.element.getAttribute("id")+"_input"),O.isNullOrUndefined(this.inputElement.getAttribute("name"))&&O.attributes(this.inputElement,{name:this.element.id}),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"})},x.prototype.checkTimeFormat=function(){var e;this.format?"string"==typeof this.format?this.formatString=this.format:O.isNullOrUndefined(this.format.skeleton)||""===this.format.skeleton?this.formatString=this.globalize.getDatePattern({type:"time",skeleton:"short"}):(e=this.format.skeleton,this.formatString=this.globalize.getDatePattern({type:"time",skeleton:e})):this.formatString=null},x.prototype.checkDateValue=function(e){return!O.isNullOrUndefined(e)&&e instanceof Date&&!isNaN(+e)?e:null},x.prototype.createInputElement=function(){this.fullScreenMode&&O.Browser.isDevice&&(this.cssClass+=" e-popup-expand");var e=this.cssClass,t=!this.enableMask;O.isNullOrUndefined(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),this.inputWrapper=u.Input.createInput({element:this.inputElement,bindClearAction:t,floatLabelType:this.floatLabelType,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:e,enabled:this.enabled,enableRtl:this.enableRtl,showClearButton:this.showClearButton},buttons:[" e-input-group-icon e-time-icon e-icons"]},this.createElement),this.inputWrapper.container.style.width=this.setWidth(this.width),this.updateFloatLabelOverflowWidth(),O.attributes(this.inputElement,{"aria-autocomplete":"list",tabindex:"0","aria-expanded":"false",role:"combobox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-disabled":"false","aria-invalid":"false"}),this.isNullOrEmpty(this.inputStyle)||u.Input.addAttributes({style:this.inputStyle},this.inputElement),O.addClass([this.inputWrapper.container],"e-time-wrapper")},x.prototype.getCldrDateTimeFormat=function(){var e=new O.Internationalization(this.locale).getDatePattern({skeleton:"yMd"}),e=this.isNullOrEmpty(this.formatString)?e+" "+this.cldrFormat("time"):this.formatString;return e},x.prototype.checkInvalidValue=function(e){var t,i,s,a=!1;"object"==typeof e||O.isNullOrUndefined(e)||("string"==typeof(t=e)&&(t=t.trim()),s=i=null,"number"==typeof e?t=e.toString():"string"!=typeof e||/^[a-zA-Z0-9- ]*$/.test(e)||(i=this.setCurrentDate(this.getDateObject(e)),O.isNullOrUndefined(i)&&(i=this.checkDateValue(this.globalize.parseDate(this.getAmPmValue(t),{format:this.getCldrDateTimeFormat(),type:"datetime"})),O.isNullOrUndefined(i))&&(i=this.checkDateValue(this.globalize.parseDate(this.getAmPmValue(t),{format:this.formatString,type:"dateTime",skeleton:"yMd"})))),s=this.globalize.parseDate(this.getAmPmValue(t),{format:this.getCldrDateTimeFormat(),type:"datetime"}),i=!O.isNullOrUndefined(s)&&s instanceof Date&&!isNaN(+s)?s:null,O.isNullOrUndefined(i)&&t.replace(/\s/g,"").length&&(s=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,!/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/.test(t)&&!s.test(t)||/^[a-zA-Z0-9- ]*$/.test(e)||isNaN(+new Date(""+t))?a=!0:i=new Date(""+t)),a?(this.strictMode||(this.invalidValueString=t),this.setProperties({value:null},!0),this.initValue=null):(this.setProperties({value:i},!0),this.initValue=this.value))},x.prototype.requiredModules=function(){var e=[];return this.enableMask&&e.push({args:[this],member:"MaskedDateTime"}),e},x.prototype.getAmPmValue=function(e){try{return"string"==typeof e&&""!==e.trim()?e.replace(/(am|pm|Am|aM|pM|Pm)/g,function(e){return e.toLocaleUpperCase()}):""}catch(e){return console.error("Error occurred while processing date:",e),""}},x.prototype.cldrFormat=function(e){var t="en"===this.locale||"en-US"===this.locale?O.getValue("timeFormats.short",O.getDefaultDateObject()):this.getCultureTimeObject(O.cldrData,""+this.locale);return t},x.prototype.destroy=function(){this.hide(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),this.unBindEvents();this.inputElement&&(u.Input.removeAttributes({"aria-autocomplete":"list",tabindex:"0","aria-expanded":"false",role:"combobox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-disabled":"true","aria-invalid":"false"},this.inputElement),null===this.angularTag&&this.inputWrapper.container.parentElement.appendChild(this.inputElement),O.isNullOrUndefined(this.cloneElement.getAttribute("tabindex"))?this.inputElement.removeAttribute("tabindex"):this.inputElement.setAttribute("tabindex",this.tabIndex),this.ensureInputAttribute(),this.enableElement([this.inputElement]),this.inputElement.classList.remove("e-input"),O.isNullOrUndefined(this.cloneElement.getAttribute("disabled")))&&u.Input.setEnabled(!0,this.inputElement,this.floatLabelType),this.inputWrapper.container&&O.detach(this.inputWrapper.container),this.inputWrapper=this.popupWrapper=this.cloneElement=void 0,this.liCollections=this.timeCollections=this.disableItemCollection=[],O.isNullOrUndefined(this.rippleFn)||this.rippleFn(),u.Input.destroy({element:this.inputElement,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),Et.prototype.destroy.call(this),this.formElement&&O.EventHandler.remove(this.formElement,"reset",this.formResetHandler),this.rippleFn=null,this.openPopupEventArgs=null,this.selectedElement=null,this.listTag=null,this.liCollections=null},x.prototype.ensureInputAttribute=function(){for(var e=[],t=0;t<this.inputElement.attributes.length;t++)e[t]=this.inputElement.attributes[t].name;for(t=0;t<e.length;t++)O.isNullOrUndefined(this.cloneElement.getAttribute(e[t]))?(this.inputElement.removeAttribute(e[t]),"value"===e[t].toLowerCase()&&(this.inputElement.value="")):(this.inputElement.setAttribute(e[t],this.cloneElement.getAttribute(e[t])),"value"===e[t].toLowerCase()&&(this.inputElement.value=this.cloneElement.getAttribute(e[t])))},x.prototype.popupCreation=function(){this.popupWrapper=this.createElement("div",{className:ht+" e-popup",attrs:{id:this.element.id+"_popup"}}),this.popupWrapper.style.visibility="hidden",this.popupWrapper.setAttribute("aria-label",this.element.id),this.popupWrapper.setAttribute("role","dialog"),O.isNullOrUndefined(this.cssClass)||(this.popupWrapper.className+=" "+this.cssClass),!O.isNullOrUndefined(this.step)&&0<this.step&&(this.generateList(),O.append([this.listWrapper],this.popupWrapper)),this.addSelection(),this.renderPopup(),O.detach(this.popupWrapper)},x.prototype.getPopupHeight=function(){var e=parseInt("240px",10),t=this.popupWrapper.getBoundingClientRect().height;return e<t?e:t},x.prototype.generateList=function(){this.createListItems(),this.wireListEvents(),this.rippleFn=O.rippleEffect(this.listWrapper,{duration:300,selector:"."+ft}),this.liCollections=this.listWrapper.querySelectorAll("."+ft)},x.prototype.renderPopup=function(){var e,t,i,s=this;this.containerStyle=this.inputWrapper.container.getBoundingClientRect(),this.popupObj=new H.Popup(this.popupWrapper,{width:this.setPopupWidth(this.width),zIndex:this.zIndex,targetType:"relative",position:O.Browser.isDevice?{X:"center",Y:"center"}:{X:"left",Y:"bottom"},collision:O.Browser.isDevice?{X:"fit",Y:"fit"}:{X:"flip",Y:"flip"},enableRtl:this.enableRtl,relateTo:O.Browser.isDevice?document.body:this.inputWrapper.container,offsetY:4,open:function(){s.popupWrapper.style.visibility="visible",O.addClass([s.inputWrapper.buttons[0]],ut)},close:function(){O.removeClass([s.inputWrapper.buttons[0]],ut),s.unWireListEvents(),s.inputElement.removeAttribute("aria-activedescendant"),O.remove(s.popupObj.element),s.popupObj.destroy(),s.popupWrapper.innerHTML="",s.listWrapper=s.popupWrapper=s.listTag=void 0},targetExitViewport:function(){O.Browser.isDevice||s.hide()}}),O.Browser.isDevice||(this.popupObj.collision={X:"none",Y:"flip"}),O.Browser.isDevice&&this.fullScreenMode?(this.popupObj.element.style.maxHeight="100%",this.popupObj.element.style.width="100%"):this.popupObj.element.style.maxHeight="240px",O.Browser.isDevice&&this.fullScreenMode&&(e=this.createElement("div",{className:"e-model-header"}),(t=this.createElement("span",{className:"e-model-title"})).textContent="Select time",i=this.createElement("span",{className:"e-popup-close"}),O.EventHandler.add(i,"mousedown touchstart",this.timePopupCloseHandler,this),e.appendChild(i),e.appendChild(t),this.popupWrapper.insertBefore(e,this.popupWrapper.firstElementChild))},x.prototype.timePopupCloseHandler=function(e){this.hide()},x.prototype.getFormattedValue=function(e){return O.isNullOrUndefined(this.checkDateValue(e))?null:this.globalize.formatDate(e,{skeleton:"medium",type:"time"})},x.prototype.getDateObject=function(e){if(!this.isNullOrEmpty(e)){var t,i,e=this.createDateObj(e),s=!this.isNullOrEmpty(this.initValue);if(this.checkDateValue(e))return t=s?this.initValue.getDate():rt,i=s?this.initValue.getMonth():lt,s=s?this.initValue.getFullYear():ot,new Date(s,i,t,e.getHours(),e.getMinutes(),e.getSeconds())}return null},x.prototype.updateHtmlAttributeToWrapper=function(){if(!O.isNullOrUndefined(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i,s=t[e];-1<yt.indexOf(s)&&("class"===s?""!==(i=this.htmlAttributes[""+s].replace(/\s+/g," ").trim())&&O.addClass([this.inputWrapper.container],i.split(" ")):"style"===s?(i=this.inputWrapper.container.getAttribute(s),i=O.isNullOrUndefined(i)?this.htmlAttributes[""+s]:i+this.htmlAttributes[""+s],this.inputWrapper.container.setAttribute(s,i)):this.inputWrapper.container.setAttribute(s,this.htmlAttributes[""+s]))}},x.prototype.updateHtmlAttributeToElement=function(){if(!O.isNullOrUndefined(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i=t[e];yt.indexOf(i)<0&&this.inputElement.setAttribute(i,this.htmlAttributes[""+i])}},x.prototype.updateCssClass=function(e,t){O.isNullOrUndefined(t)||(t=t.replace(/\s+/g," ").trim()),O.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),u.Input.setCssClass(e,[this.inputWrapper.container],t),this.popupWrapper&&u.Input.setCssClass(e,[this.popupWrapper],t)},x.prototype.removeErrorClass=function(){O.removeClass([this.inputWrapper.container],nt),O.attributes(this.inputElement,{"aria-invalid":"false"})},x.prototype.checkErrorState=function(e){e=this.getDateObject(e);this.validateState(e)&&!this.invalidValueString||this.enableMask&&this.inputElement.value===this.maskedDateValue?this.removeErrorClass():(O.addClass([this.inputWrapper.container],nt),O.attributes(this.inputElement,{"aria-invalid":"true"}))},x.prototype.validateInterval=function(){!O.isNullOrUndefined(this.step)&&0<this.step?this.enableElement([this.inputWrapper.buttons[0]]):this.disableTimeIcon()},x.prototype.disableTimeIcon=function(){this.disableElement([this.inputWrapper.buttons[0]]),this.hide()},x.prototype.disableElement=function(e){O.addClass(e,ct)},x.prototype.enableElement=function(e){O.removeClass(e,ct)},x.prototype.selectInputText=function(){this.inputElement.setSelectionRange(0,this.inputElement.value.length)},x.prototype.setCursorToEnd=function(){this.inputElement.setSelectionRange(this.inputElement.value.length,this.inputElement.value.length)},x.prototype.getMeridianText=function(){return"en"===this.locale||"en-US"===this.locale?O.getValue("dayPeriods.format.wide",O.getDefaultDateObject()):O.getValue("main."+this.locale+".dates.calendars.gregorian.dayPeriods.format.abbreviated",O.cldrData)},x.prototype.getCursorSelection=function(){var e=this.inputElement,t=0,i=0;return isNaN(e.selectionStart)||(t=e.selectionStart,i=e.selectionEnd),{start:Math.abs(t),end:Math.abs(i)}},x.prototype.getActiveElement=function(){return O.isNullOrUndefined(this.popupWrapper)?null:this.popupWrapper.querySelectorAll("."+ut)},x.prototype.isNullOrEmpty=function(e){return!!(O.isNullOrUndefined(e)||"string"==typeof e&&""===e.trim())},x.prototype.setWidth=function(e){return e="number"==typeof e?O.formatUnit(e):"string"==typeof e?e.match(/px|%|em/)?e:O.formatUnit(e):"100%"},x.prototype.setPopupWidth=function(e){return e=-1<(e=this.setWidth(e)).indexOf("%")?(this.containerStyle.width*parseFloat(e)/100).toString()+"px":e},x.prototype.setScrollPosition=function(){var e=this.selectedElement;O.isNullOrUndefined(e)?this.popupWrapper&&this.checkDateValue(this.scrollTo)&&this.setScrollTo():this.findScrollTop(e)},x.prototype.findScrollTop=function(e){var t=this.getPopupHeight(),i=e.nextElementSibling,s=(i||e).offsetTop,a=e.getBoundingClientRect().height;s+e.offsetTop>t?this.popupWrapper.scrollTop=i?s-(t/2+a/2):s:this.popupWrapper.scrollTop=0},x.prototype.setScrollTo=function(){var e,t,i;O.isNullOrUndefined(this.popupWrapper)?this.popupWrapper.scrollTop=0:(e=this.popupWrapper.querySelectorAll("."+ft)).length&&(t=this.timeCollections[0],i=this.getDateObject(this.checkDateValue(this.scrollTo)).getTime(),i=e[Math.round((i-t)/(6e4*this.step))]),O.isNullOrUndefined(i)?this.popupWrapper.scrollTop=0:this.findScrollTop(i)},x.prototype.getText=function(){return O.isNullOrUndefined(this.checkDateValue(this.value))?"":this.getValue(this.value)},x.prototype.getValue=function(e){return O.isNullOrUndefined(this.checkDateValue(e))?null:this.globalize.formatDate(e,{format:this.cldrTimeFormat(),type:"time"})},x.prototype.cldrDateFormat=function(){var e="en"===this.locale||"en-US"===this.locale?O.getValue("dateFormats.short",O.getDefaultDateObject()):this.getCultureDateObject(O.cldrData,""+this.locale);return e},x.prototype.cldrTimeFormat=function(){var e=this.isNullOrEmpty(this.formatString)?"en"===this.locale||"en-US"===this.locale?O.getValue("timeFormats.short",O.getDefaultDateObject()):this.getCultureTimeObject(O.cldrData,""+this.locale):this.formatString;return e},x.prototype.dateToNumeric=function(){var e="en"===this.locale||"en-US"===this.locale?O.getValue("timeFormats.medium",O.getDefaultDateObject()):O.getValue("main."+this.locale+".dates.calendars.gregorian.timeFormats.medium",O.cldrData);return e},x.prototype.getExactDateTime=function(e){return O.isNullOrUndefined(this.checkDateValue(e))?null:this.globalize.formatDate(e,{format:this.dateToNumeric(),type:"time"})},x.prototype.setValue=function(e){e=this.checkValue(e);this.strictMode||this.validateState(e)?this.isNullOrEmpty(e)?(this.initValue=null,this.validateMinMax(this.value,this.min,this.max)):this.initValue=this.compareFormatChange(e):(null===this.checkDateValue(this.valueWithMinutes)&&(this.initValue=this.valueWithMinutes=null),this.validateMinMax(this.value,this.min,this.max)),this.updateInput(!0,this.initValue)},x.prototype.compareFormatChange=function(e){return O.isNullOrUndefined(e)?null:e!==this.getText()?this.getDateObject(e):this.getDateObject(this.value)},x.prototype.updatePlaceHolder=function(){u.Input.setPlaceholder(this.l10n.getConstant("placeholder"),this.inputElement)},x.prototype.updateInputValue=function(e){u.Input.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton)},x.prototype.preventEventBubbling=function(e){e.preventDefault(),this.interopAdaptor.invokeMethodAsync("OnTimeIconClick")},x.prototype.popupHandler=function(e){this.enabled&&(O.Browser.isDevice&&this.inputElement.setAttribute("readonly",""),e.preventDefault(),this.isPopupOpen()?this.closePopup(0,e):(this.inputElement.focus(),this.show(e)))},x.prototype.mouseDownHandler=function(){!this.enabled||this.readonly||(this.inputElement.setSelectionRange(0,0),O.EventHandler.add(this.inputElement,"mouseup",this.mouseUpHandler,this))},x.prototype.mouseUpHandler=function(e){this.readonly||(e.preventDefault(),this.enableMask?(e.preventDefault(),this.notify("setMaskSelection",{module:"MaskedDateTime"})):(O.EventHandler.remove(this.inputElement,"mouseup",this.mouseUpHandler),0===(e=this.getCursorSelection()).start&&e.end===this.inputElement.value.length||(0<this.inputElement.value.length&&(this.cursorDetails=this.focusSelection()),this.inputElement.setSelectionRange(this.cursorDetails.start,this.cursorDetails.end))))},x.prototype.focusSelection=function(){var e=new RegExp("^[a-zA-Z0-9]+$"),t=this.inputElement.value.split(""),i=(t.push(" "),this.getCursorSelection()),s=0,a=0,n=!1;if(this.isTextSelected)s=i.start,a=i.end,this.isTextSelected=!1;else for(var r=0;r<t.length;r++)if(e.test(t[r])||(a=r,n=!0),n){if(i.start>=s&&i.end<=a){this.isTextSelected=!0;break}s=r+1,n=!1}return{start:s,end:a}},x.prototype.inputHandler=function(e){if(!this.readonly&&this.enabled)switch("right"!==e.action&&"left"!==e.action&&"tab"!==e.action&&("home"!==e.action&&"end"!==e.action&&"up"!==e.action&&"down"!==e.action||this.isPopupOpen()||this.enableMask)&&e.preventDefault(),e.action){case"home":case"end":case"up":case"down":this.isPopupOpen()||(this.popupCreation(),this.popupObj.destroy(),this.popupObj=this.popupWrapper=null),!this.enableMask||this.readonly||this.isPopupOpen()||(e.preventDefault(),this.notify("keyDownHandler",{module:"MaskedDateTime",e:e})),this.isPopupOpen()&&this.keyHandler(e);break;case"enter":this.isNavigate?(this.selectedElement=this.liCollections[this.activeIndex],this.valueWithMinutes=new Date(this.timeCollections[this.activeIndex]),this.updateValue(this.valueWithMinutes,e)):this.updateValue(this.inputElement.value,e),this.hide(),this.isNavigate=!1,this.isPopupOpen()&&e.stopPropagation();break;case"open":this.show(e);break;case"escape":this.updateInputValue(this.objToString(this.value)),this.enableMask&&(this.value||this.updateInputValue(this.maskedDateValue),this.createMask()),this.previousState(this.value),this.hide();break;case"close":this.hide();break;case"right":case"left":case"tab":case"shiftTab":this.isPopupOpen()||!this.enableMask||this.readonly||((0===this.inputElement.selectionStart&&this.inputElement.selectionEnd===this.inputElement.value.length||this.inputElement.selectionEnd!==this.inputElement.value.length&&"tab"===e.action||0!==this.inputElement.selectionStart&&"shiftTab"===e.action||"left"===e.action||"right"===e.action)&&e.preventDefault(),this.notify("keyDownHandler",{module:"MaskedDateTime",e:e}));break;default:this.isNavigate=!1}},x.prototype.onMouseClick=function(e){var t=e.target,t=this.selectedElement=O.closest(t,"."+ft);this.setSelection(t,e),t&&t.classList.contains(ft)&&this.hide()},x.prototype.closePopup=function(t,e){var i=this;this.isPopupOpen()&&this.popupWrapper?(e={popup:this.popupObj,event:e||null,cancel:!1,name:"open"},O.removeClass([document.body],vt),this.trigger("close",e,function(e){e.cancel||(i.popupObj.hide(new O.Animation({name:"FadeOut",duration:50,delay:t||0})),O.removeClass([i.inputWrapper.container],["e-icon-anim"]),O.attributes(i.inputElement,{"aria-expanded":"false"}),i.inputElement.removeAttribute("aria-owns"),i.inputElement.removeAttribute("aria-controls"),i.inputElement.removeAttribute("aria-activedescendant"),O.EventHandler.remove(document,"mousedown touchstart",i.documentClickHandler)),O.Browser.isDevice&&i.modal&&(i.modal.style.display="none",i.modal.outerHTML="",i.modal=null),O.Browser.isDevice&&!O.isNullOrUndefined(i.mobileTimePopupWrap)&&(i.mobileTimePopupWrap.remove(),i.mobileTimePopupWrap=null),O.Browser.isDevice&&i.allowEdit&&!i.readonly&&i.inputElement.removeAttribute("readonly")})):O.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly")},x.prototype.disposeServerPopup=function(){this.popupWrapper&&(this.popupWrapper.style.visibility="hidden",this.popupWrapper.style.top="-9999px",this.popupWrapper.style.left="-9999px",this.popupWrapper.style.width="0px",this.popupWrapper.style.height="0px")},x.prototype.checkValueChange=function(e,t){var i;this.strictMode||this.validateState(this.valueWithMinutes)?t?(i=this.getDateObject(new Date(this.timeCollections[this.activeIndex])),+this.prevDate!=+i&&this.valueProcess(e,i)):(i=this.compareFormatChange(this.inputElement.value),+this.prevDate==+i&&!O.isNullOrUndefined(this.checkDateValue(this.value))||this.valueProcess(e,i)):(null===this.checkDateValue(this.valueWithMinutes)&&(this.initValue=this.valueWithMinutes=null),this.setProperties({value:this.compareFormatChange(this.inputElement.value)},!0),this.initValue=this.valueWithMinutes=this.compareFormatChange(this.inputElement.value),this.prevValue=this.inputElement.value,+this.prevDate!=+this.value&&this.changeEvent(e))},x.prototype.onMouseOver=function(e){e=O.closest(e.target,"."+ft);this.setHover(e,dt)},x.prototype.setHover=function(e,t){this.enabled&&this.isValidLI(e)&&!e.classList.contains(t)&&(this.removeHover(t),O.addClass([e],t),t===pt)&&e.setAttribute("aria-selected","true")},x.prototype.setSelection=function(e,t){this.isValidLI(e)&&(this.checkValue(e.getAttribute("data-value")),this.enableMask&&this.createMask(),this.selectedElement=e,this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(e),this.valueWithMinutes=new Date(this.timeCollections[this.activeIndex]),O.addClass([this.selectedElement],ut),this.selectedElement.setAttribute("aria-selected","true"),this.checkValueChange(t,!0))},x.prototype.onMouseLeave=function(){this.removeHover(dt)},x.prototype.scrollHandler=function(){"timepicker"===this.getModuleName()&&O.Browser.isDevice||this.hide()},x.prototype.setMinMax=function(e,t){O.isNullOrUndefined(this.checkDateValue(e))&&(this.initMin=this.getDateObject("12:00:00 AM")),O.isNullOrUndefined(this.checkDateValue(t))&&(this.initMax=this.getDateObject("11:59:59 PM"))},x.prototype.validateMinMax=function(e,t,i){var s=e instanceof Date?e:this.getDateObject(e);return O.isNullOrUndefined(this.checkDateValue(s))?+this.createDateObj(this.getFormattedValue(this.initMin))>+this.createDateObj(this.getFormattedValue(this.initMax))&&this.disableTimeIcon():e=this.strictOperation(this.initMin,this.initMax,e,s),this.strictMode&&(e=this.valueIsDisable(e)?e:null),this.checkErrorState(e),e},x.prototype.valueIsDisable=function(e){if(!O.isNullOrUndefined(this.disableItemCollection)&&0<this.disableItemCollection.length){if(this.disableItemCollection.length===this.timeCollections.length)return!1;for(var t=e instanceof Date?this.objToString(e):e,i=0;i<this.disableItemCollection.length;i++)if(t===this.disableItemCollection[i])return!1}return!0},x.prototype.validateState=function(e){if(!this.strictMode){if(!this.valueIsDisable(e))return!1;var e=this.setCurrentDate(this.getDateObject(e)),t=this.setCurrentDate(this.getDateObject(this.initMax)),i=this.setCurrentDate(this.getDateObject(this.initMin));if(O.isNullOrUndefined(this.checkDateValue(e))){if(+t<+i||""!==this.inputElement.value)return!1}else if(+t<+e||+e<+i)return!1}return!0},x.prototype.strictOperation=function(e,t,i,s){t=this.createDateObj(this.getFormattedValue(t)),e=this.createDateObj(this.getFormattedValue(e)),s=this.createDateObj(this.getFormattedValue(s));if(this.strictMode){if(+t<+e)return this.disableTimeIcon(),this.initValue=this.getDateObject(t),this.updateInputValue(this.getValue(this.initValue)),this.enableMask&&this.createMask(),this.inputElement.value;if(+s<=+e)return this.getDateObject(e);if(+t<=+s||+e==+t)return this.getDateObject(t)}else if(+t<+e&&(this.disableTimeIcon(),!isNaN(+this.createDateObj(i))));return i},x.prototype.bindEvents=function(){O.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.popupHandler,this),O.EventHandler.add(this.inputElement,"blur",this.inputBlurHandler,this),O.EventHandler.add(this.inputElement,"focus",this.inputFocusHandler,this),O.EventHandler.add(this.inputElement,"change",this.inputChangeHandler,this),O.EventHandler.add(this.inputElement,"input",this.inputEventHandler,this),this.enableMask&&(O.EventHandler.add(this.inputElement,"keydown",this.keydownHandler,this),O.EventHandler.add(this.inputElement,"keyup",this.keyupHandler,this)),this.showClearButton&&this.inputWrapper.clearButton&&O.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.clearHandler,this),this.formElement&&O.EventHandler.add(this.formElement,"reset",this.formResetHandler,this),O.Browser.isDevice||(this.keyConfigure=O.extend(this.keyConfigure,this.keyConfigs),this.inputEvent=new O.KeyboardEvents(this.inputWrapper.container,{keyAction:this.inputHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}),this.inputElement&&(this.showClearButton||this.enableMask)&&O.EventHandler.add(this.inputElement,"mousedown",this.mouseDownHandler,this))},x.prototype.keydownHandler=function(e){"Delete"!==e.code||!this.enableMask||this.popupObj||this.readonly||this.notify("keyDownHandler",{module:"MaskedDateTime",e:e})},x.prototype.keyupHandler=function(e){("Backspace"===e.code||"Delete"===e.code)&&this.enableMask&&this.showClearButton&&this.inputElement&&this.inputElement.value===this.maskedDateValue&&this.inputWrapper&&this.inputWrapper.clearButton&&!this.inputWrapper.clearButton.classList.contains("e-clear-icon-hide")&&this.inputWrapper.clearButton.classList.add("e-clear-icon-hide")},x.prototype.formResetHandler=function(){var e,t;this.enabled&&!this.inputElement.disabled&&(e=this.inputElement.getAttribute("value"),t=this.checkDateValue(this.inputEleValue),"EJS-TIMEPICKER"===this.element.tagName&&(t=null,this.inputElement.setAttribute("value",e="")),this.setProperties({value:t},!0),this.prevDate=this.value,this.valueWithMinutes=this.value,this.initValue=this.value,this.inputElement)&&(this.updateInputValue(e),this.enableMask&&(e||this.updateInputValue(this.maskedDateValue),this.createMask()),this.checkErrorState(e),this.prevValue=this.inputElement.value)},x.prototype.inputChangeHandler=function(e){this.enabled&&e.stopPropagation()},x.prototype.inputEventHandler=function(){this.enableMask&&this.notify("inputHandler",{module:"MaskedDateTime"})},x.prototype.unBindEvents=function(){this.inputWrapper&&O.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown touchstart",this.popupHandler),O.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),O.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),O.EventHandler.remove(this.inputElement,"change",this.inputChangeHandler),O.EventHandler.remove(this.inputElement,"input",this.inputEventHandler),this.enableMask&&O.EventHandler.remove(this.inputElement,"keyup",this.keyupHandler),this.inputEvent&&this.inputEvent.destroy(),O.EventHandler.remove(this.inputElement,"mousedown touchstart",this.mouseDownHandler),!this.showClearButton||O.isNullOrUndefined(this.inputWrapper)||O.isNullOrUndefined(this.inputWrapper.clearButton)||O.EventHandler.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.clearHandler),this.formElement&&O.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},x.prototype.bindClearEvent=function(){this.showClearButton&&this.inputWrapper.clearButton&&O.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.clearHandler,this)},x.prototype.raiseClearedEvent=function(e){this.trigger("cleared",{event:e})},x.prototype.clearHandler=function(e){var t;this.enabled&&(e.preventDefault(),O.isNullOrUndefined(this.value)?(this.resetState(),this.raiseClearedEvent(e)):this.clear(e),this.popupWrapper&&(this.popupWrapper.scrollTop=0),this.enableMask&&this.notify("clearHandler",{module:"MaskedDateTime"}),O.closest(this.element,"form"))&&(e=this.element,(t=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),e.dispatchEvent(t))},x.prototype.clear=function(e){this.setProperties({value:null},!0),this.initValue=null,this.resetState(),this.raiseClearedEvent(e),this.changeEvent(e)},x.prototype.setZIndex=function(){this.popupObj&&(this.popupObj.zIndex=this.zIndex,this.popupObj.dataBind())},x.prototype.checkAttributes=function(e){for(var t,i=0,s=e?O.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["step","disabled","readonly","style","name","value","min","max","placeholder"];i<s.length;i++){var a,n=s[i];if(!O.isNullOrUndefined(this.inputElement.getAttribute(n)))switch(n){case"disabled":(O.isNullOrUndefined(this.timeOptions)||void 0===this.timeOptions.enabled||e)&&(a="disabled"!==this.inputElement.getAttribute(n)&&""!==this.inputElement.getAttribute(n)&&"true"!==this.inputElement.getAttribute(n),this.setProperties({enabled:a},!e));break;case"style":this.inputStyle=this.inputElement.getAttribute(n);break;case"readonly":(O.isNullOrUndefined(this.timeOptions)||void 0===this.timeOptions.readonly||e)&&(a="readonly"===this.inputElement.getAttribute(n)||""===this.inputElement.getAttribute(n)||"true"===this.inputElement.getAttribute(n),this.setProperties({readonly:a},!e));break;case"name":this.inputElement.setAttribute("name",this.inputElement.getAttribute(n));break;case"step":this.step=parseInt(this.inputElement.getAttribute(n),10);break;case"placeholder":(O.isNullOrUndefined(this.timeOptions)||void 0===this.timeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(n)},!e);break;case"min":(O.isNullOrUndefined(this.timeOptions)||void 0===this.timeOptions.min||e)&&(t=new Date(this.inputElement.getAttribute(n)),O.isNullOrUndefined(this.checkDateValue(t))||this.setProperties({min:t},!e));break;case"max":(O.isNullOrUndefined(this.timeOptions)||void 0===this.timeOptions.max||e)&&(t=new Date(this.inputElement.getAttribute(n)),O.isNullOrUndefined(this.checkDateValue(t))||this.setProperties({max:t},!e));break;case"value":(O.isNullOrUndefined(this.timeOptions)||void 0===this.timeOptions.value||e)&&(t=new Date(this.inputElement.getAttribute(n)),O.isNullOrUndefined(this.checkDateValue(t))||(this.initValue=t,this.updateInput(!1,this.initValue),this.setProperties({value:t},!e)))}}},x.prototype.setCurrentDate=function(e){return O.isNullOrUndefined(this.checkDateValue(e))?null:new Date(ot,lt,rt,e.getHours(),e.getMinutes(),e.getSeconds())},x.prototype.getTextFormat=function(){var e=0;if("a"===this.cldrTimeFormat().split(" ")[0]||0===this.cldrTimeFormat().indexOf("a"))e=1;else if(this.cldrTimeFormat().indexOf("a")<0)for(var t=this.cldrTimeFormat().split(" "),i=0;i<t.length;i++)if(0<=t[i].toLowerCase().indexOf("h")){e=i;break}return e},x.prototype.updateValue=function(e,t){var i,s;this.isNullOrEmpty(e)?this.resetState():(s=this.checkValue(e),this.strictMode&&(i=null===s&&0<e.trim().length?this.previousState(this.prevDate):this.inputElement.value,this.updateInputValue(i),this.enableMask)&&(i||this.updateInputValue(this.maskedDateValue),O.isNullOrUndefined(s)&&e!==this.maskedDateValue&&this.createMask(),O.isNullOrUndefined(s))&&e===this.maskedDateValue&&this.updateInputValue(this.maskedDateValue)),this.checkValueChange(t,"string"!=typeof e)},x.prototype.previousState=function(e){for(var t=this.getDateObject(e),i=0;i<this.timeCollections.length;i++)if(+t===this.timeCollections[i]){this.activeIndex=i,this.selectedElement=this.liCollections[i],this.valueWithMinutes=new Date(this.timeCollections[i]);break}return this.getValue(e)},x.prototype.resetState=function(){this.removeSelection(),u.Input.setValue("",this.inputElement,this.floatLabelType,!1),this.valueWithMinutes=this.activeIndex=null,this.strictMode||this.checkErrorState(null)},x.prototype.objToString=function(e){return O.isNullOrUndefined(this.checkDateValue(e))?null:this.globalize.formatDate(e,{format:this.cldrTimeFormat(),type:"time"})},x.prototype.checkValue=function(e){var t;return this.isNullOrEmpty(e)?(this.resetState(),this.valueWithMinutes=null):(t=e instanceof Date?e:this.getDateObject(e),this.validateValue(t,e))},x.prototype.validateValue=function(e,t){var i=this.validateMinMax(t,this.min,this.max),s=this.getDateObject(i),s=(this.getFormattedValue(s)!==this.getFormattedValue(this.value)?this.valueWithMinutes=O.isNullOrUndefined(s)?null:s:(this.strictMode&&(e=s),this.valueWithMinutes=this.checkDateValue(e)),this.objToString(this.valueWithMinutes));return!this.strictMode&&O.isNullOrUndefined(s)?(e=0<i.trim().length?i:"",this.updateInputValue(e),this.enableMask&&!e&&this.updateInputValue(this.maskedDateValue)):(this.updateInputValue(s),this.enableMask&&(""===s&&this.updateInputValue(this.maskedDateValue),O.isNullOrUndefined(s)&&t!==this.maskedDateValue&&this.createMask(),O.isNullOrUndefined(s))&&t===this.maskedDateValue&&this.updateInputValue(this.maskedDateValue)),s},x.prototype.createMask=function(){this.notify("createMask",{module:"MaskedDateTime"})},x.prototype.findNextElement=function(e){var t=this.inputElement.value,i=O.isNullOrUndefined(this.valueWithMinutes)?this.createDateObj(t):this.getDateObject(this.valueWithMinutes),s=null,a=this.liCollections.length,t=this.timeCollections;if(O.isNullOrUndefined(this.checkDateValue(i))&&O.isNullOrUndefined(this.activeIndex))this.selectNextItem(e);else{if("home"===e.action){var n=this.validLiElement(0),s=+this.createDateObj(new Date(this.timeCollections[n]));this.activeIndex=n}else if("end"===e.action){n=this.validLiElement(t.length-1,!0);s=+this.createDateObj(new Date(this.timeCollections[n])),this.activeIndex=n}else if("down"===e.action)for(var r=0;r<a;r++){if(+i<this.timeCollections[r]){n=this.validLiElement(r);s=+this.createDateObj(new Date(this.timeCollections[n])),this.activeIndex=n;break}if(r===a-1){n=this.validLiElement(0);s=+this.createDateObj(new Date(this.timeCollections[n])),this.activeIndex=n;break}}else for(r=a-1;0<=r;r--){if(+i>this.timeCollections[r]){n=this.validLiElement(r,!0);s=+this.createDateObj(new Date(this.timeCollections[n])),this.activeIndex=n;break}if(0===r){n=this.validLiElement(a-1);s=+this.createDateObj(new Date(this.timeCollections[n])),this.activeIndex=n;break}}this.selectedElement=this.liCollections[this.activeIndex],this.elementValue(O.isNullOrUndefined(s)?null:new Date(s))}},x.prototype.selectNextItem=function(e){e=this.validLiElement(0,"down"!==e.action);this.activeIndex=e,this.selectedElement=this.liCollections[e],this.elementValue(new Date(this.timeCollections[e]))},x.prototype.elementValue=function(e){O.isNullOrUndefined(this.checkDateValue(e))||this.checkValue(e)},x.prototype.validLiElement=function(e,t){var i=null,s=O.isNullOrUndefined(this.popupWrapper)?this.liCollections:this.popupWrapper.querySelectorAll("."+ft),a=!0;if(s.length)if(t)for(var n=e;0<=n;n--){if(!s[n].classList.contains(ct)){i=n;break}0===n&&a&&(e=n=s.length,a=!1)}else for(n=e;n<=s.length-1;n++){if(!s[n].classList.contains(ct)){i=n;break}n===s.length-1&&(a=a&&!(e=n=-1))}return i},x.prototype.keyHandler=function(e){var t,i,s;O.isNullOrUndefined(this.step)||this.step<=0||!O.isNullOrUndefined(this.inputWrapper)&&this.inputWrapper.buttons[0].classList.contains(ct)||(t=this.timeCollections.length,O.isNullOrUndefined(this.getActiveElement())||0===this.getActiveElement().length?0<this.liCollections.length&&O.isNullOrUndefined(this.value)&&O.isNullOrUndefined(this.activeIndex)?(s=this.validLiElement(0,"down"!==e.action),this.activeIndex=s,this.selectedElement=this.liCollections[s],this.elementValue(new Date(this.timeCollections[s]))):this.findNextElement(e):(i=void 0,37<=e.keyCode&&e.keyCode<=40?(s=40===e.keyCode||39===e.keyCode?++this.activeIndex:--this.activeIndex,this.activeIndex=s=this.activeIndex===t?0:this.activeIndex,this.activeIndex=s=this.activeIndex<0?t-1:this.activeIndex,this.activeIndex=s=this.validLiElement(this.activeIndex,40!==e.keyCode&&39!==e.keyCode),i=O.isNullOrUndefined(this.timeCollections[s])?this.timeCollections[0]:this.timeCollections[s]):"home"===e.action?(s=this.validLiElement(0),this.activeIndex=s,i=this.timeCollections[s]):"end"===e.action&&(s=this.validLiElement(t-1,!0),this.activeIndex=s,i=this.timeCollections[s]),this.selectedElement=this.liCollections[this.activeIndex],this.elementValue(new Date(i))),this.isNavigate=!0,this.setHover(this.selectedElement,pt),this.setActiveDescendant(),this.enableMask&&this.selectInputText(),!this.isPopupOpen())||null===this.selectedElement||e&&"click"===e.type||this.setScrollPosition()},x.prototype.getCultureTimeObject=function(e,t){return O.getValue("main."+t+".dates.calendars.gregorian.timeFormats.short",e)},x.prototype.getCultureDateObject=function(e,t){return O.getValue("main."+t+".dates.calendars.gregorian.dateFormats.short",e)},x.prototype.wireListEvents=function(){O.EventHandler.add(this.listWrapper,"click",this.onMouseClick,this),O.Browser.isDevice||(O.EventHandler.add(this.listWrapper,"mouseover",this.onMouseOver,this),O.EventHandler.add(this.listWrapper,"mouseout",this.onMouseLeave,this))},x.prototype.unWireListEvents=function(){this.listWrapper&&(O.EventHandler.remove(this.listWrapper,"click",this.onMouseClick),O.Browser.isDevice||(O.EventHandler.remove(this.listWrapper,"mouseover",this.onMouseOver),O.EventHandler.remove(this.listWrapper,"mouseout",this.onMouseLeave)))},x.prototype.valueProcess=function(e,t){t=O.isNullOrUndefined(this.checkDateValue(t))?null:t;+this.prevDate!=+t&&(this.initValue=t,this.changeEvent(e))},x.prototype.changeEvent=function(e){this.addSelection(),this.updateInput(!0,this.initValue);e={event:e||null,value:this.value,text:this.inputElement.value,isInteracted:!O.isNullOrUndefined(e),element:this.element};e.value=this.valueWithMinutes||this.getDateObject(this.inputElement.value),this.prevDate=this.valueWithMinutes||this.getDateObject(this.inputElement.value),this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",e),this.invalidValueString=null,this.checkErrorState(this.value)},x.prototype.updateInput=function(e,t){e&&(this.prevValue=this.getValue(this.prevDate)),"number"==typeof(this.prevDate=this.valueWithMinutes=t)&&(this.value&&+new Date(+this.value).setMilliseconds(0))===+t||(this.setProperties({value:t},!0),this.enableMask&&this.value&&this.createMask()),!this.strictMode&&O.isNullOrUndefined(this.value)&&this.invalidValueString&&(this.checkErrorState(this.invalidValueString),this.updateInputValue(this.invalidValueString)),this.clearIconState()},x.prototype.setActiveDescendant=function(){!O.isNullOrUndefined(this.selectedElement)&&this.value?O.attributes(this.inputElement,{"aria-activedescendant":this.selectedElement.getAttribute("id")}):this.inputElement.removeAttribute("aria-activedescendant")},x.prototype.removeSelection=function(){var e;this.removeHover(dt),O.isNullOrUndefined(this.popupWrapper)||(e=this.popupWrapper.querySelectorAll("."+ut)).length&&(O.removeClass(e,ut),e[0].removeAttribute("aria-selected"))},x.prototype.removeHover=function(e){var t=this.getHoverItem(e);t&&t.length&&(O.removeClass(t,e),e===pt)&&t[0].removeAttribute("aria-selected")},x.prototype.getHoverItem=function(e){var t;return t=O.isNullOrUndefined(this.popupWrapper)?t:this.popupWrapper.querySelectorAll("."+e)},x.prototype.setActiveClass=function(){if(!O.isNullOrUndefined(this.popupWrapper)){var e=this.popupWrapper.querySelectorAll("."+ft);if(e.length)for(var t=0;t<e.length;t++)if(this.timeCollections[t]===+this.getDateObject(this.valueWithMinutes)){e[t].setAttribute("aria-selected","true"),this.selectedElement=e[t],this.activeIndex=t;break}}},x.prototype.addSelection=function(){this.selectedElement=null,this.removeSelection(),this.setActiveClass(),O.isNullOrUndefined(this.selectedElement)||(O.addClass([this.selectedElement],ut),this.selectedElement.setAttribute("aria-selected","true"))},x.prototype.isValidLI=function(e){return e&&e.classList.contains(ft)&&!e.classList.contains(ct)},x.prototype.createDateObj=function(e){var t=this.globalize.formatDate(new Date,{format:null,skeleton:"short",type:"date"}),i=null;return"string"!=typeof e||this.enableMask&&this.maskedDateValue&&this.inputElement.value===this.maskedDateValue&&!this.value?e instanceof Date&&(i=e):(-1<e.toUpperCase().indexOf("AM")||-1<e.toUpperCase().indexOf("PM"))&&(t=this.defaultCulture.formatDate(new Date,{format:null,skeleton:"short",type:"date"}),i=isNaN(+new Date(t+" "+e))?null:new Date(new Date(t+" "+e).setMilliseconds(0)),!O.isNullOrUndefined(i))||(i=this.timeParse(t,e)),i},x.prototype.timeParse=function(e,t){var i=this.globalize.parseDate(this.getAmPmValue(e+" "+t),{format:this.cldrDateFormat()+" "+this.cldrTimeFormat(),type:"datetime"});return i=O.isNullOrUndefined(i)?this.globalize.parseDate(this.getAmPmValue(e+" "+t),{format:this.cldrDateFormat()+" "+this.dateToNumeric(),type:"datetime"}):i,i=O.isNullOrUndefined(i)?i:new Date(i.setMilliseconds(0))},x.prototype.createListItems=function(){for(var e,t=this,i=(this.listWrapper=this.createElement("div",{className:"e-content",attrs:{tabindex:"-1"}}),6e4*this.step),s=[],a=(this.timeCollections=[],this.disableItemCollection=[],e=+this.getDateObject(this.initMin).setMilliseconds(0),+this.getDateObject(this.initMax).setMilliseconds(0));e<=a;)this.timeCollections.push(e),s.push(this.globalize.formatDate(new Date(e),{format:this.cldrTimeFormat(),type:"time"})),e+=i;this.listTag=F.ListBase.createList(this.createElement,s,{itemCreated:function(e){e={element:e.item,text:e.text,value:t.getDateObject(e.text),isDisabled:!1};t.trigger("itemRender",e,function(e){e.isDisabled&&e.element.classList.add(ct),e.element.classList.contains(ct)&&t.disableItemCollection.push(e.element.getAttribute("data-value"))})}},!0),O.attributes(this.listTag,{role:"listbox","aria-hidden":"false",id:this.element.id+"_options",tabindex:"0"}),O.append([this.listTag],this.listWrapper)},x.prototype.documentClickHandler=function(e){var t=e.target;O.isNullOrUndefined(this.popupObj)||O.isNullOrUndefined(this.inputWrapper)||!(this.inputWrapper.container.contains(t)&&"mousedown"!==e.type||this.popupObj.element&&this.popupObj.element.contains(t))||"touchstart"===e.type||e.preventDefault(),O.closest(t,'[id="'+this.popupObj.element.id+'"]')||t===this.inputElement||t===(this.inputWrapper&&this.inputWrapper.buttons[0])||t===(this.inputWrapper&&this.inputWrapper.clearButton)||t===(this.inputWrapper&&this.inputWrapper.container)?t===this.inputElement||O.Browser.isDevice||(this.isPreventBlur=(O.Browser.isIE||"edge"===O.Browser.info.name)&&document.activeElement===this.inputElement&&t===this.popupWrapper):this.isPopupOpen()&&(this.hide(),t.classList.contains("e-dlg-overlay")?e.preventDefault():this.focusOut())},x.prototype.setEnableRtl=function(){u.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]),this.popupObj&&(this.popupObj.enableRtl=this.enableRtl,this.popupObj.dataBind())},x.prototype.setEnable=function(){u.Input.setEnabled(this.enabled,this.inputElement,this.floatLabelType),this.enabled?(O.removeClass([this.inputWrapper.container],ct),O.attributes(this.inputElement,{"aria-disabled":"false"}),this.inputElement.setAttribute("tabindex",this.tabIndex)):(this.hide(),O.addClass([this.inputWrapper.container],ct),O.attributes(this.inputElement,{"aria-disabled":"true"}),this.inputElement.tabIndex=-1)},x.prototype.getProperty=function(e,t){"min"===t?(this.initMin=this.checkDateValue(new Date(this.checkInValue(e.min))),this.setProperties({min:this.initMin},!0)):(this.initMax=this.checkDateValue(new Date(this.checkInValue(e.max))),this.setProperties({max:this.initMax},!0)),""===this.inputElement.value?this.validateMinMax(this.value,this.min,this.max):this.checkValue(this.inputElement.value),this.checkValueChange(null,!1)},x.prototype.inputBlurHandler=function(e){this.updateFloatLabelOverflowWidth(),this.enabled&&(this.isPreventBlur&&this.isPopupOpen()?this.inputElement.focus():(this.closePopup(0,e),this.enableMask&&this.maskedDateValue&&this.placeholder&&"Always"!==this.floatLabelType&&(this.inputElement.value!==this.maskedDateValue||this.value||"Auto"!==this.floatLabelType&&"Never"!==this.floatLabelType&&!this.placeholder||this.updateInputValue("")),O.removeClass([this.inputWrapper.container],[mt]),this.getText()!==this.inputElement.value?this.updateValue(this.inputElement.value,e):0===this.inputElement.value.trim().length&&this.resetState(),this.cursorDetails=null,this.isNavigate=!1,""===this.inputElement.value&&(this.invalidValueString=null),this.trigger("blur",{model:this})))},x.prototype.focusOut=function(){document.activeElement===this.inputElement&&(this.inputElement.blur(),O.removeClass([this.inputWrapper.container],[mt]),this.trigger("blur",{model:this}))},x.prototype.isPopupOpen=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains(ht))},x.prototype.inputFocusHandler=function(){var e;this.enabled&&(e={model:this},this.readonly||O.Browser.isDevice||this.enableMask||this.selectInputText(),this.enableMask&&!this.inputElement.value&&this.placeholder&&this.maskedDateValue&&!this.value&&("Auto"===this.floatLabelType||"Never"===this.floatLabelType||this.placeholder)&&(this.updateInputValue(this.maskedDateValue),this.inputElement.selectionStart=0,this.inputElement.selectionEnd=this.inputElement.value.length),this.enableMask&&this.showClearButton&&this.inputElement&&this.inputElement.value===this.maskedDateValue&&this.inputWrapper&&this.inputWrapper.clearButton&&!this.inputWrapper.clearButton.classList.contains("e-clear-icon-hide")&&this.inputWrapper.clearButton.classList.add("e-clear-icon-hide"),this.trigger("focus",e),this.clearIconState(),this.clearFloatLabelOverflowWidth(),this.openOnFocus)&&this.show()},x.prototype.focusIn=function(){document.activeElement!==this.inputElement&&this.enabled&&this.inputElement.focus()},x.prototype.hide=function(){this.closePopup(100,null),this.clearIconState()},x.prototype.show=function(e){var t=this;this.enabled&&this.readonly||!this.enabled||this.popupWrapper||(this.popupCreation(),O.Browser.isDevice&&this.listWrapper&&(this.modal=this.createElement("div"),this.modal.className=ht+" e-time-modal",document.body.className+=" "+vt,document.body.appendChild(this.modal)),O.Browser.isDevice&&(this.mobileTimePopupWrap=this.createElement("div",{className:"e-timepicker-mob-popup-wrap"}),document.body.appendChild(this.mobileTimePopupWrap)),this.openPopupEventArgs={popup:this.popupObj||null,cancel:!1,event:e||null,name:"open",appendTo:O.Browser.isDevice?this.mobileTimePopupWrap:document.body},e=this.openPopupEventArgs,this.trigger("open",e,function(e){t.openPopupEventArgs=e,t.openPopupEventArgs.cancel||t.inputWrapper.buttons[0].classList.contains(ct)?(t.popupObj.destroy(),t.popupWrapper=t.listTag=void 0,t.liCollections=t.timeCollections=t.disableItemCollection=[],t.popupObj=null):(t.openPopupEventArgs.appendTo.appendChild(t.popupWrapper),t.popupAlignment(t.openPopupEventArgs),t.setScrollPosition(),O.Browser.isDevice||t.inputElement.focus(),e={name:"FadeIn",duration:50},t.popupObj.refreshPosition(t.anchor),1e3===t.zIndex?t.popupObj.show(new O.Animation(e),t.element):t.popupObj.show(new O.Animation(e),null),t.setActiveDescendant(),O.attributes(t.inputElement,{"aria-expanded":"true"}),O.attributes(t.inputElement,{"aria-owns":t.inputElement.id+"_options"}),O.attributes(t.inputElement,{"aria-controls":t.inputElement.id}),O.addClass([t.inputWrapper.container],mt),O.EventHandler.add(document,"mousedown touchstart",t.documentClickHandler,t),t.setOverlayIndex(t.mobileTimePopupWrap,t.popupObj.element,t.modal,O.Browser.isDevice),O.Browser.isDevice&&((e=t.createElement("div",{className:"e-dlg-overlay"})).style.zIndex=(t.zIndex-1).toString(),t.mobileTimePopupWrap.appendChild(e)))}))},x.prototype.setOverlayIndex=function(e,t,i,s){!s||O.isNullOrUndefined(t)||O.isNullOrUndefined(i)||O.isNullOrUndefined(e)||(s=parseInt(t.style.zIndex,10)?parseInt(t.style.zIndex,10):1e3,i.style.zIndex=(s-1).toString(),e.style.zIndex=s.toString())},x.prototype.formatValues=function(e){var t;return"number"==typeof e?t=O.formatUnit(e):"string"==typeof e&&(t=e.match(/px|%|em/)||isNaN(parseInt(e,10))?e:O.formatUnit(e)),t},x.prototype.popupAlignment=function(e){if(e.popup.position.X=this.formatValues(e.popup.position.X),e.popup.position.Y=this.formatValues(e.popup.position.Y),isNaN(parseFloat(e.popup.position.X))&&isNaN(parseFloat(e.popup.position.Y))||(this.popupObj.relateTo=this.anchor=document.body,this.popupObj.targetType="container"),isNaN(parseFloat(e.popup.position.X))||(this.popupObj.offsetX=parseFloat(e.popup.position.X)),isNaN(parseFloat(e.popup.position.Y))||(this.popupObj.offsetY=parseFloat(e.popup.position.Y)),O.Browser.isDevice)"center"===e.popup.position.X&&"center"===e.popup.position.Y&&(this.popupObj.relateTo=this.anchor=document.body,this.popupObj.offsetY=0,this.popupObj.targetType="container",this.popupObj.collision={X:"fit",Y:"fit"});else{switch(e.popup.position.X){case"left":break;case"right":e.popup.offsetX=this.containerStyle.width;break;case"center":e.popup.offsetX=-this.containerStyle.width/2}switch(e.popup.position.Y){case"top":case"bottom":break;case"center":e.popup.offsetY=-this.containerStyle.height/2}"center"===e.popup.position.X&&"center"===e.popup.position.Y&&(this.popupObj.relateTo=this.inputWrapper.container,this.anchor=this.inputElement,this.popupObj.targetType="relative")}},x.prototype.getPersistData=function(){return this.addOnPersist(["value"])},x.prototype.getModuleName=function(){return"timepicker"},x.prototype.updateFloatLabelOverflowWidth=function(){for(var e=this.inputWrapper.container,t=e.querySelector(".e-float-text.e-label-bottom"),i=0,s=e.querySelectorAll(".e-input-group-icon, .e-clear-icon"),a=0;a<s.length;a++)i+=s[a].offsetWidth;!t||!(e=this.element.parentElement.offsetWidth-i)||this.cssClass&&-1!==this.cssClass.split(" ").indexOf("e-outline")||(t.style.width=e+"px")},x.prototype.clearFloatLabelOverflowWidth=function(){var e=this.inputWrapper.container.querySelector(".e-float-text.e-label-top");e&&e.removeAttribute("style")},x.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){var a=s[i];switch(a){case"placeholder":u.Input.setPlaceholder(e.placeholder,this.inputElement);break;case"readonly":u.Input.setReadonly(this.readonly,this.inputElement,this.floatLabelType),this.readonly&&this.hide(),this.setTimeAllowEdit();break;case"enabled":this.setProperties({enabled:e.enabled},!0),this.setEnable();break;case"allowEdit":this.setTimeAllowEdit();break;case"enableRtl":this.setProperties({enableRtl:e.enableRtl},!0),this.setEnableRtl();break;case"cssClass":this.updateCssClass(e.cssClass,t.cssClass);break;case"zIndex":this.setProperties({zIndex:e.zIndex},!0),this.setZIndex();break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.checkAttributes(!0);break;case"min":case"max":this.getProperty(e,a);break;case"showClearButton":u.Input.setClearButton(this.showClearButton,this.inputElement,this.inputWrapper),this.bindClearEvent();break;case"locale":this.setProperties({locale:e.locale},!0),this.globalize=new O.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.timeOptions&&null==this.timeOptions.placeholder&&this.updatePlaceHolder(),this.setValue(this.value),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"});break;case"width":O.setStyleAttribute(this.inputWrapper.container,{width:this.setWidth(e.width)}),this.containerStyle=this.inputWrapper.container.getBoundingClientRect(),u.Input.calculateWidth(this.inputElement,this.inputWrapper.container),O.isNullOrUndefined(this.inputWrapper.buttons[0])||O.isNullOrUndefined(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon");break;case"format":this.setProperties({format:e.format},!0),this.checkTimeFormat(),this.setValue(this.value),this.enableMask&&(this.createMask(),this.value||this.updateInputValue(this.maskedDateValue));break;case"value":this.invalidValueString=null,this.checkInvalidValue(e.value),e.value=this.value,this.invalidValueString?(this.updateInputValue(this.invalidValueString),this.checkErrorState(this.invalidValueString)):("string"==typeof e.value?(this.setProperties({value:this.checkDateValue(new Date(e.value))},!0),e.value=this.value):(e.value&&+new Date(+e.value).setMilliseconds(0))!==+this.value&&(e.value=this.checkDateValue(new Date(""+e.value))),this.initValue=e.value,e.value=this.compareFormatChange(this.checkValue(e.value))),this.enableMask&&O.isNullOrUndefined(e.value)&&(this.updateInputValue(this.maskedDateValue),this.checkErrorState(this.maskedDateValue)),this.checkValueChange(null,!1),this.isPopupOpen()&&this.setScrollPosition(),this.isAngular&&this.preventChange&&(this.preventChange=!1),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"});break;case"floatLabelType":this.floatLabelType=e.floatLabelType,u.Input.removeFloating(this.inputWrapper),u.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder),O.isNullOrUndefined(this.inputWrapper.buttons[0])||O.isNullOrUndefined(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon");break;case"strictMode":this.invalidValueString=null,e.strictMode&&this.checkErrorState(null),this.setProperties({strictMode:e.strictMode},!0),this.checkValue(this.inputElement.value),this.checkValueChange(null,!1);break;case"scrollTo":this.checkDateValue(new Date(this.checkInValue(e.scrollTo)))?(this.popupWrapper&&this.setScrollTo(),this.setProperties({scrollTo:this.checkDateValue(new Date(this.checkInValue(e.scrollTo)))},!0)):this.setProperties({scrollTo:null},!0);break;case"enableMask":this.enableMask?(this.notify("createMask",{module:"MaskedDateTime"}),this.updateInputValue(this.maskedDateValue)):this.inputElement.value===this.maskedDateValue&&this.updateInputValue("")}}},x.prototype.checkInValue=function(e){return e instanceof Date?e.toUTCString():""+e},V([O.Property(null)],x.prototype,"width",void 0),V([O.Property(null)],x.prototype,"cssClass",void 0),V([O.Property(!1)],x.prototype,"strictMode",void 0),V([O.Property(null)],x.prototype,"keyConfigs",void 0),V([O.Property(null)],x.prototype,"format",void 0),V([O.Property(!0)],x.prototype,"enabled",void 0),V([O.Property(!1)],x.prototype,"fullScreenMode",void 0),V([O.Property(!1)],x.prototype,"readonly",void 0),V([O.Property({})],x.prototype,"htmlAttributes",void 0),V([O.Property("Never")],x.prototype,"floatLabelType",void 0),V([O.Property(null)],x.prototype,"placeholder",void 0),V([O.Property(1e3)],x.prototype,"zIndex",void 0),V([O.Property(!1)],x.prototype,"enablePersistence",void 0),V([O.Property(!0)],x.prototype,"showClearButton",void 0),V([O.Property(30)],x.prototype,"step",void 0),V([O.Property(null)],x.prototype,"scrollTo",void 0),V([O.Property(null)],x.prototype,"value",void 0),V([O.Property(null)],x.prototype,"min",void 0),V([O.Property(null)],x.prototype,"max",void 0),V([O.Property(!0)],x.prototype,"allowEdit",void 0),V([O.Property(!1)],x.prototype,"openOnFocus",void 0),V([O.Property(!1)],x.prototype,"enableMask",void 0),V([O.Property({day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"})],x.prototype,"maskPlaceholder",void 0),V([O.Property(null)],x.prototype,"serverTimezoneOffset",void 0),V([O.Event()],x.prototype,"change",void 0),V([O.Event()],x.prototype,"created",void 0),V([O.Event()],x.prototype,"destroyed",void 0),V([O.Event()],x.prototype,"open",void 0),V([O.Event()],x.prototype,"itemRender",void 0),V([O.Event()],x.prototype,"close",void 0),V([O.Event()],x.prototype,"cleared",void 0),V([O.Event()],x.prototype,"blur",void 0),V([O.Event()],x.prototype,"focus",void 0);var Et,h=V([O.NotifyPropertyChanges],x);function x(e,t){t=Et.call(this,e,t)||this;return t.liCollections=[],t.timeCollections=[],t.disableItemCollection=[],t.invalidValueString=null,t.preventChange=!1,t.maskedDateValue="",t.moduleName=t.getModuleName(),t.timeOptions=e,t}Ct=function(e,t){return(Ct=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)};var Ct,S,V=function(e,t){function i(){this.constructor=e}Ct(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},P=function(e,t,i,s){var a,n=arguments.length,r=n<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;0<=l;l--)(a=e[l])&&(r=(n<3?a(r):3<n?a(t,i,r):a(t,i))||r);return 3<n&&r&&Object.defineProperty(t,i,r),r},kt=(new Date).getDate(),wt=(new Date).getMonth(),Mt=(new Date).getFullYear(),Vt=(new Date).getHours(),Ot=(new Date).getMinutes(),Nt=(new Date).getSeconds(),It=(new Date).getMilliseconds(),Tt="e-datetimepicker",xt="e-datetimepopup-wrapper",St="e-popup",Pt="e-input-focus",At="e-icon-anim",Ut="e-disabled",Ht="e-error",Wt="e-active",Ft="e-hover",Lt="e-list-item",Bt="e-time-overflow",V=(V(A,S=r),A.prototype.focusHandler=function(){this.clearLabelOverflowWidth(),this.enabled&&O.addClass([this.inputWrapper.container],Pt)},A.prototype.focusIn=function(){S.prototype.focusIn.call(this)},A.prototype.focusOut=function(){document.activeElement===this.inputElement&&(this.inputElement.blur(),this.inputWrapper)&&O.removeClass([this.inputWrapper.container],[Pt])},A.prototype.blurHandler=function(e){var t;this.updateLabelOverflowWidth(),this.enabled&&(this.isTimePopupOpen()&&this.isPreventBlur?this.inputElement.focus():(O.removeClass([this.inputWrapper.container],Pt),t={model:this},this.isTimePopupOpen()&&this.hide(e),this.trigger("blur",t)))},A.prototype.destroy=function(){this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),this.popupObject&&this.popupObject.element.classList.contains(St)&&(this.popupObject.destroy(),O.detach(this.dateTimeWrapper),this.dateTimeWrapper=void 0,this.liCollections=this.timeCollections=[],O.isNullOrUndefined(this.rippleFn)||this.rippleFn());this.inputElement&&u.Input.removeAttributes({"aria-live":"assertive","aria-atomic":"true","aria-invalid":"false",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-expanded":"false",role:"combobox",autocomplete:"off"},this.inputElement),this.isCalendar()&&(this.popupWrapper&&O.detach(this.popupWrapper),this.popupObject=this.popupWrapper=null,this.keyboardHandler.destroy()),this.unBindInputEvents(),this.liCollections=null,this.rippleFn=null,this.selectedElement=null,this.listTag=null,this.timeIcon=null,this.popupObject=null,this.preventArgs=null,this.keyboardModule=null,u.Input.destroy({element:this.inputElement,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),S.prototype.destroy.call(this)},A.prototype.render=function(){this.timekeyConfigure={enter:"enter",escape:"escape",end:"end",tab:"tab",home:"home",down:"downarrow",up:"uparrow",left:"leftarrow",right:"rightarrow",open:"alt+downarrow",close:"alt+uparrow"},this.valueWithMinutes=null,this.previousDateTime=null,this.isPreventBlur=!1,this.cloneElement=this.element.cloneNode(!0),this.dateTimeFormat=this.cldrDateTimeFormat(),this.initValue=this.value,"string"==typeof this.min&&(this.min=this.checkDateValue(new Date(this.min))),"string"==typeof this.max&&(this.max=this.checkDateValue(new Date(this.max))),"string"==typeof this.minTime&&(this.minTime=this.checkDateValue(new Date(this.minTime))),"string"==typeof this.maxTime&&(this.maxTime=this.checkDateValue(new Date(this.maxTime))),!O.isNullOrUndefined(O.closest(this.element,"fieldset"))&&O.closest(this.element,"fieldset").disabled&&(this.enabled=!1),S.prototype.updateHtmlAttributeToElement.call(this),this.checkAttributes(!1);var e={placeholder:this.placeholder};this.l10n=new O.L10n("datetimepicker",e,this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),S.prototype.render.call(this),this.createInputElement(),S.prototype.updateHtmlAttributeToWrapper.call(this),this.bindInputEvents(),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"}),this.setValue(!0),!this.enableMask||this.value||!this.maskedDateValue||"Always"!==this.floatLabelType&&this.floatLabelType&&this.placeholder||u.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton),this.setProperties({scrollTo:this.checkDateValue(new Date(this.checkValue(this.scrollTo)))},!0),this.previousDateTime=this.value&&new Date(+this.value),"EJS-DATETIMEPICKER"===this.element.tagName&&(this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex"),this.enabled||(this.inputElement.tabIndex=-1)),"Never"!==this.floatLabelType&&u.Input.calculateWidth(this.inputElement,this.inputWrapper.container),O.isNullOrUndefined(this.inputWrapper.buttons[0])||O.isNullOrUndefined(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-date-time-icon"),this.renderComplete()},A.prototype.setValue=function(e){var t;void 0===e&&(e=!1),this.initValue=this.validateMinMaxRange(this.value),!this.strictMode&&this.isDateObject(this.initValue)?(t=this.validateMinMaxRange(this.initValue),u.Input.setValue(this.getFormattedValue(t),this.inputElement,this.floatLabelType,this.showClearButton),this.setProperties({value:t},!0)):O.isNullOrUndefined(this.value)&&(this.initValue=null,this.setProperties({value:null},!0)),this.valueWithMinutes=this.value,S.prototype.updateInput.call(this,e)},A.prototype.validateMinMaxRange=function(e){var t=e;return this.isDateObject(e)?t=this.validateValue(e):+this.min>+this.max&&this.disablePopupButton(!0),this.checkValidState(t),t},A.prototype.checkValidState=function(e){this.isValidState=!0,this.strictMode||(+e>+this.max||+e<+this.min||!this.isValidTime(e))&&(this.isValidState=!1),this.checkErrorState()},A.prototype.checkErrorState=function(){this.isValidState?O.removeClass([this.inputWrapper.container],Ht):O.addClass([this.inputWrapper.container],Ht),O.attributes(this.inputElement,{"aria-invalid":this.isValidState?"false":"true"})},A.prototype.isValidTime=function(e){var t,i,s,a,n;return!(null!=e&&(this.minTime||this.maxTime)&&(n=s=i=t=void 0,a=36e5*e.getHours()+6e4*e.getMinutes()+1e3*e.getSeconds()+e.getMilliseconds(),this.minTime&&(t=36e5*this.minTime.getHours()+6e4*this.minTime.getMinutes()+1e3*this.minTime.getSeconds()+this.minTime.getMilliseconds()),this.maxTime&&(i=36e5*this.maxTime.getHours()+6e4*this.maxTime.getMinutes()+1e3*this.maxTime.getSeconds()+this.maxTime.getMilliseconds()),this.min&&+e.getDate()==+this.min.getDate()&&+e.getMonth()==+this.min.getMonth()&&+e.getFullYear()==+this.min.getFullYear()&&(t=t<(n=36e5*this.min.getHours()+6e4*this.min.getMinutes()+1e3*this.min.getSeconds()+this.min.getMilliseconds())?n:t),this.max&&+e.getDate()==+this.max.getDate()&&+e.getMonth()==+this.max.getMonth()&&+this.max.getFullYear()==+this.max.getFullYear()&&(i=(s=36e5*this.max.getHours()+6e4*this.max.getMinutes()+1e3*this.max.getSeconds()+this.max.getMilliseconds())<i?s:i),this.strictMode?(n=void 0,t&&a<t?(n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),this.minTime.getHours(),this.minTime.getMinutes(),this.minTime.getSeconds(),this.minTime.getMilliseconds()),this.setProperties({value:n},!0),this.changedArgs={value:this.value}):i&&i<a&&(n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),this.maxTime.getHours(),this.maxTime.getMinutes(),this.maxTime.getSeconds(),this.maxTime.getMilliseconds()),this.setProperties({value:n},!0),this.changedArgs={value:this.value}),0):t&&a<t||i&&i<a))},A.prototype.validateValue=function(e){var t=e;return this.strictMode?+this.min>+this.max?(this.disablePopupButton(!0),t=this.max):+e<+this.min?t=this.min:+e>+this.max&&(t=this.max):+this.min>+this.max&&(this.disablePopupButton(!0),t=e),t},A.prototype.disablePopupButton=function(e){e?(O.addClass([this.inputWrapper.buttons[0],this.timeIcon],Ut),this.hide()):O.removeClass([this.inputWrapper.buttons[0],this.timeIcon],Ut)},A.prototype.getFormattedValue=function(e){var t;return O.isNullOrUndefined(e)?null:(t="Gregorian"===this.calendarMode?{format:this.cldrDateTimeFormat(),type:"dateTime",skeleton:"yMd"}:{format:this.cldrDateTimeFormat(),type:"dateTime",skeleton:"yMd",calendar:"islamic"},this.globalize.formatDate(e,t))},A.prototype.isDateObject=function(e){return!O.isNullOrUndefined(e)&&!isNaN(+e)},A.prototype.createInputElement=function(){O.removeClass([this.inputElement],"e-datepicker"),O.removeClass([this.inputWrapper.container],"e-date-wrapper"),O.addClass([this.inputWrapper.container],"e-datetime-wrapper"),O.addClass([this.inputElement],Tt),this.renderTimeIcon(),this.updateLabelOverflowWidth()},A.prototype.renderTimeIcon=function(){this.timeIcon=u.Input.appendSpan("e-input-group-icon e-time-icon e-icons",this.inputWrapper.container)},A.prototype.bindInputEvents=function(){O.EventHandler.add(this.timeIcon,"mousedown",this.timeHandler,this),O.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.dateHandler,this),O.EventHandler.add(this.inputElement,"blur",this.blurHandler,this),O.EventHandler.add(this.inputElement,"focus",this.focusHandler,this),this.defaultKeyConfigs=O.extend(this.defaultKeyConfigs,this.keyConfigs),this.keyboardHandler=new O.KeyboardEvents(this.inputElement,{eventName:"keydown",keyAction:this.inputKeyAction.bind(this),keyConfigs:this.defaultKeyConfigs})},A.prototype.unBindInputEvents=function(){O.EventHandler.remove(this.timeIcon,"mousedown touchstart",this.timeHandler),O.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown touchstart",this.dateHandler),this.inputElement&&(O.EventHandler.remove(this.inputElement,"blur",this.blurHandler),O.EventHandler.remove(this.inputElement,"focus",this.focusHandler)),this.keyboardHandler&&this.keyboardHandler.destroy()},A.prototype.cldrTimeFormat=function(){var e=this.isNullOrEmpty(this.timeFormat)?"en"===this.locale||"en-US"===this.locale?O.getValue("timeFormats.short",O.getDefaultDateObject()):this.getCultureTimeObject(O.cldrData,""+this.locale):this.timeFormat;return e},A.prototype.cldrDateTimeFormat=function(){var e=new O.Internationalization(this.locale).getDatePattern({skeleton:"yMd"}),e=this.isNullOrEmpty(this.formatString)?e+" "+this.getCldrFormat("time"):this.formatString;return e},A.prototype.getCldrFormat=function(e){var t="en"===this.locale||"en-US"===this.locale?O.getValue("timeFormats.short",O.getDefaultDateObject()):this.getCultureTimeObject(O.cldrData,""+this.locale);return t},A.prototype.isNullOrEmpty=function(e){return!!(O.isNullOrUndefined(e)||"string"==typeof e&&""===e.trim())},A.prototype.getCultureTimeObject=function(e,t){return"Gregorian"===this.calendarMode?O.getValue("main."+this.locale+".dates.calendars.gregorian.timeFormats.short",e):O.getValue("main."+this.locale+".dates.calendars.islamic.timeFormats.short",e)},A.prototype.timeHandler=function(e){this.enabled&&(this.isIconClicked=!0,O.Browser.isDevice&&this.inputElement.setAttribute("readonly",""),e.currentTarget===this.timeIcon&&e.preventDefault(),this.enabled&&!this.readonly&&(this.isDatePopupOpen()&&S.prototype.hide.call(this,e),this.isTimePopupOpen()?this.closePopup(e):(this.inputElement.focus(),this.popupCreation("time",e),O.addClass([this.inputWrapper.container],[Pt]))),this.isIconClicked=!1)},A.prototype.dateHandler=function(e){this.enabled&&(e.currentTarget===this.inputWrapper.buttons[0]&&e.preventDefault(),this.enabled)&&!this.readonly&&(this.isTimePopupOpen()&&this.closePopup(e),O.isNullOrUndefined(this.popupWrapper)||this.popupCreation("date",e))},A.prototype.show=function(e,t){this.enabled&&this.readonly||!this.enabled||("time"!==e||this.dateTimeWrapper?this.popupObj||(this.isTimePopupOpen()&&this.hide(t),S.prototype.show.call(this),this.popupCreation("date",t)):(this.isDatePopupOpen()&&this.hide(t),this.popupCreation("time",t)))},A.prototype.toggle=function(e){this.isDatePopupOpen()?(S.prototype.hide.call(this,e),this.show("time",null)):this.isTimePopupOpen()?(this.hide(e),S.prototype.show.call(this,null,e),this.popupCreation("date",null)):this.show(null,e)},A.prototype.listCreation=function(){var e="Gregorian"===this.calendarMode?(this.cldrDateTimeFormat().replace(this.formatRegex,this.TimePopupFormat()),""===this.dateFormatString&&(this.dateFormatString=this.cldrDateTimeFormat()),this.globalize.parseDate(this.getAmPmValue(this.inputElement.value),{format:this.dateFormatString,type:"datetime"})):this.globalize.parseDate(this.getAmPmValue(this.inputElement.value),{format:this.cldrDateTimeFormat(),type:"datetime",calendar:"islamic"}),e=O.isNullOrUndefined(this.value)?""!==this.inputElement.value?e:new Date:this.value,t=(this.valueWithMinutes=e,this.listWrapper=O.createElement("div",{className:"e-content",attrs:{tabindex:"0"}}),this.startTime(e)),e=this.endTime(e),t=i.TimePickerBase.createListItems(this.createElement,t,e,this.globalize,this.cldrTimeFormat(),this.step),e=(this.timeCollections=t.collection,this.listTag=t.list,O.attributes(this.listTag,{role:"listbox","aria-hidden":"false",id:this.element.id+"_options"}),O.append([t.list],this.listWrapper),this.wireTimeListEvents(),{duration:300,selector:"."+Lt});this.rippleFn=O.rippleEffect(this.listWrapper,e),this.liCollections=this.listWrapper.querySelectorAll("."+Lt)},A.prototype.popupCreation=function(e,t){O.Browser.isDevice&&this.element.setAttribute("readonly","readonly"),"date"===e?!this.readonly&&this.popupWrapper&&(O.addClass([this.popupWrapper],xt),O.attributes(this.popupWrapper,{id:this.element.id+"_options"})):this.readonly||((e=O.createElement("div",{className:Tt+" "+St,attrs:{id:this.element.id+"_timepopup"}})).style.cssText="visibility: hidden; display: block;",this.dateTimeWrapper=e,O.isNullOrUndefined(this.cssClass)||(this.dateTimeWrapper.className+=" "+this.cssClass),!O.isNullOrUndefined(this.step)&&0<this.step&&(this.listCreation(),O.append([this.listWrapper],this.dateTimeWrapper)),document.body.appendChild(this.dateTimeWrapper),this.addTimeSelection(),this.renderPopup(),this.setTimeScrollPosition(),this.openPopup(t),O.Browser.isDevice&&(!O.Browser.isDevice||this.fullScreenMode)||this.popupObject.refreshPosition(this.inputElement),O.Browser.isDevice&&(this.modelWrapper.style.zIndex=(this.popupObject.zIndex-1).toString(),this.fullScreenMode)&&(this.dateTimeWrapper.style.left="0px"))},A.prototype.openPopup=function(e){var t=this,e=(this.preventArgs={cancel:!1,popup:this.popupObject,event:e||null},this.preventArgs);this.trigger("open",e,function(e){t.preventArgs=e,t.preventArgs.cancel||t.readonly||(e={name:"FadeIn",duration:100},1e3===t.zIndex?t.popupObject.show(new O.Animation(e),t.element):t.popupObject.show(new O.Animation(e),null),O.addClass([t.inputWrapper.container],[At]),O.attributes(t.inputElement,{"aria-expanded":"true"}),O.attributes(t.inputElement,{"aria-owns":t.inputElement.id+"_options"}),O.attributes(t.inputElement,{"aria-controls":t.inputElement.id}),O.EventHandler.add(document,"mousedown touchstart",t.documentClickHandler,t))})},A.prototype.documentClickHandler=function(e){var t=e.target;!O.isNullOrUndefined(this.popupObject)&&(this.inputWrapper.container.contains(t)&&"mousedown"!==e.type||this.popupObject.element&&this.popupObject.element.contains(t))&&"touchstart"!==e.type&&e.preventDefault(),O.closest(t,'[id="'+(this.popupObject&&this.popupObject.element.id+'"]'))||t===this.inputElement||t===this.timeIcon||O.isNullOrUndefined(this.inputWrapper)||t===this.inputWrapper.container?t===this.inputElement||O.Browser.isDevice||(this.isPreventBlur=document.activeElement===this.inputElement&&(O.Browser.isIE||"edge"===O.Browser.info.name)&&t===this.popupObject.element):this.isTimePopupOpen()&&(this.hide(e),t.classList.contains("e-dlg-overlay")?e.preventDefault():this.focusOut())},A.prototype.isTimePopupOpen=function(){return!(!this.dateTimeWrapper||!this.dateTimeWrapper.classList.contains(Tt))},A.prototype.isDatePopupOpen=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains(xt))},A.prototype.renderPopup=function(){var e,t,i,s=this;this.containerStyle=this.inputWrapper.container.getBoundingClientRect(),O.Browser.isDevice&&(this.timeModal=O.createElement("div"),this.timeModal.className=Tt+" e-time-modal",document.body.className+=" "+Bt,this.timeModal.style.display="block",document.body.appendChild(this.timeModal)),O.Browser.isDevice&&(this.modelWrapper=O.createElement("div",{className:"e-datetime-mob-popup-wrap"}),this.modelWrapper.appendChild(this.dateTimeWrapper),(e=O.createElement("div",{className:"e-dlg-overlay"})).style.zIndex=(this.zIndex-1).toString(),this.modelWrapper.appendChild(e),document.body.appendChild(this.modelWrapper));this.popupObject=new H.Popup(this.dateTimeWrapper,{width:this.setPopupWidth(),zIndex:this.zIndex,targetType:"container",collision:O.Browser.isDevice?{X:"fit",Y:"fit"}:{X:"flip",Y:"flip"},relateTo:O.Browser.isDevice?document.body:this.inputWrapper.container,position:O.Browser.isDevice?{X:"center",Y:"center"}:{X:"left",Y:"bottom"},enableRtl:this.enableRtl,offsetY:4,open:function(){s.dateTimeWrapper.style.visibility="visible",O.addClass([s.timeIcon],Wt),O.Browser.isDevice||(s.timekeyConfigure=O.extend(s.timekeyConfigure,s.keyConfigs),s.inputEvent=new O.KeyboardEvents(s.inputWrapper.container,{keyAction:s.timeKeyActionHandle.bind(s),keyConfigs:s.timekeyConfigure,eventName:"keydown"}))},close:function(){O.removeClass([s.timeIcon],Wt),s.unWireTimeListEvents(),s.inputElement.removeAttribute("aria-activedescendant"),O.remove(s.popupObject.element),s.popupObject.destroy(),s.dateTimeWrapper.innerHTML="",s.modelWrapper&&O.remove(s.modelWrapper),s.listWrapper=s.dateTimeWrapper=void 0,s.inputEvent&&s.inputEvent.destroy()},targetExitViewport:function(){O.Browser.isDevice||s.hide()}}),O.Browser.isDevice&&this.fullScreenMode?(this.popupObject.element.style.maxHeight="100%",this.popupObject.element.style.width="100%"):this.popupObject.element.style.maxHeight="250px",O.Browser.isDevice&&this.fullScreenMode&&(e=this.createElement("div",{className:"e-model-header"}),(t=this.createElement("span",{className:"e-model-title"})).textContent="Select time",i=this.createElement("span",{className:"e-popup-close"}),O.EventHandler.add(i,"mousedown touchstart",this.dateTimeCloseHandler,this),e.appendChild(i),e.appendChild(t),this.dateTimeWrapper.insertBefore(e,this.dateTimeWrapper.firstElementChild))},A.prototype.dateTimeCloseHandler=function(e){this.hide()},A.prototype.setDimension=function(e){return"number"==typeof e?e=O.formatUnit(e):"string"!=typeof e&&(e="100%"),e},A.prototype.setPopupWidth=function(){var e=this.setDimension(this.width);return e=-1<e.indexOf("%")?(this.containerStyle.width*parseFloat(e)/100).toString()+"px":e},A.prototype.wireTimeListEvents=function(){O.EventHandler.add(this.listWrapper,"click",this.onMouseClick,this),O.Browser.isDevice||(O.EventHandler.add(this.listWrapper,"mouseover",this.onMouseOver,this),O.EventHandler.add(this.listWrapper,"mouseout",this.onMouseLeave,this))},A.prototype.unWireTimeListEvents=function(){this.listWrapper&&(O.EventHandler.remove(this.listWrapper,"click",this.onMouseClick),O.EventHandler.remove(document,"mousedown touchstart",this.documentClickHandler),O.Browser.isDevice||(O.EventHandler.add(this.listWrapper,"mouseover",this.onMouseOver,this),O.EventHandler.add(this.listWrapper,"mouseout",this.onMouseLeave,this)))},A.prototype.onMouseOver=function(e){e=O.closest(e.target,"."+Lt);this.setTimeHover(e,Ft)},A.prototype.onMouseLeave=function(){this.removeTimeHover(Ft)},A.prototype.setTimeHover=function(e,t){this.enabled&&this.isValidLI(e)&&!e.classList.contains(t)&&(this.removeTimeHover(t),O.addClass([e],t))},A.prototype.getPopupHeight=function(){var e=parseInt("250px",10),t=this.dateTimeWrapper.getBoundingClientRect().height;return(!O.Browser.isDevice||!this.fullScreenMode)&&e<t?e:t},A.prototype.changeEvent=function(e){S.prototype.changeEvent.call(this,e),(this.value&&this.value.valueOf())!==(this.previousDateTime&&+this.previousDateTime.valueOf())&&(this.valueWithMinutes=this.value,this.setInputValue("date"),this.previousDateTime=this.value&&new Date(+this.value))},A.prototype.updateValue=function(e){this.setInputValue("time"),+this.previousDateTime!=+this.value&&(this.changedArgs={value:this.value,event:e||null,isInteracted:!O.isNullOrUndefined(e),element:this.element},this.addTimeSelection(),this.trigger("change",this.changedArgs),this.previousDateTime=this.previousDate=this.value)},A.prototype.setTimeScrollPosition=function(){var e=this.selectedElement;O.isNullOrUndefined(e)?this.dateTimeWrapper&&this.checkDateValue(this.scrollTo)&&this.setScrollTo():this.findScrollTop(e)},A.prototype.findScrollTop=function(e){var t=this.getPopupHeight(),i=e.nextElementSibling,s=(i||e).offsetTop,a=e.getBoundingClientRect().height;s+e.offsetTop>t?O.Browser.isDevice&&this.fullScreenMode?this.dateTimeWrapper.querySelector(".e-content").scrollTop=i?s-(t/2+a/2):s:this.dateTimeWrapper.scrollTop=i?s-(t/2+a/2):s:this.dateTimeWrapper.scrollTop=0},A.prototype.setScrollTo=function(){var e,t,i=this.dateTimeWrapper.querySelectorAll("."+Lt);0<=i.length?(this.scrollInvoked=!0,e=this.timeCollections[0],t=this.getDateObject(this.checkDateValue(this.scrollTo)).getTime(),t=i[Math.round((t-e)/(6e4*this.step))]):this.dateTimeWrapper.scrollTop=0,O.isNullOrUndefined(t)?this.dateTimeWrapper.scrollTop=0:this.findScrollTop(t)},A.prototype.setInputValue=function(e){"date"===e?(this.inputElement.value=this.previousElementValue=this.getFormattedValue(this.getFullDateTime()),this.setProperties({value:this.getFullDateTime()},!0)):(e=this.getFormattedValue(new Date(this.timeCollections[this.activeIndex])),u.Input.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton),this.previousElementValue=this.inputElement.value,this.setProperties({value:new Date(this.timeCollections[this.activeIndex])},!0),this.enableMask&&this.createMask()),this.updateIconState()},A.prototype.getFullDateTime=function(){var e=null,e=this.isDateObject(this.valueWithMinutes)?this.combineDateTime(this.valueWithMinutes):this.previousDate;return this.validateMinMaxRange(e)},A.prototype.createMask=function(){this.notify("createMask",{module:"MaskedDateTime"})},A.prototype.combineDateTime=function(e){var t,i,s,a,n;return this.isDateObject(e)?(t=this.previousDate.getDate(),i=this.previousDate.getMonth(),s=this.previousDate.getFullYear(),a=e.getHours(),n=e.getMinutes(),e=e.getSeconds(),new Date(s,i,t,a,n,e)):this.previousDate},A.prototype.onMouseClick=function(e){var t=e.target,t=this.selectedElement=O.closest(t,"."+Lt);t&&t.classList.contains(Lt)&&(this.timeValue=t.getAttribute("data-value"),this.hide(e)),this.setSelection(t,e)},A.prototype.setSelection=function(e,t){this.isValidLI(e)&&!e.classList.contains(Wt)&&(this.selectedElement=e,e=Array.prototype.slice.call(this.liCollections).indexOf(e),this.activeIndex=e,this.valueWithMinutes=new Date(this.timeCollections[this.activeIndex]),O.addClass([this.selectedElement],Wt),this.selectedElement.setAttribute("aria-selected","true"),this.updateValue(t))},A.prototype.setTimeActiveClass=function(){var e=O.isNullOrUndefined(this.dateTimeWrapper)?this.listWrapper:this.dateTimeWrapper;if(!O.isNullOrUndefined(e)){var t=e.querySelectorAll("."+Lt);if(t.length)for(var i=0;i<t.length;i++)if(this.timeCollections[i]===+this.valueWithMinutes){t[i].setAttribute("aria-selected","true"),this.selectedElement=t[i],this.activeIndex=i,this.setTimeActiveDescendant();break}}},A.prototype.setTimeActiveDescendant=function(){!O.isNullOrUndefined(this.selectedElement)&&this.value?O.attributes(this.inputElement,{"aria-activedescendant":this.selectedElement.getAttribute("id")}):this.inputElement.removeAttribute("aria-activedescendant")},A.prototype.addTimeSelection=function(){this.selectedElement=null,this.removeTimeSelection(),this.setTimeActiveClass(),O.isNullOrUndefined(this.selectedElement)||(O.addClass([this.selectedElement],Wt),this.selectedElement.setAttribute("aria-selected","true"))},A.prototype.removeTimeSelection=function(){var e;this.removeTimeHover(Ft),O.isNullOrUndefined(this.dateTimeWrapper)||(e=this.dateTimeWrapper.querySelectorAll("."+Wt)).length&&(O.removeClass(e,Wt),e[0].removeAttribute("aria-selected"))},A.prototype.removeTimeHover=function(e){var t=this.getTimeHoverItem(e);t&&t.length&&O.removeClass(t,e)},A.prototype.getTimeHoverItem=function(e){var t,i=O.isNullOrUndefined(this.dateTimeWrapper)?this.listWrapper:this.dateTimeWrapper;return t=O.isNullOrUndefined(i)?t:i.querySelectorAll("."+e)},A.prototype.isValidLI=function(e){return e&&e.classList.contains(Lt)&&!e.classList.contains(Ut)},A.prototype.calculateStartEnd=function(e,t,i){var s=e.getDate(),a=e.getMonth(),n=e.getFullYear(),r=e.getHours(),l=e.getMinutes(),o=e.getSeconds(),e=e.getMilliseconds();return t?"starttime"===i?new Date(n,a,s,0,0,0):new Date(n,a,s,23,59,59):new Date(n,a,s,r,l,o,e)},A.prototype.startTime=function(e){var t,i,s,a=this.min,n=this.max,e=null===e?new Date:e,r=!1;return this.minTime?(s=new Date(e.getFullYear(),e.getMonth(),e.getDate(),this.minTime.getHours(),this.minTime.getMinutes(),this.minTime.getSeconds(),this.minTime.getMilliseconds()),r=!0):s=e,+s.getDate()==+a.getDate()&&+s.getMonth()==+a.getMonth()&&+s.getFullYear()==+a.getFullYear()||+new Date(s.getFullYear(),s.getMonth(),s.getDate())<=+new Date(a.getFullYear(),a.getMonth(),a.getDate())?(i=!1,t=a,r&&+new Date(s.getFullYear(),s.getMonth(),s.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds())>=+new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds())&&t.setHours(s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds())):+s<+n&&+a<+s?(i=!r,t=s):+n<=+s&&(i=!0,t=n),this.calculateStartEnd(t,i,"starttime")},A.prototype.TimePopupFormat=function(){var t="",i=0,s=this;return function(e){switch(e){case"d":case"dd":case"ddd":case"dddd":case"M":case"MM":case"MMM":case"MMMM":case"y":case"yy":case"yyy":case"yyyy":""===t?t+=e:t=t+"/"+e,i+=1}return 2<i&&(s.dateFormatString=t),t}},A.prototype.endTime=function(e){var t,i,s,a=this.max,e=null===e?new Date:e,n=!1;return this.maxTime?(s=new Date(e.getFullYear(),e.getMonth(),e.getDate(),this.maxTime.getHours(),this.maxTime.getMinutes(),this.maxTime.getSeconds(),this.maxTime.getMilliseconds()),n=!0):s=e,+s.getDate()==+a.getDate()&&+s.getMonth()==+a.getMonth()&&+s.getFullYear()==+a.getFullYear()||+new Date(s.getUTCFullYear(),s.getMonth(),s.getDate())>=+new Date(a.getFullYear(),a.getMonth(),a.getDate())?(i=!1,t=this.max,n&&+new Date(s.getUTCFullYear(),s.getMonth(),s.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds())<=+new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds())&&t.setHours(s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds())):+s<+this.max&&+s>+this.min?(i=!n,t=s):+s<=+this.min&&(i=!0,t=this.min),this.calculateStartEnd(t,i,"endtime")},A.prototype.hide=function(t){var e,i=this;this.popupObj||this.dateTimeWrapper?(this.preventArgs={cancel:!1,popup:this.popupObj||this.popupObject,event:t||null},e=this.preventArgs,O.isNullOrUndefined(this.popupObj)?this.trigger("close",e,function(e){i.dateTimeCloseEventCallback(t,e)}):this.dateTimeCloseEventCallback(t,e)):(O.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit())},A.prototype.dateTimeCloseEventCallback=function(e,t){this.preventArgs=t,this.preventArgs.cancel||(this.isDatePopupOpen()?S.prototype.hide.call(this,e):this.isTimePopupOpen()&&(this.closePopup(e),O.removeClass([document.body],Bt),O.Browser.isDevice&&this.timeModal&&(this.timeModal.style.display="none",this.timeModal.outerHTML="",this.timeModal=null),this.setTimeActiveDescendant())),O.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit()},A.prototype.closePopup=function(e){this.isTimePopupOpen()&&this.popupObject&&(this.popupObject.hide(new O.Animation({name:"FadeOut",duration:100,delay:0})),this.inputWrapper.container.classList.remove(At),O.attributes(this.inputElement,{"aria-expanded":"false"}),this.inputElement.removeAttribute("aria-owns"),this.inputElement.removeAttribute("aria-controls"),O.EventHandler.remove(document,"mousedown touchstart",this.documentClickHandler))},A.prototype.preRender=function(){this.checkFormat(),this.dateTimeFormat=this.cldrDateTimeFormat(),S.prototype.preRender.call(this),O.removeClass([this.inputElementCopy],[Tt])},A.prototype.getProperty=function(e,t){"min"===t?this.setProperties({min:this.validateValue(e.min)},!0):this.setProperties({max:this.validateValue(e.max)},!0)},A.prototype.checkAttributes=function(e){for(var t,i=0,s=e?O.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["style","name","step","disabled","readonly","value","min","max","placeholder","type"];i<s.length;i++){var a,n=s[i];if(!O.isNullOrUndefined(this.inputElement.getAttribute(n)))switch(n){case"name":this.inputElement.setAttribute("name",this.inputElement.getAttribute(n));break;case"step":this.step=parseInt(this.inputElement.getAttribute(n),10);break;case"readonly":(O.isNullOrUndefined(this.dateTimeOptions)||void 0===this.dateTimeOptions.readonly||e)&&(a="disabled"===this.inputElement.getAttribute(n)||""===this.inputElement.getAttribute(n)||"true"===this.inputElement.getAttribute(n),this.setProperties({readonly:a},!e));break;case"placeholder":(O.isNullOrUndefined(this.dateTimeOptions)||void 0===this.dateTimeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(n)},!e);break;case"min":(O.isNullOrUndefined(this.dateTimeOptions)||void 0===this.dateTimeOptions.min||e)&&(t=new Date(this.inputElement.getAttribute(n)),this.isNullOrEmpty(t)||isNaN(+t)||this.setProperties({min:t},!e));break;case"disabled":(O.isNullOrUndefined(this.dateTimeOptions)||void 0===this.dateTimeOptions.enabled||e)&&(a="disabled"!==this.inputElement.getAttribute(n)&&"true"!==this.inputElement.getAttribute(n)&&""!==this.inputElement.getAttribute(n),this.setProperties({enabled:a},!e));break;case"value":(O.isNullOrUndefined(this.dateTimeOptions)||void 0===this.dateTimeOptions.value||e)&&(t=new Date(this.inputElement.getAttribute(n)),this.isNullOrEmpty(t)||isNaN(+t)||this.setProperties({value:t},!e));break;case"max":(O.isNullOrUndefined(this.dateTimeOptions)||void 0===this.dateTimeOptions.max||e)&&(t=new Date(this.inputElement.getAttribute(n)),this.isNullOrEmpty(t)||isNaN(+t)||this.setProperties({max:t},!e))}}},A.prototype.requiredModules=function(){var e=[];return"Islamic"===this.calendarMode&&e.push({args:[this],member:"islamic",name:"Islamic"}),this.enableMask&&e.push(this.maskedDateModule()),e},A.prototype.maskedDateModule=function(){return{args:[this],member:"MaskedDateTime"}},A.prototype.getTimeActiveElement=function(){return O.isNullOrUndefined(this.dateTimeWrapper)?null:this.dateTimeWrapper.querySelectorAll("."+Wt)},A.prototype.createDateObj=function(e){return e instanceof Date?e:null},A.prototype.getDateObject=function(e){if(!this.isNullOrEmpty(e)){var t,i,s,a,n,r,e=this.createDateObj(e),l=this.valueWithMinutes,o=!O.isNullOrUndefined(l);if(this.checkDateValue(e))return t=o?l.getDate():kt,i=o?l.getMonth():wt,s=o?l.getFullYear():Mt,a=o?l.getHours():Vt,n=o?l.getMinutes():Ot,r=o?l.getSeconds():Nt,o=o?l.getMilliseconds():It,this.scrollInvoked?(this.scrollInvoked=!1,new Date(s,i,t,e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())):new Date(s,i,t,a,n,r,o)}return null},A.prototype.findNextTimeElement=function(e){var t=this.inputElement.value,i=O.isNullOrUndefined(this.valueWithMinutes)?this.createDateObj(t):this.getDateObject(this.valueWithMinutes),s=null,a=this.liCollections.length;if(!O.isNullOrUndefined(this.activeIndex)||!O.isNullOrUndefined(this.checkDateValue(i))){if("home"===e.action)s=+this.createDateObj(new Date(this.timeCollections[0])),this.activeIndex=0;else if("end"===e.action)s=+this.createDateObj(new Date(this.timeCollections[this.timeCollections.length-1])),this.activeIndex=this.timeCollections.length-1;else if("down"===e.action){for(var n=0;n<a;n++)if(+i<this.timeCollections[n]){s=+this.createDateObj(new Date(this.timeCollections[n])),this.activeIndex=n;break}}else for(n=a-1;0<=n;n--)if(+i>this.timeCollections[n]){s=+this.createDateObj(new Date(this.timeCollections[n])),this.activeIndex=n;break}this.selectedElement=this.liCollections[this.activeIndex],this.timeElementValue(O.isNullOrUndefined(s)?null:new Date(s))}},A.prototype.setTimeValue=function(e,t){t=this.validateMinMaxRange(t),t=this.createDateObj(t),this.getFormattedValue(t)!==(O.isNullOrUndefined(this.value)?null:this.getFormattedValue(this.value))?this.valueWithMinutes=O.isNullOrUndefined(t)?null:t:(this.strictMode&&(e=t),this.valueWithMinutes=this.checkDateValue(e)),t=new Date(+this.valueWithMinutes),e="Gregorian"===this.calendarMode?this.globalize.formatDate(t,{format:O.isNullOrUndefined(this.formatString)?this.cldrDateTimeFormat():this.formatString,type:"dateTime",skeleton:"yMd"}):this.globalize.formatDate(t,{format:O.isNullOrUndefined(this.formatString)?this.cldrDateTimeFormat():this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"});return this.strictMode||O.isNullOrUndefined(t),u.Input.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton),t},A.prototype.timeElementValue=function(e){var t;return O.isNullOrUndefined(this.checkDateValue(e))||this.isNullOrEmpty(e)?null:(t=e instanceof Date?e:this.getDateObject(e),this.setTimeValue(t,e))},A.prototype.timeKeyHandler=function(e){var t,i,s;O.isNullOrUndefined(this.step)||this.step<=0||(t=this.timeCollections.length,O.isNullOrUndefined(this.getTimeActiveElement())||0===this.getTimeActiveElement().length?0<this.liCollections.length&&(O.isNullOrUndefined(this.value)&&O.isNullOrUndefined(this.activeIndex)?(this.activeIndex=0,this.selectedElement=this.liCollections[0],this.timeElementValue(new Date(this.timeCollections[0]))):this.findNextTimeElement(e)):(i=void 0,37<=e.keyCode&&e.keyCode<=40?(s=40===e.keyCode||39===e.keyCode?++this.activeIndex:--this.activeIndex,this.activeIndex=s=this.activeIndex===t?0:this.activeIndex,this.activeIndex=s=this.activeIndex<0?t-1:this.activeIndex,i=O.isNullOrUndefined(this.timeCollections[s])?this.timeCollections[0]:this.timeCollections[s]):"home"===e.action?(this.activeIndex=0,i=this.timeCollections[0]):"end"===e.action&&(this.activeIndex=t-1,i=this.timeCollections[t-1]),this.selectedElement=this.liCollections[this.activeIndex],this.timeElementValue(new Date(i))),this.isNavigate=!0,this.setTimeHover(this.selectedElement,"e-navigation"),this.setTimeActiveDescendant(),!this.isTimePopupOpen())||null===this.selectedElement||e&&"click"===e.type||this.setTimeScrollPosition()},A.prototype.timeKeyActionHandle=function(e){if(this.enabled)switch("right"!==e.action&&"left"!==e.action&&"tab"!==e.action&&e.preventDefault(),e.action){case"up":case"down":case"home":case"end":this.timeKeyHandler(e);break;case"enter":this.isNavigate?(this.selectedElement=this.liCollections[this.activeIndex],this.valueWithMinutes=new Date(this.timeCollections[this.activeIndex]),this.setInputValue("time"),+this.previousDateTime!=+this.value&&(this.changedArgs.value=this.value,this.addTimeSelection(),this.previousDateTime=this.value)):this.updateValue(e),this.hide(e),O.addClass([this.inputWrapper.container],Pt),this.isNavigate=!1,e.stopPropagation();break;case"escape":this.hide(e);break;default:this.isNavigate=!1}},A.prototype.inputKeyAction=function(e){"altDownArrow"===e.action&&(this.strictModeUpdate(),this.updateInput(),this.toggle(e))},A.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){var a=s[i];switch(0<["blur","change","cleared","close","created","destroyed","focus","navigated","open","renderDayCell"].indexOf(a)&&this.isReact&&(this.isDynamicValueChanged=!0),a){case"value":this.isDynamicValueChanged=!0,this.invalidValueString=null,this.checkInvalidValue(e.value),e.value=this.value,e.value=this.validateValue(e.value),this.enableMask?u.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton):u.Input.setValue(this.getFormattedValue(e.value),this.inputElement,this.floatLabelType,this.showClearButton),this.valueWithMinutes=e.value,this.setProperties({value:e.value},!0),this.popupObj&&this.popupUpdate(),this.previousDateTime=new Date(this.inputElement.value),this.updateInput(),this.changeTrigger(null),this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange,this.enableMask&&this.value&&this.notify("createMask",{module:"MaskedDateTime"});break;case"min":case"max":this.getProperty(e,a),this.updateInput();break;case"enableRtl":u.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]);break;case"cssClass":O.isNullOrUndefined(t.cssClass)||(t.cssClass=t.cssClass.replace(/\s+/g," ").trim()),O.isNullOrUndefined(e.cssClass)||(e.cssClass=e.cssClass.replace(/\s+/g," ").trim()),u.Input.setCssClass(e.cssClass,[this.inputWrapper.container],t.cssClass),this.dateTimeWrapper&&u.Input.setCssClass(e.cssClass,[this.dateTimeWrapper],t.cssClass);break;case"locale":this.globalize=new O.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.dateTimeOptions&&null==this.dateTimeOptions.placeholder&&(this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),u.Input.setPlaceholder(this.l10n.getConstant("placeholder"),this.inputElement)),this.dateTimeFormat=this.cldrDateTimeFormat(),S.prototype.updateInput.call(this);break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.checkAttributes(!0);break;case"format":this.setProperties({format:e.format},!0),this.checkFormat(),this.dateTimeFormat=this.formatString,this.setValue(),this.enableMask&&(this.notify("createMask",{module:"MaskedDateTime"}),this.value||u.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton));break;case"placeholder":u.Input.setPlaceholder(e.placeholder,this.inputElement);break;case"enabled":u.Input.setEnabled(this.enabled,this.inputElement),this.enabled?this.inputElement.setAttribute("tabindex",this.tabIndex):this.inputElement.tabIndex=-1;break;case"strictMode":this.invalidValueString=null,this.updateInput();break;case"width":this.setWidth(e.width),u.Input.calculateWidth(this.inputElement,this.inputWrapper.container),O.isNullOrUndefined(this.inputWrapper.buttons[0])||O.isNullOrUndefined(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-date-time-icon");break;case"readonly":u.Input.setReadonly(this.readonly,this.inputElement);break;case"floatLabelType":this.floatLabelType=e.floatLabelType,u.Input.removeFloating(this.inputWrapper),u.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder),O.isNullOrUndefined(this.inputWrapper.buttons[0])||O.isNullOrUndefined(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-date-time-icon");break;case"scrollTo":this.checkDateValue(new Date(this.checkValue(e.scrollTo)))?(this.dateTimeWrapper&&this.setScrollTo(),this.setProperties({scrollTo:this.checkDateValue(new Date(this.checkValue(e.scrollTo)))},!0)):this.setProperties({scrollTo:null},!0);break;case"enableMask":this.enableMask?(this.notify("createMask",{module:"MaskedDateTime"}),u.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton)):this.inputElement.value===this.maskedDateValue&&(this.maskedDateValue="",u.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton));break;default:S.prototype.onPropertyChanged.call(this,e,t)}this.isDynamicValueChanged||this.hide(null),this.isDynamicValueChanged=!1}},A.prototype.updateLabelOverflowWidth=function(){for(var e=this.inputWrapper.container,t=e.querySelector(".e-float-text.e-label-bottom"),i=0,s=e.querySelectorAll(".e-input-group-icon, .e-clear-icon"),a=0;a<s.length;a++)i+=s[a].offsetWidth;!t||!(e=this.element.parentElement.offsetWidth-i)||this.cssClass&&-1!==this.cssClass.split(" ").indexOf("e-outline")||(t.style.width=e+"px")},A.prototype.clearLabelOverflowWidth=function(){var e=this.inputWrapper.container.querySelector(".e-float-text.e-label-top");e&&e.removeAttribute("style")},A.prototype.getModuleName=function(){return"datetimepicker"},A.prototype.restoreValue=function(){this.previousDateTime=this.previousDate,this.currentDate=this.value||new Date,this.valueWithMinutes=this.value,this.previousDate=this.value,this.previousElementValue=this.previousElementValue=O.isNullOrUndefined(this.inputValueCopy)?"":this.getFormattedValue(this.inputValueCopy)},P([O.Property(null)],A.prototype,"timeFormat",void 0),P([O.Property(30)],A.prototype,"step",void 0),P([O.Property(null)],A.prototype,"scrollTo",void 0),P([O.Property(1e3)],A.prototype,"zIndex",void 0),P([O.Property(null)],A.prototype,"value",void 0),P([O.Property(null)],A.prototype,"keyConfigs",void 0),P([O.Property({})],A.prototype,"htmlAttributes",void 0),P([O.Property(!1)],A.prototype,"enablePersistence",void 0),P([O.Property(!0)],A.prototype,"allowEdit",void 0),P([O.Property(!1)],A.prototype,"isMultiSelection",void 0),P([O.Property(null)],A.prototype,"values",void 0),P([O.Property(!0)],A.prototype,"showClearButton",void 0),P([O.Property(null)],A.prototype,"placeholder",void 0),P([O.Property(!1)],A.prototype,"strictMode",void 0),P([O.Property(!1)],A.prototype,"fullScreenMode",void 0),P([O.Property(null)],A.prototype,"serverTimezoneOffset",void 0),P([O.Property(new Date(1900,0,1))],A.prototype,"min",void 0),P([O.Property(new Date(2099,11,31))],A.prototype,"max",void 0),P([O.Property(null)],A.prototype,"minTime",void 0),P([O.Property(null)],A.prototype,"maxTime",void 0),P([O.Property(null)],A.prototype,"firstDayOfWeek",void 0),P([O.Property("Gregorian")],A.prototype,"calendarMode",void 0),P([O.Property("Month")],A.prototype,"start",void 0),P([O.Property("Month")],A.prototype,"depth",void 0),P([O.Property(!1)],A.prototype,"weekNumber",void 0),P([O.Property(!0)],A.prototype,"showTodayButton",void 0),P([O.Property("Short")],A.prototype,"dayHeaderFormat",void 0),P([O.Property(!1)],A.prototype,"openOnFocus",void 0),P([O.Property(!1)],A.prototype,"enableMask",void 0),P([O.Property({day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"})],A.prototype,"maskPlaceholder",void 0),P([O.Event()],A.prototype,"open",void 0),P([O.Event()],A.prototype,"close",void 0),P([O.Event()],A.prototype,"cleared",void 0),P([O.Event()],A.prototype,"blur",void 0),P([O.Event()],A.prototype,"focus",void 0),P([O.Event()],A.prototype,"created",void 0),P([O.Event()],A.prototype,"destroyed",void 0),P([O.NotifyPropertyChanges],A));function A(e,t){t=S.call(this,e,t)||this;return t.valueWithMinutes=null,t.scrollInvoked=!1,t.moduleName=t.getModuleName(),t.formatRegex=/dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yyy|yy|y|'[^']*'|'[^']*'/g,t.dateFormatString="",t.dateTimeOptions=e,t}var jt="ArrowLeft",Yt="ArrowDown",Rt="shiftTab",zt="End",P=(U.prototype.getModuleName=function(){return"MaskedDateTime"},U.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("createMask",this.createMask,this),this.parent.on("setMaskSelection",this.validCharacterCheck,this),this.parent.on("inputHandler",this.maskInputHandler,this),this.parent.on("keyDownHandler",this.maskKeydownHandler,this),this.parent.on("clearHandler",this.clearHandler,this),this.parent.on("maskPasteInputHandler",this.maskPasteInputHandler,this))},U.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("createMask",this.createMask),this.parent.off("setMaskSelection",this.validCharacterCheck),this.parent.off("inputHandler",this.maskInputHandler),this.parent.off("keyDownHandler",this.maskKeydownHandler),this.parent.off("clearHandler",this.clearHandler),this.parent.off("maskPasteInputHandler",this.maskPasteInputHandler))},U.prototype.createMask=function(e){this.isDayPart=this.isMonthPart=this.isYearPart=this.isHourPart=this.isMinutePart=this.isSecondsPart=!1,this.dateformat=this.getCulturedFormat(),this.parent.maskPlaceholder.day&&(this.defaultConstant.day=this.parent.maskPlaceholder.day),this.parent.maskPlaceholder.month&&(this.defaultConstant.month=this.parent.maskPlaceholder.month),this.parent.maskPlaceholder.year&&(this.defaultConstant.year=this.parent.maskPlaceholder.year),this.parent.maskPlaceholder.hour&&(this.defaultConstant.hour=this.parent.maskPlaceholder.hour),this.parent.maskPlaceholder.minute&&(this.defaultConstant.minute=this.parent.maskPlaceholder.minute),this.parent.maskPlaceholder.second&&(this.defaultConstant.second=this.parent.maskPlaceholder.second),this.parent.maskPlaceholder.dayOfTheWeek&&(this.defaultConstant.dayOfTheWeek=this.parent.maskPlaceholder.dayOfTheWeek.toString()),this.getCUltureMaskFormat();var t=this.dateformat.replace(this.formatRegex,this.formatCheck());this.isHiddenMask=!0,this.hiddenMask=this.dateformat.replace(this.formatRegex,this.formatCheck()),this.isHiddenMask=!1,this.previousHiddenMask=this.hiddenMask,this.mask=this.previousValue=t,this.parent.maskedDateValue=this.mask,this.parent.value&&(this.navigated=!0,this.isBlur=e.isBlur,this.setDynamicValue())},U.prototype.getCUltureMaskFormat=function(){this.l10n=new O.L10n(this.parent.moduleName,this.defaultConstant,this.parent.locale),this.objectString=Object.keys(this.defaultConstant);for(var e=0;e<this.objectString.length;e++)this.defaultConstant[this.objectString[e].toString()]=this.l10n.getConstant(this.objectString[e].toString())},U.prototype.validCharacterCheck=function(){for(var e=this.parent.inputElement.selectionStart,t=e="timepicker"!==this.parent.moduleName&&e===this.hiddenMask.length&&this.mask===this.parent.inputElement.value?0:e,i=e-1;t<this.hiddenMask.length||0<=i;t++,i--){if(t<this.hiddenMask.length&&-1!==this.validCharacters.indexOf(this.hiddenMask[t]))return void this.setSelection(this.hiddenMask[t]);if(0<=i&&-1!==this.validCharacters.indexOf(this.hiddenMask[i]))return void this.setSelection(this.hiddenMask[i])}},U.prototype.setDynamicValue=function(){this.maskDateValue=new Date(+this.parent.value),this.isDayPart=this.isMonthPart=this.isYearPart=this.isHourPart=this.isMinutePart=this.isSecondsPart=!0,this.updateValue(),this.isBlur||this.validCharacterCheck()},U.prototype.setSelection=function(e){for(var t=-1,i=0,s=0;s<this.hiddenMask.length;s++)this.hiddenMask[s]===e&&(i=s+1,-1===t)&&(t=s);this.parent.inputElement.setSelectionRange(t=t<0?0:t,i)},U.prototype.maskKeydownHandler=function(e){if("Backspace"===e.e.key){var t=this.parent.inputElement.selectionStart,i="";switch(i=-1!==this.validCharacters.indexOf(this.hiddenMask[t])?this.hiddenMask[t]:i){case"d":this.dayTypeCount=Math.max(this.dayTypeCount-1,0);break;case"M":this.monthTypeCount=Math.max(this.monthTypeCount-1,0);break;case"H":case"h":this.hourTypeCount=Math.max(this.hourTypeCount-1,0);break;case"m":this.minuteTypeCount=Math.max(this.minuteTypeCount-1,0);break;case"s":this.secondTypeCount=Math.max(this.secondTypeCount-1,0)}}else{var s;if(this.dayTypeCount=this.monthTypeCount=this.hourTypeCount=this.minuteTypeCount=this.secondTypeCount=0,"Delete"===e.e.key)this.isDeleteKey=!0;else if(e.e.altKey||e.e.ctrlKey||e.e.key!==jt&&"ArrowRight"!==e.e.key&&e.e.key!==Rt&&"Tab"!==e.e.key&&e.e.action!==Rt&&e.e.key!==zt&&"Home"!==e.e.key||(t=this.parent.inputElement.selectionStart,s=this.parent.inputElement.selectionEnd,a=this.parent.inputElement.value.length,0!==t||s!==a||"Tab"!==e.e.key&&e.e.action!==Rt||(s=e.e.action===Rt?s:0,this.parent.inputElement.selectionStart=this.parent.inputElement.selectionEnd=s),e.e.key!==zt&&"Home"!==e.e.key||(s=e.e.key===zt?a:0,this.parent.inputElement.selectionStart=this.parent.inputElement.selectionEnd=s),this.navigateSelection(e.e.key===jt||e.e.action===Rt||e.e.key===zt)),!(e.e.altKey||e.e.ctrlKey||"ArrowUp"!==e.e.key&&e.e.key!==Yt)){var t=this.parent.inputElement.selectionStart,i="",a=(-1!==this.validCharacters.indexOf(this.hiddenMask[t])&&(i=this.hiddenMask[t]),this.dateAlteration(e.e.key===Yt),this.dateformat.replace(this.formatRegex,this.formatCheck()));this.isHiddenMask=!0,this.hiddenMask=this.dateformat.replace(this.formatRegex,this.formatCheck()),this.isHiddenMask=!1,this.previousHiddenMask=this.hiddenMask,this.previousValue=a,this.parent.inputElement.value=a;for(var n=0;n<this.hiddenMask.length;n++)if(i===this.hiddenMask[n]){t=n;break}this.parent.inputElement.selectionStart=t,this.validCharacterCheck()}}},U.prototype.isPersist=function(){return this.parent.isFocused||this.navigated},U.prototype.differenceCheck=function(){var e=this.parent.inputElement.selectionStart,t=this.parent.inputElement.value,i=this.previousValue.substring(0,e+this.previousValue.length-t.length),s=t.substring(0,e),a=new Date(+this.maskDateValue),n=new Date(a.getFullYear(),a.getMonth()+1,0).getDate();if(0===i.indexOf(s)&&(0===s.length||this.previousHiddenMask[s.length-1]!==this.previousHiddenMask[s.length])){for(var r=s.length;r<i.length;r++)""!==this.previousHiddenMask[r]&&0<=this.validCharacters.indexOf(this.previousHiddenMask[r])&&(this.isDeletion=this.handleDeletion(this.previousHiddenMask[r],!1));if(this.isDeletion)return}switch(this.previousHiddenMask[e-1]){case"d":var l=(this.isDayPart&&a.getDate().toString().length<2&&!this.isPersist()?10*a.getDate():0)+parseInt(s[e-1],10);if(this.isDateZero="0"===s[e-1],this.parent.isFocused=this.parent.isFocused&&!1,this.navigated=this.navigated&&!1,isNaN(l))return;for(r=0;n<l;r++)l=parseInt(l.toString().slice(1),10);if(1<=l){if(a.setDate(l),this.isNavigate=2===l.toString().length,this.previousDate=new Date(a.getFullYear(),a.getMonth(),a.getDate()),a.getMonth()!==this.maskDateValue.getMonth())return;this.isDayPart=!0;var o=new Date(a.getFullYear(),a.getMonth()+1,0).getDate();this.dayTypeCount+=0===this.dayTypeCount&&parseInt(l+"0",10)>o?2:1}else this.isDayPart=!1,1===this.dayTypeCount&&this.isDateZero||(this.dayTypeCount+=this.isDateZero?1:0);break;case"M":var h,u=void 0,u=a.getMonth().toString().length<2&&!this.isPersist()?(this.isMonthPart?10*(a.getMonth()+1):0)+parseInt(s[e-1],10):parseInt(s[e-1],10);if(this.parent.isFocused=this.parent.isFocused&&!1,this.navigated=this.navigated&&!1,this.isMonthZero="0"===s[e-1],isNaN(u)){var d=this.getCulturedValue("months[stand-alone].wide"),p=Object.keys(d);for(this.monthCharacter+=s[e-1].toLowerCase();0<this.monthCharacter.length;){for(var r=1,c=0,m=p;c<m.length;c++){m[c];if(0===d[r].toLowerCase().indexOf(this.monthCharacter))return a.setMonth(r-1),this.isMonthPart=!0,void(this.maskDateValue=a);r++}this.monthCharacter=this.monthCharacter.substring(1,this.monthCharacter.length)}}else{for(;12<u;)u=parseInt(u.toString().slice(1),10);1<=u?(a.setMonth(u-1),10<=u||1===u?this.isLeadingZero&&1===u?(this.isNavigate=1===u.toString().length,this.isLeadingZero=!1):this.isNavigate=2===u.toString().length:this.isNavigate=1===u.toString().length,a.getMonth()!==u-1&&(a.setDate(1),a.setMonth(u-1)),this.isDayPart&&(o=new Date(this.previousDate.getFullYear(),this.previousDate.getMonth()+1,0).getDate(),h=new Date(a.getFullYear(),a.getMonth()+1,0).getDate(),this.previousDate.getDate()===o)&&h<=o&&a.setDate(h),this.previousDate=new Date(a.getFullYear(),a.getMonth(),a.getDate()),this.isMonthPart=!0,this.monthTypeCount=this.monthTypeCount+1,this.isLeadingZero=!1):(a.setMonth(0),this.isLeadingZero=!0,this.isMonthPart=!1,1===this.monthTypeCount&&this.isMonthZero||(this.monthTypeCount+=this.isMonthZero?1:0))}break;case"y":var f=(this.isYearPart&&a.getFullYear().toString().length<4&&!this.isShortYear?10*a.getFullYear():0)+parseInt(s[e-1],10),o=2!==(o=(this.dateformat.match(/y/g)||[]).length)?4:o;if(this.isShortYear=!1,this.isYearZero="0"===s[e-1],isNaN(f))return;for(;9999<f;)f=parseInt(f.toString().slice(1),10);f<1?this.isYearPart=!1:(a.setFullYear(f),f.toString().length===o&&(this.isNavigate=!0),this.previousDate=new Date(a.getFullYear(),a.getMonth(),a.getDate()),this.isYearPart=!0);break;case"h":if(this.hour=(this.isHourPart&&(a.getHours()%12||12).toString().length<2&&!this.isPersist()?10*(a.getHours()%12||12):0)+parseInt(s[e-1],10),this.parent.isFocused=this.parent.isFocused&&!1,this.navigated=this.navigated&&!1,isNaN(this.hour))return;for(;12<this.hour;)this.hour=parseInt(this.hour.toString().slice(1),10);a.setHours(12*Math.floor(a.getHours()/12)+this.hour%12),this.isNavigate=2===this.hour.toString().length,this.isHourPart=!0,this.hourTypeCount=0===this.hourTypeCount&&this.hour&&12<parseInt(this.hour+"0",10)?2:this.hourTypeCount+1;break;case"H":if(this.hour=(this.isHourPart&&a.getHours().toString().length<2&&!this.isPersist()?10*a.getHours():0)+parseInt(s[e-1],10),this.parent.isFocused=this.parent.isFocused&&!1,this.navigated=this.navigated&&!1,isNaN(this.hour))return;for(r=0;23<this.hour;r++)this.hour=parseInt(this.hour.toString().slice(1),10);a.setHours(this.hour),this.isNavigate=2===this.hour.toString().length,this.isHourPart=!0,this.hourTypeCount=0===this.hourTypeCount&&this.hour&&23<parseInt(this.hour+"0",10)?2:this.hourTypeCount+1;break;case"m":var v=(this.isMinutePart&&a.getMinutes().toString().length<2&&!this.isPersist()?10*a.getMinutes():0)+parseInt(s[e-1],10);if(this.parent.isFocused=this.parent.isFocused&&!1,this.navigated=this.navigated&&!1,isNaN(v))return;for(r=0;59<v;r++)v=parseInt(v.toString().slice(1),10);a.setMinutes(v),this.isNavigate=2===v.toString().length,this.isMinutePart=!0,this.minuteTypeCount=0===this.minuteTypeCount&&59<parseInt(v+"0",10)?2:this.minuteTypeCount+1;break;case"s":var g=(this.isSecondsPart&&a.getSeconds().toString().length<2&&!this.isPersist()?10*a.getSeconds():0)+parseInt(s[e-1],10);if(this.parent.isFocused=this.parent.isFocused&&!1,this.navigated=this.navigated&&!1,isNaN(g))return;for(r=0;59<g;r++)g=parseInt(g.toString().slice(1),10);a.setSeconds(g),this.isNavigate=2===g.toString().length,this.isSecondsPart=!0,this.secondTypeCount=0===this.secondTypeCount&&59<parseInt(g+"0",10)?2:this.secondTypeCount+1;break;case"a":this.periodCharacter+=s[e-1].toLowerCase();for(var y=this.getCulturedValue("dayPeriods.format.wide"),b=Object.keys(y),r=0;0<this.periodCharacter.length;r++)(0===y[b[0]].toLowerCase().indexOf(this.periodCharacter)&&12<=a.getHours()||0===y[b[1]].toLowerCase().indexOf(this.periodCharacter)&&a.getHours()<12)&&(a.setHours((a.getHours()+12)%24),this.maskDateValue=a),this.periodCharacter=this.periodCharacter.substring(1,this.periodCharacter.length)}this.maskDateValue=a},U.prototype.formatCheck=function(){var m=this;return function(e){var t,i,s=m.getCulturedValue("days[stand-alone].abbreviated"),a=Object.keys(s),n=m.getCulturedValue("days[stand-alone].wide"),r=Object.keys(n),l=m.getCulturedValue("days[stand-alone].narrow"),o=Object.keys(l),h=m.getCulturedValue("months[stand-alone].abbreviated"),u=m.getCulturedValue("months[stand-alone].wide"),d=m.getCulturedValue("dayPeriods.format.wide");switch(e){case"ddd":case"dddd":case"d":t=(m.isDayPart?m.maskDateValue.getDate():m.defaultConstant.day).toString(),t=m.zeroCheck(m.isDateZero,m.isDayPart,t),2===m.dayTypeCount&&(m.isNavigate=!0,m.dayTypeCount=0);break;case"dd":t=m.isDayPart?m.roundOff(m.maskDateValue.getDate(),2):m.defaultConstant.day.toString(),t=m.zeroCheck(m.isDateZero,m.isDayPart,t),2===m.dayTypeCount&&(m.isNavigate=!0,m.dayTypeCount=0);break;case"E":case"EE":case"EEE":case"ccc":t=(m.isDayPart&&m.isMonthPart&&m.isYearPart?s[a[m.maskDateValue.getDay()]]:m.defaultConstant.dayOfTheWeek).toString();break;case"EEEE":case"cccc":t=(m.isDayPart&&m.isMonthPart&&m.isYearPart?n[r[m.maskDateValue.getDay()]]:m.defaultConstant.dayOfTheWeek).toString();break;case"EEEEE":t=(m.isDayPart&&m.isMonthPart&&m.isYearPart?l[o[m.maskDateValue.getDay()]]:m.defaultConstant.dayOfTheWeek).toString();break;case"M":t=(m.isMonthPart?m.maskDateValue.getMonth()+1:m.defaultConstant.month).toString(),t=m.zeroCheck(m.isMonthZero,m.isMonthPart,t),2===m.monthTypeCount&&(m.isNavigate=!0,m.monthTypeCount=0);break;case"MM":t=m.isMonthPart?m.roundOff(m.maskDateValue.getMonth()+1,2):m.defaultConstant.month.toString(),t=m.zeroCheck(m.isMonthZero,m.isMonthPart,t),2===m.monthTypeCount&&(m.isNavigate=!0,m.monthTypeCount=0);break;case"MMM":t=m.isMonthPart?h[m.maskDateValue.getMonth()+1]:m.defaultConstant.month.toString();break;case"MMMM":t=m.isMonthPart?u[m.maskDateValue.getMonth()+1]:m.defaultConstant.month.toString();break;case"yy":t=m.isYearPart?m.roundOff(m.maskDateValue.getFullYear()%100,2):m.defaultConstant.year.toString(),t=m.zeroCheck(m.isYearZero,m.isYearPart,t);break;case"y":case"yyy":case"yyyy":t=m.isYearPart?m.roundOff(m.maskDateValue.getFullYear(),4):m.defaultConstant.year.toString(),t=m.zeroCheck(m.isYearZero,m.isYearPart,t);break;case"h":t=(m.isHourPart?m.maskDateValue.getHours()%12||12:m.defaultConstant.hour).toString(),2===m.hourTypeCount&&(m.isNavigate=!0,m.hourTypeCount=0);break;case"hh":t=m.isHourPart?m.roundOff(m.maskDateValue.getHours()%12||12,2):m.defaultConstant.hour.toString(),2===m.hourTypeCount&&(m.isNavigate=!0,m.hourTypeCount=0);break;case"H":t=(m.isHourPart?m.maskDateValue.getHours():m.defaultConstant.hour).toString(),2===m.hourTypeCount&&(m.isNavigate=!0,m.hourTypeCount=0);break;case"HH":t=m.isHourPart?m.roundOff(m.maskDateValue.getHours(),2):m.defaultConstant.hour.toString(),2===m.hourTypeCount&&(m.isNavigate=!0,m.hourTypeCount=0);break;case"m":t=(m.isMinutePart?m.maskDateValue.getMinutes():m.defaultConstant.minute).toString(),2===m.minuteTypeCount&&(m.isNavigate=!0,m.minuteTypeCount=0);break;case"mm":t=m.isMinutePart?m.roundOff(m.maskDateValue.getMinutes(),2):m.defaultConstant.minute.toString(),2===m.minuteTypeCount&&(m.isNavigate=!0,m.minuteTypeCount=0);break;case"s":t=(m.isSecondsPart?m.maskDateValue.getSeconds():m.defaultConstant.second).toString(),2===m.secondTypeCount&&(m.isNavigate=!0,m.secondTypeCount=0);break;case"ss":t=m.isSecondsPart?m.roundOff(m.maskDateValue.getSeconds(),2):m.defaultConstant.second.toString(),2===m.secondTypeCount&&(m.isNavigate=!0,m.secondTypeCount=0);break;case"f":t=Math.floor(m.maskDateValue.getMilliseconds()/100).toString();break;case"ff":i=m.maskDateValue.getMilliseconds(),99<m.maskDateValue.getMilliseconds()&&(i=Math.floor(m.maskDateValue.getMilliseconds()/10)),t=m.roundOff(i,2);break;case"fff":t=m.roundOff(m.maskDateValue.getMilliseconds(),3);break;case"a":case"aa":t=m.maskDateValue.getHours()<12?d.am:d.pm;break;case"z":case"zz":case"zzz":case"zzzz":i={format:e,type:"dateTime",skeleton:"yMd",calendar:m.parent.calendarMode},t=m.parent.globalize.formatDate(m.maskDateValue,i)}if(t=void 0!==t?t:e.slice(1,e.length-1),m.isHiddenMask){for(var p="",c=0;c<t.length;c++)p+=e[0];return p}return t}},U.prototype.isValidDate=function(e){e=new Date(e);return!isNaN(e.getTime())},U.prototype.maskPasteInputHandler=function(){this.isValidDate(this.parent.inputElement.value)?(this.maskDateValue=new Date(this.parent.inputElement.value),this.isDayPart=this.isMonthPart=this.isYearPart=this.isHourPart=this.isMinutePart=this.isSecondsPart=!0,this.updateValue(),this.isBlur||this.validCharacterCheck()):this.maskInputHandler()},U.prototype.maskInputHandler=function(){var e=this.parent.inputElement.selectionStart,t=(O.Browser.isDevice&&(O.Browser.isIos||O.Browser.isIos7)&&(e=this.normalizeTokenIndex(e)),""),i=(-1!==this.validCharacters.indexOf(this.hiddenMask[e])&&(t=this.hiddenMask[e]),this.differenceCheck(),this.dateformat.replace(this.formatRegex,this.formatCheck()));this.isHiddenMask=!0,this.hiddenMask=this.dateformat.replace(this.formatRegex,this.formatCheck()),this.isDateZero=this.isMonthZero=this.isYearZero=!1,this.isHiddenMask=!1,this.previousHiddenMask=this.hiddenMask,this.previousValue=i,this.parent.inputElement.value=i;for(var s=0;s<this.hiddenMask.length;s++)if(t===this.hiddenMask[s]){e=s;break}var a=null,n=0;O.Browser.isDevice&&(O.Browser.isIos||O.Browser.isIos7)&&(i=this.findScrollableParent(this.parent.inputElement),n=i?(a=i).scrollTop:(a=window).pageYOffset||document.documentElement.scrollTop||0),this.parent.inputElement.selectionStart=e,this.validCharacterCheck(),!this.isNavigate&&!this.isDeletion||this.isDeleteKey||(i=!this.isNavigate,this.isNavigate=this.isDeletion=!1,this.navigateSelection(i),O.Browser.isDevice&&(O.Browser.isIos||O.Browser.isIos7)&&setTimeout(function(){a?a.scrollTop=n:window.scrollTo(0,n)},0)),this.isDeleteKey&&(this.isDeletion=!1),this.isDeleteKey=!1},U.prototype.findScrollableParent=function(e){for(;e;){if(this.isScrollable(e))return e;e=e.parentElement}return null},U.prototype.isScrollable=function(e){var t=window.getComputedStyle(e).overflowY;return e.scrollHeight>e.clientHeight&&("auto"===t||"scroll"===t)},U.prototype.navigateSelection=function(e){var t=this.parent.inputElement.selectionStart,i=this.parent.inputElement.selectionEnd,s=e?t-1:i;for(this.navigated=!0;s<this.hiddenMask.length&&0<=s;){if(0<=this.validCharacters.indexOf(this.hiddenMask[s])){this.setSelection(this.hiddenMask[s]);break}s+=e?-1:1}},U.prototype.roundOff=function(e,t){for(var e=e.toString(),i=t-e.length,s="",a=0;a<i;a++)s+="0";return s+e},U.prototype.zeroCheck=function(e,t,i){return e&&!t?"0":i},U.prototype.handleDeletion=function(e,t){switch(e){case"d":this.isDayPart=t;break;case"M":(this.isMonthPart=t)||(this.maskDateValue.setMonth(0),this.monthCharacter="");break;case"y":this.isYearPart=t;break;case"H":case"h":(this.isHourPart=t)||(this.periodCharacter="");break;case"m":this.isMinutePart=t;break;case"s":this.isSecondsPart=t;break;default:return!1}return!0},U.prototype.dateAlteration=function(e){var t=this.parent.inputElement.selectionStart,i="";if(-1!==this.validCharacters.indexOf(this.hiddenMask[t])){var i=this.hiddenMask[t],s=new Date(this.maskDateValue.getFullYear(),this.maskDateValue.getMonth(),this.maskDateValue.getDate(),this.maskDateValue.getHours(),this.maskDateValue.getMinutes(),this.maskDateValue.getSeconds()),a=(this.previousDate=new Date(this.maskDateValue.getFullYear(),this.maskDateValue.getMonth(),this.maskDateValue.getDate(),this.maskDateValue.getHours(),this.maskDateValue.getMinutes(),this.maskDateValue.getSeconds()),e?-1:1);switch(i){case"d":s.setDate(s.getDate()+a);break;case"M":var n,r=s.getMonth()+a;s.setDate(1),s.setMonth(r),this.isDayPart&&(r=new Date(this.previousDate.getFullYear(),this.previousDate.getMonth()+1,0).getDate(),n=new Date(s.getFullYear(),s.getMonth()+1,0).getDate(),this.previousDate.getDate()===r)&&n<=r?s.setDate(n):s.setDate(this.previousDate.getDate()),this.previousDate=new Date(s.getFullYear(),s.getMonth(),s.getDate());break;case"y":s.setFullYear(s.getFullYear()+a);break;case"H":case"h":s.setHours(s.getHours()+a);break;case"m":s.setMinutes(s.getMinutes()+a);break;case"s":s.setSeconds(s.getSeconds()+a);break;case"a":s.setHours((s.getHours()+12)%24)}this.maskDateValue=0<s.getFullYear()?s:this.maskDateValue,-1!==this.validCharacters.indexOf(this.hiddenMask[t])&&this.handleDeletion(this.hiddenMask[t],!0)}},U.prototype.getCulturedValue=function(e){var t=this.parent.locale,t="en"===t||"en-US"===t?O.getValue(e,O.getDefaultDateObject()):O.getValue("main."+t+".dates.calendars.gregorian."+e,O.cldrData);return t},U.prototype.getCulturedFormat=function(){var e=this.getCulturedValue("dateTimeFormats[availableFormats].yMd").toString();return"datepicker"===this.parent.moduleName&&(e=this.getCulturedValue("dateTimeFormats[availableFormats].yMd").toString(),this.parent.format)&&this.parent.formatString&&(e=this.parent.formatString),"datetimepicker"===this.parent.moduleName&&(e=this.getCulturedValue("dateTimeFormats[availableFormats].yMd").toString(),this.parent.dateTimeFormat)&&(e=this.parent.dateTimeFormat),e="timepicker"===this.parent.moduleName?this.parent.cldrTimeFormat():e},U.prototype.clearHandler=function(){this.isDayPart=this.isMonthPart=this.isYearPart=this.isHourPart=this.isMinutePart=this.isSecondsPart=!1,this.updateValue(),this.parent.inputElement&&this.parent.inputElement.value===this.parent.maskedDateValue&&this.parent.inputWrapper&&this.parent.inputWrapper.clearButton&&!this.parent.inputWrapper.clearButton.classList.contains("e-clear-icon-hide")&&this.parent.inputWrapper.clearButton.classList.add("e-clear-icon-hide")},U.prototype.updateValue=function(){this.monthCharacter=this.periodCharacter="";var e=this.dateformat.replace(this.formatRegex,this.formatCheck());this.isHiddenMask=!0,this.hiddenMask=this.dateformat.replace(this.formatRegex,this.formatCheck()),this.isHiddenMask=!1,this.previousHiddenMask=this.hiddenMask,this.previousValue=e,this.parent.updateInputValue(e),!this.parent.strictMode||0===this.dayTypeCount&&0===this.monthTypeCount||(this.isLeadingZero=!1),this.dayTypeCount=0,this.monthTypeCount=0},U.prototype.isMaskToken=function(e){return 0<=e&&e<this.hiddenMask.length&&-1!==this.validCharacters.indexOf(this.hiddenMask[e])},U.prototype.normalizeTokenIndex=function(e,t){if(void 0===t&&(t=!1),!this.isMaskToken(e)){var i=e-1,s=e+1;if(t){if(this.isMaskToken(i))return i;if(this.isMaskToken(s))return s}else{if(this.isMaskToken(s))return s;if(this.isMaskToken(i))return i}}return e},U.prototype.destroy=function(){this.removeEventListener()},U);function U(e){this.mask="",this.defaultConstant={day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"},this.hiddenMask="",this.validCharacters="dMyhmHfasz",this.isDayPart=!1,this.isMonthPart=!1,this.isYearPart=!1,this.isHourPart=!1,this.isMinutePart=!1,this.isSecondsPart=!1,this.isMilliSecondsPart=!1,this.monthCharacter="",this.periodCharacter="",this.isHiddenMask=!1,this.isComplete=!1,this.isNavigate=!1,this.navigated=!1,this.isBlur=!1,this.formatRegex=/EEEEE|EEEE|EEE|EE|E|cccc|ccc|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yyy|yy|y|HH|H|hh|h|mm|m|fff|ff|f|aa|a|ss|s|zzzz|zzz|zz|z|'[^']*'|'[^']*'/g,this.isDeletion=!1,this.isShortYear=!1,this.isDeleteKey=!1,this.isDateZero=!1,this.isMonthZero=!1,this.isYearZero=!1,this.isLeadingZero=!1,this.dayTypeCount=0,this.monthTypeCount=0,this.hourTypeCount=0,this.minuteTypeCount=0,this.secondTypeCount=0,this.parent=e,this.dateformat=this.getCulturedFormat(),this.maskDateValue=null!=this.parent.value?new Date(+this.parent.value):new Date,this.maskDateValue.setMonth(0),this.maskDateValue.setHours(0),this.maskDateValue.setMinutes(0),this.maskDateValue.setSeconds(0),this.previousDate=new Date(this.maskDateValue.getFullYear(),this.maskDateValue.getMonth(),this.maskDateValue.getDate(),this.maskDateValue.getHours(),this.maskDateValue.getMinutes(),this.maskDateValue.getSeconds()),this.removeEventListener(),this.addEventListener()}i.Calendar=j,i.CalendarBase=re,i.DatePicker=r,i.DateRangePicker=Ve,i.DateTimePicker=V,i.Islamic=e,i.MaskedDateTime=P,i.Presets=tt,i.TimeMaskPlaceholder=bt,i.TimePicker=h,Object.defineProperty(i,"__esModule",{value:!0})});
//# sourceMappingURL=ej2-calendars.umd.min.js.map