@syncfusion/ej2-calendars 22.2.8 → 22.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/ej2-calendars.min.js +2 -2
- package/dist/ej2-calendars.umd.min.js +2 -2
- package/dist/ej2-calendars.umd.min.js.map +1 -1
- package/dist/es6/ej2-calendars.es2015.js +4 -11
- package/dist/es6/ej2-calendars.es2015.js.map +1 -1
- package/dist/es6/ej2-calendars.es5.js +4 -11
- package/dist/es6/ej2-calendars.es5.js.map +1 -1
- package/dist/global/ej2-calendars.min.js +2 -2
- package/dist/global/ej2-calendars.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +10 -10
- package/src/daterangepicker/daterangepicker.js +4 -11
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: ej2-calendars.min.js
|
|
3
|
-
* version : 22.2.
|
|
3
|
+
* version : 22.2.9
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
7
|
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
8
|
* applicable laws.
|
|
9
9
|
*/
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionBase"),require("SyncfusionInputs"),require("SyncfusionPopups"),require("SyncfusionLists"),require("SyncfusionButtons")):"function"==typeof define&&define.amd?define(["SyncfusionBase","SyncfusionInputs","SyncfusionPopups","SyncfusionLists","SyncfusionButtons"],t):"object"==typeof exports?exports.SyncfusionCalendars=t(require("SyncfusionBase"),require("SyncfusionInputs"),require("SyncfusionPopups"),require("SyncfusionLists"),require("SyncfusionButtons")):e.SyncfusionCalendars=t(e.SyncfusionBase,e.SyncfusionInputs,e.SyncfusionPopups,e.SyncfusionLists,e.SyncfusionButtons)}(this,function(e,t,i,s,a){return function(e){function t(s){if(i[s])return i[s].exports;var a=i[s]={i:s,l:!1,exports:{}};return e[s].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var i={};return t.m=e,t.c=i,t.i=function(e){return e},t.d=function(e,i,s){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:s})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=16)}([function(t,i){t.exports=e},function(e,i){e.exports=t},function(e,t){e.exports=i},function(e,t,i){"use strict";i.d(t,"b",function(){return p}),i.d(t,"a",function(){return c});var s=i(0),a=(i.n(s),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}()),n=this&&this.__decorate||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;l>=0;l--)(a=e[l])&&(r=(n<3?a(r):n>3?a(t,i,r):a(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},r="e-other-month",l="e-calendar",o="e-disabled",h="e-overlay",u="e-selected",d="e-focused-date",p=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.effect="",s.isPopupClicked=!1,s.isDateSelected=!0,s.isTodayClicked=!1,s.preventChange=!1,s.isAngular=!1,s.previousDates=!1,s}return a(t,e),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(1944,2,18)),+this.max==+new Date(2099,11,31)&&(this.max=new Date(2069,10,16))),this.globalize=new s.Internationalization(this.locale),(i.i(s.isNullOrUndefined)(this.firstDayOfWeek)||this.firstDayOfWeek>6||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(l),this.enableRtl&&this.element.classList.add("e-rtl"),s.Browser.isDevice&&this.element.classList.add("e-device"),i.i(s.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(l),this.enableRtl&&this.calendarElement.classList.add("e-rtl"),s.Browser.isDevice&&this.calendarElement.classList.add("e-device"),i.i(s.attributes)(this.calendarElement,{"data-role":"calendar"})),!i.i(s.isNullOrUndefined)(i.i(s.closest)(this.element,"fieldset"))&&i.i(s.closest)(this.element,"fieldset").disabled&&(this.enabled=!1),this.createHeader(),this.createContent(),this.wireEvents()},t.prototype.rangeValidation=function(e,t){i.i(s.isNullOrUndefined)(e)&&this.setProperties({min:new Date(1900,0,1)},!0),i.i(s.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?this.currentDate:new Date((new Date).setHours(0,0,0,0)),!i.i(s.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,a,n){if(n&&!i.i(s.isNullOrUndefined)(t)&&!i.i(s.isNullOrUndefined)(a)&&!i.i(s.isNullOrUndefined)(e)){var r=parseInt(t.style.zIndex,10)?parseInt(t.style.zIndex,10):1e3;a.style.zIndex=(r-1).toString(),e.style.zIndex=r.toString()}},t.prototype.minMaxUpdate=function(e){+this.min<=+this.max?i.i(s.removeClass)([this.element],h):(this.setProperties({min:this.min},!0),i.i(s.addClass)([this.element],h)),this.min=i.i(s.isNullOrUndefined)(this.min)||!+this.min?this.min=new Date(1900,0,1):this.min,this.max=i.i(s.isNullOrUndefined)(this.max)||!+this.max?this.max=new Date(2099,11,31):this.max,+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={"aria-disabled":"false","aria-label":"previous month"},t={"aria-disabled":"false","aria-label":"next month"},a={"aria-atomic":"true","aria-live":"assertive","aria-label":"title"};this.headerElement=this.createElement("div",{className:"e-header"});var n=this.createElement("div",{className:"e-icon-container"});this.previousIcon=this.createElement("button",{className:"e-prev",attrs:{type:"button"}}),i.i(s.rippleEffect)(this.previousIcon,{duration:400,selector:".e-prev",isCenterRipple:!0}),i.i(s.attributes)(this.previousIcon,e),this.nextIcon=this.createElement("button",{className:"e-next",attrs:{type:"button"}}),i.i(s.rippleEffect)(this.nextIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),"daterangepicker"===this.getModuleName()&&(i.i(s.attributes)(this.previousIcon,{tabIndex:"-1"}),i.i(s.attributes)(this.nextIcon,{tabIndex:"-1"})),i.i(s.attributes)(this.nextIcon,t),this.headerTitleElement=this.createElement("div",{className:"e-day e-title"}),i.i(s.attributes)(this.headerTitleElement,a),this.headerElement.appendChild(this.headerTitleElement),this.previousIcon.appendChild(this.createElement("span",{className:"e-date-icon-prev e-icons"})),this.nextIcon.appendChild(this.createElement("span",{className:"e-date-icon-next e-icons"})),n.appendChild(this.previousIcon),n.appendChild(this.nextIcon),this.headerElement.appendChild(n),"calendar"===this.getModuleName()?this.element.appendChild(this.headerElement):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:{tabIndex:"0",role:"grid","aria-activedescendant":"","aria-labelledby":this.element.id}}),"calendar"===this.getModuleName()?this.element.appendChild(this.contentElement):this.calendarElement.appendChild(this.contentElement),this.contentElement.appendChild(this.table),this.createContentHeader(),this.createContentBody(),this.showTodayButton&&this.createContentFooter()},t.prototype.getCultureValues=function(){var e,t=[],a="days.stand-alone."+this.dayHeaderFormat.toLowerCase();if(e="en"===this.locale||"en-US"===this.locale?i.i(s.getValue)(a,i.i(s.getDefaultDateObject)()):this.getCultureObjects(s.cldrData,""+this.locale),!i.i(s.isNullOrUndefined)(e))for(var n=0,r=Object.keys(e);n<r.length;n++){var l=r[n];t.push(i.i(s.getValue)(l,e))}return t},t.prototype.toCapitalize=function(e){return!i.i(s.isNullOrUndefined)(e)&&e.length?e[0].toUpperCase()+e.slice(1):e},t.prototype.createContentHeader=function(){"calendar"===this.getModuleName()?i.i(s.isNullOrUndefined)(this.element.querySelectorAll(".e-content .e-week-header")[0])||i.i(s.detach)(this.element.querySelectorAll(".e-content .e-week-header")[0]):i.i(s.isNullOrUndefined)(this.calendarElement.querySelectorAll(".e-content .e-week-header")[0])||i.i(s.detach)(this.calendarElement.querySelectorAll(".e-content .e-week-header")[0]);var e="";(this.firstDayOfWeek>6||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"></th>',"calendar"===this.getModuleName()?i.i(s.addClass)([this.element],"e-week-number"):i.i(s.addClass)([this.calendarElement],"e-week-number"));var t=this.getCultureValues().length>0&&this.getCultureValues()?this.shiftArray(this.getCultureValues().length>0&&this.getCultureValues(),this.firstDayOfWeek):null;if(!i.i(s.isNullOrUndefined)(t))for(var a=0;a<=6;a++)e+='<th class="">'+this.toCapitalize(t[a])+"</th>";e="<tr>"+e+"</tr>",this.tableHeadElement.innerHTML=e,this.table.appendChild(this.tableHeadElement)},t.prototype.createContentBody=function(){switch("calendar"===this.getModuleName()?i.i(s.isNullOrUndefined)(this.element.querySelectorAll(".e-content tbody")[0])||i.i(s.detach)(this.element.querySelectorAll(".e-content tbody")[0]):i.i(s.isNullOrUndefined)(this.calendarElement.querySelectorAll(".e-content tbody")[0])||i.i(s.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"))},t.prototype.createContentFooter=function(){if(this.showTodayButton){var e=new Date(+this.min),t=new Date(+this.max),a={today:"Today"};this.globalize=new s.Internationalization(this.locale),this.l10=new s.L10n(this.getModuleName(),a,this.locale),this.todayElement=this.createElement("button",{attrs:{role:"button"}}),i.i(s.rippleEffect)(this.todayElement),this.updateFooter(),i.i(s.addClass)([this.todayElement],["e-btn","e-today","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||i.i(s.addClass)([this.todayElement],o),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(o)||s.EventHandler.add(this.todayElement,"click",this.todayButtonClick,this)}},t.prototype.wireEvents=function(e,t,a,n){s.EventHandler.add(this.headerTitleElement,"click",this.navigateTitle,this),this.defaultKeyConfigs=i.i(s.extend)(this.defaultKeyConfigs,this.keyConfigs),"calendar"===this.getModuleName()?this.keyboardModule=new s.KeyboardEvents(this.element,{eventName:"keydown",keyAction:this.keyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs}):this.keyboardModule=new s.KeyboardEvents(this.calendarElement,{eventName:"keydown",keyAction:this.keyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})},t.prototype.dateWireEvents=function(e,t,a,n){this.defaultKeyConfigs=this.getDefaultKeyConfig(),this.defaultKeyConfigs=i.i(s.extend)(this.defaultKeyConfigs,a),this.serverModuleName=n},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&&i.i(s.detach)(this.calendarElement),this.tableBodyElement&&i.i(s.detach)(this.tableBodyElement),this.table&&i.i(s.detach)(this.table),this.tableHeadElement&&i.i(s.detach)(this.tableHeadElement),this.nextIcon&&i.i(s.detach)(this.nextIcon),this.previousIcon&&i.i(s.detach)(this.previousIcon),this.footer&&i.i(s.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,a){var n,r=this.tableBodyElement.querySelector("tr td.e-focused-date");n=a?i.i(s.isNullOrUndefined)(r)||+t!==parseInt(r.getAttribute("id").split("_")[0],10)?this.tableBodyElement.querySelector("tr td.e-selected"):r:this.tableBodyElement.querySelector("tr td.e-selected");var l=this.getViewNumber(this.currentView()),h=this.getViewNumber(this.depth),u=l===h&&this.getViewNumber(this.start)>=h;switch(this.effect="",e.action){case"moveLeft":this.keyboardNavigate(-1,l,e,this.max,this.min),e.preventDefault();break;case"moveRight":this.keyboardNavigate(1,l,e,this.max,this.min),e.preventDefault();break;case"moveUp":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":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":if(e.target===this.todayElement)this.todayButtonClick(e,t);else{var d=i.i(s.isNullOrUndefined)(r)?n:r;if(!i.i(s.isNullOrUndefined)(d)&&!d.classList.contains(o))if(u){var p=new Date(parseInt(""+d.id,0));this.selectDate(e,p,d)}else this.contentClick(null,--l,d,t)}break;case"controlUp":this.title(),e.preventDefault();break;case"controlDown":(i.i(s.isNullOrUndefined)(r)||u)&&(i.i(s.isNullOrUndefined)(n)||u)||this.contentClick(null,--l,r||n,t),e.preventDefault();break;case"home":this.currentDate=this.firstDay(this.currentDate),i.i(s.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),i.i(s.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()}"calendar"===this.getModuleName()&&this.table.focus()},t.prototype.keyboardNavigate=function(e,t,a,n,r){var l=new Date(this.checkValue(this.currentDate));switch(t){case 2:this.addYears(this.currentDate,e),this.isMonthYearRange(this.currentDate)?(i.i(s.detach)(this.tableBodyElement),this.renderDecades(a)):this.currentDate=l;break;case 1:this.addMonths(this.currentDate,e),this.calendarMode,this.isMonthYearRange(this.currentDate)?(i.i(s.detach)(this.tableBodyElement),this.renderYears(a)):this.currentDate=l;break;case 0:this.addDay(this.currentDate,e,a,n,r),this.isMinMaxRange(this.currentDate)?(i.i(s.detach)(this.tableBodyElement),this.renderMonths(a)):this.currentDate=l}},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<+this.min&&(e=new Date(+this.min)),+e>+this.max&&(e=new Date(+this.max))),e},t.prototype.renderMonths=function(e,t,i){var s,a=this.weekNumber?8:7;s="Gregorian"===this.calendarMode?this.renderDays(this.currentDate,t,null,null,i,e):this.islamicModule.islamicRenderDays(this.currentDate,t),this.createContentHeader(),"Gregorian"===this.calendarMode?this.renderTemplate(s,a,"e-month",e,t):this.islamicModule.islamicRenderTemplate(s,a,"e-month",e,t)},t.prototype.renderDays=function(e,t,a,n,l,d){var p,c=[],m=l?new Date(+e):this.getDate(new Date,this.timezone),f=new Date(this.checkValue(e)),v=f.getMonth();this.titleUpdate(e,"days");var y=f;for(f=new Date(y.getFullYear(),y.getMonth(),0,y.getHours(),y.getMinutes(),y.getSeconds(),y.getMilliseconds());f.getDay()!==this.firstDayOfWeek;)this.setStartDate(f,-864e5);for(var g=0;g<42;++g){var b=this.createElement("td",{className:"e-cell"}),D=this.createElement("span");if(g%7==0&&this.weekNumber){var C="FirstDay"===this.weekRule?6:"FirstFourDayWeek"===this.weekRule?3:0,E=new Date(f.getFullYear(),f.getMonth(),f.getDate()+C);D.textContent=""+this.getWeek(E),b.appendChild(D),i.i(s.addClass)([b],"e-week-number"),c.push(b)}p=new Date(+f),f=this.minMaxDate(f);var k={type:"dateTime",skeleton:"full"},w=this.globalize.parseDate(this.globalize.formatDate(f,k),k),V=this.dayCell(f),M=this.globalize.formatDate(f,{type:"date",skeleton:"full"}),O=this.createElement("span");O.textContent=this.globalize.formatDate(f,{format:"d",type:"date",skeleton:"yMd"});var N=this.min>f||this.max<f;N?(i.i(s.addClass)([V],o),i.i(s.addClass)([V],h)):O.setAttribute("title",""+M),v!==f.getMonth()&&i.i(s.addClass)([V],r),0!==f.getDay()&&6!==f.getDay()||i.i(s.addClass)([V],"e-weekend"),V.appendChild(O),this.renderDayCellArgs={date:f,isDisabled:!1,element:V,isOutOfRange:N};var I=this.renderDayCellArgs;if(this.renderDayCellEvent(I),I.isDisabled){var T=new Date(this.checkValue(t)),x=new Date(this.checkValue(I.date));if(a){if(!i.i(s.isNullOrUndefined)(n)&&n.length>0)for(var S=0;S<n.length;S++){var P=+new Date(this.globalize.formatDate(I.date,{type:"date",skeleton:"yMd"})),A=+new Date(this.globalize.formatDate(n[S],{type:"date",skeleton:"yMd"}));P===A&&(n.splice(S,1),S=-1)}}else T&&+T==+x&&this.setProperties({value:null},!0)}this.renderDayCellArgs.isDisabled&&!V.classList.contains(u)&&(i.i(s.addClass)([V],o),i.i(s.addClass)([V],h),+this.renderDayCellArgs.date==+this.todayDate&&(this.todayDisabled=!0));var U=V.classList.contains(r),H=V.classList.contains(o);H||s.EventHandler.add(V,"click",this.clickHandler,this);var W=void 0;if(i.i(s.isNullOrUndefined)(d)||"click"!==d.type||(W=d.currentTarget),!a||i.i(s.isNullOrUndefined)(n)||H)!H&&this.getDateVal(f,t)&&i.i(s.addClass)([V],u);else{for(var L=0;L<n.length;L++){var F="Gregorian"===this.calendarMode?"gregorian":"islamic",B={format:null,type:"date",skeleton:"short",calendar:F},P=this.globalize.formatDate(f,B),A=this.globalize.formatDate(n[L],B);if((P===A&&this.getDateVal(f,n[L])||this.getDateVal(f,t))&&i.i(s.addClass)([V],u),!i.i(s.isNullOrUndefined)(W)&&W.innerText===V.innerText&&this.previousDates&&V.classList.contains(u)&&W.classList.contains(u)){i.i(s.removeClass)([V],u),this.previousDates=!1;for(var j=this.copyValues(n),Y=0;Y<j.length;Y++){var R="Gregorian"===this.calendarMode?"gregorian":"islamic",z={format:null,type:"date",skeleton:"short",calendar:R};if(this.globalize.formatDate(w,z)===this.globalize.formatDate(j[Y],z)){var S=j.indexOf(j[Y]);j.splice(S,1),n.splice(S,1)}}this.setProperties({values:j},!0)}else this.updateFocus(U,H,f,V,e)}n.length<=0&&this.updateFocus(U,H,f,V,e)}this.updateFocus(U,H,f,V,e),i.i(s.isNullOrUndefined)(w)||w.getFullYear()!==m.getFullYear()||w.getMonth()!==m.getMonth()||w.getDate()!==m.getDate()||i.i(s.addClass)([V],"e-today"),c.push(this.renderDayCellArgs.element),f=new Date(+p),this.addDay(f,1,null,this.max,this.min)}return c},t.prototype.updateFocus=function(e,t,a,n,r){r.getDate()!==a.getDate()||e||t?(r>=this.max&&parseInt(n.id,0)===+this.max&&!e&&!t&&i.i(s.addClass)([n],d),r<=this.min&&parseInt(n.id,0)===+this.min&&!e&&!t&&i.i(s.addClass)([n],d)):i.i(s.addClass)([n],d)},t.prototype.renderYears=function(e,t){this.removeTableHeadElement();var a=[],n=i.i(s.isNullOrUndefined)(t),r=new Date(this.checkValue(this.currentDate)),l=r.getMonth(),h=r.getFullYear(),p=r,c=p.getFullYear(),m=new Date(this.checkValue(this.min)).getFullYear(),f=new Date(this.checkValue(this.min)).getMonth(),v=new Date(this.checkValue(this.max)).getFullYear(),y=new Date(this.checkValue(this.max)).getMonth();p.setMonth(0),this.titleUpdate(this.currentDate,"months"),p.setDate(1);for(var g=0;g<12;++g){var b=this.dayCell(p),D=this.createElement("span"),C=t&&t.getMonth()===p.getMonth(),E=t&&t.getFullYear()===h&&C;D.textContent=this.toCapitalize(this.globalize.formatDate(p,{format:null,type:"dateTime",skeleton:"MMM"})),this.min&&(c<m||g<f&&c===m)||this.max&&(c>v||g>y&&c>=v)?i.i(s.addClass)([b],o):!n&&E?i.i(s.addClass)([b],u):p.getMonth()===l&&this.currentDate.getMonth()===l&&i.i(s.addClass)([b],d),p.setDate(1),p.setMonth(p.getMonth()+1),b.classList.contains(o)||s.EventHandler.add(b,"click",this.clickHandler,this),b.appendChild(D),a.push(b)}this.renderTemplate(a,4,"e-year",e,t)},t.prototype.renderDecades=function(e,t){this.removeTableHeadElement();var a=[],n=new Date(this.checkValue(this.currentDate));n.setMonth(0),n.setDate(1);var r=n.getFullYear(),l=new Date(n.setFullYear(r-r%10)),h=new Date(n.setFullYear(r-r%10+9)),p=l.getFullYear(),c=h.getFullYear(),m=this.globalize.formatDate(l,{format:null,type:"dateTime",skeleton:"y"}),f=this.globalize.formatDate(h,{format:null,type:"dateTime",skeleton:"y"});this.headerTitleElement.textContent=m+" - "+f;for(var v=new Date(r-r%10-1,0,1),y=v.getFullYear(),g=0;g<12;++g){var b=y+g;n.setFullYear(b);var D=this.dayCell(n),C=this.createElement("span");C.textContent=this.globalize.formatDate(n,{format:null,type:"dateTime",skeleton:"y"}),b<p||b>c?(i.i(s.addClass)([D],"e-other-year"),i.i(s.isNullOrUndefined)(t)||n.getFullYear()!==t.getFullYear()||i.i(s.addClass)([D],u),(b<new Date(this.checkValue(this.min)).getFullYear()||b>new Date(this.checkValue(this.max)).getFullYear())&&i.i(s.addClass)([D],o)):b<new Date(this.checkValue(this.min)).getFullYear()||b>new Date(this.checkValue(this.max)).getFullYear()?i.i(s.addClass)([D],o):i.i(s.isNullOrUndefined)(t)||n.getFullYear()!==t.getFullYear()?n.getFullYear()!==this.currentDate.getFullYear()||D.classList.contains(o)||i.i(s.addClass)([D],d):i.i(s.addClass)([D],u),D.classList.contains(o)||s.EventHandler.add(D,"click",this.clickHandler,this),D.appendChild(C),a.push(D)}this.renderTemplate(a,4,"e-decade",e,t)},t.prototype.dayCell=function(e){var t,a="Gregorian"===this.calendarMode?"gregorian":"islamic",n={skeleton:"full",type:"dateTime",calendar:a},r=this.globalize.parseDate(this.globalize.formatDate(e,n),n);i.i(s.isNullOrUndefined)(r)||(t=r.valueOf());var l={className:"e-cell",attrs:{id:""+i.i(s.getUniqueID)(""+t),"aria-selected":"false"}};return this.createElement("td",l)},t.prototype.firstDay=function(e){var t="Decade"!==this.currentView()?this.tableBodyElement.querySelectorAll("td:not(."+r):this.tableBodyElement.querySelectorAll("td:not(.e-other-year");if(t.length)for(var i=0;i<t.length;i++)if(!t[i].classList.contains(o)){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);if(2!==t){var s=Math.abs(i.getTimezoneOffset()-this.firstDay(e).getTimezoneOffset());return s&&i.setHours(this.firstDay(e).getHours()+s/60),this.findLastDay(i)}return this.findLastDay(this.firstDay(i))},t.prototype.checkDateValue=function(e){return!i.i(s.isNullOrUndefined)(e)&&e instanceof Date&&!isNaN(+e)?e:null},t.prototype.findLastDay=function(e){var t="Decade"===this.currentView()?this.tableBodyElement.querySelectorAll("td:not(.e-other-year"):this.tableBodyElement.querySelectorAll("td:not(."+r);if(t.length)for(var i=t.length-1;i>=0;i--)if(!t[i].classList.contains(o)){e=new Date(parseInt(t[i].id,0));break}return e},t.prototype.removeTableHeadElement=function(){"calendar"===this.getModuleName()?i.i(s.isNullOrUndefined)(this.element.querySelectorAll(".e-content table thead")[0])||i.i(s.detach)(this.tableHeadElement):i.i(s.isNullOrUndefined)(this.calendarElement.querySelectorAll(".e-content table thead")[0])||i.i(s.detach)(this.tableHeadElement)},t.prototype.renderTemplate=function(e,t,a,n,l){var o,h=this.getViewNumber(this.currentView());this.tableBodyElement=this.createElement("tbody"),this.table.appendChild(this.tableBodyElement),i.i(s.removeClass)([this.contentElement,this.headerElement],["e-month","e-decade","e-year"]),i.i(s.addClass)([this.contentElement,this.headerElement],[a]);for(var u=t,d=0,p=0;p<e.length/t;++p){for(o=this.createElement("tr"),d=0+d;d<u;d++)e[d].classList.contains("e-week-number")||i.i(s.isNullOrUndefined)(e[d].children[0])||(i.i(s.addClass)([e[d].children[0]],["e-day"]),i.i(s.rippleEffect)(e[d].children[0],{duration:600,isCenterRipple:!0})),o.appendChild(e[d]),this.weekNumber&&7===d&&e[7].classList.contains(r)&&i.i(s.addClass)([o],"e-month-hide"),!this.weekNumber&&6===d&&e[6].classList.contains(r)&&i.i(s.addClass)([o],"e-month-hide"),this.weekNumber?41===d&&e[41].classList.contains(r)&&i.i(s.addClass)([o],"e-month-hide"):35===d&&e[35].classList.contains(r)&&i.i(s.addClass)([o],"e-month-hide");u+=t,d+=0,this.tableBodyElement.appendChild(o)}this.table.querySelector("tbody").className=this.effect,"Gregorian"===this.calendarMode?this.iconHandler():this.islamicModule.islamicIconHandler(),(h!==this.getViewNumber(this.currentView())||0===h&&h!==this.getViewNumber(this.currentView()))&&this.navigateHandler(n),this.setAriaActiveDescendant()},t.prototype.clickHandler=function(e,t){this.clickEventEmitter(e);var i=e.currentTarget,s=this.getViewNumber(this.currentView());i.classList.contains(r)?this.contentClick(e,0,null,t):s===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth)?this.contentClick(e,1,null,t):2===s?this.contentClick(e,1,null,t):i.classList.contains(r)||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,a,n){var r=this.getViewNumber(this.currentView()),l=this.getIdValue(e,a);switch(t){case 0:r===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth)?(i.i(s.detach)(this.tableBodyElement),this.currentDate=l,this.effect="e-zoomin",this.renderMonths(e)):("Gregorian"===this.calendarMode?(this.currentDate.setMonth(l.getMonth()),l.getMonth()>0&&this.currentDate.getMonth()!==l.getMonth()&&this.currentDate.setDate(0),this.currentDate.setFullYear(l.getFullYear())):this.currentDate=l,this.effect="e-zoomin",i.i(s.detach)(this.tableBodyElement),this.renderMonths(e));break;case 1:if(r===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth))this.selectDate(e,l,null);else{if("Gregorian"===this.calendarMode)this.currentDate.setFullYear(l.getFullYear());else{this.islamicPreviousHeader=this.headerElement.textContent;var o=this.islamicModule.getIslamicDate(l);this.currentDate=this.islamicModule.toGregorian(o.year,o.month,1)}this.effect="e-zoomin",i.i(s.detach)(this.tableBodyElement),this.renderYears(e)}}},t.prototype.switchView=function(e,t,a,n){switch(e){case 0:i.i(s.detach)(this.tableBodyElement),this.renderMonths(t,null,n);break;case 1:i.i(s.detach)(this.tableBodyElement),this.renderYears(t);break;case 2:i.i(s.detach)(this.tableBodyElement),this.renderDecades(t)}},t.prototype.getModuleName=function(){return"calendar"},t.prototype.requiredModules=function(){var e=[];return this&&e.push({args:[this],member:"islamic"}),e},t.prototype.getPersistData=function(){var e=["value"];return this.addOnPersist(e)},t.prototype.onPropertyChanged=function(e,t,a,n){this.effect="";for(var r=0,l=Object.keys(e);r<l.length;r++){var h=l[r];switch(h){case"enableRtl":e.enableRtl?"calendar"===this.getModuleName()?this.element.classList.add("e-rtl"):this.calendarElement.classList.add("e-rtl"):"calendar"===this.getModuleName()?this.element.classList.remove("e-rtl"):this.calendarElement.classList.remove("e-rtl");break;case"dayHeaderFormat":this.getCultureValues(),"datepicker"!==this.getModuleName()?this.createContentHeader():this.calendarElement&&this.createContentHeader(),this.adjustLongHeaderSize();break;case"min":case"max":this.rangeValidation(this.min,this.max),"min"===h?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&&i.i(s.detach)(this.tableBodyElement),this.minMaxUpdate(),a&&this.validateValues(a,n),"datepicker"!==this.getModuleName()?this.createContentBody():this.calendarElement&&this.createContentBody(),(this.todayDate<this.min||this.max<this.todayDate)&&this.footer&&this.todayElement?(i.i(s.detach)(this.todayElement),i.i(s.detach)(this.footer),this.todayElement=this.footer=null,this.createContentFooter()):this.footer&&this.todayElement&&this.todayElement.classList.contains("e-disabled")&&(i.i(s.removeClass)([this.todayElement],o),i.i(s.detach)(this.todayElement),i.i(s.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.createContentHeader(),this.createContentBody()):this.calendarElement&&(this.createContentHeader(),this.createContentBody());break;case"locale":this.globalize=new s.Internationalization(this.locale),"datepicker"!==this.getModuleName()?(this.createContentHeader(),this.createContentBody()):this.calendarElement&&(this.createContentHeader(),this.createContentBody()),this.l10.setLocale(this.locale),this.updateFooter();break;case"showTodayButton":e.showTodayButton?this.createContentFooter():i.i(s.isNullOrUndefined)(this.todayElement)||i.i(s.isNullOrUndefined)(this.footer)||(i.i(s.detach)(this.todayElement),i.i(s.detach)(this.footer),this.todayElement=this.footer=void 0),this.setProperties({showTodayButton:e.showTodayButton},!0)}}},t.prototype.validateValues=function(e,t){if(e&&!i.i(s.isNullOrUndefined)(t)&&t.length>0){for(var a=this.copyValues(t),n=0;n<a.length;n++){var r=a[n],l="Gregorian"===this.calendarMode?"gregorian":"islamic",o=void 0;o="Gregorian"===this.calendarMode?this.globalize.formatDate(r,{type:"date",skeleton:"yMd"}):this.globalize.formatDate(r,{type:"dateTime",skeleton:"full",calendar:"islamic"});var h={type:"date",skeleton:"yMd",calendar:l},u=this.globalize.formatDate(this.min,h),d=u,p={type:"date",skeleton:"yMd",calendar:l},c=this.globalize.formatDate(this.max,p),m=c;(+new Date(o)<+new Date(d)||+new Date(o)>+new Date(m))&&(a.splice(n,1),n=-1)}this.setProperties({values:a},!0)}},t.prototype.setValueUpdate=function(){i.i(s.isNullOrUndefined)(this.tableBodyElement)||(i.i(s.detach)(this.tableBodyElement),this.setProperties({start:this.currentView()},!0),this.createContentBody())},t.prototype.copyValues=function(e){var t=[];if(!i.i(s.isNullOrUndefined)(e)&&e.length>0)for(var a=0;a<e.length;a++)t.push(new Date(+e[a]));return t},t.prototype.titleUpdate=function(e,t){var i,a,n=new s.Internationalization(this.locale),r="Gregorian"===this.calendarMode?"gregorian":"islamic";switch("Gregorian"===this.calendarMode?(i=n.formatDate(e,{type:"dateTime",skeleton:"yMMMM",calendar:r}),a=n.formatDate(e,{format:null,type:"dateTime",skeleton:"y",calendar:r})):(i=n.formatDate(e,{type:"dateTime",format:"MMMM y",calendar:r}),a=n.formatDate(e,{type:"dateTime",format:"y",calendar:r})),t){case"days":this.headerTitleElement.textContent=this.toCapitalize(i);break;case"months":this.headerTitleElement.textContent=a}},t.prototype.setActiveDescendant=function(){var e,t,a=this.tableBodyElement.querySelector("tr td.e-focused-date"),n=this.tableBodyElement.querySelector("tr td.e-selected"),r="Gregorian"===this.calendarMode?"gregorian":"islamic",l=this.currentView();return t="Month"===l?this.globalize.formatDate(this.currentDate,{type:"date",skeleton:"full",calendar:r}):"Year"===l?"islamic"!==r?this.globalize.formatDate(this.currentDate,{type:"date",skeleton:"yMMMM",calendar:r}):this.globalize.formatDate(this.currentDate,{type:"date",skeleton:"GyMMM",calendar:r}):this.globalize.formatDate(this.currentDate,{format:null,type:"date",skeleton:"y",calendar:r}),(n||a)&&(i.i(s.isNullOrUndefined)(n)||n.setAttribute("aria-selected","true"),(a||n).setAttribute("aria-label",t),e=(a||n).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(this.compareMonth(new Date(this.checkValue(this.currentDate)),this.max)>-1);break;case"Year":this.previousIconHandler(this.compareYear(new Date(this.checkValue(this.currentDate)),this.min)<1),this.nextIconHandler(this.compareYear(new Date(this.checkValue(this.currentDate)),this.max)>-1);break;case"Decade":this.previousIconHandler(this.compareDecade(new Date(this.checkValue(this.currentDate)),this.min)<1),this.nextIconHandler(this.compareDecade(new Date(this.checkValue(this.currentDate)),this.max)>-1)}},t.prototype.destroy=function(){"calendar"===this.getModuleName()&&this.element?i.i(s.removeClass)([this.element],[l]):this.calendarElement&&this.element&&i.i(s.removeClass)([this.element],[l]),"calendar"===this.getModuleName()&&this.element&&(i.i(s.isNullOrUndefined)(this.headerTitleElement)||s.EventHandler.remove(this.headerTitleElement,"click",this.navigateTitle),this.todayElement&&s.EventHandler.remove(this.todayElement,"click",this.todayButtonClick),this.previousIconHandler(!0),this.nextIconHandler(!0),this.keyboardModule.destroy(),this.element.removeAttribute("data-role"),i.i(s.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.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,e.prototype.destroy.call(this)},t.prototype.title=function(e){var t=this.getViewNumber(this.currentView());this.effect="e-zoomin",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),"calendar"===this.getModuleName()&&this.table.focus()},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){!s.Browser.isDevice&&e.preventDefault(),"Gregorian"===this.calendarMode?this.previous():this.islamicModule.islamicPrevious(),this.triggerNavigate(e),"calendar"===this.getModuleName()&&this.table.focus()},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){!s.Browser.isDevice&&e.preventDefault(),"Gregorian"===this.calendarMode?this.next():this.islamicModule.islamicNext(),this.triggerNavigate(e),"calendar"===this.getModuleName()&&this.table.focus()},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!i.i(s.isNullOrUndefined)(this.contentElement)&&this.contentElement.classList.contains("e-year")?"Year":!i.i(s.isNullOrUndefined)(this.contentElement)&&this.contentElement.classList.contains("e-decade")?"Decade":"Month"},t.prototype.getDateVal=function(e,t){return!i.i(s.isNullOrUndefined)(t)&&e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()},t.prototype.getCultureObjects=function(e,t){var a=".dates.calendars.gregorian.days.format."+this.dayHeaderFormat.toLowerCase(),n=".dates.calendars.islamic.days.format."+this.dayHeaderFormat.toLowerCase();return"Gregorian"===this.calendarMode?i.i(s.getValue)("main."+this.locale+a,e):i.i(s.getValue)("main."+this.locale+n,e)},t.prototype.getWeek=function(e){var t=new Date(this.checkValue(e)).valueOf(),i=new Date(e.getFullYear(),0,1).valueOf();return Math.ceil((t-i+864e5)/864e5/7)},t.prototype.setStartDate=function(e,t){var i=e.getTimezoneOffset(),s=new Date(e.getTime()+t),a=s.getTimezoneOffset()-i;e.setTime(s.getTime()+6e4*a)},t.prototype.addMonths=function(e,t){if("Gregorian"===this.calendarMode){var i=e.getDate();e.setDate(1),e.setMonth(e.getMonth()+t),e.setDate(Math.min(i,this.getMaxDays(e)))}else{var s=this.islamicModule.getIslamicDate(e);this.currentDate=this.islamicModule.toGregorian(s.year,s.month+t,1)}},t.prototype.addYears=function(e,t){if("Gregorian"===this.calendarMode){var i=e.getDate();e.setDate(1),e.setFullYear(e.getFullYear()+t),e.setDate(Math.min(i,this.getMaxDays(e)))}else{var s=this.islamicModule.getIslamicDate(e);this.currentDate=this.islamicModule.toGregorian(s.year+t,s.month,1)}},t.prototype.getIdValue=function(e,t){var i;i=e?e.currentTarget:t;var s="Gregorian"===this.calendarMode?"gregorian":"islamic",a={type:"dateTime",skeleton:"full",calendar:s},n=this.globalize.formatDate(new Date(parseInt(""+i.getAttribute("id"),0)),a),r=this.globalize.parseDate(n,a),l=r.valueOf()-r.valueOf()%1e3;return new Date(l)},t.prototype.adjustLongHeaderSize=function(){i.i(s.removeClass)([this.element],"e-calendar-day-header-lg"),"Wide"===this.dayHeaderFormat&&i.i(s.addClass)(["calendar"===this.getModuleName()?this.element:this.calendarElement],"e-calendar-day-header-lg")},t.prototype.selectDate=function(e,t,a,n,r){var o=a||e.currentTarget;if(this.isDateSelected=!1,"Decade"===this.currentView())this.setDateDecade(this.currentDate,t.getFullYear());else if("Year"===this.currentView())this.setDateYear(this.currentDate,t);else{if(n&&!this.checkPresentDate(t,r)){var h=this.copyValues(r);!i.i(s.isNullOrUndefined)(r)&&h.length>0?(h.push(new Date(this.checkValue(t))),this.setProperties({values:h},!0),this.setProperties({value:r[r.length-1]},!0)):this.setProperties({values:[new Date(this.checkValue(t))]},!0)}else this.setProperties({value:new Date(this.checkValue(t))},!0);this.currentDate=new Date(this.checkValue(t))}var p=i.i(s.closest)(o,"."+l);if(i.i(s.isNullOrUndefined)(p)&&(p=this.tableBodyElement),n||i.i(s.isNullOrUndefined)(p.querySelector("."+u))||i.i(s.removeClass)([p.querySelector("."+u)],u),n||i.i(s.isNullOrUndefined)(p.querySelector("."+d))||i.i(s.removeClass)([p.querySelector("."+d)],d),n){for(var h=this.copyValues(r),c=Array.prototype.slice.call(this.tableBodyElement.querySelectorAll("td")),m=0;m<c.length;m++){var f=p.querySelectorAll("td."+d)[0],v=p.querySelectorAll("td."+u)[0];c[m]===f&&i.i(s.removeClass)([c[m]],d),c[m]!==v||this.checkPresentDate(new Date(parseInt(v.getAttribute("id").split("_")[0],10)),r)||i.i(s.removeClass)([c[m]],u)}if(o.classList.contains(u)){i.i(s.removeClass)([o],u);for(var y=0;y<h.length;y++){var g="Gregorian"===this.calendarMode?"gregorian":"islamic",b={format:null,type:"date",skeleton:"short",calendar:g};if(this.globalize.formatDate(t,b)===this.globalize.formatDate(h[y],b)){var m=h.indexOf(h[y]);h.splice(m,1),i.i(s.addClass)([o],d)}}this.setProperties({values:h},!0)}else i.i(s.addClass)([o],u)}else i.i(s.addClass)([o],u);this.isDateSelected=!0},t.prototype.checkPresentDate=function(e,t){var a=!1;if(!i.i(s.isNullOrUndefined)(t))for(var n=0;n<t.length;n++){var r="Gregorian"===this.calendarMode?"gregorian":"islamic",l=this.globalize.formatDate(e,{format:null,type:"date",skeleton:"short",calendar:r}),o=this.globalize.formatDate(t[n],{format:null,type:"date",skeleton:"short",calendar:r});l===o&&(a=!0)}return a},t.prototype.setAriaActiveDescendant=function(){i.i(s.attributes)(this.table,{"aria-activedescendant":""+this.setActiveDescendant()})},t.prototype.previousIconHandler=function(e){e?i.i(s.isNullOrUndefined)(this.previousIcon)||(s.EventHandler.remove(this.previousIcon,"click",this.navigatePreviousHandler),i.i(s.addClass)([this.previousIcon],""+o),i.i(s.addClass)([this.previousIcon],""+h),this.previousIcon.setAttribute("aria-disabled","true")):(s.EventHandler.add(this.previousIcon,"click",this.navigatePreviousHandler),i.i(s.removeClass)([this.previousIcon],""+o),i.i(s.removeClass)([this.previousIcon],""+h),this.previousIcon.setAttribute("aria-disabled","false"))},t.prototype.renderDayCellEvent=function(e){i.i(s.extend)(this.renderDayCellArgs,{name:"renderDayCell"}),this.trigger("renderDayCell",e)},t.prototype.navigatedEvent=function(e){i.i(s.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?i.i(s.isNullOrUndefined)(this.previousIcon)||(s.EventHandler.remove(this.nextIcon,"click",this.navigateNextHandler),i.i(s.addClass)([this.nextIcon],o),i.i(s.addClass)([this.nextIcon],h),this.nextIcon.setAttribute("aria-disabled","true")):(s.EventHandler.add(this.nextIcon,"click",this.navigateNextHandler),i.i(s.removeClass)([this.nextIcon],o),i.i(s.removeClass)([this.nextIcon],h),this.nextIcon.setAttribute("aria-disabled","false"))},t.prototype.compare=function(e,t,i){var s,a,n=t.getFullYear();return s=n,a=0,i&&(n-=n%i,s=n-n%i+i-1),e.getFullYear()>s?a=1:e.getFullYear()<n&&(a=-1),a},t.prototype.isMinMaxRange=function(e){return+e>=+this.min&&+e<=+this.max},t.prototype.isMonthYearRange=function(e){if("Gregorian"===this.calendarMode)return e.getMonth()>=this.min.getMonth()&&e.getFullYear()>=this.min.getFullYear()&&e.getMonth()<=this.max.getMonth()&&e.getFullYear()<=this.max.getFullYear();var t=this.islamicModule.getIslamicDate(e);return t.month>=this.islamicModule.getIslamicDate(new Date(1944,1,18)).month&&t.year>=this.islamicModule.getIslamicDate(new Date(1944,1,18)).year&&t.month<=this.islamicModule.getIslamicDate(new Date(2069,1,16)).month&&t.year<=this.islamicModule.getIslamicDate(new Date(2069,1,16)).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,a,n,r){var l=t,o=new Date(+e);if(!i.i(s.isNullOrUndefined)(this.tableBodyElement)&&!i.i(s.isNullOrUndefined)(a)){for(;this.findNextTD(new Date(+e),l,n,r);)l+=t;var h=new Date(o.setDate(o.getDate()+l));l=+h>+n||+h<+r?l===t?t-t:t:l}e.setDate(e.getDate()+l)},t.prototype.findNextTD=function(e,t,a,n){var r=new Date(e.setDate(e.getDate()+t)),l=[],h=!1;if((!i.i(s.isNullOrUndefined)(r)&&r.getMonth())===(!i.i(s.isNullOrUndefined)(this.currentDate)&&this.currentDate.getMonth())){var u=void 0;u="Gregorian"===this.calendarMode?this.renderDays(r):this.islamicModule.islamicRenderDays(this.currentDate,r),l=u.filter(function(e){return e.classList.contains(o)})}else l=this.tableBodyElement.querySelectorAll("td."+o);if(+r<=+a&&+r>=+n&&l.length)for(var d=0;d<l.length&&!(h=+r==+new Date(parseInt(l[d].id,0)));d++);return h},t.prototype.getMaxDays=function(e){var t,i=new Date(this.checkValue(e));t=28;for(var s=i.getMonth();i.getMonth()===s;)++t,i.setDate(t);return t-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){return e.getFullYear()>t.getFullYear()?1:e.getFullYear()<t.getFullYear()?-1:e.getMonth()===t.getMonth()?0:e.getMonth()>t.getMonth()?1:-1},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 t&&(e=new Date(e.toLocaleString("en-US",{timeZone:t}))),e},n([i.i(s.Property)(new Date(1900,0,1))],t.prototype,"min",void 0),n([i.i(s.Property)(!0)],t.prototype,"enabled",void 0),n([i.i(s.Property)(null)],t.prototype,"cssClass",void 0),n([i.i(s.Property)(new Date(2099,11,31))],t.prototype,"max",void 0),n([i.i(s.Property)(null)],t.prototype,"firstDayOfWeek",void 0),n([i.i(s.Property)("Gregorian")],t.prototype,"calendarMode",void 0),n([i.i(s.Property)("Month")],t.prototype,"start",void 0),n([i.i(s.Property)("Month")],t.prototype,"depth",void 0),n([i.i(s.Property)(!1)],t.prototype,"weekNumber",void 0),n([i.i(s.Property)("FirstDay")],t.prototype,"weekRule",void 0),n([i.i(s.Property)(!0)],t.prototype,"showTodayButton",void 0),n([i.i(s.Property)("Short")],t.prototype,"dayHeaderFormat",void 0),n([i.i(s.Property)(!1)],t.prototype,"enablePersistence",void 0),n([i.i(s.Property)(null)],t.prototype,"keyConfigs",void 0),n([i.i(s.Property)(null)],t.prototype,"serverTimezoneOffset",void 0),n([i.i(s.Event)()],t.prototype,"created",void 0),n([i.i(s.Event)()],t.prototype,"destroyed",void 0),n([i.i(s.Event)()],t.prototype,"navigated",void 0),n([i.i(s.Event)()],t.prototype,"renderDayCell",void 0),t=n([s.NotifyPropertyChanges],t)}(s.Component),c=function(e){function t(t,i){return e.call(this,t,i)||this}return a(t,e),t.prototype.render=function(){if("Islamic"===this.calendarMode&&void 0===this.islamicModule&&i.i(s.throwError)("Requires the injectable Islamic modules to render Calendar in Islamic mode"),this.isMultiSelection&&"object"==typeof this.values&&!i.i(s.isNullOrUndefined)(this.values)&&this.values.length>0){for(var t=[],a=[],n=0;n<this.values.length;n++)-1===t.indexOf(+this.values[n])&&(t.push(+this.values[n]),a.push(this.values[n]));this.setProperties({values:a},!0);for(var r=0;r<this.values.length;r++)if(!this.checkDateValue(this.values[r]))if("string"==typeof this.values[r]&&this.checkDateValue(new Date(this.checkValue(this.values[r])))){var l=new Date(this.checkValue(this.values[r]));this.values.splice(r,1),this.values.splice(r,0,l)}else this.values.splice(r,1);this.setProperties({value:this.values[this.values.length-1]},!0),this.previousValues=this.values.length}if(this.validateDate(),this.minMaxUpdate(),"calendar"===this.getModuleName()&&(this.setEnable(this.enabled),this.setClass(this.cssClass)),e.prototype.render.call(this),"calendar"===this.getModuleName()){var o=i.i(s.closest)(this.element,"form");o&&s.EventHandler.add(o,"reset",this.formResetHandler.bind(this)),this.setTimeZone(this.serverTimezoneOffset)}this.renderComplete()},t.prototype.setEnable=function(e){e?i.i(s.removeClass)([this.element],o):i.i(s.addClass)([this.element],o)},t.prototype.setClass=function(e,t){i.i(s.isNullOrUndefined)(t)||(t=t.replace(/\s+/g," ").trim()),i.i(s.isNullOrUndefined)(e)||(e=e.replace(/\s+/g," ").trim()),i.i(s.isNullOrUndefined)(t)||""===t||i.i(s.removeClass)([this.element],t.split(" ")),i.i(s.isNullOrUndefined)(e)||i.i(s.addClass)([this.element],e.split(" "))},t.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)},t.prototype.setTimeZone=function(e){if(!i.i(s.isNullOrUndefined)(this.serverTimezoneOffset)&&this.value){var t=e,a=(new Date).getTimezoneOffset()/60,n=t+a;n=this.isDayLightSaving()?n--:n,this.value=new Date(this.value.getTime()+60*n*60*1e3)}},t.prototype.formResetHandler=function(){this.setProperties({value:null},!0)},t.prototype.validateDate=function(){"string"==typeof this.value&&this.setProperties({value:this.checkDateValue(new Date(this.checkValue(this.value)))},!0),e.prototype.validateDate.call(this,this.value),!i.i(s.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)},t.prototype.minMaxUpdate=function(){"calendar"===this.getModuleName()&&(!i.i(s.isNullOrUndefined)(this.value)&&this.value<=this.min&&this.min<=this.max?(this.setProperties({value:this.min},!0),this.changedArgs={value:this.value}):!i.i(s.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()||i.i(s.isNullOrUndefined)(this.value)?e.prototype.minMaxUpdate.call(this,this.value):!i.i(s.isNullOrUndefined)(this.value)&&this.value<this.min&&this.min<=this.max?e.prototype.minMaxUpdate.call(this,this.min):!i.i(s.isNullOrUndefined)(this.value)&&this.value>this.max&&this.min<=this.max&&e.prototype.minMaxUpdate.call(this,this.max)},t.prototype.generateTodayVal=function(t){var a=new Date;return i.i(s.isNullOrUndefined)(this.timezone)||(a=e.prototype.getDate.call(this,a,this.timezone)),t&&i.i(s.isNullOrUndefined)(this.timezone)?(a.setHours(t.getHours()),a.setMinutes(t.getMinutes()),a.setSeconds(t.getSeconds()),a.setMilliseconds(t.getMilliseconds())):a=new Date(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0,0),a},t.prototype.todayButtonClick=function(t){if(this.showTodayButton){var i=this.generateTodayVal(this.value);if(this.setProperties({value:i},!0),this.isTodayClicked=!0,this.todayButtonEvent=t,this.isMultiSelection){var s=this.copyValues(this.values);e.prototype.checkPresentDate.call(this,i,this.values)||(s.push(i),this.setProperties({values:s}))}e.prototype.todayButtonClick.call(this,t,new Date(+this.value))}},t.prototype.keyActionHandle=function(t){e.prototype.keyActionHandle.call(this,t,this.value,this.isMultiSelection)},t.prototype.preRender=function(){var t=this;this.changeHandler=function(e){t.triggerChange(e)},this.checkView(),e.prototype.preRender.call(this,this.value)},t.prototype.createContent=function(){this.previousDate=this.value,this.previousDateTime=this.value,e.prototype.createContent.call(this)},t.prototype.minMaxDate=function(t){return e.prototype.minMaxDate.call(this,t)},t.prototype.renderMonths=function(t,i,s){e.prototype.renderMonths.call(this,t,this.value,s)},t.prototype.renderDays=function(t,i,s,a,n,r){var l=e.prototype.renderDays.call(this,t,this.value,this.isMultiSelection,this.values,n,r);return this.isMultiSelection&&e.prototype.validateValues.call(this,this.isMultiSelection,this.values),l},t.prototype.renderYears=function(t){"Gregorian"===this.calendarMode?e.prototype.renderYears.call(this,t,this.value):this.islamicModule.islamicRenderYears(t,this.value)},t.prototype.renderDecades=function(t){"Gregorian"===this.calendarMode?e.prototype.renderDecades.call(this,t,this.value):this.islamicModule.islamicRenderDecade(t,this.value)},t.prototype.renderTemplate=function(t,i,s,a){"Gregorian"===this.calendarMode?e.prototype.renderTemplate.call(this,t,i,s,a,this.value):this.islamicModule.islamicRenderTemplate(t,i,s,a,this.value),this.changedArgs={value:this.value,values:this.values},this.changeHandler()},t.prototype.clickHandler=function(t){var a=t.currentTarget;if(this.isPopupClicked=!0,a.classList.contains(r))if(this.isMultiSelection){var n=this.copyValues(this.values);-1===n.toString().indexOf(this.getIdValue(t,null).toString())?(n.push(this.getIdValue(t,null)),this.setProperties({values:n},!0),this.setProperties({value:this.values[this.values.length-1]},!0)):this.previousDates=!0}else this.setProperties({value:this.getIdValue(t,null)},!0);var l=this.currentView();e.prototype.clickHandler.call(this,t,this.value),this.isMultiSelection&&this.currentDate!==this.value&&!i.i(s.isNullOrUndefined)(this.tableBodyElement.querySelectorAll("."+d)[0])&&"Year"===l&&this.tableBodyElement.querySelectorAll("."+d)[0].classList.remove(d)},t.prototype.switchView=function(t,i,s,a){e.prototype.switchView.call(this,t,i,this.isMultiSelection,a)},t.prototype.getModuleName=function(){return e.prototype.getModuleName.call(this),"calendar"},t.prototype.getPersistData=function(){e.prototype.getPersistData.call(this);var t=["value","values"];return this.addOnPersist(t)},t.prototype.onPropertyChanged=function(t,i){this.effect="",this.rangeValidation(this.min,this.max);for(var s=0,a=Object.keys(t);s<a.length;s++){switch(a[s]){case"value":this.isDateSelected&&("string"==typeof t.value?this.setProperties({value:new Date(this.checkValue(t.value))},!0):t.value=new Date(this.checkValue(t.value)),isNaN(+this.value)&&this.setProperties({value:i.value},!0),this.update());break;case"values":if(this.isDateSelected){if("string"==typeof t.values||"number"==typeof t.values)this.setProperties({values:null},!0);else{for(var n=this.copyValues(this.values),r=0;r<n.length;r++){var l=n[r];this.checkDateValue(l)&&!e.prototype.checkPresentDate.call(this,l,n)&&n.push(l)}this.setProperties({values:n},!0),this.values.length>0&&this.setProperties({value:t.values[t.values.length-1]},!0)}this.validateValues(this.isMultiSelection,this.values),this.update()}break;case"isMultiSelection":this.isDateSelected&&(this.setProperties({isMultiSelection:t.isMultiSelection},!0),this.update());break;case"enabled":this.setEnable(this.enabled);break;case"cssClass":"calendar"===this.getModuleName()&&this.setClass(t.cssClass,i.cssClass);break;default:e.prototype.onPropertyChanged.call(this,t,i,this.isMultiSelection,this.values)}}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange},t.prototype.destroy=function(){if(e.prototype.destroy.call(this),"calendar"===this.getModuleName()){var t=i.i(s.closest)(this.element,"form");t&&s.EventHandler.remove(t,"reset",this.formResetHandler.bind(this))}},t.prototype.navigateTo=function(t,i,s){this.minMaxUpdate(),e.prototype.navigateTo.call(this,t,i,s)},t.prototype.currentView=function(){return e.prototype.currentView.call(this)},t.prototype.addDate=function(t){if("string"!=typeof t&&"number"!=typeof t){var a=this.copyValues(this.values);if("object"==typeof t&&t.length>0)for(var n=t,r=0;r<n.length;r++)this.checkDateValue(n[r])&&!e.prototype.checkPresentDate.call(this,n[r],a)&&(!i.i(s.isNullOrUndefined)(a)&&a.length>0?a.push(n[r]):a=[new Date(+n[r])]);else this.checkDateValue(t)&&!e.prototype.checkPresentDate.call(this,t,a)&&(!i.i(s.isNullOrUndefined)(a)&&a.length>0?a.push(t):a=[new Date(+t)]);this.setProperties({values:a},!0),this.isMultiSelection&&this.setProperties({value:this.values[this.values.length-1]},!0),this.validateValues(this.isMultiSelection,a),this.update(),this.changedArgs={value:this.value,values:this.values},this.changeHandler()}},t.prototype.removeDate=function(e){if("string"!=typeof e&&"number"!=typeof e&&!i.i(s.isNullOrUndefined)(this.values)&&this.values.length>0){var t=this.copyValues(this.values);if("object"==typeof e&&e.length>0)for(var a=e,n=0;n<a.length;n++)for(var r=0;r<t.length;r++)+t[r]==+a[n]&&t.splice(r,1);else for(var r=0;r<t.length;r++)+t[r]==+e&&t.splice(r,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()}},t.prototype.setTodayDate=function(t){var i=new Date(+t);this.setProperties({value:i},!0),e.prototype.todayButtonClick.call(this,null,i,!0)},t.prototype.update=function(){this.validateDate(),this.minMaxUpdate(),e.prototype.setValueUpdate.call(this)},t.prototype.selectDate=function(t,a,n){e.prototype.selectDate.call(this,t,a,n,this.isMultiSelection,this.values),this.isMultiSelection&&!i.i(s.isNullOrUndefined)(this.values)&&this.values.length>0&&this.setProperties({value:this.values[this.values.length-1]},!0),this.changedArgs={value:this.value,values:this.values},this.changeHandler(t)},t.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))},t.prototype.triggerChange=function(e){!i.i(s.isNullOrUndefined)(this.todayButtonEvent)&&this.isTodayClicked&&(e=this.todayButtonEvent,this.isTodayClicked=!1),this.changedArgs.event=e||null,this.changedArgs.isInteracted=!i.i(s.isNullOrUndefined)(e),i.i(s.isNullOrUndefined)(this.value)||this.setProperties({value:this.value},!0),this.isMultiSelection||+this.value===Number.NaN||(i.i(s.isNullOrUndefined)(this.value)||i.i(s.isNullOrUndefined)(this.previousDate))&&(null!==this.previousDate||isNaN(+this.value))?i.i(s.isNullOrUndefined)(this.values)||this.previousValues===this.values.length||(this.changeEvent(e),this.previousValues=this.values.length):this.changeEvent(e)},n([i.i(s.Property)(null)],t.prototype,"value",void 0),n([i.i(s.Property)(null)],t.prototype,"values",void 0),n([i.i(s.Property)(!1)],t.prototype,"isMultiSelection",void 0),n([i.i(s.Event)()],t.prototype,"change",void 0),t=n([s.NotifyPropertyChanges],t)}(p)},function(e,t,i){"use strict";i.d(t,"a",function(){return d});var s=i(0),a=(i.n(s),i(2)),n=(i.n(a),i(1)),r=(i.n(n),i(3)),l=this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),o=this&&this.__decorate||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;l>=0;l--)(a=e[l])&&(r=(n<3?a(r):n>3?a(t,i,r):a(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},h="e-datepicker",u=["title","class","style"],d=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.isDateIconClicked=!1,s.isAltKeyPressed=!1,s.isInteracted=!0,s.invalidValueString=null,s.checkPreviousValue=null,s.maskedDateValue="",s.isAngular=!1,s.preventChange=!1,s.isIconClicked=!1,s.isDynamicValueChanged=!1,s.moduleName=s.getModuleName(),s.isFocused=!1,s.isBlur=!1,s.datepickerOptions=t,s}return l(t,e),t.prototype.render=function(){this.initialize(),this.bindEvents(),"Auto"===this.floatLabelType&&n.Input.calculateWidth(this.inputElement,this.inputWrapper.container),i.i(s.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(s.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"),!i.i(s.isNullOrUndefined)(i.i(s.closest)(this.element,"fieldset"))&&i.i(s.closest)(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete(),this.setTimeZone(this.serverTimezoneOffset)},t.prototype.setTimeZone=function(e){if(!i.i(s.isNullOrUndefined)(this.serverTimezoneOffset)&&this.value){var t=(new Date).getTimezoneOffset()/60,a=e,n=a+t;n=this.isDayLightSaving()?n--:n,this.value=new Date(this.value.getTime()+60*n*60*1e3),this.updateInput()}},t.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)},t.prototype.setAllowEdit=function(){this.allowEdit?this.readonly||this.inputElement.removeAttribute("readonly"):i.i(s.attributes)(this.inputElement,{readonly:""}),this.updateIconState()},t.prototype.updateIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&i.i(s.removeClass)([this.inputWrapper.container],["e-non-edit"]):""===this.inputElement.value?i.i(s.removeClass)([this.inputWrapper.container],["e-non-edit"]):i.i(s.addClass)([this.inputWrapper.container],["e-non-edit"])},t.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=i.i(s.isNullOrUndefined)(this.value)?null:new Date(+this.value),this.inputElement.setAttribute("value",this.inputElement.value),this.inputValueCopy=this.value},t.prototype.createInput=function(){var e={"aria-atomic":"true","aria-expanded":"false",role:"combobox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-invalid":"false"};if("datepicker"===this.getModuleName()){var t={placeholder:this.placeholder};this.globalize=new s.Internationalization(this.locale),this.l10n=new s.L10n("datepicker",t,this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0)}this.fullScreenMode&&s.Browser.isDevice&&(this.cssClass+=" e-popup-expand");var a=this.cssClass;i.i(s.isNullOrUndefined)(this.cssClass)||""===this.cssClass||(a=this.cssClass.replace(/\s+/g," ").trim());var r=!this.enableMask;this.inputWrapper=n.Input.createInput({element:this.inputElement,floatLabelType:this.floatLabelType,bindClearAction:r,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:a,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),i.i(s.attributes)(this.inputElement,e),this.enabled?(this.inputElement.setAttribute("aria-disabled","false"),this.inputElement.setAttribute("tabindex",this.tabIndex)):(this.inputElement.setAttribute("aria-disabled","true"),this.inputElement.tabIndex=-1),n.Input.addAttributes({"aria-label":"select"},this.inputWrapper.buttons[0]),i.i(s.addClass)([this.inputWrapper.container],"e-date-wrapper")},t.prototype.updateInput=function(t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);var n;if(this.value&&!this.isCalendar()&&this.disabledDates(t,a),isNaN(+new Date(this.checkValue(this.value)))&&this.setProperties({value:null},!0),this.strictMode&&(e.prototype.validateDate.call(this),this.minMaxUpdates(),e.prototype.minMaxUpdate.call(this)),!i.i(s.isNullOrUndefined)(this.value)){var r=this.value,l=void 0,o=i.i(s.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString;if("datetimepicker"===this.getModuleName()?l="Gregorian"===this.calendarMode?this.globalize.formatDate(this.value,{format:o,type:"dateTime",skeleton:"yMd"}):this.globalize.formatDate(this.value,{format:o,type:"dateTime",skeleton:"yMd",calendar:"islamic"}):(n="Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"},l=this.globalize.formatDate(this.value,n)),+r<=+this.max&&+r>=+this.min)this.updateInputValue(l);else{var h=+r>=+this.max||!+this.value||!+this.value||+r<=+this.min;!this.strictMode&&h&&this.updateInputValue(l)}}i.i(s.isNullOrUndefined)(this.value)&&this.strictMode&&(this.enableMask?(this.updateInputValue(this.maskedDateValue),this.notify("createMask",{module:"MaskedDateTime"})):this.updateInputValue("")),!this.strictMode&&i.i(s.isNullOrUndefined)(this.value)&&this.invalidValueString&&this.updateInputValue(this.invalidValueString),this.changedArgs={value:this.value},this.errorClass(),this.updateIconState()},t.prototype.minMaxUpdates=function(){!i.i(s.isNullOrUndefined)(this.value)&&this.value<this.min&&this.min<=this.max&&this.strictMode?(this.setProperties({value:this.min},!0),this.changedArgs={value:this.value}):!i.i(s.isNullOrUndefined)(this.value)&&this.value>this.max&&this.min<=this.max&&this.strictMode&&(this.setProperties({value:this.max},!0),this.changedArgs={value:this.value})},t.prototype.checkStringValue=function(e){var t=null,a=null,n=null;if("datetimepicker"===this.getModuleName()){var r=new s.Internationalization(this.locale);"Gregorian"===this.calendarMode?(a={format:this.dateTimeFormat,type:"dateTime",skeleton:"yMd"},n={format:r.getDatePattern({skeleton:"yMd"}),type:"dateTime"}):(a={format:this.dateTimeFormat,type:"dateTime",skeleton:"yMd",calendar:"islamic"},n={format:r.getDatePattern({skeleton:"yMd"}),type:"dateTime",calendar:"islamic"})}else a="Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"};return t=this.checkDateValue(this.globalize.parseDate(e,a)),i.i(s.isNullOrUndefined)(t)&&"datetimepicker"===this.getModuleName()&&(t=this.checkDateValue(this.globalize.parseDate(e,n))),t},t.prototype.checkInvalidValue=function(e){if(!(e instanceof Date||i.i(s.isNullOrUndefined)(e))){var t=null,a=e;"number"==typeof e&&(a=e.toString());if("datetimepicker"===this.getModuleName()){var n=new s.Internationalization(this.locale);"Gregorian"===this.calendarMode?({format:this.dateTimeFormat,type:"dateTime",skeleton:"yMd"},{format:n.getDatePattern({skeleton:"yMd"}),type:"dateTime"}):({format:this.dateTimeFormat,type:"dateTime",skeleton:"yMd",calendar:"islamic"},{format:n.getDatePattern({skeleton:"yMd"}),type:"dateTime",calendar:"islamic"})}else"Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"};var r=!1;if("string"!=typeof a)a=null,r=!0;else if("string"==typeof a&&(a=a.trim()),!(t=this.checkStringValue(a))){var l=null,o=null;l=/^\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)?)?/,o=/^\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)?)?/,!l.test(a)&&!o.test(a)||/^[a-zA-Z0-9- ]*$/.test(a)||isNaN(+new Date(this.checkValue(a)))?r=!0:t=new Date(a)}r?(this.strictMode||(this.invalidValueString=a),this.setProperties({value:null},!0)):this.setProperties({value:t},!0)}},t.prototype.bindInputEvent=function(){i.i(s.isNullOrUndefined)(this.formatString)&&!this.enableMask||(this.enableMask||-1===this.formatString.indexOf("y")?s.EventHandler.add(this.inputElement,"input",this.inputHandler,this):s.EventHandler.remove(this.inputElement,"input",this.inputHandler))},t.prototype.bindEvents=function(){s.EventHandler.add(this.inputWrapper.buttons[0],"mousedown touchstart",this.dateIconHandler,this),s.EventHandler.add(this.inputElement,"mouseup",this.mouseUpHandler,this),s.EventHandler.add(this.inputElement,"focus",this.inputFocusHandler,this),s.EventHandler.add(this.inputElement,"blur",this.inputBlurHandler,this),this.enableMask&&s.EventHandler.add(this.inputElement,"keydown",this.keydownHandler,this),this.bindInputEvent(),s.EventHandler.add(this.inputElement,"change",this.inputChangeHandler,this),this.showClearButton&&this.inputWrapper.clearButton&&s.EventHandler.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this),this.formElement&&s.EventHandler.add(this.formElement,"reset",this.resetFormHandler,this),this.defaultKeyConfigs=i.i(s.extend)(this.defaultKeyConfigs,this.keyConfigs),this.keyboardModules=new s.KeyboardEvents(this.inputElement,{eventName:"keydown",keyAction:this.inputKeyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})},t.prototype.keydownHandler=function(e){switch(e.code){case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"ArrowDown":case"Home":case"End":case"Delete":!this.enableMask||this.popupObj||this.readonly||("Delete"!==e.code&&e.preventDefault(),this.notify("keyDownHandler",{module:"MaskedDateTime",e:e}))}},t.prototype.unBindEvents=function(){i.i(s.isNullOrUndefined)(this.inputWrapper)||s.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown touchstart",this.dateIconHandler),s.EventHandler.remove(this.inputElement,"mouseup",this.mouseUpHandler),s.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),s.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),s.EventHandler.remove(this.inputElement,"change",this.inputChangeHandler),this.enableMask&&s.EventHandler.remove(this.inputElement,"keydown",this.keydownHandler),this.showClearButton&&this.inputWrapper.clearButton&&s.EventHandler.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler),this.formElement&&s.EventHandler.remove(this.formElement,"reset",this.resetFormHandler)},t.prototype.resetFormHandler=function(){if(this.enabled&&!this.inputElement.disabled){var 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())}},t.prototype.restoreValue=function(){this.currentDate=this.value?this.value:new Date,this.previousDate=this.value,this.previousElementValue=i.i(s.isNullOrUndefined)(this.inputValueCopy)?"":this.globalize.formatDate(this.inputValueCopy,{format:this.formatString,type:"dateTime",skeleton:"yMd"})},t.prototype.inputChangeHandler=function(e){this.enabled&&e.stopPropagation()},t.prototype.bindClearEvent=function(){this.showClearButton&&this.inputWrapper.clearButton&&s.EventHandler.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this)},t.prototype.resetHandler=function(e){this.enabled&&(e.preventDefault(),this.clear(e))},t.prototype.mouseUpHandler=function(e){this.enableMask&&(e.preventDefault(),this.notify("setMaskSelection",{module:"MaskedDateTime"}))},t.prototype.clear=function(e){this.setProperties({value:null},!0),this.enableMask||this.updateInputValue("");var t={event:e};if(this.trigger("cleared",t),this.invalidValueString="",this.updateInput(),this.popupUpdate(),this.changeEvent(e),this.enableMask&&this.notify("clearHandler",{module:"MaskedDateTime"}),i.i(s.closest)(this.element,"form")){var a=this.element,n=document.createEvent("KeyboardEvent");n.initEvent("keyup",!1,!0),a.dispatchEvent(n)}},t.prototype.preventEventBubbling=function(e){e.preventDefault(),this.interopAdaptor.invokeMethodAsync("OnDateIconClick")},t.prototype.updateInputValue=function(e){n.Input.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton)},t.prototype.dateIconHandler=function(e){this.enabled&&(this.isIconClicked=!0,s.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(),i.i(s.addClass)([this.inputWrapper.container],["e-input-focus"]),i.i(s.addClass)(this.inputWrapper.buttons,"e-active"))),this.isIconClicked=!1)},t.prototype.updateHtmlAttributeToWrapper=function(){if(!i.i(s.isNullOrUndefined)(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var a=t[e];if(!i.i(s.isNullOrUndefined)(this.htmlAttributes[""+a])&&u.indexOf(a)>-1)if("class"===a){var n=this.htmlAttributes[""+a].replace(/\s+/g," ").trim();""!==n&&i.i(s.addClass)([this.inputWrapper.container],n.split(" "))}else if("style"===a){var r=this.inputWrapper.container.getAttribute(a);i.i(s.isNullOrUndefined)(r)?r=this.htmlAttributes[""+a]:";"===r.charAt(r.length-1)?r+=this.htmlAttributes[""+a]:r=r+";"+this.htmlAttributes[""+a],this.inputWrapper.container.setAttribute(a,r)}else this.inputWrapper.container.setAttribute(a,this.htmlAttributes[""+a])}},t.prototype.updateHtmlAttributeToElement=function(){if(!i.i(s.isNullOrUndefined)(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var a=t[e];u.indexOf(a)<0&&this.inputElement.setAttribute(a,this.htmlAttributes[""+a])}},t.prototype.updateCssClass=function(e,t){i.i(s.isNullOrUndefined)(t)||(t=t.replace(/\s+/g," ").trim()),i.i(s.isNullOrUndefined)(e)||(e=e.replace(/\s+/g," ").trim()),n.Input.setCssClass(e,[this.inputWrapper.container],t),this.popupWrapper&&n.Input.setCssClass(e,[this.popupWrapper],t)},t.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();break;case"tab":this.hide(e)}},t.prototype.inputFocusHandler=function(){if(this.isFocused=!0,this.enabled){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));var e={model:this};this.isDateIconClicked=!1,this.trigger("focus",e),this.updateIconState(),this.openOnFocus&&!this.isIconClicked&&this.show()}},t.prototype.inputHandler=function(){this.isPopupClicked=!1,this.enableMask&&this.notify("inputHandler",{module:"MaskedDateTime"})},t.prototype.inputBlurHandler=function(e){if(this.enabled){if(this.strictModeUpdate(),""===this.inputElement.value&&i.i(s.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()){var t={model:this};this.trigger("blur",t)}this.isCalendar()&&(this.defaultKeyConfigs=i.i(s.extend)(this.defaultKeyConfigs,this.keyConfigs),this.calendarKeyboardModules=new s.KeyboardEvents(this.calendarElement.children[1].firstElementChild,{eventName:"keydown",keyAction:this.calendarKeyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})),this.isPopupClicked=!1}},t.prototype.documentHandler=function(t){i.i(s.isNullOrUndefined)(this.popupObj)||i.i(s.isNullOrUndefined)(this.inputWrapper)||!(this.inputWrapper.container.contains(t.target)&&"mousedown"!==t.type||this.popupObj.element&&this.popupObj.element.contains(t.target))||"touchstart"===t.type||t.preventDefault();var a=t.target;i.i(s.closest)(a,".e-datepicker.e-popup-wrapper")||i.i(s.isNullOrUndefined)(this.inputWrapper)||i.i(s.closest)(a,".e-input-group")===this.inputWrapper.container||a.classList.contains("e-day")?i.i(s.closest)(a,".e-datepicker.e-popup-wrapper")&&(a.classList.contains("e-day")&&!i.i(s.isNullOrUndefined)(t.target.parentElement)&&t.target.parentElement.classList.contains("e-selected")&&i.i(s.closest)(a,".e-content")&&i.i(s.closest)(a,".e-content").classList.contains("e-"+this.depth.toLowerCase())?this.hide(t):i.i(s.closest)(a,".e-footer-container")&&a.classList.contains("e-today")&&a.classList.contains("e-btn")&&+new Date(+this.value)==+e.prototype.generateTodayVal.call(this,this.value)&&this.hide(t)):(this.hide(t),this.focusOut())},t.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":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 i=this.inputElement.selectionStart,s=this.inputElement.selectionEnd;if(this.enableMask&&!this.popupObj&&!this.readonly){var 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),this.hide(e);break;default:this.defaultAction(e),"select"===e.action&&t===this.depth&&this.hide(e)}},t.prototype.defaultAction=function(t){this.previousDate=!i.i(s.isNullOrUndefined)(this.value)&&new Date(+this.value)||null,this.isCalendar()&&(e.prototype.keyActionHandle.call(this,t),this.isCalendar()&&i.i(s.attributes)(this.inputElement,{"aria-activedescendant":""+this.setActiveDescendant()}))},t.prototype.popupUpdate=function(){if((i.i(s.isNullOrUndefined)(this.value)&&!i.i(s.isNullOrUndefined)(this.previousDate)||+this.value!=+this.previousDate)&&(this.popupObj&&this.popupObj.element.querySelectorAll(".e-selected").length>0&&i.i(s.removeClass)(this.popupObj.element.querySelectorAll(".e-selected"),["e-selected"]),!i.i(s.isNullOrUndefined)(this.value)&&+this.value>=+this.min&&+this.value<=+this.max)){var t=new Date(this.checkValue(this.value));e.prototype.navigateTo.call(this,"Month",t)}},t.prototype.strictModeUpdate=function(){var e,t,a=/^y/,n=/[^a-zA-Z]/;if("datetimepicker"===this.getModuleName()?e=i.i(s.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString:a.test(this.formatString)&&!n.test(this.formatString)||(e=i.i(s.isNullOrUndefined)(this.formatString)?this.formatString:this.formatString.replace("dd","d")),i.i(s.isNullOrUndefined)(e))e=this.formatString;else{e.split("M").length-1<3&&(e=e.replace("MM","M"))}var r;"datetimepicker"===this.getModuleName()?r="Gregorian"===this.calendarMode?{format:i.i(s.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:i.i(s.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}:(t="Gregorian"===this.calendarMode?{format:e,type:"dateTime",skeleton:"yMd"}:{format:e,type:"dateTime",skeleton:"yMd",calendar:"islamic"},r=t);var l;"string"==typeof this.inputElement.value&&(this.inputElement.value=this.inputElement.value.trim()),"datetimepicker"===this.getModuleName()?this.checkDateValue(this.globalize.parseDate(this.inputElement.value,r))?l=this.globalize.parseDate(this.inputElement.value.toLocaleUpperCase(),r):(t="Gregorian"===this.calendarMode?{type:"dateTime",skeleton:"yMd"}:{type:"dateTime",skeleton:"yMd",calendar:"islamic"},l=this.globalize.parseDate(this.inputElement.value,t)):(l=this.globalize.parseDate(this.inputElement.value,r),l=!i.i(s.isNullOrUndefined)(l)&&isNaN(+l)?null:l,!i.i(s.isNullOrUndefined)(this.formatString)&&""!==this.inputElement.value&&this.strictMode&&(this.isPopupClicked||!this.isPopupClicked&&this.inputElement.value===this.previousElementValue)&&-1===this.formatString.indexOf("y")&&l.setFullYear(this.value.getFullYear())),"datepicker"===this.getModuleName()&&this.value&&!isNaN(+this.value)&&l&&l.setHours(this.value.getHours(),this.value.getMinutes(),this.value.getSeconds(),this.value.getMilliseconds()),this.strictMode&&l?(this.updateInputValue(this.globalize.formatDate(l,r)),this.inputElement.value!==this.previousElementValue&&this.setProperties({value:l},!0)):this.strictMode||this.inputElement.value!==this.previousElementValue&&this.setProperties({value:l},!0),this.strictMode&&!l&&this.inputElement.value===(this.enableMask?this.maskedDateValue:"")&&this.setProperties({value:null},!0),isNaN(+this.value)&&this.setProperties({value:null},!0),i.i(s.isNullOrUndefined)(this.value)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0)))},t.prototype.createCalendar=function(){var e=this;this.popupWrapper=this.createElement("div",{className:h+" e-popup-wrapper"}),i.i(s.isNullOrUndefined)(this.cssClass)||(this.popupWrapper.className+=" "+this.cssClass),s.Browser.isDevice&&(this.modelHeader(),this.modal=this.createElement("div"),this.modal.className=h+" e-date-modal",document.body.className+=" e-date-overflow",this.modal.style.display="block",document.body.appendChild(this.modal)),this.calendarElement.querySelector("table tbody").className="",this.popupObj=new a.Popup(this.popupWrapper,{content:this.calendarElement,relateTo:s.Browser.isDevice?document.body:this.inputWrapper.container,position:s.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:s.Browser.isDevice?{X:"fit",Y:"fit"}:{X:"flip",Y:"flip"},open:function(){s.Browser.isDevice&&e.fullScreenMode&&(e.iconRight=parseInt(window.getComputedStyle(e.calendarElement.querySelector(".e-header.e-month .e-prev")).marginRight,10)>16,e.touchModule=new s.Touch(e.calendarElement.querySelector(".e-content.e-month"),{swipe:e.CalendarSwipeHandler.bind(e)}),s.EventHandler.add(e.calendarElement.querySelector(".e-content.e-month"),"touchstart",e.TouchStartHandler,e)),"datetimepicker"!==e.getModuleName()&&document.activeElement!==e.inputElement&&(e.defaultKeyConfigs=i.i(s.extend)(e.defaultKeyConfigs,e.keyConfigs),e.calendarElement.children[1].firstElementChild.focus(),e.calendarKeyboardModules=new s.KeyboardEvents(e.calendarElement.children[1].firstElementChild,{eventName:"keydown",keyAction:e.calendarKeyActionHandle.bind(e),keyConfigs:e.defaultKeyConfigs}),e.calendarKeyboardModules=new s.KeyboardEvents(e.inputWrapper.container.children[e.index],{eventName:"keydown",keyAction:e.calendarKeyActionHandle.bind(e),keyConfigs:e.defaultKeyConfigs}))},close:function(){e.isDateIconClicked&&e.inputWrapper.container.children[e.index].focus(),e.value&&e.disabledDates(),e.popupObj&&e.popupObj.destroy(),e.resetCalendar(),i.i(s.detach)(e.popupWrapper),e.popupObj=e.popupWrapper=null,e.preventArgs=null,e.calendarKeyboardModules=null,e.setAriaAttributes()},targetExitViewport:function(){s.Browser.isDevice||e.hide()}}),this.popupObj.element.className+=" "+this.cssClass,this.setAriaAttributes()},t.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)},t.prototype.TouchStartHandler=function(e){this.touchStart=!0},t.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)},t.prototype.modelHeader=function(){var e,t=this.createElement("div",{className:"e-model-header"}),i=this.createElement("h1",{className:"e-model-year"}),a=this.createElement("div"),n=this.createElement("span",{className:"e-model-day"}),r=this.createElement("span",{className:"e-model-month"});if(e="Gregorian"===this.calendarMode?{format:"y",skeleton:"dateTime"}:{format:"y",skeleton:"dateTime",calendar:"islamic"},i.textContent=""+this.globalize.formatDate(this.value||new Date,e),e="Gregorian"===this.calendarMode?{format:"E",skeleton:"dateTime"}:{format:"E",skeleton:"dateTime",calendar:"islamic"},n.textContent=this.globalize.formatDate(this.value||new Date,e)+", ",e="Gregorian"===this.calendarMode?{format:"MMM d",skeleton:"dateTime"}:{format:"MMM d",skeleton:"dateTime",calendar:"islamic"},r.textContent=""+this.globalize.formatDate(this.value||new Date,e),this.fullScreenMode){var l=this.createElement("span",{className:"e-popup-close"});s.EventHandler.add(l,"mousedown touchstart",this.modelCloseHandler,this);var o=this.calendarElement.querySelector("button.e-today");a.classList.add("e-day-wrapper"),o.classList.add("e-outline"),t.appendChild(l),t.appendChild(o)}this.fullScreenMode||t.appendChild(i),a.appendChild(n),a.appendChild(r),t.appendChild(a),this.calendarElement.insertBefore(t,this.calendarElement.firstElementChild)},t.prototype.modelCloseHandler=function(e){this.hide()},t.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=!i.i(s.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)},t.prototype.navigatedEvent=function(){this.trigger("navigated",this.navigatedArgs)},t.prototype.changeEvent=function(e){this.isIconClicked||this.isBlur||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.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)},t.prototype.requiredModules=function(){var e=[];return this&&e.push({args:[this],member:"islamic"}),this.enableMask&&e.push({args:[this],member:"MaskedDateTime"}),e},t.prototype.selectCalendar=function(e){var t,a,n;a="datetimepicker"===this.getModuleName()&&i.i(s.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString,this.value&&("datetimepicker"===this.getModuleName()?(n="Gregorian"===this.calendarMode?{format:a,type:"dateTime",skeleton:"yMd"}:{format:a,type:"dateTime",skeleton:"yMd",calendar:"islamic"},t=this.globalize.formatDate(this.changedArgs.value,n)):(n="Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"},t=this.globalize.formatDate(this.changedArgs.value,n)),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"})),i.i(s.isNullOrUndefined)(t)||(this.updateInputValue(t),this.enableMask&&this.notify("setMaskSelection",{module:"MaskedDateTime"}))},t.prototype.isCalendar=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains("e-popup-wrapper"))},t.prototype.setWidth=function(e){this.inputWrapper.container.style.width="number"==typeof e?i.i(s.formatUnit)(this.width):"string"==typeof e?e.match(/px|%|em/)?this.width:i.i(s.formatUnit)(this.width):"100%"},t.prototype.show=function(t,a){var n=this;if(!(this.enabled&&this.readonly||!this.enabled||this.popupObj)){var r=!0,l=void 0;i.i(s.isNullOrUndefined)(this.value)||+this.value>=+new Date(this.checkValue(this.min))&&+this.value<=+new Date(this.checkValue(this.max))?l=this.value||null:(l=new Date(this.checkValue(this.value)),this.setProperties({value:null},!0)),this.isCalendar()||(e.prototype.render.call(this),this.setProperties({value:l||null},!0),this.previousDate=l,this.createCalendar()),s.Browser.isDevice&&(this.mobilePopupWrapper=this.createElement("div",{className:"e-datepick-mob-popup-wrap"}),document.body.appendChild(this.mobilePopupWrapper)),this.preventArgs={preventDefault:function(){r=!1},popup:this.popupObj,event:a||null,cancel:!1,appendTo:s.Browser.isDevice?this.mobilePopupWrapper:document.body};var o=this.preventArgs;this.trigger("open",o,function(t){if(n.preventArgs=t,r&&!n.preventArgs.cancel){i.i(s.addClass)(n.inputWrapper.buttons,"e-active"),n.preventArgs.appendTo.appendChild(n.popupWrapper),n.popupObj.refreshPosition(n.inputElement);var a={name:"FadeIn",duration:s.Browser.isDevice?0:300};1e3===n.zIndex?n.popupObj.show(new s.Animation(a),n.element):n.popupObj.show(new s.Animation(a),null),e.prototype.setOverlayIndex.call(n,n.mobilePopupWrapper,n.popupObj.element,n.modal,s.Browser.isDevice),n.setAriaAttributes()}else n.popupObj.destroy(),n.popupWrapper=n.popupObj=null;i.i(s.isNullOrUndefined)(n.inputElement)||""!==n.inputElement.value||!i.i(s.isNullOrUndefined)(n.tableBodyElement)&&n.tableBodyElement.querySelectorAll("td.e-selected").length>0&&(i.i(s.addClass)([n.tableBodyElement.querySelector("td.e-selected")],"e-focused-date"),i.i(s.removeClass)(n.tableBodyElement.querySelectorAll("td.e-selected"),"e-selected")),s.EventHandler.add(document,"mousedown touchstart",n.documentHandler,n)})}},t.prototype.hide=function(e){var t=this;if(i.i(s.isNullOrUndefined)(this.popupWrapper))s.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit();else{var a=!0;this.preventArgs={preventDefault:function(){a=!1},popup:this.popupObj,event:e||null,cancel:!1},i.i(s.removeClass)(this.inputWrapper.buttons,"e-active"),i.i(s.removeClass)([document.body],"e-date-overflow");var n=this.preventArgs;this.isCalendar()?this.trigger("close",n,function(e){t.closeEventCallback(a,e)}):this.closeEventCallback(a,n)}},t.prototype.closeEventCallback=function(e,t){this.preventArgs=t,this.isCalendar()&&e&&!this.preventArgs.cancel&&(this.popupObj.hide(),this.isAltKeyPressed=!1,this.keyboardModule.destroy(),i.i(s.removeClass)(this.inputWrapper.buttons,"e-active")),this.setAriaAttributes(),s.Browser.isDevice&&this.modal&&(this.modal.style.display="none",this.modal.outerHTML="",this.modal=null),s.Browser.isDevice&&(i.i(s.isNullOrUndefined)(this.mobilePopupWrapper)||!e||!i.i(s.isNullOrUndefined)(this.preventArgs)&&this.preventArgs.cancel||(this.mobilePopupWrapper.remove(),this.mobilePopupWrapper=null)),s.EventHandler.remove(document,"mousedown touchstart",this.documentHandler),s.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit()},t.prototype.focusIn=function(e){document.activeElement!==this.inputElement&&this.enabled&&(this.inputElement.focus(),i.i(s.addClass)([this.inputWrapper.container],["e-input-focus"]))},t.prototype.focusOut=function(){document.activeElement===this.inputElement&&(i.i(s.removeClass)([this.inputWrapper.container],["e-input-focus"]),this.inputElement.blur())},t.prototype.currentView=function(){var t;return this.calendarElement&&(t=e.prototype.currentView.call(this)),t},t.prototype.navigateTo=function(t,i){this.calendarElement&&e.prototype.navigateTo.call(this,t,i)},t.prototype.destroy=function(){this.unBindEvents(),e.prototype.destroy.call(this),i.i(s.isNullOrUndefined)(this.keyboardModules)||this.keyboardModules.destroy(),this.popupObj&&this.popupObj.element.classList.contains("e-popup")&&e.prototype.destroy.call(this);var t={"aria-atomic":"true","aria-disabled":"true","aria-expanded":"false",role:"combobox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false"};this.inputElement&&(n.Input.removeAttributes(t,this.inputElement),i.i(s.isNullOrUndefined)(this.inputElementCopy.getAttribute("tabindex"))?this.inputElement.removeAttribute("tabindex"):this.inputElement.setAttribute("tabindex",this.tabIndex),s.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),s.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),this.ensureInputAttribute()),this.isCalendar()&&(this.popupWrapper&&i.i(s.detach)(this.popupWrapper),this.popupObj=this.popupWrapper=null,this.keyboardModule.destroy()),null===this.ngTag&&(this.inputElement&&(i.i(s.isNullOrUndefined)(this.inputWrapper)||this.inputWrapper.container.insertAdjacentElement("afterend",this.inputElement),i.i(s.removeClass)([this.inputElement],["e-input"])),i.i(s.removeClass)([this.element],[h]),i.i(s.isNullOrUndefined)(this.inputWrapper)||i.i(s.detach)(this.inputWrapper.container)),this.formElement&&s.EventHandler.remove(this.formElement,"reset",this.resetFormHandler),this.inputWrapper=null,this.keyboardModules=null},t.prototype.ensureInputAttribute=function(){for(var e=[],t=0;t<this.inputElement.attributes.length;t++)e[t]=this.inputElement.attributes[t].name;for(var t=0;t<e.length;t++)i.i(s.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])))},t.prototype.preRender=function(){this.inputElementCopy=this.element.cloneNode(!0),i.i(s.removeClass)([this.inputElementCopy],[h,"e-control","e-lib"]),this.inputElement=this.element,this.formElement=i.i(s.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=i.i(s.getUniqueID)("ej2-datetimepicker"),null!==this.ngTag&&i.i(s.attributes)(this.inputElement,{id:this.element.id+"_input"})):(this.element.id=i.i(s.getUniqueID)("ej2-datepicker"),null!==this.ngTag&&i.i(s.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.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex"),e.prototype.preRender.call(this)},t.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},t.prototype.validationAttribute=function(e,t){var a=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");t.setAttribute("name",a),e.removeAttribute("name");for(var n=["required","aria-required","form"],r=0;r<n.length;r++)if(!i.i(s.isNullOrUndefined)(e.getAttribute(n[r]))){var l=e.getAttribute(n[r]);t.setAttribute(n[r],l),e.removeAttribute(n[r])}},t.prototype.checkFormat=function(){var e=new s.Internationalization(this.locale);if(this.format)if("string"==typeof this.format)this.formatString=this.format;else if(""===this.format.skeleton||i.i(s.isNullOrUndefined)(this.format.skeleton))"datetimepicker"===this.getModuleName()?this.formatString=this.dateTimeFormat:this.formatString=null;else{var t=this.format.skeleton;"datetimepicker"===this.getModuleName()?this.formatString=e.getDatePattern({skeleton:t,type:"dateTime"}):this.formatString=e.getDatePattern({skeleton:t,type:"date"})}else this.formatString=null},t.prototype.checkHtmlAttributes=function(e){this.globalize=new s.Internationalization(this.locale),this.checkFormat(),this.checkView();var t,a=e?i.i(s.isNullOrUndefined)(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["value","min","max","disabled","readonly","style","name","placeholder","type"];t="datetimepicker"===this.getModuleName()?"Gregorian"===this.calendarMode?{format:i.i(s.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:i.i(s.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"};for(var n=0,r=a;n<r.length;n++){var l=r[n];if(!i.i(s.isNullOrUndefined)(this.inputElement.getAttribute(l)))switch(l){case"disabled":if(i.i(s.isNullOrUndefined)(this.datepickerOptions)||void 0===this.datepickerOptions.enabled||e){var o="disabled"!==this.inputElement.getAttribute(l)&&""!==this.inputElement.getAttribute(l)&&"true"!==this.inputElement.getAttribute(l);this.setProperties({enabled:o},!e)}break;case"readonly":if(i.i(s.isNullOrUndefined)(this.datepickerOptions)||void 0===this.datepickerOptions.readonly||e){var h="readonly"===this.inputElement.getAttribute(l)||""===this.inputElement.getAttribute(l)||"true"===this.inputElement.getAttribute(l);this.setProperties({readonly:h},!e)}break;case"placeholder":(i.i(s.isNullOrUndefined)(this.datepickerOptions)||void 0===this.datepickerOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(l)},!e);break;case"style":this.inputElement.setAttribute("style",""+this.inputElement.getAttribute(l));break;case"name":this.inputElement.setAttribute("name",""+this.inputElement.getAttribute(l));break;case"value":if(i.i(s.isNullOrUndefined)(this.datepickerOptions)||void 0===this.datepickerOptions.value||e){var u=this.inputElement.getAttribute(l);this.setProperties(i.i(s.setValue)(l,this.globalize.parseDate(u,t),{}),!e)}break;case"min":if(+this.min==+new Date(1900,0,1)||e){var d=this.inputElement.getAttribute(l);this.setProperties(i.i(s.setValue)(l,this.globalize.parseDate(d),{}),!e)}break;case"max":if(+this.max==+new Date(2099,11,31)||e){var p=this.inputElement.getAttribute(l);this.setProperties(i.i(s.setValue)(l,this.globalize.parseDate(p),{}),!e)}break;case"type":"text"!==this.inputElement.getAttribute(l)&&this.inputElement.setAttribute("type","text")}}},t.prototype.getModuleName=function(){return"datepicker"},t.prototype.disabledDates=function(t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);var n,r,l=this.checkDateValue(this.value)?new Date(+this.value):new Date(this.checkValue(this.value)),o=this.previousDate;this.minMaxUpdates(),(!t||t&&!i.i(s.isNullOrUndefined)(this.renderDayCell))&&e.prototype.render.call(this),this.previousDate=o;var h=l&&+l,u='*[id^="/id"]'.replace("/id",""+h);this.strictMode||("string"==typeof this.value||"object"==typeof this.value&&+this.value!=+l)&&this.setProperties({value:l},!0),i.i(s.isNullOrUndefined)(this.calendarElement)||i.i(s.isNullOrUndefined)(this.calendarElement.querySelectorAll(u)[0])||this.calendarElement.querySelectorAll(u)[0].classList.contains("e-disabled")&&(this.strictMode||(this.currentDate=new Date((new Date).setHours(0,0,0,0))));var d;"datetimepicker"===this.getModuleName()?(r="Gregorian"===this.calendarMode?this.globalize.formatDate(l,{format:i.i(s.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd"}):this.globalize.formatDate(l,{format:i.i(s.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}),d=r):(n="Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"},d=this.globalize.formatDate(l,n)),this.popupObj||(this.updateInputValue(d),this.enableMask&&(this.updateInputValue(this.maskedDateValue),this.notify("createMask",{module:"MaskedDateTime",isBlur:a})))},t.prototype.setAriaAttributes=function(){this.isCalendar()?(n.Input.addAttributes({"aria-expanded":"true"},this.inputElement),i.i(s.attributes)(this.inputElement,{"aria-owns":this.inputElement.id+"_options"}),this.value&&i.i(s.attributes)(this.inputElement,{"aria-activedescendant":""+this.setActiveDescendant()})):(n.Input.addAttributes({"aria-expanded":"false"},this.inputElement),this.inputElement.removeAttribute("aria-owns"),this.inputElement.removeAttribute("aria-activedescendant"))},t.prototype.errorClass=function(){var e='*[id^="/id"]'.replace("/id",""+ +this.value),t=this.calendarElement&&this.calendarElement.querySelectorAll(e)[0]&&this.calendarElement.querySelectorAll(e)[0].classList.contains("e-disabled");!(i.i(s.isNullOrUndefined)(this.value)||i.i(s.isNullOrUndefined)(this.min)||i.i(s.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&&i.i(s.isNullOrUndefined)(this.value)||t?(i.i(s.addClass)([this.inputWrapper.container],"e-error"),i.i(s.attributes)(this.inputElement,{"aria-invalid":"true"})):i.i(s.isNullOrUndefined)(this.inputWrapper)||(i.i(s.removeClass)([this.inputWrapper.container],"e-error"),i.i(s.attributes)(this.inputElement,{"aria-invalid":"false"}))},t.prototype.onPropertyChanged=function(t,a){for(var r=0,l=Object.keys(t);r<l.length;r++){switch(l[r]){case"value":this.isDynamicValueChanged=!0,this.isInteracted=!1,this.invalidValueString=null,this.checkInvalidValue(t.value),t.value=this.value,this.previousElementValue=this.inputElement.value,i.i(s.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"allowEdit":this.setAllowEdit();break;case"placeholder":n.Input.setPlaceholder(this.placeholder,this.inputElement);break;case"readonly":n.Input.setReadonly(this.readonly,this.inputElement);break;case"enabled":n.Input.setEnabled(this.enabled,this.inputElement),this.setAriaDisabled();break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.checkHtmlAttributes(!0);break;case"locale":this.globalize=new s.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),n.Input.setPlaceholder(this.placeholder,this.inputElement),this.updateInput(),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"});break;case"enableRtl":n.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]);break;case"start":case"depth":this.checkView(),this.calendarElement&&e.prototype.onPropertyChanged.call(this,t,a);break;case"zIndex":this.setProperties({zIndex:t.zIndex},!0);break;case"cssClass":this.updateCssClass(t.cssClass,a.cssClass);break;case"showClearButton":n.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(t.width),n.Input.calculateWidth(this.inputElement,this.inputWrapper.container),i.i(s.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(s.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=t.floatLabelType,n.Input.removeFloating(this.inputWrapper),n.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder),i.i(s.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(s.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;default:this.calendarElement&&this.isCalendar()&&e.prototype.onPropertyChanged.call(this,t,a)}this.isDynamicValueChanged||this.hide(null),this.isDynamicValueChanged=!1}},o([i.i(s.Property)(null)],t.prototype,"width",void 0),o([i.i(s.Property)(null)],t.prototype,"value",void 0),o([i.i(s.Property)(null)],t.prototype,"cssClass",void 0),o([i.i(s.Property)(!1)],t.prototype,"strictMode",void 0),o([i.i(s.Property)(null)],t.prototype,"format",void 0),o([i.i(s.Property)(!0)],t.prototype,"enabled",void 0),o([i.i(s.Property)(!1)],t.prototype,"fullScreenMode",void 0),o([i.i(s.Property)({})],t.prototype,"htmlAttributes",void 0),o([i.i(s.Property)(null)],t.prototype,"values",void 0),o([i.i(s.Property)(!1)],t.prototype,"isMultiSelection",void 0),o([i.i(s.Property)(!0)],t.prototype,"showClearButton",void 0),o([i.i(s.Property)(!0)],t.prototype,"allowEdit",void 0),o([i.i(s.Property)(null)],t.prototype,"keyConfigs",void 0),o([i.i(s.Property)(!1)],t.prototype,"enablePersistence",void 0),o([i.i(s.Property)(1e3)],t.prototype,"zIndex",void 0),o([i.i(s.Property)(!1)],t.prototype,"readonly",void 0),o([i.i(s.Property)(null)],t.prototype,"placeholder",void 0),o([i.i(s.Property)("Never")],t.prototype,"floatLabelType",void 0),o([i.i(s.Property)(null)],t.prototype,"serverTimezoneOffset",void 0),o([i.i(s.Property)(!1)],t.prototype,"openOnFocus",void 0),o([i.i(s.Property)(!1)],t.prototype,"enableMask",void 0),o([i.i(s.Property)({day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"})],t.prototype,"maskPlaceholder",void 0),o([i.i(s.Event)()],t.prototype,"open",void 0),o([i.i(s.Event)()],t.prototype,"cleared",void 0),o([i.i(s.Event)()],t.prototype,"close",void 0),o([i.i(s.Event)()],t.prototype,"blur",void 0),o([i.i(s.Event)()],t.prototype,"focus",void 0),o([i.i(s.Event)()],t.prototype,"created",void 0),o([i.i(s.Event)()],t.prototype,"destroyed",void 0),t=o([s.NotifyPropertyChanges],t)}(r.a)},function(e,t,i){"use strict";i.d(t,"a",function(){return s}),i.d(t,"b",function(){return g}),i.d(t,"c",function(){return b});var s,a=i(0),n=(i.n(a),i(2)),r=(i.n(n),i(1)),l=(i.n(r),i(6)),o=(i.n(l),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}()),h=this&&this.__decorate||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;l>=0;l--)(a=e[l])&&(r=(n<3?a(r):n>3?a(t,i,r):a(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},u=(new Date).getDate(),d=(new Date).getMonth(),p=(new Date).getFullYear(),c="e-timepicker",m="e-disabled",f="e-input-focus",v="e-list-item",y=["title","class","style"];!function(e){function t(e,t,i,s,a,n){this.calendarMode;var r,o=6e4*n,h=[],u=[];r=+t.setMilliseconds(0);for(var d=+i.setMilliseconds(0);d>=r;)u.push(r),h.push(s.formatDate(new Date(r),{format:a,type:"time"})),r+=o;return{collection:u,list:l.ListBase.createList(e,h,null,!0)}}e.createListItems=t}(s||(s={}));var g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),h([i.i(a.Property)("day")],t.prototype,"day",void 0),h([i.i(a.Property)("month")],t.prototype,"month",void 0),h([i.i(a.Property)("year")],t.prototype,"year",void 0),h([i.i(a.Property)("day of the week")],t.prototype,"dayOfTheWeek",void 0),h([i.i(a.Property)("hour")],t.prototype,"hour",void 0),h([i.i(a.Property)("minute")],t.prototype,"minute",void 0),h([i.i(a.Property)("second")],t.prototype,"second",void 0),t}(a.ChildProperty),b=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.liCollections=[],s.timeCollections=[],s.disableItemCollection=[],s.invalidValueString=null,s.isAngular=!1,s.preventChange=!1,s.maskedDateValue="",s.moduleName=s.getModuleName(),s.timeOptions=t,s}return o(t,e),t.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),i.i(a.removeClass)([this.cloneElement],[c,"e-control","e-lib"]),this.inputElement=this.element,this.angularTag=null,this.formElement=i.i(a.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.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex"),this.openPopupEventArgs={appendTo:document.body}},t.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),i.i(a.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(a.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"),!i.i(a.isNullOrUndefined)(i.i(a.closest)(this.element,"fieldset"))&&i.i(a.closest)(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete()},t.prototype.setTimeZone=function(){if(!i.i(a.isNullOrUndefined)(this.serverTimezoneOffset)&&this.value){var e=(new Date).getTimezoneOffset()/60,t=this.serverTimezoneOffset,s=t+e;s=this.isDayLightSaving()?s--:s,this.value=new Date(this.value.getTime()+60*s*60*1e3)}},t.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)},t.prototype.setTimeAllowEdit=function(){this.allowEdit?this.readonly||this.inputElement.removeAttribute("readonly"):i.i(a.attributes)(this.inputElement,{readonly:""}),this.clearIconState()},t.prototype.clearIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&i.i(a.removeClass)([this.inputWrapper.container],["e-non-edit"]):""===this.inputElement.value?i.i(a.removeClass)([this.inputWrapper.container],["e-non-edit"]):i.i(a.addClass)([this.inputWrapper.container],["e-non-edit"])},t.prototype.validateDisable=function(){this.setMinMax(this.initMin,this.initMax),i.i(a.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))},t.prototype.validationAttribute=function(e,t){var s=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");t.setAttribute("name",s),e.removeAttribute("name");for(var n=["required","aria-required","form"],r=0;r<n.length;r++)if(!i.i(a.isNullOrUndefined)(e.getAttribute(n[r]))){var l=e.getAttribute(n[r]);t.setAttribute(n[r],l),e.removeAttribute(n[r])}},t.prototype.initialize=function(){this.globalize=new a.Internationalization(this.locale),this.defaultCulture=new a.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 a.L10n("timepicker",e,this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),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,i.i(a.isNullOrUndefined)(this.element.getAttribute("id"))?(this.element.id=i.i(a.getUniqueID)("ej2_timepicker"),null!==this.angularTag&&i.i(a.attributes)(this.inputElement,{id:this.element.id+"_input"})):null!==this.angularTag&&(this.inputElement.id=this.element.getAttribute("id")+"_input"),i.i(a.isNullOrUndefined)(this.inputElement.getAttribute("name"))&&i.i(a.attributes)(this.inputElement,{name:this.element.id}),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"})},t.prototype.checkTimeFormat=function(){if(this.format)if("string"==typeof this.format)this.formatString=this.format;else if(i.i(a.isNullOrUndefined)(this.format.skeleton)||""===this.format.skeleton)this.formatString=this.globalize.getDatePattern({type:"time",skeleton:"short"});else{var e=this.format.skeleton;this.formatString=this.globalize.getDatePattern({type:"time",skeleton:e})}else this.formatString=null},t.prototype.checkDateValue=function(e){return!i.i(a.isNullOrUndefined)(e)&&e instanceof Date&&!isNaN(+e)?e:null},t.prototype.createInputElement=function(){this.fullScreenMode&&a.Browser.isDevice&&(this.cssClass+=" e-popup-expand");var e=this.cssClass,t=!this.enableMask;i.i(a.isNullOrUndefined)(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),this.inputWrapper=r.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),i.i(a.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)||r.Input.addAttributes({style:this.inputStyle},this.inputElement),i.i(a.addClass)([this.inputWrapper.container],"e-time-wrapper")},t.prototype.getCldrDateTimeFormat=function(){var e=new a.Internationalization(this.locale),t=e.getDatePattern({skeleton:"yMd"});return this.isNullOrEmpty(this.formatString)?t+" "+this.cldrFormat("time"):this.formatString},t.prototype.checkInvalidValue=function(e){var t=!1;if("object"!=typeof e&&!i.i(a.isNullOrUndefined)(e)){var s=e;"string"==typeof s&&(s=s.trim());var n=null,r=null;if("number"==typeof e?s=e.toString():"string"==typeof e&&(/^[a-zA-Z0-9- ]*$/.test(e)||(n=this.setCurrentDate(this.getDateObject(e)),i.i(a.isNullOrUndefined)(n)&&(n=this.checkDateValue(this.globalize.parseDate(s,{format:this.getCldrDateTimeFormat(),type:"datetime"})),i.i(a.isNullOrUndefined)(n)&&(n=this.checkDateValue(this.globalize.parseDate(s,{format:this.formatString,type:"dateTime",skeleton:"yMd"})))))),r=this.globalize.parseDate(s,{format:this.getCldrDateTimeFormat(),type:"datetime"}),n=!i.i(a.isNullOrUndefined)(r)&&r instanceof Date&&!isNaN(+r)?r:null,i.i(a.isNullOrUndefined)(n)&&s.replace(/\s/g,"").length){var l=null,o=null;l=/^\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)?)?/,o=/^\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)?)?/,!l.test(s)&&!o.test(s)||/^[a-zA-Z0-9- ]*$/.test(e)||isNaN(+new Date(""+s))?t=!0:n=new Date(""+s)}t?(this.strictMode||(this.invalidValueString=s),this.setProperties({value:null},!0),this.initValue=null):(this.setProperties({value:n},!0),this.initValue=this.value)}},t.prototype.requiredModules=function(){var e=[];return this.enableMask&&e.push({args:[this],member:"MaskedDateTime"}),e},t.prototype.cldrFormat=function(e){return"en"===this.locale||"en-US"===this.locale?i.i(a.getValue)("timeFormats.short",i.i(a.getDefaultDateObject)()):this.getCultureTimeObject(a.cldrData,""+this.locale)},t.prototype.destroy=function(){this.hide(),this.unBindEvents();var t={"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&&(r.Input.removeAttributes(t,this.inputElement),null===this.angularTag&&this.inputWrapper.container.parentElement.appendChild(this.inputElement),i.i(a.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"),i.i(a.isNullOrUndefined)(this.cloneElement.getAttribute("disabled"))&&r.Input.setEnabled(!0,this.inputElement,this.floatLabelType)),this.inputWrapper.container&&i.i(a.detach)(this.inputWrapper.container),this.inputWrapper=this.popupWrapper=this.cloneElement=void 0,this.liCollections=this.timeCollections=this.disableItemCollection=[],i.i(a.isNullOrUndefined)(this.rippleFn)||this.rippleFn(),e.prototype.destroy.call(this),this.formElement&&a.EventHandler.remove(this.formElement,"reset",this.formResetHandler),this.rippleFn=null,this.openPopupEventArgs=null,this.selectedElement=null,this.listTag=null,this.liCollections=null},t.prototype.ensureInputAttribute=function(){for(var e=[],t=0;t<this.inputElement.attributes.length;t++)e[t]=this.inputElement.attributes[t].name;for(var t=0;t<e.length;t++)i.i(a.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])))},t.prototype.popupCreation=function(){this.popupWrapper=this.createElement("div",{className:c+" e-popup",attrs:{id:this.element.id+"_popup",style:"visibility:hidden"}}),i.i(a.isNullOrUndefined)(this.cssClass)||(this.popupWrapper.className+=" "+this.cssClass),!i.i(a.isNullOrUndefined)(this.step)&&this.step>0&&(this.generateList(),i.i(a.append)([this.listWrapper],this.popupWrapper)),this.addSelection(),this.renderPopup(),i.i(a.detach)(this.popupWrapper)},t.prototype.getPopupHeight=function(){var e=parseInt("240px",10),t=this.popupWrapper.getBoundingClientRect().height;return t>e?e:t},t.prototype.generateList=function(){this.createListItems(),this.wireListEvents();var e={duration:300,selector:"."+v};this.rippleFn=i.i(a.rippleEffect)(this.listWrapper,e),this.liCollections=this.listWrapper.querySelectorAll("."+v)},t.prototype.renderPopup=function(){var e=this;if(this.containerStyle=this.inputWrapper.container.getBoundingClientRect(),this.popupObj=new n.Popup(this.popupWrapper,{width:this.setPopupWidth(this.width),zIndex:this.zIndex,targetType:"relative",position:a.Browser.isDevice?{X:"center",Y:"center"}:{X:"left",Y:"bottom"},collision:a.Browser.isDevice?{X:"fit",Y:"fit"}:{X:"flip",Y:"flip"},enableRtl:this.enableRtl,relateTo:a.Browser.isDevice?document.body:this.inputWrapper.container,offsetY:4,open:function(){e.popupWrapper.style.visibility="visible",i.i(a.addClass)([e.inputWrapper.buttons[0]],"e-active")},close:function(){i.i(a.removeClass)([e.inputWrapper.buttons[0]],"e-active"),e.unWireListEvents(),e.inputElement.removeAttribute("aria-activedescendant"),i.i(a.remove)(e.popupObj.element),e.popupObj.destroy(),e.popupWrapper.innerHTML="",e.listWrapper=e.popupWrapper=e.listTag=void 0},targetExitViewport:function(){a.Browser.isDevice||e.hide()}}),a.Browser.isDevice||(this.popupObj.collision={X:"none",Y:"flip"}),a.Browser.isDevice&&this.fullScreenMode?(this.popupObj.element.style.maxHeight="100%",this.popupObj.element.style.width="100%"):this.popupObj.element.style.maxHeight="240px",a.Browser.isDevice&&this.fullScreenMode){var t=this.createElement("div",{className:"e-model-header"}),s=this.createElement("span",{className:"e-model-title"});s.textContent="Select time";var r=this.createElement("span",{className:"e-popup-close"});a.EventHandler.add(r,"mousedown touchstart",this.timePopupCloseHandler,this),t.appendChild(r),t.appendChild(s),this.popupWrapper.insertBefore(t,this.popupWrapper.firstElementChild)}},t.prototype.timePopupCloseHandler=function(e){this.hide()},t.prototype.getFormattedValue=function(e){return i.i(a.isNullOrUndefined)(this.checkDateValue(e))?null:this.globalize.formatDate(e,{skeleton:"medium",type:"time"})},t.prototype.getDateObject=function(e){if(!this.isNullOrEmpty(e)){var t=this.createDateObj(e),i=!this.isNullOrEmpty(this.initValue);if(this.checkDateValue(t)){var s=i?this.initValue.getDate():u,a=i?this.initValue.getMonth():d,n=i?this.initValue.getFullYear():p;return new Date(n,a,s,t.getHours(),t.getMinutes(),t.getSeconds())}}return null},t.prototype.updateHtmlAttributeToWrapper=function(){if(!i.i(a.isNullOrUndefined)(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var s=t[e];if(y.indexOf(s)>-1)if("class"===s){var n=this.htmlAttributes[""+s].replace(/\s+/g," ").trim();""!==n&&i.i(a.addClass)([this.inputWrapper.container],n.split(" "))}else if("style"===s){var r=this.inputWrapper.container.getAttribute(s);r=i.i(a.isNullOrUndefined)(r)?this.htmlAttributes[""+s]:r+this.htmlAttributes[""+s],this.inputWrapper.container.setAttribute(s,r)}else this.inputWrapper.container.setAttribute(s,this.htmlAttributes[""+s])}},t.prototype.updateHtmlAttributeToElement=function(){if(!i.i(a.isNullOrUndefined)(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var s=t[e];y.indexOf(s)<0&&this.inputElement.setAttribute(s,this.htmlAttributes[""+s])}},t.prototype.updateCssClass=function(e,t){i.i(a.isNullOrUndefined)(t)||(t=t.replace(/\s+/g," ").trim()),i.i(a.isNullOrUndefined)(e)||(e=e.replace(/\s+/g," ").trim()),r.Input.setCssClass(e,[this.inputWrapper.container],t),this.popupWrapper&&r.Input.setCssClass(e,[this.popupWrapper],t)},t.prototype.removeErrorClass=function(){i.i(a.removeClass)([this.inputWrapper.container],"e-error"),i.i(a.attributes)(this.inputElement,{"aria-invalid":"false"})},t.prototype.checkErrorState=function(e){var t=this.getDateObject(e);this.validateState(t)&&!this.invalidValueString||this.enableMask&&this.inputElement.value===this.maskedDateValue?this.removeErrorClass():(i.i(a.addClass)([this.inputWrapper.container],"e-error"),i.i(a.attributes)(this.inputElement,{"aria-invalid":"true"}))},t.prototype.validateInterval=function(){!i.i(a.isNullOrUndefined)(this.step)&&this.step>0?this.enableElement([this.inputWrapper.buttons[0]]):this.disableTimeIcon()},t.prototype.disableTimeIcon=function(){this.disableElement([this.inputWrapper.buttons[0]]),this.hide()},t.prototype.disableElement=function(e){i.i(a.addClass)(e,m)},t.prototype.enableElement=function(e){i.i(a.removeClass)(e,m)},t.prototype.selectInputText=function(){this.inputElement.setSelectionRange(0,this.inputElement.value.length)},t.prototype.setCursorToEnd=function(){this.inputElement.setSelectionRange(this.inputElement.value.length,this.inputElement.value.length)},t.prototype.getMeridianText=function(){var e;if("en"===this.locale||"en-US"===this.locale)e=i.i(a.getValue)("dayPeriods.format.wide",i.i(a.getDefaultDateObject)());else{e=i.i(a.getValue)("main."+this.locale+".dates.calendars.gregorian.dayPeriods.format.abbreviated",a.cldrData)}return e},t.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)}},t.prototype.getActiveElement=function(){return i.i(a.isNullOrUndefined)(this.popupWrapper)?null:this.popupWrapper.querySelectorAll(".e-active")},t.prototype.isNullOrEmpty=function(e){return!!(i.i(a.isNullOrUndefined)(e)||"string"==typeof e&&""===e.trim())},t.prototype.setWidth=function(e){return e="number"==typeof e?i.i(a.formatUnit)(e):"string"==typeof e?e.match(/px|%|em/)?e:i.i(a.formatUnit)(e):"100%"},t.prototype.setPopupWidth=function(e){if(e=this.setWidth(e),e.indexOf("%")>-1){e=(this.containerStyle.width*parseFloat(e)/100).toString()+"px"}return e},t.prototype.setScrollPosition=function(){var e=this.selectedElement;i.i(a.isNullOrUndefined)(e)?this.popupWrapper&&this.checkDateValue(this.scrollTo)&&this.setScrollTo():this.findScrollTop(e)},t.prototype.findScrollTop=function(e){var t=this.getPopupHeight(),i=e.nextElementSibling,s=i?i.offsetTop:e.offsetTop,a=e.getBoundingClientRect().height;s+e.offsetTop>t?this.popupWrapper.scrollTop=i?s-(t/2+a/2):s:this.popupWrapper.scrollTop=0},t.prototype.setScrollTo=function(){var e;if(i.i(a.isNullOrUndefined)(this.popupWrapper))this.popupWrapper.scrollTop=0;else{var t=this.popupWrapper.querySelectorAll("."+v);if(t.length){var s=this.timeCollections[0],n=this.getDateObject(this.checkDateValue(this.scrollTo)).getTime();e=t[Math.round((n-s)/(6e4*this.step))]}}i.i(a.isNullOrUndefined)(e)?this.popupWrapper.scrollTop=0:this.findScrollTop(e)},t.prototype.getText=function(){return i.i(a.isNullOrUndefined)(this.checkDateValue(this.value))?"":this.getValue(this.value)},t.prototype.getValue=function(e){return i.i(a.isNullOrUndefined)(this.checkDateValue(e))?null:this.globalize.formatDate(e,{format:this.cldrTimeFormat(),type:"time"})},t.prototype.cldrDateFormat=function(){return"en"===this.locale||"en-US"===this.locale?i.i(a.getValue)("dateFormats.short",i.i(a.getDefaultDateObject)()):this.getCultureDateObject(a.cldrData,""+this.locale)},t.prototype.cldrTimeFormat=function(){return this.isNullOrEmpty(this.formatString)?"en"===this.locale||"en-US"===this.locale?i.i(a.getValue)("timeFormats.short",i.i(a.getDefaultDateObject)()):this.getCultureTimeObject(a.cldrData,""+this.locale):this.formatString},t.prototype.dateToNumeric=function(){return"en"===this.locale||"en-US"===this.locale?i.i(a.getValue)("timeFormats.medium",i.i(a.getDefaultDateObject)()):i.i(a.getValue)("main."+this.locale+".dates.calendars.gregorian.timeFormats.medium",a.cldrData)},t.prototype.getExactDateTime=function(e){return i.i(a.isNullOrUndefined)(this.checkDateValue(e))?null:this.globalize.formatDate(e,{format:this.dateToNumeric(),type:"time"})},t.prototype.setValue=function(e){var t=this.checkValue(e);this.strictMode||this.validateState(t)?this.isNullOrEmpty(t)?(this.initValue=null,this.validateMinMax(this.value,this.min,this.max)):this.initValue=this.compareFormatChange(t):(null===this.checkDateValue(this.valueWithMinutes)&&(this.initValue=this.valueWithMinutes=null),this.validateMinMax(this.value,this.min,this.max)),this.updateInput(!0,this.initValue)},t.prototype.compareFormatChange=function(e){return i.i(a.isNullOrUndefined)(e)?null:e!==this.getText()?this.getDateObject(e):this.getDateObject(this.value)},t.prototype.updatePlaceHolder=function(){r.Input.setPlaceholder(this.l10n.getConstant("placeholder"),this.inputElement)},t.prototype.updateInputValue=function(e){r.Input.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton)},t.prototype.preventEventBubbling=function(e){e.preventDefault(),this.interopAdaptor.invokeMethodAsync("OnTimeIconClick")},t.prototype.popupHandler=function(e){this.enabled&&(a.Browser.isDevice&&this.inputElement.setAttribute("readonly",""),e.preventDefault(),this.isPopupOpen()?this.closePopup(0,e):(this.inputElement.focus(),this.show(e)))},t.prototype.mouseDownHandler=function(){this.enabled&&(this.readonly||(this.inputElement.setSelectionRange(0,0),a.EventHandler.add(this.inputElement,"mouseup",this.mouseUpHandler,this)))},t.prototype.mouseUpHandler=function(e){if(!this.readonly){if(e.preventDefault(),this.enableMask)return e.preventDefault(),void this.notify("setMaskSelection",{module:"MaskedDateTime"});a.EventHandler.remove(this.inputElement,"mouseup",this.mouseUpHandler);var t=this.getCursorSelection();0===t.start&&t.end===this.inputElement.value.length||(this.inputElement.value.length>0&&(this.cursorDetails=this.focusSelection()),this.inputElement.setSelectionRange(this.cursorDetails.start,this.cursorDetails.end))}},t.prototype.focusSelection=function(){var e=new RegExp("^[a-zA-Z0-9]+$"),t=this.inputElement.value.split("");t.push(" ");var i=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){a=a,this.isTextSelected=!0;break}s=r+1,n=!1}return{start:s,end:a}},t.prototype.inputHandler=function(e){if(!this.readonly&&this.enabled)switch("right"!==e.action&&"left"!==e.action&&"tab"!==e.action&&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.enableMask&&!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}},t.prototype.onMouseClick=function(e){var t=e.target,s=this.selectedElement=i.i(a.closest)(t,"."+v);this.setSelection(s,e),s&&s.classList.contains(v)&&this.hide()},t.prototype.closePopup=function(e,t){var s=this;if(this.isPopupOpen()&&this.popupWrapper){var n={popup:this.popupObj,event:t||null,cancel:!1,name:"open"};i.i(a.removeClass)([document.body],"e-time-overflow"),this.trigger("close",n,function(t){if(!t.cancel){var n={name:"FadeOut",duration:50,delay:e||0};s.popupObj.hide(new a.Animation(n)),i.i(a.removeClass)([s.inputWrapper.container],["e-icon-anim"]),i.i(a.attributes)(s.inputElement,{"aria-expanded":"false"}),s.inputElement.removeAttribute("aria-owns"),s.inputElement.removeAttribute("aria-activedescendant"),a.EventHandler.remove(document,"mousedown touchstart",s.documentClickHandler)}a.Browser.isDevice&&s.modal&&(s.modal.style.display="none",s.modal.outerHTML="",s.modal=null),a.Browser.isDevice&&(i.i(a.isNullOrUndefined)(s.mobileTimePopupWrap)||(s.mobileTimePopupWrap.remove(),s.mobileTimePopupWrap=null)),a.Browser.isDevice&&s.allowEdit&&!s.readonly&&s.inputElement.removeAttribute("readonly")})}else a.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly")},t.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")},t.prototype.checkValueChange=function(e,t){if(this.strictMode||this.validateState(this.valueWithMinutes))if(t){var s=this.getDateObject(new Date(this.timeCollections[this.activeIndex]));+this.prevDate!=+s&&this.valueProcess(e,s)}else(this.prevValue!==this.inputElement.value||i.i(a.isNullOrUndefined)(this.checkDateValue(this.value)))&&this.valueProcess(e,this.compareFormatChange(this.inputElement.value));else 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)},t.prototype.onMouseOver=function(e){var t=i.i(a.closest)(e.target,"."+v);this.setHover(t,"e-hover")},t.prototype.setHover=function(e,t){this.enabled&&this.isValidLI(e)&&!e.classList.contains(t)&&(this.removeHover(t),i.i(a.addClass)([e],t),"e-navigation"===t&&e.setAttribute("aria-selected","true"))},t.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]),i.i(a.addClass)([this.selectedElement],"e-active"),this.selectedElement.setAttribute("aria-selected","true"),this.checkValueChange(t,!0))},t.prototype.onMouseLeave=function(){this.removeHover("e-hover")},t.prototype.scrollHandler=function(){"timepicker"===this.getModuleName()&&a.Browser.isDevice||this.hide()},t.prototype.setMinMax=function(e,t){i.i(a.isNullOrUndefined)(this.checkDateValue(e))&&(this.initMin=this.getDateObject("12:00:00 AM")),i.i(a.isNullOrUndefined)(this.checkDateValue(t))&&(this.initMax=this.getDateObject("11:59:59 PM"))},t.prototype.validateMinMax=function(e,t,s){var n=e instanceof Date?e:this.getDateObject(e);return i.i(a.isNullOrUndefined)(this.checkDateValue(n))?+this.createDateObj(this.getFormattedValue(this.initMin))>+this.createDateObj(this.getFormattedValue(this.initMax))&&this.disableTimeIcon():e=this.strictOperation(this.initMin,this.initMax,e,n),this.strictMode&&(e=this.valueIsDisable(e)?e:null),this.checkErrorState(e),e},t.prototype.valueIsDisable=function(e){if(this.disableItemCollection.length>0){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},t.prototype.validateState=function(e){if(!this.strictMode){if(!this.valueIsDisable(e))return!1;var t=this.setCurrentDate(this.getDateObject(e)),s=this.setCurrentDate(this.getDateObject(this.initMax)),n=this.setCurrentDate(this.getDateObject(this.initMin));if(i.i(a.isNullOrUndefined)(this.checkDateValue(t))){if(+s<+n||""!==this.inputElement.value)return!1}else if(+t>+s||+t<+n)return!1}return!0},t.prototype.strictOperation=function(e,t,i,s){var a=this.createDateObj(this.getFormattedValue(t)),n=this.createDateObj(this.getFormattedValue(e)),r=this.createDateObj(this.getFormattedValue(s));if(this.strictMode){if(+n>+a)return this.disableTimeIcon(),this.initValue=this.getDateObject(a),this.updateInputValue(this.getValue(this.initValue)),this.enableMask&&this.createMask(),this.inputElement.value;if(+n>=+r)return this.getDateObject(n);if(+r>=+a||+n==+a)return this.getDateObject(a)}else if(+n>+a&&(this.disableTimeIcon(),!isNaN(+this.createDateObj(i))))return i;return i},t.prototype.bindEvents=function(){a.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.popupHandler,this),a.EventHandler.add(this.inputElement,"blur",this.inputBlurHandler,this),a.EventHandler.add(this.inputElement,"focus",this.inputFocusHandler,this),a.EventHandler.add(this.inputElement,"change",this.inputChangeHandler,this),a.EventHandler.add(this.inputElement,"input",this.inputEventHandler,this),this.enableMask&&a.EventHandler.add(this.inputElement,"keydown",this.keydownHandler,this),this.showClearButton&&this.inputWrapper.clearButton&&a.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.clearHandler,this),this.formElement&&a.EventHandler.add(this.formElement,"reset",this.formResetHandler,this),a.Browser.isDevice||(this.keyConfigure=i.i(a.extend)(this.keyConfigure,this.keyConfigs),this.inputEvent=new a.KeyboardEvents(this.inputWrapper.container,{keyAction:this.inputHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}),this.showClearButton&&this.inputElement&&a.EventHandler.add(this.inputElement,"mousedown",this.mouseDownHandler,this))},t.prototype.keydownHandler=function(e){switch(e.code){case"Delete":!this.enableMask||this.popupObj||this.readonly||this.notify("keyDownHandler",{module:"MaskedDateTime",e:e})}},t.prototype.formResetHandler=function(){if(this.enabled&&!this.inputElement.disabled){var e=this.inputElement.getAttribute("value"),t=this.checkDateValue(this.inputEleValue);"EJS-TIMEPICKER"===this.element.tagName&&(t=null,e="",this.inputElement.setAttribute("value","")),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)}},t.prototype.inputChangeHandler=function(e){this.enabled&&e.stopPropagation()},t.prototype.inputEventHandler=function(){this.enableMask&&this.notify("inputHandler",{module:"MaskedDateTime"})},t.prototype.unBindEvents=function(){this.inputWrapper&&a.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown touchstart",this.popupHandler),a.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),a.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),a.EventHandler.remove(this.inputElement,"change",this.inputChangeHandler),a.EventHandler.remove(this.inputElement,"input",this.inputEventHandler),this.inputEvent&&this.inputEvent.destroy(),a.EventHandler.remove(this.inputElement,"mousedown touchstart",this.mouseDownHandler),!this.showClearButton||i.i(a.isNullOrUndefined)(this.inputWrapper)||i.i(a.isNullOrUndefined)(this.inputWrapper.clearButton)||a.EventHandler.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.clearHandler),this.formElement&&a.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},t.prototype.bindClearEvent=function(){this.showClearButton&&this.inputWrapper.clearButton&&a.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.clearHandler,this)},t.prototype.raiseClearedEvent=function(e){var t={event:e};this.trigger("cleared",t)},t.prototype.clearHandler=function(e){if(this.enabled&&(e.preventDefault(),i.i(a.isNullOrUndefined)(this.value)?(this.resetState(),this.raiseClearedEvent(e)):this.clear(e),this.popupWrapper&&(this.popupWrapper.scrollTop=0),this.enableMask&&this.notify("clearHandler",{module:"MaskedDateTime"}),i.i(a.closest)(this.element,"form"))){var t=this.element,s=document.createEvent("KeyboardEvent");s.initEvent("keyup",!1,!0),t.dispatchEvent(s)}},t.prototype.clear=function(e){this.setProperties({value:null},!0),this.initValue=null,this.resetState(),this.raiseClearedEvent(e),this.changeEvent(e)},t.prototype.setZIndex=function(){this.popupObj&&(this.popupObj.zIndex=this.zIndex,this.popupObj.dataBind())},t.prototype.checkAttributes=function(e){for(var t,s=e?i.i(a.isNullOrUndefined)(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["step","disabled","readonly","style","name","value","min","max","placeholder"],n=0,r=s;n<r.length;n++){var l=r[n];if(!i.i(a.isNullOrUndefined)(this.inputElement.getAttribute(l)))switch(l){case"disabled":if(i.i(a.isNullOrUndefined)(this.timeOptions)||void 0===this.timeOptions.enabled||e){var o="disabled"!==this.inputElement.getAttribute(l)&&""!==this.inputElement.getAttribute(l)&&"true"!==this.inputElement.getAttribute(l);this.setProperties({enabled:o},!e)}break;case"style":this.inputStyle=this.inputElement.getAttribute(l);break;case"readonly":if(i.i(a.isNullOrUndefined)(this.timeOptions)||void 0===this.timeOptions.readonly||e){var h="readonly"===this.inputElement.getAttribute(l)||""===this.inputElement.getAttribute(l)||"true"===this.inputElement.getAttribute(l);this.setProperties({readonly:h},!e)}break;case"name":this.inputElement.setAttribute("name",this.inputElement.getAttribute(l));break;case"step":this.step=parseInt(this.inputElement.getAttribute(l),10);break;case"placeholder":(i.i(a.isNullOrUndefined)(this.timeOptions)||void 0===this.timeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(l)},!e);break;case"min":(i.i(a.isNullOrUndefined)(this.timeOptions)||void 0===this.timeOptions.min||e)&&(t=new Date(this.inputElement.getAttribute(l)),i.i(a.isNullOrUndefined)(this.checkDateValue(t))||this.setProperties({min:t},!e));break;case"max":(i.i(a.isNullOrUndefined)(this.timeOptions)||void 0===this.timeOptions.max||e)&&(t=new Date(this.inputElement.getAttribute(l)),i.i(a.isNullOrUndefined)(this.checkDateValue(t))||this.setProperties({max:t},!e));break;case"value":(i.i(a.isNullOrUndefined)(this.timeOptions)||void 0===this.timeOptions.value||e)&&(t=new Date(this.inputElement.getAttribute(l)),i.i(a.isNullOrUndefined)(this.checkDateValue(t))||(this.initValue=t,this.updateInput(!1,this.initValue),this.setProperties({value:t},!e)))}}},t.prototype.setCurrentDate=function(e){return i.i(a.isNullOrUndefined)(this.checkDateValue(e))?null:new Date(p,d,u,e.getHours(),e.getMinutes(),e.getSeconds())},t.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(t[i].toLowerCase().indexOf("h")>=0){e=i;break}return e},t.prototype.updateValue=function(e,t){var s;if(this.isNullOrEmpty(e))this.resetState();else if(s=this.checkValue(e),this.strictMode){var n=null===s&&e.trim().length>0?this.previousState(this.prevDate):this.inputElement.value;this.updateInputValue(n),this.enableMask&&(n||this.updateInputValue(this.maskedDateValue),i.i(a.isNullOrUndefined)(s)&&e!==this.maskedDateValue&&this.createMask(),i.i(a.isNullOrUndefined)(s)&&e===this.maskedDateValue&&this.updateInputValue(this.maskedDateValue))}this.checkValueChange(t,"string"!=typeof e)},t.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.prevValue},t.prototype.resetState=function(){this.removeSelection(),r.Input.setValue("",this.inputElement,this.floatLabelType,!1),this.valueWithMinutes=this.activeIndex=null,this.strictMode||this.checkErrorState(null)},t.prototype.objToString=function(e){return i.i(a.isNullOrUndefined)(this.checkDateValue(e))?null:this.globalize.formatDate(e,{format:this.cldrTimeFormat(),type:"time"})},t.prototype.checkValue=function(e){if(!this.isNullOrEmpty(e)){var t=e instanceof Date?e:this.getDateObject(e);return this.validateValue(t,e)}return this.resetState(),this.valueWithMinutes=null},t.prototype.validateValue=function(e,t){var s,n=this.validateMinMax(t,this.min,this.max),r=this.createDateObj(n);if(this.getFormattedValue(r)!==this.getFormattedValue(this.value)?(this.valueWithMinutes=i.i(a.isNullOrUndefined)(r)?null:r,s=this.objToString(this.valueWithMinutes)):(this.strictMode&&(e=r),this.valueWithMinutes=this.checkDateValue(e),s=this.objToString(this.valueWithMinutes)),!this.strictMode&&i.i(a.isNullOrUndefined)(s)){var l=n.trim().length>0?n:"";this.updateInputValue(l),this.enableMask&&(l||this.updateInputValue(this.maskedDateValue))}else this.updateInputValue(s),this.enableMask&&(""===s&&this.updateInputValue(this.maskedDateValue),i.i(a.isNullOrUndefined)(s)&&t!==this.maskedDateValue&&this.createMask(),i.i(a.isNullOrUndefined)(s)&&t===this.maskedDateValue&&this.updateInputValue(this.maskedDateValue));return s},t.prototype.createMask=function(){this.notify("createMask",{module:"MaskedDateTime"})},t.prototype.findNextElement=function(e){var t=this.inputElement.value,s=i.i(a.isNullOrUndefined)(this.valueWithMinutes)?this.createDateObj(t):this.getDateObject(this.valueWithMinutes),n=null,r=this.liCollections.length,l=this.timeCollections;if(i.i(a.isNullOrUndefined)(this.checkDateValue(s))&&i.i(a.isNullOrUndefined)(this.activeIndex))this.selectNextItem(e);else{if("home"===e.action){var o=this.validLiElement(0);n=+this.createDateObj(new Date(this.timeCollections[o])),this.activeIndex=o}else if("end"===e.action){var o=this.validLiElement(l.length-1,!0);n=+this.createDateObj(new Date(this.timeCollections[o])),this.activeIndex=o}else if("down"===e.action)for(var h=0;h<r;h++){if(+s<this.timeCollections[h]){var o=this.validLiElement(h);n=+this.createDateObj(new Date(this.timeCollections[o])),this.activeIndex=o;break}if(h===r-1){var o=this.validLiElement(0);n=+this.createDateObj(new Date(this.timeCollections[o])),this.activeIndex=o;break}}else for(var h=r-1;h>=0;h--){if(+s>this.timeCollections[h]){var o=this.validLiElement(h,!0);n=+this.createDateObj(new Date(this.timeCollections[o])),this.activeIndex=o;break}if(0===h){var o=this.validLiElement(r-1);n=+this.createDateObj(new Date(this.timeCollections[o])),this.activeIndex=o;break}}this.selectedElement=this.liCollections[this.activeIndex],this.elementValue(i.i(a.isNullOrUndefined)(n)?null:new Date(n))}},t.prototype.selectNextItem=function(e){var t=this.validLiElement(0,"down"!==e.action);this.activeIndex=t,this.selectedElement=this.liCollections[t],this.elementValue(new Date(this.timeCollections[t]))},t.prototype.elementValue=function(e){i.i(a.isNullOrUndefined)(this.checkDateValue(e))||this.checkValue(e)},t.prototype.validLiElement=function(e,t){var s=null,n=i.i(a.isNullOrUndefined)(this.popupWrapper)?this.liCollections:this.popupWrapper.querySelectorAll("."+v),r=!0;if(n.length)if(t)for(var l=e;l>=0;l--){if(!n[l].classList.contains(m)){s=l;break}0===l&&r&&(e=l=n.length,r=!1)}else for(var l=e;l<=n.length-1;l++){if(!n[l].classList.contains(m)){s=l;break}l===n.length-1&&r&&(e=l=-1,r=!1)}return s},t.prototype.keyHandler=function(e){if(!(i.i(a.isNullOrUndefined)(this.step)||this.step<=0||!i.i(a.isNullOrUndefined)(this.inputWrapper)&&this.inputWrapper.buttons[0].classList.contains(m))){var t=this.timeCollections.length;if(i.i(a.isNullOrUndefined)(this.getActiveElement())||0===this.getActiveElement().length)if(this.liCollections.length>0)if(i.i(a.isNullOrUndefined)(this.value)&&i.i(a.isNullOrUndefined)(this.activeIndex)){var s=this.validLiElement(0,"down"!==e.action);this.activeIndex=s,this.selectedElement=this.liCollections[s],this.elementValue(new Date(this.timeCollections[s]))}else this.findNextElement(e);else this.findNextElement(e);else{var n=void 0;if(e.keyCode>=37&&e.keyCode<=40){var 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),n=i.i(a.isNullOrUndefined)(this.timeCollections[s])?this.timeCollections[0]:this.timeCollections[s]}else if("home"===e.action){var s=this.validLiElement(0);this.activeIndex=s,n=this.timeCollections[s]}else if("end"===e.action){var s=this.validLiElement(t-1,!0);this.activeIndex=s,n=this.timeCollections[s]}this.selectedElement=this.liCollections[this.activeIndex],this.elementValue(new Date(n))}this.isNavigate=!0,this.setHover(this.selectedElement,"e-navigation"),this.setActiveDescendant(),this.selectInputText(),!this.isPopupOpen()||null===this.selectedElement||e&&"click"===e.type||this.setScrollPosition()}},t.prototype.getCultureTimeObject=function(e,t){return i.i(a.getValue)("main."+t+".dates.calendars.gregorian.timeFormats.short",e)},t.prototype.getCultureDateObject=function(e,t){return i.i(a.getValue)("main."+t+".dates.calendars.gregorian.dateFormats.short",e)},t.prototype.wireListEvents=function(){a.EventHandler.add(this.listWrapper,"click",this.onMouseClick,this),a.Browser.isDevice||(a.EventHandler.add(this.listWrapper,"mouseover",this.onMouseOver,this),a.EventHandler.add(this.listWrapper,"mouseout",this.onMouseLeave,this))},t.prototype.unWireListEvents=function(){this.listWrapper&&(a.EventHandler.remove(this.listWrapper,"click",this.onMouseClick),a.Browser.isDevice||(a.EventHandler.remove(this.listWrapper,"mouseover",this.onMouseOver),a.EventHandler.remove(this.listWrapper,"mouseout",this.onMouseLeave)))},t.prototype.valueProcess=function(e,t){var s=i.i(a.isNullOrUndefined)(this.checkDateValue(t))?null:t;+this.prevDate!=+s&&(this.initValue=s,this.changeEvent(e))},t.prototype.changeEvent=function(e){this.addSelection(),this.updateInput(!0,this.initValue);var t={event:e||null,value:this.value,text:this.inputElement.value,isInteracted:!i.i(a.isNullOrUndefined)(e),element:this.element};t.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",t),this.invalidValueString=null,this.checkErrorState(this.value)},t.prototype.updateInput=function(e,t){e&&(this.prevValue=this.getValue(t)),this.prevDate=this.valueWithMinutes=t,"number"==typeof t&&(this.value&&+new Date(+this.value).setMilliseconds(0))===+t||(this.setProperties({value:t},!0),this.enableMask&&this.value&&this.createMask()),!this.strictMode&&i.i(a.isNullOrUndefined)(this.value)&&this.invalidValueString&&(this.checkErrorState(this.invalidValueString),this.updateInputValue(this.invalidValueString)),this.clearIconState()},t.prototype.setActiveDescendant=function(){!i.i(a.isNullOrUndefined)(this.selectedElement)&&this.value?i.i(a.attributes)(this.inputElement,{"aria-activedescendant":this.selectedElement.getAttribute("id")}):this.inputElement.removeAttribute("aria-activedescendant")},t.prototype.removeSelection=function(){if(this.removeHover("e-hover"),!i.i(a.isNullOrUndefined)(this.popupWrapper)){var e=this.popupWrapper.querySelectorAll(".e-active");e.length&&(i.i(a.removeClass)(e,"e-active"),e[0].removeAttribute("aria-selected"))}},t.prototype.removeHover=function(e){var t=this.getHoverItem(e);t&&t.length&&(i.i(a.removeClass)(t,e),"e-navigation"===e&&t[0].removeAttribute("aria-selected"))},t.prototype.getHoverItem=function(e){var t;return i.i(a.isNullOrUndefined)(this.popupWrapper)||(t=this.popupWrapper.querySelectorAll("."+e)),t},t.prototype.setActiveClass=function(){if(!i.i(a.isNullOrUndefined)(this.popupWrapper)){var e=this.popupWrapper.querySelectorAll("."+v);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}}},t.prototype.addSelection=function(){this.selectedElement=null,this.removeSelection(),this.setActiveClass(),i.i(a.isNullOrUndefined)(this.selectedElement)||(i.i(a.addClass)([this.selectedElement],"e-active"),this.selectedElement.setAttribute("aria-selected","true"))},t.prototype.isValidLI=function(e){return e&&e.classList.contains(v)&&!e.classList.contains(m)},t.prototype.createDateObj=function(e){var t=this.globalize.formatDate(new Date,{format:null,skeleton:"short",type:"date"}),s=null;return"string"==typeof e?e.toUpperCase().indexOf("AM")>-1||e.toUpperCase().indexOf("PM")>-1?(t=this.defaultCulture.formatDate(new Date,{format:null,skeleton:"short",type:"date"}),s=isNaN(+new Date(t+" "+e))?null:new Date(new Date(t+" "+e).setMilliseconds(0)),i.i(a.isNullOrUndefined)(s)&&(s=this.timeParse(t,e))):s=this.timeParse(t,e):e instanceof Date&&(s=e),s},t.prototype.timeParse=function(e,t){var s;return s=this.globalize.parseDate(e+" "+t,{format:this.cldrDateFormat()+" "+this.cldrTimeFormat(),type:"datetime"}),s=i.i(a.isNullOrUndefined)(s)?this.globalize.parseDate(e+" "+t,{format:this.cldrDateFormat()+" "+this.dateToNumeric(),type:"datetime"}):s,s=i.i(a.isNullOrUndefined)(s)?s:new Date(s.setMilliseconds(0))},t.prototype.createListItems=function(){var e=this;this.listWrapper=this.createElement("div",{className:"e-content",attrs:{tabindex:"-1"}});var t,s=6e4*this.step,n=[];this.timeCollections=[],this.disableItemCollection=[],t=+this.getDateObject(this.initMin).setMilliseconds(0);for(var r=+this.getDateObject(this.initMax).setMilliseconds(0);r>=t;)this.timeCollections.push(t),n.push(this.globalize.formatDate(new Date(t),{format:this.cldrTimeFormat(),type:"time"})),t+=s;var o={itemCreated:function(t){var i={element:t.item,text:t.text,value:e.getDateObject(t.text),isDisabled:!1};e.trigger("itemRender",i,function(t){t.isDisabled&&t.element.classList.add(m),t.element.classList.contains(m)&&e.disableItemCollection.push(t.element.getAttribute("data-value"))})}};this.listTag=l.ListBase.createList(this.createElement,n,o,!0),i.i(a.attributes)(this.listTag,{role:"listbox","aria-hidden":"false",id:this.element.id+"_options",tabindex:"0"}),i.i(a.append)([this.listTag],this.listWrapper)},t.prototype.documentClickHandler=function(e){var t=e.target;i.i(a.isNullOrUndefined)(this.popupObj)||i.i(a.isNullOrUndefined)(this.inputWrapper)||!(this.inputWrapper.container.contains(t)&&"mousedown"!==e.type||this.popupObj.element&&this.popupObj.element.contains(t))||"touchstart"===e.type||e.preventDefault(),i.i(a.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&&(a.Browser.isDevice||(this.isPreventBlur=(a.Browser.isIE||"edge"===a.Browser.info.name)&&document.activeElement===this.inputElement&&t===this.popupWrapper)):this.isPopupOpen()&&(this.hide(),this.focusOut())},t.prototype.setEnableRtl=function(){r.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]),this.popupObj&&(this.popupObj.enableRtl=this.enableRtl,this.popupObj.dataBind())},t.prototype.setEnable=function(){r.Input.setEnabled(this.enabled,this.inputElement,this.floatLabelType),this.enabled?(i.i(a.removeClass)([this.inputWrapper.container],m),i.i(a.attributes)(this.inputElement,{"aria-disabled":"false"}),this.inputElement.setAttribute("tabindex",this.tabIndex)):(this.hide(),i.i(a.addClass)([this.inputWrapper.container],m),i.i(a.attributes)(this.inputElement,{"aria-disabled":"true"}),this.inputElement.tabIndex=-1)},t.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)},t.prototype.inputBlurHandler=function(e){if(this.enabled){if(this.isPreventBlur&&this.isPopupOpen())return void 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("")),i.i(a.removeClass)([this.inputWrapper.container],[f]);var t={model:this};this.trigger("blur",t),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)}},t.prototype.focusOut=function(){if(document.activeElement===this.inputElement){this.inputElement.blur(),i.i(a.removeClass)([this.inputWrapper.container],[f]);var e={model:this};this.trigger("blur",e)}},t.prototype.isPopupOpen=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains(""+c))},t.prototype.inputFocusHandler=function(){if(this.enabled){var e={model:this};this.readonly||a.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.trigger("focus",e),this.clearIconState(),this.openOnFocus&&this.show()}},t.prototype.focusIn=function(){document.activeElement!==this.inputElement&&this.enabled&&this.inputElement.focus()},t.prototype.hide=function(){this.closePopup(100,null),this.clearIconState()},t.prototype.show=function(e){var t=this;if(!(this.enabled&&this.readonly||!this.enabled||this.popupWrapper)){this.popupCreation(),a.Browser.isDevice&&this.listWrapper&&(this.modal=this.createElement("div"),this.modal.className=c+" e-time-modal",document.body.className+=" e-time-overflow",document.body.appendChild(this.modal)),a.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:a.Browser.isDevice?this.mobileTimePopupWrap:document.body};var s=this.openPopupEventArgs;this.trigger("open",s,function(e){if(t.openPopupEventArgs=e,t.openPopupEventArgs.cancel||t.inputWrapper.buttons[0].classList.contains(m))t.popupObj.destroy(),t.popupWrapper=t.listTag=void 0,t.liCollections=t.timeCollections=t.disableItemCollection=[],t.popupObj=null;else{t.openPopupEventArgs.appendTo.appendChild(t.popupWrapper),t.popupAlignment(t.openPopupEventArgs),t.setScrollPosition(),a.Browser.isDevice||t.inputElement.focus();var s={name:"FadeIn",duration:50};t.popupObj.refreshPosition(t.anchor),1e3===t.zIndex?t.popupObj.show(new a.Animation(s),t.element):t.popupObj.show(new a.Animation(s),null),t.setActiveDescendant(),i.i(a.attributes)(t.inputElement,{"aria-expanded":"true"}),i.i(a.attributes)(t.inputElement,{"aria-owns":t.inputElement.id+"_options"}),i.i(a.addClass)([t.inputWrapper.container],f),a.EventHandler.add(document,"mousedown touchstart",t.documentClickHandler,t),t.setOverlayIndex(t.mobileTimePopupWrap,t.popupObj.element,t.modal,a.Browser.isDevice)}})}},t.prototype.setOverlayIndex=function(e,t,s,n){if(n&&!i.i(a.isNullOrUndefined)(t)&&!i.i(a.isNullOrUndefined)(s)&&!i.i(a.isNullOrUndefined)(e)){var r=parseInt(t.style.zIndex,10)?parseInt(t.style.zIndex,10):1e3;s.style.zIndex=(r-1).toString(),e.style.zIndex=r.toString()}},t.prototype.formatValues=function(e){var t;return"number"==typeof e?t=i.i(a.formatUnit)(e):"string"==typeof e&&(t=e.match(/px|%|em/)?e:isNaN(parseInt(e,10))?e:i.i(a.formatUnit)(e)),t},t.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)),a.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")}},t.prototype.getPersistData=function(){var e=["value"];return this.addOnPersist(e)},t.prototype.getModuleName=function(){return"timepicker"},t.prototype.onPropertyChanged=function(e,t){for(var s=0,n=Object.keys(e);s<n.length;s++){var l=n[s];switch(l){case"placeholder":r.Input.setPlaceholder(e.placeholder,this.inputElement);break;case"readonly":r.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,l);break;case"showClearButton":r.Input.setClearButton(this.showClearButton,this.inputElement,this.inputWrapper),this.bindClearEvent();break;case"locale":this.setProperties({locale:e.locale},!0),this.globalize=new a.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.updatePlaceHolder(),this.setValue(this.value),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"});break;case"width":i.i(a.setStyleAttribute)(this.inputWrapper.container,{width:this.setWidth(e.width)}),this.containerStyle=this.inputWrapper.container.getBoundingClientRect(),r.Input.calculateWidth(this.inputElement,this.inputWrapper.container),i.i(a.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(a.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&&i.i(a.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,r.Input.removeFloating(this.inputWrapper),r.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder),i.i(a.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(a.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("")}}},t.prototype.checkInValue=function(e){return e instanceof Date?e.toUTCString():""+e},h([i.i(a.Property)(null)],t.prototype,"width",void 0),h([i.i(a.Property)(null)],t.prototype,"cssClass",void 0),h([i.i(a.Property)(!1)],t.prototype,"strictMode",void 0),h([i.i(a.Property)(null)],t.prototype,"keyConfigs",void 0),h([i.i(a.Property)(null)],t.prototype,"format",void 0),h([i.i(a.Property)(!0)],t.prototype,"enabled",void 0),h([i.i(a.Property)(!1)],t.prototype,"fullScreenMode",void 0),h([i.i(a.Property)(!1)],t.prototype,"readonly",void 0),h([i.i(a.Property)({})],t.prototype,"htmlAttributes",void 0),h([i.i(a.Property)("Never")],t.prototype,"floatLabelType",void 0),h([i.i(a.Property)(null)],t.prototype,"placeholder",void 0),h([i.i(a.Property)(1e3)],t.prototype,"zIndex",void 0),h([i.i(a.Property)(!1)],t.prototype,"enablePersistence",void 0),h([i.i(a.Property)(!0)],t.prototype,"showClearButton",void 0),h([i.i(a.Property)(30)],t.prototype,"step",void 0),h([i.i(a.Property)(null)],t.prototype,"scrollTo",void 0),h([i.i(a.Property)(null)],t.prototype,"value",void 0),h([i.i(a.Property)(null)],t.prototype,"min",void 0),h([i.i(a.Property)(null)],t.prototype,"max",void 0),h([i.i(a.Property)(!0)],t.prototype,"allowEdit",void 0),h([i.i(a.Property)(!1)],t.prototype,"openOnFocus",void 0),h([i.i(a.Property)(!1)],t.prototype,"enableMask",void 0),h([i.i(a.Property)({day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"})],t.prototype,"maskPlaceholder",void 0),h([i.i(a.Property)(null)],t.prototype,"serverTimezoneOffset",void 0),h([i.i(a.Event)()],t.prototype,"change",void 0),h([i.i(a.Event)()],t.prototype,"created",void 0),h([i.i(a.Event)()],t.prototype,"destroyed",void 0),h([i.i(a.Event)()],t.prototype,"open",void 0),h([i.i(a.Event)()],t.prototype,"itemRender",void 0),h([i.i(a.Event)()],t.prototype,"close",void 0),h([i.i(a.Event)()],t.prototype,"cleared",void 0),h([i.i(a.Event)()],t.prototype,"blur",void 0),h([i.i(a.Event)()],t.prototype,"focus",void 0),t=h([a.NotifyPropertyChanges],t)}(a.Component)},function(e,t){e.exports=s},function(e,t,i){"use strict";var s=i(3);i.d(t,"a",function(){return s.b}),i.d(t,"b",function(){return s.a});var a=i(13);i.d(t,"c",function(){return a.a})},function(e,t,i){"use strict";var s=i(4);i.d(t,"a",function(){return s.a})},function(e,t,i){"use strict";var s=i(14);i.d(t,"a",function(){return s.a}),i.d(t,"b",function(){return s.b})},function(e,t,i){"use strict";var s=i(15);i.d(t,"a",function(){return s.a})},function(e,t,i){"use strict";var s=i(17);i.d(t,"a",function(){return s.a})},function(e,t,i){"use strict";var s=i(5);i.d(t,"a",function(){return s.a}),i.d(t,"b",function(){return s.b}),i.d(t,"c",function(){return s.c})},function(e,t,i){"use strict";i.d(t,"a",function(){return r});var s=i(0),a=(i.n(s),"e-other-month"),n="e-disabled",r=function(){function e(e){this.calendarInstance=e}return e.prototype.getModuleName=function(){return"islamic"},e.prototype.islamicTitleUpdate=function(e,t){var i=new s.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"})}},e.prototype.islamicRenderDays=function(e,t,r,l){var o,h=[],u=new Date(this.islamicInValue(e));this.islamicTitleUpdate(e,"days");var d=this.getIslamicDate(u),p=this.toGregorian(d.year,d.month,1),c=d.month;for(u=p;u.getDay()!==this.calendarInstance.firstDayOfWeek;)this.calendarInstance.setStartDate(u,-864e5);for(var m=0;m<42;++m){var f=this.calendarInstance.createElement("td",{className:"e-cell"}),v=this.calendarInstance.createElement("span");m%7==0&&this.calendarInstance.weekNumber&&(v.textContent=""+this.calendarInstance.getWeek(u),f.appendChild(v),i.i(s.addClass)([f],"e-week-number"),h.push(f)),o=new Date(+u),u=this.calendarInstance.minMaxDate(u);var y={type:"dateTime",skeleton:"full",calendar:"islamic"},g=this.calendarInstance.globalize.parseDate(this.calendarInstance.globalize.formatDate(u,y),y),b=this.islamicDayCell(u),D=this.calendarInstance.globalize.formatDate(u,{type:"date",skeleton:"full",calendar:"islamic"}),C=this.calendarInstance.createElement("span");C.textContent=this.calendarInstance.globalize.formatDate(u,{type:"date",skeleton:"d",calendar:"islamic"});var E=this.calendarInstance.min>u||this.calendarInstance.max<u;E?(i.i(s.addClass)([b],n),i.i(s.addClass)([b],"e-overlay")):C.setAttribute("title",""+D);c!==this.getIslamicDate(u).month&&i.i(s.addClass)([b],a),0!==u.getDay()&&6!==u.getDay()||i.i(s.addClass)([b],"e-weekend"),b.appendChild(C),this.calendarInstance.renderDayCellArgs={date:u,isDisabled:!1,element:b,isOutOfRange:E};var k=this.calendarInstance.renderDayCellArgs;if(this.calendarInstance.renderDayCellEvent(k),k.isDisabled)if(this.calendarInstance.isMultiSelection){if(!i.i(s.isNullOrUndefined)(this.calendarInstance.values)&&this.calendarInstance.values.length>0)for(var w=0;w<l.length;w++){var V=+new Date(this.calendarInstance.globalize.formatDate(k.date,{type:"date",skeleton:"yMd",calendar:"islamic"})),M=+new Date(this.calendarInstance.globalize.formatDate(this.calendarInstance.values[w],{type:"date",skeleton:"yMd",calendar:"islamic"}));V===M&&(this.calendarInstance.values.splice(w,1),w=-1)}}else t&&+t==+k.date&&this.calendarInstance.setProperties({value:null},!0);this.calendarInstance.renderDayCellArgs.isDisabled&&!b.classList.contains("e-selected")&&(i.i(s.addClass)([b],n),i.i(s.addClass)([b],"e-overlay"),+this.calendarInstance.renderDayCellArgs.date==+this.calendarInstance.todayDate&&(this.calendarInstance.todayDisabled=!0));var O=b.classList.contains(a),N=b.classList.contains(n);if(N||s.EventHandler.add(b,"click",this.calendarInstance.clickHandler,this.calendarInstance),!this.calendarInstance.isMultiSelection||i.i(s.isNullOrUndefined)(this.calendarInstance.values)||O||N)O||N||!this.calendarInstance.getDateVal(u,t)?this.calendarInstance.updateFocus(O,N,u,b,e):i.i(s.addClass)([b],"e-selected");else{for(var I=0;I<this.calendarInstance.values.length;I++){var V=this.calendarInstance.globalize.formatDate(u,{type:"date",skeleton:"short",calendar:"islamic"}),M=this.calendarInstance.globalize.formatDate(this.calendarInstance.values[I],{type:"date",skeleton:"short",calendar:"islamic"});V===M&&this.calendarInstance.getDateVal(u,this.calendarInstance.values[I])?i.i(s.addClass)([b],"e-selected"):this.calendarInstance.updateFocus(O,N,u,b,e)}this.calendarInstance.values.length<=0&&this.calendarInstance.updateFocus(O,N,u,b,e)}g.getDate()===(new Date).getDate()&&g.getMonth()===(new Date).getMonth()&&g.getFullYear()===(new Date).getFullYear()&&i.i(s.addClass)([b],"e-today"),u=new Date(+o),h.push(this.calendarInstance.renderDayCellArgs.element),this.calendarInstance.addDay(u,1,null,this.calendarInstance.max,this.calendarInstance.min)}return h},e.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=this.islamicCompareMonth(e,this.calendarInstance.max)>-1;this.calendarInstance.previousIconHandler(t),this.calendarInstance.nextIconHandler(i);break;case"Year":var a=this.hijriCompareYear(e,this.calendarInstance.min)<1,n=this.hijriCompareYear(e,this.calendarInstance.max)>-1;this.calendarInstance.previousIconHandler(a),this.calendarInstance.nextIconHandler(n);break;case"Decade":var r=s.HijriParser.toGregorian(1361,1,1),l=this.hijriCompareDecade(e,this.calendarInstance.min)<1,o=this.hijriCompareDecade(e,this.calendarInstance.max)>-1;l=s.HijriParser.toGregorian(this.calendarInstance.headerTitleElement.textContent.split("-")[0].trim(),1,1).getFullYear()===r.getFullYear()||l,this.calendarInstance.previousIconHandler(l),this.calendarInstance.nextIconHandler(o)}},e.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)}},e.prototype.islamicPrevious=function(){var e=this.calendarInstance.getViewNumber(this.calendarInstance.currentView());this.calendarInstance.effect="";var t=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)}},e.prototype.islamicRenderYears=function(e,t){this.calendarInstance.removeTableHeadElement();var a=[],r=i.i(s.isNullOrUndefined)(t),l=new Date(this.islamicInValue(this.calendarInstance.currentDate)),o=l,h=this.getIslamicDate(o);o=s.HijriParser.toGregorian(h.year,1,1);var u=h.month,d=h.year,p=h.year,c=this.getIslamicDate(this.calendarInstance.min).year,m=this.getIslamicDate(this.calendarInstance.min).month,f=this.getIslamicDate(this.calendarInstance.max).year,v=this.getIslamicDate(this.calendarInstance.max).month;this.islamicTitleUpdate(this.calendarInstance.currentDate,"months");for(var y=1;y<=12;++y){var g=this.getIslamicDate(o);o=s.HijriParser.toGregorian(g.year,y,1);var b=this.islamicDayCell(o),D=this.calendarInstance.createElement("span"),C=t&&this.getIslamicDate(t).month===this.getIslamicDate(o).month,E=t&&this.getIslamicDate(t).year===d&&C;D.textContent=this.calendarInstance.globalize.formatDate(o,{type:"dateTime",format:"MMM",calendar:"islamic"}),this.calendarInstance.min&&(p<c||y<m&&p===c)||this.calendarInstance.max&&(p>f||y>v&&p>=f)?i.i(s.addClass)([b],n):!r&&E?i.i(s.addClass)([b],"e-selected"):this.getIslamicDate(o).month===u&&this.getIslamicDate(this.calendarInstance.currentDate).month===u&&i.i(s.addClass)([b],"e-focused-date"),b.classList.contains(n)||s.EventHandler.add(b,"click",this.calendarInstance.clickHandler,this.calendarInstance),b.appendChild(D),a.push(b)}this.islamicRenderTemplate(a,4,"e-year",e,t)},e.prototype.islamicRenderDecade=function(e,t){this.calendarInstance.removeTableHeadElement();var r=[],l=new Date(this.islamicInValue(this.calendarInstance.currentDate)),o=this.getIslamicDate(l);l=s.HijriParser.toGregorian(o.year,1,1);var h=l.getFullYear(),u=new Date(this.islamicInValue(h-h%10)),d=new Date(this.islamicInValue(h-h%10+9)),p=u.getFullYear(),c=d.getFullYear(),m=this.calendarInstance.globalize.formatDate(u,{type:"dateTime",format:"y",calendar:"islamic"}),f=this.calendarInstance.globalize.formatDate(d,{type:"dateTime",format:"y",calendar:"islamic"});"ar"===this.calendarInstance.locale&&(m=Number(m.replace(/[٠١٢٣٤٥٦٧٨٩]/g,function(e){return String.fromCharCode(e.charCodeAt(0)-1632+48)})),f=Number(f.replace(/[٠١٢٣٤٥٦٧٨٩]/g,function(e){return String.fromCharCode(e.charCodeAt(0)-1632+48)})));var v=this.calendarInstance.headerElement.textContent.split("-");if((!i.i(s.isNullOrUndefined)(e)&&v[0]!==m&&"home"===e.action||!i.i(s.isNullOrUndefined)(e)&&"keydown"===e.type&&"end"===e.action)&&(m=this.calendarInstance.headerElement.textContent.split("-")[0].trim(),f=this.calendarInstance.headerElement.textContent.split("-")[1].trim()),this.calendarInstance.islamicPreviousHeader&&(m=this.calendarInstance.islamicPreviousHeader.split("-")[0].trim(),f=this.calendarInstance.islamicPreviousHeader.split("-")[1].trim(),this.calendarInstance.islamicPreviousHeader=null),this.calendarInstance.previousIconClicked){for(var y=0;y<=v.length;y++)(f=f-v[y]==2||v[y]-f==2?(parseInt(f,10)+1).toString():f-v[y]==3||v[y]-f==3?(parseInt(f,10)+2).toString():f-v[y]==4||v[y]-f==4?(parseInt(f,10)+3).toString():f-v[y]==5||v[y]-f==5?(parseInt(f,10)+4).toString():f)-v[y]!=0&&v[y]-f!=0||(f=(parseInt(f,10)-1).toString());f-v[y]!=8&&v[y]-f!=8||(f=(parseInt(f,10)-9).toString(),m=(parseInt(f,10)-9).toString()),f-v[y]!=7&&v[y]-f!=7||(f=(parseInt(f,10)-8).toString(),m=(parseInt(f,10)-9).toString()),m=f-m==10?(parseInt(m,10)+1).toString():f-m==11?(parseInt(m,10)+2).toString():f-m==12?(parseInt(m,10)+3).toString():m,f-m==8&&(m=(parseInt(m,10)-1).toString())}if(this.calendarInstance.nextIconClicked){for(var g=0;g<=v.length;g++)m-v[g]!=0&&v[g]-m!=0||(m=(parseInt(m,10)+1).toString()),m-v[g]==2&&m>v[g].trim()&&(m=(parseInt(m,10)-1).toString()),v[g]-m==1&&m<v[g].trim()&&(m=(parseInt(m,10)+2).toString());m-this.calendarInstance.headerTitleElement.textContent.split("-")[1].trim()>1&&(m=(parseInt(this.calendarInstance.headerTitleElement.textContent.split("-")[1].trim(),10)+1).toString(),f=(parseInt(m,10)+9).toString()),f=f-m==10?(parseInt(f,10)-1).toString():f,f=f-m==7?(parseInt(f,10)+2).toString():f-m==8?(parseInt(f,10)+1).toString():f}if("ar"===this.calendarInstance.locale){var b=this.calendarInstance.globalize.formatDate(u,{type:"dateTime",format:"y",calendar:"islamic"}),D=this.calendarInstance.globalize.formatDate(d,{type:"dateTime",format:"y",calendar:"islamic"});this.calendarInstance.headerTitleElement.textContent=b+" - "+D}else this.calendarInstance.headerTitleElement.textContent=m+" - "+f;this.calendarInstance.nextIconClicked=this.calendarInstance.previousIconClicked=!1;var C=(parseInt(m,10)-2).toString();p=Math.round(.97*parseInt(m,10)+622),c=Math.round(.97*parseInt(f,10)+622);for(var E=Math.round(.97*parseInt(C,10)+622),k=1;k<=12;++k){var w=E+k;l.setFullYear(w),l.setDate(1),l.setMonth(0),this.getIslamicDate(l).year-o.year>1&&(l.setMonth(1),k-=1,l.setFullYear(l.getFullYear()-1)),o=this.getIslamicDate(l);if(l=s.HijriParser.toGregorian(o.year,1,1),o.year===parseInt(m,10)-1||o.year>=m&&o.year<=c||o.year===parseInt(f,10)+1){var V=this.islamicDayCell(l);i.i(s.attributes)(V,{role:"gridcell"});var M=this.calendarInstance.createElement("span");M.textContent=this.calendarInstance.globalize.formatDate(l,{type:"dateTime",format:"y",calendar:"islamic"}),o.year===parseInt(m,10)-1||w<p||w>c&&o.year!==parseInt(f,10)?i.i(s.addClass)([V],a):w<new Date(this.islamicInValue(this.calendarInstance.min)).getFullYear()||w>new Date(this.islamicInValue(this.calendarInstance.max)).getFullYear()?i.i(s.addClass)([V],n):i.i(s.isNullOrUndefined)(t)||this.getIslamicDate(l).year!==this.getIslamicDate(t).year?l.getFullYear()!==this.calendarInstance.currentDate.getFullYear()||V.classList.contains(n)||i.i(s.addClass)([V],"e-focused-date"):i.i(s.addClass)([V],"e-selected"),V.classList.contains(n)||s.EventHandler.add(V,"click",this.calendarInstance.clickHandler,this.calendarInstance),V.appendChild(M),(!i.i(s.isNullOrUndefined)(e)&&"home"===e.action&&o.year.toString()===m||!i.i(s.isNullOrUndefined)(e)&&"end"===e.action&&o.year.toString()===f)&&i.i(s.addClass)([V],"e-focused-date"),r.push(V)}}this.islamicRenderTemplate(r,4,"e-decade",e,t)},e.prototype.islamicDayCell=function(e){var t={skeleton:"full",type:"dateTime",calendar:"islamic"},a=this.calendarInstance.globalize.formatDate(e,t),n=this.calendarInstance.globalize.parseDate(a,t),r=n.valueOf(),l={className:"e-cell",attrs:{id:""+i.i(s.getUniqueID)(""+r),"aria-selected":"false",role:"gridcell"}};return this.calendarInstance.createElement("td",l)},e.prototype.islamicRenderTemplate=function(e,t,n,r,l){var o,h=this.calendarInstance.getViewNumber(this.calendarInstance.currentView());this.calendarInstance.tableBodyElement=this.calendarInstance.createElement("tbody"),this.calendarInstance.table.appendChild(this.calendarInstance.tableBodyElement),i.i(s.removeClass)([this.calendarInstance.contentElement,this.calendarInstance.headerElement],["e-month","e-decade","e-year"]),i.i(s.addClass)([this.calendarInstance.contentElement,this.calendarInstance.headerElement],[n]);for(var u=t,d=0,p=0;p<Math.round(e.length/t);++p){for(o=this.calendarInstance.createElement("tr",{attrs:{role:"row"}}),d=0+d;d<u;d++)e[d].classList.contains("e-week-number")||i.i(s.isNullOrUndefined)(e[d].children[0])||(i.i(s.addClass)([e[d].children[0]],["e-day"]),i.i(s.rippleEffect)(e[d].children[0],{duration:600,isCenterRipple:!0})),o.appendChild(e[d]),this.calendarInstance.weekNumber&&7===d&&e[7].classList.contains(a)&&i.i(s.addClass)([o],"e-month-hide"),!this.calendarInstance.weekNumber&&6===d&&e[6].classList.contains(a)&&i.i(s.addClass)([o],"e-month-hide"),this.calendarInstance.weekNumber?41===d&&e[41].classList.contains(a)&&i.i(s.addClass)([o],"e-month-hide"):35===d&&e[35].classList.contains(a)&&i.i(s.addClass)([o],"e-month-hide");u+=t,d+=0,this.calendarInstance.tableBodyElement.appendChild(o)}this.calendarInstance.table.querySelector("tbody").className=this.calendarInstance.effect,this.islamicIconHandler(),(h!==this.calendarInstance.getViewNumber(this.calendarInstance.currentView())||0===h&&h!==this.calendarInstance.getViewNumber(this.calendarInstance.currentView()))&&this.calendarInstance.navigateHandler(r),this.calendarInstance.setAriaActiveDescendant(),this.calendarInstance.changedArgs={value:this.calendarInstance.value,values:this.calendarInstance.values},this.calendarInstance.changeHandler()},e.prototype.islamicCompareMonth=function(e,t){var i=this.getIslamicDate(e),s=this.getIslamicDate(t);return i.year>s.year?1:i.year<s.year?-1:i.month===s.month?0:i.month>s.month?1:-1},e.prototype.islamicCompare=function(e,t,i){var s,a,n=this.getIslamicDate(e),r=this.getIslamicDate(t),l=r.year;return s=l,a=0,i&&(l-=l%i,s=l-l%i+i-1),n.year>s?a=1:"Decade"===this.calendarInstance.currentView()&&n.year<l&&!(e.getFullYear()>=2060&&e.getFullYear()<=2069)?a=-1:n.year<l&&"Year"===this.calendarInstance.currentView()&&(a=-1),a},e.prototype.getIslamicDate=function(e){return s.HijriParser.getHijriDate(e)},e.prototype.toGregorian=function(e,t,i){return s.HijriParser.toGregorian(e,t,i)},e.prototype.hijriCompareYear=function(e,t){return this.islamicCompare(e,t,0)},e.prototype.hijriCompareDecade=function(e,t){return this.islamicCompare(e,t,10)},e.prototype.destroy=function(){this.calendarInstance=null},e.prototype.islamicInValue=function(e){return e instanceof Date?e.toUTCString():""+e},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return A}),i.d(t,"b",function(){return U});var s=i(0),a=(i.n(s),i(3)),n=i(2),r=(i.n(n),i(18)),l=(i.n(r),i(1)),o=(i.n(l),i(6)),h=(i.n(o),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}()),u=this&&this.__decorate||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;l>=0;l--)(a=e[l])&&(r=(n<3?a(r):n>3?a(t,i,r):a(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},d="e-left-calendar",p="e-right-calendar",c="e-daterangepicker",m="e-active",f="e-start-date",v="e-end-date",y="e-input-focus",g="e-range-hover",b="e-other-month",D="e-disabled",C="e-selected",E="e-calendar",k="e-header",w="e-title",V="e-focused-date",M="e-content",O="e-day-span",N="e-date-disabled",I="e-icon-disabled",T="e-overlay",x="e-list-item",S="e-hover",P=["title","class","style"],A=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return h(t,e),u([i.i(s.Property)()],t.prototype,"label",void 0),u([i.i(s.Property)()],t.prototype,"start",void 0),u([i.i(s.Property)()],t.prototype,"end",void 0),t}(s.ChildProperty),U=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.isCustomRange=!1,s.isCustomWindow=!1,s.presetsItem=[],s.liCollections=[],s.previousEleValue="",s.isKeyPopup=!1,s.dateDisabled=!1,s.isRangeIconClicked=!1,s.isMaxDaysClicked=!1,s.disabledDays=[],s.preventBlur=!1,s.preventFocus=!1,s.invalidValueString=null,s.isAngular=!1,s.preventChange=!1,s.dateRangeOptions=t,s}return h(t,e),t.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"),"Auto"===this.floatLabelType&&l.Input.calculateWidth(this.inputElement,this.inputWrapper.container),i.i(s.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(s.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"),!i.i(s.isNullOrUndefined)(i.i(s.closest)(this.element,"fieldset"))&&i.i(s.closest)(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete()},t.prototype.preRender=function(){if(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=!(!s.Browser.isDevice||!this.fullScreenMode)||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),i.i(s.removeClass)([this.cloneElement],[c,"e-control","e-lib"]),this.updateHtmlAttributeToElement(),this.element.getAttribute("id")?null!==this.angularTag&&(this.inputElement.id=this.element.getAttribute("id")+"_input"):(this.element.id=i.i(s.getUniqueID)("ej2-datetimepicker"),null!==this.angularTag&&i.i(s.attributes)(this.inputElement,{id:this.element.id+"_input"})),this.checkInvalidRange(this.value),!this.invalidValueString&&"string"==typeof this.value){var t=this.value.split(" "+this.separator+" ");this.value=[new Date(t[0]),new Date(t[1])]}this.initProperty(),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex"),e.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=i.i(s.closest)(this.element,"form")},t.prototype.updateValue=function(){this.value&&this.value.length>0?(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.startValue=null,this.setValue()),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.setValue()):(this.setProperties({endDate:new Date(this.checkValue(this.value[1]))},!0),this.endValue=new Date(this.checkValue(this.value[1])),this.setValue()):(this.setProperties({endDate:null},!0),this.endValue=null,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.setValue()):(this.setProperties({endDate:null},!0),this.endValue=null,this.setValue())):i.i(s.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())},t.prototype.initProperty=function(){this.globalize=new s.Internationalization(this.locale),this.checkFormat(),this.checkView(),(i.i(s.isNullOrUndefined)(this.firstDayOfWeek)||this.firstDayOfWeek>6||this.firstDayOfWeek<0)&&this.setProperties({firstDayOfWeek:this.globalize.getFirstDayOfWeek()},!0),this.updateValue()},t.prototype.checkFormat=function(){if(this.format)if("string"==typeof this.format)this.formatString=this.format;else if(""===this.format.skeleton||i.i(s.isNullOrUndefined)(this.format.skeleton))this.formatString=null;else{var e=this.format.skeleton;this.formatString=this.globalize.getDatePattern({skeleton:e,type:"date"})}else this.formatString=null},t.prototype.initialize=function(){null!==this.angularTag&&this.validationAttribute(this.element,this.inputElement),this.checkHtmlAttributes(!1),i.i(s.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 s.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()},t.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]))}},t.prototype.setRangeAllowEdit=function(){this.allowEdit?this.readonly||this.inputElement.removeAttribute("readonly"):i.i(s.attributes)(this.inputElement,{readonly:""}),this.updateClearIconState()},t.prototype.updateClearIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&i.i(s.removeClass)([this.inputWrapper.container],["e-non-edit"]):""===this.inputElement.value?i.i(s.removeClass)([this.inputWrapper.container],["e-non-edit"]):i.i(s.addClass)([this.inputWrapper.container],["e-non-edit"])},t.prototype.validationAttribute=function(e,t){var a=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");t.setAttribute("name",a),e.removeAttribute("name");for(var n=["required","aria-required","form"],r=0;r<n.length;r++)if(!i.i(s.isNullOrUndefined)(e.getAttribute(n[r]))){var l=e.getAttribute(n[r]);t.setAttribute(n[r],l),e.removeAttribute(n[r])}},t.prototype.updateHtmlAttributeToWrapper=function(){if(!i.i(s.isNullOrUndefined)(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var a=t[e];if(P.indexOf(a)>-1)if("class"===a){var n=this.htmlAttributes[""+a].replace(/\s+/g," ").trim();""!==n&&i.i(s.addClass)([this.inputWrapper.container],n.split(" "))}else if("style"===a){var r=this.inputWrapper.container.getAttribute(a);r=i.i(s.isNullOrUndefined)(r)?this.htmlAttributes[""+a]:r+this.htmlAttributes[""+a],this.inputWrapper.container.setAttribute(a,r)}else this.inputWrapper.container.setAttribute(a,this.htmlAttributes[""+a])}},t.prototype.updateHtmlAttributeToElement=function(){if(!i.i(s.isNullOrUndefined)(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var a=t[e];P.indexOf(a)<0&&this.inputElement.setAttribute(a,this.htmlAttributes[""+a])}},t.prototype.updateCssClass=function(e,t){i.i(s.isNullOrUndefined)(t)||(t=t.replace(/\s+/g," ").trim()),i.i(s.isNullOrUndefined)(e)||(e=e.replace(/\s+/g," ").trim()),l.Input.setCssClass(e,[this.inputWrapper.container],t),this.popupWrapper&&l.Input.setCssClass(e,[this.popupWrapper],t)},t.prototype.processPresets=function(){this.presetsItem=[];var e=0;if(!i.i(s.isUndefined)(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)){for(var t=0,a=this.presets;t<a.length;t++){var n=a[t],r=n.label.replace(/\s+/g,"")+"_"+ ++e;"string"==typeof n.end?this.presetsItem.push({id:r,text:n.label,end:new Date(this.checkValue(n.end)),start:new Date(this.checkValue(n.start))}):this.presetsItem.push({id:r,text:n.label,start:n.start,end:n.end})}var l=i.i(s.isNullOrUndefined)(this.startValue)?null:new Date(+this.startValue),o=i.i(s.isNullOrUndefined)(this.endValue)?null:new Date(+this.endValue);this.presetsItem.push({id:"custom_range",text:this.l10n.getConstant("customRange"),start:l,end:o}),i.i(s.isNullOrUndefined)(this.startValue)||i.i(s.isNullOrUndefined)(this.endValue)||(this.isCustomRange=!0,this.activeIndex=this.presetsItem.length-1)}},t.prototype.bindEvents=function(){s.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler,this),s.EventHandler.add(this.inputElement,"focus",this.inputFocusHandler,this),s.EventHandler.add(this.inputElement,"blur",this.inputBlurHandler,this),s.EventHandler.add(this.inputElement,"change",this.inputChangeHandler,this),this.showClearButton&&this.inputWrapper.clearButton&&s.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this),this.isMobile||(this.keyInputConfigs=i.i(s.extend)(this.keyInputConfigs,this.keyConfigs),this.inputKeyboardModule=new s.KeyboardEvents(this.inputElement,{eventName:"keydown",keyAction:this.inputHandler.bind(this),keyConfigs:this.keyInputConfigs})),this.formElement&&s.EventHandler.add(this.formElement,"reset",this.formResetHandler,this),this.enabled?this.inputElement.setAttribute("tabindex",this.tabIndex):this.inputElement.tabIndex=-1},t.prototype.unBindEvents=function(){s.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler),s.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),s.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),s.EventHandler.remove(this.inputElement,"change",this.inputChangeHandler),this.showClearButton&&this.inputWrapper.clearButton&&s.EventHandler.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler),this.isMobile||i.i(s.isNullOrUndefined)(this.inputKeyboardModule)||this.inputKeyboardModule.destroy(),this.formElement&&s.EventHandler.remove(this.formElement,"reset",this.formResetHandler),this.inputElement.tabIndex=-1},t.prototype.updateHiddenInput=function(){if(this.firstHiddenChild&&this.secondHiddenChild){var e={format:this.formatString,type:"datetime",skeleton:"yMd"};"string"==typeof this.startDate&&(this.startDate=this.globalize.parseDate(this.startDate,e)),"string"==typeof this.endDate&&(this.endDate=this.globalize.parseDate(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")}},t.prototype.inputChangeHandler=function(e){this.enabled&&(e.stopPropagation(),this.updateHiddenInput())},t.prototype.bindClearEvent=function(){this.showClearButton&&this.inputWrapper.clearButton&&s.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this)},t.prototype.resetHandler=function(e){if(this.enabled){this.valueType=this.value,e.preventDefault(),this.clear();var t={event:e};if(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),i.i(s.closest)(this.element,"form")){var a=this.firstHiddenChild,n=document.createEvent("KeyboardEvent");n.initEvent("keyup",!1,!0),a.dispatchEvent(n)}}},t.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()},t.prototype.formResetHandler=function(e){if(this.enabled&&this.formElement&&e.target===this.formElement&&!this.inputElement.disabled){var t=this.inputElement.getAttribute("value");i.i(s.isNullOrUndefined)(this.startCopy)?(this.setProperties({value:null,startDate:null,endDate:null},!0),this.startValue=this.endValue=null):(i.i(s.isNullOrUndefined)(this.value)||i.i(s.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),t="",this.startValue=this.endValue=null,this.inputElement.setAttribute("value","")),this.restoreValue(),this.inputElement&&(l.Input.setValue(t,this.inputElement,this.floatLabelType,this.showClearButton),this.errorClass())}},t.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&&this.value.length>0&&this.setProperties({value:null},!0),l.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),i.i(s.isNullOrUndefined)(this.applyButton)||(this.applyButton.disabled=this.applyButton.element.disabled=!0),this.removeSelection()},t.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||i.i(s.isNullOrUndefined)(this.leftCalendar)||(this.isRangeIconClicked=!1,this.calendarFocus(),this.isRangeIconClicked=!0),i.i(s.addClass)([this.inputWrapper.container],[y])))},t.prototype.checkHtmlAttributes=function(e){this.globalize=new s.Internationalization(this.locale);for(var t=e?i.i(s.isNullOrUndefined)(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["startDate","endDate","minDays","maxDays","min","max","disabled","readonly","style","name","placeholder","type","value"],a={format:this.formatString,type:"date",skeleton:"yMd"},n=0,r=t;n<r.length;n++){var l=r[n];if(!i.i(s.isNullOrUndefined)(this.inputElement.getAttribute(l)))switch(l){case"disabled":if(i.i(s.isNullOrUndefined)(this.dateRangeOptions)||void 0===this.dateRangeOptions.enabled||e){var o="disabled"===this.inputElement.getAttribute(l)||""===this.inputElement.getAttribute(l)||"true"===this.inputElement.getAttribute(l);this.setProperties({enabled:!o},!e)}break;case"readonly":if(i.i(s.isNullOrUndefined)(this.dateRangeOptions)||void 0===this.dateRangeOptions.readonly||e){var h="readonly"===this.inputElement.getAttribute(l)||"true"===this.inputElement.getAttribute(l)||""===this.inputElement.getAttribute(l);this.setProperties({readonly:h},!e)}break;case"placeholder":(i.i(s.isNullOrUndefined)(this.dateRangeOptions)||void 0===this.dateRangeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(l)},!e);break;case"value":if(i.i(s.isNullOrUndefined)(this.dateRangeOptions)||void 0===this.dateRangeOptions.value||e){var u=this.inputElement.getAttribute(l);this.setProperties(i.i(s.setValue)(l,u,{}),!e)}break;case"style":this.inputElement.setAttribute("style",""+this.inputElement.getAttribute(l));break;case"min":if(i.i(s.isNullOrUndefined)(this.min)||+this.min==+new Date(1900,0,1)||e){var d=this.globalize.parseDate(this.inputElement.getAttribute(l),a);this.setProperties(i.i(s.setValue)(l,d,{}),!e)}break;case"name":this.inputElement.setAttribute("name",""+this.inputElement.getAttribute(l));break;case"max":if(i.i(s.isNullOrUndefined)(this.max)||+this.max==+new Date(2099,11,31)||e){var d=this.globalize.parseDate(this.inputElement.getAttribute(l),a);this.setProperties(i.i(s.setValue)(l,d,{}),!e)}break;case"startDate":if(i.i(s.isNullOrUndefined)(this.startDate)){var d=this.globalize.parseDate(this.inputElement.getAttribute(l),a);this.startValue=d,this.setValue()}break;case"endDate":if(i.i(s.isNullOrUndefined)(this.endDate)){var d=this.globalize.parseDate(this.inputElement.getAttribute(l),a);this.endValue=d,this.setValue()}break;case"minDays":i.i(s.isNullOrUndefined)(this.minDays)&&this.setProperties(i.i(s.setValue)(l,parseInt(this.inputElement.getAttribute(l),10),{}),!0);break;case"maxDays":i.i(s.isNullOrUndefined)(this.maxDays)&&this.setProperties(i.i(s.setValue)(l,parseInt(this.inputElement.getAttribute(l),10),{}),!0);break;case"type":"text"!==this.inputElement.getAttribute(l)&&this.inputElement.setAttribute("type","text")}}},t.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(var e=0;e<=this.presetsItem.length-2;e++){var t=this.presetsItem[e].start,a=this.presetsItem[e].end;this.startValue&&this.endValue&&+new Date(t.setHours(0,0,0,0))==+new Date(this.startValue.setHours(0,0,0,0))&&+new Date(a.setHours(0,0,0,0))==+new Date(this.endValue.setHours(0,0,0,0))&&(this.activeIndex=e,this.isCustomRange=!1)}this.popupWrapper=i.i(s.createElement)("div",{id:this.element.id+"_popup",className:c+" e-popup"}),this.adjustLongHeaderWidth();var n=!this.isCustomRange||this.isMobile;!i.i(s.isUndefined)(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)&&n?(this.isCustomWindow=!1,this.createPresets(),this.listRippleEffect(),this.renderPopup()):(this.isCustomWindow=!0,this.renderControl())},t.prototype.renderControl=function(){this.createControl(),this.bindCalendarEvents(),this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar]),i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.isNullOrUndefined)(this.startValue)||i.i(s.isNullOrUndefined)(this.renderDayCellArgs)||!this.renderDayCellArgs.isDisabled||this.disabledDateRender(),this.updateHeader()},t.prototype.clearCalendarEvents=function(){this.leftCalPrevIcon&&this.leftCalNextIcon&&this.rightCalPrevIcon&&this.rightCalNextIcon&&(s.EventHandler.clearEvents(this.leftCalPrevIcon),s.EventHandler.clearEvents(this.leftCalNextIcon),s.EventHandler.clearEvents(this.rightCalPrevIcon),s.EventHandler.clearEvents(this.rightCalNextIcon))},t.prototype.updateNavIcons=function(){e.prototype.iconHandler.call(this)},t.prototype.calendarIconEvent=function(){this.clearCalendarEvents(),this.leftCalPrevIcon&&!this.leftCalPrevIcon.classList.contains(D)&&s.EventHandler.add(this.leftCalPrevIcon,"mousedown",this.navPrevFunction),this.leftCalNextIcon&&!this.leftCalNextIcon.classList.contains(D)&&s.EventHandler.add(this.leftCalNextIcon,"mousedown",this.navNextFunction),this.rightCalPrevIcon&&!this.rightCalPrevIcon.classList.contains(D)&&s.EventHandler.add(this.rightCalPrevIcon,"mousedown",this.navPrevFunction),this.rightCalNextIcon&&!this.rightCalNextIcon.classList.contains(D)&&s.EventHandler.add(this.rightCalNextIcon,"mousedown",this.navNextFunction)},t.prototype.bindCalendarEvents=function(){this.isMobile?(this.deviceCalendarEvent(),s.EventHandler.add(this.startButton.element,"click",this.deviceHeaderClick,this),s.EventHandler.add(this.endButton.element,"click",this.deviceHeaderClick,this)):(this.updateNavIcons(),this.calendarIconEvent(),this.calendarIconRipple(),this.headerTitleElement=this.popupObj.element.querySelector(".e-right-calendar .e-header ."+w),this.headerTitleElement=this.popupObj.element.querySelector(".e-left-calendar .e-header ."+w),this.defaultKeyConfigs=i.i(s.extend)(this.defaultKeyConfigs,this.keyConfigs),this.leftKeyboardModule=new s.KeyboardEvents(this.leftCalendar,{eventName:"keydown",keyAction:this.keyInputHandler.bind(this),keyConfigs:this.defaultKeyConfigs}),this.rightKeyboardModule=new s.KeyboardEvents(this.rightCalendar,{eventName:"keydown",keyAction:this.keyInputHandler.bind(this),keyConfigs:this.defaultKeyConfigs})),this.start===this.depth&&this.bindCalendarCellEvents(),this.removeFocusedDate()},t.prototype.calendarIconRipple=function(){i.i(s.rippleEffect)(this.leftCalPrevIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),i.i(s.rippleEffect)(this.leftCalNextIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),i.i(s.rippleEffect)(this.rightCalPrevIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),i.i(s.rippleEffect)(this.rightCalNextIcon,{selector:".e-next",duration:400,isCenterRipple:!0})},t.prototype.deviceCalendarEvent=function(){s.EventHandler.clearEvents(this.nextIcon),s.EventHandler.clearEvents(this.previousIcon),i.i(s.rippleEffect)(this.nextIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),i.i(s.rippleEffect)(this.previousIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),this.nextIcon&&!this.nextIcon.classList.contains(D)&&s.EventHandler.add(this.nextIcon,"mousedown",this.deviceNavNextFunction),this.previousIcon&&!this.previousIcon.classList.contains(D)&&s.EventHandler.add(this.previousIcon,"mousedown",this.deviceNavPrevFunction)},t.prototype.deviceNavNext=function(e){var t=i.i(s.closest)(e.target,"."+E);this.updateDeviceCalendar(t),this.navigateNext(e),this.deviceNavigation()},t.prototype.deviceNavPrevious=function(e){var t=i.i(s.closest)(e.target,"."+E);this.updateDeviceCalendar(t),this.navigatePrevious(e),this.deviceNavigation()},t.prototype.updateDeviceCalendar=function(e){e&&(this.previousIcon=e.querySelector(".e-prev"),this.nextIcon=e.querySelector(".e-next"),this.calendarElement=e,this.deviceCalendar=e,this.contentElement=e.querySelector("."+M),this.tableBodyElement=i.i(s.select)(".e-content tbody",e),this.table=e.querySelector("."+M).getElementsByTagName("table")[0],this.headerTitleElement=e.querySelector(".e-header ."+w),this.headerElement=e.querySelector("."+k))},t.prototype.deviceHeaderClick=function(e){if(e.currentTarget.classList.contains("e-start-btn")&&!i.i(s.isNullOrUndefined)(this.startValue)){this.endButton.element.classList.remove(m),this.startButton.element.classList.add(m);var t=this.popupObj.element.querySelector("."+E);this.updateDeviceCalendar(t),i.i(s.isNullOrUndefined)(this.calendarElement.querySelector(".e-start-date:not(.e-other-month)"))&&(this.currentDate=new Date(+this.startValue),i.i(s.remove)(this.tableBodyElement),this.createContentBody(),this.deviceNavigation()),this.removeClassDisabled()}else if(!i.i(s.isNullOrUndefined)(this.startValue)&&!i.i(s.isNullOrUndefined)(this.endValue)){this.startButton.element.classList.remove(m),this.endButton.element.classList.add(m);var t=this.popupObj.element.querySelector("."+E);this.updateDeviceCalendar(t),i.i(s.isNullOrUndefined)(this.calendarElement.querySelector(".e-end-date:not(.e-other-month)"))&&(this.currentDate=new Date(+this.endValue),i.i(s.remove)(this.tableBodyElement),this.createContentBody(),this.deviceNavigation()),this.updateMinMaxDays(this.popupObj.element.querySelector("."+E)),this.selectableDates()}},t.prototype.inputFocusHandler=function(){if(this.enabled){this.preventBlur=!1;var e={model:this};this.preventFocus||this.trigger("focus",e),this.updateClearIconState(),this.openOnFocus&&!this.preventFocus?(this.preventFocus=!0,this.show()):this.preventFocus=!0}},t.prototype.inputBlurHandler=function(e){if(this.enabled){if(!this.preventBlur){var t=this.inputElement.value;if(i.i(s.isNullOrUndefined)(this.presetsItem)||this.presetsItem.length>0&&this.previousEleValue!==this.inputElement.value&&(this.activeIndex=this.presetsItem.length-1,this.isCustomRange=!0),!i.i(s.isNullOrUndefined)(t)&&""!==t.trim()){var a=t.split(" "+this.separator+" ");if(a.length>1){this.invalidValueString=null;var n={format:this.formatString,type:"date",skeleton:"yMd"},r=new Date(a[0]),o=new Date(a[1]),h=this.getStartEndDate(r,!1,a,n),u=this.getStartEndDate(o,!0,a,n);if(!(i.i(s.isNullOrUndefined)(h)||isNaN(+h)||i.i(s.isNullOrUndefined)(u)||isNaN(+u))){var d=this.startValue;this.startValue=h;var p=this.endValue;if(this.endValue=u,this.setValue(),this.refreshControl(),t!==this.previousEleValue&&this.changeTrigger(e),!this.preventBlur&&document.activeElement!==this.inputElement){this.preventFocus=!1;var c={model:this};this.trigger("blur",c)}return this.updateHiddenInput(),void(this.isMobile&&this.isPopupOpen()&&(this.startValue=d,this.endValue=p))}this.strictMode||(this.startValue=null,this.endValue=null,this.setValue())}else this.strictMode||(this.startValue=null,this.endValue=null,this.setValue())}if(this.strictMode?(i.i(s.isNullOrUndefined)(t)||""!==t.trim()||(this.startValue=null,this.endValue=null),l.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.updateInput()):(i.i(s.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;var c={model:this};this.trigger("blur",c)}}this.updateHiddenInput()}},t.prototype.getStartEndDate=function(e,t,i,s){return"Month"===this.depth?this.globalize.parseDate(i[t?1:0].trim(),s):"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)},t.prototype.clearRange=function(){this.previousStartValue=this.previousEndValue=null,this.currentDate=null},t.prototype.errorClass=function(){var e=this.inputElement.value.trim();(i.i(s.isNullOrUndefined)(this.endValue)&&i.i(s.isNullOrUndefined)(this.startValue)&&""!==e||!i.i(s.isNullOrUndefined)(this.startValue)&&+this.startValue<+this.min||!i.i(s.isNullOrUndefined)(this.startValue)&&!i.i(s.isNullOrUndefined)(this.endValue)&&+this.startValue>+this.endValue||!i.i(s.isNullOrUndefined)(this.endValue)&&+this.endValue>+this.max||this.startValue&&this.isDateDisabled(this.startValue)||this.endValue&&this.isDateDisabled(this.endValue))&&""!==e?(i.i(s.addClass)([this.inputWrapper.container],"e-error"),i.i(s.attributes)(this.inputElement,{"aria-invalid":"true"})):this.inputWrapper&&(i.i(s.removeClass)([this.inputWrapper.container],"e-error"),i.i(s.attributes)(this.inputElement,{"aria-invalid":"false"}))},t.prototype.keyCalendarUpdate=function(e,t,i){return void 0===i&&(i=!0),i&&this.removeFocusedDate(),e?(this.leftCalCurrentDate=new Date(+this.currentDate),t=this.leftCalendar):(this.rightCalCurrentDate=new Date(+this.currentDate),t=this.rightCalendar),this.updateCalendarElement(t),this.table.focus(),t},t.prototype.navInCalendar=function(e,t,a,n,r){var l,o,h=this.getViewNumber(this.currentView()),u=this.min;switch(o=i.i(s.isNullOrUndefined)(this.maxDays)||!this.isMaxDaysClicked||i.i(s.isNullOrUndefined)(this.startValue)?this.max:new Date(new Date(+this.startValue).setDate(this.startValue.getDate()+(this.maxDays-1))),e.action){case"moveRight":l=new Date(+this.currentDate),this.addDay(l,1,e,o,u),t&&+l==+n&&(r=this.keyCalendarUpdate(!1,r)),this.keyboardNavigate(1,h,e,o,u),this.keyNavigation(r,e);break;case"moveLeft":l=new Date(+this.currentDate),this.addDay(l,-1,e,o,u),t||+l==+a&&(r=this.keyCalendarUpdate(!0,r)),this.keyboardNavigate(-1,h,e,o,u),this.keyNavigation(r,e);break;case"moveUp":0===h?(l=new Date(+this.currentDate),this.addDay(l,-7,e,o,u),+l<=+a&&!t&&(r=this.keyCalendarUpdate(!0,r)),this.keyboardNavigate(-7,h,e,o,u)):this.keyboardNavigate(-4,h,e,this.max,this.min),this.keyNavigation(r,e);break;case"moveDown":0===h?(l=new Date(+this.currentDate),this.addDay(l,7,e,o,u),t&&+l>=+n&&(r=this.keyCalendarUpdate(!1,r)),this.keyboardNavigate(7,h,e,o,u)):this.keyboardNavigate(4,h,e,this.max,this.min),this.keyNavigation(r,e);break;case"home":this.currentDate=this.firstDay(this.currentDate),i.i(s.remove)(this.tableBodyElement),0===h?this.renderMonths(e):1===h?this.renderYears(e):this.renderDecades(e),this.keyNavigation(r,e);break;case"end":this.currentDate=this.lastDay(this.currentDate,h),i.i(s.remove)(this.tableBodyElement),0===h?this.renderMonths(e):1===h?this.renderYears(e):this.renderDecades(e),this.keyNavigation(r,e);break;case"tab":this.tabKeyValidation(r,d)&&(r=this.keyCalendarUpdate(!1,r,!1),this.currentDate=this.firstCellToFocus(this.rightCalendar),h=this.getViewNumber(this.currentView()),this.keyboardNavigate(0,h,e,o,u),this.keyNavigation(r,e));break;case"shiftTab":this.tabKeyValidation(r,p)&&(r=this.keyCalendarUpdate(!0,r,!1),this.currentDate=this.firstCellToFocus(this.leftCalendar),this.keyboardNavigate(0,h,e,o,u),this.keyNavigation(r,e))}},t.prototype.firstCellToFocus=function(e){var t=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)"),i=t&&t.id?t.id.split("_")[0]:null,s=new Date(this.currentDate.getFullYear(),this.currentDate.getMonth(),1);return i?new Date(+i):s},t.prototype.keyInputHandler=function(t,a){var n,r=this.getViewNumber(this.currentView()),l=new Date(this.rightCalCurrentDate.getFullYear(),this.rightCalCurrentDate.getMonth(),1),o=new Date(this.leftCalCurrentDate.getFullYear(),this.leftCalCurrentDate.getMonth()+1,0),h=i.i(s.closest)(t.target,"."+p);h=i.i(s.isNullOrUndefined)(h)?this.leftCalendar:h;var u=h.classList.contains(d);this.updateCalendarElement(h);var c=this.tableBodyElement.querySelector("tr td.e-selected"),m=h.querySelector("tr td."+V),g=h.querySelector("tr td."+f),b=h.querySelector("tr td."+v),C=this.getViewNumber(this.depth),E=r===C&&this.getViewNumber(this.start)>=C,k=i.i(s.closest)(t.target,"."+d),w=i.i(s.closest)(t.target,"."+p),M=i.i(s.closest)(t.target,".e-presets");switch(i.i(s.isNullOrUndefined)(m)?i.i(s.isNullOrUndefined)(b)||this.dateDisabled?i.i(s.isNullOrUndefined)(g)||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="",t.action){case"altUpArrow":this.isPopupOpen()&&(this.hide(t),this.preventFocus=!0,this.inputElement.focus(),i.i(s.addClass)([this.inputWrapper.container],[y]));break;case"select":if(E){var O=i.i(s.isNullOrUndefined)(m)?g:m;i.i(s.isNullOrUndefined)(O)||O.classList.contains(D)||this.selectRange(null,O)}else(i.i(s.isNullOrUndefined)(c)||E)&&i.i(s.isNullOrUndefined)(m)||(i.i(s.isNullOrUndefined)(this.value)||(a=this.calendarElement.classList.contains(d)?this.startDate:this.endDate),this.controlDown=t,this.contentClick(null,--r,m||c,a));t.preventDefault();break;case"controlHome":var N=new Date(this.currentDate.getFullYear(),0,1);!u&&+N<+o&&(h=this.keyCalendarUpdate(!0,h)),e.prototype.navigateTo.call(this,"Month",new Date(this.currentDate.getFullYear(),0,1)),this.keyNavigation(h,t);break;case"altRightArrow":i.i(s.isNullOrUndefined)(k)?i.i(s.isNullOrUndefined)(w)?i.i(s.isNullOrUndefined)(M)||this.cancelButton.element.focus():i.i(s.isNullOrUndefined)(this.presetElement)?this.cancelButton.element.focus():(this.presetElement.focus(),this.removeFocusedDate()):this.rightCalendar.children[1].firstElementChild.focus(),t.preventDefault();break;case"altLeftArrow":i.i(s.isNullOrUndefined)(k)?i.i(s.isNullOrUndefined)(w)||this.leftCalendar.children[1].firstElementChild.focus():!0!==this.applyButton.element.disabled?this.applyButton.element.focus():this.cancelButton.element.focus(),t.preventDefault();break;case"controlUp":this.calendarElement.classList.contains(d),this.calendarNavigation(t,this.calendarElement),t.preventDefault();break;case"controlDown":i.i(s.isNullOrUndefined)(c)&&i.i(s.isNullOrUndefined)(m)||E||(i.i(s.isNullOrUndefined)(this.value)||(a=this.calendarElement.classList.contains(d)?this.startDate:this.endDate),this.controlDown=t,this.contentClick(null,--r,c||m,a)),t.preventDefault();break;case"controlEnd":var N=new Date(this.currentDate.getFullYear(),11,31);u&&+N>+l&&(h=this.keyCalendarUpdate(!1,h)),e.prototype.navigateTo.call(this,"Month",new Date(this.currentDate.getFullYear(),11,31)),this.keyNavigation(h,t);break;case"pageUp":n=new Date(+this.currentDate),this.addMonths(n,-1),!u&&+n<=+o&&(h=this.keyCalendarUpdate(!0,h)),this.addMonths(this.currentDate,-1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(h,t);break;case"pageDown":n=new Date(+this.currentDate),this.addMonths(n,1),u&&+n>=+l&&(h=this.keyCalendarUpdate(!1,h)),this.addMonths(this.currentDate,1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(h,t);break;case"shiftPageUp":n=new Date(+this.currentDate),this.addYears(n,-1),!u&&+n<=+o&&(h=this.keyCalendarUpdate(!0,h)),this.addYears(this.currentDate,-1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(h,t);break;case"shiftPageDown":n=new Date(+this.currentDate),this.addYears(n,1),u&&+n>=+l&&(h=this.keyCalendarUpdate(!1,h)),this.addYears(this.currentDate,1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(h,t);break;case"shiftTab":i.i(s.isNullOrUndefined)(this.presetElement)||(this.presetElement.setAttribute("tabindex","0"),this.presetElement.focus(),this.removeFocusedDate()),u&&t.preventDefault(),this.tabKeyValidation(h,p)&&(this.currentDate=new Date(+this.leftCalCurrentDate),this.navInCalendar(t,u,o,l,h));break;case"spacebar":this.applyButton&&!this.applyButton.disabled&&this.applyFunction(t);break;case"tab":this.tabKeyValidation(h,d)&&(this.currentDate=new Date(+this.rightCalCurrentDate),this.navInCalendar(t,u,o,l,h));break;default:this.navInCalendar(t,u,o,l,h),this.checkMinMaxDays()}this.presetHeight()},t.prototype.tabKeyValidation=function(e,t){var i=e.classList.contains(t),s=this.rightCalendar.querySelector(".e-header"),a=this.leftCalendar.querySelector(".e-header"),n=!!s&&s.classList.contains("e-month"),r=!!a&&a.classList.contains("e-month"),l=!!s&&s.classList.contains("e-year"),o=!!a&&a.classList.contains("e-year"),h=!!s&&s.classList.contains("e-decade"),u=!!a&&a.classList.contains("e-decade");return i&&(r||o||u)&&(n||l||h)&&!this.isMobile},t.prototype.keyNavigation=function(e,t){this.bindCalendarCellEvents(e),e.classList.contains(d)?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()},t.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||i.i(s.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())}},t.prototype.bindCalendarCellEvents=function(e){var t;t=e?e.querySelectorAll(".e-calendar td"):this.popupObj.element.querySelectorAll(".e-calendar td");for(var i=0,a=t;i<a.length;i++){var n=a[i];s.EventHandler.clearEvents(n);n.classList.contains(D)||n.classList.contains(N)||n.classList.contains("e-week-number")||(this.isMobile||s.EventHandler.add(n,"mouseover",this.hoverSelection,this),s.EventHandler.add(n,"mousedown",this.selectRange,this))}},t.prototype.removeFocusedDate=function(){for(var e=!i.i(s.isNullOrUndefined)(this.startValue)||!i.i(s.isNullOrUndefined)(this.endValue),t=this.popupObj.element.querySelectorAll(".e-calendar ."+V),a=0,n=t;a<n.length;a++){var r=n[a],l=new Date,o=this.getIdValue(null,r);("Month"===this.depth&&"Month"===this.currentView()&&(!r.classList.contains("e-today")||r.classList.contains("e-today")&&e)||"Year"===this.depth&&"Year"===this.currentView()&&(!this.isSameMonth(l,o)&&!this.isSameYear(l,o)||e)||"Decade"===this.depth&&"Decade"===this.currentView()&&(!this.isSameYear(l,o)||e))&&(r.classList.remove(V),r.classList.contains(f)||r.classList.contains(v)||r.removeAttribute("aria-label"))}},t.prototype.hoverSelection=function(e,t){var a=t||e.currentTarget,n=this.getIdValue(null,a);if(!i.i(s.isNullOrUndefined)(this.startValue)&&+this.startValue>=+this.min&&+this.startValue<=+this.max&&(!this.isDateDisabled(this.endValue)&&!this.isDateDisabled(this.startValue)&&i.i(s.isNullOrUndefined)(this.endValue)&&i.i(s.isNullOrUndefined)(this.startValue)||!i.i(s.isNullOrUndefined)(this.startValue)&&i.i(s.isNullOrUndefined)(this.endValue)))for(var r=this.popupObj.element.querySelectorAll(".e-calendar td"),l=0,o=r;l<o.length;l++){var h=o[l],u=!h.classList.contains(D)||h.classList.contains(N);if(!h.classList.contains("e-week-number")&&u){var d=this.getIdValue(null,h),p=new Date(+this.startValue),c=new Date(+d);c.setHours(0,0,0,0)>=p.setHours(0,0,0,0)&&+d<=+n?i.i(s.addClass)([h],g):i.i(s.removeClass)([h],[g])}}},t.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},t.prototype.updateRange=function(e){if(!i.i(s.isNullOrUndefined)(this.startValue))for(var t=0,a=e;t<a.length;t++)for(var n=a[t],r=n.querySelectorAll(".e-calendar td"),l=0,o=r;l<o.length;l++){var h=o[l];if(!h.classList.contains("e-week-number")&&!h.classList.contains(D)){var u=this.getIdValue(null,h),d=this.getIdValue(null,h);if(i.i(s.isNullOrUndefined)(this.endValue)?i.i(s.removeClass)([h],[g]):this.currentView()===this.depth&&+d.setHours(0,0,0,0)>=+new Date(+this.startValue).setHours(0,0,0,0)&&+d.setHours(0,0,0,0)<=+new Date(+this.endValue).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)&&i.i(s.addClass)([h],g),h.classList.contains(C)&&h.classList.contains(v)&&+d!=+this.endValue&&(i.i(s.removeClass)([h],[C]),i.i(s.removeClass)([h],[v])),h.classList.contains(g)&&+d>+this.endValue&&i.i(s.removeClass)([h],[g]),!h.classList.contains(b)){var p=new Date(+this.startValue),c=new Date(+u);this.currentView()===this.depth&&+c.setHours(0,0,0,0)==+p.setHours(0,0,0,0)&&+c.setHours(0,0,0,0)>=+p.setHours(0,0,0,0)&&+this.startValue>=+this.min&&!this.inputWrapper.container.classList.contains("e-error")&&!this.isDateDisabled(this.startValue)&&!this.isDateDisabled(this.endValue)&&(i.i(s.addClass)([h],[f,C]),this.addSelectedAttributes(h,this.startValue,!0));var m=new Date(+this.endValue);"Year"===this.currentView()?c=new Date(c.getFullYear(),c.getMonth()+1,0):"Decade"===this.currentView()&&(c=new Date(c.getFullYear(),11,31)),this.currentView()===this.depth&&!i.i(s.isNullOrUndefined)(this.endValue)&&+c.setHours(0,0,0,0)==+m.setHours(0,0,0,0)&&+c.setHours(0,0,0,0)<=+m.setHours(0,0,0,0)&&+this.startValue>=+this.min&&!this.inputWrapper.container.classList.contains("e-error")&&!this.isDateDisabled(this.startValue)&&!this.isDateDisabled(this.endValue)&&(i.i(s.addClass)([h],[v,C]),this.addSelectedAttributes(h,this.startValue,!1)),+u!=+this.startValue||i.i(s.isNullOrUndefined)(this.endValue)||+u!=+this.endValue||this.addSelectedAttributes(h,this.endValue,!1,!0)}}}},t.prototype.checkMinMaxDays=function(){(!i.i(s.isNullOrUndefined)(this.minDays)&&this.minDays>0||!i.i(s.isNullOrUndefined)(this.maxDays)&&this.maxDays>0)&&(this.isMobile?this.updateMinMaxDays(this.popupObj.element.querySelector("."+E)):(this.updateMinMaxDays(this.popupObj.element.querySelector("."+d)),this.updateMinMaxDays(this.popupObj.element.querySelector("."+p))))},t.prototype.rangeArgs=function(e){var t,a,n=i.i(s.isNullOrUndefined)(this.startValue)?null:this.globalize.formatDate(this.startValue,{format:this.formatString,type:"date",skeleton:"yMd"}),r=i.i(s.isNullOrUndefined)(this.endValue)?null:this.globalize.formatDate(this.endValue,{format:this.formatString,type:"date",skeleton:"yMd"});return i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.isNullOrUndefined)(this.startValue)?(t="",a=0):(t=n+" "+this.separator+" "+r,a=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1),{value:this.value,startDate:this.startValue,endDate:this.endValue,daySpan:a,event:e||null,element:this.element,isInteracted:!i.i(s.isNullOrUndefined)(e),text:t}},t.prototype.otherMonthSelect=function(e,t,a){var n=+this.getIdValue(null,e),r='*[id^="/id"]:not(.e-other-month)'.replace("/id",""+n),l=this.popupObj&&this.popupObj.element.querySelector(r);i.i(s.isNullOrUndefined)(l)||(t?(i.i(s.addClass)([l],[f,C]),this.addSelectedAttributes(l,this.startValue,!0)):(i.i(s.addClass)([l],[v,C]),this.addSelectedAttributes(l,this.endValue,!0)),a&&this.addSelectedAttributes(e,this.endValue,!1,!0))},t.prototype.selectRange=function(e,t){var a,n;e&&e.preventDefault();var r=i.i(s.isNullOrUndefined)(e)?this.getIdValue(null,t):this.getIdValue(e,null),l=r.getFullYear(),o=r.getMonth(),h=new Date(l,o,1),u=new Date(l,o+1,0),c=new Date(l,0,1),y=new Date(l,11,31);i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.isNullOrUndefined)(this.startValue)?this.isMobile&&this.startButton.element.classList.contains(m)&&this.removeSelection():(!this.isMobile||this.isMobile&&!this.endButton.element.classList.contains(m))&&this.removeSelection();var D=t||e.currentTarget;if(i.i(s.isNullOrUndefined)(this.startValue))i.i(s.isNullOrUndefined)(this.previousStartValue)||(r.setHours(this.previousStartValue.getHours()),r.setMinutes(this.previousStartValue.getMinutes()),r.setSeconds(this.previousStartValue.getSeconds())),this.startValue="Month"===this.depth?new Date(this.checkValue(r)):"Year"===this.depth?h:c,this.endValue=null,this.setValue(),i.i(s.addClass)([D],f),this.addSelectedAttributes(D,this.startValue,!0),D.classList.contains(b)&&this.otherMonthSelect(D,!0),this.checkMinMaxDays(),this.applyButton.disabled=!0,this.applyButton.element.disabled=!0,this.isMobile&&(this.endButton.element.classList.add(m),this.startButton.element.classList.remove(m),this.endButton.element.removeAttribute("disabled"),this.selectableDates()),this.trigger("select",this.rangeArgs(e));else if(+r==+this.startValue||+r>+this.startValue){if(+r==+this.startValue&&!i.i(s.isNullOrUndefined)(this.minDays)&&this.minDays>1)return;this.endValue=null,this.setValue(),(this.isMobile||t)&&this.hoverSelection(e,t),i.i(s.isNullOrUndefined)(this.previousEndValue)||(r.setHours(this.previousEndValue.getHours()),r.setMinutes(this.previousEndValue.getMinutes()),r.setSeconds(this.previousEndValue.getSeconds())),this.endValue="Month"===this.depth?new Date(this.checkValue(r)):"Year"===this.depth?u:y,this.setValue();var E=this.popupObj.element.querySelectorAll("."+v);if(this.isMobile){this.startButton.element.classList.remove(m),this.endButton.element.classList.add(m);for(var k=0,w=E;k<w.length;k++){var V=w[k];V.removeAttribute("aria-label"),V.classList.contains(f)?(this.addSelectedAttributes(V,this.startValue,!0),i.i(s.removeClass)([V],[v])):(V.setAttribute("aria-selected","false"),i.i(s.removeClass)([V],[v,C]))}}i.i(s.addClass)([D],v),+this.endValue==+this.startValue?this.addSelectedAttributes(D,this.endValue,!1,!0):this.addSelectedAttributes(D,this.endValue,!1),D.classList.contains(b)&&(+this.endValue==+this.startValue?this.otherMonthSelect(D,!1,!0):this.otherMonthSelect(D,!1)),E=this.popupObj.element.querySelectorAll("."+v);for(var M=0,O=E;M<O.length;M++){var N=O[M];N.classList.contains(f)&&i.i(s.removeClass)([N],[g])}this.applyButton.disabled=!1,this.applyButton.element.disabled=!1,this.isMobile||this.removeClassDisabled(),!i.i(s.isNullOrUndefined)(this.renderDayCellArgs)&&this.renderDayCellArgs.isDisabled&&this.disabledDateRender(),this.trigger("select",this.rangeArgs(e))}else+r<+this.startValue&&(this.removeClassDisabled(),this.startValue="Month"===this.depth?new Date(this.checkValue(r)):"Year"===this.depth?h:c,this.setValue(),this.removeSelectedAttributes(),i.i(s.removeClass)(this.popupObj.element.querySelectorAll("."+f),[f,C]),i.i(s.addClass)([D],f),this.addSelectedAttributes(D,this.startValue,!0),D.classList.contains(b)&&this.otherMonthSelect(D,!0),this.checkMinMaxDays());e&&(a=i.i(s.closest)(e.target,"."+d)),i.i(s.isNullOrUndefined)(a)?(e&&(n=e&&i.i(s.closest)(e.target,"."+p)),i.i(s.isNullOrUndefined)(n)||this.rightCalendar.children[1].firstElementChild.focus()):this.leftCalendar.children[1].firstElementChild.focus(),i.i(s.addClass)([D],C),this.calendarIconEvent(),this.updateHeader(),this.removeFocusedDate()},t.prototype.selectableDates=function(){if(!i.i(s.isNullOrUndefined)(this.startValue)){var e=this.calendarElement.querySelectorAll(".e-calendar td"),t=!1;if(this.currentView()===this.depth){for(var a=0,n=e;a<n.length;a++){var r=n[a];if(!r.classList.contains(f)&&!r.classList.contains("e-week-number")&&!r.classList.contains(D)){if(+this.getIdValue(null,r)<+this.startValue){i.i(s.addClass)([r],[N,D,T]),s.EventHandler.clearEvents(r);continue}break}if(r.classList.contains(f)&&!r.classList.contains(b)){t=!0;break}}t&&(this.previousIcon.classList.contains(D)||i.i(s.addClass)([this.previousIcon],[I,D,T]))}else{for(var l=0,o=e;l<o.length;l++){var r=o[l],h=this.startValue.getMonth(),u=this.startValue.getFullYear(),d=this.getIdValue(null,r);if(this.startButton.element.classList.contains(m)||!("Year"===this.currentView()&&d.getMonth()<h&&d.getFullYear()<=u||"Decade"===this.currentView()&&d.getMonth()<=h&&d.getFullYear()<u))break;i.i(s.addClass)([r],[D])}e[0].classList.contains(D)?this.previousIconHandler(!0):e[e.length-1].classList.contains(D)&&this.nextIconHandler(!0)}}},t.prototype.updateMinMaxDays=function(e){if(!i.i(s.isNullOrUndefined)(this.startValue)&&i.i(s.isNullOrUndefined)(this.endValue)||this.isMobile&&this.endButton.element.classList.contains(m)){if(!i.i(s.isNullOrUndefined)(this.minDays)&&this.minDays>0||!i.i(s.isNullOrUndefined)(this.maxDays)&&this.maxDays>0){var t=this.removeTimeValueFromDate(this.startValue),a=new Date(new Date(+t).setDate(t.getDate()+(this.minDays-1))),n=new Date(new Date(+t).setDate(t.getDate()+(this.maxDays-1)));a=!i.i(s.isNullOrUndefined)(this.minDays)&&this.minDays>0?a:null,n=!i.i(s.isNullOrUndefined)(this.maxDays)&&this.maxDays>0?n:null,"Year"===this.currentView()?(a=i.i(s.isNullOrUndefined)(a)?null:new Date(a.getFullYear(),a.getMonth(),0),n=i.i(s.isNullOrUndefined)(n)?null:new Date(n.getFullYear(),n.getMonth(),1)):"Decade"===this.currentView()&&(a=i.i(s.isNullOrUndefined)(a)?null:new Date(a.getFullYear()-1,11,1),n=i.i(s.isNullOrUndefined)(n)?null:new Date(n.getFullYear(),0,1));for(var r=e.querySelectorAll(".e-calendar td"),l=void 0,o=0,h=r;o<h.length;o++){var u=h[o];if(!u.classList.contains(f)&&!u.classList.contains("e-week-number")){var c=this.getIdValue(null,u);if(c=this.removeTimeValueFromDate(c),!i.i(s.isNullOrUndefined)(a)&&+c==+a&&u.classList.contains(D)&&a.setDate(a.getDate()+1),!u.classList.contains(D)){if(+c<=+t)continue;!i.i(s.isNullOrUndefined)(a)&&+c<+a&&(i.i(s.addClass)([u],[N,D,T]),s.EventHandler.clearEvents(u)),!i.i(s.isNullOrUndefined)(n)&&+c>+n&&(i.i(s.addClass)([u],[N,D,T]),this.isMaxDaysClicked=!0,s.EventHandler.clearEvents(u),i.i(s.isNullOrUndefined)(l)&&!u.classList.contains(b)&&(l=u))}}}if(!i.i(s.isNullOrUndefined)(l))if(this.isMobile)this.nextIcon.classList.contains(D)||i.i(s.addClass)([this.nextIcon],[I,D,T]);else{var v=i.i(s.closest)(l,"."+p);v=i.i(s.isNullOrUndefined)(v)?this.leftCalendar:v;var y=v.classList.contains(d);y?(this.rightCalNextIcon.classList.contains(D)||i.i(s.addClass)([this.rightCalNextIcon],[I,D,T]),this.leftCalNextIcon.classList.contains(D)||i.i(s.addClass)([this.leftCalNextIcon],[I,D,T]),this.rightCalPrevIcon.classList.contains(D)||i.i(s.addClass)([this.rightCalPrevIcon],[I,D,T])):this.rightCalNextIcon.classList.contains(D)||i.i(s.addClass)([this.rightCalNextIcon],[I,D,T])}}}else this.isMaxDaysClicked=!1},t.prototype.removeTimeValueFromDate=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())},t.prototype.removeClassDisabled=function(){for(var e=this.popupObj.element.querySelectorAll(".e-calendar td."+N),t=0,a=e;t<a.length;t++){var n=a[t];n.classList.contains(N)&&(i.i(s.removeClass)([n],[N,D,T]),s.EventHandler.add(n,"click",this.selectRange,this),this.isMobile||s.EventHandler.add(n,"mouseover",this.hoverSelection,this))}this.isMobile?(this.nextIcon.classList.contains(I)&&i.i(s.removeClass)([this.nextIcon],[I,D,T]),this.previousIcon.classList.contains(I)&&i.i(s.removeClass)([this.previousIcon],[I,D,T])):(this.rightCalNextIcon.classList.contains(I)&&i.i(s.removeClass)([this.rightCalNextIcon],[I,D,T]),this.rightCalPrevIcon.classList.contains(I)&&i.i(s.removeClass)([this.rightCalPrevIcon],[I,D,T]),this.leftCalNextIcon.classList.contains(I)&&i.i(s.removeClass)([this.leftCalNextIcon],[I,D,T]))},t.prototype.updateHeader=function(){var e={type:"date",skeleton:"yMMMd"};if(i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.isNullOrUndefined)(this.startValue))this.popupObj.element.querySelector("."+O).textContent=this.l10n.getConstant("selectedDays");else{var t=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1;i.i(s.isNullOrUndefined)(this.disabledDayCnt)||(t-=this.disabledDayCnt,this.disabledDayCnt=null),this.popupObj.element.querySelector("."+O).textContent=t.toString()+" "+this.l10n.getConstant("days")}this.isMobile?(i.i(s.isNullOrUndefined)(this.startValue)?this.startButton.element.textContent=this.l10n.getConstant("startLabel"):this.startButton.element.textContent=this.globalize.formatDate(this.startValue,e),i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.isNullOrUndefined)(this.startValue)?this.endButton.element.textContent=this.l10n.getConstant("endLabel"):this.endButton.element.textContent=this.globalize.formatDate(this.endValue,e)):(i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.isNullOrUndefined)(this.startValue)?this.popupObj.element.querySelector(".e-end-label").textContent=this.l10n.getConstant("endLabel"):this.popupObj.element.querySelector(".e-end-label").textContent=this.globalize.formatDate(this.endValue,e),i.i(s.isNullOrUndefined)(this.startValue)?this.popupObj.element.querySelector(".e-start-label").textContent=this.l10n.getConstant("startLabel"):this.popupObj.element.querySelector(".e-start-label").textContent=this.globalize.formatDate(this.startValue,e)),(this.isDateDisabled(this.startValue)||this.isDateDisabled(this.endValue)||!i.i(s.isNullOrUndefined)(this.startValue)&&+this.startValue<+this.min||!i.i(s.isNullOrUndefined)(this.endValue)&&+this.endValue>+this.max||!i.i(s.isNullOrUndefined)(this.startValue)&&!i.i(s.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("."+O).textContent=this.l10n.getConstant("selectedDays")):(this.popupObj.element.querySelector("."+O).textContent=this.l10n.getConstant("selectedDays"),this.popupObj.element.querySelector(".e-start-label").textContent=this.l10n.getConstant("startLabel"),this.popupObj.element.querySelector(".e-end-label").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")},t.prototype.removeSelection=function(){this.startValue=null,this.endValue=null,this.setValue(),this.removeSelectedAttributes(),this.popupObj&&(this.popupObj.element.querySelectorAll("."+C).length>0&&i.i(s.removeClass)(this.popupObj.element.querySelectorAll("."+C),[f,v,C]),this.popupObj.element.querySelectorAll("."+V).length>0&&i.i(s.removeClass)(this.popupObj.element.querySelectorAll("."+V),V),this.popupObj.element.querySelectorAll("."+g).length>0&&i.i(s.removeClass)(this.popupObj.element.querySelectorAll("."+g),[g]))},t.prototype.addSelectedAttributes=function(e,t,a,n){if(e){var r=this.globalize.formatDate(t,{type:"date",skeleton:"full"});!i.i(s.isNullOrUndefined)(n)&&n?e.setAttribute("aria-label","The current start and end date is "+r):e.setAttribute("aria-label","The current "+(a?"start":"end")+" date is "+r),e.setAttribute("aria-selected","true")}},t.prototype.removeSelectedAttributes=function(){if(this.popupObj){for(var e=this.popupObj.element.querySelectorAll("."+f),t=0,i=e;t<i.length;t++){var s=i[t];s.setAttribute("aria-selected","false"),s.removeAttribute("aria-label")}for(var a=this.popupObj.element.querySelectorAll("."+v),n=0,r=a;n<r.length;n++){var s=r[n];s.setAttribute("aria-selected","false"),s.removeAttribute("aria-label")}}},t.prototype.updateCalendarElement=function(e){e.classList.contains(d)?(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("."+M),this.tableBodyElement=i.i(s.select)(".e-content tbody",e),this.table=e.querySelector("."+M).getElementsByTagName("table")[0],this.headerTitleElement=e.querySelector(".e-header ."+w),this.headerElement=e.querySelector("."+k)},t.prototype.navPrevMonth=function(e){e.preventDefault();var t=i.i(s.closest)(e.target,"."+d);t=i.i(s.isNullOrUndefined)(t)?i.i(s.closest)(e.target,"."+p):t,this.updateCalendarElement(t),this.navigatePrevious(e),!i.i(s.isNullOrUndefined)(this.startValue)&&i.i(s.isNullOrUndefined)(this.endValue)&&this.updateMinMaxDays(t),this.updateControl(t)},t.prototype.deviceNavigation=function(e){this.deviceCalendarEvent(),this.updateRange([this.popupObj.element.querySelector("."+E)]),this.endButton.element.classList.contains(m)&&this.updateMinMaxDays(this.popupObj.element.querySelector("."+E)),this.endButton.element.classList.contains(m)&&this.selectableDates(),this.currentView()===this.depth&&this.bindCalendarCellEvents(),this.removeFocusedDate()},t.prototype.updateControl=function(e,t){void 0===t&&(t=null),e.classList.contains(p)?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])},t.prototype.navNextMonth=function(e){e.preventDefault();var t=i.i(s.closest)(e.target,"."+d);t=i.i(s.isNullOrUndefined)(t)?i.i(s.closest)(e.target,"."+p):t,this.updateCalendarElement(t),this.navigateNext(e),!i.i(s.isNullOrUndefined)(this.startValue)&&i.i(s.isNullOrUndefined)(this.endValue)&&this.updateMinMaxDays(t),this.updateControl(t)},t.prototype.isPopupOpen=function(){return!(i.i(s.isNullOrUndefined)(this.popupObj)||!this.popupObj.element.classList.contains("e-popup"))},t.prototype.createRangeHeader=function(){var e=this.createElement("div",{className:"e-start-end"});if(this.isMobile){var t=this.createElement("button",{className:"e-end-btn"}),a=this.createElement("button",{className:"e-start-btn"});this.startButton=new r.Button({content:this.l10n.getConstant("startLabel")},a),this.endButton=new r.Button({content:this.l10n.getConstant("endLabel")},t),e.appendChild(a),e.appendChild(t)}else{var n=this.createElement("a",{className:"e-start-label"}),l=this.createElement("a",{className:"e-end-label"}),o=this.createElement("span",{className:"e-change-icon e-icons"});i.i(s.attributes)(n,{"aria-atomic":"true","aria-live":"assertive","aria-label":"Start Date",role:"button"}),i.i(s.attributes)(l,{"aria-atomic":"true","aria-live":"assertive","aria-label":"End Date",role:"button"}),e.appendChild(n),e.appendChild(o),e.appendChild(l),n.textContent=this.l10n.getConstant("startLabel"),l.textContent=this.l10n.getConstant("endLabel")}return e},t.prototype.disableInput=function(){this.strictMode?i.i(s.isNullOrUndefined)(this.previousStartValue)||i.i(s.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),l.Input.setEnabled(this.enabled,this.inputElement),this.bindEvents()},t.prototype.validateMinMax=function(){if(this.min=i.i(s.isNullOrUndefined)(this.min)||!+this.min?this.min=new Date(1900,0,1):this.min,this.max=i.i(s.isNullOrUndefined)(this.max)||!+this.max?this.max=new Date(2099,11,31):this.max,!(this.min<=this.max))return void this.disableInput();i.i(s.isNullOrUndefined)(this.minDays)||i.i(s.isNullOrUndefined)(this.maxDays)||this.maxDays>0&&this.minDays>0&&this.minDays>this.maxDays&&(this.maxDays=null),!i.i(s.isNullOrUndefined)(this.minDays)&&this.minDays<0&&(this.minDays=null),!i.i(s.isNullOrUndefined)(this.maxDays)&&this.maxDays<0&&(this.maxDays=null)},t.prototype.validateRangeStrict=function(){i.i(s.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)),i.i(s.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()},t.prototype.validateRange=function(){this.validateMinMaxDays()},t.prototype.validateMinMaxDays=function(){if(!i.i(s.isNullOrUndefined)(this.startValue)&&!i.i(s.isNullOrUndefined)(this.endValue)){var e=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1;if(!i.i(s.isNullOrUndefined)(this.minDays)&&this.minDays>0&&!(e>=this.minDays))if(this.strictMode){var t=new Date(+this.startValue);t.setDate(t.getDate()+(this.minDays-1)),+t>+this.max?(this.endValue=this.max,this.setValue()):(this.endValue=t,this.setValue())}else this.startValue=null,this.endValue=null,this.setValue();i.i(s.isNullOrUndefined)(this.maxDays)||!(this.maxDays>0)||e<=this.maxDays||(this.strictMode?(this.endValue=new Date(+this.startValue),this.endValue.setDate(this.endValue.getDate()+(this.maxDays-1)),this.setValue()):(this.startValue=null,this.endValue=null,this.setValue()))}},t.prototype.renderCalendar=function(){this.calendarElement=this.createElement("div"),this.calendarElement.classList.add(E),this.enableRtl&&this.calendarElement.classList.add("e-rtl"),i.i(s.attributes)(this.calendarElement,{"data-role":"calendar"}),e.prototype.createHeader.call(this),e.prototype.createContent.call(this)},t.prototype.isSameMonth=function(e,t){return e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()},t.prototype.isSameYear=function(e,t){return e.getFullYear()===t.getFullYear()},t.prototype.isSameDecade=function(e,t){var i=e.getFullYear(),s=t.getFullYear();return i-i%10==s-s%10},t.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)))},t.prototype.selectNextMonth=function(){if(i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.isNullOrUndefined)(this.startValue)||this.isSameMonth(this.endValue,this.currentDate)||this.isDateDisabled(this.endValue)||this.isDateDisabled(this.startValue))return this.currentDate.setDate(1),void this.currentDate.setMonth(this.currentDate.getMonth()+1);if(this.currentDate=new Date(+this.endValue),!i.i(s.isNullOrUndefined)(this.startValue)&&+this.startValue<+this.min||!i.i(s.isNullOrUndefined)(this.endValue)&&+this.endValue>+this.max||!i.i(s.isNullOrUndefined)(this.startValue)&&!i.i(s.isNullOrUndefined)(this.endValue)&&+this.startValue>+this.endValue){this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.currentDate.setDate(1);var e=this.currentDate.getMonth()+1;this.currentDate.setMonth(e)}},t.prototype.selectNextYear=function(){if(i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.isNullOrUndefined)(this.startValue)||this.isSameYear(this.endValue,this.currentDate)||this.isDateDisabled(this.endValue)||this.isDateDisabled(this.startValue)){this.currentDate.setMonth(0);var e=this.currentDate.getFullYear()+1;return void this.currentDate.setFullYear(e)}this.currentDate=new Date(+this.endValue),(!i.i(s.isNullOrUndefined)(this.endValue)&&+this.endValue>+this.max||!i.i(s.isNullOrUndefined)(this.startValue)&&!i.i(s.isNullOrUndefined)(this.endValue)&&+this.startValue>+this.endValue||!i.i(s.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))},t.prototype.selectNextDecade=function(){if(i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.isNullOrUndefined)(this.startValue)||this.isSameDecade(this.endValue,this.currentDate)||this.isDateDisabled(this.endValue)||this.isDateDisabled(this.startValue)){var e=this.currentDate.getFullYear()+10;return void this.currentDate.setFullYear(e)}this.currentDate=new Date(+this.endValue),(!i.i(s.isNullOrUndefined)(this.startValue)&&!i.i(s.isNullOrUndefined)(this.endValue)&&+this.startValue>+this.endValue||!i.i(s.isNullOrUndefined)(this.endValue)&&+this.endValue>+this.max||!i.i(s.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))},t.prototype.selectStartMonth=function(){i.i(s.isNullOrUndefined)(this.startValue)?(this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.startMonthCurrentDate()):!i.i(s.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)),(!i.i(s.isNullOrUndefined)(this.endValue)&&+this.endValue>+this.max||!i.i(s.isNullOrUndefined)(this.startValue)&&+this.startValue<+this.min||!i.i(s.isNullOrUndefined)(this.startValue)&&!i.i(s.isNullOrUndefined)(this.endValue)&&+this.startValue>+this.endValue)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0))),this.startMonthCurrentDate()},t.prototype.createCalendar=function(){var t=this.createElement("div",{className:"e-calendar-container"});if(this.isMobile){i.i(s.isNullOrUndefined)(this.startValue)||(this.currentDate=new Date(+this.startValue)),e.prototype.validateDate.call(this),e.prototype.minMaxUpdate.call(this),e.prototype.render.call(this);var a=this.calendarElement.querySelector(".e-calendar .e-prev"),n=this.calendarElement.querySelector(".e-calendar .e-next");i.i(s.remove)(this.calendarElement.querySelector(".e-calendar .e-icon-container")),this.calendarElement.querySelector(".e-calendar ."+k).appendChild(n),this.calendarElement.querySelector(".e-calendar ."+k).appendChild(a),i.i(s.prepend)([a],this.calendarElement.querySelector(".e-calendar ."+k)),this.deviceCalendar=this.calendarElement,t.appendChild(this.calendarElement),this.headerTitleElement=this.calendarElement.querySelector(".e-calendar .e-header ."+w)}else{this.selectStartMonth(),this.renderCalendar(),this.leftCalCurrentDate=new Date(+this.currentDate),this.calendarElement.classList.add(d),this.leftCalPrevIcon=this.calendarElement.querySelector(".e-left-calendar .e-prev"),this.leftCalNextIcon=this.calendarElement.querySelector(".e-left-calendar .e-next"),this.leftTitle=this.calendarElement.querySelector(".e-left-calendar ."+w),i.i(s.remove)(this.calendarElement.querySelector(".e-left-calendar .e-icon-container")),this.calendarElement.querySelector(".e-left-calendar ."+k).appendChild(this.leftCalNextIcon),this.calendarElement.querySelector(".e-left-calendar ."+k).appendChild(this.leftCalPrevIcon),i.i(s.prepend)([this.leftCalPrevIcon],this.calendarElement.querySelector(".e-left-calendar ."+k)),this.leftCalendar=this.calendarElement;var r=this.createElement("div",{className:"e-left-container"}),l=this.createElement("div",{className:"e-right-container"});r.appendChild(this.leftCalendar),t.appendChild(r),this.isMobile||s.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),i.i(s.addClass)([this.calendarElement],p),this.rightCalendar=this.calendarElement,i.i(s.removeClass)([this.leftCalendar&&this.leftCalendar.querySelector(".e-content tbody")],"e-zoomin"),i.i(s.removeClass)([this.rightCalendar&&this.rightCalendar.querySelector(".e-content tbody")],"e-zoomin"),this.rightCalPrevIcon=this.calendarElement.querySelector(".e-right-calendar .e-prev"),this.rightCalNextIcon=this.calendarElement.querySelector(".e-right-calendar .e-next"),this.rightTitle=this.calendarElement.querySelector(".e-right-calendar ."+w),i.i(s.remove)(this.calendarElement.querySelector(".e-right-calendar .e-icon-container")),this.calendarElement.querySelector("table").setAttribute("tabindex","0"),this.calendarElement.querySelector(".e-right-calendar ."+k).appendChild(this.rightCalNextIcon),this.calendarElement.querySelector(".e-right-calendar ."+k).appendChild(this.rightCalPrevIcon),i.i(s.prepend)([this.rightCalPrevIcon],this.calendarElement.querySelector(".e-right-calendar ."+k)),l.appendChild(this.rightCalendar),t.appendChild(l),this.isMobile||s.EventHandler.add(this.rightTitle,"click",this.rightNavTitle,this)}return t},t.prototype.leftNavTitle=function(e){this.isPopupOpen()&&(this.calendarElement=this.leftCalendar,this.calendarNavigation(e,this.calendarElement))},t.prototype.calendarNavigation=function(t,i){this.table=i.querySelector("table"),this.headerTitleElement=i.querySelector(".e-title"),this.tableBodyElement=i.querySelector("tbody"),this.tableHeadElement=i.querySelector("thead"),this.contentElement=i.querySelector(".e-content"),this.updateCalendarElement(i),e.prototype.navigateTitle.call(this,t),this.updateNavIcons()},t.prototype.rightNavTitle=function(e){this.isPopupOpen()&&(this.calendarElement=this.rightCalendar,this.calendarNavigation(e,this.calendarElement))},t.prototype.clickEventEmitter=function(e){this.isMobile||(i.i(s.closest)(e.target,".e-calendar.e-left-calendar")?(this.calendarElement=this.leftCalendar,this.updateCalendarElement(this.leftCalendar)):(this.calendarElement=this.rightCalendar,this.updateCalendarElement(this.rightCalendar)))},t.prototype.currentView=function(){return e.prototype.currentView.call(this)},t.prototype.getCalendarView=function(e){return"Year"===e?"Year":"Decade"===e?"Decade":"Month"},t.prototype.navigatedEvent=function(t){if(this.trigger("navigated",this.navigatedArgs),!i.i(s.isNullOrUndefined)(this.popupObj)){var a=this.getCalendarView(this.currentView());if(this.isMobile)a===this.depth?(this.bindCalendarCellEvents(),this.deviceNavigation(),this.removeFocusedDate(),this.checkMinMaxDays()):this.selectableDates();else if(this.isMobile||a!==this.depth)this.updateNavIcons(),this.calendarIconEvent();else{if((this.calendarElement.classList.contains("e-left-calendar")?this.leftCalendar:this.rightCalendar)!==this.leftCalendar||(!t||t.currentTarget.children[0].classList.contains("e-icons"))&&i.i(s.isNullOrUndefined)(this.controlDown))(t&&!t.currentTarget.children[0].classList.contains("e-icons")||!i.i(s.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&&i.i(s.isNullOrUndefined)(this.endValue)?"Month"===a&&this.startValue.getMonth()<this.rightCalCurrentDate.getMonth()&&this.startValue.getFullYear()<=this.rightCalCurrentDate.getFullYear()?e.prototype.navigateTo.call(this,a,new Date(+this.startValue)):"Year"===a&&this.startValue.getFullYear()<this.rightCalCurrentDate.getFullYear()?e.prototype.navigateTo.call(this,a,new Date(+this.startValue)):e.prototype.navigateTo.call(this,a,this.leftCalCurrentDate):e.prototype.navigateTo.call(this,a,this.leftCalCurrentDate),this.updateControl(this.leftCalendar),this.updateNavIcons(),this.calendarIconEvent(),this.calendarIconRipple(),this.controlDown=null);else{this.leftCalCurrentDate=new Date(+this.currentDate),this.effect="",this.currentDate=this.leftCalCurrentDate,this.updateCalendarElement(this.leftCalendar),this.updateControl(this.leftCalendar),this.updateCalendarElement(this.rightCalendar),e.prototype.navigateTo.call(this,a,this.rightCalCurrentDate);var n=this.rightCalCurrentDate?this.rightCalCurrentDate:this.currentDate;this.updateControl(this.rightCalendar,n),this.updateNavIcons(),this.calendarIconEvent(),this.calendarIconRipple(),this.controlDown=null}this.checkMinMaxDays()}}},t.prototype.createControl=function(){var e=this.createElement("div",{className:"e-date-range-container"}),t=this.createElement("div",{className:"e-range-header"});if(this.isMobile&&this.fullScreenMode){var a=this.createElement("div",{className:"e-model-header-wrapper"}),n=this.createElement("span",{className:"e-popup-close"});s.EventHandler.add(n,"mousedown touchstart",this.modelRangeCloseHandler,this);var l=this.createElement("span",{className:"e-apply"});s.EventHandler.add(l,"mousedown touchstart",this.applyFunction,this),a.appendChild(n),a.appendChild(l),t.appendChild(a)}var o=this.createRangeHeader();t.appendChild(o);var h=this.createElement("div",{className:O});i.i(s.attributes)(h,{"aria-label":"Selected Days"}),h.textContent=this.l10n.getConstant("selectedDays"),t.appendChild(h);var u=this.createElement("div",{className:"e-separator"}),d=this.createCalendar();e.appendChild(t),e.appendChild(u),e.appendChild(d);var p=this.createElement("div",{className:"e-footer"}),c=this.createElement("button",{className:"e-cancel e-flat e-css"}),m=this.createElement("button");i.i(s.addClass)([m],["e-apply","e-flat","e-primary","e-css"]),p.appendChild(m),p.appendChild(c);var f=!i.i(s.isNullOrUndefined)(this.startValue)&&!i.i(s.isNullOrUndefined)(this.endValue);if(this.cancelButton=new r.Button({content:this.l10n.getConstant("cancelText")},c),this.applyButton=new r.Button({content:this.l10n.getConstant("applyText"),disabled:!f},m),s.EventHandler.add(m,"click",this.applyFunction,this),s.EventHandler.add(c,"click",this.cancelFunction,this),this.popupWrapper.appendChild(e),!this.isMobile&&!i.i(s.isUndefined)(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)){this.createPresets(),this.listRippleEffect(),i.i(s.addClass)([e],"e-range-border"),i.i(s.addClass)([this.popupWrapper],"e-preset-wrapper");this.popupWrapper.querySelector(".e-presets").style.height=this.popupWrapper.querySelector(".e-date-range-container").getBoundingClientRect().height+"px"}this.popupWrapper.appendChild(p),this.isMobile&&this.deviceHeaderUpdate(),this.renderPopup()},t.prototype.modelRangeCloseHandler=function(e){this.hide()},t.prototype.cancelFunction=function(e){document.activeElement!==this.inputElement&&(this.preventFocus=!0,this.inputElement.focus(),i.i(s.addClass)([this.inputWrapper.container],[y])),e.preventDefault(),this.isKeyPopup&&(this.inputElement.focus(),this.isKeyPopup=!1),this.startValue=null,this.endValue=null,this.removeSelection(),this.hide(e)},t.prototype.deviceHeaderUpdate=function(){i.i(s.isNullOrUndefined)(this.startValue)&&i.i(s.isNullOrUndefined)(this.endValue)?(this.endButton.element.setAttribute("disabled",""),this.startButton.element.classList.add(m)):i.i(s.isNullOrUndefined)(this.startValue)||this.startButton.element.classList.add(m)},t.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(),i.i(s.addClass)([this.inputWrapper.container],[y])),"touchstart"!==e.type&&this.closeEventArgs&&!this.closeEventArgs.cancel&&e.preventDefault(),i.i(s.isNullOrUndefined)(this.startValue)||i.i(s.isNullOrUndefined)(this.endValue)?this.hide(e||null):(this.previousStartValue=new Date(+this.startValue),this.previousEndValue=new Date(+this.endValue),this.previousEleValue=this.inputElement.value,l.Input.setValue(this.rangeArgs(e).text,this.inputElement,this.floatLabelType,this.showClearButton),+this.initStartDate==+this.startValue&&+this.initEndDate==+this.endValue||(t=!0),this.changeTrigger(e),this.hide(e||null),this.errorClass(),t=!0),i.i(s.closest)(e.target,".e-input-group")||t||this.focusOut(),this.isMobile||(this.isKeyPopup=!1,this.isRangeIconClicked&&(this.inputWrapper.container.children[1].focus(),this.keyInputConfigs=i.i(s.extend)(this.keyInputConfigs,this.keyConfigs),this.popupKeyboardModule=new s.KeyboardEvents(this.inputWrapper.container.children[1],{eventName:"keydown",keyConfigs:this.keyInputConfigs,keyAction:this.popupKeyActionHandle.bind(this)})))},t.prototype.onMouseClick=function(e,t){if("touchstart"!==e.type){var a=t||e.target,n=i.i(s.closest)(a,"."+x),r=n&&n.classList.contains(m);n&&n.classList.contains(x)&&this.setListSelection(n,e),this.preventFocus=!0,this.inputElement.focus(),this.isMobile||(this.preventFocus=!0,n&&n.classList.contains(x)&&"custom_range"===n.getAttribute("id")?this.leftCalendar.children[1].firstElementChild.focus():r||"keydown"!==e.type||this.inputElement.focus())}},t.prototype.onMouseOver=function(e){var t=i.i(s.closest)(e.target,"."+x);t&&t.classList.contains(x)&&!t.classList.contains(S)&&i.i(s.addClass)([t],S)},t.prototype.onMouseLeave=function(e){var t=i.i(s.closest)(e.target,"."+S);i.i(s.isNullOrUndefined)(t)||i.i(s.removeClass)([t],S)},t.prototype.setListSelection=function(e,t){if(e&&(!e.classList.contains(m)||this.isMobile&&e.classList.contains(m))){if(this.isMobile&&e.classList.contains(m)){this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(e);if("custom_range"===this.presetsItem[this.activeIndex].id)return void this.renderCustomPopup();return}this.removeListSelection(),this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(e),i.i(s.addClass)([e],m),e.setAttribute("aria-selected","true");var a=this.presetsItem[this.activeIndex];"custom_range"===a.id?this.renderCustomPopup():this.applyPresetRange(a,t)}},t.prototype.removeListSelection=function(){var e=this.presetElement.querySelector("."+m);i.i(s.isNullOrUndefined)(e)||(i.i(s.removeClass)([e],m),e.removeAttribute("aria-selected"))},t.prototype.setValue=function(){this.modelValue=[this.startValue,this.endValue]},t.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())},t.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()},t.prototype.renderCustomPopup=function(){this.isCustomWindow=!0,this.popupObj.hide(),this.popupWrapper=this.createElement("div",{id:this.element.id+"_popup",className:c+" e-popup"}),this.renderControl(),this.openEventArgs.appendTo.appendChild(this.popupWrapper),this.showPopup(),this.isCustomRange=!0,this.isMobile||this.calendarFocus()},t.prototype.listRippleEffect=function(){for(var e=0,t=this.liCollections;e<t.length;e++){var a=t[e];i.i(s.rippleEffect)(a)}},t.prototype.createPresets=function(){if(!i.i(s.isUndefined)(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)){this.presetElement=this.createElement("div",{className:"e-presets",attrs:{tabindex:"0"}});var e=o.ListBase.createList(this.createElement,this.presetsItem,null,!0);i.i(s.attributes)(e,{role:"listbox","aria-hidden":"false",id:this.element.id+"_options",tabindex:"0"}),this.presetElement.appendChild(e),this.popupWrapper.appendChild(this.presetElement);var t=this.presetElement.querySelector("#custom_range");if(i.i(s.isNullOrUndefined)(t)||(t.textContent=""!==this.l10n.getConstant("customRange")?this.l10n.getConstant("customRange"):"Custom Range"),this.liCollections=this.presetElement.querySelectorAll("."+x),this.wireListEvents(),this.isMobile)if(this.fullScreenMode){var a=i.i(s.createElement)("div",{className:"e-range-mob-popup-wrap"}),n=this.createElement("div",{className:"e-model-header"}),r=this.createElement("span",{className:"e-model-title"});r.textContent="Select Preset";var l=this.createElement("span",{className:"e-popup-close"});s.EventHandler.add(l,"mousedown touchstart",this.modelRangeCloseHandler,this);var h=this.presetElement;n.appendChild(l),n.appendChild(r),a.appendChild(n),a.appendChild(h),this.popupWrapper.insertBefore(a,this.popupWrapper.firstElementChild),this.presetElement.style.width="100%"}else this.presetElement.style.width=this.inputWrapper.container.getBoundingClientRect().width+"px";!i.i(s.isNullOrUndefined)(this.activeIndex)&&this.activeIndex>-1&&i.i(s.addClass)([this.liCollections[this.activeIndex]],m)}},t.prototype.wireListEvents=function(){s.EventHandler.add(this.presetElement,"click",this.onMouseClick,this),this.isMobile||(s.EventHandler.add(this.presetElement,"mouseover",this.onMouseOver,this),s.EventHandler.add(this.presetElement,"mouseout",this.onMouseLeave,this))},t.prototype.unWireListEvents=function(){i.i(s.isNullOrUndefined)(this.presetElement)||(s.EventHandler.remove(this.presetElement,"click touchstart",this.onMouseClick),this.isMobile||(s.EventHandler.remove(this.presetElement,"mouseover",this.onMouseOver),s.EventHandler.remove(this.presetElement,"mouseout",this.onMouseLeave)))},t.prototype.renderPopup=function(){var e=this;this.popupWrapper.classList.add("e-control");var t=this.popupWrapper.getBoundingClientRect().width;i.i(s.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 n.Popup(this.popupWrapper,{relateTo:this.isMobile&&this.isCustomWindow?document.body:i.i(s.isNullOrUndefined)(this.targetElement)?this.inputWrapper.container:this.targetElement,position:this.isMobile?i.i(s.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:-t,offsetY:4,collision:this.isMobile?i.i(s.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(){e.isMobile&&e.fullScreenMode&&(e.iconRangeRight=e.calendarElement&&window.getComputedStyle(e.calendarElement.querySelector(".e-header.e-month .e-prev")).cssFloat,e.iconRangeRight&&(e.touchRangeModule=new s.Touch(e.calendarElement.querySelector(".e-content.e-month"),{swipe:e.dateRangeSwipeHandler.bind(e)}),s.EventHandler.add(e.calendarElement.querySelector(".e-content.e-month"),"touchstart",e.touchStartRangeHandler,e))),i.i(s.attributes)(e.inputElement,{"aria-expanded":"true","aria-owns":e.inputElement.id+"_options"}),e.value?i.i(s.attributes)(e.inputElement,{"aria-activedescendant":e.inputElement.id}):e.inputElement.removeAttribute("aria-activedescendant"),i.i(s.addClass)([e.inputWrapper.buttons[0]],m),e.isMobile||(e.cancelButton&&(e.btnKeyboardModule=new s.KeyboardEvents(e.cancelButton.element,{eventName:"keydown",keyAction:e.popupKeyActionHandle.bind(e),keyConfigs:{tab:"tab",altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}}),e.btnKeyboardModule=new s.KeyboardEvents(e.applyButton.element,{eventName:"keydown",keyAction:e.popupKeyActionHandle.bind(e),keyConfigs:{altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}})),i.i(s.isNullOrUndefined)(e.leftCalendar)||e.isRangeIconClicked||e.calendarFocus(),i.i(s.isNullOrUndefined)(e.presetElement)||(e.keyInputConfigs=i.i(s.extend)(e.keyInputConfigs,e.keyConfigs),e.presetKeyboardModule=new s.KeyboardEvents(e.presetElement,{eventName:"keydown",keyAction:e.presetKeyActionHandler.bind(e),keyConfigs:e.keyInputConfigs}),e.presetKeyboardModule=new s.KeyboardEvents(e.presetElement,{eventName:"keydown",keyAction:e.popupKeyActionHandle.bind(e),keyConfigs:{altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}}),i.i(s.isNullOrUndefined)(e.leftCalendar)?(e.preventBlur=!0,e.presetElement.focus()):e.presetElement.setAttribute("tabindex","-1")),e.popupKeyBoardHandler()),e.isMobile&&!s.Browser.isDevice&&s.EventHandler.add(document,"keydown",e.popupCloseHandler,e)},close:function(){i.i(s.attributes)(e.inputElement,{"aria-expanded":"false"}),e.inputElement.removeAttribute("aria-owns"),e.inputElement.removeAttribute("aria-activedescendant"),i.i(s.removeClass)([e.inputWrapper.buttons[0]],m),e.isRangeIconClicked&&e.inputWrapper.container.children[1].focus(),i.i(s.isUndefined)(e.presets[0].start&&e.presets[0].end&&e.presets[0].label)||e.unWireListEvents(),i.i(s.isNullOrUndefined)(e.popupObj)||(i.i(s.isNullOrUndefined)(e.popupObj.element.parentElement)||i.i(s.detach)(e.popupObj.element),e.popupObj.destroy(),e.popupObj=null),e.isMobile&&!s.Browser.isDevice&&s.EventHandler.remove(document,"keydown",e.popupCloseHandler)},targetExitViewport:function(){s.Browser.isDevice||e.hide()}}),this.isMobile&&(this.popupObj.element.classList.add("e-device"),this.isMobile||this.popupObj.element.classList.add("e-bigger")),this.isMobile&&this.isCustomWindow&&(i.i(s.addClass)([this.modal],["e-device",c,"e-range-modal"]),document.body.className+=" e-range-overflow",this.modal.style.display="block"),s.EventHandler.add(document,"mousedown touchstart",this.documentHandler,this)},t.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)},t.prototype.touchStartRangeHandler=function(e){this.touchRangeStart=!0},t.prototype.popupCloseHandler=function(e){switch(e.keyCode){case 27:this.hide(e)}},t.prototype.calendarFocus=function(){var e=this.popupObj&&this.popupObj.element.querySelector("."+f);if(e){var t=i.i(s.closest)(e,"."+p);t=i.i(s.isNullOrUndefined)(t)?this.leftCalendar:t,this.isRangeIconClicked?this.inputWrapper.container.focus():(this.preventBlur=!0,t.children[1].firstElementChild.focus()),i.i(s.addClass)([e],V)}else this.isRangeIconClicked?this.inputWrapper.container.focus():(this.preventBlur=!0,this.leftCalendar.children[1].firstElementChild.focus())},t.prototype.presetHeight=function(){var e=this.popupObj&&this.popupObj.element.querySelector(".e-presets"),t=this.popupObj&&this.popupObj.element.querySelector(".e-date-range-container");i.i(s.isNullOrUndefined)(e)||i.i(s.isNullOrUndefined)(t)||(e.style.height=t.getBoundingClientRect().height+"px")},t.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(),a=this.getActiveLI();if(!i.i(s.isNullOrUndefined)(this.leftCalendar)&&!i.i(s.isNullOrUndefined)(a)&&(i.i(s.isNullOrUndefined)(t)||!i.i(s.isNullOrUndefined)(a)&&a===t)){this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(a);if("custom_range"===this.presetsItem[this.activeIndex].id)return this.calendarFocus(),a.classList.remove(S),void e.preventDefault()}i.i(s.isNullOrUndefined)(t)&&i.i(s.isNullOrUndefined)(a)||this.onMouseClick(e,t||a),e.preventDefault();break;case"tab":if(this.leftCalendar){var n=this.getHoverLI();i.i(s.isNullOrUndefined)(n)||n.classList.remove(S)}else this.hide(e),e.preventDefault()}},t.prototype.listMoveDown=function(e){var t=this.getHoverLI(),a=this.getActiveLI();if(i.i(s.isNullOrUndefined)(t))if(i.i(s.isNullOrUndefined)(a))i.i(s.addClass)([this.liCollections[0]],S);else{var n=a.nextElementSibling;!i.i(s.isNullOrUndefined)(n)&&n.classList.contains(x)&&i.i(s.addClass)([n],S)}else{var n=t.nextElementSibling;!i.i(s.isNullOrUndefined)(n)&&n.classList.contains(x)&&(i.i(s.removeClass)([t],S),i.i(s.addClass)([n],S))}},t.prototype.listMoveUp=function(e){var t=this.getHoverLI(),a=this.getActiveLI();if(i.i(s.isNullOrUndefined)(t)){if(!i.i(s.isNullOrUndefined)(a)){var n=a.previousElementSibling;!i.i(s.isNullOrUndefined)(n)&&n.classList.contains(x)&&i.i(s.addClass)([n],S)}}else{var n=t.previousElementSibling;!i.i(s.isNullOrUndefined)(n)&&n.classList.contains(x)&&(i.i(s.removeClass)([t],S),i.i(s.addClass)([n],S))}},t.prototype.getHoverLI=function(){return this.presetElement.querySelector("."+S)},t.prototype.getActiveLI=function(){return this.presetElement.querySelector("."+m)},t.prototype.popupKeyBoardHandler=function(){this.popupKeyboardModule=new s.KeyboardEvents(this.popupWrapper,{eventName:"keydown",keyAction:this.popupKeyActionHandle.bind(this),keyConfigs:{escape:"escape"}}),this.keyInputConfigs=i.i(s.extend)(this.keyInputConfigs,this.keyConfigs),this.popupKeyboardModule=new s.KeyboardEvents(this.inputWrapper.container.children[1],{eventName:"keydown",keyAction:this.popupKeyActionHandle.bind(this),keyConfigs:this.keyInputConfigs})},t.prototype.setScrollPosition=function(){var e=this.presetElement.getBoundingClientRect().height,t=this.presetElement.querySelector("."+S),a=this.presetElement.querySelector("."+m),n=i.i(s.isNullOrUndefined)(t)?a:t;if(!i.i(s.isNullOrUndefined)(n)){var r=n.nextElementSibling,l=r?r.offsetTop:n.offsetTop,o=n.getBoundingClientRect().height;l+n.offsetTop>e?this.presetElement.scrollTop=r?l-(e/2+o/2):l:this.presetElement.scrollTop=0}},t.prototype.popupKeyActionHandle=function(e){var t=i.i(s.closest)(e.target,".e-presets");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":i.i(s.isNullOrUndefined)(t)?document.activeElement===this.cancelButton.element&&!0!==this.applyButton.element.disabled?this.applyButton.element.focus():this.leftCalendar.children[1].firstElementChild.focus():this.cancelButton.element.focus(),e.preventDefault();break;case"altLeftArrow":i.i(s.isNullOrUndefined)(t)?document.activeElement===this.applyButton.element&&!0!==this.applyButton.element.disabled?this.cancelButton.element.focus():i.i(s.isNullOrUndefined)(this.presetElement)||document.activeElement!==this.cancelButton.element?this.rightCalendar.children[1].firstElementChild.focus():this.presetElement.focus():this.rightCalendar.children[1].firstElementChild.focus(),e.preventDefault()}},t.prototype.documentHandler=function(e){if(!i.i(s.isNullOrUndefined)(this.popupObj)){var t=e.target;this.inputWrapper.container.contains(t)&&(i.i(s.isNullOrUndefined)(this.popupObj)||i.i(s.closest)(t,'[id="'+this.popupWrapper.id+'"]')||"mousedown"===e.type)||"touchstart"!==e.type&&("mousedown"===e.type||this.closeEventArgs&&!this.closeEventArgs.cancel)&&e.preventDefault(),!i.i(s.isNullOrUndefined)(this.targetElement)&&(i.i(s.isNullOrUndefined)(this.targetElement)||t===this.targetElement)||i.i(s.closest)(t,'[id="'+this.popupWrapper.id+'"]')||i.i(s.closest)(t,".e-input-group")===this.inputWrapper.container||i.i(s.closest)(t,".e-daterangepicker.e-popup")&&!t.classList.contains("e-day")||(this.preventBlur=!1,this.isPopupOpen()&&document.body.contains(this.popupObj.element)&&(this.applyFunction(e),this.isMobile||(this.isRangeIconClicked=!1)))}},t.prototype.createInput=function(){this.fullScreenMode&&this.isMobile&&(this.cssClass+=" e-popup-expand");var e=this.cssClass;i.i(s.isNullOrUndefined)(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),this.inputWrapper=l.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),i.i(s.attributes)(this.inputElement,{tabindex:"0","aria-expanded":"false",role:"combobox",autocomplete:"off","aria-disabled":this.enabled?"false":"true",autocorrect:"off",autocapitalize:"off",spellcheck:"false"}),l.Input.addAttributes({"aria-label":"select"},this.inputWrapper.buttons[0]),i.i(s.isNullOrUndefined)(this.placeholder)||""===this.placeholder.trim()||l.Input.addAttributes({"aria-placeholder":this.placeholder},this.inputElement),this.setEleWidth(this.width),i.i(s.addClass)([this.inputWrapper.container],"e-date-range-wrapper"),i.i(s.isNullOrUndefined)(this.inputElement.getAttribute("name"))&&i.i(s.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},t.prototype.setEleWidth=function(e){this.inputWrapper.container.style.width="string"==typeof e?this.width:"number"==typeof e?i.i(s.formatUnit)(this.width):"100%"},t.prototype.adjustLongHeaderWidth=function(){"Wide"===this.dayHeaderFormat&&i.i(s.addClass)([this.popupWrapper],"e-daterange-day-header-lg")},t.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(),i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.isNullOrUndefined)(this.startValue)||e||i.i(s.isNullOrUndefined)(this.renderDayCellArgs)||!this.renderDayCellArgs.isDisabled||this.disabledDateRender(),this.errorClass(),this.previousStartValue=i.i(s.isNullOrUndefined)(this.startValue)||isNaN(+this.startValue)?null:new Date(+this.startValue),this.previousEndValue=i.i(s.isNullOrUndefined)(this.endValue)||isNaN(+this.endValue)?null:new Date(+this.endValue)},t.prototype.updateInput=function(){if(!i.i(s.isNullOrUndefined)(this.endValue)&&!i.i(s.isNullOrUndefined)(this.startValue)){var e={format:this.formatString,type:"date",skeleton:"yMd"},t=this.globalize.formatDate(this.startValue,e),a=this.globalize.formatDate(this.endValue,e);l.Input.setValue(t+" "+this.separator+" "+a,this.inputElement,this.floatLabelType,this.showClearButton),this.previousStartValue=new Date(+this.startValue),this.previousEndValue=new Date(+this.endValue)}!this.strictMode&&i.i(s.isNullOrUndefined)(this.value)&&this.invalidValueString&&l.Input.setValue(this.invalidValueString,this.inputElement,this.floatLabelType,this.showClearButton)},t.prototype.checkInvalidRange=function(e){if(!i.i(s.isNullOrUndefined)(e)){var t=!1,a=void 0,n=void 0,r=null,l=null,o=null,h=!1,u=!1,d=!1;if("string"==typeof e){var p=e.split(" "+this.separator+" ");2===p.length?(r=p[0],l=p[1]):(t=!0,o=e)}else e.length>0?(a=e[0],n=e[1]):(a=e.start,n=e.end),a instanceof Date||"object"==typeof a?a instanceof Date?h=!0:i.i(s.isNullOrUndefined)(a)||(d=!0):r=this.getstringvalue(a),n instanceof Date||"object"==typeof n?n instanceof Date?u=!0:i.i(s.isNullOrUndefined)(n)||(d=!0):l=this.getstringvalue(n);(i.i(s.isNullOrUndefined)(r)&&!h&&!i.i(s.isNullOrUndefined)(l)||!i.i(s.isNullOrUndefined)(r)&&!u&&i.i(s.isNullOrUndefined)(l))&&(t=!0),d&&(r=l=o=null,t=!0),r&&(t=t||this.checkInvalidValue(r)),l&&(t=t||this.checkInvalidValue(l)),t&&(h&&!d&&(r=a.toLocaleDateString()),u&&!d&&(l=n.toLocaleDateString()),i.i(s.isNullOrUndefined)(r)||i.i(s.isNullOrUndefined)(l)?i.i(s.isNullOrUndefined)(r)?i.i(s.isNullOrUndefined)(l)||(o=l):o=r:o=r+" "+this.separator+" "+l,this.invalidValueString=o,this.setProperties({value:null},!0),this.setProperties({startValue:null},!0),this.setProperties({endValue:null},!0),this.startDate=null,this.endDate=null)}},t.prototype.getstringvalue=function(e){var t=null;return i.i(s.isNullOrUndefined)(e)||"number"!=typeof e?i.i(s.isNullOrUndefined)(e)||"string"!=typeof e||(t=""+e):t=e.toString(),t},t.prototype.checkInvalidValue=function(e){var t=e,i=!1,a=null;if(a={format:this.formatString,type:"date",skeleton:"yMd"},"string"!=typeof t)i=!0;else{var n=new s.Internationalization(this.locale);if(!this.checkDateValue(n.parseDate(t,a))){var r=null,l=null;r=/^\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)?)?/,l=/^\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)?)?/,(!r.test(t)&&!l.test(t)||/^[a-zA-Z0-9- ]*$/.test(t)||isNaN(+new Date(this.checkValue(t))))&&(i=!0)}}return i},t.prototype.isDateDisabled=function(e){if(i.i(s.isNullOrUndefined)(e))return!1;var t=new Date(+e);if(+t<+this.min||+t>+this.max)return!0;this.virtualRenderCellArgs={date:t,isDisabled:!1};var a=this.virtualRenderCellArgs;return this.virtualRenderCellEvent(a),!!a.isDisabled},t.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},t.prototype.virtualRenderCellEvent=function(e){i.i(s.extend)(this.virtualRenderCellArgs,{name:"renderDayCell"}),this.trigger("renderDayCell",e)},t.prototype.disabledDates=function(){var e=!1,t=!1;return i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.isNullOrUndefined)(this.startValue)||(e=this.isDateDisabled(this.startValue),t=this.isDateDisabled(this.endValue),this.isPopupOpen()||(this.currentDate=null),this.setValue()),e||t},t.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&&this.value.length>0||this.valueType&&this.valueType.length>0?(+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()},t.prototype.dispatchEvent=function(e,t){var i=document.createEvent("HTMLEvents");i.initEvent(t,!1,!0),e.dispatchEvent(i),this.firstHiddenChild.dispatchEvent(i)},t.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)},t.prototype.navigateTo=function(t,i){if(this.isPopupOpen()){if("month"===t.toLowerCase())t="Month";else if("year"===t.toLowerCase())t="Year";else{if("decade"!==t.toLowerCase())return;t="Decade"}this.getViewNumber(t)<this.getViewNumber(this.depth)&&(t=this.depth),this.isMobile?e.prototype.navigateTo.call(this,t,i):(i<this.min?i=new Date(+this.min):i>=this.max&&(i=new Date(+this.max)),"Month"===t&&this.isSameMonth(i,this.max)?i=new Date(this.max.getFullYear(),this.max.getMonth()-1,this.min.getDate()):"Year"===t&&this.isSameYear(i,this.max)?i=new Date(this.max.getFullYear()-1,this.max.getMonth(),this.max.getDate()):"Decade"===t&&this.isSameDecade(i,this.max)&&(i=new Date(this.max.getFullYear()-10,this.max.getMonth(),this.max.getDate())),this.leftCalCurrentDate=i,this.navigate(this.leftCalendar,this.leftCalCurrentDate,t),i="Month"===t?new Date(this.currentDate.setMonth(this.currentDate.getMonth()+1)):"Year"===t?new Date(this.currentDate.setFullYear(this.currentDate.getFullYear()+1)):new Date(this.currentDate.setFullYear(this.currentDate.getFullYear()+10)),this.rightCalCurrentDate=i,this.navigate(this.rightCalendar,this.rightCalCurrentDate,t),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])}},t.prototype.navigate=function(t,i,s){this.calendarElement=t,this.table=t.querySelector("table"),this.tableBodyElement=t.querySelector("tbody"),this.headerTitleElement=t.querySelector(".e-title"),this.tableHeadElement=t.querySelector("thead"),this.contentElement=t.querySelector(".e-content"),this.previousIcon=t.querySelector(".e-prev"),this.nextIcon=t.querySelector(".e-next"),this.effect="e-zoomin",e.prototype.navigateTo.call(this,s,i)},t.prototype.focusIn=function(){document.activeElement!==this.inputElement&&this.enabled&&(i.i(s.addClass)([this.inputWrapper.container],[y]),this.inputElement.focus())},t.prototype.focusOut=function(){var e=this.preventBlur;document.activeElement===this.inputElement&&(i.i(s.removeClass)([this.inputWrapper.container],[y]),this.preventBlur=!1,this.inputElement.blur(),this.preventBlur=e)},t.prototype.destroy=function(){this.unBindEvents(),this.hide(null);var t={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&&(i.i(s.removeClass)([this.inputElement],[c]),s.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),l.Input.removeAttributes(t,this.inputElement),i.i(s.isNullOrUndefined)(this.cloneElement.getAttribute("tabindex"))?this.inputElement.removeAttribute("tabindex"):this.inputElement.setAttribute("tabindex",this.tabIndex),this.ensureInputAttribute(),this.inputElement.classList.remove("e-input"),i.i(s.isNullOrUndefined)(this.inputWrapper)||(s.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler),null===this.angularTag&&this.inputWrapper.container.parentElement.appendChild(this.inputElement),i.i(s.detach)(this.inputWrapper.container))),i.i(s.isNullOrUndefined)(this.inputKeyboardModule)||this.isMobile||this.inputKeyboardModule.destroy(),this.popupObj&&(this.isMobile||this.clearCalendarEvents()),e.prototype.destroy.call(this),this.inputWrapper=this.popupWrapper=this.popupObj=this.cloneElement=this.presetElement=null,this.formElement&&s.EventHandler.remove(this.formElement,"reset",this.formResetHandler),i.i(s.isNullOrUndefined)(this.firstHiddenChild)||i.i(s.isNullOrUndefined)(this.secondHiddenChild)||(i.i(s.detach)(this.firstHiddenChild),i.i(s.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},t.prototype.ensureInputAttribute=function(){for(var e=[],t=0;t<this.inputElement.attributes.length;t++)e[t]=this.inputElement.attributes[t].name;for(var t=0;t<e.length;t++)i.i(s.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])))},t.prototype.getModuleName=function(){return"daterangepicker"},t.prototype.getPersistData=function(){var e=["startDate","endDate","value"];return this.addOnPersist(e)},t.prototype.getSelectedRange=function(){var e;return i.i(s.isNullOrUndefined)(this.startValue)||i.i(s.isNullOrUndefined)(this.endValue)?e=0:(e=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1,!i.i(s.isNullOrUndefined)(this.renderDayCellArgs)&&this.renderDayCellArgs.isDisabled&&this.disabledDateRender(),i.i(s.isNullOrUndefined)(this.disabledDayCnt)||(e-=this.disabledDayCnt,this.disabledDayCnt=null)),{startDate:this.startValue,endDate:this.endValue,daySpan:e}},t.prototype.show=function(t,a){var n=this;if(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||s.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:a||null,appendTo:this.isMobile||s.Browser.isDevice?this.mobileRangePopupWrap:document.body};var r=this.openEventArgs;this.trigger("open",r,function(r){if(n.openEventArgs=r,!n.openEventArgs.cancel){n.openEventArgs.appendTo.appendChild(n.popupWrapper),n.showPopup(t,a);var l=!n.isCustomRange||n.isMobile&&n.isCustomRange;!i.i(s.isUndefined)(n.presets[0].start&&n.presets[0].end&&n.presets[0].label)&&l&&n.setScrollPosition(),n.checkMinMaxDays(),n.isMobile&&!i.i(s.isNullOrUndefined)(n.startDate)&&i.i(s.isNullOrUndefined)(n.endDate)&&(n.endButton.element.classList.add(m),n.startButton.element.classList.remove(m),n.endButton.element.removeAttribute("disabled"),n.selectableDates()),e.prototype.setOverlayIndex.call(n,n.mobileRangePopupWrap,n.popupObj.element,n.modal,n.isMobile||s.Browser.isDevice)}})}},t.prototype.hide=function(e){var t=this;if(this.popupObj){if(i.i(s.isNullOrUndefined)(this.previousEndValue)&&i.i(s.isNullOrUndefined)(this.previousStartValue)?this.clearRange():(i.i(s.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))),i.i(s.isNullOrUndefined)(this.previousEndValue)?(this.endValue=null,this.setValue()):(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};var a=this.closeEventArgs;this.trigger("close",a,function(e){t.closeEventArgs=e,t.closeEventArgs.cancel?i.i(s.removeClass)([t.inputWrapper.buttons[0]],m):(t.isMobile&&(i.i(s.isNullOrUndefined)(t.startButton)||i.i(s.isNullOrUndefined)(t.endButton)||(s.EventHandler.remove(t.startButton.element,"click touchstart",t.deviceHeaderClick),s.EventHandler.remove(t.endButton.element,"click touchstart",t.deviceHeaderClick))),t.popupObj&&(t.popupObj.hide(),t.preventBlur&&(t.inputElement.focus(),i.i(s.addClass)([t.inputWrapper.container],[y]))),t.isMobile||(i.i(s.isNullOrUndefined)(t.leftKeyboardModule)||i.i(s.isNullOrUndefined)(t.rightKeyboardModule)||(t.leftKeyboardModule.destroy(),t.rightKeyboardModule.destroy()),i.i(s.isNullOrUndefined)(t.presetElement)||t.presetKeyboardModule.destroy(),i.i(s.isNullOrUndefined)(t.cancelButton)||t.btnKeyboardModule.destroy()),t.targetElement=null,i.i(s.removeClass)([document.body],"e-range-overflow"),s.EventHandler.remove(document,"mousedown touchstart",t.documentHandler),t.isMobile&&t.modal&&(t.modal.style.display="none",t.modal.outerHTML="",t.modal=null),(t.isMobile||s.Browser.isDevice)&&(i.i(s.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")})}}else this.updateClearIconState(),this.updateHiddenInput(),this.isMobile&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly")},t.prototype.setLocale=function(){this.globalize=new s.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),l.Input.setPlaceholder(this.placeholder,this.inputElement),this.updateInput(),this.updateHiddenInput(),this.changeTrigger()},t.prototype.refreshChange=function(){this.checkView(),this.refreshControl(),this.changeTrigger()},t.prototype.setDate=function(){l.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.refreshChange()},t.prototype.enableInput=function(){+this.min<=+this.max&&(this.setProperties({enabled:!0},!0),l.Input.setEnabled(this.enabled,this.inputElement),this.element.hasAttribute("disabled")&&this.bindEvents())},t.prototype.clearModelvalue=function(e,t){this.setProperties({startDate:null},!0),this.setProperties({endDate:null},!0),t.value&&t.value.length>0?this.setProperties({value:null},!0):t.value&&t.value.start?this.setProperties({value:{start:null,end:null}},!0):t.value&&!t.value.start&&this.setProperties({value:{start:null,end:null}},!0),this.updateValue(),this.setDate()},t.prototype.createHiddenInput=function(){i.i(s.isNullOrUndefined)(this.firstHiddenChild)&&i.i(s.isNullOrUndefined)(this.secondHiddenChild)&&(this.firstHiddenChild=this.createElement("input"),this.secondHiddenChild=this.createElement("input")),i.i(s.isNullOrUndefined)(this.inputElement.getAttribute("name"))||(this.inputElement.setAttribute("data-name",this.inputElement.getAttribute("name")),this.inputElement.removeAttribute("name")),i.i(s.attributes)(this.firstHiddenChild,{type:"text",name:this.inputElement.getAttribute("data-name"),class:"e-daterange-hidden"}),i.i(s.attributes)(this.secondHiddenChild,{type:"text",name:this.inputElement.getAttribute("data-name"),class:"e-daterange-hidden"});var e={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)},t.prototype.setMinMaxDays=function(){this.isPopupOpen()&&(this.removeClassDisabled(),this.checkMinMaxDays(),this.isMobile&&this.selectableDates(),!this.strictMode&&i.i(s.isNullOrUndefined)(this.startValue)&&i.i(s.isNullOrUndefined)(this.endValue)?this.removeSelection():this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar]),this.updateHeader())},t.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)},t.prototype.onPropertyChanged=function(e,t){for(var a={format:this.formatString,type:"date",skeleton:"yMd"},n=0,r=Object.keys(e);n<r.length;n++){var o=r[n];switch(["maxDays","minDays","value"].indexOf(o)<0&&this.hide(null),o){case"width":this.setEleWidth(this.width),l.Input.calculateWidth(this.inputElement,this.inputWrapper.container),i.i(s.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(s.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":l.Input.setPlaceholder(e.placeholder,this.inputElement),this.setProperties({placeholder:e.placeholder},!0);break;case"readonly":l.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),l.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),l.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"locale":this.globalize=new s.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),l.Input.setPlaceholder(this.placeholder,this.inputElement),this.setLocale();break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.setDataAttribute(!0),this.checkHtmlAttributes(!0);break;case"showClearButton":l.Input.setClearButton(this.showClearButton,this.inputElement,this.inputWrapper),this.bindClearEvent();break;case"startDate":"string"==typeof e.startDate&&(e.startDate=this.globalize.parseDate(e.startDate,a)),+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(e.endDate,a)),+this.initEndDate!=+e.endDate&&(this.endValue=this.getStartEndValue(e.endDate,!0),this.setDate(),this.setValue());break;case"value":if(this.invalidValueString=null,this.checkInvalidRange(e.value),"string"==typeof e.value)if(this.invalidValueString)this.clearModelvalue(e,t);else{var h=e.value.split(" "+this.separator+" ");this.value=[new Date(h[0]),new Date(h[1])],this.updateValue(),this.setDate()}else!i.i(s.isNullOrUndefined)(e.value)&&e.value.length>0||!i.i(s.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?this.clearModelvalue(e,t):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?this.modelValue=e.value:e.value.start&&(this.modelValue=e.value),this.updateValue(),this.setDate())):(i.i(s.isNullOrUndefined)(this.value)||null==e.value.start)&&(this.valueType=e.value,this.startValue=null,this.endValue=null,this.clearModelvalue(e,t));if(this.isPopupOpen()){if(i.i(s.isNullOrUndefined)(this.startValue)&&i.i(s.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},!0),this.refreshChange(),this.setMinMaxDays();break;case"maxDays":this.setProperties({maxDays:e.maxDays},!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,l.Input.removeFloating(this.inputWrapper),l.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder),i.i(s.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(s.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()}}},u([i.i(s.Property)(null)],t.prototype,"value",void 0),u([i.i(s.Property)(!1)],t.prototype,"enablePersistence",void 0),u([i.i(s.Property)(new Date(1900,0,1))],t.prototype,"min",void 0),u([i.i(s.Property)(new Date(2099,11,31))],t.prototype,"max",void 0),u([i.i(s.Property)(null)],t.prototype,"locale",void 0),u([i.i(s.Property)(null)],t.prototype,"firstDayOfWeek",void 0),u([i.i(s.Property)(!1)],t.prototype,"weekNumber",void 0),u([i.i(s.Property)("Gregorian")],t.prototype,"calendarMode",void 0),u([i.i(s.Property)(!1)],t.prototype,"openOnFocus",void 0),u([i.i(s.Property)(!1)],t.prototype,"fullScreenMode",void 0),u([i.i(s.Event)()],t.prototype,"created",void 0),u([i.i(s.Event)()],t.prototype,"destroyed",void 0),u([i.i(s.Event)()],t.prototype,"change",void 0),u([i.i(s.Event)()],t.prototype,"cleared",void 0),u([i.i(s.Event)()],t.prototype,"navigated",void 0),u([i.i(s.Event)()],t.prototype,"renderDayCell",void 0),u([i.i(s.Property)(null)],t.prototype,"startDate",void 0),u([i.i(s.Property)(null)],t.prototype,"endDate",void 0),u([i.i(s.Collection)([{}],A)],t.prototype,"presets",void 0),u([i.i(s.Property)("")],t.prototype,"width",void 0),u([i.i(s.Property)(1e3)],t.prototype,"zIndex",void 0),u([i.i(s.Property)(!0)],t.prototype,"showClearButton",void 0),u([i.i(s.Property)(!0)],t.prototype,"showTodayButton",void 0),u([i.i(s.Property)("Month")],t.prototype,"start",void 0),u([i.i(s.Property)("Month")],t.prototype,"depth",void 0),u([i.i(s.Property)("")],t.prototype,"cssClass",void 0),u([i.i(s.Property)("-")],t.prototype,"separator",void 0),u([i.i(s.Property)(null)],t.prototype,"minDays",void 0),u([i.i(s.Property)(null)],t.prototype,"maxDays",void 0),u([i.i(s.Property)(!1)],t.prototype,"strictMode",void 0),u([i.i(s.Property)(null)],t.prototype,"keyConfigs",void 0),u([i.i(s.Property)(null)],t.prototype,"format",void 0),u([i.i(s.Property)(!0)],t.prototype,"enabled",void 0),u([i.i(s.Property)(!1)],t.prototype,"readonly",void 0),u([i.i(s.Property)(!0)],t.prototype,"allowEdit",void 0),u([i.i(s.Property)("Never")],t.prototype,"floatLabelType",void 0),u([i.i(s.Property)(null)],t.prototype,"placeholder",void 0),u([i.i(s.Property)({})],t.prototype,"htmlAttributes",void 0),u([i.i(s.Event)()],t.prototype,"open",void 0),u([i.i(s.Event)()],t.prototype,"close",void 0),u([i.i(s.Event)()],t.prototype,"select",void 0),u([i.i(s.Event)()],t.prototype,"focus",void 0),u([i.i(s.Event)()],t.prototype,"blur",void 0),t=u([s.NotifyPropertyChanges],t)}(a.b)},function(e,t,i){"use strict";i.d(t,"a",function(){return D});var s=i(0),a=(i.n(s),i(2)),n=(i.n(a),i(1)),r=(i.n(n),i(4)),l=i(5),o=this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),h=this&&this.__decorate||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;l>=0;l--)(a=e[l])&&(r=(n<3?a(r):n>3?a(t,i,r):a(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},u=(new Date).getDate(),d=(new Date).getMonth(),p=(new Date).getFullYear(),c=(new Date).getHours(),m=(new Date).getMinutes(),f=(new Date).getSeconds(),v=(new Date).getMilliseconds(),y="e-datetimepicker",g="e-active",b="e-list-item",D=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.valueWithMinutes=null,s.scrollInvoked=!1,s.moduleName=s.getModuleName(),s.dateTimeOptions=t,s}return o(t,e),t.prototype.focusHandler=function(){this.enabled&&i.i(s.addClass)([this.inputWrapper.container],"e-input-focus")},t.prototype.focusIn=function(){e.prototype.focusIn.call(this)},t.prototype.focusOut=function(){document.activeElement===this.inputElement&&(this.inputElement.blur(),i.i(s.removeClass)([this.inputWrapper.container],["e-input-focus"]))},t.prototype.blurHandler=function(e){if(this.enabled){if(this.isTimePopupOpen()&&this.isPreventBlur)return void this.inputElement.focus();i.i(s.removeClass)([this.inputWrapper.container],"e-input-focus");var t={model:this};this.isTimePopupOpen()&&this.hide(e),this.trigger("blur",t)}},t.prototype.destroy=function(){this.popupObject&&this.popupObject.element.classList.contains("e-popup")&&(this.popupObject.destroy(),i.i(s.detach)(this.dateTimeWrapper),this.dateTimeWrapper=void 0,this.liCollections=this.timeCollections=[],i.i(s.isNullOrUndefined)(this.rippleFn)||this.rippleFn());var t={"aria-live":"assertive","aria-atomic":"true","aria-invalid":"false",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-expanded":"false",role:"combobox",autocomplete:"off"};this.inputElement&&n.Input.removeAttributes(t,this.inputElement),this.isCalendar()&&(this.popupWrapper&&i.i(s.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,e.prototype.destroy.call(this)},t.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,!i.i(s.isNullOrUndefined)(i.i(s.closest)(this.element,"fieldset"))&&i.i(s.closest)(this.element,"fieldset").disabled&&(this.enabled=!1),e.prototype.updateHtmlAttributeToElement.call(this),this.checkAttributes(!1);var t={placeholder:this.placeholder};this.l10n=new s.L10n("datetimepicker",t,this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),e.prototype.render.call(this),this.createInputElement(),e.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||n.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)),"Auto"===this.floatLabelType&&n.Input.calculateWidth(this.inputElement,this.inputWrapper.container),i.i(s.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(s.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()},t.prototype.setValue=function(t){if(void 0===t&&(t=!1),this.initValue=this.validateMinMaxRange(this.value),!this.strictMode&&this.isDateObject(this.initValue)){var a=this.validateMinMaxRange(this.initValue);n.Input.setValue(this.getFormattedValue(a),this.inputElement,this.floatLabelType,this.showClearButton),this.setProperties({value:a},!0)}else i.i(s.isNullOrUndefined)(this.value)&&(this.initValue=null,this.setProperties({value:null},!0));this.valueWithMinutes=this.value,e.prototype.updateInput.call(this,t)},t.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},t.prototype.checkValidState=function(e){this.isValidState=!0,this.strictMode||(+e>+this.max||+e<+this.min)&&(this.isValidState=!1),this.checkErrorState()},t.prototype.checkErrorState=function(){this.isValidState?i.i(s.removeClass)([this.inputWrapper.container],"e-error"):i.i(s.addClass)([this.inputWrapper.container],"e-error"),i.i(s.attributes)(this.inputElement,{"aria-invalid":this.isValidState?"false":"true"})},t.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},t.prototype.disablePopupButton=function(e){e?(i.i(s.addClass)([this.inputWrapper.buttons[0],this.timeIcon],"e-disabled"),this.hide()):i.i(s.removeClass)([this.inputWrapper.buttons[0],this.timeIcon],"e-disabled")},t.prototype.getFormattedValue=function(e){var t;return i.i(s.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))},t.prototype.isDateObject=function(e){return!i.i(s.isNullOrUndefined)(e)&&!isNaN(+e)},t.prototype.createInputElement=function(){i.i(s.removeClass)([this.inputElement],"e-datepicker"),i.i(s.removeClass)([this.inputWrapper.container],"e-date-wrapper"),i.i(s.addClass)([this.inputWrapper.container],"e-datetime-wrapper"),i.i(s.addClass)([this.inputElement],y),this.renderTimeIcon()},t.prototype.renderTimeIcon=function(){this.timeIcon=n.Input.appendSpan("e-input-group-icon e-time-icon e-icons",this.inputWrapper.container)},t.prototype.bindInputEvents=function(){s.EventHandler.add(this.timeIcon,"mousedown",this.timeHandler,this),s.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.dateHandler,this),s.EventHandler.add(this.inputElement,"blur",this.blurHandler,this),s.EventHandler.add(this.inputElement,"focus",this.focusHandler,this),this.defaultKeyConfigs=i.i(s.extend)(this.defaultKeyConfigs,this.keyConfigs),this.keyboardHandler=new s.KeyboardEvents(this.inputElement,{eventName:"keydown",keyAction:this.inputKeyAction.bind(this),keyConfigs:this.defaultKeyConfigs})},t.prototype.unBindInputEvents=function(){s.EventHandler.remove(this.timeIcon,"mousedown touchstart",this.timeHandler),s.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown touchstart",this.dateHandler),this.inputElement&&(s.EventHandler.remove(this.inputElement,"blur",this.blurHandler),s.EventHandler.remove(this.inputElement,"focus",this.focusHandler)),this.keyboardHandler&&this.keyboardHandler.destroy()},t.prototype.cldrTimeFormat=function(){return this.isNullOrEmpty(this.timeFormat)?"en"===this.locale||"en-US"===this.locale?i.i(s.getValue)("timeFormats.short",i.i(s.getDefaultDateObject)()):this.getCultureTimeObject(s.cldrData,""+this.locale):this.timeFormat},t.prototype.cldrDateTimeFormat=function(){var e=new s.Internationalization(this.locale),t=e.getDatePattern({skeleton:"yMd"});return this.isNullOrEmpty(this.formatString)?t+" "+this.getCldrFormat("time"):this.formatString},t.prototype.getCldrFormat=function(e){return"en"===this.locale||"en-US"===this.locale?i.i(s.getValue)("timeFormats.short",i.i(s.getDefaultDateObject)()):this.getCultureTimeObject(s.cldrData,""+this.locale)},t.prototype.isNullOrEmpty=function(e){return!!(i.i(s.isNullOrUndefined)(e)||"string"==typeof e&&""===e.trim())},t.prototype.getCultureTimeObject=function(e,t){return"Gregorian"===this.calendarMode?i.i(s.getValue)("main."+this.locale+".dates.calendars.gregorian.timeFormats.short",e):i.i(s.getValue)("main."+this.locale+".dates.calendars.islamic.timeFormats.short",e)},t.prototype.timeHandler=function(t){this.enabled&&(this.isIconClicked=!0,s.Browser.isDevice&&this.inputElement.setAttribute("readonly",""),t.currentTarget===this.timeIcon&&t.preventDefault(),this.enabled&&!this.readonly&&(this.isDatePopupOpen()&&e.prototype.hide.call(this,t),this.isTimePopupOpen()?this.closePopup(t):(this.inputElement.focus(),this.popupCreation("time",t),i.i(s.addClass)([this.inputWrapper.container],["e-input-focus"]))),this.isIconClicked=!1)},t.prototype.dateHandler=function(e){this.enabled&&(e.currentTarget===this.inputWrapper.buttons[0]&&e.preventDefault(),this.enabled&&!this.readonly&&(this.isTimePopupOpen()&&this.closePopup(e),i.i(s.isNullOrUndefined)(this.popupWrapper)||this.popupCreation("date",e)))},t.prototype.show=function(t,i){this.enabled&&this.readonly||!this.enabled||("time"!==t||this.dateTimeWrapper?this.popupObj||(this.isTimePopupOpen()&&this.hide(i),e.prototype.show.call(this),this.popupCreation("date",i)):(this.isDatePopupOpen()&&this.hide(i),this.popupCreation("time",i)))},t.prototype.toggle=function(t){this.isDatePopupOpen()?(e.prototype.hide.call(this,t),this.show("time",null)):this.isTimePopupOpen()?(this.hide(t),e.prototype.show.call(this,null,t),this.popupCreation("date",null)):this.show(null,t)},t.prototype.listCreation=function(){var e;e="Gregorian"===this.calendarMode?this.globalize.parseDate(this.inputElement.value,{format:this.cldrDateTimeFormat(),type:"datetime"}):this.globalize.parseDate(this.inputElement.value,{format:this.cldrDateTimeFormat(),type:"datetime",calendar:"islamic"});var t=i.i(s.isNullOrUndefined)(this.value)?""!==this.inputElement.value?e:new Date:this.value;this.valueWithMinutes=t,this.listWrapper=i.i(s.createElement)("div",{className:"e-content",attrs:{tabindex:"0"}});var a=this.startTime(t),n=this.endTime(t),r=l.a.createListItems(this.createElement,a,n,this.globalize,this.cldrTimeFormat(),this.step);this.timeCollections=r.collection,this.listTag=r.list,i.i(s.attributes)(this.listTag,{role:"listbox","aria-hidden":"false",id:this.element.id+"_options"}),i.i(s.append)([r.list],this.listWrapper),this.wireTimeListEvents();var o={duration:300,selector:"."+b};this.rippleFn=i.i(s.rippleEffect)(this.listWrapper,o),this.liCollections=this.listWrapper.querySelectorAll("."+b)},t.prototype.popupCreation=function(e,t){s.Browser.isDevice&&this.element.setAttribute("readonly","readonly"),"date"===e?!this.readonly&&this.popupWrapper&&(i.i(s.addClass)([this.popupWrapper],"e-datetimepopup-wrapper"),i.i(s.attributes)(this.popupWrapper,{id:this.element.id+"_datepopup"})):this.readonly||(this.dateTimeWrapper=i.i(s.createElement)("div",{className:y+" e-popup",attrs:{id:this.element.id+"_timepopup",style:"visibility:hidden ; display:block"}}),i.i(s.isNullOrUndefined)(this.cssClass)||(this.dateTimeWrapper.className+=" "+this.cssClass),!i.i(s.isNullOrUndefined)(this.step)&&this.step>0&&(this.listCreation(),i.i(s.append)([this.listWrapper],this.dateTimeWrapper)),document.body.appendChild(this.dateTimeWrapper),this.addTimeSelection(),this.renderPopup(),this.setTimeScrollPosition(),this.openPopup(t),(!s.Browser.isDevice||s.Browser.isDevice&&!this.fullScreenMode)&&this.popupObject.refreshPosition(this.inputElement),s.Browser.isDevice&&this.fullScreenMode&&(this.dateTimeWrapper.style.left="0px"))},t.prototype.openPopup=function(e){var t=this;this.preventArgs={cancel:!1,popup:this.popupObject,event:e||null};var a=this.preventArgs;this.trigger("open",a,function(e){if(t.preventArgs=e,!t.preventArgs.cancel&&!t.readonly){var a={name:"FadeIn",duration:100};1e3===t.zIndex?t.popupObject.show(new s.Animation(a),t.element):t.popupObject.show(new s.Animation(a),null),i.i(s.addClass)([t.inputWrapper.container],["e-icon-anim"]),i.i(s.attributes)(t.inputElement,{"aria-expanded":"true"}),i.i(s.attributes)(t.inputElement,{"aria-owns":t.inputElement.id+"_options"}),s.EventHandler.add(document,"mousedown touchstart",t.documentClickHandler,t)}})},t.prototype.documentClickHandler=function(e){var t=e.target;!i.i(s.isNullOrUndefined)(this.popupObject)&&(this.inputWrapper.container.contains(t)&&"mousedown"!==e.type||this.popupObject.element&&this.popupObject.element.contains(t))&&"touchstart"!==e.type&&e.preventDefault(),i.i(s.closest)(t,'[id="'+(this.popupObject&&this.popupObject.element.id+'"]'))||t===this.inputElement||t===this.timeIcon||i.i(s.isNullOrUndefined)(this.inputWrapper)||t===this.inputWrapper.container?t!==this.inputElement&&(s.Browser.isDevice||(this.isPreventBlur=document.activeElement===this.inputElement&&(s.Browser.isIE||"edge"===s.Browser.info.name)&&t===this.popupObject.element)):this.isTimePopupOpen()&&(this.hide(e),this.focusOut())},t.prototype.isTimePopupOpen=function(){return!(!this.dateTimeWrapper||!this.dateTimeWrapper.classList.contains(""+y))},t.prototype.isDatePopupOpen=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains("e-datetimepopup-wrapper"))},t.prototype.renderPopup=function(){var e=this;this.containerStyle=this.inputWrapper.container.getBoundingClientRect(),s.Browser.isDevice&&(this.timeModal=i.i(s.createElement)("div"),this.timeModal.className=y+" e-time-modal",document.body.className+=" e-time-overflow",this.timeModal.style.display="block",document.body.appendChild(this.timeModal));if(this.popupObject=new a.Popup(this.dateTimeWrapper,{width:this.setPopupWidth(),zIndex:this.zIndex,targetType:"container",collision:s.Browser.isDevice?{X:"fit",Y:"fit"}:{X:"flip",Y:"flip"},relateTo:s.Browser.isDevice?document.body:this.inputWrapper.container,position:s.Browser.isDevice?{X:"center",Y:"center"}:{X:"left",Y:"bottom"},enableRtl:this.enableRtl,offsetY:4,open:function(){e.dateTimeWrapper.style.visibility="visible",i.i(s.addClass)([e.timeIcon],g),s.Browser.isDevice||(e.timekeyConfigure=i.i(s.extend)(e.timekeyConfigure,e.keyConfigs),e.inputEvent=new s.KeyboardEvents(e.inputWrapper.container,{keyAction:e.timeKeyActionHandle.bind(e),keyConfigs:e.timekeyConfigure,eventName:"keydown"}))},close:function(){i.i(s.removeClass)([e.timeIcon],g),e.unWireTimeListEvents(),e.inputElement.removeAttribute("aria-activedescendant"),i.i(s.remove)(e.popupObject.element),e.popupObject.destroy(),e.dateTimeWrapper.innerHTML="",e.listWrapper=e.dateTimeWrapper=void 0,e.inputEvent&&e.inputEvent.destroy()},targetExitViewport:function(){s.Browser.isDevice||e.hide()}}),s.Browser.isDevice&&this.fullScreenMode?(this.popupObject.element.style.display="flex",this.popupObject.element.style.maxHeight="100%",this.popupObject.element.style.width="100%"):this.popupObject.element.style.maxHeight="250px",s.Browser.isDevice&&this.fullScreenMode){var t=i.i(s.createElement)("div",{className:"e-datetime-mob-popup-wrap"}),n=this.createElement("div",{className:"e-model-header"}),r=this.createElement("span",{className:"e-model-title"});r.textContent="Select time";var l=this.createElement("span",{className:"e-popup-close"});s.EventHandler.add(l,"mousedown touchstart",this.dateTimeCloseHandler,this);var o=this.dateTimeWrapper.querySelector(".e-content");n.appendChild(l),n.appendChild(r),t.appendChild(n),t.appendChild(o),this.dateTimeWrapper.insertBefore(t,this.dateTimeWrapper.firstElementChild)}},t.prototype.dateTimeCloseHandler=function(e){this.hide()},t.prototype.setDimension=function(e){return e="number"==typeof e?i.i(s.formatUnit)(e):"string"==typeof e?e:"100%"},t.prototype.setPopupWidth=function(){var e=this.setDimension(this.width);if(e.indexOf("%")>-1){e=(this.containerStyle.width*parseFloat(e)/100).toString()+"px"}return e},t.prototype.wireTimeListEvents=function(){s.EventHandler.add(this.listWrapper,"click",this.onMouseClick,this),s.Browser.isDevice||(s.EventHandler.add(this.listWrapper,"mouseover",this.onMouseOver,this),s.EventHandler.add(this.listWrapper,"mouseout",this.onMouseLeave,this))},t.prototype.unWireTimeListEvents=function(){this.listWrapper&&(s.EventHandler.remove(this.listWrapper,"click",this.onMouseClick),s.EventHandler.remove(document,"mousedown touchstart",this.documentClickHandler),s.Browser.isDevice||(s.EventHandler.add(this.listWrapper,"mouseover",this.onMouseOver,this),s.EventHandler.add(this.listWrapper,"mouseout",this.onMouseLeave,this)))},t.prototype.onMouseOver=function(e){var t=i.i(s.closest)(e.target,"."+b);this.setTimeHover(t,"e-hover")},t.prototype.onMouseLeave=function(){this.removeTimeHover("e-hover")},t.prototype.setTimeHover=function(e,t){this.enabled&&this.isValidLI(e)&&!e.classList.contains(t)&&(this.removeTimeHover(t),i.i(s.addClass)([e],t))},t.prototype.getPopupHeight=function(){var e=parseInt("250px",10),t=this.dateTimeWrapper.getBoundingClientRect().height;return s.Browser.isDevice&&this.fullScreenMode?t:t>e?e:t},t.prototype.changeEvent=function(t){e.prototype.changeEvent.call(this,t),(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))},t.prototype.updateValue=function(e){this.setInputValue("time"),+this.previousDateTime!=+this.value&&(this.changedArgs={value:this.value,event:e||null,isInteracted:!i.i(s.isNullOrUndefined)(e),element:this.element},this.addTimeSelection(),this.trigger("change",this.changedArgs),this.previousDateTime=this.previousDate=this.value)},t.prototype.setTimeScrollPosition=function(){var e=this.selectedElement;i.i(s.isNullOrUndefined)(e)?this.dateTimeWrapper&&this.checkDateValue(this.scrollTo)&&this.setScrollTo():this.findScrollTop(e)},t.prototype.findScrollTop=function(e){var t=this.getPopupHeight(),i=e.nextElementSibling,a=i?i.offsetTop:e.offsetTop,n=e.getBoundingClientRect().height;if(a+e.offsetTop>t)if(s.Browser.isDevice&&this.fullScreenMode){var r=this.dateTimeWrapper.querySelector(".e-content");r.scrollTop=i?a-(t/2+n/2):a}else this.dateTimeWrapper.scrollTop=i?a-(t/2+n/2):a;else this.dateTimeWrapper.scrollTop=0},t.prototype.setScrollTo=function(){var e,t=this.dateTimeWrapper.querySelectorAll("."+b);if(t.length>=0){this.scrollInvoked=!0;var a=this.timeCollections[0],n=this.getDateObject(this.checkDateValue(this.scrollTo)).getTime();e=t[Math.round((n-a)/(6e4*this.step))]}else this.dateTimeWrapper.scrollTop=0;i.i(s.isNullOrUndefined)(e)?this.dateTimeWrapper.scrollTop=0:this.findScrollTop(e)},t.prototype.setInputValue=function(e){if("date"===e)this.inputElement.value=this.previousElementValue=this.getFormattedValue(this.getFullDateTime()),this.setProperties({value:this.getFullDateTime()},!0);else{var t=this.getFormattedValue(new Date(this.timeCollections[this.activeIndex]));n.Input.setValue(t,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()},t.prototype.getFullDateTime=function(){var e=null;return e=this.isDateObject(this.valueWithMinutes)?this.combineDateTime(this.valueWithMinutes):this.previousDate,this.validateMinMaxRange(e)},t.prototype.createMask=function(){this.notify("createMask",{module:"MaskedDateTime"})},t.prototype.combineDateTime=function(e){if(this.isDateObject(e)){var t=this.previousDate.getDate(),i=this.previousDate.getMonth(),s=this.previousDate.getFullYear(),a=e.getHours(),n=e.getMinutes(),r=e.getSeconds();return new Date(s,i,t,a,n,r)}return this.previousDate},t.prototype.onMouseClick=function(e){var t=e.target,a=this.selectedElement=i.i(s.closest)(t,"."+b);a&&a.classList.contains(b)&&(this.timeValue=a.getAttribute("data-value"),this.hide(e)),this.setSelection(a,e)},t.prototype.setSelection=function(e,t){if(this.isValidLI(e)&&!e.classList.contains(g)){this.selectedElement=e;var a=Array.prototype.slice.call(this.liCollections).indexOf(e);this.activeIndex=a,this.valueWithMinutes=new Date(this.timeCollections[this.activeIndex]),i.i(s.addClass)([this.selectedElement],g),this.selectedElement.setAttribute("aria-selected","true"),this.updateValue(t)}},t.prototype.setTimeActiveClass=function(){var e=i.i(s.isNullOrUndefined)(this.dateTimeWrapper)?this.listWrapper:this.dateTimeWrapper;if(!i.i(s.isNullOrUndefined)(e)){var t=e.querySelectorAll("."+b);if(t.length)for(var a=0;a<t.length;a++)if(this.timeCollections[a]===+this.valueWithMinutes){t[a].setAttribute("aria-selected","true"),this.selectedElement=t[a],this.activeIndex=a,this.setTimeActiveDescendant();break}}},t.prototype.setTimeActiveDescendant=function(){!i.i(s.isNullOrUndefined)(this.selectedElement)&&this.value?i.i(s.attributes)(this.inputElement,{"aria-activedescendant":this.selectedElement.getAttribute("id")}):this.inputElement.removeAttribute("aria-activedescendant")},t.prototype.addTimeSelection=function(){this.selectedElement=null,this.removeTimeSelection(),this.setTimeActiveClass(),i.i(s.isNullOrUndefined)(this.selectedElement)||(i.i(s.addClass)([this.selectedElement],g),this.selectedElement.setAttribute("aria-selected","true"))},t.prototype.removeTimeSelection=function(){if(this.removeTimeHover("e-hover"),!i.i(s.isNullOrUndefined)(this.dateTimeWrapper)){var e=this.dateTimeWrapper.querySelectorAll("."+g);e.length&&(i.i(s.removeClass)(e,g),e[0].removeAttribute("aria-selected"))}},t.prototype.removeTimeHover=function(e){var t=this.getTimeHoverItem(e);t&&t.length&&i.i(s.removeClass)(t,e)},t.prototype.getTimeHoverItem=function(e){var t,a=i.i(s.isNullOrUndefined)(this.dateTimeWrapper)?this.listWrapper:this.dateTimeWrapper;return i.i(s.isNullOrUndefined)(a)||(t=a.querySelectorAll("."+e)),t},t.prototype.isValidLI=function(e){return e&&e.classList.contains(b)&&!e.classList.contains("e-disabled")},t.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(),h=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,h)},t.prototype.startTime=function(e){var t,i,s=this.min,a=null===e?new Date:e;return+a.getDate()==+s.getDate()&&+a.getMonth()==+s.getMonth()&&+a.getFullYear()==+s.getFullYear()||+new Date(a.getFullYear(),a.getMonth(),a.getDate())<=+new Date(s.getFullYear(),s.getMonth(),s.getDate())?(i=!1,t=this.min):+a<+this.max&&+a>+this.min?(i=!0,t=a):+a>=+this.max&&(i=!0,t=this.max),this.calculateStartEnd(t,i,"starttime")},t.prototype.endTime=function(e){var t,i,s=this.max,a=null===e?new Date:e;return+a.getDate()==+s.getDate()&&+a.getMonth()==+s.getMonth()&&+a.getFullYear()==+s.getFullYear()||+new Date(a.getUTCFullYear(),a.getMonth(),a.getDate())>=+new Date(s.getFullYear(),s.getMonth(),s.getDate())?(i=!1,t=this.max):+a<+this.max&&+a>+this.min?(i=!0,t=a):+a<=+this.min&&(i=!0,t=this.min),this.calculateStartEnd(t,i,"endtime")},t.prototype.hide=function(e){var t=this;if(this.popupObj||this.dateTimeWrapper){this.preventArgs={cancel:!1,popup:this.popupObj||this.popupObject,event:e||null};var a=this.preventArgs;i.i(s.isNullOrUndefined)(this.popupObj)?this.trigger("close",a,function(i){t.dateTimeCloseEventCallback(e,i)}):this.dateTimeCloseEventCallback(e,a)}else s.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit()},t.prototype.dateTimeCloseEventCallback=function(t,a){this.preventArgs=a,this.preventArgs.cancel||(this.isDatePopupOpen()?e.prototype.hide.call(this,t):this.isTimePopupOpen()&&(this.closePopup(t),i.i(s.removeClass)([document.body],"e-time-overflow"),s.Browser.isDevice&&this.timeModal&&(this.timeModal.style.display="none",this.timeModal.outerHTML="",this.timeModal=null),this.setTimeActiveDescendant())),s.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit()},t.prototype.closePopup=function(e){if(this.isTimePopupOpen()&&this.popupObject){var t={name:"FadeOut",duration:100,delay:0};this.popupObject.hide(new s.Animation(t)),this.inputWrapper.container.classList.remove("e-icon-anim"),i.i(s.attributes)(this.inputElement,{"aria-expanded":"false"}),this.inputElement.removeAttribute("aria-owns"),s.EventHandler.remove(document,"mousedown touchstart",this.documentClickHandler)}},t.prototype.preRender=function(){this.checkFormat(),this.dateTimeFormat=this.cldrDateTimeFormat(),e.prototype.preRender.call(this),i.i(s.removeClass)([this.inputElementCopy],[y])},t.prototype.getProperty=function(e,t){"min"===t?this.setProperties({min:this.validateValue(e.min)},!0):this.setProperties({max:this.validateValue(e.max)},!0)},t.prototype.checkAttributes=function(e){for(var t,a=e?i.i(s.isNullOrUndefined)(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["style","name","step","disabled","readonly","value","min","max","placeholder","type"],n=0,r=a;n<r.length;n++){var l=r[n];if(!i.i(s.isNullOrUndefined)(this.inputElement.getAttribute(l)))switch(l){case"name":this.inputElement.setAttribute("name",this.inputElement.getAttribute(l));break;case"step":this.step=parseInt(this.inputElement.getAttribute(l),10);break;case"readonly":if(i.i(s.isNullOrUndefined)(this.dateTimeOptions)||void 0===this.dateTimeOptions.readonly||e){var o="disabled"===this.inputElement.getAttribute(l)||""===this.inputElement.getAttribute(l)||"true"===this.inputElement.getAttribute(l);this.setProperties({readonly:o},!e)}break;case"placeholder":(i.i(s.isNullOrUndefined)(this.dateTimeOptions)||void 0===this.dateTimeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(l)},!e);break;case"min":(i.i(s.isNullOrUndefined)(this.dateTimeOptions)||void 0===this.dateTimeOptions.min||e)&&(t=new Date(this.inputElement.getAttribute(l)),this.isNullOrEmpty(t)||isNaN(+t)||this.setProperties({min:t},!e));break;case"disabled":if(i.i(s.isNullOrUndefined)(this.dateTimeOptions)||void 0===this.dateTimeOptions.enabled||e){var h="disabled"!==this.inputElement.getAttribute(l)&&"true"!==this.inputElement.getAttribute(l)&&""!==this.inputElement.getAttribute(l);this.setProperties({enabled:h},!e)}break;case"value":(i.i(s.isNullOrUndefined)(this.dateTimeOptions)||void 0===this.dateTimeOptions.value||e)&&(t=new Date(this.inputElement.getAttribute(l)),this.isNullOrEmpty(t)||isNaN(+t)||this.setProperties({value:t},!e));break;case"max":(i.i(s.isNullOrUndefined)(this.dateTimeOptions)||void 0===this.dateTimeOptions.max||e)&&(t=new Date(this.inputElement.getAttribute(l)),this.isNullOrEmpty(t)||isNaN(+t)||this.setProperties({max:t},!e))}}},t.prototype.requiredModules=function(){var e=[];return this&&e.push({args:[this],member:"islamic"}),this.enableMask&&e.push(this.maskedDateModule()),e},t.prototype.maskedDateModule=function(){return{args:[this],member:"MaskedDateTime"}},t.prototype.getTimeActiveElement=function(){return i.i(s.isNullOrUndefined)(this.dateTimeWrapper)?null:this.dateTimeWrapper.querySelectorAll("."+g)},t.prototype.createDateObj=function(e){return e instanceof Date?e:null},t.prototype.getDateObject=function(e){if(!this.isNullOrEmpty(e)){var t=this.createDateObj(e),a=this.valueWithMinutes,n=!i.i(s.isNullOrUndefined)(a);if(this.checkDateValue(t)){var r=n?a.getDate():u,l=n?a.getMonth():d,o=n?a.getFullYear():p,h=n?a.getHours():c,y=n?a.getMinutes():m,g=n?a.getSeconds():f,b=n?a.getMilliseconds():v;return this.scrollInvoked?(this.scrollInvoked=!1,new Date(o,l,r,t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())):new Date(o,l,r,h,y,g,b)}}return null},t.prototype.findNextTimeElement=function(e){var t=this.inputElement.value,a=i.i(s.isNullOrUndefined)(this.valueWithMinutes)?this.createDateObj(t):this.getDateObject(this.valueWithMinutes),n=null,r=this.liCollections.length;if(!i.i(s.isNullOrUndefined)(this.activeIndex)||!i.i(s.isNullOrUndefined)(this.checkDateValue(a))){if("home"===e.action)n=+this.createDateObj(new Date(this.timeCollections[0])),this.activeIndex=0;else if("end"===e.action)n=+this.createDateObj(new Date(this.timeCollections[this.timeCollections.length-1])),this.activeIndex=this.timeCollections.length-1;else if("down"===e.action){for(var l=0;l<r;l++)if(+a<this.timeCollections[l]){n=+this.createDateObj(new Date(this.timeCollections[l])),this.activeIndex=l;break}}else for(var l=r-1;l>=0;l--)if(+a>this.timeCollections[l]){n=+this.createDateObj(new Date(this.timeCollections[l])),this.activeIndex=l;break}this.selectedElement=this.liCollections[this.activeIndex],this.timeElementValue(i.i(s.isNullOrUndefined)(n)?null:new Date(n))}},t.prototype.setTimeValue=function(e,t){var a,r,l=this.validateMinMaxRange(t),o=this.createDateObj(l);return this.getFormattedValue(o)!==(i.i(s.isNullOrUndefined)(this.value)?null:this.getFormattedValue(this.value))?(this.valueWithMinutes=i.i(s.isNullOrUndefined)(o)?null:o,r=new Date(+this.valueWithMinutes)):(this.strictMode&&(e=o),this.valueWithMinutes=this.checkDateValue(e),r=new Date(+this.valueWithMinutes)),a="Gregorian"===this.calendarMode?this.globalize.formatDate(r,{format:i.i(s.isNullOrUndefined)(this.formatString)?this.cldrDateTimeFormat():this.formatString,type:"dateTime",skeleton:"yMd"}):this.globalize.formatDate(r,{format:i.i(s.isNullOrUndefined)(this.formatString)?this.cldrDateTimeFormat():this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}),!this.strictMode&&i.i(s.isNullOrUndefined)(r),n.Input.setValue(a,this.inputElement,this.floatLabelType,this.showClearButton),r},t.prototype.timeElementValue=function(e){if(!i.i(s.isNullOrUndefined)(this.checkDateValue(e))&&!this.isNullOrEmpty(e)){var t=e instanceof Date?e:this.getDateObject(e);return this.setTimeValue(t,e)}return null},t.prototype.timeKeyHandler=function(e){if(!(i.i(s.isNullOrUndefined)(this.step)||this.step<=0)){var t=this.timeCollections.length;if(i.i(s.isNullOrUndefined)(this.getTimeActiveElement())||0===this.getTimeActiveElement().length)this.liCollections.length>0&&(i.i(s.isNullOrUndefined)(this.value)&&i.i(s.isNullOrUndefined)(this.activeIndex)?(this.activeIndex=0,this.selectedElement=this.liCollections[0],this.timeElementValue(new Date(this.timeCollections[0]))):this.findNextTimeElement(e));else{var a=void 0;if(e.keyCode>=37&&e.keyCode<=40){var n=40===e.keyCode||39===e.keyCode?++this.activeIndex:--this.activeIndex;this.activeIndex=n=this.activeIndex===t?0:this.activeIndex,this.activeIndex=n=this.activeIndex<0?t-1:this.activeIndex,a=i.i(s.isNullOrUndefined)(this.timeCollections[n])?this.timeCollections[0]:this.timeCollections[n]}else"home"===e.action?(this.activeIndex=0,a=this.timeCollections[0]):"end"===e.action&&(this.activeIndex=t-1,a=this.timeCollections[t-1]);this.selectedElement=this.liCollections[this.activeIndex],this.timeElementValue(new Date(a))}this.isNavigate=!0,this.setTimeHover(this.selectedElement,"e-navigation"),this.setTimeActiveDescendant(),!this.isTimePopupOpen()||null===this.selectedElement||e&&"click"===e.type||this.setTimeScrollPosition()}},t.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),i.i(s.addClass)([this.inputWrapper.container],"e-input-focus"),this.isNavigate=!1,e.stopPropagation();break;case"escape":this.hide(e);break;default:this.isNavigate=!1}},t.prototype.inputKeyAction=function(e){switch(e.action){case"altDownArrow":this.strictModeUpdate(),this.updateInput(),this.toggle(e)}},t.prototype.onPropertyChanged=function(t,a){for(var r=0,l=Object.keys(t);r<l.length;r++){var o=l[r];switch(o){case"value":this.isDynamicValueChanged=!0,this.invalidValueString=null,this.checkInvalidValue(t.value),t.value=this.value,t.value=this.validateValue(t.value),this.enableMask?n.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton):n.Input.setValue(this.getFormattedValue(t.value),this.inputElement,this.floatLabelType,this.showClearButton),this.valueWithMinutes=t.value,this.setProperties({value:t.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(t,o),this.updateInput();break;case"enableRtl":n.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]);break;case"cssClass":i.i(s.isNullOrUndefined)(a.cssClass)||(a.cssClass=a.cssClass.replace(/\s+/g," ").trim()),i.i(s.isNullOrUndefined)(t.cssClass)||(t.cssClass=t.cssClass.replace(/\s+/g," ").trim()),n.Input.setCssClass(t.cssClass,[this.inputWrapper.container],a.cssClass),this.dateTimeWrapper&&n.Input.setCssClass(t.cssClass,[this.dateTimeWrapper],a.cssClass);break;case"locale":this.globalize=new s.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),n.Input.setPlaceholder(this.l10n.getConstant("placeholder"),this.inputElement),this.dateTimeFormat=this.cldrDateTimeFormat(),e.prototype.updateInput.call(this);break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.checkAttributes(!0);break;case"format":this.setProperties({format:t.format},!0),this.checkFormat(),this.dateTimeFormat=this.formatString,this.setValue(),this.enableMask&&(this.notify("createMask",{module:"MaskedDateTime"}),this.value||n.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton));break;case"placeholder":n.Input.setPlaceholder(t.placeholder,this.inputElement);break;case"enabled":n.Input.setEnabled(this.enabled,this.inputElement),this.enabled||(this.inputElement.tabIndex=-1);break;case"strictMode":this.invalidValueString=null,this.updateInput();break;case"width":this.setWidth(t.width),n.Input.calculateWidth(this.inputElement,this.inputWrapper.container),i.i(s.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(s.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":n.Input.setReadonly(this.readonly,this.inputElement);break;case"floatLabelType":this.floatLabelType=t.floatLabelType,n.Input.removeFloating(this.inputWrapper),n.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder),i.i(s.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(s.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(t.scrollTo)))?(this.dateTimeWrapper&&this.setScrollTo(),this.setProperties({scrollTo:this.checkDateValue(new Date(this.checkValue(t.scrollTo)))},!0)):this.setProperties({scrollTo:null},!0);break;case"enableMask":this.enableMask?(this.notify("createMask",{module:"MaskedDateTime"}),n.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton)):this.inputElement.value===this.maskedDateValue&&(this.maskedDateValue="",n.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton));break;default:e.prototype.onPropertyChanged.call(this,t,a)}this.isDynamicValueChanged||this.hide(null),this.isDynamicValueChanged=!1}},t.prototype.getModuleName=function(){return"datetimepicker"},t.prototype.restoreValue=function(){this.previousDateTime=this.previousDate,this.currentDate=this.value?this.value:new Date,this.valueWithMinutes=this.value,this.previousDate=this.value,this.previousElementValue=this.previousElementValue=i.i(s.isNullOrUndefined)(this.inputValueCopy)?"":this.getFormattedValue(this.inputValueCopy)},h([i.i(s.Property)(null)],t.prototype,"timeFormat",void 0),h([i.i(s.Property)(30)],t.prototype,"step",void 0),h([i.i(s.Property)(null)],t.prototype,"scrollTo",void 0),h([i.i(s.Property)(1e3)],t.prototype,"zIndex",void 0),h([i.i(s.Property)(null)],t.prototype,"value",void 0),h([i.i(s.Property)(null)],t.prototype,"keyConfigs",void 0),h([i.i(s.Property)({})],t.prototype,"htmlAttributes",void 0),h([i.i(s.Property)(!1)],t.prototype,"enablePersistence",void 0),h([i.i(s.Property)(!0)],t.prototype,"allowEdit",void 0),h([i.i(s.Property)(!1)],t.prototype,"isMultiSelection",void 0),h([i.i(s.Property)(null)],t.prototype,"values",void 0),h([i.i(s.Property)(!0)],t.prototype,"showClearButton",void 0),h([i.i(s.Property)(null)],t.prototype,"placeholder",void 0),h([i.i(s.Property)(!1)],t.prototype,"strictMode",void 0),h([i.i(s.Property)(!1)],t.prototype,"fullScreenMode",void 0),h([i.i(s.Property)(null)],t.prototype,"serverTimezoneOffset",void 0),h([i.i(s.Property)(new Date(1900,0,1))],t.prototype,"min",void 0),h([i.i(s.Property)(new Date(2099,11,31))],t.prototype,"max",void 0),h([i.i(s.Property)(null)],t.prototype,"firstDayOfWeek",void 0),h([i.i(s.Property)("Gregorian")],t.prototype,"calendarMode",void 0),h([i.i(s.Property)("Month")],t.prototype,"start",void 0),h([i.i(s.Property)("Month")],t.prototype,"depth",void 0),h([i.i(s.Property)(!1)],t.prototype,"weekNumber",void 0),h([i.i(s.Property)(!0)],t.prototype,"showTodayButton",void 0),h([i.i(s.Property)("Short")],t.prototype,"dayHeaderFormat",void 0),h([i.i(s.Property)(!1)],t.prototype,"openOnFocus",void 0),h([i.i(s.Property)(!1)],t.prototype,"enableMask",void 0),h([i.i(s.Property)({day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"})],t.prototype,"maskPlaceholder",void 0),h([i.i(s.Event)()],t.prototype,"open",void 0),h([i.i(s.Event)()],t.prototype,"close",void 0),h([i.i(s.Event)()],t.prototype,"cleared",void 0),h([i.i(s.Event)()],t.prototype,"blur",void 0),h([i.i(s.Event)()],t.prototype,"focus",void 0),h([i.i(s.Event)()],t.prototype,"created",void 0),h([i.i(s.Event)()],t.prototype,"destroyed",void 0),t=h([s.NotifyPropertyChanges],t)}(r.a)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=i(7);i.d(t,"CalendarBase",function(){return s.a}),i.d(t,"Calendar",function(){return s.b}),i.d(t,"Islamic",function(){return s.c});var a=i(8);i.d(t,"DatePicker",function(){return a.a});var n=i(9);i.d(t,"Presets",function(){return n.a}),i.d(t,"DateRangePicker",function(){return n.b});var r=i(12);i.d(t,"TimePickerBase",function(){return r.a}),i.d(t,"TimeMaskPlaceholder",function(){return r.b}),i.d(t,"TimePicker",function(){return r.c});var l=i(10);i.d(t,"DateTimePicker",function(){return l.a});var o=i(11);i.d(t,"MaskedDateTime",function(){return o.a})},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var s=i(0),a=(i.n(s),function(){function e(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|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|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.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()}return e.prototype.getModuleName=function(){return"MaskedDateTime"},e.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))},e.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))},e.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())},e.prototype.getCUltureMaskFormat=function(){this.l10n=new s.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())},e.prototype.validCharacterCheck=function(){var e=this.parent.inputElement.selectionStart;"timepicker"!==this.parent.moduleName&&e===this.hiddenMask.length&&this.mask===this.parent.inputElement.value&&(e=0);for(var t=e,i=e-1;t<this.hiddenMask.length||i>=0;t++,i--){if(t<this.hiddenMask.length&&-1!==this.validCharacters.indexOf(this.hiddenMask[t]))return void this.setSelection(this.hiddenMask[t]);if(i>=0&&-1!==this.validCharacters.indexOf(this.hiddenMask[i]))return void this.setSelection(this.hiddenMask[i])}},e.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()},e.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));t<0&&(t=0),this.parent.inputElement.setSelectionRange(t,i)},e.prototype.maskKeydownHandler=function(e){if(this.dayTypeCount=this.monthTypeCount=this.hourTypeCount=this.minuteTypeCount=this.secondTypeCount=0,"Delete"===e.e.key)return void(this.isDeleteKey=!0);if(!(e.e.altKey||e.e.ctrlKey||"ArrowLeft"!==e.e.key&&"ArrowRight"!==e.e.key&&"shiftTab"!==e.e.key&&"Tab"!==e.e.key&&"shiftTab"!==e.e.action&&"End"!==e.e.key&&"Home"!==e.e.key)){var t=this.parent.inputElement.selectionStart,i=this.parent.inputElement.selectionEnd,s=this.parent.inputElement.value.length;if(0===t&&i===s&&("Tab"===e.e.key||"shiftTab"===e.e.action)){var a="shiftTab"===e.e.action?i:0;this.parent.inputElement.selectionStart=this.parent.inputElement.selectionEnd=a}if("End"===e.e.key||"Home"===e.e.key){var n="End"===e.e.key?s:0;this.parent.inputElement.selectionStart=this.parent.inputElement.selectionEnd=n}this.navigateSelection("ArrowLeft"===e.e.key||"shiftTab"===e.e.action||"End"===e.e.key)}if(!(e.e.altKey||e.e.ctrlKey||"ArrowUp"!==e.e.key&&"ArrowDown"!==e.e.key)){var t=this.parent.inputElement.selectionStart,r="";-1!==this.validCharacters.indexOf(this.hiddenMask[t])&&(r=this.hiddenMask[t]),this.dateAlteration("ArrowDown"===e.e.key);var l=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=l,this.parent.inputElement.value=l;for(var o=0;o<this.hiddenMask.length;o++)if(r===this.hiddenMask[o]){t=o;break}this.parent.inputElement.selectionStart=t,this.validCharacterCheck()}},e.prototype.isPersist=function(){return this.parent.isFocused||this.navigated},e.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]&&this.validCharacters.indexOf(this.previousHiddenMask[r])>=0&&(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&&this.parent.isFocused,this.navigated=!this.navigated&&this.navigated,isNaN(l))return;for(var r=0;l>n;r++)l=parseInt(l.toString().slice(1),10);if(l>=1){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,this.dayTypeCount=this.dayTypeCount+1}else this.isDayPart=!1,this.dayTypeCount=this.isDateZero?this.dayTypeCount+1:this.dayTypeCount;break;case"M":var o=void 0;if(o=a.getMonth().toString().length<2&&!this.isPersist()?(this.isMonthPart?10*(a.getMonth()+1):0)+parseInt(s[e-1],10):parseInt(s[e-1],10),this.parent.isFocused=!this.parent.isFocused&&this.parent.isFocused,this.navigated=!this.navigated&&this.navigated,this.isMonthZero="0"===s[e-1],isNaN(o)){var h=this.getCulturedValue("months[stand-alone].wide"),u=Object.keys(h);for(this.monthCharacter+=s[e-1].toLowerCase();this.monthCharacter.length>0;){for(var r=1,d=0,p=u;d<p.length;d++){p[d];if(0===h[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(;o>12;)o=parseInt(o.toString().slice(1),10);if(o>=1){if(a.setMonth(o-1),this.isNavigate=2===o.toString().length,a.getMonth()!==o-1&&(a.setDate(1),a.setMonth(o-1)),this.isDayPart){var c=new Date(this.previousDate.getFullYear(),this.previousDate.getMonth()+1,0).getDate(),m=new Date(a.getFullYear(),a.getMonth()+1,0).getDate();this.previousDate.getDate()===c&&m<=c&&a.setDate(m)}this.previousDate=new Date(a.getFullYear(),a.getMonth(),a.getDate()),this.isMonthPart=!0,this.monthTypeCount=this.monthTypeCount+1}else a.setMonth(0),this.isMonthPart=!1,this.monthTypeCount=this.isMonthZero?this.monthTypeCount+1:this.monthTypeCount}break;case"y":var f=(this.isYearPart&&a.getFullYear().toString().length<4&&!this.isShortYear?10*a.getFullYear():0)+parseInt(s[e-1],10);if(this.isShortYear=!1,this.isYearZero="0"===s[e-1],isNaN(f))return;for(;f>9999;)f=parseInt(f.toString().slice(1),10);f<1?this.isYearPart=!1:(a.setFullYear(f),4===f.toString().length&&(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&&this.parent.isFocused,this.navigated=!this.navigated&&this.navigated,isNaN(this.hour))return;for(;this.hour>12;)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=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&&this.parent.isFocused,this.navigated=!this.navigated&&this.navigated,isNaN(this.hour))return;for(var r=0;this.hour>23;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=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&&this.parent.isFocused,this.navigated=!this.navigated&&this.navigated,isNaN(v))return;for(var r=0;v>59;r++)v=parseInt(v.toString().slice(1),10);a.setMinutes(v),this.isNavigate=2===v.toString().length,this.isMinutePart=!0,this.minuteTypeCount=this.minuteTypeCount+1;break;case"s":var y=(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&&this.parent.isFocused,this.navigated=!this.navigated&&this.navigated,isNaN(y))return;for(var r=0;y>59;r++)y=parseInt(y.toString().slice(1),10);a.setSeconds(y),this.isNavigate=2===y.toString().length,this.isSecondsPart=!0,this.secondTypeCount=this.secondTypeCount+1;break;case"a":this.periodCharacter+=s[e-1].toLowerCase();for(var g=this.getCulturedValue("dayPeriods.format.wide"),b=Object.keys(g),r=0;this.periodCharacter.length>0;r++)(0===g[b[0]].toLowerCase().indexOf(this.periodCharacter)&&a.getHours()>=12||0===g[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},e.prototype.formatCheck=function(){function e(e){var i,s,a,n=t.getCulturedValue("days[stand-alone].abbreviated"),r=Object.keys(n),l=t.getCulturedValue("days[stand-alone].wide"),o=Object.keys(l),h=t.getCulturedValue("days[stand-alone].narrow"),u=Object.keys(h),d=t.getCulturedValue("months[stand-alone].abbreviated"),p=t.getCulturedValue("months[stand-alone].wide"),c=t.getCulturedValue("dayPeriods.format.wide"),m=Object.keys(c);switch(e){case"ddd":case"dddd":case"d":i=t.isDayPart?t.maskDateValue.getDate().toString():t.defaultConstant.day.toString(),i=t.zeroCheck(t.isDateZero,t.isDayPart,i),2===t.dayTypeCount&&(t.isNavigate=!0,t.dayTypeCount=0);break;case"dd":i=t.isDayPart?t.roundOff(t.maskDateValue.getDate(),2):t.defaultConstant.day.toString(),i=t.zeroCheck(t.isDateZero,t.isDayPart,i),2===t.dayTypeCount&&(t.isNavigate=!0,t.dayTypeCount=0);break;case"E":case"EE":case"EEE":i=t.isDayPart&&t.isMonthPart&&t.isYearPart?n[r[t.maskDateValue.getDay()]].toString():t.defaultConstant.dayOfTheWeek.toString();break;case"EEEE":i=t.isDayPart&&t.isMonthPart&&t.isYearPart?l[o[t.maskDateValue.getDay()]].toString():t.defaultConstant.dayOfTheWeek.toString();break;case"EEEEE":i=t.isDayPart&&t.isMonthPart&&t.isYearPart?h[u[t.maskDateValue.getDay()]].toString():t.defaultConstant.dayOfTheWeek.toString();break;case"M":i=t.isMonthPart?(t.maskDateValue.getMonth()+1).toString():t.defaultConstant.month.toString(),i=t.zeroCheck(t.isMonthZero,t.isMonthPart,i),2===t.monthTypeCount&&(t.isNavigate=!0,t.monthTypeCount=0);break;case"MM":i=t.isMonthPart?t.roundOff(t.maskDateValue.getMonth()+1,2):t.defaultConstant.month.toString(),i=t.zeroCheck(t.isMonthZero,t.isMonthPart,i),2===t.monthTypeCount&&(t.isNavigate=!0,t.monthTypeCount=0);break;case"MMM":i=t.isMonthPart?d[t.maskDateValue.getMonth()+1]:t.defaultConstant.month.toString();break;case"MMMM":i=t.isMonthPart?p[t.maskDateValue.getMonth()+1]:t.defaultConstant.month.toString();break;case"yy":i=t.isYearPart?t.roundOff(t.maskDateValue.getFullYear()%100,2):t.defaultConstant.year.toString(),i=t.zeroCheck(t.isYearZero,t.isYearPart,i),t.isYearPart&&(t.isNavigate=t.isShortYear=2===(t.maskDateValue.getFullYear()%100).toString().length);break;case"y":case"yyyy":i=t.isYearPart?t.roundOff(t.maskDateValue.getFullYear(),4):t.defaultConstant.year.toString(),i=t.zeroCheck(t.isYearZero,t.isYearPart,i);break;case"h":i=t.isHourPart?(t.maskDateValue.getHours()%12||12).toString():t.defaultConstant.hour.toString(),2===t.hourTypeCount&&(t.isNavigate=!0,t.hourTypeCount=0);break;case"hh":i=t.isHourPart?t.roundOff(t.maskDateValue.getHours()%12||12,2):t.defaultConstant.hour.toString(),2===t.hourTypeCount&&(t.isNavigate=!0,t.hourTypeCount=0);break;case"H":i=t.isHourPart?t.maskDateValue.getHours().toString():t.defaultConstant.hour.toString(),2===t.hourTypeCount&&(t.isNavigate=!0,t.hourTypeCount=0);break;case"HH":i=t.isHourPart?t.roundOff(t.maskDateValue.getHours(),2):t.defaultConstant.hour.toString(),2===t.hourTypeCount&&(t.isNavigate=!0,t.hourTypeCount=0);break;case"m":i=t.isMinutePart?t.maskDateValue.getMinutes().toString():t.defaultConstant.minute.toString(),2===t.minuteTypeCount&&(t.isNavigate=!0,t.minuteTypeCount=0);break;case"mm":i=t.isMinutePart?t.roundOff(t.maskDateValue.getMinutes(),2):t.defaultConstant.minute.toString(),2===t.minuteTypeCount&&(t.isNavigate=!0,t.minuteTypeCount=0);break;case"s":i=t.isSecondsPart?t.maskDateValue.getSeconds().toString():t.defaultConstant.second.toString(),2===t.secondTypeCount&&(t.isNavigate=!0,t.secondTypeCount=0);break;case"ss":i=t.isSecondsPart?t.roundOff(t.maskDateValue.getSeconds(),2):t.defaultConstant.second.toString(),2===t.secondTypeCount&&(t.isNavigate=!0,t.secondTypeCount=0);break;case"f":i=Math.floor(t.maskDateValue.getMilliseconds()/100).toString();break;case"ff":s=t.maskDateValue.getMilliseconds(),t.maskDateValue.getMilliseconds()>99&&(s=Math.floor(t.maskDateValue.getMilliseconds()/10)),i=t.roundOff(s,2);break;case"fff":i=t.roundOff(t.maskDateValue.getMilliseconds(),3);break;case"a":case"aa":i=t.maskDateValue.getHours()<12?c[m[0]]:c[m[1]];break;case"z":case"zz":case"zzz":case"zzzz":a={format:e,type:"dateTime",skeleton:"yMd",calendar:t.parent.calendarMode},i=t.parent.globalize.formatDate(t.maskDateValue,a)}if(i=void 0!==i?i:e.slice(1,e.length-1),t.isHiddenMask){for(var f="",v=0;v<i.length;v++)f+=e[0];return f}return i}var t=this;return e},e.prototype.maskInputHandler=function(){var e=this.parent.inputElement.selectionStart,t="";-1!==this.validCharacters.indexOf(this.hiddenMask[e])&&(t=this.hiddenMask[e]),this.differenceCheck();var i=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,this.parent.inputElement.value=i;for(var s=0;s<this.hiddenMask.length;s++)if(t===this.hiddenMask[s]){e=s;break}if(this.parent.inputElement.selectionStart=e,this.validCharacterCheck(),(this.isNavigate||this.isDeletion)&&!this.isDeleteKey){var a=!this.isNavigate;this.isNavigate=this.isDeletion=!1,this.navigateSelection(a)}this.isDeleteKey&&(this.isDeletion=!1),this.isDeleteKey=!1},e.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&&s>=0;){if(this.validCharacters.indexOf(this.hiddenMask[s])>=0){this.setSelection(this.hiddenMask[s]);break}s+=e?-1:1}},e.prototype.roundOff=function(e,t){for(var i=e.toString(),s=t-i.length,a="",n=0;n<s;n++)a+="0";return a+i},e.prototype.zeroCheck=function(e,t,i){var s=i;return e&&!t&&(s="0"),s},e.prototype.handleDeletion=function(e,t){switch(e){case"d":this.isDayPart=t;break;case"M":this.isMonthPart=t,t||(this.maskDateValue.setMonth(0),this.monthCharacter="");break;case"y":this.isYearPart=t;break;case"H":case"h":this.isHourPart=t,t||(this.periodCharacter="");break;case"m":this.isMinutePart=t;break;case"s":this.isSecondsPart=t;break;default:return!1}return!0},e.prototype.dateAlteration=function(e){var t=this.parent.inputElement.selectionStart,i="";if(-1!==this.validCharacters.indexOf(this.hiddenMask[t])){i=this.hiddenMask[t];var s=new Date(this.maskDateValue.getFullYear(),this.maskDateValue.getMonth(),this.maskDateValue.getDate(),this.maskDateValue.getHours(),this.maskDateValue.getMinutes(),this.maskDateValue.getSeconds());this.previousDate=new Date(this.maskDateValue.getFullYear(),this.maskDateValue.getMonth(),this.maskDateValue.getDate(),this.maskDateValue.getHours(),this.maskDateValue.getMinutes(),this.maskDateValue.getSeconds());var a=e?-1:1;switch(i){case"d":s.setDate(s.getDate()+a);break;case"M":var n=s.getMonth()+a;if(s.setDate(1),s.setMonth(n),this.isDayPart){var r=new Date(this.previousDate.getFullYear(),this.previousDate.getMonth()+1,0).getDate(),l=new Date(s.getFullYear(),s.getMonth()+1,0).getDate();this.previousDate.getDate()===r&&l<=r?s.setDate(l):s.setDate(this.previousDate.getDate())}else 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=s.getFullYear()>0?s:this.maskDateValue,-1!==this.validCharacters.indexOf(this.hiddenMask[t])&&this.handleDeletion(this.hiddenMask[t],!0)}},e.prototype.getCulturedValue=function(e){var t=this.parent.locale;return"en"===t||"en-US"===t?i.i(s.getValue)(e,i.i(s.getDefaultDateObject)()):i.i(s.getValue)("main."+t+".dates.calendars.gregorian."+e,s.cldrData)},e.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)),"timepicker"===this.parent.moduleName&&(e=this.parent.cldrTimeFormat()),e},e.prototype.clearHandler=function(){this.isDayPart=this.isMonthPart=this.isYearPart=this.isHourPart=this.isMinutePart=this.isSecondsPart=!1,this.updateValue()},e.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)},e.prototype.destroy=function(){this.removeEventListener()},e}())},function(e,t){e.exports=a}])});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionBase"),require("SyncfusionInputs"),require("SyncfusionPopups"),require("SyncfusionLists"),require("SyncfusionButtons")):"function"==typeof define&&define.amd?define(["SyncfusionBase","SyncfusionInputs","SyncfusionPopups","SyncfusionLists","SyncfusionButtons"],t):"object"==typeof exports?exports.SyncfusionCalendars=t(require("SyncfusionBase"),require("SyncfusionInputs"),require("SyncfusionPopups"),require("SyncfusionLists"),require("SyncfusionButtons")):e.SyncfusionCalendars=t(e.SyncfusionBase,e.SyncfusionInputs,e.SyncfusionPopups,e.SyncfusionLists,e.SyncfusionButtons)}(this,function(e,t,i,s,a){return function(e){function t(s){if(i[s])return i[s].exports;var a=i[s]={i:s,l:!1,exports:{}};return e[s].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var i={};return t.m=e,t.c=i,t.i=function(e){return e},t.d=function(e,i,s){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:s})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=16)}([function(t,i){t.exports=e},function(e,i){e.exports=t},function(e,t){e.exports=i},function(e,t,i){"use strict";i.d(t,"b",function(){return p}),i.d(t,"a",function(){return c});var s=i(0),a=(i.n(s),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}()),n=this&&this.__decorate||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;l>=0;l--)(a=e[l])&&(r=(n<3?a(r):n>3?a(t,i,r):a(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},r="e-other-month",l="e-calendar",o="e-disabled",h="e-overlay",u="e-selected",d="e-focused-date",p=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.effect="",s.isPopupClicked=!1,s.isDateSelected=!0,s.isTodayClicked=!1,s.preventChange=!1,s.isAngular=!1,s.previousDates=!1,s}return a(t,e),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(1944,2,18)),+this.max==+new Date(2099,11,31)&&(this.max=new Date(2069,10,16))),this.globalize=new s.Internationalization(this.locale),(i.i(s.isNullOrUndefined)(this.firstDayOfWeek)||this.firstDayOfWeek>6||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(l),this.enableRtl&&this.element.classList.add("e-rtl"),s.Browser.isDevice&&this.element.classList.add("e-device"),i.i(s.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(l),this.enableRtl&&this.calendarElement.classList.add("e-rtl"),s.Browser.isDevice&&this.calendarElement.classList.add("e-device"),i.i(s.attributes)(this.calendarElement,{"data-role":"calendar"})),!i.i(s.isNullOrUndefined)(i.i(s.closest)(this.element,"fieldset"))&&i.i(s.closest)(this.element,"fieldset").disabled&&(this.enabled=!1),this.createHeader(),this.createContent(),this.wireEvents()},t.prototype.rangeValidation=function(e,t){i.i(s.isNullOrUndefined)(e)&&this.setProperties({min:new Date(1900,0,1)},!0),i.i(s.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?this.currentDate:new Date((new Date).setHours(0,0,0,0)),!i.i(s.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,a,n){if(n&&!i.i(s.isNullOrUndefined)(t)&&!i.i(s.isNullOrUndefined)(a)&&!i.i(s.isNullOrUndefined)(e)){var r=parseInt(t.style.zIndex,10)?parseInt(t.style.zIndex,10):1e3;a.style.zIndex=(r-1).toString(),e.style.zIndex=r.toString()}},t.prototype.minMaxUpdate=function(e){+this.min<=+this.max?i.i(s.removeClass)([this.element],h):(this.setProperties({min:this.min},!0),i.i(s.addClass)([this.element],h)),this.min=i.i(s.isNullOrUndefined)(this.min)||!+this.min?this.min=new Date(1900,0,1):this.min,this.max=i.i(s.isNullOrUndefined)(this.max)||!+this.max?this.max=new Date(2099,11,31):this.max,+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={"aria-disabled":"false","aria-label":"previous month"},t={"aria-disabled":"false","aria-label":"next month"},a={"aria-atomic":"true","aria-live":"assertive","aria-label":"title"};this.headerElement=this.createElement("div",{className:"e-header"});var n=this.createElement("div",{className:"e-icon-container"});this.previousIcon=this.createElement("button",{className:"e-prev",attrs:{type:"button"}}),i.i(s.rippleEffect)(this.previousIcon,{duration:400,selector:".e-prev",isCenterRipple:!0}),i.i(s.attributes)(this.previousIcon,e),this.nextIcon=this.createElement("button",{className:"e-next",attrs:{type:"button"}}),i.i(s.rippleEffect)(this.nextIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),"daterangepicker"===this.getModuleName()&&(i.i(s.attributes)(this.previousIcon,{tabIndex:"-1"}),i.i(s.attributes)(this.nextIcon,{tabIndex:"-1"})),i.i(s.attributes)(this.nextIcon,t),this.headerTitleElement=this.createElement("div",{className:"e-day e-title"}),i.i(s.attributes)(this.headerTitleElement,a),this.headerElement.appendChild(this.headerTitleElement),this.previousIcon.appendChild(this.createElement("span",{className:"e-date-icon-prev e-icons"})),this.nextIcon.appendChild(this.createElement("span",{className:"e-date-icon-next e-icons"})),n.appendChild(this.previousIcon),n.appendChild(this.nextIcon),this.headerElement.appendChild(n),"calendar"===this.getModuleName()?this.element.appendChild(this.headerElement):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:{tabIndex:"0",role:"grid","aria-activedescendant":"","aria-labelledby":this.element.id}}),"calendar"===this.getModuleName()?this.element.appendChild(this.contentElement):this.calendarElement.appendChild(this.contentElement),this.contentElement.appendChild(this.table),this.createContentHeader(),this.createContentBody(),this.showTodayButton&&this.createContentFooter()},t.prototype.getCultureValues=function(){var e,t=[],a="days.stand-alone."+this.dayHeaderFormat.toLowerCase();if(e="en"===this.locale||"en-US"===this.locale?i.i(s.getValue)(a,i.i(s.getDefaultDateObject)()):this.getCultureObjects(s.cldrData,""+this.locale),!i.i(s.isNullOrUndefined)(e))for(var n=0,r=Object.keys(e);n<r.length;n++){var l=r[n];t.push(i.i(s.getValue)(l,e))}return t},t.prototype.toCapitalize=function(e){return!i.i(s.isNullOrUndefined)(e)&&e.length?e[0].toUpperCase()+e.slice(1):e},t.prototype.createContentHeader=function(){"calendar"===this.getModuleName()?i.i(s.isNullOrUndefined)(this.element.querySelectorAll(".e-content .e-week-header")[0])||i.i(s.detach)(this.element.querySelectorAll(".e-content .e-week-header")[0]):i.i(s.isNullOrUndefined)(this.calendarElement.querySelectorAll(".e-content .e-week-header")[0])||i.i(s.detach)(this.calendarElement.querySelectorAll(".e-content .e-week-header")[0]);var e="";(this.firstDayOfWeek>6||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"></th>',"calendar"===this.getModuleName()?i.i(s.addClass)([this.element],"e-week-number"):i.i(s.addClass)([this.calendarElement],"e-week-number"));var t=this.getCultureValues().length>0&&this.getCultureValues()?this.shiftArray(this.getCultureValues().length>0&&this.getCultureValues(),this.firstDayOfWeek):null;if(!i.i(s.isNullOrUndefined)(t))for(var a=0;a<=6;a++)e+='<th class="">'+this.toCapitalize(t[a])+"</th>";e="<tr>"+e+"</tr>",this.tableHeadElement.innerHTML=e,this.table.appendChild(this.tableHeadElement)},t.prototype.createContentBody=function(){switch("calendar"===this.getModuleName()?i.i(s.isNullOrUndefined)(this.element.querySelectorAll(".e-content tbody")[0])||i.i(s.detach)(this.element.querySelectorAll(".e-content tbody")[0]):i.i(s.isNullOrUndefined)(this.calendarElement.querySelectorAll(".e-content tbody")[0])||i.i(s.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"))},t.prototype.createContentFooter=function(){if(this.showTodayButton){var e=new Date(+this.min),t=new Date(+this.max),a={today:"Today"};this.globalize=new s.Internationalization(this.locale),this.l10=new s.L10n(this.getModuleName(),a,this.locale),this.todayElement=this.createElement("button",{attrs:{role:"button"}}),i.i(s.rippleEffect)(this.todayElement),this.updateFooter(),i.i(s.addClass)([this.todayElement],["e-btn","e-today","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||i.i(s.addClass)([this.todayElement],o),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(o)||s.EventHandler.add(this.todayElement,"click",this.todayButtonClick,this)}},t.prototype.wireEvents=function(e,t,a,n){s.EventHandler.add(this.headerTitleElement,"click",this.navigateTitle,this),this.defaultKeyConfigs=i.i(s.extend)(this.defaultKeyConfigs,this.keyConfigs),"calendar"===this.getModuleName()?this.keyboardModule=new s.KeyboardEvents(this.element,{eventName:"keydown",keyAction:this.keyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs}):this.keyboardModule=new s.KeyboardEvents(this.calendarElement,{eventName:"keydown",keyAction:this.keyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})},t.prototype.dateWireEvents=function(e,t,a,n){this.defaultKeyConfigs=this.getDefaultKeyConfig(),this.defaultKeyConfigs=i.i(s.extend)(this.defaultKeyConfigs,a),this.serverModuleName=n},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&&i.i(s.detach)(this.calendarElement),this.tableBodyElement&&i.i(s.detach)(this.tableBodyElement),this.table&&i.i(s.detach)(this.table),this.tableHeadElement&&i.i(s.detach)(this.tableHeadElement),this.nextIcon&&i.i(s.detach)(this.nextIcon),this.previousIcon&&i.i(s.detach)(this.previousIcon),this.footer&&i.i(s.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,a){var n,r=this.tableBodyElement.querySelector("tr td.e-focused-date");n=a?i.i(s.isNullOrUndefined)(r)||+t!==parseInt(r.getAttribute("id").split("_")[0],10)?this.tableBodyElement.querySelector("tr td.e-selected"):r:this.tableBodyElement.querySelector("tr td.e-selected");var l=this.getViewNumber(this.currentView()),h=this.getViewNumber(this.depth),u=l===h&&this.getViewNumber(this.start)>=h;switch(this.effect="",e.action){case"moveLeft":this.keyboardNavigate(-1,l,e,this.max,this.min),e.preventDefault();break;case"moveRight":this.keyboardNavigate(1,l,e,this.max,this.min),e.preventDefault();break;case"moveUp":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":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":if(e.target===this.todayElement)this.todayButtonClick(e,t);else{var d=i.i(s.isNullOrUndefined)(r)?n:r;if(!i.i(s.isNullOrUndefined)(d)&&!d.classList.contains(o))if(u){var p=new Date(parseInt(""+d.id,0));this.selectDate(e,p,d)}else this.contentClick(null,--l,d,t)}break;case"controlUp":this.title(),e.preventDefault();break;case"controlDown":(i.i(s.isNullOrUndefined)(r)||u)&&(i.i(s.isNullOrUndefined)(n)||u)||this.contentClick(null,--l,r||n,t),e.preventDefault();break;case"home":this.currentDate=this.firstDay(this.currentDate),i.i(s.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),i.i(s.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()}"calendar"===this.getModuleName()&&this.table.focus()},t.prototype.keyboardNavigate=function(e,t,a,n,r){var l=new Date(this.checkValue(this.currentDate));switch(t){case 2:this.addYears(this.currentDate,e),this.isMonthYearRange(this.currentDate)?(i.i(s.detach)(this.tableBodyElement),this.renderDecades(a)):this.currentDate=l;break;case 1:this.addMonths(this.currentDate,e),this.calendarMode,this.isMonthYearRange(this.currentDate)?(i.i(s.detach)(this.tableBodyElement),this.renderYears(a)):this.currentDate=l;break;case 0:this.addDay(this.currentDate,e,a,n,r),this.isMinMaxRange(this.currentDate)?(i.i(s.detach)(this.tableBodyElement),this.renderMonths(a)):this.currentDate=l}},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<+this.min&&(e=new Date(+this.min)),+e>+this.max&&(e=new Date(+this.max))),e},t.prototype.renderMonths=function(e,t,i){var s,a=this.weekNumber?8:7;s="Gregorian"===this.calendarMode?this.renderDays(this.currentDate,t,null,null,i,e):this.islamicModule.islamicRenderDays(this.currentDate,t),this.createContentHeader(),"Gregorian"===this.calendarMode?this.renderTemplate(s,a,"e-month",e,t):this.islamicModule.islamicRenderTemplate(s,a,"e-month",e,t)},t.prototype.renderDays=function(e,t,a,n,l,d){var p,c=[],m=l?new Date(+e):this.getDate(new Date,this.timezone),f=new Date(this.checkValue(e)),v=f.getMonth();this.titleUpdate(e,"days");var y=f;for(f=new Date(y.getFullYear(),y.getMonth(),0,y.getHours(),y.getMinutes(),y.getSeconds(),y.getMilliseconds());f.getDay()!==this.firstDayOfWeek;)this.setStartDate(f,-864e5);for(var g=0;g<42;++g){var b=this.createElement("td",{className:"e-cell"}),D=this.createElement("span");if(g%7==0&&this.weekNumber){var C="FirstDay"===this.weekRule?6:"FirstFourDayWeek"===this.weekRule?3:0,E=new Date(f.getFullYear(),f.getMonth(),f.getDate()+C);D.textContent=""+this.getWeek(E),b.appendChild(D),i.i(s.addClass)([b],"e-week-number"),c.push(b)}p=new Date(+f),f=this.minMaxDate(f);var k={type:"dateTime",skeleton:"full"},w=this.globalize.parseDate(this.globalize.formatDate(f,k),k),V=this.dayCell(f),M=this.globalize.formatDate(f,{type:"date",skeleton:"full"}),O=this.createElement("span");O.textContent=this.globalize.formatDate(f,{format:"d",type:"date",skeleton:"yMd"});var N=this.min>f||this.max<f;N?(i.i(s.addClass)([V],o),i.i(s.addClass)([V],h)):O.setAttribute("title",""+M),v!==f.getMonth()&&i.i(s.addClass)([V],r),0!==f.getDay()&&6!==f.getDay()||i.i(s.addClass)([V],"e-weekend"),V.appendChild(O),this.renderDayCellArgs={date:f,isDisabled:!1,element:V,isOutOfRange:N};var I=this.renderDayCellArgs;if(this.renderDayCellEvent(I),I.isDisabled){var T=new Date(this.checkValue(t)),x=new Date(this.checkValue(I.date));if(a){if(!i.i(s.isNullOrUndefined)(n)&&n.length>0)for(var S=0;S<n.length;S++){var P=+new Date(this.globalize.formatDate(I.date,{type:"date",skeleton:"yMd"})),A=+new Date(this.globalize.formatDate(n[S],{type:"date",skeleton:"yMd"}));P===A&&(n.splice(S,1),S=-1)}}else T&&+T==+x&&this.setProperties({value:null},!0)}this.renderDayCellArgs.isDisabled&&!V.classList.contains(u)&&(i.i(s.addClass)([V],o),i.i(s.addClass)([V],h),+this.renderDayCellArgs.date==+this.todayDate&&(this.todayDisabled=!0));var U=V.classList.contains(r),H=V.classList.contains(o);H||s.EventHandler.add(V,"click",this.clickHandler,this);var W=void 0;if(i.i(s.isNullOrUndefined)(d)||"click"!==d.type||(W=d.currentTarget),!a||i.i(s.isNullOrUndefined)(n)||H)!H&&this.getDateVal(f,t)&&i.i(s.addClass)([V],u);else{for(var L=0;L<n.length;L++){var F="Gregorian"===this.calendarMode?"gregorian":"islamic",B={format:null,type:"date",skeleton:"short",calendar:F},P=this.globalize.formatDate(f,B),A=this.globalize.formatDate(n[L],B);if((P===A&&this.getDateVal(f,n[L])||this.getDateVal(f,t))&&i.i(s.addClass)([V],u),!i.i(s.isNullOrUndefined)(W)&&W.innerText===V.innerText&&this.previousDates&&V.classList.contains(u)&&W.classList.contains(u)){i.i(s.removeClass)([V],u),this.previousDates=!1;for(var j=this.copyValues(n),Y=0;Y<j.length;Y++){var R="Gregorian"===this.calendarMode?"gregorian":"islamic",z={format:null,type:"date",skeleton:"short",calendar:R};if(this.globalize.formatDate(w,z)===this.globalize.formatDate(j[Y],z)){var S=j.indexOf(j[Y]);j.splice(S,1),n.splice(S,1)}}this.setProperties({values:j},!0)}else this.updateFocus(U,H,f,V,e)}n.length<=0&&this.updateFocus(U,H,f,V,e)}this.updateFocus(U,H,f,V,e),i.i(s.isNullOrUndefined)(w)||w.getFullYear()!==m.getFullYear()||w.getMonth()!==m.getMonth()||w.getDate()!==m.getDate()||i.i(s.addClass)([V],"e-today"),c.push(this.renderDayCellArgs.element),f=new Date(+p),this.addDay(f,1,null,this.max,this.min)}return c},t.prototype.updateFocus=function(e,t,a,n,r){r.getDate()!==a.getDate()||e||t?(r>=this.max&&parseInt(n.id,0)===+this.max&&!e&&!t&&i.i(s.addClass)([n],d),r<=this.min&&parseInt(n.id,0)===+this.min&&!e&&!t&&i.i(s.addClass)([n],d)):i.i(s.addClass)([n],d)},t.prototype.renderYears=function(e,t){this.removeTableHeadElement();var a=[],n=i.i(s.isNullOrUndefined)(t),r=new Date(this.checkValue(this.currentDate)),l=r.getMonth(),h=r.getFullYear(),p=r,c=p.getFullYear(),m=new Date(this.checkValue(this.min)).getFullYear(),f=new Date(this.checkValue(this.min)).getMonth(),v=new Date(this.checkValue(this.max)).getFullYear(),y=new Date(this.checkValue(this.max)).getMonth();p.setMonth(0),this.titleUpdate(this.currentDate,"months"),p.setDate(1);for(var g=0;g<12;++g){var b=this.dayCell(p),D=this.createElement("span"),C=t&&t.getMonth()===p.getMonth(),E=t&&t.getFullYear()===h&&C;D.textContent=this.toCapitalize(this.globalize.formatDate(p,{format:null,type:"dateTime",skeleton:"MMM"})),this.min&&(c<m||g<f&&c===m)||this.max&&(c>v||g>y&&c>=v)?i.i(s.addClass)([b],o):!n&&E?i.i(s.addClass)([b],u):p.getMonth()===l&&this.currentDate.getMonth()===l&&i.i(s.addClass)([b],d),p.setDate(1),p.setMonth(p.getMonth()+1),b.classList.contains(o)||s.EventHandler.add(b,"click",this.clickHandler,this),b.appendChild(D),a.push(b)}this.renderTemplate(a,4,"e-year",e,t)},t.prototype.renderDecades=function(e,t){this.removeTableHeadElement();var a=[],n=new Date(this.checkValue(this.currentDate));n.setMonth(0),n.setDate(1);var r=n.getFullYear(),l=new Date(n.setFullYear(r-r%10)),h=new Date(n.setFullYear(r-r%10+9)),p=l.getFullYear(),c=h.getFullYear(),m=this.globalize.formatDate(l,{format:null,type:"dateTime",skeleton:"y"}),f=this.globalize.formatDate(h,{format:null,type:"dateTime",skeleton:"y"});this.headerTitleElement.textContent=m+" - "+f;for(var v=new Date(r-r%10-1,0,1),y=v.getFullYear(),g=0;g<12;++g){var b=y+g;n.setFullYear(b);var D=this.dayCell(n),C=this.createElement("span");C.textContent=this.globalize.formatDate(n,{format:null,type:"dateTime",skeleton:"y"}),b<p||b>c?(i.i(s.addClass)([D],"e-other-year"),i.i(s.isNullOrUndefined)(t)||n.getFullYear()!==t.getFullYear()||i.i(s.addClass)([D],u),(b<new Date(this.checkValue(this.min)).getFullYear()||b>new Date(this.checkValue(this.max)).getFullYear())&&i.i(s.addClass)([D],o)):b<new Date(this.checkValue(this.min)).getFullYear()||b>new Date(this.checkValue(this.max)).getFullYear()?i.i(s.addClass)([D],o):i.i(s.isNullOrUndefined)(t)||n.getFullYear()!==t.getFullYear()?n.getFullYear()!==this.currentDate.getFullYear()||D.classList.contains(o)||i.i(s.addClass)([D],d):i.i(s.addClass)([D],u),D.classList.contains(o)||s.EventHandler.add(D,"click",this.clickHandler,this),D.appendChild(C),a.push(D)}this.renderTemplate(a,4,"e-decade",e,t)},t.prototype.dayCell=function(e){var t,a="Gregorian"===this.calendarMode?"gregorian":"islamic",n={skeleton:"full",type:"dateTime",calendar:a},r=this.globalize.parseDate(this.globalize.formatDate(e,n),n);i.i(s.isNullOrUndefined)(r)||(t=r.valueOf());var l={className:"e-cell",attrs:{id:""+i.i(s.getUniqueID)(""+t),"aria-selected":"false"}};return this.createElement("td",l)},t.prototype.firstDay=function(e){var t="Decade"!==this.currentView()?this.tableBodyElement.querySelectorAll("td:not(."+r):this.tableBodyElement.querySelectorAll("td:not(.e-other-year");if(t.length)for(var i=0;i<t.length;i++)if(!t[i].classList.contains(o)){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);if(2!==t){var s=Math.abs(i.getTimezoneOffset()-this.firstDay(e).getTimezoneOffset());return s&&i.setHours(this.firstDay(e).getHours()+s/60),this.findLastDay(i)}return this.findLastDay(this.firstDay(i))},t.prototype.checkDateValue=function(e){return!i.i(s.isNullOrUndefined)(e)&&e instanceof Date&&!isNaN(+e)?e:null},t.prototype.findLastDay=function(e){var t="Decade"===this.currentView()?this.tableBodyElement.querySelectorAll("td:not(.e-other-year"):this.tableBodyElement.querySelectorAll("td:not(."+r);if(t.length)for(var i=t.length-1;i>=0;i--)if(!t[i].classList.contains(o)){e=new Date(parseInt(t[i].id,0));break}return e},t.prototype.removeTableHeadElement=function(){"calendar"===this.getModuleName()?i.i(s.isNullOrUndefined)(this.element.querySelectorAll(".e-content table thead")[0])||i.i(s.detach)(this.tableHeadElement):i.i(s.isNullOrUndefined)(this.calendarElement.querySelectorAll(".e-content table thead")[0])||i.i(s.detach)(this.tableHeadElement)},t.prototype.renderTemplate=function(e,t,a,n,l){var o,h=this.getViewNumber(this.currentView());this.tableBodyElement=this.createElement("tbody"),this.table.appendChild(this.tableBodyElement),i.i(s.removeClass)([this.contentElement,this.headerElement],["e-month","e-decade","e-year"]),i.i(s.addClass)([this.contentElement,this.headerElement],[a]);for(var u=t,d=0,p=0;p<e.length/t;++p){for(o=this.createElement("tr"),d=0+d;d<u;d++)e[d].classList.contains("e-week-number")||i.i(s.isNullOrUndefined)(e[d].children[0])||(i.i(s.addClass)([e[d].children[0]],["e-day"]),i.i(s.rippleEffect)(e[d].children[0],{duration:600,isCenterRipple:!0})),o.appendChild(e[d]),this.weekNumber&&7===d&&e[7].classList.contains(r)&&i.i(s.addClass)([o],"e-month-hide"),!this.weekNumber&&6===d&&e[6].classList.contains(r)&&i.i(s.addClass)([o],"e-month-hide"),this.weekNumber?41===d&&e[41].classList.contains(r)&&i.i(s.addClass)([o],"e-month-hide"):35===d&&e[35].classList.contains(r)&&i.i(s.addClass)([o],"e-month-hide");u+=t,d+=0,this.tableBodyElement.appendChild(o)}this.table.querySelector("tbody").className=this.effect,"Gregorian"===this.calendarMode?this.iconHandler():this.islamicModule.islamicIconHandler(),(h!==this.getViewNumber(this.currentView())||0===h&&h!==this.getViewNumber(this.currentView()))&&this.navigateHandler(n),this.setAriaActiveDescendant()},t.prototype.clickHandler=function(e,t){this.clickEventEmitter(e);var i=e.currentTarget,s=this.getViewNumber(this.currentView());i.classList.contains(r)?this.contentClick(e,0,null,t):s===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth)?this.contentClick(e,1,null,t):2===s?this.contentClick(e,1,null,t):i.classList.contains(r)||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,a,n){var r=this.getViewNumber(this.currentView()),l=this.getIdValue(e,a);switch(t){case 0:r===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth)?(i.i(s.detach)(this.tableBodyElement),this.currentDate=l,this.effect="e-zoomin",this.renderMonths(e)):("Gregorian"===this.calendarMode?(this.currentDate.setMonth(l.getMonth()),l.getMonth()>0&&this.currentDate.getMonth()!==l.getMonth()&&this.currentDate.setDate(0),this.currentDate.setFullYear(l.getFullYear())):this.currentDate=l,this.effect="e-zoomin",i.i(s.detach)(this.tableBodyElement),this.renderMonths(e));break;case 1:if(r===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth))this.selectDate(e,l,null);else{if("Gregorian"===this.calendarMode)this.currentDate.setFullYear(l.getFullYear());else{this.islamicPreviousHeader=this.headerElement.textContent;var o=this.islamicModule.getIslamicDate(l);this.currentDate=this.islamicModule.toGregorian(o.year,o.month,1)}this.effect="e-zoomin",i.i(s.detach)(this.tableBodyElement),this.renderYears(e)}}},t.prototype.switchView=function(e,t,a,n){switch(e){case 0:i.i(s.detach)(this.tableBodyElement),this.renderMonths(t,null,n);break;case 1:i.i(s.detach)(this.tableBodyElement),this.renderYears(t);break;case 2:i.i(s.detach)(this.tableBodyElement),this.renderDecades(t)}},t.prototype.getModuleName=function(){return"calendar"},t.prototype.requiredModules=function(){var e=[];return this&&e.push({args:[this],member:"islamic"}),e},t.prototype.getPersistData=function(){var e=["value"];return this.addOnPersist(e)},t.prototype.onPropertyChanged=function(e,t,a,n){this.effect="";for(var r=0,l=Object.keys(e);r<l.length;r++){var h=l[r];switch(h){case"enableRtl":e.enableRtl?"calendar"===this.getModuleName()?this.element.classList.add("e-rtl"):this.calendarElement.classList.add("e-rtl"):"calendar"===this.getModuleName()?this.element.classList.remove("e-rtl"):this.calendarElement.classList.remove("e-rtl");break;case"dayHeaderFormat":this.getCultureValues(),"datepicker"!==this.getModuleName()?this.createContentHeader():this.calendarElement&&this.createContentHeader(),this.adjustLongHeaderSize();break;case"min":case"max":this.rangeValidation(this.min,this.max),"min"===h?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&&i.i(s.detach)(this.tableBodyElement),this.minMaxUpdate(),a&&this.validateValues(a,n),"datepicker"!==this.getModuleName()?this.createContentBody():this.calendarElement&&this.createContentBody(),(this.todayDate<this.min||this.max<this.todayDate)&&this.footer&&this.todayElement?(i.i(s.detach)(this.todayElement),i.i(s.detach)(this.footer),this.todayElement=this.footer=null,this.createContentFooter()):this.footer&&this.todayElement&&this.todayElement.classList.contains("e-disabled")&&(i.i(s.removeClass)([this.todayElement],o),i.i(s.detach)(this.todayElement),i.i(s.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.createContentHeader(),this.createContentBody()):this.calendarElement&&(this.createContentHeader(),this.createContentBody());break;case"locale":this.globalize=new s.Internationalization(this.locale),"datepicker"!==this.getModuleName()?(this.createContentHeader(),this.createContentBody()):this.calendarElement&&(this.createContentHeader(),this.createContentBody()),this.l10.setLocale(this.locale),this.updateFooter();break;case"showTodayButton":e.showTodayButton?this.createContentFooter():i.i(s.isNullOrUndefined)(this.todayElement)||i.i(s.isNullOrUndefined)(this.footer)||(i.i(s.detach)(this.todayElement),i.i(s.detach)(this.footer),this.todayElement=this.footer=void 0),this.setProperties({showTodayButton:e.showTodayButton},!0)}}},t.prototype.validateValues=function(e,t){if(e&&!i.i(s.isNullOrUndefined)(t)&&t.length>0){for(var a=this.copyValues(t),n=0;n<a.length;n++){var r=a[n],l="Gregorian"===this.calendarMode?"gregorian":"islamic",o=void 0;o="Gregorian"===this.calendarMode?this.globalize.formatDate(r,{type:"date",skeleton:"yMd"}):this.globalize.formatDate(r,{type:"dateTime",skeleton:"full",calendar:"islamic"});var h={type:"date",skeleton:"yMd",calendar:l},u=this.globalize.formatDate(this.min,h),d=u,p={type:"date",skeleton:"yMd",calendar:l},c=this.globalize.formatDate(this.max,p),m=c;(+new Date(o)<+new Date(d)||+new Date(o)>+new Date(m))&&(a.splice(n,1),n=-1)}this.setProperties({values:a},!0)}},t.prototype.setValueUpdate=function(){i.i(s.isNullOrUndefined)(this.tableBodyElement)||(i.i(s.detach)(this.tableBodyElement),this.setProperties({start:this.currentView()},!0),this.createContentBody())},t.prototype.copyValues=function(e){var t=[];if(!i.i(s.isNullOrUndefined)(e)&&e.length>0)for(var a=0;a<e.length;a++)t.push(new Date(+e[a]));return t},t.prototype.titleUpdate=function(e,t){var i,a,n=new s.Internationalization(this.locale),r="Gregorian"===this.calendarMode?"gregorian":"islamic";switch("Gregorian"===this.calendarMode?(i=n.formatDate(e,{type:"dateTime",skeleton:"yMMMM",calendar:r}),a=n.formatDate(e,{format:null,type:"dateTime",skeleton:"y",calendar:r})):(i=n.formatDate(e,{type:"dateTime",format:"MMMM y",calendar:r}),a=n.formatDate(e,{type:"dateTime",format:"y",calendar:r})),t){case"days":this.headerTitleElement.textContent=this.toCapitalize(i);break;case"months":this.headerTitleElement.textContent=a}},t.prototype.setActiveDescendant=function(){var e,t,a=this.tableBodyElement.querySelector("tr td.e-focused-date"),n=this.tableBodyElement.querySelector("tr td.e-selected"),r="Gregorian"===this.calendarMode?"gregorian":"islamic",l=this.currentView();return t="Month"===l?this.globalize.formatDate(this.currentDate,{type:"date",skeleton:"full",calendar:r}):"Year"===l?"islamic"!==r?this.globalize.formatDate(this.currentDate,{type:"date",skeleton:"yMMMM",calendar:r}):this.globalize.formatDate(this.currentDate,{type:"date",skeleton:"GyMMM",calendar:r}):this.globalize.formatDate(this.currentDate,{format:null,type:"date",skeleton:"y",calendar:r}),(n||a)&&(i.i(s.isNullOrUndefined)(n)||n.setAttribute("aria-selected","true"),(a||n).setAttribute("aria-label",t),e=(a||n).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(this.compareMonth(new Date(this.checkValue(this.currentDate)),this.max)>-1);break;case"Year":this.previousIconHandler(this.compareYear(new Date(this.checkValue(this.currentDate)),this.min)<1),this.nextIconHandler(this.compareYear(new Date(this.checkValue(this.currentDate)),this.max)>-1);break;case"Decade":this.previousIconHandler(this.compareDecade(new Date(this.checkValue(this.currentDate)),this.min)<1),this.nextIconHandler(this.compareDecade(new Date(this.checkValue(this.currentDate)),this.max)>-1)}},t.prototype.destroy=function(){"calendar"===this.getModuleName()&&this.element?i.i(s.removeClass)([this.element],[l]):this.calendarElement&&this.element&&i.i(s.removeClass)([this.element],[l]),"calendar"===this.getModuleName()&&this.element&&(i.i(s.isNullOrUndefined)(this.headerTitleElement)||s.EventHandler.remove(this.headerTitleElement,"click",this.navigateTitle),this.todayElement&&s.EventHandler.remove(this.todayElement,"click",this.todayButtonClick),this.previousIconHandler(!0),this.nextIconHandler(!0),this.keyboardModule.destroy(),this.element.removeAttribute("data-role"),i.i(s.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.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,e.prototype.destroy.call(this)},t.prototype.title=function(e){var t=this.getViewNumber(this.currentView());this.effect="e-zoomin",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),"calendar"===this.getModuleName()&&this.table.focus()},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){!s.Browser.isDevice&&e.preventDefault(),"Gregorian"===this.calendarMode?this.previous():this.islamicModule.islamicPrevious(),this.triggerNavigate(e),"calendar"===this.getModuleName()&&this.table.focus()},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){!s.Browser.isDevice&&e.preventDefault(),"Gregorian"===this.calendarMode?this.next():this.islamicModule.islamicNext(),this.triggerNavigate(e),"calendar"===this.getModuleName()&&this.table.focus()},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!i.i(s.isNullOrUndefined)(this.contentElement)&&this.contentElement.classList.contains("e-year")?"Year":!i.i(s.isNullOrUndefined)(this.contentElement)&&this.contentElement.classList.contains("e-decade")?"Decade":"Month"},t.prototype.getDateVal=function(e,t){return!i.i(s.isNullOrUndefined)(t)&&e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()},t.prototype.getCultureObjects=function(e,t){var a=".dates.calendars.gregorian.days.format."+this.dayHeaderFormat.toLowerCase(),n=".dates.calendars.islamic.days.format."+this.dayHeaderFormat.toLowerCase();return"Gregorian"===this.calendarMode?i.i(s.getValue)("main."+this.locale+a,e):i.i(s.getValue)("main."+this.locale+n,e)},t.prototype.getWeek=function(e){var t=new Date(this.checkValue(e)).valueOf(),i=new Date(e.getFullYear(),0,1).valueOf();return Math.ceil((t-i+864e5)/864e5/7)},t.prototype.setStartDate=function(e,t){var i=e.getTimezoneOffset(),s=new Date(e.getTime()+t),a=s.getTimezoneOffset()-i;e.setTime(s.getTime()+6e4*a)},t.prototype.addMonths=function(e,t){if("Gregorian"===this.calendarMode){var i=e.getDate();e.setDate(1),e.setMonth(e.getMonth()+t),e.setDate(Math.min(i,this.getMaxDays(e)))}else{var s=this.islamicModule.getIslamicDate(e);this.currentDate=this.islamicModule.toGregorian(s.year,s.month+t,1)}},t.prototype.addYears=function(e,t){if("Gregorian"===this.calendarMode){var i=e.getDate();e.setDate(1),e.setFullYear(e.getFullYear()+t),e.setDate(Math.min(i,this.getMaxDays(e)))}else{var s=this.islamicModule.getIslamicDate(e);this.currentDate=this.islamicModule.toGregorian(s.year+t,s.month,1)}},t.prototype.getIdValue=function(e,t){var i;i=e?e.currentTarget:t;var s="Gregorian"===this.calendarMode?"gregorian":"islamic",a={type:"dateTime",skeleton:"full",calendar:s},n=this.globalize.formatDate(new Date(parseInt(""+i.getAttribute("id"),0)),a),r=this.globalize.parseDate(n,a),l=r.valueOf()-r.valueOf()%1e3;return new Date(l)},t.prototype.adjustLongHeaderSize=function(){i.i(s.removeClass)([this.element],"e-calendar-day-header-lg"),"Wide"===this.dayHeaderFormat&&i.i(s.addClass)(["calendar"===this.getModuleName()?this.element:this.calendarElement],"e-calendar-day-header-lg")},t.prototype.selectDate=function(e,t,a,n,r){var o=a||e.currentTarget;if(this.isDateSelected=!1,"Decade"===this.currentView())this.setDateDecade(this.currentDate,t.getFullYear());else if("Year"===this.currentView())this.setDateYear(this.currentDate,t);else{if(n&&!this.checkPresentDate(t,r)){var h=this.copyValues(r);!i.i(s.isNullOrUndefined)(r)&&h.length>0?(h.push(new Date(this.checkValue(t))),this.setProperties({values:h},!0),this.setProperties({value:r[r.length-1]},!0)):this.setProperties({values:[new Date(this.checkValue(t))]},!0)}else this.setProperties({value:new Date(this.checkValue(t))},!0);this.currentDate=new Date(this.checkValue(t))}var p=i.i(s.closest)(o,"."+l);if(i.i(s.isNullOrUndefined)(p)&&(p=this.tableBodyElement),n||i.i(s.isNullOrUndefined)(p.querySelector("."+u))||i.i(s.removeClass)([p.querySelector("."+u)],u),n||i.i(s.isNullOrUndefined)(p.querySelector("."+d))||i.i(s.removeClass)([p.querySelector("."+d)],d),n){for(var h=this.copyValues(r),c=Array.prototype.slice.call(this.tableBodyElement.querySelectorAll("td")),m=0;m<c.length;m++){var f=p.querySelectorAll("td."+d)[0],v=p.querySelectorAll("td."+u)[0];c[m]===f&&i.i(s.removeClass)([c[m]],d),c[m]!==v||this.checkPresentDate(new Date(parseInt(v.getAttribute("id").split("_")[0],10)),r)||i.i(s.removeClass)([c[m]],u)}if(o.classList.contains(u)){i.i(s.removeClass)([o],u);for(var y=0;y<h.length;y++){var g="Gregorian"===this.calendarMode?"gregorian":"islamic",b={format:null,type:"date",skeleton:"short",calendar:g};if(this.globalize.formatDate(t,b)===this.globalize.formatDate(h[y],b)){var m=h.indexOf(h[y]);h.splice(m,1),i.i(s.addClass)([o],d)}}this.setProperties({values:h},!0)}else i.i(s.addClass)([o],u)}else i.i(s.addClass)([o],u);this.isDateSelected=!0},t.prototype.checkPresentDate=function(e,t){var a=!1;if(!i.i(s.isNullOrUndefined)(t))for(var n=0;n<t.length;n++){var r="Gregorian"===this.calendarMode?"gregorian":"islamic",l=this.globalize.formatDate(e,{format:null,type:"date",skeleton:"short",calendar:r}),o=this.globalize.formatDate(t[n],{format:null,type:"date",skeleton:"short",calendar:r});l===o&&(a=!0)}return a},t.prototype.setAriaActiveDescendant=function(){i.i(s.attributes)(this.table,{"aria-activedescendant":""+this.setActiveDescendant()})},t.prototype.previousIconHandler=function(e){e?i.i(s.isNullOrUndefined)(this.previousIcon)||(s.EventHandler.remove(this.previousIcon,"click",this.navigatePreviousHandler),i.i(s.addClass)([this.previousIcon],""+o),i.i(s.addClass)([this.previousIcon],""+h),this.previousIcon.setAttribute("aria-disabled","true")):(s.EventHandler.add(this.previousIcon,"click",this.navigatePreviousHandler),i.i(s.removeClass)([this.previousIcon],""+o),i.i(s.removeClass)([this.previousIcon],""+h),this.previousIcon.setAttribute("aria-disabled","false"))},t.prototype.renderDayCellEvent=function(e){i.i(s.extend)(this.renderDayCellArgs,{name:"renderDayCell"}),this.trigger("renderDayCell",e)},t.prototype.navigatedEvent=function(e){i.i(s.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?i.i(s.isNullOrUndefined)(this.previousIcon)||(s.EventHandler.remove(this.nextIcon,"click",this.navigateNextHandler),i.i(s.addClass)([this.nextIcon],o),i.i(s.addClass)([this.nextIcon],h),this.nextIcon.setAttribute("aria-disabled","true")):(s.EventHandler.add(this.nextIcon,"click",this.navigateNextHandler),i.i(s.removeClass)([this.nextIcon],o),i.i(s.removeClass)([this.nextIcon],h),this.nextIcon.setAttribute("aria-disabled","false"))},t.prototype.compare=function(e,t,i){var s,a,n=t.getFullYear();return s=n,a=0,i&&(n-=n%i,s=n-n%i+i-1),e.getFullYear()>s?a=1:e.getFullYear()<n&&(a=-1),a},t.prototype.isMinMaxRange=function(e){return+e>=+this.min&&+e<=+this.max},t.prototype.isMonthYearRange=function(e){if("Gregorian"===this.calendarMode)return e.getMonth()>=this.min.getMonth()&&e.getFullYear()>=this.min.getFullYear()&&e.getMonth()<=this.max.getMonth()&&e.getFullYear()<=this.max.getFullYear();var t=this.islamicModule.getIslamicDate(e);return t.month>=this.islamicModule.getIslamicDate(new Date(1944,1,18)).month&&t.year>=this.islamicModule.getIslamicDate(new Date(1944,1,18)).year&&t.month<=this.islamicModule.getIslamicDate(new Date(2069,1,16)).month&&t.year<=this.islamicModule.getIslamicDate(new Date(2069,1,16)).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,a,n,r){var l=t,o=new Date(+e);if(!i.i(s.isNullOrUndefined)(this.tableBodyElement)&&!i.i(s.isNullOrUndefined)(a)){for(;this.findNextTD(new Date(+e),l,n,r);)l+=t;var h=new Date(o.setDate(o.getDate()+l));l=+h>+n||+h<+r?l===t?t-t:t:l}e.setDate(e.getDate()+l)},t.prototype.findNextTD=function(e,t,a,n){var r=new Date(e.setDate(e.getDate()+t)),l=[],h=!1;if((!i.i(s.isNullOrUndefined)(r)&&r.getMonth())===(!i.i(s.isNullOrUndefined)(this.currentDate)&&this.currentDate.getMonth())){var u=void 0;u="Gregorian"===this.calendarMode?this.renderDays(r):this.islamicModule.islamicRenderDays(this.currentDate,r),l=u.filter(function(e){return e.classList.contains(o)})}else l=this.tableBodyElement.querySelectorAll("td."+o);if(+r<=+a&&+r>=+n&&l.length)for(var d=0;d<l.length&&!(h=+r==+new Date(parseInt(l[d].id,0)));d++);return h},t.prototype.getMaxDays=function(e){var t,i=new Date(this.checkValue(e));t=28;for(var s=i.getMonth();i.getMonth()===s;)++t,i.setDate(t);return t-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){return e.getFullYear()>t.getFullYear()?1:e.getFullYear()<t.getFullYear()?-1:e.getMonth()===t.getMonth()?0:e.getMonth()>t.getMonth()?1:-1},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 t&&(e=new Date(e.toLocaleString("en-US",{timeZone:t}))),e},n([i.i(s.Property)(new Date(1900,0,1))],t.prototype,"min",void 0),n([i.i(s.Property)(!0)],t.prototype,"enabled",void 0),n([i.i(s.Property)(null)],t.prototype,"cssClass",void 0),n([i.i(s.Property)(new Date(2099,11,31))],t.prototype,"max",void 0),n([i.i(s.Property)(null)],t.prototype,"firstDayOfWeek",void 0),n([i.i(s.Property)("Gregorian")],t.prototype,"calendarMode",void 0),n([i.i(s.Property)("Month")],t.prototype,"start",void 0),n([i.i(s.Property)("Month")],t.prototype,"depth",void 0),n([i.i(s.Property)(!1)],t.prototype,"weekNumber",void 0),n([i.i(s.Property)("FirstDay")],t.prototype,"weekRule",void 0),n([i.i(s.Property)(!0)],t.prototype,"showTodayButton",void 0),n([i.i(s.Property)("Short")],t.prototype,"dayHeaderFormat",void 0),n([i.i(s.Property)(!1)],t.prototype,"enablePersistence",void 0),n([i.i(s.Property)(null)],t.prototype,"keyConfigs",void 0),n([i.i(s.Property)(null)],t.prototype,"serverTimezoneOffset",void 0),n([i.i(s.Event)()],t.prototype,"created",void 0),n([i.i(s.Event)()],t.prototype,"destroyed",void 0),n([i.i(s.Event)()],t.prototype,"navigated",void 0),n([i.i(s.Event)()],t.prototype,"renderDayCell",void 0),t=n([s.NotifyPropertyChanges],t)}(s.Component),c=function(e){function t(t,i){return e.call(this,t,i)||this}return a(t,e),t.prototype.render=function(){if("Islamic"===this.calendarMode&&void 0===this.islamicModule&&i.i(s.throwError)("Requires the injectable Islamic modules to render Calendar in Islamic mode"),this.isMultiSelection&&"object"==typeof this.values&&!i.i(s.isNullOrUndefined)(this.values)&&this.values.length>0){for(var t=[],a=[],n=0;n<this.values.length;n++)-1===t.indexOf(+this.values[n])&&(t.push(+this.values[n]),a.push(this.values[n]));this.setProperties({values:a},!0);for(var r=0;r<this.values.length;r++)if(!this.checkDateValue(this.values[r]))if("string"==typeof this.values[r]&&this.checkDateValue(new Date(this.checkValue(this.values[r])))){var l=new Date(this.checkValue(this.values[r]));this.values.splice(r,1),this.values.splice(r,0,l)}else this.values.splice(r,1);this.setProperties({value:this.values[this.values.length-1]},!0),this.previousValues=this.values.length}if(this.validateDate(),this.minMaxUpdate(),"calendar"===this.getModuleName()&&(this.setEnable(this.enabled),this.setClass(this.cssClass)),e.prototype.render.call(this),"calendar"===this.getModuleName()){var o=i.i(s.closest)(this.element,"form");o&&s.EventHandler.add(o,"reset",this.formResetHandler.bind(this)),this.setTimeZone(this.serverTimezoneOffset)}this.renderComplete()},t.prototype.setEnable=function(e){e?i.i(s.removeClass)([this.element],o):i.i(s.addClass)([this.element],o)},t.prototype.setClass=function(e,t){i.i(s.isNullOrUndefined)(t)||(t=t.replace(/\s+/g," ").trim()),i.i(s.isNullOrUndefined)(e)||(e=e.replace(/\s+/g," ").trim()),i.i(s.isNullOrUndefined)(t)||""===t||i.i(s.removeClass)([this.element],t.split(" ")),i.i(s.isNullOrUndefined)(e)||i.i(s.addClass)([this.element],e.split(" "))},t.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)},t.prototype.setTimeZone=function(e){if(!i.i(s.isNullOrUndefined)(this.serverTimezoneOffset)&&this.value){var t=e,a=(new Date).getTimezoneOffset()/60,n=t+a;n=this.isDayLightSaving()?n--:n,this.value=new Date(this.value.getTime()+60*n*60*1e3)}},t.prototype.formResetHandler=function(){this.setProperties({value:null},!0)},t.prototype.validateDate=function(){"string"==typeof this.value&&this.setProperties({value:this.checkDateValue(new Date(this.checkValue(this.value)))},!0),e.prototype.validateDate.call(this,this.value),!i.i(s.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)},t.prototype.minMaxUpdate=function(){"calendar"===this.getModuleName()&&(!i.i(s.isNullOrUndefined)(this.value)&&this.value<=this.min&&this.min<=this.max?(this.setProperties({value:this.min},!0),this.changedArgs={value:this.value}):!i.i(s.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()||i.i(s.isNullOrUndefined)(this.value)?e.prototype.minMaxUpdate.call(this,this.value):!i.i(s.isNullOrUndefined)(this.value)&&this.value<this.min&&this.min<=this.max?e.prototype.minMaxUpdate.call(this,this.min):!i.i(s.isNullOrUndefined)(this.value)&&this.value>this.max&&this.min<=this.max&&e.prototype.minMaxUpdate.call(this,this.max)},t.prototype.generateTodayVal=function(t){var a=new Date;return i.i(s.isNullOrUndefined)(this.timezone)||(a=e.prototype.getDate.call(this,a,this.timezone)),t&&i.i(s.isNullOrUndefined)(this.timezone)?(a.setHours(t.getHours()),a.setMinutes(t.getMinutes()),a.setSeconds(t.getSeconds()),a.setMilliseconds(t.getMilliseconds())):a=new Date(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0,0),a},t.prototype.todayButtonClick=function(t){if(this.showTodayButton){var i=this.generateTodayVal(this.value);if(this.setProperties({value:i},!0),this.isTodayClicked=!0,this.todayButtonEvent=t,this.isMultiSelection){var s=this.copyValues(this.values);e.prototype.checkPresentDate.call(this,i,this.values)||(s.push(i),this.setProperties({values:s}))}e.prototype.todayButtonClick.call(this,t,new Date(+this.value))}},t.prototype.keyActionHandle=function(t){e.prototype.keyActionHandle.call(this,t,this.value,this.isMultiSelection)},t.prototype.preRender=function(){var t=this;this.changeHandler=function(e){t.triggerChange(e)},this.checkView(),e.prototype.preRender.call(this,this.value)},t.prototype.createContent=function(){this.previousDate=this.value,this.previousDateTime=this.value,e.prototype.createContent.call(this)},t.prototype.minMaxDate=function(t){return e.prototype.minMaxDate.call(this,t)},t.prototype.renderMonths=function(t,i,s){e.prototype.renderMonths.call(this,t,this.value,s)},t.prototype.renderDays=function(t,i,s,a,n,r){var l=e.prototype.renderDays.call(this,t,this.value,this.isMultiSelection,this.values,n,r);return this.isMultiSelection&&e.prototype.validateValues.call(this,this.isMultiSelection,this.values),l},t.prototype.renderYears=function(t){"Gregorian"===this.calendarMode?e.prototype.renderYears.call(this,t,this.value):this.islamicModule.islamicRenderYears(t,this.value)},t.prototype.renderDecades=function(t){"Gregorian"===this.calendarMode?e.prototype.renderDecades.call(this,t,this.value):this.islamicModule.islamicRenderDecade(t,this.value)},t.prototype.renderTemplate=function(t,i,s,a){"Gregorian"===this.calendarMode?e.prototype.renderTemplate.call(this,t,i,s,a,this.value):this.islamicModule.islamicRenderTemplate(t,i,s,a,this.value),this.changedArgs={value:this.value,values:this.values},this.changeHandler()},t.prototype.clickHandler=function(t){var a=t.currentTarget;if(this.isPopupClicked=!0,a.classList.contains(r))if(this.isMultiSelection){var n=this.copyValues(this.values);-1===n.toString().indexOf(this.getIdValue(t,null).toString())?(n.push(this.getIdValue(t,null)),this.setProperties({values:n},!0),this.setProperties({value:this.values[this.values.length-1]},!0)):this.previousDates=!0}else this.setProperties({value:this.getIdValue(t,null)},!0);var l=this.currentView();e.prototype.clickHandler.call(this,t,this.value),this.isMultiSelection&&this.currentDate!==this.value&&!i.i(s.isNullOrUndefined)(this.tableBodyElement.querySelectorAll("."+d)[0])&&"Year"===l&&this.tableBodyElement.querySelectorAll("."+d)[0].classList.remove(d)},t.prototype.switchView=function(t,i,s,a){e.prototype.switchView.call(this,t,i,this.isMultiSelection,a)},t.prototype.getModuleName=function(){return e.prototype.getModuleName.call(this),"calendar"},t.prototype.getPersistData=function(){e.prototype.getPersistData.call(this);var t=["value","values"];return this.addOnPersist(t)},t.prototype.onPropertyChanged=function(t,i){this.effect="",this.rangeValidation(this.min,this.max);for(var s=0,a=Object.keys(t);s<a.length;s++){switch(a[s]){case"value":this.isDateSelected&&("string"==typeof t.value?this.setProperties({value:new Date(this.checkValue(t.value))},!0):t.value=new Date(this.checkValue(t.value)),isNaN(+this.value)&&this.setProperties({value:i.value},!0),this.update());break;case"values":if(this.isDateSelected){if("string"==typeof t.values||"number"==typeof t.values)this.setProperties({values:null},!0);else{for(var n=this.copyValues(this.values),r=0;r<n.length;r++){var l=n[r];this.checkDateValue(l)&&!e.prototype.checkPresentDate.call(this,l,n)&&n.push(l)}this.setProperties({values:n},!0),this.values.length>0&&this.setProperties({value:t.values[t.values.length-1]},!0)}this.validateValues(this.isMultiSelection,this.values),this.update()}break;case"isMultiSelection":this.isDateSelected&&(this.setProperties({isMultiSelection:t.isMultiSelection},!0),this.update());break;case"enabled":this.setEnable(this.enabled);break;case"cssClass":"calendar"===this.getModuleName()&&this.setClass(t.cssClass,i.cssClass);break;default:e.prototype.onPropertyChanged.call(this,t,i,this.isMultiSelection,this.values)}}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange},t.prototype.destroy=function(){if(e.prototype.destroy.call(this),"calendar"===this.getModuleName()){var t=i.i(s.closest)(this.element,"form");t&&s.EventHandler.remove(t,"reset",this.formResetHandler.bind(this))}},t.prototype.navigateTo=function(t,i,s){this.minMaxUpdate(),e.prototype.navigateTo.call(this,t,i,s)},t.prototype.currentView=function(){return e.prototype.currentView.call(this)},t.prototype.addDate=function(t){if("string"!=typeof t&&"number"!=typeof t){var a=this.copyValues(this.values);if("object"==typeof t&&t.length>0)for(var n=t,r=0;r<n.length;r++)this.checkDateValue(n[r])&&!e.prototype.checkPresentDate.call(this,n[r],a)&&(!i.i(s.isNullOrUndefined)(a)&&a.length>0?a.push(n[r]):a=[new Date(+n[r])]);else this.checkDateValue(t)&&!e.prototype.checkPresentDate.call(this,t,a)&&(!i.i(s.isNullOrUndefined)(a)&&a.length>0?a.push(t):a=[new Date(+t)]);this.setProperties({values:a},!0),this.isMultiSelection&&this.setProperties({value:this.values[this.values.length-1]},!0),this.validateValues(this.isMultiSelection,a),this.update(),this.changedArgs={value:this.value,values:this.values},this.changeHandler()}},t.prototype.removeDate=function(e){if("string"!=typeof e&&"number"!=typeof e&&!i.i(s.isNullOrUndefined)(this.values)&&this.values.length>0){var t=this.copyValues(this.values);if("object"==typeof e&&e.length>0)for(var a=e,n=0;n<a.length;n++)for(var r=0;r<t.length;r++)+t[r]==+a[n]&&t.splice(r,1);else for(var r=0;r<t.length;r++)+t[r]==+e&&t.splice(r,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()}},t.prototype.setTodayDate=function(t){var i=new Date(+t);this.setProperties({value:i},!0),e.prototype.todayButtonClick.call(this,null,i,!0)},t.prototype.update=function(){this.validateDate(),this.minMaxUpdate(),e.prototype.setValueUpdate.call(this)},t.prototype.selectDate=function(t,a,n){e.prototype.selectDate.call(this,t,a,n,this.isMultiSelection,this.values),this.isMultiSelection&&!i.i(s.isNullOrUndefined)(this.values)&&this.values.length>0&&this.setProperties({value:this.values[this.values.length-1]},!0),this.changedArgs={value:this.value,values:this.values},this.changeHandler(t)},t.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))},t.prototype.triggerChange=function(e){!i.i(s.isNullOrUndefined)(this.todayButtonEvent)&&this.isTodayClicked&&(e=this.todayButtonEvent,this.isTodayClicked=!1),this.changedArgs.event=e||null,this.changedArgs.isInteracted=!i.i(s.isNullOrUndefined)(e),i.i(s.isNullOrUndefined)(this.value)||this.setProperties({value:this.value},!0),this.isMultiSelection||+this.value===Number.NaN||(i.i(s.isNullOrUndefined)(this.value)||i.i(s.isNullOrUndefined)(this.previousDate))&&(null!==this.previousDate||isNaN(+this.value))?i.i(s.isNullOrUndefined)(this.values)||this.previousValues===this.values.length||(this.changeEvent(e),this.previousValues=this.values.length):this.changeEvent(e)},n([i.i(s.Property)(null)],t.prototype,"value",void 0),n([i.i(s.Property)(null)],t.prototype,"values",void 0),n([i.i(s.Property)(!1)],t.prototype,"isMultiSelection",void 0),n([i.i(s.Event)()],t.prototype,"change",void 0),t=n([s.NotifyPropertyChanges],t)}(p)},function(e,t,i){"use strict";i.d(t,"a",function(){return d});var s=i(0),a=(i.n(s),i(2)),n=(i.n(a),i(1)),r=(i.n(n),i(3)),l=this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),o=this&&this.__decorate||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;l>=0;l--)(a=e[l])&&(r=(n<3?a(r):n>3?a(t,i,r):a(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},h="e-datepicker",u=["title","class","style"],d=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.isDateIconClicked=!1,s.isAltKeyPressed=!1,s.isInteracted=!0,s.invalidValueString=null,s.checkPreviousValue=null,s.maskedDateValue="",s.isAngular=!1,s.preventChange=!1,s.isIconClicked=!1,s.isDynamicValueChanged=!1,s.moduleName=s.getModuleName(),s.isFocused=!1,s.isBlur=!1,s.datepickerOptions=t,s}return l(t,e),t.prototype.render=function(){this.initialize(),this.bindEvents(),"Auto"===this.floatLabelType&&n.Input.calculateWidth(this.inputElement,this.inputWrapper.container),i.i(s.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(s.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"),!i.i(s.isNullOrUndefined)(i.i(s.closest)(this.element,"fieldset"))&&i.i(s.closest)(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete(),this.setTimeZone(this.serverTimezoneOffset)},t.prototype.setTimeZone=function(e){if(!i.i(s.isNullOrUndefined)(this.serverTimezoneOffset)&&this.value){var t=(new Date).getTimezoneOffset()/60,a=e,n=a+t;n=this.isDayLightSaving()?n--:n,this.value=new Date(this.value.getTime()+60*n*60*1e3),this.updateInput()}},t.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)},t.prototype.setAllowEdit=function(){this.allowEdit?this.readonly||this.inputElement.removeAttribute("readonly"):i.i(s.attributes)(this.inputElement,{readonly:""}),this.updateIconState()},t.prototype.updateIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&i.i(s.removeClass)([this.inputWrapper.container],["e-non-edit"]):""===this.inputElement.value?i.i(s.removeClass)([this.inputWrapper.container],["e-non-edit"]):i.i(s.addClass)([this.inputWrapper.container],["e-non-edit"])},t.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=i.i(s.isNullOrUndefined)(this.value)?null:new Date(+this.value),this.inputElement.setAttribute("value",this.inputElement.value),this.inputValueCopy=this.value},t.prototype.createInput=function(){var e={"aria-atomic":"true","aria-expanded":"false",role:"combobox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-invalid":"false"};if("datepicker"===this.getModuleName()){var t={placeholder:this.placeholder};this.globalize=new s.Internationalization(this.locale),this.l10n=new s.L10n("datepicker",t,this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0)}this.fullScreenMode&&s.Browser.isDevice&&(this.cssClass+=" e-popup-expand");var a=this.cssClass;i.i(s.isNullOrUndefined)(this.cssClass)||""===this.cssClass||(a=this.cssClass.replace(/\s+/g," ").trim());var r=!this.enableMask;this.inputWrapper=n.Input.createInput({element:this.inputElement,floatLabelType:this.floatLabelType,bindClearAction:r,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:a,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),i.i(s.attributes)(this.inputElement,e),this.enabled?(this.inputElement.setAttribute("aria-disabled","false"),this.inputElement.setAttribute("tabindex",this.tabIndex)):(this.inputElement.setAttribute("aria-disabled","true"),this.inputElement.tabIndex=-1),n.Input.addAttributes({"aria-label":"select"},this.inputWrapper.buttons[0]),i.i(s.addClass)([this.inputWrapper.container],"e-date-wrapper")},t.prototype.updateInput=function(t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);var n;if(this.value&&!this.isCalendar()&&this.disabledDates(t,a),isNaN(+new Date(this.checkValue(this.value)))&&this.setProperties({value:null},!0),this.strictMode&&(e.prototype.validateDate.call(this),this.minMaxUpdates(),e.prototype.minMaxUpdate.call(this)),!i.i(s.isNullOrUndefined)(this.value)){var r=this.value,l=void 0,o=i.i(s.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString;if("datetimepicker"===this.getModuleName()?l="Gregorian"===this.calendarMode?this.globalize.formatDate(this.value,{format:o,type:"dateTime",skeleton:"yMd"}):this.globalize.formatDate(this.value,{format:o,type:"dateTime",skeleton:"yMd",calendar:"islamic"}):(n="Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"},l=this.globalize.formatDate(this.value,n)),+r<=+this.max&&+r>=+this.min)this.updateInputValue(l);else{var h=+r>=+this.max||!+this.value||!+this.value||+r<=+this.min;!this.strictMode&&h&&this.updateInputValue(l)}}i.i(s.isNullOrUndefined)(this.value)&&this.strictMode&&(this.enableMask?(this.updateInputValue(this.maskedDateValue),this.notify("createMask",{module:"MaskedDateTime"})):this.updateInputValue("")),!this.strictMode&&i.i(s.isNullOrUndefined)(this.value)&&this.invalidValueString&&this.updateInputValue(this.invalidValueString),this.changedArgs={value:this.value},this.errorClass(),this.updateIconState()},t.prototype.minMaxUpdates=function(){!i.i(s.isNullOrUndefined)(this.value)&&this.value<this.min&&this.min<=this.max&&this.strictMode?(this.setProperties({value:this.min},!0),this.changedArgs={value:this.value}):!i.i(s.isNullOrUndefined)(this.value)&&this.value>this.max&&this.min<=this.max&&this.strictMode&&(this.setProperties({value:this.max},!0),this.changedArgs={value:this.value})},t.prototype.checkStringValue=function(e){var t=null,a=null,n=null;if("datetimepicker"===this.getModuleName()){var r=new s.Internationalization(this.locale);"Gregorian"===this.calendarMode?(a={format:this.dateTimeFormat,type:"dateTime",skeleton:"yMd"},n={format:r.getDatePattern({skeleton:"yMd"}),type:"dateTime"}):(a={format:this.dateTimeFormat,type:"dateTime",skeleton:"yMd",calendar:"islamic"},n={format:r.getDatePattern({skeleton:"yMd"}),type:"dateTime",calendar:"islamic"})}else a="Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"};return t=this.checkDateValue(this.globalize.parseDate(e,a)),i.i(s.isNullOrUndefined)(t)&&"datetimepicker"===this.getModuleName()&&(t=this.checkDateValue(this.globalize.parseDate(e,n))),t},t.prototype.checkInvalidValue=function(e){if(!(e instanceof Date||i.i(s.isNullOrUndefined)(e))){var t=null,a=e;"number"==typeof e&&(a=e.toString());if("datetimepicker"===this.getModuleName()){var n=new s.Internationalization(this.locale);"Gregorian"===this.calendarMode?({format:this.dateTimeFormat,type:"dateTime",skeleton:"yMd"},{format:n.getDatePattern({skeleton:"yMd"}),type:"dateTime"}):({format:this.dateTimeFormat,type:"dateTime",skeleton:"yMd",calendar:"islamic"},{format:n.getDatePattern({skeleton:"yMd"}),type:"dateTime",calendar:"islamic"})}else"Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"};var r=!1;if("string"!=typeof a)a=null,r=!0;else if("string"==typeof a&&(a=a.trim()),!(t=this.checkStringValue(a))){var l=null,o=null;l=/^\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)?)?/,o=/^\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)?)?/,!l.test(a)&&!o.test(a)||/^[a-zA-Z0-9- ]*$/.test(a)||isNaN(+new Date(this.checkValue(a)))?r=!0:t=new Date(a)}r?(this.strictMode||(this.invalidValueString=a),this.setProperties({value:null},!0)):this.setProperties({value:t},!0)}},t.prototype.bindInputEvent=function(){i.i(s.isNullOrUndefined)(this.formatString)&&!this.enableMask||(this.enableMask||-1===this.formatString.indexOf("y")?s.EventHandler.add(this.inputElement,"input",this.inputHandler,this):s.EventHandler.remove(this.inputElement,"input",this.inputHandler))},t.prototype.bindEvents=function(){s.EventHandler.add(this.inputWrapper.buttons[0],"mousedown touchstart",this.dateIconHandler,this),s.EventHandler.add(this.inputElement,"mouseup",this.mouseUpHandler,this),s.EventHandler.add(this.inputElement,"focus",this.inputFocusHandler,this),s.EventHandler.add(this.inputElement,"blur",this.inputBlurHandler,this),this.enableMask&&s.EventHandler.add(this.inputElement,"keydown",this.keydownHandler,this),this.bindInputEvent(),s.EventHandler.add(this.inputElement,"change",this.inputChangeHandler,this),this.showClearButton&&this.inputWrapper.clearButton&&s.EventHandler.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this),this.formElement&&s.EventHandler.add(this.formElement,"reset",this.resetFormHandler,this),this.defaultKeyConfigs=i.i(s.extend)(this.defaultKeyConfigs,this.keyConfigs),this.keyboardModules=new s.KeyboardEvents(this.inputElement,{eventName:"keydown",keyAction:this.inputKeyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})},t.prototype.keydownHandler=function(e){switch(e.code){case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"ArrowDown":case"Home":case"End":case"Delete":!this.enableMask||this.popupObj||this.readonly||("Delete"!==e.code&&e.preventDefault(),this.notify("keyDownHandler",{module:"MaskedDateTime",e:e}))}},t.prototype.unBindEvents=function(){i.i(s.isNullOrUndefined)(this.inputWrapper)||s.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown touchstart",this.dateIconHandler),s.EventHandler.remove(this.inputElement,"mouseup",this.mouseUpHandler),s.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),s.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),s.EventHandler.remove(this.inputElement,"change",this.inputChangeHandler),this.enableMask&&s.EventHandler.remove(this.inputElement,"keydown",this.keydownHandler),this.showClearButton&&this.inputWrapper.clearButton&&s.EventHandler.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler),this.formElement&&s.EventHandler.remove(this.formElement,"reset",this.resetFormHandler)},t.prototype.resetFormHandler=function(){if(this.enabled&&!this.inputElement.disabled){var 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())}},t.prototype.restoreValue=function(){this.currentDate=this.value?this.value:new Date,this.previousDate=this.value,this.previousElementValue=i.i(s.isNullOrUndefined)(this.inputValueCopy)?"":this.globalize.formatDate(this.inputValueCopy,{format:this.formatString,type:"dateTime",skeleton:"yMd"})},t.prototype.inputChangeHandler=function(e){this.enabled&&e.stopPropagation()},t.prototype.bindClearEvent=function(){this.showClearButton&&this.inputWrapper.clearButton&&s.EventHandler.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this)},t.prototype.resetHandler=function(e){this.enabled&&(e.preventDefault(),this.clear(e))},t.prototype.mouseUpHandler=function(e){this.enableMask&&(e.preventDefault(),this.notify("setMaskSelection",{module:"MaskedDateTime"}))},t.prototype.clear=function(e){this.setProperties({value:null},!0),this.enableMask||this.updateInputValue("");var t={event:e};if(this.trigger("cleared",t),this.invalidValueString="",this.updateInput(),this.popupUpdate(),this.changeEvent(e),this.enableMask&&this.notify("clearHandler",{module:"MaskedDateTime"}),i.i(s.closest)(this.element,"form")){var a=this.element,n=document.createEvent("KeyboardEvent");n.initEvent("keyup",!1,!0),a.dispatchEvent(n)}},t.prototype.preventEventBubbling=function(e){e.preventDefault(),this.interopAdaptor.invokeMethodAsync("OnDateIconClick")},t.prototype.updateInputValue=function(e){n.Input.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton)},t.prototype.dateIconHandler=function(e){this.enabled&&(this.isIconClicked=!0,s.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(),i.i(s.addClass)([this.inputWrapper.container],["e-input-focus"]),i.i(s.addClass)(this.inputWrapper.buttons,"e-active"))),this.isIconClicked=!1)},t.prototype.updateHtmlAttributeToWrapper=function(){if(!i.i(s.isNullOrUndefined)(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var a=t[e];if(!i.i(s.isNullOrUndefined)(this.htmlAttributes[""+a])&&u.indexOf(a)>-1)if("class"===a){var n=this.htmlAttributes[""+a].replace(/\s+/g," ").trim();""!==n&&i.i(s.addClass)([this.inputWrapper.container],n.split(" "))}else if("style"===a){var r=this.inputWrapper.container.getAttribute(a);i.i(s.isNullOrUndefined)(r)?r=this.htmlAttributes[""+a]:";"===r.charAt(r.length-1)?r+=this.htmlAttributes[""+a]:r=r+";"+this.htmlAttributes[""+a],this.inputWrapper.container.setAttribute(a,r)}else this.inputWrapper.container.setAttribute(a,this.htmlAttributes[""+a])}},t.prototype.updateHtmlAttributeToElement=function(){if(!i.i(s.isNullOrUndefined)(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var a=t[e];u.indexOf(a)<0&&this.inputElement.setAttribute(a,this.htmlAttributes[""+a])}},t.prototype.updateCssClass=function(e,t){i.i(s.isNullOrUndefined)(t)||(t=t.replace(/\s+/g," ").trim()),i.i(s.isNullOrUndefined)(e)||(e=e.replace(/\s+/g," ").trim()),n.Input.setCssClass(e,[this.inputWrapper.container],t),this.popupWrapper&&n.Input.setCssClass(e,[this.popupWrapper],t)},t.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();break;case"tab":this.hide(e)}},t.prototype.inputFocusHandler=function(){if(this.isFocused=!0,this.enabled){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));var e={model:this};this.isDateIconClicked=!1,this.trigger("focus",e),this.updateIconState(),this.openOnFocus&&!this.isIconClicked&&this.show()}},t.prototype.inputHandler=function(){this.isPopupClicked=!1,this.enableMask&&this.notify("inputHandler",{module:"MaskedDateTime"})},t.prototype.inputBlurHandler=function(e){if(this.enabled){if(this.strictModeUpdate(),""===this.inputElement.value&&i.i(s.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()){var t={model:this};this.trigger("blur",t)}this.isCalendar()&&(this.defaultKeyConfigs=i.i(s.extend)(this.defaultKeyConfigs,this.keyConfigs),this.calendarKeyboardModules=new s.KeyboardEvents(this.calendarElement.children[1].firstElementChild,{eventName:"keydown",keyAction:this.calendarKeyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})),this.isPopupClicked=!1}},t.prototype.documentHandler=function(t){i.i(s.isNullOrUndefined)(this.popupObj)||i.i(s.isNullOrUndefined)(this.inputWrapper)||!(this.inputWrapper.container.contains(t.target)&&"mousedown"!==t.type||this.popupObj.element&&this.popupObj.element.contains(t.target))||"touchstart"===t.type||t.preventDefault();var a=t.target;i.i(s.closest)(a,".e-datepicker.e-popup-wrapper")||i.i(s.isNullOrUndefined)(this.inputWrapper)||i.i(s.closest)(a,".e-input-group")===this.inputWrapper.container||a.classList.contains("e-day")?i.i(s.closest)(a,".e-datepicker.e-popup-wrapper")&&(a.classList.contains("e-day")&&!i.i(s.isNullOrUndefined)(t.target.parentElement)&&t.target.parentElement.classList.contains("e-selected")&&i.i(s.closest)(a,".e-content")&&i.i(s.closest)(a,".e-content").classList.contains("e-"+this.depth.toLowerCase())?this.hide(t):i.i(s.closest)(a,".e-footer-container")&&a.classList.contains("e-today")&&a.classList.contains("e-btn")&&+new Date(+this.value)==+e.prototype.generateTodayVal.call(this,this.value)&&this.hide(t)):(this.hide(t),this.focusOut())},t.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":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 i=this.inputElement.selectionStart,s=this.inputElement.selectionEnd;if(this.enableMask&&!this.popupObj&&!this.readonly){var 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),this.hide(e);break;default:this.defaultAction(e),"select"===e.action&&t===this.depth&&this.hide(e)}},t.prototype.defaultAction=function(t){this.previousDate=!i.i(s.isNullOrUndefined)(this.value)&&new Date(+this.value)||null,this.isCalendar()&&(e.prototype.keyActionHandle.call(this,t),this.isCalendar()&&i.i(s.attributes)(this.inputElement,{"aria-activedescendant":""+this.setActiveDescendant()}))},t.prototype.popupUpdate=function(){if((i.i(s.isNullOrUndefined)(this.value)&&!i.i(s.isNullOrUndefined)(this.previousDate)||+this.value!=+this.previousDate)&&(this.popupObj&&this.popupObj.element.querySelectorAll(".e-selected").length>0&&i.i(s.removeClass)(this.popupObj.element.querySelectorAll(".e-selected"),["e-selected"]),!i.i(s.isNullOrUndefined)(this.value)&&+this.value>=+this.min&&+this.value<=+this.max)){var t=new Date(this.checkValue(this.value));e.prototype.navigateTo.call(this,"Month",t)}},t.prototype.strictModeUpdate=function(){var e,t,a=/^y/,n=/[^a-zA-Z]/;if("datetimepicker"===this.getModuleName()?e=i.i(s.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString:a.test(this.formatString)&&!n.test(this.formatString)||(e=i.i(s.isNullOrUndefined)(this.formatString)?this.formatString:this.formatString.replace("dd","d")),i.i(s.isNullOrUndefined)(e))e=this.formatString;else{e.split("M").length-1<3&&(e=e.replace("MM","M"))}var r;"datetimepicker"===this.getModuleName()?r="Gregorian"===this.calendarMode?{format:i.i(s.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:i.i(s.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}:(t="Gregorian"===this.calendarMode?{format:e,type:"dateTime",skeleton:"yMd"}:{format:e,type:"dateTime",skeleton:"yMd",calendar:"islamic"},r=t);var l;"string"==typeof this.inputElement.value&&(this.inputElement.value=this.inputElement.value.trim()),"datetimepicker"===this.getModuleName()?this.checkDateValue(this.globalize.parseDate(this.inputElement.value,r))?l=this.globalize.parseDate(this.inputElement.value.toLocaleUpperCase(),r):(t="Gregorian"===this.calendarMode?{type:"dateTime",skeleton:"yMd"}:{type:"dateTime",skeleton:"yMd",calendar:"islamic"},l=this.globalize.parseDate(this.inputElement.value,t)):(l=this.globalize.parseDate(this.inputElement.value,r),l=!i.i(s.isNullOrUndefined)(l)&&isNaN(+l)?null:l,!i.i(s.isNullOrUndefined)(this.formatString)&&""!==this.inputElement.value&&this.strictMode&&(this.isPopupClicked||!this.isPopupClicked&&this.inputElement.value===this.previousElementValue)&&-1===this.formatString.indexOf("y")&&l.setFullYear(this.value.getFullYear())),"datepicker"===this.getModuleName()&&this.value&&!isNaN(+this.value)&&l&&l.setHours(this.value.getHours(),this.value.getMinutes(),this.value.getSeconds(),this.value.getMilliseconds()),this.strictMode&&l?(this.updateInputValue(this.globalize.formatDate(l,r)),this.inputElement.value!==this.previousElementValue&&this.setProperties({value:l},!0)):this.strictMode||this.inputElement.value!==this.previousElementValue&&this.setProperties({value:l},!0),this.strictMode&&!l&&this.inputElement.value===(this.enableMask?this.maskedDateValue:"")&&this.setProperties({value:null},!0),isNaN(+this.value)&&this.setProperties({value:null},!0),i.i(s.isNullOrUndefined)(this.value)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0)))},t.prototype.createCalendar=function(){var e=this;this.popupWrapper=this.createElement("div",{className:h+" e-popup-wrapper"}),i.i(s.isNullOrUndefined)(this.cssClass)||(this.popupWrapper.className+=" "+this.cssClass),s.Browser.isDevice&&(this.modelHeader(),this.modal=this.createElement("div"),this.modal.className=h+" e-date-modal",document.body.className+=" e-date-overflow",this.modal.style.display="block",document.body.appendChild(this.modal)),this.calendarElement.querySelector("table tbody").className="",this.popupObj=new a.Popup(this.popupWrapper,{content:this.calendarElement,relateTo:s.Browser.isDevice?document.body:this.inputWrapper.container,position:s.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:s.Browser.isDevice?{X:"fit",Y:"fit"}:{X:"flip",Y:"flip"},open:function(){s.Browser.isDevice&&e.fullScreenMode&&(e.iconRight=parseInt(window.getComputedStyle(e.calendarElement.querySelector(".e-header.e-month .e-prev")).marginRight,10)>16,e.touchModule=new s.Touch(e.calendarElement.querySelector(".e-content.e-month"),{swipe:e.CalendarSwipeHandler.bind(e)}),s.EventHandler.add(e.calendarElement.querySelector(".e-content.e-month"),"touchstart",e.TouchStartHandler,e)),"datetimepicker"!==e.getModuleName()&&document.activeElement!==e.inputElement&&(e.defaultKeyConfigs=i.i(s.extend)(e.defaultKeyConfigs,e.keyConfigs),e.calendarElement.children[1].firstElementChild.focus(),e.calendarKeyboardModules=new s.KeyboardEvents(e.calendarElement.children[1].firstElementChild,{eventName:"keydown",keyAction:e.calendarKeyActionHandle.bind(e),keyConfigs:e.defaultKeyConfigs}),e.calendarKeyboardModules=new s.KeyboardEvents(e.inputWrapper.container.children[e.index],{eventName:"keydown",keyAction:e.calendarKeyActionHandle.bind(e),keyConfigs:e.defaultKeyConfigs}))},close:function(){e.isDateIconClicked&&e.inputWrapper.container.children[e.index].focus(),e.value&&e.disabledDates(),e.popupObj&&e.popupObj.destroy(),e.resetCalendar(),i.i(s.detach)(e.popupWrapper),e.popupObj=e.popupWrapper=null,e.preventArgs=null,e.calendarKeyboardModules=null,e.setAriaAttributes()},targetExitViewport:function(){s.Browser.isDevice||e.hide()}}),this.popupObj.element.className+=" "+this.cssClass,this.setAriaAttributes()},t.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)},t.prototype.TouchStartHandler=function(e){this.touchStart=!0},t.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)},t.prototype.modelHeader=function(){var e,t=this.createElement("div",{className:"e-model-header"}),i=this.createElement("h1",{className:"e-model-year"}),a=this.createElement("div"),n=this.createElement("span",{className:"e-model-day"}),r=this.createElement("span",{className:"e-model-month"});if(e="Gregorian"===this.calendarMode?{format:"y",skeleton:"dateTime"}:{format:"y",skeleton:"dateTime",calendar:"islamic"},i.textContent=""+this.globalize.formatDate(this.value||new Date,e),e="Gregorian"===this.calendarMode?{format:"E",skeleton:"dateTime"}:{format:"E",skeleton:"dateTime",calendar:"islamic"},n.textContent=this.globalize.formatDate(this.value||new Date,e)+", ",e="Gregorian"===this.calendarMode?{format:"MMM d",skeleton:"dateTime"}:{format:"MMM d",skeleton:"dateTime",calendar:"islamic"},r.textContent=""+this.globalize.formatDate(this.value||new Date,e),this.fullScreenMode){var l=this.createElement("span",{className:"e-popup-close"});s.EventHandler.add(l,"mousedown touchstart",this.modelCloseHandler,this);var o=this.calendarElement.querySelector("button.e-today");a.classList.add("e-day-wrapper"),o.classList.add("e-outline"),t.appendChild(l),t.appendChild(o)}this.fullScreenMode||t.appendChild(i),a.appendChild(n),a.appendChild(r),t.appendChild(a),this.calendarElement.insertBefore(t,this.calendarElement.firstElementChild)},t.prototype.modelCloseHandler=function(e){this.hide()},t.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=!i.i(s.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)},t.prototype.navigatedEvent=function(){this.trigger("navigated",this.navigatedArgs)},t.prototype.changeEvent=function(e){this.isIconClicked||this.isBlur||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.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)},t.prototype.requiredModules=function(){var e=[];return this&&e.push({args:[this],member:"islamic"}),this.enableMask&&e.push({args:[this],member:"MaskedDateTime"}),e},t.prototype.selectCalendar=function(e){var t,a,n;a="datetimepicker"===this.getModuleName()&&i.i(s.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString,this.value&&("datetimepicker"===this.getModuleName()?(n="Gregorian"===this.calendarMode?{format:a,type:"dateTime",skeleton:"yMd"}:{format:a,type:"dateTime",skeleton:"yMd",calendar:"islamic"},t=this.globalize.formatDate(this.changedArgs.value,n)):(n="Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"},t=this.globalize.formatDate(this.changedArgs.value,n)),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"})),i.i(s.isNullOrUndefined)(t)||(this.updateInputValue(t),this.enableMask&&this.notify("setMaskSelection",{module:"MaskedDateTime"}))},t.prototype.isCalendar=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains("e-popup-wrapper"))},t.prototype.setWidth=function(e){this.inputWrapper.container.style.width="number"==typeof e?i.i(s.formatUnit)(this.width):"string"==typeof e?e.match(/px|%|em/)?this.width:i.i(s.formatUnit)(this.width):"100%"},t.prototype.show=function(t,a){var n=this;if(!(this.enabled&&this.readonly||!this.enabled||this.popupObj)){var r=!0,l=void 0;i.i(s.isNullOrUndefined)(this.value)||+this.value>=+new Date(this.checkValue(this.min))&&+this.value<=+new Date(this.checkValue(this.max))?l=this.value||null:(l=new Date(this.checkValue(this.value)),this.setProperties({value:null},!0)),this.isCalendar()||(e.prototype.render.call(this),this.setProperties({value:l||null},!0),this.previousDate=l,this.createCalendar()),s.Browser.isDevice&&(this.mobilePopupWrapper=this.createElement("div",{className:"e-datepick-mob-popup-wrap"}),document.body.appendChild(this.mobilePopupWrapper)),this.preventArgs={preventDefault:function(){r=!1},popup:this.popupObj,event:a||null,cancel:!1,appendTo:s.Browser.isDevice?this.mobilePopupWrapper:document.body};var o=this.preventArgs;this.trigger("open",o,function(t){if(n.preventArgs=t,r&&!n.preventArgs.cancel){i.i(s.addClass)(n.inputWrapper.buttons,"e-active"),n.preventArgs.appendTo.appendChild(n.popupWrapper),n.popupObj.refreshPosition(n.inputElement);var a={name:"FadeIn",duration:s.Browser.isDevice?0:300};1e3===n.zIndex?n.popupObj.show(new s.Animation(a),n.element):n.popupObj.show(new s.Animation(a),null),e.prototype.setOverlayIndex.call(n,n.mobilePopupWrapper,n.popupObj.element,n.modal,s.Browser.isDevice),n.setAriaAttributes()}else n.popupObj.destroy(),n.popupWrapper=n.popupObj=null;i.i(s.isNullOrUndefined)(n.inputElement)||""!==n.inputElement.value||!i.i(s.isNullOrUndefined)(n.tableBodyElement)&&n.tableBodyElement.querySelectorAll("td.e-selected").length>0&&(i.i(s.addClass)([n.tableBodyElement.querySelector("td.e-selected")],"e-focused-date"),i.i(s.removeClass)(n.tableBodyElement.querySelectorAll("td.e-selected"),"e-selected")),s.EventHandler.add(document,"mousedown touchstart",n.documentHandler,n)})}},t.prototype.hide=function(e){var t=this;if(i.i(s.isNullOrUndefined)(this.popupWrapper))s.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit();else{var a=!0;this.preventArgs={preventDefault:function(){a=!1},popup:this.popupObj,event:e||null,cancel:!1},i.i(s.removeClass)(this.inputWrapper.buttons,"e-active"),i.i(s.removeClass)([document.body],"e-date-overflow");var n=this.preventArgs;this.isCalendar()?this.trigger("close",n,function(e){t.closeEventCallback(a,e)}):this.closeEventCallback(a,n)}},t.prototype.closeEventCallback=function(e,t){this.preventArgs=t,this.isCalendar()&&e&&!this.preventArgs.cancel&&(this.popupObj.hide(),this.isAltKeyPressed=!1,this.keyboardModule.destroy(),i.i(s.removeClass)(this.inputWrapper.buttons,"e-active")),this.setAriaAttributes(),s.Browser.isDevice&&this.modal&&(this.modal.style.display="none",this.modal.outerHTML="",this.modal=null),s.Browser.isDevice&&(i.i(s.isNullOrUndefined)(this.mobilePopupWrapper)||!e||!i.i(s.isNullOrUndefined)(this.preventArgs)&&this.preventArgs.cancel||(this.mobilePopupWrapper.remove(),this.mobilePopupWrapper=null)),s.EventHandler.remove(document,"mousedown touchstart",this.documentHandler),s.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit()},t.prototype.focusIn=function(e){document.activeElement!==this.inputElement&&this.enabled&&(this.inputElement.focus(),i.i(s.addClass)([this.inputWrapper.container],["e-input-focus"]))},t.prototype.focusOut=function(){document.activeElement===this.inputElement&&(i.i(s.removeClass)([this.inputWrapper.container],["e-input-focus"]),this.inputElement.blur())},t.prototype.currentView=function(){var t;return this.calendarElement&&(t=e.prototype.currentView.call(this)),t},t.prototype.navigateTo=function(t,i){this.calendarElement&&e.prototype.navigateTo.call(this,t,i)},t.prototype.destroy=function(){this.unBindEvents(),e.prototype.destroy.call(this),i.i(s.isNullOrUndefined)(this.keyboardModules)||this.keyboardModules.destroy(),this.popupObj&&this.popupObj.element.classList.contains("e-popup")&&e.prototype.destroy.call(this);var t={"aria-atomic":"true","aria-disabled":"true","aria-expanded":"false",role:"combobox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false"};this.inputElement&&(n.Input.removeAttributes(t,this.inputElement),i.i(s.isNullOrUndefined)(this.inputElementCopy.getAttribute("tabindex"))?this.inputElement.removeAttribute("tabindex"):this.inputElement.setAttribute("tabindex",this.tabIndex),s.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),s.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),this.ensureInputAttribute()),this.isCalendar()&&(this.popupWrapper&&i.i(s.detach)(this.popupWrapper),this.popupObj=this.popupWrapper=null,this.keyboardModule.destroy()),null===this.ngTag&&(this.inputElement&&(i.i(s.isNullOrUndefined)(this.inputWrapper)||this.inputWrapper.container.insertAdjacentElement("afterend",this.inputElement),i.i(s.removeClass)([this.inputElement],["e-input"])),i.i(s.removeClass)([this.element],[h]),i.i(s.isNullOrUndefined)(this.inputWrapper)||i.i(s.detach)(this.inputWrapper.container)),this.formElement&&s.EventHandler.remove(this.formElement,"reset",this.resetFormHandler),this.inputWrapper=null,this.keyboardModules=null},t.prototype.ensureInputAttribute=function(){for(var e=[],t=0;t<this.inputElement.attributes.length;t++)e[t]=this.inputElement.attributes[t].name;for(var t=0;t<e.length;t++)i.i(s.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])))},t.prototype.preRender=function(){this.inputElementCopy=this.element.cloneNode(!0),i.i(s.removeClass)([this.inputElementCopy],[h,"e-control","e-lib"]),this.inputElement=this.element,this.formElement=i.i(s.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=i.i(s.getUniqueID)("ej2-datetimepicker"),null!==this.ngTag&&i.i(s.attributes)(this.inputElement,{id:this.element.id+"_input"})):(this.element.id=i.i(s.getUniqueID)("ej2-datepicker"),null!==this.ngTag&&i.i(s.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.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex"),e.prototype.preRender.call(this)},t.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},t.prototype.validationAttribute=function(e,t){var a=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");t.setAttribute("name",a),e.removeAttribute("name");for(var n=["required","aria-required","form"],r=0;r<n.length;r++)if(!i.i(s.isNullOrUndefined)(e.getAttribute(n[r]))){var l=e.getAttribute(n[r]);t.setAttribute(n[r],l),e.removeAttribute(n[r])}},t.prototype.checkFormat=function(){var e=new s.Internationalization(this.locale);if(this.format)if("string"==typeof this.format)this.formatString=this.format;else if(""===this.format.skeleton||i.i(s.isNullOrUndefined)(this.format.skeleton))"datetimepicker"===this.getModuleName()?this.formatString=this.dateTimeFormat:this.formatString=null;else{var t=this.format.skeleton;"datetimepicker"===this.getModuleName()?this.formatString=e.getDatePattern({skeleton:t,type:"dateTime"}):this.formatString=e.getDatePattern({skeleton:t,type:"date"})}else this.formatString=null},t.prototype.checkHtmlAttributes=function(e){this.globalize=new s.Internationalization(this.locale),this.checkFormat(),this.checkView();var t,a=e?i.i(s.isNullOrUndefined)(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["value","min","max","disabled","readonly","style","name","placeholder","type"];t="datetimepicker"===this.getModuleName()?"Gregorian"===this.calendarMode?{format:i.i(s.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:i.i(s.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"};for(var n=0,r=a;n<r.length;n++){var l=r[n];if(!i.i(s.isNullOrUndefined)(this.inputElement.getAttribute(l)))switch(l){case"disabled":if(i.i(s.isNullOrUndefined)(this.datepickerOptions)||void 0===this.datepickerOptions.enabled||e){var o="disabled"!==this.inputElement.getAttribute(l)&&""!==this.inputElement.getAttribute(l)&&"true"!==this.inputElement.getAttribute(l);this.setProperties({enabled:o},!e)}break;case"readonly":if(i.i(s.isNullOrUndefined)(this.datepickerOptions)||void 0===this.datepickerOptions.readonly||e){var h="readonly"===this.inputElement.getAttribute(l)||""===this.inputElement.getAttribute(l)||"true"===this.inputElement.getAttribute(l);this.setProperties({readonly:h},!e)}break;case"placeholder":(i.i(s.isNullOrUndefined)(this.datepickerOptions)||void 0===this.datepickerOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(l)},!e);break;case"style":this.inputElement.setAttribute("style",""+this.inputElement.getAttribute(l));break;case"name":this.inputElement.setAttribute("name",""+this.inputElement.getAttribute(l));break;case"value":if(i.i(s.isNullOrUndefined)(this.datepickerOptions)||void 0===this.datepickerOptions.value||e){var u=this.inputElement.getAttribute(l);this.setProperties(i.i(s.setValue)(l,this.globalize.parseDate(u,t),{}),!e)}break;case"min":if(+this.min==+new Date(1900,0,1)||e){var d=this.inputElement.getAttribute(l);this.setProperties(i.i(s.setValue)(l,this.globalize.parseDate(d),{}),!e)}break;case"max":if(+this.max==+new Date(2099,11,31)||e){var p=this.inputElement.getAttribute(l);this.setProperties(i.i(s.setValue)(l,this.globalize.parseDate(p),{}),!e)}break;case"type":"text"!==this.inputElement.getAttribute(l)&&this.inputElement.setAttribute("type","text")}}},t.prototype.getModuleName=function(){return"datepicker"},t.prototype.disabledDates=function(t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);var n,r,l=this.checkDateValue(this.value)?new Date(+this.value):new Date(this.checkValue(this.value)),o=this.previousDate;this.minMaxUpdates(),(!t||t&&!i.i(s.isNullOrUndefined)(this.renderDayCell))&&e.prototype.render.call(this),this.previousDate=o;var h=l&&+l,u='*[id^="/id"]'.replace("/id",""+h);this.strictMode||("string"==typeof this.value||"object"==typeof this.value&&+this.value!=+l)&&this.setProperties({value:l},!0),i.i(s.isNullOrUndefined)(this.calendarElement)||i.i(s.isNullOrUndefined)(this.calendarElement.querySelectorAll(u)[0])||this.calendarElement.querySelectorAll(u)[0].classList.contains("e-disabled")&&(this.strictMode||(this.currentDate=new Date((new Date).setHours(0,0,0,0))));var d;"datetimepicker"===this.getModuleName()?(r="Gregorian"===this.calendarMode?this.globalize.formatDate(l,{format:i.i(s.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd"}):this.globalize.formatDate(l,{format:i.i(s.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}),d=r):(n="Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"},d=this.globalize.formatDate(l,n)),this.popupObj||(this.updateInputValue(d),this.enableMask&&(this.updateInputValue(this.maskedDateValue),this.notify("createMask",{module:"MaskedDateTime",isBlur:a})))},t.prototype.setAriaAttributes=function(){this.isCalendar()?(n.Input.addAttributes({"aria-expanded":"true"},this.inputElement),i.i(s.attributes)(this.inputElement,{"aria-owns":this.inputElement.id+"_options"}),this.value&&i.i(s.attributes)(this.inputElement,{"aria-activedescendant":""+this.setActiveDescendant()})):(n.Input.addAttributes({"aria-expanded":"false"},this.inputElement),this.inputElement.removeAttribute("aria-owns"),this.inputElement.removeAttribute("aria-activedescendant"))},t.prototype.errorClass=function(){var e='*[id^="/id"]'.replace("/id",""+ +this.value),t=this.calendarElement&&this.calendarElement.querySelectorAll(e)[0]&&this.calendarElement.querySelectorAll(e)[0].classList.contains("e-disabled");!(i.i(s.isNullOrUndefined)(this.value)||i.i(s.isNullOrUndefined)(this.min)||i.i(s.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&&i.i(s.isNullOrUndefined)(this.value)||t?(i.i(s.addClass)([this.inputWrapper.container],"e-error"),i.i(s.attributes)(this.inputElement,{"aria-invalid":"true"})):i.i(s.isNullOrUndefined)(this.inputWrapper)||(i.i(s.removeClass)([this.inputWrapper.container],"e-error"),i.i(s.attributes)(this.inputElement,{"aria-invalid":"false"}))},t.prototype.onPropertyChanged=function(t,a){for(var r=0,l=Object.keys(t);r<l.length;r++){switch(l[r]){case"value":this.isDynamicValueChanged=!0,this.isInteracted=!1,this.invalidValueString=null,this.checkInvalidValue(t.value),t.value=this.value,this.previousElementValue=this.inputElement.value,i.i(s.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"allowEdit":this.setAllowEdit();break;case"placeholder":n.Input.setPlaceholder(this.placeholder,this.inputElement);break;case"readonly":n.Input.setReadonly(this.readonly,this.inputElement);break;case"enabled":n.Input.setEnabled(this.enabled,this.inputElement),this.setAriaDisabled();break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.checkHtmlAttributes(!0);break;case"locale":this.globalize=new s.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),n.Input.setPlaceholder(this.placeholder,this.inputElement),this.updateInput(),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"});break;case"enableRtl":n.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]);break;case"start":case"depth":this.checkView(),this.calendarElement&&e.prototype.onPropertyChanged.call(this,t,a);break;case"zIndex":this.setProperties({zIndex:t.zIndex},!0);break;case"cssClass":this.updateCssClass(t.cssClass,a.cssClass);break;case"showClearButton":n.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(t.width),n.Input.calculateWidth(this.inputElement,this.inputWrapper.container),i.i(s.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(s.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=t.floatLabelType,n.Input.removeFloating(this.inputWrapper),n.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder),i.i(s.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(s.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;default:this.calendarElement&&this.isCalendar()&&e.prototype.onPropertyChanged.call(this,t,a)}this.isDynamicValueChanged||this.hide(null),this.isDynamicValueChanged=!1}},o([i.i(s.Property)(null)],t.prototype,"width",void 0),o([i.i(s.Property)(null)],t.prototype,"value",void 0),o([i.i(s.Property)(null)],t.prototype,"cssClass",void 0),o([i.i(s.Property)(!1)],t.prototype,"strictMode",void 0),o([i.i(s.Property)(null)],t.prototype,"format",void 0),o([i.i(s.Property)(!0)],t.prototype,"enabled",void 0),o([i.i(s.Property)(!1)],t.prototype,"fullScreenMode",void 0),o([i.i(s.Property)({})],t.prototype,"htmlAttributes",void 0),o([i.i(s.Property)(null)],t.prototype,"values",void 0),o([i.i(s.Property)(!1)],t.prototype,"isMultiSelection",void 0),o([i.i(s.Property)(!0)],t.prototype,"showClearButton",void 0),o([i.i(s.Property)(!0)],t.prototype,"allowEdit",void 0),o([i.i(s.Property)(null)],t.prototype,"keyConfigs",void 0),o([i.i(s.Property)(!1)],t.prototype,"enablePersistence",void 0),o([i.i(s.Property)(1e3)],t.prototype,"zIndex",void 0),o([i.i(s.Property)(!1)],t.prototype,"readonly",void 0),o([i.i(s.Property)(null)],t.prototype,"placeholder",void 0),o([i.i(s.Property)("Never")],t.prototype,"floatLabelType",void 0),o([i.i(s.Property)(null)],t.prototype,"serverTimezoneOffset",void 0),o([i.i(s.Property)(!1)],t.prototype,"openOnFocus",void 0),o([i.i(s.Property)(!1)],t.prototype,"enableMask",void 0),o([i.i(s.Property)({day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"})],t.prototype,"maskPlaceholder",void 0),o([i.i(s.Event)()],t.prototype,"open",void 0),o([i.i(s.Event)()],t.prototype,"cleared",void 0),o([i.i(s.Event)()],t.prototype,"close",void 0),o([i.i(s.Event)()],t.prototype,"blur",void 0),o([i.i(s.Event)()],t.prototype,"focus",void 0),o([i.i(s.Event)()],t.prototype,"created",void 0),o([i.i(s.Event)()],t.prototype,"destroyed",void 0),t=o([s.NotifyPropertyChanges],t)}(r.a)},function(e,t,i){"use strict";i.d(t,"a",function(){return s}),i.d(t,"b",function(){return g}),i.d(t,"c",function(){return b});var s,a=i(0),n=(i.n(a),i(2)),r=(i.n(n),i(1)),l=(i.n(r),i(6)),o=(i.n(l),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}()),h=this&&this.__decorate||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;l>=0;l--)(a=e[l])&&(r=(n<3?a(r):n>3?a(t,i,r):a(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},u=(new Date).getDate(),d=(new Date).getMonth(),p=(new Date).getFullYear(),c="e-timepicker",m="e-disabled",f="e-input-focus",v="e-list-item",y=["title","class","style"];!function(e){function t(e,t,i,s,a,n){this.calendarMode;var r,o=6e4*n,h=[],u=[];r=+t.setMilliseconds(0);for(var d=+i.setMilliseconds(0);d>=r;)u.push(r),h.push(s.formatDate(new Date(r),{format:a,type:"time"})),r+=o;return{collection:u,list:l.ListBase.createList(e,h,null,!0)}}e.createListItems=t}(s||(s={}));var g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),h([i.i(a.Property)("day")],t.prototype,"day",void 0),h([i.i(a.Property)("month")],t.prototype,"month",void 0),h([i.i(a.Property)("year")],t.prototype,"year",void 0),h([i.i(a.Property)("day of the week")],t.prototype,"dayOfTheWeek",void 0),h([i.i(a.Property)("hour")],t.prototype,"hour",void 0),h([i.i(a.Property)("minute")],t.prototype,"minute",void 0),h([i.i(a.Property)("second")],t.prototype,"second",void 0),t}(a.ChildProperty),b=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.liCollections=[],s.timeCollections=[],s.disableItemCollection=[],s.invalidValueString=null,s.isAngular=!1,s.preventChange=!1,s.maskedDateValue="",s.moduleName=s.getModuleName(),s.timeOptions=t,s}return o(t,e),t.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),i.i(a.removeClass)([this.cloneElement],[c,"e-control","e-lib"]),this.inputElement=this.element,this.angularTag=null,this.formElement=i.i(a.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.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex"),this.openPopupEventArgs={appendTo:document.body}},t.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),i.i(a.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(a.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"),!i.i(a.isNullOrUndefined)(i.i(a.closest)(this.element,"fieldset"))&&i.i(a.closest)(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete()},t.prototype.setTimeZone=function(){if(!i.i(a.isNullOrUndefined)(this.serverTimezoneOffset)&&this.value){var e=(new Date).getTimezoneOffset()/60,t=this.serverTimezoneOffset,s=t+e;s=this.isDayLightSaving()?s--:s,this.value=new Date(this.value.getTime()+60*s*60*1e3)}},t.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)},t.prototype.setTimeAllowEdit=function(){this.allowEdit?this.readonly||this.inputElement.removeAttribute("readonly"):i.i(a.attributes)(this.inputElement,{readonly:""}),this.clearIconState()},t.prototype.clearIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&i.i(a.removeClass)([this.inputWrapper.container],["e-non-edit"]):""===this.inputElement.value?i.i(a.removeClass)([this.inputWrapper.container],["e-non-edit"]):i.i(a.addClass)([this.inputWrapper.container],["e-non-edit"])},t.prototype.validateDisable=function(){this.setMinMax(this.initMin,this.initMax),i.i(a.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))},t.prototype.validationAttribute=function(e,t){var s=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");t.setAttribute("name",s),e.removeAttribute("name");for(var n=["required","aria-required","form"],r=0;r<n.length;r++)if(!i.i(a.isNullOrUndefined)(e.getAttribute(n[r]))){var l=e.getAttribute(n[r]);t.setAttribute(n[r],l),e.removeAttribute(n[r])}},t.prototype.initialize=function(){this.globalize=new a.Internationalization(this.locale),this.defaultCulture=new a.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 a.L10n("timepicker",e,this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),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,i.i(a.isNullOrUndefined)(this.element.getAttribute("id"))?(this.element.id=i.i(a.getUniqueID)("ej2_timepicker"),null!==this.angularTag&&i.i(a.attributes)(this.inputElement,{id:this.element.id+"_input"})):null!==this.angularTag&&(this.inputElement.id=this.element.getAttribute("id")+"_input"),i.i(a.isNullOrUndefined)(this.inputElement.getAttribute("name"))&&i.i(a.attributes)(this.inputElement,{name:this.element.id}),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"})},t.prototype.checkTimeFormat=function(){if(this.format)if("string"==typeof this.format)this.formatString=this.format;else if(i.i(a.isNullOrUndefined)(this.format.skeleton)||""===this.format.skeleton)this.formatString=this.globalize.getDatePattern({type:"time",skeleton:"short"});else{var e=this.format.skeleton;this.formatString=this.globalize.getDatePattern({type:"time",skeleton:e})}else this.formatString=null},t.prototype.checkDateValue=function(e){return!i.i(a.isNullOrUndefined)(e)&&e instanceof Date&&!isNaN(+e)?e:null},t.prototype.createInputElement=function(){this.fullScreenMode&&a.Browser.isDevice&&(this.cssClass+=" e-popup-expand");var e=this.cssClass,t=!this.enableMask;i.i(a.isNullOrUndefined)(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),this.inputWrapper=r.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),i.i(a.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)||r.Input.addAttributes({style:this.inputStyle},this.inputElement),i.i(a.addClass)([this.inputWrapper.container],"e-time-wrapper")},t.prototype.getCldrDateTimeFormat=function(){var e=new a.Internationalization(this.locale),t=e.getDatePattern({skeleton:"yMd"});return this.isNullOrEmpty(this.formatString)?t+" "+this.cldrFormat("time"):this.formatString},t.prototype.checkInvalidValue=function(e){var t=!1;if("object"!=typeof e&&!i.i(a.isNullOrUndefined)(e)){var s=e;"string"==typeof s&&(s=s.trim());var n=null,r=null;if("number"==typeof e?s=e.toString():"string"==typeof e&&(/^[a-zA-Z0-9- ]*$/.test(e)||(n=this.setCurrentDate(this.getDateObject(e)),i.i(a.isNullOrUndefined)(n)&&(n=this.checkDateValue(this.globalize.parseDate(s,{format:this.getCldrDateTimeFormat(),type:"datetime"})),i.i(a.isNullOrUndefined)(n)&&(n=this.checkDateValue(this.globalize.parseDate(s,{format:this.formatString,type:"dateTime",skeleton:"yMd"})))))),r=this.globalize.parseDate(s,{format:this.getCldrDateTimeFormat(),type:"datetime"}),n=!i.i(a.isNullOrUndefined)(r)&&r instanceof Date&&!isNaN(+r)?r:null,i.i(a.isNullOrUndefined)(n)&&s.replace(/\s/g,"").length){var l=null,o=null;l=/^\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)?)?/,o=/^\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)?)?/,!l.test(s)&&!o.test(s)||/^[a-zA-Z0-9- ]*$/.test(e)||isNaN(+new Date(""+s))?t=!0:n=new Date(""+s)}t?(this.strictMode||(this.invalidValueString=s),this.setProperties({value:null},!0),this.initValue=null):(this.setProperties({value:n},!0),this.initValue=this.value)}},t.prototype.requiredModules=function(){var e=[];return this.enableMask&&e.push({args:[this],member:"MaskedDateTime"}),e},t.prototype.cldrFormat=function(e){return"en"===this.locale||"en-US"===this.locale?i.i(a.getValue)("timeFormats.short",i.i(a.getDefaultDateObject)()):this.getCultureTimeObject(a.cldrData,""+this.locale)},t.prototype.destroy=function(){this.hide(),this.unBindEvents();var t={"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&&(r.Input.removeAttributes(t,this.inputElement),null===this.angularTag&&this.inputWrapper.container.parentElement.appendChild(this.inputElement),i.i(a.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"),i.i(a.isNullOrUndefined)(this.cloneElement.getAttribute("disabled"))&&r.Input.setEnabled(!0,this.inputElement,this.floatLabelType)),this.inputWrapper.container&&i.i(a.detach)(this.inputWrapper.container),this.inputWrapper=this.popupWrapper=this.cloneElement=void 0,this.liCollections=this.timeCollections=this.disableItemCollection=[],i.i(a.isNullOrUndefined)(this.rippleFn)||this.rippleFn(),e.prototype.destroy.call(this),this.formElement&&a.EventHandler.remove(this.formElement,"reset",this.formResetHandler),this.rippleFn=null,this.openPopupEventArgs=null,this.selectedElement=null,this.listTag=null,this.liCollections=null},t.prototype.ensureInputAttribute=function(){for(var e=[],t=0;t<this.inputElement.attributes.length;t++)e[t]=this.inputElement.attributes[t].name;for(var t=0;t<e.length;t++)i.i(a.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])))},t.prototype.popupCreation=function(){this.popupWrapper=this.createElement("div",{className:c+" e-popup",attrs:{id:this.element.id+"_popup",style:"visibility:hidden"}}),i.i(a.isNullOrUndefined)(this.cssClass)||(this.popupWrapper.className+=" "+this.cssClass),!i.i(a.isNullOrUndefined)(this.step)&&this.step>0&&(this.generateList(),i.i(a.append)([this.listWrapper],this.popupWrapper)),this.addSelection(),this.renderPopup(),i.i(a.detach)(this.popupWrapper)},t.prototype.getPopupHeight=function(){var e=parseInt("240px",10),t=this.popupWrapper.getBoundingClientRect().height;return t>e?e:t},t.prototype.generateList=function(){this.createListItems(),this.wireListEvents();var e={duration:300,selector:"."+v};this.rippleFn=i.i(a.rippleEffect)(this.listWrapper,e),this.liCollections=this.listWrapper.querySelectorAll("."+v)},t.prototype.renderPopup=function(){var e=this;if(this.containerStyle=this.inputWrapper.container.getBoundingClientRect(),this.popupObj=new n.Popup(this.popupWrapper,{width:this.setPopupWidth(this.width),zIndex:this.zIndex,targetType:"relative",position:a.Browser.isDevice?{X:"center",Y:"center"}:{X:"left",Y:"bottom"},collision:a.Browser.isDevice?{X:"fit",Y:"fit"}:{X:"flip",Y:"flip"},enableRtl:this.enableRtl,relateTo:a.Browser.isDevice?document.body:this.inputWrapper.container,offsetY:4,open:function(){e.popupWrapper.style.visibility="visible",i.i(a.addClass)([e.inputWrapper.buttons[0]],"e-active")},close:function(){i.i(a.removeClass)([e.inputWrapper.buttons[0]],"e-active"),e.unWireListEvents(),e.inputElement.removeAttribute("aria-activedescendant"),i.i(a.remove)(e.popupObj.element),e.popupObj.destroy(),e.popupWrapper.innerHTML="",e.listWrapper=e.popupWrapper=e.listTag=void 0},targetExitViewport:function(){a.Browser.isDevice||e.hide()}}),a.Browser.isDevice||(this.popupObj.collision={X:"none",Y:"flip"}),a.Browser.isDevice&&this.fullScreenMode?(this.popupObj.element.style.maxHeight="100%",this.popupObj.element.style.width="100%"):this.popupObj.element.style.maxHeight="240px",a.Browser.isDevice&&this.fullScreenMode){var t=this.createElement("div",{className:"e-model-header"}),s=this.createElement("span",{className:"e-model-title"});s.textContent="Select time";var r=this.createElement("span",{className:"e-popup-close"});a.EventHandler.add(r,"mousedown touchstart",this.timePopupCloseHandler,this),t.appendChild(r),t.appendChild(s),this.popupWrapper.insertBefore(t,this.popupWrapper.firstElementChild)}},t.prototype.timePopupCloseHandler=function(e){this.hide()},t.prototype.getFormattedValue=function(e){return i.i(a.isNullOrUndefined)(this.checkDateValue(e))?null:this.globalize.formatDate(e,{skeleton:"medium",type:"time"})},t.prototype.getDateObject=function(e){if(!this.isNullOrEmpty(e)){var t=this.createDateObj(e),i=!this.isNullOrEmpty(this.initValue);if(this.checkDateValue(t)){var s=i?this.initValue.getDate():u,a=i?this.initValue.getMonth():d,n=i?this.initValue.getFullYear():p;return new Date(n,a,s,t.getHours(),t.getMinutes(),t.getSeconds())}}return null},t.prototype.updateHtmlAttributeToWrapper=function(){if(!i.i(a.isNullOrUndefined)(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var s=t[e];if(y.indexOf(s)>-1)if("class"===s){var n=this.htmlAttributes[""+s].replace(/\s+/g," ").trim();""!==n&&i.i(a.addClass)([this.inputWrapper.container],n.split(" "))}else if("style"===s){var r=this.inputWrapper.container.getAttribute(s);r=i.i(a.isNullOrUndefined)(r)?this.htmlAttributes[""+s]:r+this.htmlAttributes[""+s],this.inputWrapper.container.setAttribute(s,r)}else this.inputWrapper.container.setAttribute(s,this.htmlAttributes[""+s])}},t.prototype.updateHtmlAttributeToElement=function(){if(!i.i(a.isNullOrUndefined)(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var s=t[e];y.indexOf(s)<0&&this.inputElement.setAttribute(s,this.htmlAttributes[""+s])}},t.prototype.updateCssClass=function(e,t){i.i(a.isNullOrUndefined)(t)||(t=t.replace(/\s+/g," ").trim()),i.i(a.isNullOrUndefined)(e)||(e=e.replace(/\s+/g," ").trim()),r.Input.setCssClass(e,[this.inputWrapper.container],t),this.popupWrapper&&r.Input.setCssClass(e,[this.popupWrapper],t)},t.prototype.removeErrorClass=function(){i.i(a.removeClass)([this.inputWrapper.container],"e-error"),i.i(a.attributes)(this.inputElement,{"aria-invalid":"false"})},t.prototype.checkErrorState=function(e){var t=this.getDateObject(e);this.validateState(t)&&!this.invalidValueString||this.enableMask&&this.inputElement.value===this.maskedDateValue?this.removeErrorClass():(i.i(a.addClass)([this.inputWrapper.container],"e-error"),i.i(a.attributes)(this.inputElement,{"aria-invalid":"true"}))},t.prototype.validateInterval=function(){!i.i(a.isNullOrUndefined)(this.step)&&this.step>0?this.enableElement([this.inputWrapper.buttons[0]]):this.disableTimeIcon()},t.prototype.disableTimeIcon=function(){this.disableElement([this.inputWrapper.buttons[0]]),this.hide()},t.prototype.disableElement=function(e){i.i(a.addClass)(e,m)},t.prototype.enableElement=function(e){i.i(a.removeClass)(e,m)},t.prototype.selectInputText=function(){this.inputElement.setSelectionRange(0,this.inputElement.value.length)},t.prototype.setCursorToEnd=function(){this.inputElement.setSelectionRange(this.inputElement.value.length,this.inputElement.value.length)},t.prototype.getMeridianText=function(){var e;if("en"===this.locale||"en-US"===this.locale)e=i.i(a.getValue)("dayPeriods.format.wide",i.i(a.getDefaultDateObject)());else{e=i.i(a.getValue)("main."+this.locale+".dates.calendars.gregorian.dayPeriods.format.abbreviated",a.cldrData)}return e},t.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)}},t.prototype.getActiveElement=function(){return i.i(a.isNullOrUndefined)(this.popupWrapper)?null:this.popupWrapper.querySelectorAll(".e-active")},t.prototype.isNullOrEmpty=function(e){return!!(i.i(a.isNullOrUndefined)(e)||"string"==typeof e&&""===e.trim())},t.prototype.setWidth=function(e){return e="number"==typeof e?i.i(a.formatUnit)(e):"string"==typeof e?e.match(/px|%|em/)?e:i.i(a.formatUnit)(e):"100%"},t.prototype.setPopupWidth=function(e){if(e=this.setWidth(e),e.indexOf("%")>-1){e=(this.containerStyle.width*parseFloat(e)/100).toString()+"px"}return e},t.prototype.setScrollPosition=function(){var e=this.selectedElement;i.i(a.isNullOrUndefined)(e)?this.popupWrapper&&this.checkDateValue(this.scrollTo)&&this.setScrollTo():this.findScrollTop(e)},t.prototype.findScrollTop=function(e){var t=this.getPopupHeight(),i=e.nextElementSibling,s=i?i.offsetTop:e.offsetTop,a=e.getBoundingClientRect().height;s+e.offsetTop>t?this.popupWrapper.scrollTop=i?s-(t/2+a/2):s:this.popupWrapper.scrollTop=0},t.prototype.setScrollTo=function(){var e;if(i.i(a.isNullOrUndefined)(this.popupWrapper))this.popupWrapper.scrollTop=0;else{var t=this.popupWrapper.querySelectorAll("."+v);if(t.length){var s=this.timeCollections[0],n=this.getDateObject(this.checkDateValue(this.scrollTo)).getTime();e=t[Math.round((n-s)/(6e4*this.step))]}}i.i(a.isNullOrUndefined)(e)?this.popupWrapper.scrollTop=0:this.findScrollTop(e)},t.prototype.getText=function(){return i.i(a.isNullOrUndefined)(this.checkDateValue(this.value))?"":this.getValue(this.value)},t.prototype.getValue=function(e){return i.i(a.isNullOrUndefined)(this.checkDateValue(e))?null:this.globalize.formatDate(e,{format:this.cldrTimeFormat(),type:"time"})},t.prototype.cldrDateFormat=function(){return"en"===this.locale||"en-US"===this.locale?i.i(a.getValue)("dateFormats.short",i.i(a.getDefaultDateObject)()):this.getCultureDateObject(a.cldrData,""+this.locale)},t.prototype.cldrTimeFormat=function(){return this.isNullOrEmpty(this.formatString)?"en"===this.locale||"en-US"===this.locale?i.i(a.getValue)("timeFormats.short",i.i(a.getDefaultDateObject)()):this.getCultureTimeObject(a.cldrData,""+this.locale):this.formatString},t.prototype.dateToNumeric=function(){return"en"===this.locale||"en-US"===this.locale?i.i(a.getValue)("timeFormats.medium",i.i(a.getDefaultDateObject)()):i.i(a.getValue)("main."+this.locale+".dates.calendars.gregorian.timeFormats.medium",a.cldrData)},t.prototype.getExactDateTime=function(e){return i.i(a.isNullOrUndefined)(this.checkDateValue(e))?null:this.globalize.formatDate(e,{format:this.dateToNumeric(),type:"time"})},t.prototype.setValue=function(e){var t=this.checkValue(e);this.strictMode||this.validateState(t)?this.isNullOrEmpty(t)?(this.initValue=null,this.validateMinMax(this.value,this.min,this.max)):this.initValue=this.compareFormatChange(t):(null===this.checkDateValue(this.valueWithMinutes)&&(this.initValue=this.valueWithMinutes=null),this.validateMinMax(this.value,this.min,this.max)),this.updateInput(!0,this.initValue)},t.prototype.compareFormatChange=function(e){return i.i(a.isNullOrUndefined)(e)?null:e!==this.getText()?this.getDateObject(e):this.getDateObject(this.value)},t.prototype.updatePlaceHolder=function(){r.Input.setPlaceholder(this.l10n.getConstant("placeholder"),this.inputElement)},t.prototype.updateInputValue=function(e){r.Input.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton)},t.prototype.preventEventBubbling=function(e){e.preventDefault(),this.interopAdaptor.invokeMethodAsync("OnTimeIconClick")},t.prototype.popupHandler=function(e){this.enabled&&(a.Browser.isDevice&&this.inputElement.setAttribute("readonly",""),e.preventDefault(),this.isPopupOpen()?this.closePopup(0,e):(this.inputElement.focus(),this.show(e)))},t.prototype.mouseDownHandler=function(){this.enabled&&(this.readonly||(this.inputElement.setSelectionRange(0,0),a.EventHandler.add(this.inputElement,"mouseup",this.mouseUpHandler,this)))},t.prototype.mouseUpHandler=function(e){if(!this.readonly){if(e.preventDefault(),this.enableMask)return e.preventDefault(),void this.notify("setMaskSelection",{module:"MaskedDateTime"});a.EventHandler.remove(this.inputElement,"mouseup",this.mouseUpHandler);var t=this.getCursorSelection();0===t.start&&t.end===this.inputElement.value.length||(this.inputElement.value.length>0&&(this.cursorDetails=this.focusSelection()),this.inputElement.setSelectionRange(this.cursorDetails.start,this.cursorDetails.end))}},t.prototype.focusSelection=function(){var e=new RegExp("^[a-zA-Z0-9]+$"),t=this.inputElement.value.split("");t.push(" ");var i=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){a=a,this.isTextSelected=!0;break}s=r+1,n=!1}return{start:s,end:a}},t.prototype.inputHandler=function(e){if(!this.readonly&&this.enabled)switch("right"!==e.action&&"left"!==e.action&&"tab"!==e.action&&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.enableMask&&!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}},t.prototype.onMouseClick=function(e){var t=e.target,s=this.selectedElement=i.i(a.closest)(t,"."+v);this.setSelection(s,e),s&&s.classList.contains(v)&&this.hide()},t.prototype.closePopup=function(e,t){var s=this;if(this.isPopupOpen()&&this.popupWrapper){var n={popup:this.popupObj,event:t||null,cancel:!1,name:"open"};i.i(a.removeClass)([document.body],"e-time-overflow"),this.trigger("close",n,function(t){if(!t.cancel){var n={name:"FadeOut",duration:50,delay:e||0};s.popupObj.hide(new a.Animation(n)),i.i(a.removeClass)([s.inputWrapper.container],["e-icon-anim"]),i.i(a.attributes)(s.inputElement,{"aria-expanded":"false"}),s.inputElement.removeAttribute("aria-owns"),s.inputElement.removeAttribute("aria-activedescendant"),a.EventHandler.remove(document,"mousedown touchstart",s.documentClickHandler)}a.Browser.isDevice&&s.modal&&(s.modal.style.display="none",s.modal.outerHTML="",s.modal=null),a.Browser.isDevice&&(i.i(a.isNullOrUndefined)(s.mobileTimePopupWrap)||(s.mobileTimePopupWrap.remove(),s.mobileTimePopupWrap=null)),a.Browser.isDevice&&s.allowEdit&&!s.readonly&&s.inputElement.removeAttribute("readonly")})}else a.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly")},t.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")},t.prototype.checkValueChange=function(e,t){if(this.strictMode||this.validateState(this.valueWithMinutes))if(t){var s=this.getDateObject(new Date(this.timeCollections[this.activeIndex]));+this.prevDate!=+s&&this.valueProcess(e,s)}else(this.prevValue!==this.inputElement.value||i.i(a.isNullOrUndefined)(this.checkDateValue(this.value)))&&this.valueProcess(e,this.compareFormatChange(this.inputElement.value));else 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)},t.prototype.onMouseOver=function(e){var t=i.i(a.closest)(e.target,"."+v);this.setHover(t,"e-hover")},t.prototype.setHover=function(e,t){this.enabled&&this.isValidLI(e)&&!e.classList.contains(t)&&(this.removeHover(t),i.i(a.addClass)([e],t),"e-navigation"===t&&e.setAttribute("aria-selected","true"))},t.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]),i.i(a.addClass)([this.selectedElement],"e-active"),this.selectedElement.setAttribute("aria-selected","true"),this.checkValueChange(t,!0))},t.prototype.onMouseLeave=function(){this.removeHover("e-hover")},t.prototype.scrollHandler=function(){"timepicker"===this.getModuleName()&&a.Browser.isDevice||this.hide()},t.prototype.setMinMax=function(e,t){i.i(a.isNullOrUndefined)(this.checkDateValue(e))&&(this.initMin=this.getDateObject("12:00:00 AM")),i.i(a.isNullOrUndefined)(this.checkDateValue(t))&&(this.initMax=this.getDateObject("11:59:59 PM"))},t.prototype.validateMinMax=function(e,t,s){var n=e instanceof Date?e:this.getDateObject(e);return i.i(a.isNullOrUndefined)(this.checkDateValue(n))?+this.createDateObj(this.getFormattedValue(this.initMin))>+this.createDateObj(this.getFormattedValue(this.initMax))&&this.disableTimeIcon():e=this.strictOperation(this.initMin,this.initMax,e,n),this.strictMode&&(e=this.valueIsDisable(e)?e:null),this.checkErrorState(e),e},t.prototype.valueIsDisable=function(e){if(this.disableItemCollection.length>0){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},t.prototype.validateState=function(e){if(!this.strictMode){if(!this.valueIsDisable(e))return!1;var t=this.setCurrentDate(this.getDateObject(e)),s=this.setCurrentDate(this.getDateObject(this.initMax)),n=this.setCurrentDate(this.getDateObject(this.initMin));if(i.i(a.isNullOrUndefined)(this.checkDateValue(t))){if(+s<+n||""!==this.inputElement.value)return!1}else if(+t>+s||+t<+n)return!1}return!0},t.prototype.strictOperation=function(e,t,i,s){var a=this.createDateObj(this.getFormattedValue(t)),n=this.createDateObj(this.getFormattedValue(e)),r=this.createDateObj(this.getFormattedValue(s));if(this.strictMode){if(+n>+a)return this.disableTimeIcon(),this.initValue=this.getDateObject(a),this.updateInputValue(this.getValue(this.initValue)),this.enableMask&&this.createMask(),this.inputElement.value;if(+n>=+r)return this.getDateObject(n);if(+r>=+a||+n==+a)return this.getDateObject(a)}else if(+n>+a&&(this.disableTimeIcon(),!isNaN(+this.createDateObj(i))))return i;return i},t.prototype.bindEvents=function(){a.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.popupHandler,this),a.EventHandler.add(this.inputElement,"blur",this.inputBlurHandler,this),a.EventHandler.add(this.inputElement,"focus",this.inputFocusHandler,this),a.EventHandler.add(this.inputElement,"change",this.inputChangeHandler,this),a.EventHandler.add(this.inputElement,"input",this.inputEventHandler,this),this.enableMask&&a.EventHandler.add(this.inputElement,"keydown",this.keydownHandler,this),this.showClearButton&&this.inputWrapper.clearButton&&a.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.clearHandler,this),this.formElement&&a.EventHandler.add(this.formElement,"reset",this.formResetHandler,this),a.Browser.isDevice||(this.keyConfigure=i.i(a.extend)(this.keyConfigure,this.keyConfigs),this.inputEvent=new a.KeyboardEvents(this.inputWrapper.container,{keyAction:this.inputHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}),this.showClearButton&&this.inputElement&&a.EventHandler.add(this.inputElement,"mousedown",this.mouseDownHandler,this))},t.prototype.keydownHandler=function(e){switch(e.code){case"Delete":!this.enableMask||this.popupObj||this.readonly||this.notify("keyDownHandler",{module:"MaskedDateTime",e:e})}},t.prototype.formResetHandler=function(){if(this.enabled&&!this.inputElement.disabled){var e=this.inputElement.getAttribute("value"),t=this.checkDateValue(this.inputEleValue);"EJS-TIMEPICKER"===this.element.tagName&&(t=null,e="",this.inputElement.setAttribute("value","")),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)}},t.prototype.inputChangeHandler=function(e){this.enabled&&e.stopPropagation()},t.prototype.inputEventHandler=function(){this.enableMask&&this.notify("inputHandler",{module:"MaskedDateTime"})},t.prototype.unBindEvents=function(){this.inputWrapper&&a.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown touchstart",this.popupHandler),a.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),a.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),a.EventHandler.remove(this.inputElement,"change",this.inputChangeHandler),a.EventHandler.remove(this.inputElement,"input",this.inputEventHandler),this.inputEvent&&this.inputEvent.destroy(),a.EventHandler.remove(this.inputElement,"mousedown touchstart",this.mouseDownHandler),!this.showClearButton||i.i(a.isNullOrUndefined)(this.inputWrapper)||i.i(a.isNullOrUndefined)(this.inputWrapper.clearButton)||a.EventHandler.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.clearHandler),this.formElement&&a.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},t.prototype.bindClearEvent=function(){this.showClearButton&&this.inputWrapper.clearButton&&a.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.clearHandler,this)},t.prototype.raiseClearedEvent=function(e){var t={event:e};this.trigger("cleared",t)},t.prototype.clearHandler=function(e){if(this.enabled&&(e.preventDefault(),i.i(a.isNullOrUndefined)(this.value)?(this.resetState(),this.raiseClearedEvent(e)):this.clear(e),this.popupWrapper&&(this.popupWrapper.scrollTop=0),this.enableMask&&this.notify("clearHandler",{module:"MaskedDateTime"}),i.i(a.closest)(this.element,"form"))){var t=this.element,s=document.createEvent("KeyboardEvent");s.initEvent("keyup",!1,!0),t.dispatchEvent(s)}},t.prototype.clear=function(e){this.setProperties({value:null},!0),this.initValue=null,this.resetState(),this.raiseClearedEvent(e),this.changeEvent(e)},t.prototype.setZIndex=function(){this.popupObj&&(this.popupObj.zIndex=this.zIndex,this.popupObj.dataBind())},t.prototype.checkAttributes=function(e){for(var t,s=e?i.i(a.isNullOrUndefined)(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["step","disabled","readonly","style","name","value","min","max","placeholder"],n=0,r=s;n<r.length;n++){var l=r[n];if(!i.i(a.isNullOrUndefined)(this.inputElement.getAttribute(l)))switch(l){case"disabled":if(i.i(a.isNullOrUndefined)(this.timeOptions)||void 0===this.timeOptions.enabled||e){var o="disabled"!==this.inputElement.getAttribute(l)&&""!==this.inputElement.getAttribute(l)&&"true"!==this.inputElement.getAttribute(l);this.setProperties({enabled:o},!e)}break;case"style":this.inputStyle=this.inputElement.getAttribute(l);break;case"readonly":if(i.i(a.isNullOrUndefined)(this.timeOptions)||void 0===this.timeOptions.readonly||e){var h="readonly"===this.inputElement.getAttribute(l)||""===this.inputElement.getAttribute(l)||"true"===this.inputElement.getAttribute(l);this.setProperties({readonly:h},!e)}break;case"name":this.inputElement.setAttribute("name",this.inputElement.getAttribute(l));break;case"step":this.step=parseInt(this.inputElement.getAttribute(l),10);break;case"placeholder":(i.i(a.isNullOrUndefined)(this.timeOptions)||void 0===this.timeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(l)},!e);break;case"min":(i.i(a.isNullOrUndefined)(this.timeOptions)||void 0===this.timeOptions.min||e)&&(t=new Date(this.inputElement.getAttribute(l)),i.i(a.isNullOrUndefined)(this.checkDateValue(t))||this.setProperties({min:t},!e));break;case"max":(i.i(a.isNullOrUndefined)(this.timeOptions)||void 0===this.timeOptions.max||e)&&(t=new Date(this.inputElement.getAttribute(l)),i.i(a.isNullOrUndefined)(this.checkDateValue(t))||this.setProperties({max:t},!e));break;case"value":(i.i(a.isNullOrUndefined)(this.timeOptions)||void 0===this.timeOptions.value||e)&&(t=new Date(this.inputElement.getAttribute(l)),i.i(a.isNullOrUndefined)(this.checkDateValue(t))||(this.initValue=t,this.updateInput(!1,this.initValue),this.setProperties({value:t},!e)))}}},t.prototype.setCurrentDate=function(e){return i.i(a.isNullOrUndefined)(this.checkDateValue(e))?null:new Date(p,d,u,e.getHours(),e.getMinutes(),e.getSeconds())},t.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(t[i].toLowerCase().indexOf("h")>=0){e=i;break}return e},t.prototype.updateValue=function(e,t){var s;if(this.isNullOrEmpty(e))this.resetState();else if(s=this.checkValue(e),this.strictMode){var n=null===s&&e.trim().length>0?this.previousState(this.prevDate):this.inputElement.value;this.updateInputValue(n),this.enableMask&&(n||this.updateInputValue(this.maskedDateValue),i.i(a.isNullOrUndefined)(s)&&e!==this.maskedDateValue&&this.createMask(),i.i(a.isNullOrUndefined)(s)&&e===this.maskedDateValue&&this.updateInputValue(this.maskedDateValue))}this.checkValueChange(t,"string"!=typeof e)},t.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.prevValue},t.prototype.resetState=function(){this.removeSelection(),r.Input.setValue("",this.inputElement,this.floatLabelType,!1),this.valueWithMinutes=this.activeIndex=null,this.strictMode||this.checkErrorState(null)},t.prototype.objToString=function(e){return i.i(a.isNullOrUndefined)(this.checkDateValue(e))?null:this.globalize.formatDate(e,{format:this.cldrTimeFormat(),type:"time"})},t.prototype.checkValue=function(e){if(!this.isNullOrEmpty(e)){var t=e instanceof Date?e:this.getDateObject(e);return this.validateValue(t,e)}return this.resetState(),this.valueWithMinutes=null},t.prototype.validateValue=function(e,t){var s,n=this.validateMinMax(t,this.min,this.max),r=this.createDateObj(n);if(this.getFormattedValue(r)!==this.getFormattedValue(this.value)?(this.valueWithMinutes=i.i(a.isNullOrUndefined)(r)?null:r,s=this.objToString(this.valueWithMinutes)):(this.strictMode&&(e=r),this.valueWithMinutes=this.checkDateValue(e),s=this.objToString(this.valueWithMinutes)),!this.strictMode&&i.i(a.isNullOrUndefined)(s)){var l=n.trim().length>0?n:"";this.updateInputValue(l),this.enableMask&&(l||this.updateInputValue(this.maskedDateValue))}else this.updateInputValue(s),this.enableMask&&(""===s&&this.updateInputValue(this.maskedDateValue),i.i(a.isNullOrUndefined)(s)&&t!==this.maskedDateValue&&this.createMask(),i.i(a.isNullOrUndefined)(s)&&t===this.maskedDateValue&&this.updateInputValue(this.maskedDateValue));return s},t.prototype.createMask=function(){this.notify("createMask",{module:"MaskedDateTime"})},t.prototype.findNextElement=function(e){var t=this.inputElement.value,s=i.i(a.isNullOrUndefined)(this.valueWithMinutes)?this.createDateObj(t):this.getDateObject(this.valueWithMinutes),n=null,r=this.liCollections.length,l=this.timeCollections;if(i.i(a.isNullOrUndefined)(this.checkDateValue(s))&&i.i(a.isNullOrUndefined)(this.activeIndex))this.selectNextItem(e);else{if("home"===e.action){var o=this.validLiElement(0);n=+this.createDateObj(new Date(this.timeCollections[o])),this.activeIndex=o}else if("end"===e.action){var o=this.validLiElement(l.length-1,!0);n=+this.createDateObj(new Date(this.timeCollections[o])),this.activeIndex=o}else if("down"===e.action)for(var h=0;h<r;h++){if(+s<this.timeCollections[h]){var o=this.validLiElement(h);n=+this.createDateObj(new Date(this.timeCollections[o])),this.activeIndex=o;break}if(h===r-1){var o=this.validLiElement(0);n=+this.createDateObj(new Date(this.timeCollections[o])),this.activeIndex=o;break}}else for(var h=r-1;h>=0;h--){if(+s>this.timeCollections[h]){var o=this.validLiElement(h,!0);n=+this.createDateObj(new Date(this.timeCollections[o])),this.activeIndex=o;break}if(0===h){var o=this.validLiElement(r-1);n=+this.createDateObj(new Date(this.timeCollections[o])),this.activeIndex=o;break}}this.selectedElement=this.liCollections[this.activeIndex],this.elementValue(i.i(a.isNullOrUndefined)(n)?null:new Date(n))}},t.prototype.selectNextItem=function(e){var t=this.validLiElement(0,"down"!==e.action);this.activeIndex=t,this.selectedElement=this.liCollections[t],this.elementValue(new Date(this.timeCollections[t]))},t.prototype.elementValue=function(e){i.i(a.isNullOrUndefined)(this.checkDateValue(e))||this.checkValue(e)},t.prototype.validLiElement=function(e,t){var s=null,n=i.i(a.isNullOrUndefined)(this.popupWrapper)?this.liCollections:this.popupWrapper.querySelectorAll("."+v),r=!0;if(n.length)if(t)for(var l=e;l>=0;l--){if(!n[l].classList.contains(m)){s=l;break}0===l&&r&&(e=l=n.length,r=!1)}else for(var l=e;l<=n.length-1;l++){if(!n[l].classList.contains(m)){s=l;break}l===n.length-1&&r&&(e=l=-1,r=!1)}return s},t.prototype.keyHandler=function(e){if(!(i.i(a.isNullOrUndefined)(this.step)||this.step<=0||!i.i(a.isNullOrUndefined)(this.inputWrapper)&&this.inputWrapper.buttons[0].classList.contains(m))){var t=this.timeCollections.length;if(i.i(a.isNullOrUndefined)(this.getActiveElement())||0===this.getActiveElement().length)if(this.liCollections.length>0)if(i.i(a.isNullOrUndefined)(this.value)&&i.i(a.isNullOrUndefined)(this.activeIndex)){var s=this.validLiElement(0,"down"!==e.action);this.activeIndex=s,this.selectedElement=this.liCollections[s],this.elementValue(new Date(this.timeCollections[s]))}else this.findNextElement(e);else this.findNextElement(e);else{var n=void 0;if(e.keyCode>=37&&e.keyCode<=40){var 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),n=i.i(a.isNullOrUndefined)(this.timeCollections[s])?this.timeCollections[0]:this.timeCollections[s]}else if("home"===e.action){var s=this.validLiElement(0);this.activeIndex=s,n=this.timeCollections[s]}else if("end"===e.action){var s=this.validLiElement(t-1,!0);this.activeIndex=s,n=this.timeCollections[s]}this.selectedElement=this.liCollections[this.activeIndex],this.elementValue(new Date(n))}this.isNavigate=!0,this.setHover(this.selectedElement,"e-navigation"),this.setActiveDescendant(),this.selectInputText(),!this.isPopupOpen()||null===this.selectedElement||e&&"click"===e.type||this.setScrollPosition()}},t.prototype.getCultureTimeObject=function(e,t){return i.i(a.getValue)("main."+t+".dates.calendars.gregorian.timeFormats.short",e)},t.prototype.getCultureDateObject=function(e,t){return i.i(a.getValue)("main."+t+".dates.calendars.gregorian.dateFormats.short",e)},t.prototype.wireListEvents=function(){a.EventHandler.add(this.listWrapper,"click",this.onMouseClick,this),a.Browser.isDevice||(a.EventHandler.add(this.listWrapper,"mouseover",this.onMouseOver,this),a.EventHandler.add(this.listWrapper,"mouseout",this.onMouseLeave,this))},t.prototype.unWireListEvents=function(){this.listWrapper&&(a.EventHandler.remove(this.listWrapper,"click",this.onMouseClick),a.Browser.isDevice||(a.EventHandler.remove(this.listWrapper,"mouseover",this.onMouseOver),a.EventHandler.remove(this.listWrapper,"mouseout",this.onMouseLeave)))},t.prototype.valueProcess=function(e,t){var s=i.i(a.isNullOrUndefined)(this.checkDateValue(t))?null:t;+this.prevDate!=+s&&(this.initValue=s,this.changeEvent(e))},t.prototype.changeEvent=function(e){this.addSelection(),this.updateInput(!0,this.initValue);var t={event:e||null,value:this.value,text:this.inputElement.value,isInteracted:!i.i(a.isNullOrUndefined)(e),element:this.element};t.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",t),this.invalidValueString=null,this.checkErrorState(this.value)},t.prototype.updateInput=function(e,t){e&&(this.prevValue=this.getValue(t)),this.prevDate=this.valueWithMinutes=t,"number"==typeof t&&(this.value&&+new Date(+this.value).setMilliseconds(0))===+t||(this.setProperties({value:t},!0),this.enableMask&&this.value&&this.createMask()),!this.strictMode&&i.i(a.isNullOrUndefined)(this.value)&&this.invalidValueString&&(this.checkErrorState(this.invalidValueString),this.updateInputValue(this.invalidValueString)),this.clearIconState()},t.prototype.setActiveDescendant=function(){!i.i(a.isNullOrUndefined)(this.selectedElement)&&this.value?i.i(a.attributes)(this.inputElement,{"aria-activedescendant":this.selectedElement.getAttribute("id")}):this.inputElement.removeAttribute("aria-activedescendant")},t.prototype.removeSelection=function(){if(this.removeHover("e-hover"),!i.i(a.isNullOrUndefined)(this.popupWrapper)){var e=this.popupWrapper.querySelectorAll(".e-active");e.length&&(i.i(a.removeClass)(e,"e-active"),e[0].removeAttribute("aria-selected"))}},t.prototype.removeHover=function(e){var t=this.getHoverItem(e);t&&t.length&&(i.i(a.removeClass)(t,e),"e-navigation"===e&&t[0].removeAttribute("aria-selected"))},t.prototype.getHoverItem=function(e){var t;return i.i(a.isNullOrUndefined)(this.popupWrapper)||(t=this.popupWrapper.querySelectorAll("."+e)),t},t.prototype.setActiveClass=function(){if(!i.i(a.isNullOrUndefined)(this.popupWrapper)){var e=this.popupWrapper.querySelectorAll("."+v);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}}},t.prototype.addSelection=function(){this.selectedElement=null,this.removeSelection(),this.setActiveClass(),i.i(a.isNullOrUndefined)(this.selectedElement)||(i.i(a.addClass)([this.selectedElement],"e-active"),this.selectedElement.setAttribute("aria-selected","true"))},t.prototype.isValidLI=function(e){return e&&e.classList.contains(v)&&!e.classList.contains(m)},t.prototype.createDateObj=function(e){var t=this.globalize.formatDate(new Date,{format:null,skeleton:"short",type:"date"}),s=null;return"string"==typeof e?e.toUpperCase().indexOf("AM")>-1||e.toUpperCase().indexOf("PM")>-1?(t=this.defaultCulture.formatDate(new Date,{format:null,skeleton:"short",type:"date"}),s=isNaN(+new Date(t+" "+e))?null:new Date(new Date(t+" "+e).setMilliseconds(0)),i.i(a.isNullOrUndefined)(s)&&(s=this.timeParse(t,e))):s=this.timeParse(t,e):e instanceof Date&&(s=e),s},t.prototype.timeParse=function(e,t){var s;return s=this.globalize.parseDate(e+" "+t,{format:this.cldrDateFormat()+" "+this.cldrTimeFormat(),type:"datetime"}),s=i.i(a.isNullOrUndefined)(s)?this.globalize.parseDate(e+" "+t,{format:this.cldrDateFormat()+" "+this.dateToNumeric(),type:"datetime"}):s,s=i.i(a.isNullOrUndefined)(s)?s:new Date(s.setMilliseconds(0))},t.prototype.createListItems=function(){var e=this;this.listWrapper=this.createElement("div",{className:"e-content",attrs:{tabindex:"-1"}});var t,s=6e4*this.step,n=[];this.timeCollections=[],this.disableItemCollection=[],t=+this.getDateObject(this.initMin).setMilliseconds(0);for(var r=+this.getDateObject(this.initMax).setMilliseconds(0);r>=t;)this.timeCollections.push(t),n.push(this.globalize.formatDate(new Date(t),{format:this.cldrTimeFormat(),type:"time"})),t+=s;var o={itemCreated:function(t){var i={element:t.item,text:t.text,value:e.getDateObject(t.text),isDisabled:!1};e.trigger("itemRender",i,function(t){t.isDisabled&&t.element.classList.add(m),t.element.classList.contains(m)&&e.disableItemCollection.push(t.element.getAttribute("data-value"))})}};this.listTag=l.ListBase.createList(this.createElement,n,o,!0),i.i(a.attributes)(this.listTag,{role:"listbox","aria-hidden":"false",id:this.element.id+"_options",tabindex:"0"}),i.i(a.append)([this.listTag],this.listWrapper)},t.prototype.documentClickHandler=function(e){var t=e.target;i.i(a.isNullOrUndefined)(this.popupObj)||i.i(a.isNullOrUndefined)(this.inputWrapper)||!(this.inputWrapper.container.contains(t)&&"mousedown"!==e.type||this.popupObj.element&&this.popupObj.element.contains(t))||"touchstart"===e.type||e.preventDefault(),i.i(a.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&&(a.Browser.isDevice||(this.isPreventBlur=(a.Browser.isIE||"edge"===a.Browser.info.name)&&document.activeElement===this.inputElement&&t===this.popupWrapper)):this.isPopupOpen()&&(this.hide(),this.focusOut())},t.prototype.setEnableRtl=function(){r.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]),this.popupObj&&(this.popupObj.enableRtl=this.enableRtl,this.popupObj.dataBind())},t.prototype.setEnable=function(){r.Input.setEnabled(this.enabled,this.inputElement,this.floatLabelType),this.enabled?(i.i(a.removeClass)([this.inputWrapper.container],m),i.i(a.attributes)(this.inputElement,{"aria-disabled":"false"}),this.inputElement.setAttribute("tabindex",this.tabIndex)):(this.hide(),i.i(a.addClass)([this.inputWrapper.container],m),i.i(a.attributes)(this.inputElement,{"aria-disabled":"true"}),this.inputElement.tabIndex=-1)},t.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)},t.prototype.inputBlurHandler=function(e){if(this.enabled){if(this.isPreventBlur&&this.isPopupOpen())return void 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("")),i.i(a.removeClass)([this.inputWrapper.container],[f]);var t={model:this};this.trigger("blur",t),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)}},t.prototype.focusOut=function(){if(document.activeElement===this.inputElement){this.inputElement.blur(),i.i(a.removeClass)([this.inputWrapper.container],[f]);var e={model:this};this.trigger("blur",e)}},t.prototype.isPopupOpen=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains(""+c))},t.prototype.inputFocusHandler=function(){if(this.enabled){var e={model:this};this.readonly||a.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.trigger("focus",e),this.clearIconState(),this.openOnFocus&&this.show()}},t.prototype.focusIn=function(){document.activeElement!==this.inputElement&&this.enabled&&this.inputElement.focus()},t.prototype.hide=function(){this.closePopup(100,null),this.clearIconState()},t.prototype.show=function(e){var t=this;if(!(this.enabled&&this.readonly||!this.enabled||this.popupWrapper)){this.popupCreation(),a.Browser.isDevice&&this.listWrapper&&(this.modal=this.createElement("div"),this.modal.className=c+" e-time-modal",document.body.className+=" e-time-overflow",document.body.appendChild(this.modal)),a.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:a.Browser.isDevice?this.mobileTimePopupWrap:document.body};var s=this.openPopupEventArgs;this.trigger("open",s,function(e){if(t.openPopupEventArgs=e,t.openPopupEventArgs.cancel||t.inputWrapper.buttons[0].classList.contains(m))t.popupObj.destroy(),t.popupWrapper=t.listTag=void 0,t.liCollections=t.timeCollections=t.disableItemCollection=[],t.popupObj=null;else{t.openPopupEventArgs.appendTo.appendChild(t.popupWrapper),t.popupAlignment(t.openPopupEventArgs),t.setScrollPosition(),a.Browser.isDevice||t.inputElement.focus();var s={name:"FadeIn",duration:50};t.popupObj.refreshPosition(t.anchor),1e3===t.zIndex?t.popupObj.show(new a.Animation(s),t.element):t.popupObj.show(new a.Animation(s),null),t.setActiveDescendant(),i.i(a.attributes)(t.inputElement,{"aria-expanded":"true"}),i.i(a.attributes)(t.inputElement,{"aria-owns":t.inputElement.id+"_options"}),i.i(a.addClass)([t.inputWrapper.container],f),a.EventHandler.add(document,"mousedown touchstart",t.documentClickHandler,t),t.setOverlayIndex(t.mobileTimePopupWrap,t.popupObj.element,t.modal,a.Browser.isDevice)}})}},t.prototype.setOverlayIndex=function(e,t,s,n){if(n&&!i.i(a.isNullOrUndefined)(t)&&!i.i(a.isNullOrUndefined)(s)&&!i.i(a.isNullOrUndefined)(e)){var r=parseInt(t.style.zIndex,10)?parseInt(t.style.zIndex,10):1e3;s.style.zIndex=(r-1).toString(),e.style.zIndex=r.toString()}},t.prototype.formatValues=function(e){var t;return"number"==typeof e?t=i.i(a.formatUnit)(e):"string"==typeof e&&(t=e.match(/px|%|em/)?e:isNaN(parseInt(e,10))?e:i.i(a.formatUnit)(e)),t},t.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)),a.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")}},t.prototype.getPersistData=function(){var e=["value"];return this.addOnPersist(e)},t.prototype.getModuleName=function(){return"timepicker"},t.prototype.onPropertyChanged=function(e,t){for(var s=0,n=Object.keys(e);s<n.length;s++){var l=n[s];switch(l){case"placeholder":r.Input.setPlaceholder(e.placeholder,this.inputElement);break;case"readonly":r.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,l);break;case"showClearButton":r.Input.setClearButton(this.showClearButton,this.inputElement,this.inputWrapper),this.bindClearEvent();break;case"locale":this.setProperties({locale:e.locale},!0),this.globalize=new a.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.updatePlaceHolder(),this.setValue(this.value),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"});break;case"width":i.i(a.setStyleAttribute)(this.inputWrapper.container,{width:this.setWidth(e.width)}),this.containerStyle=this.inputWrapper.container.getBoundingClientRect(),r.Input.calculateWidth(this.inputElement,this.inputWrapper.container),i.i(a.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(a.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&&i.i(a.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,r.Input.removeFloating(this.inputWrapper),r.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder),i.i(a.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(a.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("")}}},t.prototype.checkInValue=function(e){return e instanceof Date?e.toUTCString():""+e},h([i.i(a.Property)(null)],t.prototype,"width",void 0),h([i.i(a.Property)(null)],t.prototype,"cssClass",void 0),h([i.i(a.Property)(!1)],t.prototype,"strictMode",void 0),h([i.i(a.Property)(null)],t.prototype,"keyConfigs",void 0),h([i.i(a.Property)(null)],t.prototype,"format",void 0),h([i.i(a.Property)(!0)],t.prototype,"enabled",void 0),h([i.i(a.Property)(!1)],t.prototype,"fullScreenMode",void 0),h([i.i(a.Property)(!1)],t.prototype,"readonly",void 0),h([i.i(a.Property)({})],t.prototype,"htmlAttributes",void 0),h([i.i(a.Property)("Never")],t.prototype,"floatLabelType",void 0),h([i.i(a.Property)(null)],t.prototype,"placeholder",void 0),h([i.i(a.Property)(1e3)],t.prototype,"zIndex",void 0),h([i.i(a.Property)(!1)],t.prototype,"enablePersistence",void 0),h([i.i(a.Property)(!0)],t.prototype,"showClearButton",void 0),h([i.i(a.Property)(30)],t.prototype,"step",void 0),h([i.i(a.Property)(null)],t.prototype,"scrollTo",void 0),h([i.i(a.Property)(null)],t.prototype,"value",void 0),h([i.i(a.Property)(null)],t.prototype,"min",void 0),h([i.i(a.Property)(null)],t.prototype,"max",void 0),h([i.i(a.Property)(!0)],t.prototype,"allowEdit",void 0),h([i.i(a.Property)(!1)],t.prototype,"openOnFocus",void 0),h([i.i(a.Property)(!1)],t.prototype,"enableMask",void 0),h([i.i(a.Property)({day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"})],t.prototype,"maskPlaceholder",void 0),h([i.i(a.Property)(null)],t.prototype,"serverTimezoneOffset",void 0),h([i.i(a.Event)()],t.prototype,"change",void 0),h([i.i(a.Event)()],t.prototype,"created",void 0),h([i.i(a.Event)()],t.prototype,"destroyed",void 0),h([i.i(a.Event)()],t.prototype,"open",void 0),h([i.i(a.Event)()],t.prototype,"itemRender",void 0),h([i.i(a.Event)()],t.prototype,"close",void 0),h([i.i(a.Event)()],t.prototype,"cleared",void 0),h([i.i(a.Event)()],t.prototype,"blur",void 0),h([i.i(a.Event)()],t.prototype,"focus",void 0),t=h([a.NotifyPropertyChanges],t)}(a.Component)},function(e,t){e.exports=s},function(e,t,i){"use strict";var s=i(3);i.d(t,"a",function(){return s.b}),i.d(t,"b",function(){return s.a});var a=i(13);i.d(t,"c",function(){return a.a})},function(e,t,i){"use strict";var s=i(4);i.d(t,"a",function(){return s.a})},function(e,t,i){"use strict";var s=i(14);i.d(t,"a",function(){return s.a}),i.d(t,"b",function(){return s.b})},function(e,t,i){"use strict";var s=i(15);i.d(t,"a",function(){return s.a})},function(e,t,i){"use strict";var s=i(17);i.d(t,"a",function(){return s.a})},function(e,t,i){"use strict";var s=i(5);i.d(t,"a",function(){return s.a}),i.d(t,"b",function(){return s.b}),i.d(t,"c",function(){return s.c})},function(e,t,i){"use strict";i.d(t,"a",function(){return r});var s=i(0),a=(i.n(s),"e-other-month"),n="e-disabled",r=function(){function e(e){this.calendarInstance=e}return e.prototype.getModuleName=function(){return"islamic"},e.prototype.islamicTitleUpdate=function(e,t){var i=new s.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"})}},e.prototype.islamicRenderDays=function(e,t,r,l){var o,h=[],u=new Date(this.islamicInValue(e));this.islamicTitleUpdate(e,"days");var d=this.getIslamicDate(u),p=this.toGregorian(d.year,d.month,1),c=d.month;for(u=p;u.getDay()!==this.calendarInstance.firstDayOfWeek;)this.calendarInstance.setStartDate(u,-864e5);for(var m=0;m<42;++m){var f=this.calendarInstance.createElement("td",{className:"e-cell"}),v=this.calendarInstance.createElement("span");m%7==0&&this.calendarInstance.weekNumber&&(v.textContent=""+this.calendarInstance.getWeek(u),f.appendChild(v),i.i(s.addClass)([f],"e-week-number"),h.push(f)),o=new Date(+u),u=this.calendarInstance.minMaxDate(u);var y={type:"dateTime",skeleton:"full",calendar:"islamic"},g=this.calendarInstance.globalize.parseDate(this.calendarInstance.globalize.formatDate(u,y),y),b=this.islamicDayCell(u),D=this.calendarInstance.globalize.formatDate(u,{type:"date",skeleton:"full",calendar:"islamic"}),C=this.calendarInstance.createElement("span");C.textContent=this.calendarInstance.globalize.formatDate(u,{type:"date",skeleton:"d",calendar:"islamic"});var E=this.calendarInstance.min>u||this.calendarInstance.max<u;E?(i.i(s.addClass)([b],n),i.i(s.addClass)([b],"e-overlay")):C.setAttribute("title",""+D);c!==this.getIslamicDate(u).month&&i.i(s.addClass)([b],a),0!==u.getDay()&&6!==u.getDay()||i.i(s.addClass)([b],"e-weekend"),b.appendChild(C),this.calendarInstance.renderDayCellArgs={date:u,isDisabled:!1,element:b,isOutOfRange:E};var k=this.calendarInstance.renderDayCellArgs;if(this.calendarInstance.renderDayCellEvent(k),k.isDisabled)if(this.calendarInstance.isMultiSelection){if(!i.i(s.isNullOrUndefined)(this.calendarInstance.values)&&this.calendarInstance.values.length>0)for(var w=0;w<l.length;w++){var V=+new Date(this.calendarInstance.globalize.formatDate(k.date,{type:"date",skeleton:"yMd",calendar:"islamic"})),M=+new Date(this.calendarInstance.globalize.formatDate(this.calendarInstance.values[w],{type:"date",skeleton:"yMd",calendar:"islamic"}));V===M&&(this.calendarInstance.values.splice(w,1),w=-1)}}else t&&+t==+k.date&&this.calendarInstance.setProperties({value:null},!0);this.calendarInstance.renderDayCellArgs.isDisabled&&!b.classList.contains("e-selected")&&(i.i(s.addClass)([b],n),i.i(s.addClass)([b],"e-overlay"),+this.calendarInstance.renderDayCellArgs.date==+this.calendarInstance.todayDate&&(this.calendarInstance.todayDisabled=!0));var O=b.classList.contains(a),N=b.classList.contains(n);if(N||s.EventHandler.add(b,"click",this.calendarInstance.clickHandler,this.calendarInstance),!this.calendarInstance.isMultiSelection||i.i(s.isNullOrUndefined)(this.calendarInstance.values)||O||N)O||N||!this.calendarInstance.getDateVal(u,t)?this.calendarInstance.updateFocus(O,N,u,b,e):i.i(s.addClass)([b],"e-selected");else{for(var I=0;I<this.calendarInstance.values.length;I++){var V=this.calendarInstance.globalize.formatDate(u,{type:"date",skeleton:"short",calendar:"islamic"}),M=this.calendarInstance.globalize.formatDate(this.calendarInstance.values[I],{type:"date",skeleton:"short",calendar:"islamic"});V===M&&this.calendarInstance.getDateVal(u,this.calendarInstance.values[I])?i.i(s.addClass)([b],"e-selected"):this.calendarInstance.updateFocus(O,N,u,b,e)}this.calendarInstance.values.length<=0&&this.calendarInstance.updateFocus(O,N,u,b,e)}g.getDate()===(new Date).getDate()&&g.getMonth()===(new Date).getMonth()&&g.getFullYear()===(new Date).getFullYear()&&i.i(s.addClass)([b],"e-today"),u=new Date(+o),h.push(this.calendarInstance.renderDayCellArgs.element),this.calendarInstance.addDay(u,1,null,this.calendarInstance.max,this.calendarInstance.min)}return h},e.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=this.islamicCompareMonth(e,this.calendarInstance.max)>-1;this.calendarInstance.previousIconHandler(t),this.calendarInstance.nextIconHandler(i);break;case"Year":var a=this.hijriCompareYear(e,this.calendarInstance.min)<1,n=this.hijriCompareYear(e,this.calendarInstance.max)>-1;this.calendarInstance.previousIconHandler(a),this.calendarInstance.nextIconHandler(n);break;case"Decade":var r=s.HijriParser.toGregorian(1361,1,1),l=this.hijriCompareDecade(e,this.calendarInstance.min)<1,o=this.hijriCompareDecade(e,this.calendarInstance.max)>-1;l=s.HijriParser.toGregorian(this.calendarInstance.headerTitleElement.textContent.split("-")[0].trim(),1,1).getFullYear()===r.getFullYear()||l,this.calendarInstance.previousIconHandler(l),this.calendarInstance.nextIconHandler(o)}},e.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)}},e.prototype.islamicPrevious=function(){var e=this.calendarInstance.getViewNumber(this.calendarInstance.currentView());this.calendarInstance.effect="";var t=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)}},e.prototype.islamicRenderYears=function(e,t){this.calendarInstance.removeTableHeadElement();var a=[],r=i.i(s.isNullOrUndefined)(t),l=new Date(this.islamicInValue(this.calendarInstance.currentDate)),o=l,h=this.getIslamicDate(o);o=s.HijriParser.toGregorian(h.year,1,1);var u=h.month,d=h.year,p=h.year,c=this.getIslamicDate(this.calendarInstance.min).year,m=this.getIslamicDate(this.calendarInstance.min).month,f=this.getIslamicDate(this.calendarInstance.max).year,v=this.getIslamicDate(this.calendarInstance.max).month;this.islamicTitleUpdate(this.calendarInstance.currentDate,"months");for(var y=1;y<=12;++y){var g=this.getIslamicDate(o);o=s.HijriParser.toGregorian(g.year,y,1);var b=this.islamicDayCell(o),D=this.calendarInstance.createElement("span"),C=t&&this.getIslamicDate(t).month===this.getIslamicDate(o).month,E=t&&this.getIslamicDate(t).year===d&&C;D.textContent=this.calendarInstance.globalize.formatDate(o,{type:"dateTime",format:"MMM",calendar:"islamic"}),this.calendarInstance.min&&(p<c||y<m&&p===c)||this.calendarInstance.max&&(p>f||y>v&&p>=f)?i.i(s.addClass)([b],n):!r&&E?i.i(s.addClass)([b],"e-selected"):this.getIslamicDate(o).month===u&&this.getIslamicDate(this.calendarInstance.currentDate).month===u&&i.i(s.addClass)([b],"e-focused-date"),b.classList.contains(n)||s.EventHandler.add(b,"click",this.calendarInstance.clickHandler,this.calendarInstance),b.appendChild(D),a.push(b)}this.islamicRenderTemplate(a,4,"e-year",e,t)},e.prototype.islamicRenderDecade=function(e,t){this.calendarInstance.removeTableHeadElement();var r=[],l=new Date(this.islamicInValue(this.calendarInstance.currentDate)),o=this.getIslamicDate(l);l=s.HijriParser.toGregorian(o.year,1,1);var h=l.getFullYear(),u=new Date(this.islamicInValue(h-h%10)),d=new Date(this.islamicInValue(h-h%10+9)),p=u.getFullYear(),c=d.getFullYear(),m=this.calendarInstance.globalize.formatDate(u,{type:"dateTime",format:"y",calendar:"islamic"}),f=this.calendarInstance.globalize.formatDate(d,{type:"dateTime",format:"y",calendar:"islamic"});"ar"===this.calendarInstance.locale&&(m=Number(m.replace(/[٠١٢٣٤٥٦٧٨٩]/g,function(e){return String.fromCharCode(e.charCodeAt(0)-1632+48)})),f=Number(f.replace(/[٠١٢٣٤٥٦٧٨٩]/g,function(e){return String.fromCharCode(e.charCodeAt(0)-1632+48)})));var v=this.calendarInstance.headerElement.textContent.split("-");if((!i.i(s.isNullOrUndefined)(e)&&v[0]!==m&&"home"===e.action||!i.i(s.isNullOrUndefined)(e)&&"keydown"===e.type&&"end"===e.action)&&(m=this.calendarInstance.headerElement.textContent.split("-")[0].trim(),f=this.calendarInstance.headerElement.textContent.split("-")[1].trim()),this.calendarInstance.islamicPreviousHeader&&(m=this.calendarInstance.islamicPreviousHeader.split("-")[0].trim(),f=this.calendarInstance.islamicPreviousHeader.split("-")[1].trim(),this.calendarInstance.islamicPreviousHeader=null),this.calendarInstance.previousIconClicked){for(var y=0;y<=v.length;y++)(f=f-v[y]==2||v[y]-f==2?(parseInt(f,10)+1).toString():f-v[y]==3||v[y]-f==3?(parseInt(f,10)+2).toString():f-v[y]==4||v[y]-f==4?(parseInt(f,10)+3).toString():f-v[y]==5||v[y]-f==5?(parseInt(f,10)+4).toString():f)-v[y]!=0&&v[y]-f!=0||(f=(parseInt(f,10)-1).toString());f-v[y]!=8&&v[y]-f!=8||(f=(parseInt(f,10)-9).toString(),m=(parseInt(f,10)-9).toString()),f-v[y]!=7&&v[y]-f!=7||(f=(parseInt(f,10)-8).toString(),m=(parseInt(f,10)-9).toString()),m=f-m==10?(parseInt(m,10)+1).toString():f-m==11?(parseInt(m,10)+2).toString():f-m==12?(parseInt(m,10)+3).toString():m,f-m==8&&(m=(parseInt(m,10)-1).toString())}if(this.calendarInstance.nextIconClicked){for(var g=0;g<=v.length;g++)m-v[g]!=0&&v[g]-m!=0||(m=(parseInt(m,10)+1).toString()),m-v[g]==2&&m>v[g].trim()&&(m=(parseInt(m,10)-1).toString()),v[g]-m==1&&m<v[g].trim()&&(m=(parseInt(m,10)+2).toString());m-this.calendarInstance.headerTitleElement.textContent.split("-")[1].trim()>1&&(m=(parseInt(this.calendarInstance.headerTitleElement.textContent.split("-")[1].trim(),10)+1).toString(),f=(parseInt(m,10)+9).toString()),f=f-m==10?(parseInt(f,10)-1).toString():f,f=f-m==7?(parseInt(f,10)+2).toString():f-m==8?(parseInt(f,10)+1).toString():f}if("ar"===this.calendarInstance.locale){var b=this.calendarInstance.globalize.formatDate(u,{type:"dateTime",format:"y",calendar:"islamic"}),D=this.calendarInstance.globalize.formatDate(d,{type:"dateTime",format:"y",calendar:"islamic"});this.calendarInstance.headerTitleElement.textContent=b+" - "+D}else this.calendarInstance.headerTitleElement.textContent=m+" - "+f;this.calendarInstance.nextIconClicked=this.calendarInstance.previousIconClicked=!1;var C=(parseInt(m,10)-2).toString();p=Math.round(.97*parseInt(m,10)+622),c=Math.round(.97*parseInt(f,10)+622);for(var E=Math.round(.97*parseInt(C,10)+622),k=1;k<=12;++k){var w=E+k;l.setFullYear(w),l.setDate(1),l.setMonth(0),this.getIslamicDate(l).year-o.year>1&&(l.setMonth(1),k-=1,l.setFullYear(l.getFullYear()-1)),o=this.getIslamicDate(l);if(l=s.HijriParser.toGregorian(o.year,1,1),o.year===parseInt(m,10)-1||o.year>=m&&o.year<=c||o.year===parseInt(f,10)+1){var V=this.islamicDayCell(l);i.i(s.attributes)(V,{role:"gridcell"});var M=this.calendarInstance.createElement("span");M.textContent=this.calendarInstance.globalize.formatDate(l,{type:"dateTime",format:"y",calendar:"islamic"}),o.year===parseInt(m,10)-1||w<p||w>c&&o.year!==parseInt(f,10)?i.i(s.addClass)([V],a):w<new Date(this.islamicInValue(this.calendarInstance.min)).getFullYear()||w>new Date(this.islamicInValue(this.calendarInstance.max)).getFullYear()?i.i(s.addClass)([V],n):i.i(s.isNullOrUndefined)(t)||this.getIslamicDate(l).year!==this.getIslamicDate(t).year?l.getFullYear()!==this.calendarInstance.currentDate.getFullYear()||V.classList.contains(n)||i.i(s.addClass)([V],"e-focused-date"):i.i(s.addClass)([V],"e-selected"),V.classList.contains(n)||s.EventHandler.add(V,"click",this.calendarInstance.clickHandler,this.calendarInstance),V.appendChild(M),(!i.i(s.isNullOrUndefined)(e)&&"home"===e.action&&o.year.toString()===m||!i.i(s.isNullOrUndefined)(e)&&"end"===e.action&&o.year.toString()===f)&&i.i(s.addClass)([V],"e-focused-date"),r.push(V)}}this.islamicRenderTemplate(r,4,"e-decade",e,t)},e.prototype.islamicDayCell=function(e){var t={skeleton:"full",type:"dateTime",calendar:"islamic"},a=this.calendarInstance.globalize.formatDate(e,t),n=this.calendarInstance.globalize.parseDate(a,t),r=n.valueOf(),l={className:"e-cell",attrs:{id:""+i.i(s.getUniqueID)(""+r),"aria-selected":"false",role:"gridcell"}};return this.calendarInstance.createElement("td",l)},e.prototype.islamicRenderTemplate=function(e,t,n,r,l){var o,h=this.calendarInstance.getViewNumber(this.calendarInstance.currentView());this.calendarInstance.tableBodyElement=this.calendarInstance.createElement("tbody"),this.calendarInstance.table.appendChild(this.calendarInstance.tableBodyElement),i.i(s.removeClass)([this.calendarInstance.contentElement,this.calendarInstance.headerElement],["e-month","e-decade","e-year"]),i.i(s.addClass)([this.calendarInstance.contentElement,this.calendarInstance.headerElement],[n]);for(var u=t,d=0,p=0;p<Math.round(e.length/t);++p){for(o=this.calendarInstance.createElement("tr",{attrs:{role:"row"}}),d=0+d;d<u;d++)e[d].classList.contains("e-week-number")||i.i(s.isNullOrUndefined)(e[d].children[0])||(i.i(s.addClass)([e[d].children[0]],["e-day"]),i.i(s.rippleEffect)(e[d].children[0],{duration:600,isCenterRipple:!0})),o.appendChild(e[d]),this.calendarInstance.weekNumber&&7===d&&e[7].classList.contains(a)&&i.i(s.addClass)([o],"e-month-hide"),!this.calendarInstance.weekNumber&&6===d&&e[6].classList.contains(a)&&i.i(s.addClass)([o],"e-month-hide"),this.calendarInstance.weekNumber?41===d&&e[41].classList.contains(a)&&i.i(s.addClass)([o],"e-month-hide"):35===d&&e[35].classList.contains(a)&&i.i(s.addClass)([o],"e-month-hide");u+=t,d+=0,this.calendarInstance.tableBodyElement.appendChild(o)}this.calendarInstance.table.querySelector("tbody").className=this.calendarInstance.effect,this.islamicIconHandler(),(h!==this.calendarInstance.getViewNumber(this.calendarInstance.currentView())||0===h&&h!==this.calendarInstance.getViewNumber(this.calendarInstance.currentView()))&&this.calendarInstance.navigateHandler(r),this.calendarInstance.setAriaActiveDescendant(),this.calendarInstance.changedArgs={value:this.calendarInstance.value,values:this.calendarInstance.values},this.calendarInstance.changeHandler()},e.prototype.islamicCompareMonth=function(e,t){var i=this.getIslamicDate(e),s=this.getIslamicDate(t);return i.year>s.year?1:i.year<s.year?-1:i.month===s.month?0:i.month>s.month?1:-1},e.prototype.islamicCompare=function(e,t,i){var s,a,n=this.getIslamicDate(e),r=this.getIslamicDate(t),l=r.year;return s=l,a=0,i&&(l-=l%i,s=l-l%i+i-1),n.year>s?a=1:"Decade"===this.calendarInstance.currentView()&&n.year<l&&!(e.getFullYear()>=2060&&e.getFullYear()<=2069)?a=-1:n.year<l&&"Year"===this.calendarInstance.currentView()&&(a=-1),a},e.prototype.getIslamicDate=function(e){return s.HijriParser.getHijriDate(e)},e.prototype.toGregorian=function(e,t,i){return s.HijriParser.toGregorian(e,t,i)},e.prototype.hijriCompareYear=function(e,t){return this.islamicCompare(e,t,0)},e.prototype.hijriCompareDecade=function(e,t){return this.islamicCompare(e,t,10)},e.prototype.destroy=function(){this.calendarInstance=null},e.prototype.islamicInValue=function(e){return e instanceof Date?e.toUTCString():""+e},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return A}),i.d(t,"b",function(){return U});var s=i(0),a=(i.n(s),i(3)),n=i(2),r=(i.n(n),i(18)),l=(i.n(r),i(1)),o=(i.n(l),i(6)),h=(i.n(o),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}()),u=this&&this.__decorate||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;l>=0;l--)(a=e[l])&&(r=(n<3?a(r):n>3?a(t,i,r):a(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},d="e-left-calendar",p="e-right-calendar",c="e-daterangepicker",m="e-active",f="e-start-date",v="e-end-date",y="e-input-focus",g="e-range-hover",b="e-other-month",D="e-disabled",C="e-selected",E="e-calendar",k="e-header",w="e-title",V="e-focused-date",M="e-content",O="e-day-span",N="e-date-disabled",I="e-icon-disabled",T="e-overlay",x="e-list-item",S="e-hover",P=["title","class","style"],A=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return h(t,e),u([i.i(s.Property)()],t.prototype,"label",void 0),u([i.i(s.Property)()],t.prototype,"start",void 0),u([i.i(s.Property)()],t.prototype,"end",void 0),t}(s.ChildProperty),U=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.isCustomRange=!1,s.isCustomWindow=!1,s.presetsItem=[],s.liCollections=[],s.previousEleValue="",s.isKeyPopup=!1,s.dateDisabled=!1,s.isRangeIconClicked=!1,s.isMaxDaysClicked=!1,s.disabledDays=[],s.preventBlur=!1,s.preventFocus=!1,s.invalidValueString=null,s.isAngular=!1,s.preventChange=!1,s.dateRangeOptions=t,s}return h(t,e),t.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"),"Auto"===this.floatLabelType&&l.Input.calculateWidth(this.inputElement,this.inputWrapper.container),i.i(s.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(s.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"),!i.i(s.isNullOrUndefined)(i.i(s.closest)(this.element,"fieldset"))&&i.i(s.closest)(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete()},t.prototype.preRender=function(){if(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=!(!s.Browser.isDevice||!this.fullScreenMode)||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),i.i(s.removeClass)([this.cloneElement],[c,"e-control","e-lib"]),this.updateHtmlAttributeToElement(),this.element.getAttribute("id")?null!==this.angularTag&&(this.inputElement.id=this.element.getAttribute("id")+"_input"):(this.element.id=i.i(s.getUniqueID)("ej2-datetimepicker"),null!==this.angularTag&&i.i(s.attributes)(this.inputElement,{id:this.element.id+"_input"})),this.checkInvalidRange(this.value),!this.invalidValueString&&"string"==typeof this.value){var t=this.value.split(" "+this.separator+" ");this.value=[new Date(t[0]),new Date(t[1])]}this.initProperty(),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex"),e.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=i.i(s.closest)(this.element,"form")},t.prototype.updateValue=function(){this.value&&this.value.length>0?(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.startValue=null,this.setValue()),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.setValue()):(this.setProperties({endDate:new Date(this.checkValue(this.value[1]))},!0),this.endValue=new Date(this.checkValue(this.value[1])),this.setValue()):(this.setProperties({endDate:null},!0),this.endValue=null,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.setValue()):(this.setProperties({endDate:null},!0),this.endValue=null,this.setValue())):i.i(s.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())},t.prototype.initProperty=function(){this.globalize=new s.Internationalization(this.locale),this.checkFormat(),this.checkView(),(i.i(s.isNullOrUndefined)(this.firstDayOfWeek)||this.firstDayOfWeek>6||this.firstDayOfWeek<0)&&this.setProperties({firstDayOfWeek:this.globalize.getFirstDayOfWeek()},!0),this.updateValue()},t.prototype.checkFormat=function(){if(this.format)if("string"==typeof this.format)this.formatString=this.format;else if(""===this.format.skeleton||i.i(s.isNullOrUndefined)(this.format.skeleton))this.formatString=null;else{var e=this.format.skeleton;this.formatString=this.globalize.getDatePattern({skeleton:e,type:"date"})}else this.formatString=null},t.prototype.initialize=function(){null!==this.angularTag&&this.validationAttribute(this.element,this.inputElement),this.checkHtmlAttributes(!1),i.i(s.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 s.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()},t.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]))}},t.prototype.setRangeAllowEdit=function(){this.allowEdit?this.readonly||this.inputElement.removeAttribute("readonly"):i.i(s.attributes)(this.inputElement,{readonly:""}),this.updateClearIconState()},t.prototype.updateClearIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&i.i(s.removeClass)([this.inputWrapper.container],["e-non-edit"]):""===this.inputElement.value?i.i(s.removeClass)([this.inputWrapper.container],["e-non-edit"]):i.i(s.addClass)([this.inputWrapper.container],["e-non-edit"])},t.prototype.validationAttribute=function(e,t){var a=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");t.setAttribute("name",a),e.removeAttribute("name");for(var n=["required","aria-required","form"],r=0;r<n.length;r++)if(!i.i(s.isNullOrUndefined)(e.getAttribute(n[r]))){var l=e.getAttribute(n[r]);t.setAttribute(n[r],l),e.removeAttribute(n[r])}},t.prototype.updateHtmlAttributeToWrapper=function(){if(!i.i(s.isNullOrUndefined)(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var a=t[e];if(P.indexOf(a)>-1)if("class"===a){var n=this.htmlAttributes[""+a].replace(/\s+/g," ").trim();""!==n&&i.i(s.addClass)([this.inputWrapper.container],n.split(" "))}else if("style"===a){var r=this.inputWrapper.container.getAttribute(a);r=i.i(s.isNullOrUndefined)(r)?this.htmlAttributes[""+a]:r+this.htmlAttributes[""+a],this.inputWrapper.container.setAttribute(a,r)}else this.inputWrapper.container.setAttribute(a,this.htmlAttributes[""+a])}},t.prototype.updateHtmlAttributeToElement=function(){if(!i.i(s.isNullOrUndefined)(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var a=t[e];P.indexOf(a)<0&&this.inputElement.setAttribute(a,this.htmlAttributes[""+a])}},t.prototype.updateCssClass=function(e,t){i.i(s.isNullOrUndefined)(t)||(t=t.replace(/\s+/g," ").trim()),i.i(s.isNullOrUndefined)(e)||(e=e.replace(/\s+/g," ").trim()),l.Input.setCssClass(e,[this.inputWrapper.container],t),this.popupWrapper&&l.Input.setCssClass(e,[this.popupWrapper],t)},t.prototype.processPresets=function(){this.presetsItem=[];var e=0;if(!i.i(s.isUndefined)(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)){for(var t=0,a=this.presets;t<a.length;t++){var n=a[t],r=n.label.replace(/\s+/g,"")+"_"+ ++e;"string"==typeof n.end?this.presetsItem.push({id:r,text:n.label,end:new Date(this.checkValue(n.end)),start:new Date(this.checkValue(n.start))}):this.presetsItem.push({id:r,text:n.label,start:n.start,end:n.end})}var l=i.i(s.isNullOrUndefined)(this.startValue)?null:new Date(+this.startValue),o=i.i(s.isNullOrUndefined)(this.endValue)?null:new Date(+this.endValue);this.presetsItem.push({id:"custom_range",text:this.l10n.getConstant("customRange"),start:l,end:o}),i.i(s.isNullOrUndefined)(this.startValue)||i.i(s.isNullOrUndefined)(this.endValue)||(this.isCustomRange=!0,this.activeIndex=this.presetsItem.length-1)}},t.prototype.bindEvents=function(){s.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler,this),s.EventHandler.add(this.inputElement,"focus",this.inputFocusHandler,this),s.EventHandler.add(this.inputElement,"blur",this.inputBlurHandler,this),s.EventHandler.add(this.inputElement,"change",this.inputChangeHandler,this),this.showClearButton&&this.inputWrapper.clearButton&&s.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this),this.isMobile||(this.keyInputConfigs=i.i(s.extend)(this.keyInputConfigs,this.keyConfigs),this.inputKeyboardModule=new s.KeyboardEvents(this.inputElement,{eventName:"keydown",keyAction:this.inputHandler.bind(this),keyConfigs:this.keyInputConfigs})),this.formElement&&s.EventHandler.add(this.formElement,"reset",this.formResetHandler,this),this.enabled?this.inputElement.setAttribute("tabindex",this.tabIndex):this.inputElement.tabIndex=-1},t.prototype.unBindEvents=function(){s.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler),s.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),s.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),s.EventHandler.remove(this.inputElement,"change",this.inputChangeHandler),this.showClearButton&&this.inputWrapper.clearButton&&s.EventHandler.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler),this.isMobile||i.i(s.isNullOrUndefined)(this.inputKeyboardModule)||this.inputKeyboardModule.destroy(),this.formElement&&s.EventHandler.remove(this.formElement,"reset",this.formResetHandler),this.inputElement.tabIndex=-1},t.prototype.updateHiddenInput=function(){if(this.firstHiddenChild&&this.secondHiddenChild){var e={format:this.formatString,type:"datetime",skeleton:"yMd"};"string"==typeof this.startDate&&(this.startDate=this.globalize.parseDate(this.startDate,e)),"string"==typeof this.endDate&&(this.endDate=this.globalize.parseDate(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")}},t.prototype.inputChangeHandler=function(e){this.enabled&&(e.stopPropagation(),this.updateHiddenInput())},t.prototype.bindClearEvent=function(){this.showClearButton&&this.inputWrapper.clearButton&&s.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this)},t.prototype.resetHandler=function(e){if(this.enabled){this.valueType=this.value,e.preventDefault(),this.clear();var t={event:e};if(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),i.i(s.closest)(this.element,"form")){var a=this.firstHiddenChild,n=document.createEvent("KeyboardEvent");n.initEvent("keyup",!1,!0),a.dispatchEvent(n)}}},t.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()},t.prototype.formResetHandler=function(e){if(this.enabled&&this.formElement&&e.target===this.formElement&&!this.inputElement.disabled){var t=this.inputElement.getAttribute("value");i.i(s.isNullOrUndefined)(this.startCopy)?(this.setProperties({value:null,startDate:null,endDate:null},!0),this.startValue=this.endValue=null):(i.i(s.isNullOrUndefined)(this.value)||i.i(s.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),t="",this.startValue=this.endValue=null,this.inputElement.setAttribute("value","")),this.restoreValue(),this.inputElement&&(l.Input.setValue(t,this.inputElement,this.floatLabelType,this.showClearButton),this.errorClass())}},t.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&&this.value.length>0&&this.setProperties({value:null},!0),l.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),i.i(s.isNullOrUndefined)(this.applyButton)||(this.applyButton.disabled=this.applyButton.element.disabled=!0),this.removeSelection()},t.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||i.i(s.isNullOrUndefined)(this.leftCalendar)||this.calendarFocus(),i.i(s.addClass)([this.inputWrapper.container],[y])))},t.prototype.checkHtmlAttributes=function(e){this.globalize=new s.Internationalization(this.locale);for(var t=e?i.i(s.isNullOrUndefined)(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["startDate","endDate","minDays","maxDays","min","max","disabled","readonly","style","name","placeholder","type","value"],a={format:this.formatString,type:"date",skeleton:"yMd"},n=0,r=t;n<r.length;n++){var l=r[n];if(!i.i(s.isNullOrUndefined)(this.inputElement.getAttribute(l)))switch(l){case"disabled":if(i.i(s.isNullOrUndefined)(this.dateRangeOptions)||void 0===this.dateRangeOptions.enabled||e){var o="disabled"===this.inputElement.getAttribute(l)||""===this.inputElement.getAttribute(l)||"true"===this.inputElement.getAttribute(l);this.setProperties({enabled:!o},!e)}break;case"readonly":if(i.i(s.isNullOrUndefined)(this.dateRangeOptions)||void 0===this.dateRangeOptions.readonly||e){var h="readonly"===this.inputElement.getAttribute(l)||"true"===this.inputElement.getAttribute(l)||""===this.inputElement.getAttribute(l);this.setProperties({readonly:h},!e)}break;case"placeholder":(i.i(s.isNullOrUndefined)(this.dateRangeOptions)||void 0===this.dateRangeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(l)},!e);break;case"value":if(i.i(s.isNullOrUndefined)(this.dateRangeOptions)||void 0===this.dateRangeOptions.value||e){var u=this.inputElement.getAttribute(l);this.setProperties(i.i(s.setValue)(l,u,{}),!e)}break;case"style":this.inputElement.setAttribute("style",""+this.inputElement.getAttribute(l));break;case"min":if(i.i(s.isNullOrUndefined)(this.min)||+this.min==+new Date(1900,0,1)||e){var d=this.globalize.parseDate(this.inputElement.getAttribute(l),a);this.setProperties(i.i(s.setValue)(l,d,{}),!e)}break;case"name":this.inputElement.setAttribute("name",""+this.inputElement.getAttribute(l));break;case"max":if(i.i(s.isNullOrUndefined)(this.max)||+this.max==+new Date(2099,11,31)||e){var d=this.globalize.parseDate(this.inputElement.getAttribute(l),a);this.setProperties(i.i(s.setValue)(l,d,{}),!e)}break;case"startDate":if(i.i(s.isNullOrUndefined)(this.startDate)){var d=this.globalize.parseDate(this.inputElement.getAttribute(l),a);this.startValue=d,this.setValue()}break;case"endDate":if(i.i(s.isNullOrUndefined)(this.endDate)){var d=this.globalize.parseDate(this.inputElement.getAttribute(l),a);this.endValue=d,this.setValue()}break;case"minDays":i.i(s.isNullOrUndefined)(this.minDays)&&this.setProperties(i.i(s.setValue)(l,parseInt(this.inputElement.getAttribute(l),10),{}),!0);break;case"maxDays":i.i(s.isNullOrUndefined)(this.maxDays)&&this.setProperties(i.i(s.setValue)(l,parseInt(this.inputElement.getAttribute(l),10),{}),!0);break;case"type":"text"!==this.inputElement.getAttribute(l)&&this.inputElement.setAttribute("type","text")}}},t.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(var e=0;e<=this.presetsItem.length-2;e++){var t=this.presetsItem[e].start,a=this.presetsItem[e].end;this.startValue&&this.endValue&&+new Date(t.setHours(0,0,0,0))==+new Date(this.startValue.setHours(0,0,0,0))&&+new Date(a.setHours(0,0,0,0))==+new Date(this.endValue.setHours(0,0,0,0))&&(this.activeIndex=e,this.isCustomRange=!1)}this.popupWrapper=i.i(s.createElement)("div",{id:this.element.id+"_popup",className:c+" e-popup"}),this.adjustLongHeaderWidth();var n=!this.isCustomRange||this.isMobile;!i.i(s.isUndefined)(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)&&n?(this.isCustomWindow=!1,this.createPresets(),this.listRippleEffect(),this.renderPopup()):(this.isCustomWindow=!0,this.renderControl())},t.prototype.renderControl=function(){this.createControl(),this.bindCalendarEvents(),this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar]),i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.isNullOrUndefined)(this.startValue)||i.i(s.isNullOrUndefined)(this.renderDayCellArgs)||!this.renderDayCellArgs.isDisabled||this.disabledDateRender(),this.updateHeader()},t.prototype.clearCalendarEvents=function(){this.leftCalPrevIcon&&this.leftCalNextIcon&&this.rightCalPrevIcon&&this.rightCalNextIcon&&(s.EventHandler.clearEvents(this.leftCalPrevIcon),s.EventHandler.clearEvents(this.leftCalNextIcon),s.EventHandler.clearEvents(this.rightCalPrevIcon),s.EventHandler.clearEvents(this.rightCalNextIcon))},t.prototype.updateNavIcons=function(){e.prototype.iconHandler.call(this)},t.prototype.calendarIconEvent=function(){this.clearCalendarEvents(),this.leftCalPrevIcon&&!this.leftCalPrevIcon.classList.contains(D)&&s.EventHandler.add(this.leftCalPrevIcon,"mousedown",this.navPrevFunction),this.leftCalNextIcon&&!this.leftCalNextIcon.classList.contains(D)&&s.EventHandler.add(this.leftCalNextIcon,"mousedown",this.navNextFunction),this.rightCalPrevIcon&&!this.rightCalPrevIcon.classList.contains(D)&&s.EventHandler.add(this.rightCalPrevIcon,"mousedown",this.navPrevFunction),this.rightCalNextIcon&&!this.rightCalNextIcon.classList.contains(D)&&s.EventHandler.add(this.rightCalNextIcon,"mousedown",this.navNextFunction)},t.prototype.bindCalendarEvents=function(){this.isMobile?(this.deviceCalendarEvent(),s.EventHandler.add(this.startButton.element,"click",this.deviceHeaderClick,this),s.EventHandler.add(this.endButton.element,"click",this.deviceHeaderClick,this)):(this.updateNavIcons(),this.calendarIconEvent(),this.calendarIconRipple(),this.headerTitleElement=this.popupObj.element.querySelector(".e-right-calendar .e-header ."+w),this.headerTitleElement=this.popupObj.element.querySelector(".e-left-calendar .e-header ."+w),this.defaultKeyConfigs=i.i(s.extend)(this.defaultKeyConfigs,this.keyConfigs),this.leftKeyboardModule=new s.KeyboardEvents(this.leftCalendar,{eventName:"keydown",keyAction:this.keyInputHandler.bind(this),keyConfigs:this.defaultKeyConfigs}),this.rightKeyboardModule=new s.KeyboardEvents(this.rightCalendar,{eventName:"keydown",keyAction:this.keyInputHandler.bind(this),keyConfigs:this.defaultKeyConfigs})),this.start===this.depth&&this.bindCalendarCellEvents(),this.removeFocusedDate()},t.prototype.calendarIconRipple=function(){i.i(s.rippleEffect)(this.leftCalPrevIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),i.i(s.rippleEffect)(this.leftCalNextIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),i.i(s.rippleEffect)(this.rightCalPrevIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),i.i(s.rippleEffect)(this.rightCalNextIcon,{selector:".e-next",duration:400,isCenterRipple:!0})},t.prototype.deviceCalendarEvent=function(){s.EventHandler.clearEvents(this.nextIcon),s.EventHandler.clearEvents(this.previousIcon),i.i(s.rippleEffect)(this.nextIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),i.i(s.rippleEffect)(this.previousIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),this.nextIcon&&!this.nextIcon.classList.contains(D)&&s.EventHandler.add(this.nextIcon,"mousedown",this.deviceNavNextFunction),this.previousIcon&&!this.previousIcon.classList.contains(D)&&s.EventHandler.add(this.previousIcon,"mousedown",this.deviceNavPrevFunction)},t.prototype.deviceNavNext=function(e){var t=i.i(s.closest)(e.target,"."+E);this.updateDeviceCalendar(t),this.navigateNext(e),this.deviceNavigation()},t.prototype.deviceNavPrevious=function(e){var t=i.i(s.closest)(e.target,"."+E);this.updateDeviceCalendar(t),this.navigatePrevious(e),this.deviceNavigation()},t.prototype.updateDeviceCalendar=function(e){e&&(this.previousIcon=e.querySelector(".e-prev"),this.nextIcon=e.querySelector(".e-next"),this.calendarElement=e,this.deviceCalendar=e,this.contentElement=e.querySelector("."+M),this.tableBodyElement=i.i(s.select)(".e-content tbody",e),this.table=e.querySelector("."+M).getElementsByTagName("table")[0],this.headerTitleElement=e.querySelector(".e-header ."+w),this.headerElement=e.querySelector("."+k))},t.prototype.deviceHeaderClick=function(e){if(e.currentTarget.classList.contains("e-start-btn")&&!i.i(s.isNullOrUndefined)(this.startValue)){this.endButton.element.classList.remove(m),this.startButton.element.classList.add(m);var t=this.popupObj.element.querySelector("."+E);this.updateDeviceCalendar(t),i.i(s.isNullOrUndefined)(this.calendarElement.querySelector(".e-start-date:not(.e-other-month)"))&&(this.currentDate=new Date(+this.startValue),i.i(s.remove)(this.tableBodyElement),this.createContentBody(),this.deviceNavigation()),this.removeClassDisabled()}else if(!i.i(s.isNullOrUndefined)(this.startValue)&&!i.i(s.isNullOrUndefined)(this.endValue)){this.startButton.element.classList.remove(m),this.endButton.element.classList.add(m);var t=this.popupObj.element.querySelector("."+E);this.updateDeviceCalendar(t),i.i(s.isNullOrUndefined)(this.calendarElement.querySelector(".e-end-date:not(.e-other-month)"))&&(this.currentDate=new Date(+this.endValue),i.i(s.remove)(this.tableBodyElement),this.createContentBody(),this.deviceNavigation()),this.updateMinMaxDays(this.popupObj.element.querySelector("."+E)),this.selectableDates()}},t.prototype.inputFocusHandler=function(){if(this.enabled){this.preventBlur=!1;var e={model:this};this.preventFocus||this.trigger("focus",e),this.updateClearIconState(),this.openOnFocus&&!this.preventFocus?(this.preventFocus=!0,this.show()):this.preventFocus=!0}},t.prototype.inputBlurHandler=function(e){if(this.enabled){if(!this.preventBlur){var t=this.inputElement.value;if(i.i(s.isNullOrUndefined)(this.presetsItem)||this.presetsItem.length>0&&this.previousEleValue!==this.inputElement.value&&(this.activeIndex=this.presetsItem.length-1,this.isCustomRange=!0),!i.i(s.isNullOrUndefined)(t)&&""!==t.trim()){var a=t.split(" "+this.separator+" ");if(a.length>1){this.invalidValueString=null;var n={format:this.formatString,type:"date",skeleton:"yMd"},r=new Date(a[0]),o=new Date(a[1]),h=this.getStartEndDate(r,!1,a,n),u=this.getStartEndDate(o,!0,a,n);if(!(i.i(s.isNullOrUndefined)(h)||isNaN(+h)||i.i(s.isNullOrUndefined)(u)||isNaN(+u))){var d=this.startValue;this.startValue=h;var p=this.endValue;if(this.endValue=u,this.setValue(),this.refreshControl(),t!==this.previousEleValue&&this.changeTrigger(e),!this.preventBlur&&document.activeElement!==this.inputElement){this.preventFocus=!1;var c={model:this};this.trigger("blur",c)}return this.updateHiddenInput(),void(this.isMobile&&this.isPopupOpen()&&(this.startValue=d,this.endValue=p))}this.strictMode||(this.startValue=null,this.endValue=null,this.setValue())}else this.strictMode||(this.startValue=null,this.endValue=null,this.setValue())}if(this.strictMode?(i.i(s.isNullOrUndefined)(t)||""!==t.trim()||(this.startValue=null,this.endValue=null),l.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.updateInput()):(i.i(s.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;var c={model:this};this.trigger("blur",c)}}this.updateHiddenInput()}},t.prototype.getStartEndDate=function(e,t,i,s){return"Month"===this.depth?this.globalize.parseDate(i[t?1:0].trim(),s):"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)},t.prototype.clearRange=function(){this.previousStartValue=this.previousEndValue=null,this.currentDate=null},t.prototype.errorClass=function(){var e=this.inputElement.value.trim();(i.i(s.isNullOrUndefined)(this.endValue)&&i.i(s.isNullOrUndefined)(this.startValue)&&""!==e||!i.i(s.isNullOrUndefined)(this.startValue)&&+this.startValue<+this.min||!i.i(s.isNullOrUndefined)(this.startValue)&&!i.i(s.isNullOrUndefined)(this.endValue)&&+this.startValue>+this.endValue||!i.i(s.isNullOrUndefined)(this.endValue)&&+this.endValue>+this.max||this.startValue&&this.isDateDisabled(this.startValue)||this.endValue&&this.isDateDisabled(this.endValue))&&""!==e?(i.i(s.addClass)([this.inputWrapper.container],"e-error"),i.i(s.attributes)(this.inputElement,{"aria-invalid":"true"})):this.inputWrapper&&(i.i(s.removeClass)([this.inputWrapper.container],"e-error"),i.i(s.attributes)(this.inputElement,{"aria-invalid":"false"}))},t.prototype.keyCalendarUpdate=function(e,t,i){return void 0===i&&(i=!0),i&&this.removeFocusedDate(),e?(this.leftCalCurrentDate=new Date(+this.currentDate),t=this.leftCalendar):(this.rightCalCurrentDate=new Date(+this.currentDate),t=this.rightCalendar),this.updateCalendarElement(t),this.table.focus(),t},t.prototype.navInCalendar=function(e,t,a,n,r){var l,o,h=this.getViewNumber(this.currentView()),u=this.min;switch(o=i.i(s.isNullOrUndefined)(this.maxDays)||!this.isMaxDaysClicked||i.i(s.isNullOrUndefined)(this.startValue)?this.max:new Date(new Date(+this.startValue).setDate(this.startValue.getDate()+(this.maxDays-1))),e.action){case"moveRight":l=new Date(+this.currentDate),this.addDay(l,1,e,o,u),t&&+l==+n&&(r=this.keyCalendarUpdate(!1,r)),this.keyboardNavigate(1,h,e,o,u),this.keyNavigation(r,e);break;case"moveLeft":l=new Date(+this.currentDate),this.addDay(l,-1,e,o,u),t||+l==+a&&(r=this.keyCalendarUpdate(!0,r)),this.keyboardNavigate(-1,h,e,o,u),this.keyNavigation(r,e);break;case"moveUp":0===h?(l=new Date(+this.currentDate),this.addDay(l,-7,e,o,u),+l<=+a&&!t&&(r=this.keyCalendarUpdate(!0,r)),this.keyboardNavigate(-7,h,e,o,u)):this.keyboardNavigate(-4,h,e,this.max,this.min),this.keyNavigation(r,e);break;case"moveDown":0===h?(l=new Date(+this.currentDate),this.addDay(l,7,e,o,u),t&&+l>=+n&&(r=this.keyCalendarUpdate(!1,r)),this.keyboardNavigate(7,h,e,o,u)):this.keyboardNavigate(4,h,e,this.max,this.min),this.keyNavigation(r,e);break;case"home":this.currentDate=this.firstDay(this.currentDate),i.i(s.remove)(this.tableBodyElement),0===h?this.renderMonths(e):1===h?this.renderYears(e):this.renderDecades(e),this.keyNavigation(r,e);break;case"end":this.currentDate=this.lastDay(this.currentDate,h),i.i(s.remove)(this.tableBodyElement),0===h?this.renderMonths(e):1===h?this.renderYears(e):this.renderDecades(e),this.keyNavigation(r,e);break;case"tab":this.tabKeyValidation(r,d)&&(r=this.keyCalendarUpdate(!1,r,!1),this.currentDate=this.firstCellToFocus(this.rightCalendar),h=this.getViewNumber(this.currentView()),this.keyboardNavigate(0,h,e,o,u),this.keyNavigation(r,e));break;case"shiftTab":this.tabKeyValidation(r,p)&&(r=this.keyCalendarUpdate(!0,r,!1),this.currentDate=this.firstCellToFocus(this.leftCalendar),this.keyboardNavigate(0,h,e,o,u),this.keyNavigation(r,e))}},t.prototype.firstCellToFocus=function(e){var t=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)"),i=t&&t.id?t.id.split("_")[0]:null,s=new Date(this.currentDate.getFullYear(),this.currentDate.getMonth(),1);return i?new Date(+i):s},t.prototype.keyInputHandler=function(t,a){var n,r=this.getViewNumber(this.currentView()),l=new Date(this.rightCalCurrentDate.getFullYear(),this.rightCalCurrentDate.getMonth(),1),o=new Date(this.leftCalCurrentDate.getFullYear(),this.leftCalCurrentDate.getMonth()+1,0),h=i.i(s.closest)(t.target,"."+p);h=i.i(s.isNullOrUndefined)(h)?this.leftCalendar:h;var u=h.classList.contains(d);this.updateCalendarElement(h);var c=this.tableBodyElement.querySelector("tr td.e-selected"),m=h.querySelector("tr td."+V),g=h.querySelector("tr td."+f),b=h.querySelector("tr td."+v),C=this.getViewNumber(this.depth),E=r===C&&this.getViewNumber(this.start)>=C,k=i.i(s.closest)(t.target,"."+d),w=i.i(s.closest)(t.target,"."+p),M=i.i(s.closest)(t.target,".e-presets");switch(i.i(s.isNullOrUndefined)(m)?i.i(s.isNullOrUndefined)(b)||this.dateDisabled?i.i(s.isNullOrUndefined)(g)||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="",t.action){case"altUpArrow":this.isPopupOpen()&&(this.hide(t),this.preventFocus=!0,this.inputElement.focus(),i.i(s.addClass)([this.inputWrapper.container],[y]));break;case"select":if(E){var O=i.i(s.isNullOrUndefined)(m)?g:m;i.i(s.isNullOrUndefined)(O)||O.classList.contains(D)||this.selectRange(null,O)}else(i.i(s.isNullOrUndefined)(c)||E)&&i.i(s.isNullOrUndefined)(m)||(i.i(s.isNullOrUndefined)(this.value)||(a=this.calendarElement.classList.contains(d)?this.startDate:this.endDate),this.controlDown=t,this.contentClick(null,--r,m||c,a));t.preventDefault();break;case"controlHome":var N=new Date(this.currentDate.getFullYear(),0,1);!u&&+N<+o&&(h=this.keyCalendarUpdate(!0,h)),e.prototype.navigateTo.call(this,"Month",new Date(this.currentDate.getFullYear(),0,1)),this.keyNavigation(h,t);break;case"altRightArrow":i.i(s.isNullOrUndefined)(k)?i.i(s.isNullOrUndefined)(w)?i.i(s.isNullOrUndefined)(M)||this.cancelButton.element.focus():i.i(s.isNullOrUndefined)(this.presetElement)?this.cancelButton.element.focus():(this.presetElement.focus(),this.removeFocusedDate()):this.rightCalendar.children[1].firstElementChild.focus(),t.preventDefault();break;case"altLeftArrow":i.i(s.isNullOrUndefined)(k)?i.i(s.isNullOrUndefined)(w)||this.leftCalendar.children[1].firstElementChild.focus():!0!==this.applyButton.element.disabled?this.applyButton.element.focus():this.cancelButton.element.focus(),t.preventDefault();break;case"controlUp":this.calendarElement.classList.contains(d),this.calendarNavigation(t,this.calendarElement),t.preventDefault();break;case"controlDown":i.i(s.isNullOrUndefined)(c)&&i.i(s.isNullOrUndefined)(m)||E||(i.i(s.isNullOrUndefined)(this.value)||(a=this.calendarElement.classList.contains(d)?this.startDate:this.endDate),this.controlDown=t,this.contentClick(null,--r,c||m,a)),t.preventDefault();break;case"controlEnd":var N=new Date(this.currentDate.getFullYear(),11,31);u&&+N>+l&&(h=this.keyCalendarUpdate(!1,h)),e.prototype.navigateTo.call(this,"Month",new Date(this.currentDate.getFullYear(),11,31)),this.keyNavigation(h,t);break;case"pageUp":n=new Date(+this.currentDate),this.addMonths(n,-1),!u&&+n<=+o&&(h=this.keyCalendarUpdate(!0,h)),this.addMonths(this.currentDate,-1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(h,t);break;case"pageDown":n=new Date(+this.currentDate),this.addMonths(n,1),u&&+n>=+l&&(h=this.keyCalendarUpdate(!1,h)),this.addMonths(this.currentDate,1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(h,t);break;case"shiftPageUp":n=new Date(+this.currentDate),this.addYears(n,-1),!u&&+n<=+o&&(h=this.keyCalendarUpdate(!0,h)),this.addYears(this.currentDate,-1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(h,t);break;case"shiftPageDown":n=new Date(+this.currentDate),this.addYears(n,1),u&&+n>=+l&&(h=this.keyCalendarUpdate(!1,h)),this.addYears(this.currentDate,1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(h,t);break;case"shiftTab":i.i(s.isNullOrUndefined)(this.presetElement)||(this.presetElement.setAttribute("tabindex","0"),this.presetElement.focus(),this.removeFocusedDate()),u&&t.preventDefault(),this.tabKeyValidation(h,p)&&(this.currentDate=new Date(+this.leftCalCurrentDate),this.navInCalendar(t,u,o,l,h));break;case"spacebar":this.applyButton&&!this.applyButton.disabled&&this.applyFunction(t);break;case"tab":this.tabKeyValidation(h,d)&&(this.currentDate=new Date(+this.rightCalCurrentDate),this.navInCalendar(t,u,o,l,h));break;default:this.navInCalendar(t,u,o,l,h),this.checkMinMaxDays()}this.presetHeight()},t.prototype.tabKeyValidation=function(e,t){var i=e.classList.contains(t),s=this.rightCalendar.querySelector(".e-header"),a=this.leftCalendar.querySelector(".e-header"),n=!!s&&s.classList.contains("e-month"),r=!!a&&a.classList.contains("e-month"),l=!!s&&s.classList.contains("e-year"),o=!!a&&a.classList.contains("e-year"),h=!!s&&s.classList.contains("e-decade"),u=!!a&&a.classList.contains("e-decade");return i&&(r||o||u)&&(n||l||h)&&!this.isMobile},t.prototype.keyNavigation=function(e,t){this.bindCalendarCellEvents(e),e.classList.contains(d)?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()},t.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||i.i(s.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())}},t.prototype.bindCalendarCellEvents=function(e){var t;t=e?e.querySelectorAll(".e-calendar td"):this.popupObj.element.querySelectorAll(".e-calendar td");for(var i=0,a=t;i<a.length;i++){var n=a[i];s.EventHandler.clearEvents(n);n.classList.contains(D)||n.classList.contains(N)||n.classList.contains("e-week-number")||(this.isMobile||s.EventHandler.add(n,"mouseover",this.hoverSelection,this),s.EventHandler.add(n,"mousedown",this.selectRange,this))}},t.prototype.removeFocusedDate=function(){for(var e=!i.i(s.isNullOrUndefined)(this.startValue)||!i.i(s.isNullOrUndefined)(this.endValue),t=this.popupObj.element.querySelectorAll(".e-calendar ."+V),a=0,n=t;a<n.length;a++){var r=n[a],l=new Date,o=this.getIdValue(null,r);("Month"===this.depth&&"Month"===this.currentView()&&(!r.classList.contains("e-today")||r.classList.contains("e-today")&&e)||"Year"===this.depth&&"Year"===this.currentView()&&(!this.isSameMonth(l,o)&&!this.isSameYear(l,o)||e)||"Decade"===this.depth&&"Decade"===this.currentView()&&(!this.isSameYear(l,o)||e))&&(r.classList.remove(V),r.classList.contains(f)||r.classList.contains(v)||r.removeAttribute("aria-label"))}},t.prototype.hoverSelection=function(e,t){var a=t||e.currentTarget,n=this.getIdValue(null,a);if(!i.i(s.isNullOrUndefined)(this.startValue)&&+this.startValue>=+this.min&&+this.startValue<=+this.max&&(!this.isDateDisabled(this.endValue)&&!this.isDateDisabled(this.startValue)&&i.i(s.isNullOrUndefined)(this.endValue)&&i.i(s.isNullOrUndefined)(this.startValue)||!i.i(s.isNullOrUndefined)(this.startValue)&&i.i(s.isNullOrUndefined)(this.endValue)))for(var r=this.popupObj.element.querySelectorAll(".e-calendar td"),l=0,o=r;l<o.length;l++){var h=o[l],u=!h.classList.contains(D)||h.classList.contains(N);if(!h.classList.contains("e-week-number")&&u){var d=this.getIdValue(null,h),p=new Date(+this.startValue),c=new Date(+d);c.setHours(0,0,0,0)>=p.setHours(0,0,0,0)&&+d<=+n?i.i(s.addClass)([h],g):i.i(s.removeClass)([h],[g])}}},t.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},t.prototype.updateRange=function(e){if(!i.i(s.isNullOrUndefined)(this.startValue))for(var t=0,a=e;t<a.length;t++)for(var n=a[t],r=n.querySelectorAll(".e-calendar td"),l=0,o=r;l<o.length;l++){var h=o[l];if(!h.classList.contains("e-week-number")&&!h.classList.contains(D)){var u=this.getIdValue(null,h),d=this.getIdValue(null,h);if(i.i(s.isNullOrUndefined)(this.endValue)?i.i(s.removeClass)([h],[g]):this.currentView()===this.depth&&+d.setHours(0,0,0,0)>=+new Date(+this.startValue).setHours(0,0,0,0)&&+d.setHours(0,0,0,0)<=+new Date(+this.endValue).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)&&i.i(s.addClass)([h],g),h.classList.contains(C)&&h.classList.contains(v)&&+d!=+this.endValue&&(i.i(s.removeClass)([h],[C]),i.i(s.removeClass)([h],[v])),h.classList.contains(g)&&+d>+this.endValue&&i.i(s.removeClass)([h],[g]),!h.classList.contains(b)){var p=new Date(+this.startValue),c=new Date(+u);this.currentView()===this.depth&&+c.setHours(0,0,0,0)==+p.setHours(0,0,0,0)&&+c.setHours(0,0,0,0)>=+p.setHours(0,0,0,0)&&+this.startValue>=+this.min&&!this.inputWrapper.container.classList.contains("e-error")&&!this.isDateDisabled(this.startValue)&&!this.isDateDisabled(this.endValue)&&(i.i(s.addClass)([h],[f,C]),this.addSelectedAttributes(h,this.startValue,!0));var m=new Date(+this.endValue);"Year"===this.currentView()?c=new Date(c.getFullYear(),c.getMonth()+1,0):"Decade"===this.currentView()&&(c=new Date(c.getFullYear(),11,31)),this.currentView()===this.depth&&!i.i(s.isNullOrUndefined)(this.endValue)&&+c.setHours(0,0,0,0)==+m.setHours(0,0,0,0)&&+c.setHours(0,0,0,0)<=+m.setHours(0,0,0,0)&&+this.startValue>=+this.min&&!this.inputWrapper.container.classList.contains("e-error")&&!this.isDateDisabled(this.startValue)&&!this.isDateDisabled(this.endValue)&&(i.i(s.addClass)([h],[v,C]),this.addSelectedAttributes(h,this.startValue,!1)),+u!=+this.startValue||i.i(s.isNullOrUndefined)(this.endValue)||+u!=+this.endValue||this.addSelectedAttributes(h,this.endValue,!1,!0)}}}},t.prototype.checkMinMaxDays=function(){(!i.i(s.isNullOrUndefined)(this.minDays)&&this.minDays>0||!i.i(s.isNullOrUndefined)(this.maxDays)&&this.maxDays>0)&&(this.isMobile?this.updateMinMaxDays(this.popupObj.element.querySelector("."+E)):(this.updateMinMaxDays(this.popupObj.element.querySelector("."+d)),this.updateMinMaxDays(this.popupObj.element.querySelector("."+p))))},t.prototype.rangeArgs=function(e){var t,a,n=i.i(s.isNullOrUndefined)(this.startValue)?null:this.globalize.formatDate(this.startValue,{format:this.formatString,type:"date",skeleton:"yMd"}),r=i.i(s.isNullOrUndefined)(this.endValue)?null:this.globalize.formatDate(this.endValue,{format:this.formatString,type:"date",skeleton:"yMd"});return i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.isNullOrUndefined)(this.startValue)?(t="",a=0):(t=n+" "+this.separator+" "+r,a=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1),{value:this.value,startDate:this.startValue,endDate:this.endValue,daySpan:a,event:e||null,element:this.element,isInteracted:!i.i(s.isNullOrUndefined)(e),text:t}},t.prototype.otherMonthSelect=function(e,t,a){var n=+this.getIdValue(null,e),r='*[id^="/id"]:not(.e-other-month)'.replace("/id",""+n),l=this.popupObj&&this.popupObj.element.querySelector(r);i.i(s.isNullOrUndefined)(l)||(t?(i.i(s.addClass)([l],[f,C]),this.addSelectedAttributes(l,this.startValue,!0)):(i.i(s.addClass)([l],[v,C]),this.addSelectedAttributes(l,this.endValue,!0)),a&&this.addSelectedAttributes(e,this.endValue,!1,!0))},t.prototype.selectRange=function(e,t){var a,n;e&&e.preventDefault();var r=i.i(s.isNullOrUndefined)(e)?this.getIdValue(null,t):this.getIdValue(e,null),l=r.getFullYear(),o=r.getMonth(),h=new Date(l,o,1),u=new Date(l,o+1,0),c=new Date(l,0,1),y=new Date(l,11,31);i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.isNullOrUndefined)(this.startValue)?this.isMobile&&this.startButton.element.classList.contains(m)&&this.removeSelection():(!this.isMobile||this.isMobile&&!this.endButton.element.classList.contains(m))&&this.removeSelection();var D=t||e.currentTarget;if(i.i(s.isNullOrUndefined)(this.startValue))i.i(s.isNullOrUndefined)(this.previousStartValue)||(r.setHours(this.previousStartValue.getHours()),r.setMinutes(this.previousStartValue.getMinutes()),r.setSeconds(this.previousStartValue.getSeconds())),this.startValue="Month"===this.depth?new Date(this.checkValue(r)):"Year"===this.depth?h:c,this.endValue=null,this.setValue(),i.i(s.addClass)([D],f),this.addSelectedAttributes(D,this.startValue,!0),D.classList.contains(b)&&this.otherMonthSelect(D,!0),this.checkMinMaxDays(),this.applyButton.disabled=!0,this.applyButton.element.disabled=!0,this.isMobile&&(this.endButton.element.classList.add(m),this.startButton.element.classList.remove(m),this.endButton.element.removeAttribute("disabled"),this.selectableDates()),this.trigger("select",this.rangeArgs(e));else if(+r==+this.startValue||+r>+this.startValue){if(+r==+this.startValue&&!i.i(s.isNullOrUndefined)(this.minDays)&&this.minDays>1)return;this.endValue=null,this.setValue(),(this.isMobile||t)&&this.hoverSelection(e,t),i.i(s.isNullOrUndefined)(this.previousEndValue)||(r.setHours(this.previousEndValue.getHours()),r.setMinutes(this.previousEndValue.getMinutes()),r.setSeconds(this.previousEndValue.getSeconds())),this.endValue="Month"===this.depth?new Date(this.checkValue(r)):"Year"===this.depth?u:y,this.setValue();var E=this.popupObj.element.querySelectorAll("."+v);if(this.isMobile){this.startButton.element.classList.remove(m),this.endButton.element.classList.add(m);for(var k=0,w=E;k<w.length;k++){var V=w[k];V.removeAttribute("aria-label"),V.classList.contains(f)?(this.addSelectedAttributes(V,this.startValue,!0),i.i(s.removeClass)([V],[v])):(V.setAttribute("aria-selected","false"),i.i(s.removeClass)([V],[v,C]))}}i.i(s.addClass)([D],v),+this.endValue==+this.startValue?this.addSelectedAttributes(D,this.endValue,!1,!0):this.addSelectedAttributes(D,this.endValue,!1),D.classList.contains(b)&&(+this.endValue==+this.startValue?this.otherMonthSelect(D,!1,!0):this.otherMonthSelect(D,!1)),E=this.popupObj.element.querySelectorAll("."+v);for(var M=0,O=E;M<O.length;M++){var N=O[M];N.classList.contains(f)&&i.i(s.removeClass)([N],[g])}this.applyButton.disabled=!1,this.applyButton.element.disabled=!1,this.isMobile||this.removeClassDisabled(),!i.i(s.isNullOrUndefined)(this.renderDayCellArgs)&&this.renderDayCellArgs.isDisabled&&this.disabledDateRender(),this.trigger("select",this.rangeArgs(e))}else+r<+this.startValue&&(this.removeClassDisabled(),this.startValue="Month"===this.depth?new Date(this.checkValue(r)):"Year"===this.depth?h:c,this.setValue(),this.removeSelectedAttributes(),i.i(s.removeClass)(this.popupObj.element.querySelectorAll("."+f),[f,C]),i.i(s.addClass)([D],f),this.addSelectedAttributes(D,this.startValue,!0),D.classList.contains(b)&&this.otherMonthSelect(D,!0),this.checkMinMaxDays());e&&(a=i.i(s.closest)(e.target,"."+d)),e&&i.i(s.isNullOrUndefined)(a)&&(n=e&&i.i(s.closest)(e.target,"."+p)),i.i(s.isNullOrUndefined)(a)&&i.i(s.isNullOrUndefined)(n)||this.inputWrapper.container.focus(),i.i(s.addClass)([D],C),this.calendarIconEvent(),this.updateHeader(),this.removeFocusedDate()},t.prototype.selectableDates=function(){if(!i.i(s.isNullOrUndefined)(this.startValue)){var e=this.calendarElement.querySelectorAll(".e-calendar td"),t=!1;if(this.currentView()===this.depth){for(var a=0,n=e;a<n.length;a++){var r=n[a];if(!r.classList.contains(f)&&!r.classList.contains("e-week-number")&&!r.classList.contains(D)){if(+this.getIdValue(null,r)<+this.startValue){i.i(s.addClass)([r],[N,D,T]),s.EventHandler.clearEvents(r);continue}break}if(r.classList.contains(f)&&!r.classList.contains(b)){t=!0;break}}t&&(this.previousIcon.classList.contains(D)||i.i(s.addClass)([this.previousIcon],[I,D,T]))}else{for(var l=0,o=e;l<o.length;l++){var r=o[l],h=this.startValue.getMonth(),u=this.startValue.getFullYear(),d=this.getIdValue(null,r);if(this.startButton.element.classList.contains(m)||!("Year"===this.currentView()&&d.getMonth()<h&&d.getFullYear()<=u||"Decade"===this.currentView()&&d.getMonth()<=h&&d.getFullYear()<u))break;i.i(s.addClass)([r],[D])}e[0].classList.contains(D)?this.previousIconHandler(!0):e[e.length-1].classList.contains(D)&&this.nextIconHandler(!0)}}},t.prototype.updateMinMaxDays=function(e){if(!i.i(s.isNullOrUndefined)(this.startValue)&&i.i(s.isNullOrUndefined)(this.endValue)||this.isMobile&&this.endButton.element.classList.contains(m)){if(!i.i(s.isNullOrUndefined)(this.minDays)&&this.minDays>0||!i.i(s.isNullOrUndefined)(this.maxDays)&&this.maxDays>0){var t=this.removeTimeValueFromDate(this.startValue),a=new Date(new Date(+t).setDate(t.getDate()+(this.minDays-1))),n=new Date(new Date(+t).setDate(t.getDate()+(this.maxDays-1)));a=!i.i(s.isNullOrUndefined)(this.minDays)&&this.minDays>0?a:null,n=!i.i(s.isNullOrUndefined)(this.maxDays)&&this.maxDays>0?n:null,"Year"===this.currentView()?(a=i.i(s.isNullOrUndefined)(a)?null:new Date(a.getFullYear(),a.getMonth(),0),n=i.i(s.isNullOrUndefined)(n)?null:new Date(n.getFullYear(),n.getMonth(),1)):"Decade"===this.currentView()&&(a=i.i(s.isNullOrUndefined)(a)?null:new Date(a.getFullYear()-1,11,1),n=i.i(s.isNullOrUndefined)(n)?null:new Date(n.getFullYear(),0,1));for(var r=e.querySelectorAll(".e-calendar td"),l=void 0,o=0,h=r;o<h.length;o++){var u=h[o];if(!u.classList.contains(f)&&!u.classList.contains("e-week-number")){var c=this.getIdValue(null,u);if(c=this.removeTimeValueFromDate(c),!i.i(s.isNullOrUndefined)(a)&&+c==+a&&u.classList.contains(D)&&a.setDate(a.getDate()+1),!u.classList.contains(D)){if(+c<=+t)continue;!i.i(s.isNullOrUndefined)(a)&&+c<+a&&(i.i(s.addClass)([u],[N,D,T]),s.EventHandler.clearEvents(u)),!i.i(s.isNullOrUndefined)(n)&&+c>+n&&(i.i(s.addClass)([u],[N,D,T]),this.isMaxDaysClicked=!0,s.EventHandler.clearEvents(u),i.i(s.isNullOrUndefined)(l)&&!u.classList.contains(b)&&(l=u))}}}if(!i.i(s.isNullOrUndefined)(l))if(this.isMobile)this.nextIcon.classList.contains(D)||i.i(s.addClass)([this.nextIcon],[I,D,T]);else{var v=i.i(s.closest)(l,"."+p);v=i.i(s.isNullOrUndefined)(v)?this.leftCalendar:v;var y=v.classList.contains(d);y?(this.rightCalNextIcon.classList.contains(D)||i.i(s.addClass)([this.rightCalNextIcon],[I,D,T]),this.leftCalNextIcon.classList.contains(D)||i.i(s.addClass)([this.leftCalNextIcon],[I,D,T]),this.rightCalPrevIcon.classList.contains(D)||i.i(s.addClass)([this.rightCalPrevIcon],[I,D,T])):this.rightCalNextIcon.classList.contains(D)||i.i(s.addClass)([this.rightCalNextIcon],[I,D,T])}}}else this.isMaxDaysClicked=!1},t.prototype.removeTimeValueFromDate=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())},t.prototype.removeClassDisabled=function(){for(var e=this.popupObj.element.querySelectorAll(".e-calendar td."+N),t=0,a=e;t<a.length;t++){var n=a[t];n.classList.contains(N)&&(i.i(s.removeClass)([n],[N,D,T]),s.EventHandler.add(n,"click",this.selectRange,this),this.isMobile||s.EventHandler.add(n,"mouseover",this.hoverSelection,this))}this.isMobile?(this.nextIcon.classList.contains(I)&&i.i(s.removeClass)([this.nextIcon],[I,D,T]),this.previousIcon.classList.contains(I)&&i.i(s.removeClass)([this.previousIcon],[I,D,T])):(this.rightCalNextIcon.classList.contains(I)&&i.i(s.removeClass)([this.rightCalNextIcon],[I,D,T]),this.rightCalPrevIcon.classList.contains(I)&&i.i(s.removeClass)([this.rightCalPrevIcon],[I,D,T]),this.leftCalNextIcon.classList.contains(I)&&i.i(s.removeClass)([this.leftCalNextIcon],[I,D,T]))},t.prototype.updateHeader=function(){var e={type:"date",skeleton:"yMMMd"};if(i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.isNullOrUndefined)(this.startValue))this.popupObj.element.querySelector("."+O).textContent=this.l10n.getConstant("selectedDays");else{var t=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1;i.i(s.isNullOrUndefined)(this.disabledDayCnt)||(t-=this.disabledDayCnt,this.disabledDayCnt=null),this.popupObj.element.querySelector("."+O).textContent=t.toString()+" "+this.l10n.getConstant("days")}this.isMobile?(i.i(s.isNullOrUndefined)(this.startValue)?this.startButton.element.textContent=this.l10n.getConstant("startLabel"):this.startButton.element.textContent=this.globalize.formatDate(this.startValue,e),i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.isNullOrUndefined)(this.startValue)?this.endButton.element.textContent=this.l10n.getConstant("endLabel"):this.endButton.element.textContent=this.globalize.formatDate(this.endValue,e)):(i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.isNullOrUndefined)(this.startValue)?this.popupObj.element.querySelector(".e-end-label").textContent=this.l10n.getConstant("endLabel"):this.popupObj.element.querySelector(".e-end-label").textContent=this.globalize.formatDate(this.endValue,e),i.i(s.isNullOrUndefined)(this.startValue)?this.popupObj.element.querySelector(".e-start-label").textContent=this.l10n.getConstant("startLabel"):this.popupObj.element.querySelector(".e-start-label").textContent=this.globalize.formatDate(this.startValue,e)),(this.isDateDisabled(this.startValue)||this.isDateDisabled(this.endValue)||!i.i(s.isNullOrUndefined)(this.startValue)&&+this.startValue<+this.min||!i.i(s.isNullOrUndefined)(this.endValue)&&+this.endValue>+this.max||!i.i(s.isNullOrUndefined)(this.startValue)&&!i.i(s.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("."+O).textContent=this.l10n.getConstant("selectedDays")):(this.popupObj.element.querySelector("."+O).textContent=this.l10n.getConstant("selectedDays"),this.popupObj.element.querySelector(".e-start-label").textContent=this.l10n.getConstant("startLabel"),this.popupObj.element.querySelector(".e-end-label").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")},t.prototype.removeSelection=function(){this.startValue=null,this.endValue=null,this.setValue(),this.removeSelectedAttributes(),this.popupObj&&(this.popupObj.element.querySelectorAll("."+C).length>0&&i.i(s.removeClass)(this.popupObj.element.querySelectorAll("."+C),[f,v,C]),this.popupObj.element.querySelectorAll("."+V).length>0&&i.i(s.removeClass)(this.popupObj.element.querySelectorAll("."+V),V),this.popupObj.element.querySelectorAll("."+g).length>0&&i.i(s.removeClass)(this.popupObj.element.querySelectorAll("."+g),[g]))},t.prototype.addSelectedAttributes=function(e,t,a,n){if(e){var r=this.globalize.formatDate(t,{type:"date",skeleton:"full"});!i.i(s.isNullOrUndefined)(n)&&n?e.setAttribute("aria-label","The current start and end date is "+r):e.setAttribute("aria-label","The current "+(a?"start":"end")+" date is "+r),e.setAttribute("aria-selected","true")}},t.prototype.removeSelectedAttributes=function(){if(this.popupObj){for(var e=this.popupObj.element.querySelectorAll("."+f),t=0,i=e;t<i.length;t++){var s=i[t];s.setAttribute("aria-selected","false"),s.removeAttribute("aria-label")}for(var a=this.popupObj.element.querySelectorAll("."+v),n=0,r=a;n<r.length;n++){var s=r[n];s.setAttribute("aria-selected","false"),s.removeAttribute("aria-label")}}},t.prototype.updateCalendarElement=function(e){e.classList.contains(d)?(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("."+M),this.tableBodyElement=i.i(s.select)(".e-content tbody",e),this.table=e.querySelector("."+M).getElementsByTagName("table")[0],this.headerTitleElement=e.querySelector(".e-header ."+w),this.headerElement=e.querySelector("."+k)},t.prototype.navPrevMonth=function(e){e.preventDefault();var t=i.i(s.closest)(e.target,"."+d);t=i.i(s.isNullOrUndefined)(t)?i.i(s.closest)(e.target,"."+p):t,this.updateCalendarElement(t),this.navigatePrevious(e),!i.i(s.isNullOrUndefined)(this.startValue)&&i.i(s.isNullOrUndefined)(this.endValue)&&this.updateMinMaxDays(t),this.updateControl(t)},t.prototype.deviceNavigation=function(e){this.deviceCalendarEvent(),this.updateRange([this.popupObj.element.querySelector("."+E)]),this.endButton.element.classList.contains(m)&&this.updateMinMaxDays(this.popupObj.element.querySelector("."+E)),this.endButton.element.classList.contains(m)&&this.selectableDates(),this.currentView()===this.depth&&this.bindCalendarCellEvents(),this.removeFocusedDate()},t.prototype.updateControl=function(e,t){void 0===t&&(t=null),e.classList.contains(p)?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])},t.prototype.navNextMonth=function(e){e.preventDefault();var t=i.i(s.closest)(e.target,"."+d);t=i.i(s.isNullOrUndefined)(t)?i.i(s.closest)(e.target,"."+p):t,this.updateCalendarElement(t),this.navigateNext(e),!i.i(s.isNullOrUndefined)(this.startValue)&&i.i(s.isNullOrUndefined)(this.endValue)&&this.updateMinMaxDays(t),this.updateControl(t)},t.prototype.isPopupOpen=function(){return!(i.i(s.isNullOrUndefined)(this.popupObj)||!this.popupObj.element.classList.contains("e-popup"))},t.prototype.createRangeHeader=function(){var e=this.createElement("div",{className:"e-start-end"});if(this.isMobile){var t=this.createElement("button",{className:"e-end-btn"}),a=this.createElement("button",{className:"e-start-btn"});this.startButton=new r.Button({content:this.l10n.getConstant("startLabel")},a),this.endButton=new r.Button({content:this.l10n.getConstant("endLabel")},t),e.appendChild(a),e.appendChild(t)}else{var n=this.createElement("a",{className:"e-start-label"}),l=this.createElement("a",{className:"e-end-label"}),o=this.createElement("span",{className:"e-change-icon e-icons"});i.i(s.attributes)(n,{"aria-atomic":"true","aria-live":"assertive","aria-label":"Start Date",role:"button"}),i.i(s.attributes)(l,{"aria-atomic":"true","aria-live":"assertive","aria-label":"End Date",role:"button"}),e.appendChild(n),e.appendChild(o),e.appendChild(l),n.textContent=this.l10n.getConstant("startLabel"),l.textContent=this.l10n.getConstant("endLabel")}return e},t.prototype.disableInput=function(){this.strictMode?i.i(s.isNullOrUndefined)(this.previousStartValue)||i.i(s.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),l.Input.setEnabled(this.enabled,this.inputElement),this.bindEvents()},t.prototype.validateMinMax=function(){if(this.min=i.i(s.isNullOrUndefined)(this.min)||!+this.min?this.min=new Date(1900,0,1):this.min,this.max=i.i(s.isNullOrUndefined)(this.max)||!+this.max?this.max=new Date(2099,11,31):this.max,!(this.min<=this.max))return void this.disableInput();i.i(s.isNullOrUndefined)(this.minDays)||i.i(s.isNullOrUndefined)(this.maxDays)||this.maxDays>0&&this.minDays>0&&this.minDays>this.maxDays&&(this.maxDays=null),!i.i(s.isNullOrUndefined)(this.minDays)&&this.minDays<0&&(this.minDays=null),!i.i(s.isNullOrUndefined)(this.maxDays)&&this.maxDays<0&&(this.maxDays=null)},t.prototype.validateRangeStrict=function(){i.i(s.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)),i.i(s.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()},t.prototype.validateRange=function(){this.validateMinMaxDays()},t.prototype.validateMinMaxDays=function(){if(!i.i(s.isNullOrUndefined)(this.startValue)&&!i.i(s.isNullOrUndefined)(this.endValue)){var e=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1;if(!i.i(s.isNullOrUndefined)(this.minDays)&&this.minDays>0&&!(e>=this.minDays))if(this.strictMode){var t=new Date(+this.startValue);t.setDate(t.getDate()+(this.minDays-1)),+t>+this.max?(this.endValue=this.max,this.setValue()):(this.endValue=t,this.setValue())}else this.startValue=null,this.endValue=null,this.setValue();i.i(s.isNullOrUndefined)(this.maxDays)||!(this.maxDays>0)||e<=this.maxDays||(this.strictMode?(this.endValue=new Date(+this.startValue),this.endValue.setDate(this.endValue.getDate()+(this.maxDays-1)),this.setValue()):(this.startValue=null,this.endValue=null,this.setValue()))}},t.prototype.renderCalendar=function(){this.calendarElement=this.createElement("div"),this.calendarElement.classList.add(E),this.enableRtl&&this.calendarElement.classList.add("e-rtl"),i.i(s.attributes)(this.calendarElement,{"data-role":"calendar"}),e.prototype.createHeader.call(this),e.prototype.createContent.call(this)},t.prototype.isSameMonth=function(e,t){return e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()},t.prototype.isSameYear=function(e,t){return e.getFullYear()===t.getFullYear()},t.prototype.isSameDecade=function(e,t){var i=e.getFullYear(),s=t.getFullYear();return i-i%10==s-s%10},t.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)))},t.prototype.selectNextMonth=function(){if(i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.isNullOrUndefined)(this.startValue)||this.isSameMonth(this.endValue,this.currentDate)||this.isDateDisabled(this.endValue)||this.isDateDisabled(this.startValue))return this.currentDate.setDate(1),void this.currentDate.setMonth(this.currentDate.getMonth()+1);if(this.currentDate=new Date(+this.endValue),!i.i(s.isNullOrUndefined)(this.startValue)&&+this.startValue<+this.min||!i.i(s.isNullOrUndefined)(this.endValue)&&+this.endValue>+this.max||!i.i(s.isNullOrUndefined)(this.startValue)&&!i.i(s.isNullOrUndefined)(this.endValue)&&+this.startValue>+this.endValue){this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.currentDate.setDate(1);var e=this.currentDate.getMonth()+1;this.currentDate.setMonth(e)}},t.prototype.selectNextYear=function(){if(i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.isNullOrUndefined)(this.startValue)||this.isSameYear(this.endValue,this.currentDate)||this.isDateDisabled(this.endValue)||this.isDateDisabled(this.startValue)){this.currentDate.setMonth(0);var e=this.currentDate.getFullYear()+1;return void this.currentDate.setFullYear(e)}this.currentDate=new Date(+this.endValue),(!i.i(s.isNullOrUndefined)(this.endValue)&&+this.endValue>+this.max||!i.i(s.isNullOrUndefined)(this.startValue)&&!i.i(s.isNullOrUndefined)(this.endValue)&&+this.startValue>+this.endValue||!i.i(s.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))},t.prototype.selectNextDecade=function(){if(i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.isNullOrUndefined)(this.startValue)||this.isSameDecade(this.endValue,this.currentDate)||this.isDateDisabled(this.endValue)||this.isDateDisabled(this.startValue)){var e=this.currentDate.getFullYear()+10;return void this.currentDate.setFullYear(e)}this.currentDate=new Date(+this.endValue),(!i.i(s.isNullOrUndefined)(this.startValue)&&!i.i(s.isNullOrUndefined)(this.endValue)&&+this.startValue>+this.endValue||!i.i(s.isNullOrUndefined)(this.endValue)&&+this.endValue>+this.max||!i.i(s.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))},t.prototype.selectStartMonth=function(){i.i(s.isNullOrUndefined)(this.startValue)?(this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.startMonthCurrentDate()):!i.i(s.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)),(!i.i(s.isNullOrUndefined)(this.endValue)&&+this.endValue>+this.max||!i.i(s.isNullOrUndefined)(this.startValue)&&+this.startValue<+this.min||!i.i(s.isNullOrUndefined)(this.startValue)&&!i.i(s.isNullOrUndefined)(this.endValue)&&+this.startValue>+this.endValue)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0))),this.startMonthCurrentDate()},t.prototype.createCalendar=function(){var t=this.createElement("div",{className:"e-calendar-container"});if(this.isMobile){i.i(s.isNullOrUndefined)(this.startValue)||(this.currentDate=new Date(+this.startValue)),e.prototype.validateDate.call(this),e.prototype.minMaxUpdate.call(this),e.prototype.render.call(this);var a=this.calendarElement.querySelector(".e-calendar .e-prev"),n=this.calendarElement.querySelector(".e-calendar .e-next");i.i(s.remove)(this.calendarElement.querySelector(".e-calendar .e-icon-container")),this.calendarElement.querySelector(".e-calendar ."+k).appendChild(n),this.calendarElement.querySelector(".e-calendar ."+k).appendChild(a),i.i(s.prepend)([a],this.calendarElement.querySelector(".e-calendar ."+k)),this.deviceCalendar=this.calendarElement,t.appendChild(this.calendarElement),this.headerTitleElement=this.calendarElement.querySelector(".e-calendar .e-header ."+w)}else{this.selectStartMonth(),this.renderCalendar(),this.leftCalCurrentDate=new Date(+this.currentDate),this.calendarElement.classList.add(d),this.leftCalPrevIcon=this.calendarElement.querySelector(".e-left-calendar .e-prev"),this.leftCalNextIcon=this.calendarElement.querySelector(".e-left-calendar .e-next"),this.leftTitle=this.calendarElement.querySelector(".e-left-calendar ."+w),i.i(s.remove)(this.calendarElement.querySelector(".e-left-calendar .e-icon-container")),this.calendarElement.querySelector(".e-left-calendar ."+k).appendChild(this.leftCalNextIcon),this.calendarElement.querySelector(".e-left-calendar ."+k).appendChild(this.leftCalPrevIcon),i.i(s.prepend)([this.leftCalPrevIcon],this.calendarElement.querySelector(".e-left-calendar ."+k)),this.leftCalendar=this.calendarElement;var r=this.createElement("div",{className:"e-left-container"}),l=this.createElement("div",{className:"e-right-container"});r.appendChild(this.leftCalendar),t.appendChild(r),this.isMobile||s.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),i.i(s.addClass)([this.calendarElement],p),this.rightCalendar=this.calendarElement,i.i(s.removeClass)([this.leftCalendar&&this.leftCalendar.querySelector(".e-content tbody")],"e-zoomin"),i.i(s.removeClass)([this.rightCalendar&&this.rightCalendar.querySelector(".e-content tbody")],"e-zoomin"),this.rightCalPrevIcon=this.calendarElement.querySelector(".e-right-calendar .e-prev"),this.rightCalNextIcon=this.calendarElement.querySelector(".e-right-calendar .e-next"),this.rightTitle=this.calendarElement.querySelector(".e-right-calendar ."+w),i.i(s.remove)(this.calendarElement.querySelector(".e-right-calendar .e-icon-container")),this.calendarElement.querySelector("table").setAttribute("tabindex","0"),this.calendarElement.querySelector(".e-right-calendar ."+k).appendChild(this.rightCalNextIcon),this.calendarElement.querySelector(".e-right-calendar ."+k).appendChild(this.rightCalPrevIcon),i.i(s.prepend)([this.rightCalPrevIcon],this.calendarElement.querySelector(".e-right-calendar ."+k)),l.appendChild(this.rightCalendar),t.appendChild(l),this.isMobile||s.EventHandler.add(this.rightTitle,"click",this.rightNavTitle,this)}return t},t.prototype.leftNavTitle=function(e){this.isPopupOpen()&&(this.calendarElement=this.leftCalendar,this.calendarNavigation(e,this.calendarElement))},t.prototype.calendarNavigation=function(t,i){this.table=i.querySelector("table"),this.headerTitleElement=i.querySelector(".e-title"),this.tableBodyElement=i.querySelector("tbody"),this.tableHeadElement=i.querySelector("thead"),this.contentElement=i.querySelector(".e-content"),this.updateCalendarElement(i),e.prototype.navigateTitle.call(this,t),this.updateNavIcons()},t.prototype.rightNavTitle=function(e){this.isPopupOpen()&&(this.calendarElement=this.rightCalendar,this.calendarNavigation(e,this.calendarElement))},t.prototype.clickEventEmitter=function(e){this.isMobile||(i.i(s.closest)(e.target,".e-calendar.e-left-calendar")?(this.calendarElement=this.leftCalendar,this.updateCalendarElement(this.leftCalendar)):(this.calendarElement=this.rightCalendar,this.updateCalendarElement(this.rightCalendar)))},t.prototype.currentView=function(){return e.prototype.currentView.call(this)},t.prototype.getCalendarView=function(e){return"Year"===e?"Year":"Decade"===e?"Decade":"Month"},t.prototype.navigatedEvent=function(t){if(this.trigger("navigated",this.navigatedArgs),!i.i(s.isNullOrUndefined)(this.popupObj)){var a=this.getCalendarView(this.currentView());if(this.isMobile)a===this.depth?(this.bindCalendarCellEvents(),this.deviceNavigation(),this.removeFocusedDate(),this.checkMinMaxDays()):this.selectableDates();else if(this.isMobile||a!==this.depth)this.updateNavIcons(),this.calendarIconEvent();else{if((this.calendarElement.classList.contains("e-left-calendar")?this.leftCalendar:this.rightCalendar)!==this.leftCalendar||(!t||t.currentTarget.children[0].classList.contains("e-icons"))&&i.i(s.isNullOrUndefined)(this.controlDown))(t&&!t.currentTarget.children[0].classList.contains("e-icons")||!i.i(s.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&&i.i(s.isNullOrUndefined)(this.endValue)?"Month"===a&&this.startValue.getMonth()<this.rightCalCurrentDate.getMonth()&&this.startValue.getFullYear()<=this.rightCalCurrentDate.getFullYear()?e.prototype.navigateTo.call(this,a,new Date(+this.startValue)):"Year"===a&&this.startValue.getFullYear()<this.rightCalCurrentDate.getFullYear()?e.prototype.navigateTo.call(this,a,new Date(+this.startValue)):e.prototype.navigateTo.call(this,a,this.leftCalCurrentDate):e.prototype.navigateTo.call(this,a,this.leftCalCurrentDate),this.updateControl(this.leftCalendar),this.updateNavIcons(),this.calendarIconEvent(),this.calendarIconRipple(),this.controlDown=null);else{this.leftCalCurrentDate=new Date(+this.currentDate),this.effect="",this.currentDate=this.leftCalCurrentDate,this.updateCalendarElement(this.leftCalendar),this.updateControl(this.leftCalendar),this.updateCalendarElement(this.rightCalendar),e.prototype.navigateTo.call(this,a,this.rightCalCurrentDate);var n=this.rightCalCurrentDate?this.rightCalCurrentDate:this.currentDate;this.updateControl(this.rightCalendar,n),this.updateNavIcons(),this.calendarIconEvent(),this.calendarIconRipple(),this.controlDown=null}this.checkMinMaxDays()}}},t.prototype.createControl=function(){var e=this.createElement("div",{className:"e-date-range-container"}),t=this.createElement("div",{className:"e-range-header"});if(this.isMobile&&this.fullScreenMode){var a=this.createElement("div",{className:"e-model-header-wrapper"}),n=this.createElement("span",{className:"e-popup-close"});s.EventHandler.add(n,"mousedown touchstart",this.modelRangeCloseHandler,this);var l=this.createElement("span",{className:"e-apply"});s.EventHandler.add(l,"mousedown touchstart",this.applyFunction,this),a.appendChild(n),a.appendChild(l),t.appendChild(a)}var o=this.createRangeHeader();t.appendChild(o);var h=this.createElement("div",{className:O});i.i(s.attributes)(h,{"aria-label":"Selected Days"}),h.textContent=this.l10n.getConstant("selectedDays"),t.appendChild(h);var u=this.createElement("div",{className:"e-separator"}),d=this.createCalendar();e.appendChild(t),e.appendChild(u),e.appendChild(d);var p=this.createElement("div",{className:"e-footer"}),c=this.createElement("button",{className:"e-cancel e-flat e-css"}),m=this.createElement("button");i.i(s.addClass)([m],["e-apply","e-flat","e-primary","e-css"]),p.appendChild(m),p.appendChild(c);var f=!i.i(s.isNullOrUndefined)(this.startValue)&&!i.i(s.isNullOrUndefined)(this.endValue);if(this.cancelButton=new r.Button({content:this.l10n.getConstant("cancelText")},c),this.applyButton=new r.Button({content:this.l10n.getConstant("applyText"),disabled:!f},m),s.EventHandler.add(m,"click",this.applyFunction,this),s.EventHandler.add(c,"click",this.cancelFunction,this),this.popupWrapper.appendChild(e),!this.isMobile&&!i.i(s.isUndefined)(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)){this.createPresets(),this.listRippleEffect(),i.i(s.addClass)([e],"e-range-border"),i.i(s.addClass)([this.popupWrapper],"e-preset-wrapper");this.popupWrapper.querySelector(".e-presets").style.height=this.popupWrapper.querySelector(".e-date-range-container").getBoundingClientRect().height+"px"}this.popupWrapper.appendChild(p),this.isMobile&&this.deviceHeaderUpdate(),this.renderPopup()},t.prototype.modelRangeCloseHandler=function(e){this.hide()},t.prototype.cancelFunction=function(e){document.activeElement!==this.inputElement&&(this.preventFocus=!0,this.inputElement.focus(),i.i(s.addClass)([this.inputWrapper.container],[y])),e.preventDefault(),this.isKeyPopup&&(this.inputElement.focus(),this.isKeyPopup=!1),this.startValue=null,this.endValue=null,this.removeSelection(),this.hide(e)},t.prototype.deviceHeaderUpdate=function(){i.i(s.isNullOrUndefined)(this.startValue)&&i.i(s.isNullOrUndefined)(this.endValue)?(this.endButton.element.setAttribute("disabled",""),this.startButton.element.classList.add(m)):i.i(s.isNullOrUndefined)(this.startValue)||this.startButton.element.classList.add(m)},t.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(),i.i(s.addClass)([this.inputWrapper.container],[y])),"touchstart"!==e.type&&this.closeEventArgs&&!this.closeEventArgs.cancel&&e.preventDefault(),i.i(s.isNullOrUndefined)(this.startValue)||i.i(s.isNullOrUndefined)(this.endValue)?this.hide(e||null):(this.previousStartValue=new Date(+this.startValue),this.previousEndValue=new Date(+this.endValue),this.previousEleValue=this.inputElement.value,l.Input.setValue(this.rangeArgs(e).text,this.inputElement,this.floatLabelType,this.showClearButton),+this.initStartDate==+this.startValue&&+this.initEndDate==+this.endValue||(t=!0),this.changeTrigger(e),this.hide(e||null),this.errorClass(),t=!0),i.i(s.closest)(e.target,".e-input-group")||t||this.focusOut(),this.isMobile||(this.isKeyPopup=!1,this.isRangeIconClicked&&(this.inputWrapper.container.children[1].focus(),this.keyInputConfigs=i.i(s.extend)(this.keyInputConfigs,this.keyConfigs),this.popupKeyboardModule=new s.KeyboardEvents(this.inputWrapper.container.children[1],{eventName:"keydown",keyConfigs:this.keyInputConfigs,keyAction:this.popupKeyActionHandle.bind(this)})))},t.prototype.onMouseClick=function(e,t){if("touchstart"!==e.type){var a=t||e.target,n=i.i(s.closest)(a,"."+x),r=n&&n.classList.contains(m);n&&n.classList.contains(x)&&this.setListSelection(n,e),this.preventFocus=!0,this.inputElement.focus(),this.isMobile||(this.preventFocus=!0,n&&n.classList.contains(x)&&"custom_range"===n.getAttribute("id")?this.leftCalendar.children[1].firstElementChild.focus():r||"keydown"!==e.type||this.inputElement.focus())}},t.prototype.onMouseOver=function(e){var t=i.i(s.closest)(e.target,"."+x);t&&t.classList.contains(x)&&!t.classList.contains(S)&&i.i(s.addClass)([t],S)},t.prototype.onMouseLeave=function(e){var t=i.i(s.closest)(e.target,"."+S);i.i(s.isNullOrUndefined)(t)||i.i(s.removeClass)([t],S)},t.prototype.setListSelection=function(e,t){if(e&&(!e.classList.contains(m)||this.isMobile&&e.classList.contains(m))){if(this.isMobile&&e.classList.contains(m)){this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(e);if("custom_range"===this.presetsItem[this.activeIndex].id)return void this.renderCustomPopup();return}this.removeListSelection(),this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(e),i.i(s.addClass)([e],m),e.setAttribute("aria-selected","true");var a=this.presetsItem[this.activeIndex];"custom_range"===a.id?this.renderCustomPopup():this.applyPresetRange(a,t)}},t.prototype.removeListSelection=function(){var e=this.presetElement.querySelector("."+m);i.i(s.isNullOrUndefined)(e)||(i.i(s.removeClass)([e],m),e.removeAttribute("aria-selected"))},t.prototype.setValue=function(){this.modelValue=[this.startValue,this.endValue]},t.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())},t.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()},t.prototype.renderCustomPopup=function(){this.isCustomWindow=!0,this.popupObj.hide(),this.popupWrapper=this.createElement("div",{id:this.element.id+"_popup",className:c+" e-popup"}),this.renderControl(),this.openEventArgs.appendTo.appendChild(this.popupWrapper),this.showPopup(),this.isCustomRange=!0,this.isMobile||this.calendarFocus()},t.prototype.listRippleEffect=function(){for(var e=0,t=this.liCollections;e<t.length;e++){var a=t[e];i.i(s.rippleEffect)(a)}},t.prototype.createPresets=function(){if(!i.i(s.isUndefined)(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)){this.presetElement=this.createElement("div",{className:"e-presets",attrs:{tabindex:"0"}});var e=o.ListBase.createList(this.createElement,this.presetsItem,null,!0);i.i(s.attributes)(e,{role:"listbox","aria-hidden":"false",id:this.element.id+"_options",tabindex:"0"}),this.presetElement.appendChild(e),this.popupWrapper.appendChild(this.presetElement);var t=this.presetElement.querySelector("#custom_range");if(i.i(s.isNullOrUndefined)(t)||(t.textContent=""!==this.l10n.getConstant("customRange")?this.l10n.getConstant("customRange"):"Custom Range"),this.liCollections=this.presetElement.querySelectorAll("."+x),this.wireListEvents(),this.isMobile)if(this.fullScreenMode){var a=i.i(s.createElement)("div",{className:"e-range-mob-popup-wrap"}),n=this.createElement("div",{className:"e-model-header"}),r=this.createElement("span",{className:"e-model-title"});r.textContent="Select Preset";var l=this.createElement("span",{className:"e-popup-close"});s.EventHandler.add(l,"mousedown touchstart",this.modelRangeCloseHandler,this);var h=this.presetElement;n.appendChild(l),n.appendChild(r),a.appendChild(n),a.appendChild(h),this.popupWrapper.insertBefore(a,this.popupWrapper.firstElementChild),this.presetElement.style.width="100%"}else this.presetElement.style.width=this.inputWrapper.container.getBoundingClientRect().width+"px";!i.i(s.isNullOrUndefined)(this.activeIndex)&&this.activeIndex>-1&&i.i(s.addClass)([this.liCollections[this.activeIndex]],m)}},t.prototype.wireListEvents=function(){s.EventHandler.add(this.presetElement,"click",this.onMouseClick,this),this.isMobile||(s.EventHandler.add(this.presetElement,"mouseover",this.onMouseOver,this),s.EventHandler.add(this.presetElement,"mouseout",this.onMouseLeave,this))},t.prototype.unWireListEvents=function(){i.i(s.isNullOrUndefined)(this.presetElement)||(s.EventHandler.remove(this.presetElement,"click touchstart",this.onMouseClick),this.isMobile||(s.EventHandler.remove(this.presetElement,"mouseover",this.onMouseOver),s.EventHandler.remove(this.presetElement,"mouseout",this.onMouseLeave)))},t.prototype.renderPopup=function(){var e=this;this.popupWrapper.classList.add("e-control");var t=this.popupWrapper.getBoundingClientRect().width;i.i(s.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 n.Popup(this.popupWrapper,{relateTo:this.isMobile&&this.isCustomWindow?document.body:i.i(s.isNullOrUndefined)(this.targetElement)?this.inputWrapper.container:this.targetElement,position:this.isMobile?i.i(s.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:-t,offsetY:4,collision:this.isMobile?i.i(s.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(){e.isMobile&&e.fullScreenMode&&(e.iconRangeRight=e.calendarElement&&window.getComputedStyle(e.calendarElement.querySelector(".e-header.e-month .e-prev")).cssFloat,e.iconRangeRight&&(e.touchRangeModule=new s.Touch(e.calendarElement.querySelector(".e-content.e-month"),{swipe:e.dateRangeSwipeHandler.bind(e)}),s.EventHandler.add(e.calendarElement.querySelector(".e-content.e-month"),"touchstart",e.touchStartRangeHandler,e))),i.i(s.attributes)(e.inputElement,{"aria-expanded":"true","aria-owns":e.inputElement.id+"_options"}),e.value?i.i(s.attributes)(e.inputElement,{"aria-activedescendant":e.inputElement.id}):e.inputElement.removeAttribute("aria-activedescendant"),i.i(s.addClass)([e.inputWrapper.buttons[0]],m),e.isMobile||(e.cancelButton&&(e.btnKeyboardModule=new s.KeyboardEvents(e.cancelButton.element,{eventName:"keydown",keyAction:e.popupKeyActionHandle.bind(e),keyConfigs:{tab:"tab",altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}}),e.btnKeyboardModule=new s.KeyboardEvents(e.applyButton.element,{eventName:"keydown",keyAction:e.popupKeyActionHandle.bind(e),keyConfigs:{altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}})),i.i(s.isNullOrUndefined)(e.leftCalendar)||e.isRangeIconClicked||e.calendarFocus(),i.i(s.isNullOrUndefined)(e.presetElement)||(e.keyInputConfigs=i.i(s.extend)(e.keyInputConfigs,e.keyConfigs),e.presetKeyboardModule=new s.KeyboardEvents(e.presetElement,{eventName:"keydown",keyAction:e.presetKeyActionHandler.bind(e),keyConfigs:e.keyInputConfigs}),e.presetKeyboardModule=new s.KeyboardEvents(e.presetElement,{eventName:"keydown",keyAction:e.popupKeyActionHandle.bind(e),keyConfigs:{altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}}),i.i(s.isNullOrUndefined)(e.leftCalendar)?(e.preventBlur=!0,e.presetElement.focus()):e.presetElement.setAttribute("tabindex","-1")),e.popupKeyBoardHandler()),e.isMobile&&!s.Browser.isDevice&&s.EventHandler.add(document,"keydown",e.popupCloseHandler,e)},close:function(){i.i(s.attributes)(e.inputElement,{"aria-expanded":"false"}),e.inputElement.removeAttribute("aria-owns"),e.inputElement.removeAttribute("aria-activedescendant"),i.i(s.removeClass)([e.inputWrapper.buttons[0]],m),e.isRangeIconClicked&&e.inputWrapper.container.children[1].focus(),i.i(s.isUndefined)(e.presets[0].start&&e.presets[0].end&&e.presets[0].label)||e.unWireListEvents(),i.i(s.isNullOrUndefined)(e.popupObj)||(i.i(s.isNullOrUndefined)(e.popupObj.element.parentElement)||i.i(s.detach)(e.popupObj.element),e.popupObj.destroy(),e.popupObj=null),e.isMobile&&!s.Browser.isDevice&&s.EventHandler.remove(document,"keydown",e.popupCloseHandler)},targetExitViewport:function(){s.Browser.isDevice||e.hide()}}),this.isMobile&&(this.popupObj.element.classList.add("e-device"),this.isMobile||this.popupObj.element.classList.add("e-bigger")),this.isMobile&&this.isCustomWindow&&(i.i(s.addClass)([this.modal],["e-device",c,"e-range-modal"]),document.body.className+=" e-range-overflow",this.modal.style.display="block"),s.EventHandler.add(document,"mousedown touchstart",this.documentHandler,this)},t.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)},t.prototype.touchStartRangeHandler=function(e){this.touchRangeStart=!0},t.prototype.popupCloseHandler=function(e){switch(e.keyCode){case 27:this.hide(e)}},t.prototype.calendarFocus=function(){var e=this.popupObj&&this.popupObj.element.querySelector("."+f);if(e){var t=i.i(s.closest)(e,"."+p);t=i.i(s.isNullOrUndefined)(t)?this.leftCalendar:t,this.isRangeIconClicked?this.inputWrapper.container.focus():(this.preventBlur=!0,t.children[1].firstElementChild.focus()),i.i(s.addClass)([e],V)}else this.isRangeIconClicked?this.inputWrapper.container.focus():(this.preventBlur=!0,this.leftCalendar.children[1].firstElementChild.focus())},t.prototype.presetHeight=function(){var e=this.popupObj&&this.popupObj.element.querySelector(".e-presets"),t=this.popupObj&&this.popupObj.element.querySelector(".e-date-range-container");i.i(s.isNullOrUndefined)(e)||i.i(s.isNullOrUndefined)(t)||(e.style.height=t.getBoundingClientRect().height+"px")},t.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(),a=this.getActiveLI();if(!i.i(s.isNullOrUndefined)(this.leftCalendar)&&!i.i(s.isNullOrUndefined)(a)&&(i.i(s.isNullOrUndefined)(t)||!i.i(s.isNullOrUndefined)(a)&&a===t)){this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(a);if("custom_range"===this.presetsItem[this.activeIndex].id)return this.calendarFocus(),a.classList.remove(S),void e.preventDefault()}i.i(s.isNullOrUndefined)(t)&&i.i(s.isNullOrUndefined)(a)||this.onMouseClick(e,t||a),e.preventDefault();break;case"tab":if(this.leftCalendar){var n=this.getHoverLI();i.i(s.isNullOrUndefined)(n)||n.classList.remove(S)}else this.hide(e),e.preventDefault()}},t.prototype.listMoveDown=function(e){var t=this.getHoverLI(),a=this.getActiveLI();if(i.i(s.isNullOrUndefined)(t))if(i.i(s.isNullOrUndefined)(a))i.i(s.addClass)([this.liCollections[0]],S);else{var n=a.nextElementSibling;!i.i(s.isNullOrUndefined)(n)&&n.classList.contains(x)&&i.i(s.addClass)([n],S)}else{var n=t.nextElementSibling;!i.i(s.isNullOrUndefined)(n)&&n.classList.contains(x)&&(i.i(s.removeClass)([t],S),i.i(s.addClass)([n],S))}},t.prototype.listMoveUp=function(e){var t=this.getHoverLI(),a=this.getActiveLI();if(i.i(s.isNullOrUndefined)(t)){if(!i.i(s.isNullOrUndefined)(a)){var n=a.previousElementSibling;!i.i(s.isNullOrUndefined)(n)&&n.classList.contains(x)&&i.i(s.addClass)([n],S)}}else{var n=t.previousElementSibling;!i.i(s.isNullOrUndefined)(n)&&n.classList.contains(x)&&(i.i(s.removeClass)([t],S),i.i(s.addClass)([n],S))}},t.prototype.getHoverLI=function(){return this.presetElement.querySelector("."+S)},t.prototype.getActiveLI=function(){return this.presetElement.querySelector("."+m)},t.prototype.popupKeyBoardHandler=function(){this.popupKeyboardModule=new s.KeyboardEvents(this.popupWrapper,{eventName:"keydown",keyAction:this.popupKeyActionHandle.bind(this),keyConfigs:{escape:"escape"}}),this.keyInputConfigs=i.i(s.extend)(this.keyInputConfigs,this.keyConfigs),this.popupKeyboardModule=new s.KeyboardEvents(this.inputWrapper.container.children[1],{eventName:"keydown",keyAction:this.popupKeyActionHandle.bind(this),keyConfigs:this.keyInputConfigs})},t.prototype.setScrollPosition=function(){var e=this.presetElement.getBoundingClientRect().height,t=this.presetElement.querySelector("."+S),a=this.presetElement.querySelector("."+m),n=i.i(s.isNullOrUndefined)(t)?a:t;if(!i.i(s.isNullOrUndefined)(n)){var r=n.nextElementSibling,l=r?r.offsetTop:n.offsetTop,o=n.getBoundingClientRect().height;l+n.offsetTop>e?this.presetElement.scrollTop=r?l-(e/2+o/2):l:this.presetElement.scrollTop=0}},t.prototype.popupKeyActionHandle=function(e){var t=i.i(s.closest)(e.target,".e-presets");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":i.i(s.isNullOrUndefined)(t)?document.activeElement===this.cancelButton.element&&!0!==this.applyButton.element.disabled?this.applyButton.element.focus():this.leftCalendar.children[1].firstElementChild.focus():this.cancelButton.element.focus(),e.preventDefault();break;case"altLeftArrow":i.i(s.isNullOrUndefined)(t)?document.activeElement===this.applyButton.element&&!0!==this.applyButton.element.disabled?this.cancelButton.element.focus():i.i(s.isNullOrUndefined)(this.presetElement)||document.activeElement!==this.cancelButton.element?this.rightCalendar.children[1].firstElementChild.focus():this.presetElement.focus():this.rightCalendar.children[1].firstElementChild.focus(),e.preventDefault()}},t.prototype.documentHandler=function(e){if(!i.i(s.isNullOrUndefined)(this.popupObj)){var t=e.target;this.inputWrapper.container.contains(t)&&(i.i(s.isNullOrUndefined)(this.popupObj)||i.i(s.closest)(t,'[id="'+this.popupWrapper.id+'"]')||"mousedown"===e.type)||"touchstart"!==e.type&&("mousedown"===e.type||this.closeEventArgs&&!this.closeEventArgs.cancel)&&e.preventDefault(),!i.i(s.isNullOrUndefined)(this.targetElement)&&(i.i(s.isNullOrUndefined)(this.targetElement)||t===this.targetElement)||i.i(s.closest)(t,'[id="'+this.popupWrapper.id+'"]')||i.i(s.closest)(t,".e-input-group")===this.inputWrapper.container||i.i(s.closest)(t,".e-daterangepicker.e-popup")&&!t.classList.contains("e-day")||(this.preventBlur=!1,this.isPopupOpen()&&document.body.contains(this.popupObj.element)&&(this.applyFunction(e),this.isMobile||(this.isRangeIconClicked=!1)))}},t.prototype.createInput=function(){this.fullScreenMode&&this.isMobile&&(this.cssClass+=" e-popup-expand");var e=this.cssClass;i.i(s.isNullOrUndefined)(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),this.inputWrapper=l.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),i.i(s.attributes)(this.inputElement,{tabindex:"0","aria-expanded":"false",role:"combobox",autocomplete:"off","aria-disabled":this.enabled?"false":"true",autocorrect:"off",autocapitalize:"off",spellcheck:"false"}),l.Input.addAttributes({"aria-label":"select"},this.inputWrapper.buttons[0]),i.i(s.isNullOrUndefined)(this.placeholder)||""===this.placeholder.trim()||l.Input.addAttributes({"aria-placeholder":this.placeholder},this.inputElement),this.setEleWidth(this.width),i.i(s.addClass)([this.inputWrapper.container],"e-date-range-wrapper"),i.i(s.isNullOrUndefined)(this.inputElement.getAttribute("name"))&&i.i(s.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},t.prototype.setEleWidth=function(e){this.inputWrapper.container.style.width="string"==typeof e?this.width:"number"==typeof e?i.i(s.formatUnit)(this.width):"100%"},t.prototype.adjustLongHeaderWidth=function(){"Wide"===this.dayHeaderFormat&&i.i(s.addClass)([this.popupWrapper],"e-daterange-day-header-lg")},t.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(),i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.isNullOrUndefined)(this.startValue)||e||i.i(s.isNullOrUndefined)(this.renderDayCellArgs)||!this.renderDayCellArgs.isDisabled||this.disabledDateRender(),this.errorClass(),this.previousStartValue=i.i(s.isNullOrUndefined)(this.startValue)||isNaN(+this.startValue)?null:new Date(+this.startValue),this.previousEndValue=i.i(s.isNullOrUndefined)(this.endValue)||isNaN(+this.endValue)?null:new Date(+this.endValue)},t.prototype.updateInput=function(){if(!i.i(s.isNullOrUndefined)(this.endValue)&&!i.i(s.isNullOrUndefined)(this.startValue)){var e={format:this.formatString,type:"date",skeleton:"yMd"},t=this.globalize.formatDate(this.startValue,e),a=this.globalize.formatDate(this.endValue,e);l.Input.setValue(t+" "+this.separator+" "+a,this.inputElement,this.floatLabelType,this.showClearButton),this.previousStartValue=new Date(+this.startValue),this.previousEndValue=new Date(+this.endValue)}!this.strictMode&&i.i(s.isNullOrUndefined)(this.value)&&this.invalidValueString&&l.Input.setValue(this.invalidValueString,this.inputElement,this.floatLabelType,this.showClearButton)},t.prototype.checkInvalidRange=function(e){if(!i.i(s.isNullOrUndefined)(e)){var t=!1,a=void 0,n=void 0,r=null,l=null,o=null,h=!1,u=!1,d=!1;if("string"==typeof e){var p=e.split(" "+this.separator+" ");2===p.length?(r=p[0],l=p[1]):(t=!0,o=e)}else e.length>0?(a=e[0],n=e[1]):(a=e.start,n=e.end),a instanceof Date||"object"==typeof a?a instanceof Date?h=!0:i.i(s.isNullOrUndefined)(a)||(d=!0):r=this.getstringvalue(a),n instanceof Date||"object"==typeof n?n instanceof Date?u=!0:i.i(s.isNullOrUndefined)(n)||(d=!0):l=this.getstringvalue(n);(i.i(s.isNullOrUndefined)(r)&&!h&&!i.i(s.isNullOrUndefined)(l)||!i.i(s.isNullOrUndefined)(r)&&!u&&i.i(s.isNullOrUndefined)(l))&&(t=!0),d&&(r=l=o=null,t=!0),r&&(t=t||this.checkInvalidValue(r)),l&&(t=t||this.checkInvalidValue(l)),t&&(h&&!d&&(r=a.toLocaleDateString()),u&&!d&&(l=n.toLocaleDateString()),i.i(s.isNullOrUndefined)(r)||i.i(s.isNullOrUndefined)(l)?i.i(s.isNullOrUndefined)(r)?i.i(s.isNullOrUndefined)(l)||(o=l):o=r:o=r+" "+this.separator+" "+l,this.invalidValueString=o,this.setProperties({value:null},!0),this.setProperties({startValue:null},!0),this.setProperties({endValue:null},!0),this.startDate=null,this.endDate=null)}},t.prototype.getstringvalue=function(e){var t=null;return i.i(s.isNullOrUndefined)(e)||"number"!=typeof e?i.i(s.isNullOrUndefined)(e)||"string"!=typeof e||(t=""+e):t=e.toString(),t},t.prototype.checkInvalidValue=function(e){var t=e,i=!1,a=null;if(a={format:this.formatString,type:"date",skeleton:"yMd"},"string"!=typeof t)i=!0;else{var n=new s.Internationalization(this.locale);if(!this.checkDateValue(n.parseDate(t,a))){var r=null,l=null;r=/^\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)?)?/,l=/^\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)?)?/,(!r.test(t)&&!l.test(t)||/^[a-zA-Z0-9- ]*$/.test(t)||isNaN(+new Date(this.checkValue(t))))&&(i=!0)}}return i},t.prototype.isDateDisabled=function(e){if(i.i(s.isNullOrUndefined)(e))return!1;var t=new Date(+e);if(+t<+this.min||+t>+this.max)return!0;this.virtualRenderCellArgs={date:t,isDisabled:!1};var a=this.virtualRenderCellArgs;return this.virtualRenderCellEvent(a),!!a.isDisabled},t.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},t.prototype.virtualRenderCellEvent=function(e){i.i(s.extend)(this.virtualRenderCellArgs,{name:"renderDayCell"}),this.trigger("renderDayCell",e)},t.prototype.disabledDates=function(){var e=!1,t=!1;return i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.isNullOrUndefined)(this.startValue)||(e=this.isDateDisabled(this.startValue),t=this.isDateDisabled(this.endValue),this.isPopupOpen()||(this.currentDate=null),this.setValue()),e||t},t.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&&this.value.length>0||this.valueType&&this.valueType.length>0?(+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()},t.prototype.dispatchEvent=function(e,t){var i=document.createEvent("HTMLEvents");i.initEvent(t,!1,!0),e.dispatchEvent(i),this.firstHiddenChild.dispatchEvent(i)},t.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)},t.prototype.navigateTo=function(t,i){if(this.isPopupOpen()){if("month"===t.toLowerCase())t="Month";else if("year"===t.toLowerCase())t="Year";else{if("decade"!==t.toLowerCase())return;t="Decade"}this.getViewNumber(t)<this.getViewNumber(this.depth)&&(t=this.depth),this.isMobile?e.prototype.navigateTo.call(this,t,i):(i<this.min?i=new Date(+this.min):i>=this.max&&(i=new Date(+this.max)),"Month"===t&&this.isSameMonth(i,this.max)?i=new Date(this.max.getFullYear(),this.max.getMonth()-1,this.min.getDate()):"Year"===t&&this.isSameYear(i,this.max)?i=new Date(this.max.getFullYear()-1,this.max.getMonth(),this.max.getDate()):"Decade"===t&&this.isSameDecade(i,this.max)&&(i=new Date(this.max.getFullYear()-10,this.max.getMonth(),this.max.getDate())),this.leftCalCurrentDate=i,this.navigate(this.leftCalendar,this.leftCalCurrentDate,t),i="Month"===t?new Date(this.currentDate.setMonth(this.currentDate.getMonth()+1)):"Year"===t?new Date(this.currentDate.setFullYear(this.currentDate.getFullYear()+1)):new Date(this.currentDate.setFullYear(this.currentDate.getFullYear()+10)),this.rightCalCurrentDate=i,this.navigate(this.rightCalendar,this.rightCalCurrentDate,t),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])}},t.prototype.navigate=function(t,i,s){this.calendarElement=t,this.table=t.querySelector("table"),this.tableBodyElement=t.querySelector("tbody"),this.headerTitleElement=t.querySelector(".e-title"),this.tableHeadElement=t.querySelector("thead"),this.contentElement=t.querySelector(".e-content"),this.previousIcon=t.querySelector(".e-prev"),this.nextIcon=t.querySelector(".e-next"),this.effect="e-zoomin",e.prototype.navigateTo.call(this,s,i)},t.prototype.focusIn=function(){document.activeElement!==this.inputElement&&this.enabled&&(i.i(s.addClass)([this.inputWrapper.container],[y]),this.inputElement.focus())},t.prototype.focusOut=function(){var e=this.preventBlur;document.activeElement===this.inputElement&&(i.i(s.removeClass)([this.inputWrapper.container],[y]),this.preventBlur=!1,this.inputElement.blur(),this.preventBlur=e)},t.prototype.destroy=function(){this.unBindEvents(),this.hide(null);var t={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&&(i.i(s.removeClass)([this.inputElement],[c]),s.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),l.Input.removeAttributes(t,this.inputElement),i.i(s.isNullOrUndefined)(this.cloneElement.getAttribute("tabindex"))?this.inputElement.removeAttribute("tabindex"):this.inputElement.setAttribute("tabindex",this.tabIndex),this.ensureInputAttribute(),this.inputElement.classList.remove("e-input"),i.i(s.isNullOrUndefined)(this.inputWrapper)||(s.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler),null===this.angularTag&&this.inputWrapper.container.parentElement.appendChild(this.inputElement),i.i(s.detach)(this.inputWrapper.container))),i.i(s.isNullOrUndefined)(this.inputKeyboardModule)||this.isMobile||this.inputKeyboardModule.destroy(),this.popupObj&&(this.isMobile||this.clearCalendarEvents()),e.prototype.destroy.call(this),this.inputWrapper=this.popupWrapper=this.popupObj=this.cloneElement=this.presetElement=null,this.formElement&&s.EventHandler.remove(this.formElement,"reset",this.formResetHandler),i.i(s.isNullOrUndefined)(this.firstHiddenChild)||i.i(s.isNullOrUndefined)(this.secondHiddenChild)||(i.i(s.detach)(this.firstHiddenChild),i.i(s.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},t.prototype.ensureInputAttribute=function(){for(var e=[],t=0;t<this.inputElement.attributes.length;t++)e[t]=this.inputElement.attributes[t].name;for(var t=0;t<e.length;t++)i.i(s.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])))},t.prototype.getModuleName=function(){return"daterangepicker"},t.prototype.getPersistData=function(){var e=["startDate","endDate","value"];return this.addOnPersist(e)},t.prototype.getSelectedRange=function(){var e;return i.i(s.isNullOrUndefined)(this.startValue)||i.i(s.isNullOrUndefined)(this.endValue)?e=0:(e=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1,!i.i(s.isNullOrUndefined)(this.renderDayCellArgs)&&this.renderDayCellArgs.isDisabled&&this.disabledDateRender(),i.i(s.isNullOrUndefined)(this.disabledDayCnt)||(e-=this.disabledDayCnt,this.disabledDayCnt=null)),{startDate:this.startValue,endDate:this.endValue,daySpan:e}},t.prototype.show=function(t,a){var n=this;if(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||s.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:a||null,appendTo:this.isMobile||s.Browser.isDevice?this.mobileRangePopupWrap:document.body};var r=this.openEventArgs;this.trigger("open",r,function(r){if(n.openEventArgs=r,!n.openEventArgs.cancel){n.openEventArgs.appendTo.appendChild(n.popupWrapper),n.showPopup(t,a);var l=!n.isCustomRange||n.isMobile&&n.isCustomRange;!i.i(s.isUndefined)(n.presets[0].start&&n.presets[0].end&&n.presets[0].label)&&l&&n.setScrollPosition(),n.checkMinMaxDays(),n.isMobile&&!i.i(s.isNullOrUndefined)(n.startDate)&&i.i(s.isNullOrUndefined)(n.endDate)&&(n.endButton.element.classList.add(m),n.startButton.element.classList.remove(m),n.endButton.element.removeAttribute("disabled"),n.selectableDates()),e.prototype.setOverlayIndex.call(n,n.mobileRangePopupWrap,n.popupObj.element,n.modal,n.isMobile||s.Browser.isDevice)}})}},t.prototype.hide=function(e){var t=this;if(this.popupObj){if(i.i(s.isNullOrUndefined)(this.previousEndValue)&&i.i(s.isNullOrUndefined)(this.previousStartValue)?this.clearRange():(i.i(s.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))),i.i(s.isNullOrUndefined)(this.previousEndValue)?(this.endValue=null,this.setValue()):(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};var a=this.closeEventArgs;this.trigger("close",a,function(e){t.closeEventArgs=e,t.closeEventArgs.cancel?i.i(s.removeClass)([t.inputWrapper.buttons[0]],m):(t.isMobile&&(i.i(s.isNullOrUndefined)(t.startButton)||i.i(s.isNullOrUndefined)(t.endButton)||(s.EventHandler.remove(t.startButton.element,"click touchstart",t.deviceHeaderClick),s.EventHandler.remove(t.endButton.element,"click touchstart",t.deviceHeaderClick))),t.popupObj&&(t.popupObj.hide(),t.preventBlur&&(t.inputElement.focus(),i.i(s.addClass)([t.inputWrapper.container],[y]))),t.isMobile||(i.i(s.isNullOrUndefined)(t.leftKeyboardModule)||i.i(s.isNullOrUndefined)(t.rightKeyboardModule)||(t.leftKeyboardModule.destroy(),t.rightKeyboardModule.destroy()),i.i(s.isNullOrUndefined)(t.presetElement)||t.presetKeyboardModule.destroy(),i.i(s.isNullOrUndefined)(t.cancelButton)||t.btnKeyboardModule.destroy()),t.targetElement=null,i.i(s.removeClass)([document.body],"e-range-overflow"),s.EventHandler.remove(document,"mousedown touchstart",t.documentHandler),t.isMobile&&t.modal&&(t.modal.style.display="none",t.modal.outerHTML="",t.modal=null),(t.isMobile||s.Browser.isDevice)&&(i.i(s.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")})}}else this.updateClearIconState(),this.updateHiddenInput(),this.isMobile&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly")},t.prototype.setLocale=function(){this.globalize=new s.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),l.Input.setPlaceholder(this.placeholder,this.inputElement),this.updateInput(),this.updateHiddenInput(),this.changeTrigger()},t.prototype.refreshChange=function(){this.checkView(),this.refreshControl(),this.changeTrigger()},t.prototype.setDate=function(){l.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.refreshChange()},t.prototype.enableInput=function(){+this.min<=+this.max&&(this.setProperties({enabled:!0},!0),l.Input.setEnabled(this.enabled,this.inputElement),this.element.hasAttribute("disabled")&&this.bindEvents())},t.prototype.clearModelvalue=function(e,t){this.setProperties({startDate:null},!0),this.setProperties({endDate:null},!0),t.value&&t.value.length>0?this.setProperties({value:null},!0):t.value&&t.value.start?this.setProperties({value:{start:null,end:null}},!0):t.value&&!t.value.start&&this.setProperties({value:{start:null,end:null}},!0),this.updateValue(),this.setDate()},t.prototype.createHiddenInput=function(){i.i(s.isNullOrUndefined)(this.firstHiddenChild)&&i.i(s.isNullOrUndefined)(this.secondHiddenChild)&&(this.firstHiddenChild=this.createElement("input"),this.secondHiddenChild=this.createElement("input")),i.i(s.isNullOrUndefined)(this.inputElement.getAttribute("name"))||(this.inputElement.setAttribute("data-name",this.inputElement.getAttribute("name")),this.inputElement.removeAttribute("name")),i.i(s.attributes)(this.firstHiddenChild,{type:"text",name:this.inputElement.getAttribute("data-name"),class:"e-daterange-hidden"}),i.i(s.attributes)(this.secondHiddenChild,{type:"text",name:this.inputElement.getAttribute("data-name"),class:"e-daterange-hidden"});var e={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)},t.prototype.setMinMaxDays=function(){this.isPopupOpen()&&(this.removeClassDisabled(),this.checkMinMaxDays(),this.isMobile&&this.selectableDates(),!this.strictMode&&i.i(s.isNullOrUndefined)(this.startValue)&&i.i(s.isNullOrUndefined)(this.endValue)?this.removeSelection():this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar]),this.updateHeader())},t.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)},t.prototype.onPropertyChanged=function(e,t){for(var a={format:this.formatString,type:"date",skeleton:"yMd"},n=0,r=Object.keys(e);n<r.length;n++){var o=r[n];switch(["maxDays","minDays","value"].indexOf(o)<0&&this.hide(null),o){case"width":this.setEleWidth(this.width),l.Input.calculateWidth(this.inputElement,this.inputWrapper.container),i.i(s.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(s.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":l.Input.setPlaceholder(e.placeholder,this.inputElement),this.setProperties({placeholder:e.placeholder},!0);break;case"readonly":l.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),l.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),l.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"locale":this.globalize=new s.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),l.Input.setPlaceholder(this.placeholder,this.inputElement),this.setLocale();break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.setDataAttribute(!0),this.checkHtmlAttributes(!0);break;case"showClearButton":l.Input.setClearButton(this.showClearButton,this.inputElement,this.inputWrapper),this.bindClearEvent();break;case"startDate":"string"==typeof e.startDate&&(e.startDate=this.globalize.parseDate(e.startDate,a)),+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(e.endDate,a)),+this.initEndDate!=+e.endDate&&(this.endValue=this.getStartEndValue(e.endDate,!0),this.setDate(),this.setValue());break;case"value":if(this.invalidValueString=null,this.checkInvalidRange(e.value),"string"==typeof e.value)if(this.invalidValueString)this.clearModelvalue(e,t);else{var h=e.value.split(" "+this.separator+" ");this.value=[new Date(h[0]),new Date(h[1])],this.updateValue(),this.setDate()}else!i.i(s.isNullOrUndefined)(e.value)&&e.value.length>0||!i.i(s.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?this.clearModelvalue(e,t):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?this.modelValue=e.value:e.value.start&&(this.modelValue=e.value),this.updateValue(),this.setDate())):(i.i(s.isNullOrUndefined)(this.value)||null==e.value.start)&&(this.valueType=e.value,this.startValue=null,this.endValue=null,this.clearModelvalue(e,t));if(this.isPopupOpen()){if(i.i(s.isNullOrUndefined)(this.startValue)&&i.i(s.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},!0),this.refreshChange(),this.setMinMaxDays();break;case"maxDays":this.setProperties({maxDays:e.maxDays},!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,l.Input.removeFloating(this.inputWrapper),l.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder),i.i(s.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(s.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()}}},u([i.i(s.Property)(null)],t.prototype,"value",void 0),u([i.i(s.Property)(!1)],t.prototype,"enablePersistence",void 0),u([i.i(s.Property)(new Date(1900,0,1))],t.prototype,"min",void 0),u([i.i(s.Property)(new Date(2099,11,31))],t.prototype,"max",void 0),u([i.i(s.Property)(null)],t.prototype,"locale",void 0),u([i.i(s.Property)(null)],t.prototype,"firstDayOfWeek",void 0),u([i.i(s.Property)(!1)],t.prototype,"weekNumber",void 0),u([i.i(s.Property)("Gregorian")],t.prototype,"calendarMode",void 0),u([i.i(s.Property)(!1)],t.prototype,"openOnFocus",void 0),u([i.i(s.Property)(!1)],t.prototype,"fullScreenMode",void 0),u([i.i(s.Event)()],t.prototype,"created",void 0),u([i.i(s.Event)()],t.prototype,"destroyed",void 0),u([i.i(s.Event)()],t.prototype,"change",void 0),u([i.i(s.Event)()],t.prototype,"cleared",void 0),u([i.i(s.Event)()],t.prototype,"navigated",void 0),u([i.i(s.Event)()],t.prototype,"renderDayCell",void 0),u([i.i(s.Property)(null)],t.prototype,"startDate",void 0),u([i.i(s.Property)(null)],t.prototype,"endDate",void 0),u([i.i(s.Collection)([{}],A)],t.prototype,"presets",void 0),u([i.i(s.Property)("")],t.prototype,"width",void 0),u([i.i(s.Property)(1e3)],t.prototype,"zIndex",void 0),u([i.i(s.Property)(!0)],t.prototype,"showClearButton",void 0),u([i.i(s.Property)(!0)],t.prototype,"showTodayButton",void 0),u([i.i(s.Property)("Month")],t.prototype,"start",void 0),u([i.i(s.Property)("Month")],t.prototype,"depth",void 0),u([i.i(s.Property)("")],t.prototype,"cssClass",void 0),u([i.i(s.Property)("-")],t.prototype,"separator",void 0),u([i.i(s.Property)(null)],t.prototype,"minDays",void 0),u([i.i(s.Property)(null)],t.prototype,"maxDays",void 0),u([i.i(s.Property)(!1)],t.prototype,"strictMode",void 0),u([i.i(s.Property)(null)],t.prototype,"keyConfigs",void 0),u([i.i(s.Property)(null)],t.prototype,"format",void 0),u([i.i(s.Property)(!0)],t.prototype,"enabled",void 0),u([i.i(s.Property)(!1)],t.prototype,"readonly",void 0),u([i.i(s.Property)(!0)],t.prototype,"allowEdit",void 0),u([i.i(s.Property)("Never")],t.prototype,"floatLabelType",void 0),u([i.i(s.Property)(null)],t.prototype,"placeholder",void 0),u([i.i(s.Property)({})],t.prototype,"htmlAttributes",void 0),u([i.i(s.Event)()],t.prototype,"open",void 0),u([i.i(s.Event)()],t.prototype,"close",void 0),u([i.i(s.Event)()],t.prototype,"select",void 0),u([i.i(s.Event)()],t.prototype,"focus",void 0),u([i.i(s.Event)()],t.prototype,"blur",void 0),t=u([s.NotifyPropertyChanges],t)}(a.b)},function(e,t,i){"use strict";i.d(t,"a",function(){return D});var s=i(0),a=(i.n(s),i(2)),n=(i.n(a),i(1)),r=(i.n(n),i(4)),l=i(5),o=this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),h=this&&this.__decorate||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;l>=0;l--)(a=e[l])&&(r=(n<3?a(r):n>3?a(t,i,r):a(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},u=(new Date).getDate(),d=(new Date).getMonth(),p=(new Date).getFullYear(),c=(new Date).getHours(),m=(new Date).getMinutes(),f=(new Date).getSeconds(),v=(new Date).getMilliseconds(),y="e-datetimepicker",g="e-active",b="e-list-item",D=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.valueWithMinutes=null,s.scrollInvoked=!1,s.moduleName=s.getModuleName(),s.dateTimeOptions=t,s}return o(t,e),t.prototype.focusHandler=function(){this.enabled&&i.i(s.addClass)([this.inputWrapper.container],"e-input-focus")},t.prototype.focusIn=function(){e.prototype.focusIn.call(this)},t.prototype.focusOut=function(){document.activeElement===this.inputElement&&(this.inputElement.blur(),i.i(s.removeClass)([this.inputWrapper.container],["e-input-focus"]))},t.prototype.blurHandler=function(e){if(this.enabled){if(this.isTimePopupOpen()&&this.isPreventBlur)return void this.inputElement.focus();i.i(s.removeClass)([this.inputWrapper.container],"e-input-focus");var t={model:this};this.isTimePopupOpen()&&this.hide(e),this.trigger("blur",t)}},t.prototype.destroy=function(){this.popupObject&&this.popupObject.element.classList.contains("e-popup")&&(this.popupObject.destroy(),i.i(s.detach)(this.dateTimeWrapper),this.dateTimeWrapper=void 0,this.liCollections=this.timeCollections=[],i.i(s.isNullOrUndefined)(this.rippleFn)||this.rippleFn());var t={"aria-live":"assertive","aria-atomic":"true","aria-invalid":"false",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-expanded":"false",role:"combobox",autocomplete:"off"};this.inputElement&&n.Input.removeAttributes(t,this.inputElement),this.isCalendar()&&(this.popupWrapper&&i.i(s.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,e.prototype.destroy.call(this)},t.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,!i.i(s.isNullOrUndefined)(i.i(s.closest)(this.element,"fieldset"))&&i.i(s.closest)(this.element,"fieldset").disabled&&(this.enabled=!1),e.prototype.updateHtmlAttributeToElement.call(this),this.checkAttributes(!1);var t={placeholder:this.placeholder};this.l10n=new s.L10n("datetimepicker",t,this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),e.prototype.render.call(this),this.createInputElement(),e.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||n.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)),"Auto"===this.floatLabelType&&n.Input.calculateWidth(this.inputElement,this.inputWrapper.container),i.i(s.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(s.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()},t.prototype.setValue=function(t){if(void 0===t&&(t=!1),this.initValue=this.validateMinMaxRange(this.value),!this.strictMode&&this.isDateObject(this.initValue)){var a=this.validateMinMaxRange(this.initValue);n.Input.setValue(this.getFormattedValue(a),this.inputElement,this.floatLabelType,this.showClearButton),this.setProperties({value:a},!0)}else i.i(s.isNullOrUndefined)(this.value)&&(this.initValue=null,this.setProperties({value:null},!0));this.valueWithMinutes=this.value,e.prototype.updateInput.call(this,t)},t.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},t.prototype.checkValidState=function(e){this.isValidState=!0,this.strictMode||(+e>+this.max||+e<+this.min)&&(this.isValidState=!1),this.checkErrorState()},t.prototype.checkErrorState=function(){this.isValidState?i.i(s.removeClass)([this.inputWrapper.container],"e-error"):i.i(s.addClass)([this.inputWrapper.container],"e-error"),i.i(s.attributes)(this.inputElement,{"aria-invalid":this.isValidState?"false":"true"})},t.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},t.prototype.disablePopupButton=function(e){e?(i.i(s.addClass)([this.inputWrapper.buttons[0],this.timeIcon],"e-disabled"),this.hide()):i.i(s.removeClass)([this.inputWrapper.buttons[0],this.timeIcon],"e-disabled")},t.prototype.getFormattedValue=function(e){var t;return i.i(s.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))},t.prototype.isDateObject=function(e){return!i.i(s.isNullOrUndefined)(e)&&!isNaN(+e)},t.prototype.createInputElement=function(){i.i(s.removeClass)([this.inputElement],"e-datepicker"),i.i(s.removeClass)([this.inputWrapper.container],"e-date-wrapper"),i.i(s.addClass)([this.inputWrapper.container],"e-datetime-wrapper"),i.i(s.addClass)([this.inputElement],y),this.renderTimeIcon()},t.prototype.renderTimeIcon=function(){this.timeIcon=n.Input.appendSpan("e-input-group-icon e-time-icon e-icons",this.inputWrapper.container)},t.prototype.bindInputEvents=function(){s.EventHandler.add(this.timeIcon,"mousedown",this.timeHandler,this),s.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.dateHandler,this),s.EventHandler.add(this.inputElement,"blur",this.blurHandler,this),s.EventHandler.add(this.inputElement,"focus",this.focusHandler,this),this.defaultKeyConfigs=i.i(s.extend)(this.defaultKeyConfigs,this.keyConfigs),this.keyboardHandler=new s.KeyboardEvents(this.inputElement,{eventName:"keydown",keyAction:this.inputKeyAction.bind(this),keyConfigs:this.defaultKeyConfigs})},t.prototype.unBindInputEvents=function(){s.EventHandler.remove(this.timeIcon,"mousedown touchstart",this.timeHandler),s.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown touchstart",this.dateHandler),this.inputElement&&(s.EventHandler.remove(this.inputElement,"blur",this.blurHandler),s.EventHandler.remove(this.inputElement,"focus",this.focusHandler)),this.keyboardHandler&&this.keyboardHandler.destroy()},t.prototype.cldrTimeFormat=function(){return this.isNullOrEmpty(this.timeFormat)?"en"===this.locale||"en-US"===this.locale?i.i(s.getValue)("timeFormats.short",i.i(s.getDefaultDateObject)()):this.getCultureTimeObject(s.cldrData,""+this.locale):this.timeFormat},t.prototype.cldrDateTimeFormat=function(){var e=new s.Internationalization(this.locale),t=e.getDatePattern({skeleton:"yMd"});return this.isNullOrEmpty(this.formatString)?t+" "+this.getCldrFormat("time"):this.formatString},t.prototype.getCldrFormat=function(e){return"en"===this.locale||"en-US"===this.locale?i.i(s.getValue)("timeFormats.short",i.i(s.getDefaultDateObject)()):this.getCultureTimeObject(s.cldrData,""+this.locale)},t.prototype.isNullOrEmpty=function(e){return!!(i.i(s.isNullOrUndefined)(e)||"string"==typeof e&&""===e.trim())},t.prototype.getCultureTimeObject=function(e,t){return"Gregorian"===this.calendarMode?i.i(s.getValue)("main."+this.locale+".dates.calendars.gregorian.timeFormats.short",e):i.i(s.getValue)("main."+this.locale+".dates.calendars.islamic.timeFormats.short",e)},t.prototype.timeHandler=function(t){this.enabled&&(this.isIconClicked=!0,s.Browser.isDevice&&this.inputElement.setAttribute("readonly",""),t.currentTarget===this.timeIcon&&t.preventDefault(),this.enabled&&!this.readonly&&(this.isDatePopupOpen()&&e.prototype.hide.call(this,t),this.isTimePopupOpen()?this.closePopup(t):(this.inputElement.focus(),this.popupCreation("time",t),i.i(s.addClass)([this.inputWrapper.container],["e-input-focus"]))),this.isIconClicked=!1)},t.prototype.dateHandler=function(e){this.enabled&&(e.currentTarget===this.inputWrapper.buttons[0]&&e.preventDefault(),this.enabled&&!this.readonly&&(this.isTimePopupOpen()&&this.closePopup(e),i.i(s.isNullOrUndefined)(this.popupWrapper)||this.popupCreation("date",e)))},t.prototype.show=function(t,i){this.enabled&&this.readonly||!this.enabled||("time"!==t||this.dateTimeWrapper?this.popupObj||(this.isTimePopupOpen()&&this.hide(i),e.prototype.show.call(this),this.popupCreation("date",i)):(this.isDatePopupOpen()&&this.hide(i),this.popupCreation("time",i)))},t.prototype.toggle=function(t){this.isDatePopupOpen()?(e.prototype.hide.call(this,t),this.show("time",null)):this.isTimePopupOpen()?(this.hide(t),e.prototype.show.call(this,null,t),this.popupCreation("date",null)):this.show(null,t)},t.prototype.listCreation=function(){var e;e="Gregorian"===this.calendarMode?this.globalize.parseDate(this.inputElement.value,{format:this.cldrDateTimeFormat(),type:"datetime"}):this.globalize.parseDate(this.inputElement.value,{format:this.cldrDateTimeFormat(),type:"datetime",calendar:"islamic"});var t=i.i(s.isNullOrUndefined)(this.value)?""!==this.inputElement.value?e:new Date:this.value;this.valueWithMinutes=t,this.listWrapper=i.i(s.createElement)("div",{className:"e-content",attrs:{tabindex:"0"}});var a=this.startTime(t),n=this.endTime(t),r=l.a.createListItems(this.createElement,a,n,this.globalize,this.cldrTimeFormat(),this.step);this.timeCollections=r.collection,this.listTag=r.list,i.i(s.attributes)(this.listTag,{role:"listbox","aria-hidden":"false",id:this.element.id+"_options"}),i.i(s.append)([r.list],this.listWrapper),this.wireTimeListEvents();var o={duration:300,selector:"."+b};this.rippleFn=i.i(s.rippleEffect)(this.listWrapper,o),this.liCollections=this.listWrapper.querySelectorAll("."+b)},t.prototype.popupCreation=function(e,t){s.Browser.isDevice&&this.element.setAttribute("readonly","readonly"),"date"===e?!this.readonly&&this.popupWrapper&&(i.i(s.addClass)([this.popupWrapper],"e-datetimepopup-wrapper"),i.i(s.attributes)(this.popupWrapper,{id:this.element.id+"_datepopup"})):this.readonly||(this.dateTimeWrapper=i.i(s.createElement)("div",{className:y+" e-popup",attrs:{id:this.element.id+"_timepopup",style:"visibility:hidden ; display:block"}}),i.i(s.isNullOrUndefined)(this.cssClass)||(this.dateTimeWrapper.className+=" "+this.cssClass),!i.i(s.isNullOrUndefined)(this.step)&&this.step>0&&(this.listCreation(),i.i(s.append)([this.listWrapper],this.dateTimeWrapper)),document.body.appendChild(this.dateTimeWrapper),this.addTimeSelection(),this.renderPopup(),this.setTimeScrollPosition(),this.openPopup(t),(!s.Browser.isDevice||s.Browser.isDevice&&!this.fullScreenMode)&&this.popupObject.refreshPosition(this.inputElement),s.Browser.isDevice&&this.fullScreenMode&&(this.dateTimeWrapper.style.left="0px"))},t.prototype.openPopup=function(e){var t=this;this.preventArgs={cancel:!1,popup:this.popupObject,event:e||null};var a=this.preventArgs;this.trigger("open",a,function(e){if(t.preventArgs=e,!t.preventArgs.cancel&&!t.readonly){var a={name:"FadeIn",duration:100};1e3===t.zIndex?t.popupObject.show(new s.Animation(a),t.element):t.popupObject.show(new s.Animation(a),null),i.i(s.addClass)([t.inputWrapper.container],["e-icon-anim"]),i.i(s.attributes)(t.inputElement,{"aria-expanded":"true"}),i.i(s.attributes)(t.inputElement,{"aria-owns":t.inputElement.id+"_options"}),s.EventHandler.add(document,"mousedown touchstart",t.documentClickHandler,t)}})},t.prototype.documentClickHandler=function(e){var t=e.target;!i.i(s.isNullOrUndefined)(this.popupObject)&&(this.inputWrapper.container.contains(t)&&"mousedown"!==e.type||this.popupObject.element&&this.popupObject.element.contains(t))&&"touchstart"!==e.type&&e.preventDefault(),i.i(s.closest)(t,'[id="'+(this.popupObject&&this.popupObject.element.id+'"]'))||t===this.inputElement||t===this.timeIcon||i.i(s.isNullOrUndefined)(this.inputWrapper)||t===this.inputWrapper.container?t!==this.inputElement&&(s.Browser.isDevice||(this.isPreventBlur=document.activeElement===this.inputElement&&(s.Browser.isIE||"edge"===s.Browser.info.name)&&t===this.popupObject.element)):this.isTimePopupOpen()&&(this.hide(e),this.focusOut())},t.prototype.isTimePopupOpen=function(){return!(!this.dateTimeWrapper||!this.dateTimeWrapper.classList.contains(""+y))},t.prototype.isDatePopupOpen=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains("e-datetimepopup-wrapper"))},t.prototype.renderPopup=function(){var e=this;this.containerStyle=this.inputWrapper.container.getBoundingClientRect(),s.Browser.isDevice&&(this.timeModal=i.i(s.createElement)("div"),this.timeModal.className=y+" e-time-modal",document.body.className+=" e-time-overflow",this.timeModal.style.display="block",document.body.appendChild(this.timeModal));if(this.popupObject=new a.Popup(this.dateTimeWrapper,{width:this.setPopupWidth(),zIndex:this.zIndex,targetType:"container",collision:s.Browser.isDevice?{X:"fit",Y:"fit"}:{X:"flip",Y:"flip"},relateTo:s.Browser.isDevice?document.body:this.inputWrapper.container,position:s.Browser.isDevice?{X:"center",Y:"center"}:{X:"left",Y:"bottom"},enableRtl:this.enableRtl,offsetY:4,open:function(){e.dateTimeWrapper.style.visibility="visible",i.i(s.addClass)([e.timeIcon],g),s.Browser.isDevice||(e.timekeyConfigure=i.i(s.extend)(e.timekeyConfigure,e.keyConfigs),e.inputEvent=new s.KeyboardEvents(e.inputWrapper.container,{keyAction:e.timeKeyActionHandle.bind(e),keyConfigs:e.timekeyConfigure,eventName:"keydown"}))},close:function(){i.i(s.removeClass)([e.timeIcon],g),e.unWireTimeListEvents(),e.inputElement.removeAttribute("aria-activedescendant"),i.i(s.remove)(e.popupObject.element),e.popupObject.destroy(),e.dateTimeWrapper.innerHTML="",e.listWrapper=e.dateTimeWrapper=void 0,e.inputEvent&&e.inputEvent.destroy()},targetExitViewport:function(){s.Browser.isDevice||e.hide()}}),s.Browser.isDevice&&this.fullScreenMode?(this.popupObject.element.style.display="flex",this.popupObject.element.style.maxHeight="100%",this.popupObject.element.style.width="100%"):this.popupObject.element.style.maxHeight="250px",s.Browser.isDevice&&this.fullScreenMode){var t=i.i(s.createElement)("div",{className:"e-datetime-mob-popup-wrap"}),n=this.createElement("div",{className:"e-model-header"}),r=this.createElement("span",{className:"e-model-title"});r.textContent="Select time";var l=this.createElement("span",{className:"e-popup-close"});s.EventHandler.add(l,"mousedown touchstart",this.dateTimeCloseHandler,this);var o=this.dateTimeWrapper.querySelector(".e-content");n.appendChild(l),n.appendChild(r),t.appendChild(n),t.appendChild(o),this.dateTimeWrapper.insertBefore(t,this.dateTimeWrapper.firstElementChild)}},t.prototype.dateTimeCloseHandler=function(e){this.hide()},t.prototype.setDimension=function(e){return e="number"==typeof e?i.i(s.formatUnit)(e):"string"==typeof e?e:"100%"},t.prototype.setPopupWidth=function(){var e=this.setDimension(this.width);if(e.indexOf("%")>-1){e=(this.containerStyle.width*parseFloat(e)/100).toString()+"px"}return e},t.prototype.wireTimeListEvents=function(){s.EventHandler.add(this.listWrapper,"click",this.onMouseClick,this),s.Browser.isDevice||(s.EventHandler.add(this.listWrapper,"mouseover",this.onMouseOver,this),s.EventHandler.add(this.listWrapper,"mouseout",this.onMouseLeave,this))},t.prototype.unWireTimeListEvents=function(){this.listWrapper&&(s.EventHandler.remove(this.listWrapper,"click",this.onMouseClick),s.EventHandler.remove(document,"mousedown touchstart",this.documentClickHandler),s.Browser.isDevice||(s.EventHandler.add(this.listWrapper,"mouseover",this.onMouseOver,this),s.EventHandler.add(this.listWrapper,"mouseout",this.onMouseLeave,this)))},t.prototype.onMouseOver=function(e){var t=i.i(s.closest)(e.target,"."+b);this.setTimeHover(t,"e-hover")},t.prototype.onMouseLeave=function(){this.removeTimeHover("e-hover")},t.prototype.setTimeHover=function(e,t){this.enabled&&this.isValidLI(e)&&!e.classList.contains(t)&&(this.removeTimeHover(t),i.i(s.addClass)([e],t))},t.prototype.getPopupHeight=function(){var e=parseInt("250px",10),t=this.dateTimeWrapper.getBoundingClientRect().height;return s.Browser.isDevice&&this.fullScreenMode?t:t>e?e:t},t.prototype.changeEvent=function(t){e.prototype.changeEvent.call(this,t),(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))},t.prototype.updateValue=function(e){this.setInputValue("time"),+this.previousDateTime!=+this.value&&(this.changedArgs={value:this.value,event:e||null,isInteracted:!i.i(s.isNullOrUndefined)(e),element:this.element},this.addTimeSelection(),this.trigger("change",this.changedArgs),this.previousDateTime=this.previousDate=this.value)},t.prototype.setTimeScrollPosition=function(){var e=this.selectedElement;i.i(s.isNullOrUndefined)(e)?this.dateTimeWrapper&&this.checkDateValue(this.scrollTo)&&this.setScrollTo():this.findScrollTop(e)},t.prototype.findScrollTop=function(e){var t=this.getPopupHeight(),i=e.nextElementSibling,a=i?i.offsetTop:e.offsetTop,n=e.getBoundingClientRect().height;if(a+e.offsetTop>t)if(s.Browser.isDevice&&this.fullScreenMode){var r=this.dateTimeWrapper.querySelector(".e-content");r.scrollTop=i?a-(t/2+n/2):a}else this.dateTimeWrapper.scrollTop=i?a-(t/2+n/2):a;else this.dateTimeWrapper.scrollTop=0},t.prototype.setScrollTo=function(){var e,t=this.dateTimeWrapper.querySelectorAll("."+b);if(t.length>=0){this.scrollInvoked=!0;var a=this.timeCollections[0],n=this.getDateObject(this.checkDateValue(this.scrollTo)).getTime();e=t[Math.round((n-a)/(6e4*this.step))]}else this.dateTimeWrapper.scrollTop=0;i.i(s.isNullOrUndefined)(e)?this.dateTimeWrapper.scrollTop=0:this.findScrollTop(e)},t.prototype.setInputValue=function(e){if("date"===e)this.inputElement.value=this.previousElementValue=this.getFormattedValue(this.getFullDateTime()),this.setProperties({value:this.getFullDateTime()},!0);else{var t=this.getFormattedValue(new Date(this.timeCollections[this.activeIndex]));n.Input.setValue(t,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()},t.prototype.getFullDateTime=function(){var e=null;return e=this.isDateObject(this.valueWithMinutes)?this.combineDateTime(this.valueWithMinutes):this.previousDate,this.validateMinMaxRange(e)},t.prototype.createMask=function(){this.notify("createMask",{module:"MaskedDateTime"})},t.prototype.combineDateTime=function(e){if(this.isDateObject(e)){var t=this.previousDate.getDate(),i=this.previousDate.getMonth(),s=this.previousDate.getFullYear(),a=e.getHours(),n=e.getMinutes(),r=e.getSeconds();return new Date(s,i,t,a,n,r)}return this.previousDate},t.prototype.onMouseClick=function(e){var t=e.target,a=this.selectedElement=i.i(s.closest)(t,"."+b);a&&a.classList.contains(b)&&(this.timeValue=a.getAttribute("data-value"),this.hide(e)),this.setSelection(a,e)},t.prototype.setSelection=function(e,t){if(this.isValidLI(e)&&!e.classList.contains(g)){this.selectedElement=e;var a=Array.prototype.slice.call(this.liCollections).indexOf(e);this.activeIndex=a,this.valueWithMinutes=new Date(this.timeCollections[this.activeIndex]),i.i(s.addClass)([this.selectedElement],g),this.selectedElement.setAttribute("aria-selected","true"),this.updateValue(t)}},t.prototype.setTimeActiveClass=function(){var e=i.i(s.isNullOrUndefined)(this.dateTimeWrapper)?this.listWrapper:this.dateTimeWrapper;if(!i.i(s.isNullOrUndefined)(e)){var t=e.querySelectorAll("."+b);if(t.length)for(var a=0;a<t.length;a++)if(this.timeCollections[a]===+this.valueWithMinutes){t[a].setAttribute("aria-selected","true"),this.selectedElement=t[a],this.activeIndex=a,this.setTimeActiveDescendant();break}}},t.prototype.setTimeActiveDescendant=function(){!i.i(s.isNullOrUndefined)(this.selectedElement)&&this.value?i.i(s.attributes)(this.inputElement,{"aria-activedescendant":this.selectedElement.getAttribute("id")}):this.inputElement.removeAttribute("aria-activedescendant")},t.prototype.addTimeSelection=function(){this.selectedElement=null,this.removeTimeSelection(),this.setTimeActiveClass(),i.i(s.isNullOrUndefined)(this.selectedElement)||(i.i(s.addClass)([this.selectedElement],g),this.selectedElement.setAttribute("aria-selected","true"))},t.prototype.removeTimeSelection=function(){if(this.removeTimeHover("e-hover"),!i.i(s.isNullOrUndefined)(this.dateTimeWrapper)){var e=this.dateTimeWrapper.querySelectorAll("."+g);e.length&&(i.i(s.removeClass)(e,g),e[0].removeAttribute("aria-selected"))}},t.prototype.removeTimeHover=function(e){var t=this.getTimeHoverItem(e);t&&t.length&&i.i(s.removeClass)(t,e)},t.prototype.getTimeHoverItem=function(e){var t,a=i.i(s.isNullOrUndefined)(this.dateTimeWrapper)?this.listWrapper:this.dateTimeWrapper;return i.i(s.isNullOrUndefined)(a)||(t=a.querySelectorAll("."+e)),t},t.prototype.isValidLI=function(e){return e&&e.classList.contains(b)&&!e.classList.contains("e-disabled")},t.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(),h=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,h)},t.prototype.startTime=function(e){var t,i,s=this.min,a=null===e?new Date:e;return+a.getDate()==+s.getDate()&&+a.getMonth()==+s.getMonth()&&+a.getFullYear()==+s.getFullYear()||+new Date(a.getFullYear(),a.getMonth(),a.getDate())<=+new Date(s.getFullYear(),s.getMonth(),s.getDate())?(i=!1,t=this.min):+a<+this.max&&+a>+this.min?(i=!0,t=a):+a>=+this.max&&(i=!0,t=this.max),this.calculateStartEnd(t,i,"starttime")},t.prototype.endTime=function(e){var t,i,s=this.max,a=null===e?new Date:e;return+a.getDate()==+s.getDate()&&+a.getMonth()==+s.getMonth()&&+a.getFullYear()==+s.getFullYear()||+new Date(a.getUTCFullYear(),a.getMonth(),a.getDate())>=+new Date(s.getFullYear(),s.getMonth(),s.getDate())?(i=!1,t=this.max):+a<+this.max&&+a>+this.min?(i=!0,t=a):+a<=+this.min&&(i=!0,t=this.min),this.calculateStartEnd(t,i,"endtime")},t.prototype.hide=function(e){var t=this;if(this.popupObj||this.dateTimeWrapper){this.preventArgs={cancel:!1,popup:this.popupObj||this.popupObject,event:e||null};var a=this.preventArgs;i.i(s.isNullOrUndefined)(this.popupObj)?this.trigger("close",a,function(i){t.dateTimeCloseEventCallback(e,i)}):this.dateTimeCloseEventCallback(e,a)}else s.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit()},t.prototype.dateTimeCloseEventCallback=function(t,a){this.preventArgs=a,this.preventArgs.cancel||(this.isDatePopupOpen()?e.prototype.hide.call(this,t):this.isTimePopupOpen()&&(this.closePopup(t),i.i(s.removeClass)([document.body],"e-time-overflow"),s.Browser.isDevice&&this.timeModal&&(this.timeModal.style.display="none",this.timeModal.outerHTML="",this.timeModal=null),this.setTimeActiveDescendant())),s.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit()},t.prototype.closePopup=function(e){if(this.isTimePopupOpen()&&this.popupObject){var t={name:"FadeOut",duration:100,delay:0};this.popupObject.hide(new s.Animation(t)),this.inputWrapper.container.classList.remove("e-icon-anim"),i.i(s.attributes)(this.inputElement,{"aria-expanded":"false"}),this.inputElement.removeAttribute("aria-owns"),s.EventHandler.remove(document,"mousedown touchstart",this.documentClickHandler)}},t.prototype.preRender=function(){this.checkFormat(),this.dateTimeFormat=this.cldrDateTimeFormat(),e.prototype.preRender.call(this),i.i(s.removeClass)([this.inputElementCopy],[y])},t.prototype.getProperty=function(e,t){"min"===t?this.setProperties({min:this.validateValue(e.min)},!0):this.setProperties({max:this.validateValue(e.max)},!0)},t.prototype.checkAttributes=function(e){for(var t,a=e?i.i(s.isNullOrUndefined)(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["style","name","step","disabled","readonly","value","min","max","placeholder","type"],n=0,r=a;n<r.length;n++){var l=r[n];if(!i.i(s.isNullOrUndefined)(this.inputElement.getAttribute(l)))switch(l){case"name":this.inputElement.setAttribute("name",this.inputElement.getAttribute(l));break;case"step":this.step=parseInt(this.inputElement.getAttribute(l),10);break;case"readonly":if(i.i(s.isNullOrUndefined)(this.dateTimeOptions)||void 0===this.dateTimeOptions.readonly||e){var o="disabled"===this.inputElement.getAttribute(l)||""===this.inputElement.getAttribute(l)||"true"===this.inputElement.getAttribute(l);this.setProperties({readonly:o},!e)}break;case"placeholder":(i.i(s.isNullOrUndefined)(this.dateTimeOptions)||void 0===this.dateTimeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(l)},!e);break;case"min":(i.i(s.isNullOrUndefined)(this.dateTimeOptions)||void 0===this.dateTimeOptions.min||e)&&(t=new Date(this.inputElement.getAttribute(l)),this.isNullOrEmpty(t)||isNaN(+t)||this.setProperties({min:t},!e));break;case"disabled":if(i.i(s.isNullOrUndefined)(this.dateTimeOptions)||void 0===this.dateTimeOptions.enabled||e){var h="disabled"!==this.inputElement.getAttribute(l)&&"true"!==this.inputElement.getAttribute(l)&&""!==this.inputElement.getAttribute(l);this.setProperties({enabled:h},!e)}break;case"value":(i.i(s.isNullOrUndefined)(this.dateTimeOptions)||void 0===this.dateTimeOptions.value||e)&&(t=new Date(this.inputElement.getAttribute(l)),this.isNullOrEmpty(t)||isNaN(+t)||this.setProperties({value:t},!e));break;case"max":(i.i(s.isNullOrUndefined)(this.dateTimeOptions)||void 0===this.dateTimeOptions.max||e)&&(t=new Date(this.inputElement.getAttribute(l)),this.isNullOrEmpty(t)||isNaN(+t)||this.setProperties({max:t},!e))}}},t.prototype.requiredModules=function(){var e=[];return this&&e.push({args:[this],member:"islamic"}),this.enableMask&&e.push(this.maskedDateModule()),e},t.prototype.maskedDateModule=function(){return{args:[this],member:"MaskedDateTime"}},t.prototype.getTimeActiveElement=function(){return i.i(s.isNullOrUndefined)(this.dateTimeWrapper)?null:this.dateTimeWrapper.querySelectorAll("."+g)},t.prototype.createDateObj=function(e){return e instanceof Date?e:null},t.prototype.getDateObject=function(e){if(!this.isNullOrEmpty(e)){var t=this.createDateObj(e),a=this.valueWithMinutes,n=!i.i(s.isNullOrUndefined)(a);if(this.checkDateValue(t)){var r=n?a.getDate():u,l=n?a.getMonth():d,o=n?a.getFullYear():p,h=n?a.getHours():c,y=n?a.getMinutes():m,g=n?a.getSeconds():f,b=n?a.getMilliseconds():v;return this.scrollInvoked?(this.scrollInvoked=!1,new Date(o,l,r,t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())):new Date(o,l,r,h,y,g,b)}}return null},t.prototype.findNextTimeElement=function(e){var t=this.inputElement.value,a=i.i(s.isNullOrUndefined)(this.valueWithMinutes)?this.createDateObj(t):this.getDateObject(this.valueWithMinutes),n=null,r=this.liCollections.length;if(!i.i(s.isNullOrUndefined)(this.activeIndex)||!i.i(s.isNullOrUndefined)(this.checkDateValue(a))){if("home"===e.action)n=+this.createDateObj(new Date(this.timeCollections[0])),this.activeIndex=0;else if("end"===e.action)n=+this.createDateObj(new Date(this.timeCollections[this.timeCollections.length-1])),this.activeIndex=this.timeCollections.length-1;else if("down"===e.action){for(var l=0;l<r;l++)if(+a<this.timeCollections[l]){n=+this.createDateObj(new Date(this.timeCollections[l])),this.activeIndex=l;break}}else for(var l=r-1;l>=0;l--)if(+a>this.timeCollections[l]){n=+this.createDateObj(new Date(this.timeCollections[l])),this.activeIndex=l;break}this.selectedElement=this.liCollections[this.activeIndex],this.timeElementValue(i.i(s.isNullOrUndefined)(n)?null:new Date(n))}},t.prototype.setTimeValue=function(e,t){var a,r,l=this.validateMinMaxRange(t),o=this.createDateObj(l);return this.getFormattedValue(o)!==(i.i(s.isNullOrUndefined)(this.value)?null:this.getFormattedValue(this.value))?(this.valueWithMinutes=i.i(s.isNullOrUndefined)(o)?null:o,r=new Date(+this.valueWithMinutes)):(this.strictMode&&(e=o),this.valueWithMinutes=this.checkDateValue(e),r=new Date(+this.valueWithMinutes)),a="Gregorian"===this.calendarMode?this.globalize.formatDate(r,{format:i.i(s.isNullOrUndefined)(this.formatString)?this.cldrDateTimeFormat():this.formatString,type:"dateTime",skeleton:"yMd"}):this.globalize.formatDate(r,{format:i.i(s.isNullOrUndefined)(this.formatString)?this.cldrDateTimeFormat():this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}),!this.strictMode&&i.i(s.isNullOrUndefined)(r),n.Input.setValue(a,this.inputElement,this.floatLabelType,this.showClearButton),r},t.prototype.timeElementValue=function(e){if(!i.i(s.isNullOrUndefined)(this.checkDateValue(e))&&!this.isNullOrEmpty(e)){var t=e instanceof Date?e:this.getDateObject(e);return this.setTimeValue(t,e)}return null},t.prototype.timeKeyHandler=function(e){if(!(i.i(s.isNullOrUndefined)(this.step)||this.step<=0)){var t=this.timeCollections.length;if(i.i(s.isNullOrUndefined)(this.getTimeActiveElement())||0===this.getTimeActiveElement().length)this.liCollections.length>0&&(i.i(s.isNullOrUndefined)(this.value)&&i.i(s.isNullOrUndefined)(this.activeIndex)?(this.activeIndex=0,this.selectedElement=this.liCollections[0],this.timeElementValue(new Date(this.timeCollections[0]))):this.findNextTimeElement(e));else{var a=void 0;if(e.keyCode>=37&&e.keyCode<=40){var n=40===e.keyCode||39===e.keyCode?++this.activeIndex:--this.activeIndex;this.activeIndex=n=this.activeIndex===t?0:this.activeIndex,this.activeIndex=n=this.activeIndex<0?t-1:this.activeIndex,a=i.i(s.isNullOrUndefined)(this.timeCollections[n])?this.timeCollections[0]:this.timeCollections[n]}else"home"===e.action?(this.activeIndex=0,a=this.timeCollections[0]):"end"===e.action&&(this.activeIndex=t-1,a=this.timeCollections[t-1]);this.selectedElement=this.liCollections[this.activeIndex],this.timeElementValue(new Date(a))}this.isNavigate=!0,this.setTimeHover(this.selectedElement,"e-navigation"),this.setTimeActiveDescendant(),!this.isTimePopupOpen()||null===this.selectedElement||e&&"click"===e.type||this.setTimeScrollPosition()}},t.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),i.i(s.addClass)([this.inputWrapper.container],"e-input-focus"),this.isNavigate=!1,e.stopPropagation();break;case"escape":this.hide(e);break;default:this.isNavigate=!1}},t.prototype.inputKeyAction=function(e){switch(e.action){case"altDownArrow":this.strictModeUpdate(),this.updateInput(),this.toggle(e)}},t.prototype.onPropertyChanged=function(t,a){for(var r=0,l=Object.keys(t);r<l.length;r++){var o=l[r];switch(o){case"value":this.isDynamicValueChanged=!0,this.invalidValueString=null,this.checkInvalidValue(t.value),t.value=this.value,t.value=this.validateValue(t.value),this.enableMask?n.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton):n.Input.setValue(this.getFormattedValue(t.value),this.inputElement,this.floatLabelType,this.showClearButton),this.valueWithMinutes=t.value,this.setProperties({value:t.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(t,o),this.updateInput();break;case"enableRtl":n.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]);break;case"cssClass":i.i(s.isNullOrUndefined)(a.cssClass)||(a.cssClass=a.cssClass.replace(/\s+/g," ").trim()),i.i(s.isNullOrUndefined)(t.cssClass)||(t.cssClass=t.cssClass.replace(/\s+/g," ").trim()),n.Input.setCssClass(t.cssClass,[this.inputWrapper.container],a.cssClass),this.dateTimeWrapper&&n.Input.setCssClass(t.cssClass,[this.dateTimeWrapper],a.cssClass);break;case"locale":this.globalize=new s.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),n.Input.setPlaceholder(this.l10n.getConstant("placeholder"),this.inputElement),this.dateTimeFormat=this.cldrDateTimeFormat(),e.prototype.updateInput.call(this);break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.checkAttributes(!0);break;case"format":this.setProperties({format:t.format},!0),this.checkFormat(),this.dateTimeFormat=this.formatString,this.setValue(),this.enableMask&&(this.notify("createMask",{module:"MaskedDateTime"}),this.value||n.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton));break;case"placeholder":n.Input.setPlaceholder(t.placeholder,this.inputElement);break;case"enabled":n.Input.setEnabled(this.enabled,this.inputElement),this.enabled||(this.inputElement.tabIndex=-1);break;case"strictMode":this.invalidValueString=null,this.updateInput();break;case"width":this.setWidth(t.width),n.Input.calculateWidth(this.inputElement,this.inputWrapper.container),i.i(s.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(s.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":n.Input.setReadonly(this.readonly,this.inputElement);break;case"floatLabelType":this.floatLabelType=t.floatLabelType,n.Input.removeFloating(this.inputWrapper),n.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder),i.i(s.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(s.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(t.scrollTo)))?(this.dateTimeWrapper&&this.setScrollTo(),this.setProperties({scrollTo:this.checkDateValue(new Date(this.checkValue(t.scrollTo)))},!0)):this.setProperties({scrollTo:null},!0);break;case"enableMask":this.enableMask?(this.notify("createMask",{module:"MaskedDateTime"}),n.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton)):this.inputElement.value===this.maskedDateValue&&(this.maskedDateValue="",n.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton));break;default:e.prototype.onPropertyChanged.call(this,t,a)}this.isDynamicValueChanged||this.hide(null),this.isDynamicValueChanged=!1}},t.prototype.getModuleName=function(){return"datetimepicker"},t.prototype.restoreValue=function(){this.previousDateTime=this.previousDate,this.currentDate=this.value?this.value:new Date,this.valueWithMinutes=this.value,this.previousDate=this.value,this.previousElementValue=this.previousElementValue=i.i(s.isNullOrUndefined)(this.inputValueCopy)?"":this.getFormattedValue(this.inputValueCopy)},h([i.i(s.Property)(null)],t.prototype,"timeFormat",void 0),h([i.i(s.Property)(30)],t.prototype,"step",void 0),h([i.i(s.Property)(null)],t.prototype,"scrollTo",void 0),h([i.i(s.Property)(1e3)],t.prototype,"zIndex",void 0),h([i.i(s.Property)(null)],t.prototype,"value",void 0),h([i.i(s.Property)(null)],t.prototype,"keyConfigs",void 0),h([i.i(s.Property)({})],t.prototype,"htmlAttributes",void 0),h([i.i(s.Property)(!1)],t.prototype,"enablePersistence",void 0),h([i.i(s.Property)(!0)],t.prototype,"allowEdit",void 0),h([i.i(s.Property)(!1)],t.prototype,"isMultiSelection",void 0),h([i.i(s.Property)(null)],t.prototype,"values",void 0),h([i.i(s.Property)(!0)],t.prototype,"showClearButton",void 0),h([i.i(s.Property)(null)],t.prototype,"placeholder",void 0),h([i.i(s.Property)(!1)],t.prototype,"strictMode",void 0),h([i.i(s.Property)(!1)],t.prototype,"fullScreenMode",void 0),h([i.i(s.Property)(null)],t.prototype,"serverTimezoneOffset",void 0),h([i.i(s.Property)(new Date(1900,0,1))],t.prototype,"min",void 0),h([i.i(s.Property)(new Date(2099,11,31))],t.prototype,"max",void 0),h([i.i(s.Property)(null)],t.prototype,"firstDayOfWeek",void 0),h([i.i(s.Property)("Gregorian")],t.prototype,"calendarMode",void 0),h([i.i(s.Property)("Month")],t.prototype,"start",void 0),h([i.i(s.Property)("Month")],t.prototype,"depth",void 0),h([i.i(s.Property)(!1)],t.prototype,"weekNumber",void 0),h([i.i(s.Property)(!0)],t.prototype,"showTodayButton",void 0),h([i.i(s.Property)("Short")],t.prototype,"dayHeaderFormat",void 0),h([i.i(s.Property)(!1)],t.prototype,"openOnFocus",void 0),h([i.i(s.Property)(!1)],t.prototype,"enableMask",void 0),h([i.i(s.Property)({day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"})],t.prototype,"maskPlaceholder",void 0),h([i.i(s.Event)()],t.prototype,"open",void 0),h([i.i(s.Event)()],t.prototype,"close",void 0),h([i.i(s.Event)()],t.prototype,"cleared",void 0),h([i.i(s.Event)()],t.prototype,"blur",void 0),h([i.i(s.Event)()],t.prototype,"focus",void 0),h([i.i(s.Event)()],t.prototype,"created",void 0),h([i.i(s.Event)()],t.prototype,"destroyed",void 0),t=h([s.NotifyPropertyChanges],t)}(r.a)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=i(7);i.d(t,"CalendarBase",function(){return s.a}),i.d(t,"Calendar",function(){return s.b}),i.d(t,"Islamic",function(){return s.c});var a=i(8);i.d(t,"DatePicker",function(){return a.a});var n=i(9);i.d(t,"Presets",function(){return n.a}),i.d(t,"DateRangePicker",function(){return n.b});var r=i(12);i.d(t,"TimePickerBase",function(){return r.a}),i.d(t,"TimeMaskPlaceholder",function(){return r.b}),i.d(t,"TimePicker",function(){return r.c});var l=i(10);i.d(t,"DateTimePicker",function(){return l.a});var o=i(11);i.d(t,"MaskedDateTime",function(){return o.a})},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var s=i(0),a=(i.n(s),function(){function e(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|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|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.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()}return e.prototype.getModuleName=function(){return"MaskedDateTime"},e.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))},e.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))},e.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())},e.prototype.getCUltureMaskFormat=function(){this.l10n=new s.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())},e.prototype.validCharacterCheck=function(){var e=this.parent.inputElement.selectionStart;"timepicker"!==this.parent.moduleName&&e===this.hiddenMask.length&&this.mask===this.parent.inputElement.value&&(e=0);for(var t=e,i=e-1;t<this.hiddenMask.length||i>=0;t++,i--){if(t<this.hiddenMask.length&&-1!==this.validCharacters.indexOf(this.hiddenMask[t]))return void this.setSelection(this.hiddenMask[t]);if(i>=0&&-1!==this.validCharacters.indexOf(this.hiddenMask[i]))return void this.setSelection(this.hiddenMask[i])}},e.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()},e.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));t<0&&(t=0),this.parent.inputElement.setSelectionRange(t,i)},e.prototype.maskKeydownHandler=function(e){if(this.dayTypeCount=this.monthTypeCount=this.hourTypeCount=this.minuteTypeCount=this.secondTypeCount=0,"Delete"===e.e.key)return void(this.isDeleteKey=!0);if(!(e.e.altKey||e.e.ctrlKey||"ArrowLeft"!==e.e.key&&"ArrowRight"!==e.e.key&&"shiftTab"!==e.e.key&&"Tab"!==e.e.key&&"shiftTab"!==e.e.action&&"End"!==e.e.key&&"Home"!==e.e.key)){var t=this.parent.inputElement.selectionStart,i=this.parent.inputElement.selectionEnd,s=this.parent.inputElement.value.length;if(0===t&&i===s&&("Tab"===e.e.key||"shiftTab"===e.e.action)){var a="shiftTab"===e.e.action?i:0;this.parent.inputElement.selectionStart=this.parent.inputElement.selectionEnd=a}if("End"===e.e.key||"Home"===e.e.key){var n="End"===e.e.key?s:0;this.parent.inputElement.selectionStart=this.parent.inputElement.selectionEnd=n}this.navigateSelection("ArrowLeft"===e.e.key||"shiftTab"===e.e.action||"End"===e.e.key)}if(!(e.e.altKey||e.e.ctrlKey||"ArrowUp"!==e.e.key&&"ArrowDown"!==e.e.key)){var t=this.parent.inputElement.selectionStart,r="";-1!==this.validCharacters.indexOf(this.hiddenMask[t])&&(r=this.hiddenMask[t]),this.dateAlteration("ArrowDown"===e.e.key);var l=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=l,this.parent.inputElement.value=l;for(var o=0;o<this.hiddenMask.length;o++)if(r===this.hiddenMask[o]){t=o;break}this.parent.inputElement.selectionStart=t,this.validCharacterCheck()}},e.prototype.isPersist=function(){return this.parent.isFocused||this.navigated},e.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]&&this.validCharacters.indexOf(this.previousHiddenMask[r])>=0&&(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&&this.parent.isFocused,this.navigated=!this.navigated&&this.navigated,isNaN(l))return;for(var r=0;l>n;r++)l=parseInt(l.toString().slice(1),10);if(l>=1){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,this.dayTypeCount=this.dayTypeCount+1}else this.isDayPart=!1,this.dayTypeCount=this.isDateZero?this.dayTypeCount+1:this.dayTypeCount;break;case"M":var o=void 0;if(o=a.getMonth().toString().length<2&&!this.isPersist()?(this.isMonthPart?10*(a.getMonth()+1):0)+parseInt(s[e-1],10):parseInt(s[e-1],10),this.parent.isFocused=!this.parent.isFocused&&this.parent.isFocused,this.navigated=!this.navigated&&this.navigated,this.isMonthZero="0"===s[e-1],isNaN(o)){var h=this.getCulturedValue("months[stand-alone].wide"),u=Object.keys(h);for(this.monthCharacter+=s[e-1].toLowerCase();this.monthCharacter.length>0;){for(var r=1,d=0,p=u;d<p.length;d++){p[d];if(0===h[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(;o>12;)o=parseInt(o.toString().slice(1),10);if(o>=1){if(a.setMonth(o-1),this.isNavigate=2===o.toString().length,a.getMonth()!==o-1&&(a.setDate(1),a.setMonth(o-1)),this.isDayPart){var c=new Date(this.previousDate.getFullYear(),this.previousDate.getMonth()+1,0).getDate(),m=new Date(a.getFullYear(),a.getMonth()+1,0).getDate();this.previousDate.getDate()===c&&m<=c&&a.setDate(m)}this.previousDate=new Date(a.getFullYear(),a.getMonth(),a.getDate()),this.isMonthPart=!0,this.monthTypeCount=this.monthTypeCount+1}else a.setMonth(0),this.isMonthPart=!1,this.monthTypeCount=this.isMonthZero?this.monthTypeCount+1:this.monthTypeCount}break;case"y":var f=(this.isYearPart&&a.getFullYear().toString().length<4&&!this.isShortYear?10*a.getFullYear():0)+parseInt(s[e-1],10);if(this.isShortYear=!1,this.isYearZero="0"===s[e-1],isNaN(f))return;for(;f>9999;)f=parseInt(f.toString().slice(1),10);f<1?this.isYearPart=!1:(a.setFullYear(f),4===f.toString().length&&(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&&this.parent.isFocused,this.navigated=!this.navigated&&this.navigated,isNaN(this.hour))return;for(;this.hour>12;)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=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&&this.parent.isFocused,this.navigated=!this.navigated&&this.navigated,isNaN(this.hour))return;for(var r=0;this.hour>23;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=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&&this.parent.isFocused,this.navigated=!this.navigated&&this.navigated,isNaN(v))return;for(var r=0;v>59;r++)v=parseInt(v.toString().slice(1),10);a.setMinutes(v),this.isNavigate=2===v.toString().length,this.isMinutePart=!0,this.minuteTypeCount=this.minuteTypeCount+1;break;case"s":var y=(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&&this.parent.isFocused,this.navigated=!this.navigated&&this.navigated,isNaN(y))return;for(var r=0;y>59;r++)y=parseInt(y.toString().slice(1),10);a.setSeconds(y),this.isNavigate=2===y.toString().length,this.isSecondsPart=!0,this.secondTypeCount=this.secondTypeCount+1;break;case"a":this.periodCharacter+=s[e-1].toLowerCase();for(var g=this.getCulturedValue("dayPeriods.format.wide"),b=Object.keys(g),r=0;this.periodCharacter.length>0;r++)(0===g[b[0]].toLowerCase().indexOf(this.periodCharacter)&&a.getHours()>=12||0===g[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},e.prototype.formatCheck=function(){function e(e){var i,s,a,n=t.getCulturedValue("days[stand-alone].abbreviated"),r=Object.keys(n),l=t.getCulturedValue("days[stand-alone].wide"),o=Object.keys(l),h=t.getCulturedValue("days[stand-alone].narrow"),u=Object.keys(h),d=t.getCulturedValue("months[stand-alone].abbreviated"),p=t.getCulturedValue("months[stand-alone].wide"),c=t.getCulturedValue("dayPeriods.format.wide"),m=Object.keys(c);switch(e){case"ddd":case"dddd":case"d":i=t.isDayPart?t.maskDateValue.getDate().toString():t.defaultConstant.day.toString(),i=t.zeroCheck(t.isDateZero,t.isDayPart,i),2===t.dayTypeCount&&(t.isNavigate=!0,t.dayTypeCount=0);break;case"dd":i=t.isDayPart?t.roundOff(t.maskDateValue.getDate(),2):t.defaultConstant.day.toString(),i=t.zeroCheck(t.isDateZero,t.isDayPart,i),2===t.dayTypeCount&&(t.isNavigate=!0,t.dayTypeCount=0);break;case"E":case"EE":case"EEE":i=t.isDayPart&&t.isMonthPart&&t.isYearPart?n[r[t.maskDateValue.getDay()]].toString():t.defaultConstant.dayOfTheWeek.toString();break;case"EEEE":i=t.isDayPart&&t.isMonthPart&&t.isYearPart?l[o[t.maskDateValue.getDay()]].toString():t.defaultConstant.dayOfTheWeek.toString();break;case"EEEEE":i=t.isDayPart&&t.isMonthPart&&t.isYearPart?h[u[t.maskDateValue.getDay()]].toString():t.defaultConstant.dayOfTheWeek.toString();break;case"M":i=t.isMonthPart?(t.maskDateValue.getMonth()+1).toString():t.defaultConstant.month.toString(),i=t.zeroCheck(t.isMonthZero,t.isMonthPart,i),2===t.monthTypeCount&&(t.isNavigate=!0,t.monthTypeCount=0);break;case"MM":i=t.isMonthPart?t.roundOff(t.maskDateValue.getMonth()+1,2):t.defaultConstant.month.toString(),i=t.zeroCheck(t.isMonthZero,t.isMonthPart,i),2===t.monthTypeCount&&(t.isNavigate=!0,t.monthTypeCount=0);break;case"MMM":i=t.isMonthPart?d[t.maskDateValue.getMonth()+1]:t.defaultConstant.month.toString();break;case"MMMM":i=t.isMonthPart?p[t.maskDateValue.getMonth()+1]:t.defaultConstant.month.toString();break;case"yy":i=t.isYearPart?t.roundOff(t.maskDateValue.getFullYear()%100,2):t.defaultConstant.year.toString(),i=t.zeroCheck(t.isYearZero,t.isYearPart,i),t.isYearPart&&(t.isNavigate=t.isShortYear=2===(t.maskDateValue.getFullYear()%100).toString().length);break;case"y":case"yyyy":i=t.isYearPart?t.roundOff(t.maskDateValue.getFullYear(),4):t.defaultConstant.year.toString(),i=t.zeroCheck(t.isYearZero,t.isYearPart,i);break;case"h":i=t.isHourPart?(t.maskDateValue.getHours()%12||12).toString():t.defaultConstant.hour.toString(),2===t.hourTypeCount&&(t.isNavigate=!0,t.hourTypeCount=0);break;case"hh":i=t.isHourPart?t.roundOff(t.maskDateValue.getHours()%12||12,2):t.defaultConstant.hour.toString(),2===t.hourTypeCount&&(t.isNavigate=!0,t.hourTypeCount=0);break;case"H":i=t.isHourPart?t.maskDateValue.getHours().toString():t.defaultConstant.hour.toString(),2===t.hourTypeCount&&(t.isNavigate=!0,t.hourTypeCount=0);break;case"HH":i=t.isHourPart?t.roundOff(t.maskDateValue.getHours(),2):t.defaultConstant.hour.toString(),2===t.hourTypeCount&&(t.isNavigate=!0,t.hourTypeCount=0);break;case"m":i=t.isMinutePart?t.maskDateValue.getMinutes().toString():t.defaultConstant.minute.toString(),2===t.minuteTypeCount&&(t.isNavigate=!0,t.minuteTypeCount=0);break;case"mm":i=t.isMinutePart?t.roundOff(t.maskDateValue.getMinutes(),2):t.defaultConstant.minute.toString(),2===t.minuteTypeCount&&(t.isNavigate=!0,t.minuteTypeCount=0);break;case"s":i=t.isSecondsPart?t.maskDateValue.getSeconds().toString():t.defaultConstant.second.toString(),2===t.secondTypeCount&&(t.isNavigate=!0,t.secondTypeCount=0);break;case"ss":i=t.isSecondsPart?t.roundOff(t.maskDateValue.getSeconds(),2):t.defaultConstant.second.toString(),2===t.secondTypeCount&&(t.isNavigate=!0,t.secondTypeCount=0);break;case"f":i=Math.floor(t.maskDateValue.getMilliseconds()/100).toString();break;case"ff":s=t.maskDateValue.getMilliseconds(),t.maskDateValue.getMilliseconds()>99&&(s=Math.floor(t.maskDateValue.getMilliseconds()/10)),i=t.roundOff(s,2);break;case"fff":i=t.roundOff(t.maskDateValue.getMilliseconds(),3);break;case"a":case"aa":i=t.maskDateValue.getHours()<12?c[m[0]]:c[m[1]];break;case"z":case"zz":case"zzz":case"zzzz":a={format:e,type:"dateTime",skeleton:"yMd",calendar:t.parent.calendarMode},i=t.parent.globalize.formatDate(t.maskDateValue,a)}if(i=void 0!==i?i:e.slice(1,e.length-1),t.isHiddenMask){for(var f="",v=0;v<i.length;v++)f+=e[0];return f}return i}var t=this;return e},e.prototype.maskInputHandler=function(){var e=this.parent.inputElement.selectionStart,t="";-1!==this.validCharacters.indexOf(this.hiddenMask[e])&&(t=this.hiddenMask[e]),this.differenceCheck();var i=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,this.parent.inputElement.value=i;for(var s=0;s<this.hiddenMask.length;s++)if(t===this.hiddenMask[s]){e=s;break}if(this.parent.inputElement.selectionStart=e,this.validCharacterCheck(),(this.isNavigate||this.isDeletion)&&!this.isDeleteKey){var a=!this.isNavigate;this.isNavigate=this.isDeletion=!1,this.navigateSelection(a)}this.isDeleteKey&&(this.isDeletion=!1),this.isDeleteKey=!1},e.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&&s>=0;){if(this.validCharacters.indexOf(this.hiddenMask[s])>=0){this.setSelection(this.hiddenMask[s]);break}s+=e?-1:1}},e.prototype.roundOff=function(e,t){for(var i=e.toString(),s=t-i.length,a="",n=0;n<s;n++)a+="0";return a+i},e.prototype.zeroCheck=function(e,t,i){var s=i;return e&&!t&&(s="0"),s},e.prototype.handleDeletion=function(e,t){switch(e){case"d":this.isDayPart=t;break;case"M":this.isMonthPart=t,t||(this.maskDateValue.setMonth(0),this.monthCharacter="");break;case"y":this.isYearPart=t;break;case"H":case"h":this.isHourPart=t,t||(this.periodCharacter="");break;case"m":this.isMinutePart=t;break;case"s":this.isSecondsPart=t;break;default:return!1}return!0},e.prototype.dateAlteration=function(e){var t=this.parent.inputElement.selectionStart,i="";if(-1!==this.validCharacters.indexOf(this.hiddenMask[t])){i=this.hiddenMask[t];var s=new Date(this.maskDateValue.getFullYear(),this.maskDateValue.getMonth(),this.maskDateValue.getDate(),this.maskDateValue.getHours(),this.maskDateValue.getMinutes(),this.maskDateValue.getSeconds());this.previousDate=new Date(this.maskDateValue.getFullYear(),this.maskDateValue.getMonth(),this.maskDateValue.getDate(),this.maskDateValue.getHours(),this.maskDateValue.getMinutes(),this.maskDateValue.getSeconds());var a=e?-1:1;switch(i){case"d":s.setDate(s.getDate()+a);break;case"M":var n=s.getMonth()+a;if(s.setDate(1),s.setMonth(n),this.isDayPart){var r=new Date(this.previousDate.getFullYear(),this.previousDate.getMonth()+1,0).getDate(),l=new Date(s.getFullYear(),s.getMonth()+1,0).getDate();this.previousDate.getDate()===r&&l<=r?s.setDate(l):s.setDate(this.previousDate.getDate())}else 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=s.getFullYear()>0?s:this.maskDateValue,-1!==this.validCharacters.indexOf(this.hiddenMask[t])&&this.handleDeletion(this.hiddenMask[t],!0)}},e.prototype.getCulturedValue=function(e){var t=this.parent.locale;return"en"===t||"en-US"===t?i.i(s.getValue)(e,i.i(s.getDefaultDateObject)()):i.i(s.getValue)("main."+t+".dates.calendars.gregorian."+e,s.cldrData)},e.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)),"timepicker"===this.parent.moduleName&&(e=this.parent.cldrTimeFormat()),e},e.prototype.clearHandler=function(){this.isDayPart=this.isMonthPart=this.isYearPart=this.isHourPart=this.isMinutePart=this.isSecondsPart=!1,this.updateValue()},e.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)},e.prototype.destroy=function(){this.removeEventListener()},e}())},function(e,t){e.exports=a}])});
|