UNPKG

@syncfusion/ej2-schedule

Version:

Flexible scheduling library with more built-in features and enhanced customization options similar to outlook and google calendar, allowing the users to plan and manage their appointments with efficient data-binding support.

10 lines 739 kB
/*! * filename: ej2-schedule.umd.min.js * version : 31.1.17 * Copyright Syncfusion Inc. 2001 - 2024. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing * licensing@syncfusion.com. Any infringement will be prosecuted under * applicable laws. */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-navigations"),require("@syncfusion/ej2-calendars"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-dropdowns"),require("@syncfusion/ej2-lists"),require("@syncfusion/ej2-excel-export")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-popups","@syncfusion/ej2-navigations","@syncfusion/ej2-calendars","@syncfusion/ej2-data","@syncfusion/ej2-buttons","@syncfusion/ej2-inputs","@syncfusion/ej2-dropdowns","@syncfusion/ej2-lists","@syncfusion/ej2-excel-export"],t):t((e=e||self).ej={},e.ej2Base,e.ej2Popups,e.ej2Navigations,e.ej2Calendars,e.ej2Data,e.ej2Buttons,e.ej2Inputs,e.ej2Dropdowns,e.ej2Lists,e.ej2ExcelExport)}(this,function(e,B,M,k,R,p,H,P,j,N,L){"use strict";var q="cellClick",F="cellDoubleClick",U="moreEventsClick",G="select",X="hover",Q="actionBegin",K="actionComplete",Z="actionFailure",J="navigating",$="renderCell",ee="eventClick",te="eventDoubleClick",ie="eventRendered",ne="dataBinding",re="dataBound",ae="popupOpen",se="popupClose",oe="dragStart",le="drag",pe="dragStop",ce="resizeStart",he="resizing",de="resizeStop",ue="inlineClick",ge="cellSelect",me="virtualScrollStart",ve="virtualScrollStop",fe="noEvents",ye="agendaCells",Te="resourceHeader",we="dateHeader",De="beforePaste",be="beforePrint",Se="excelExport",Ce="tooltipOpen",Oe="print",Ee="data-ready",xe="events-loaded",Ve="content-ready",Ae="scroll",Ie="virtual-scroll",Me="scroll-ui-update",ke="ui-update",Re="document-click",He="document-paste",Pe="cell-mouse-down",W=864e5,je=6e4;function Ne(e,t,i){t=B.createElement("div",{className:t}).cloneNode();return t.style.visibility="hidden",t.style.position="absolute",e.appendChild(t),e=gt(t,i),B.remove(t),e}function Le(e,t,i){t=B.createElement("div",{className:t}).cloneNode();return t.style.visibility="hidden",t.style.position="absolute",e.appendChild(t),e=ut(t,i),B.remove(t),e}function qe(e){e=getComputedStyle(e);return window.WebKitCSSMatrix?new WebKitCSSMatrix(e.webkitTransform).m42:0}function Fe(e){e=getComputedStyle(e);return window.WebKitCSSMatrix?new WebKitCSSMatrix(e.webkitTransform).m41:0}function Ue(e,t){e=new Date(e.getTime());return t=(t-e.getDay()-7)%7,new Date(e.setDate(e.getDate()+(isNaN(t)?0:t)))}function Be(e,t){e=Ue(e,t),t=new Date(e.getFullYear(),e.getMonth(),e.getDate()+6);return new Date(t.getTime())}function We(e){return new Date(e.getFullYear(),e.getMonth(),1)}function ze(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function Ye(e){var t=new Date(e.getFullYear(),0,1).valueOf(),e=new Date(e.getFullYear(),e.getMonth(),e.getDate()).valueOf();return Math.ceil((e-t+W)/W/7)}function _e(e,t){return new Date(t.valueOf()-(t.valueOf()-e.valueOf())/2)}function Ge(e,t){var i=e.getTimezoneOffset(),t=new Date(e.getTime()+t),i=t.getTimezoneOffset()-i;return e.setTime(t.getTime()+i*je),e}function z(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function Xe(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0).getTimezoneOffset(),t=e.getTimezoneOffset()-t;return e.getTime()-new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0).getTime()-60*t*1e3}function Qe(e,t){return Math.ceil((t.getTime()-e.getTime())/W)}function Y(e,t){return e=new Date(""+e),new Date(e.setDate(e.getDate()+t))}function Ke(e,t){var i=(e=new Date(""+e)).getDate();return e.setDate(1),e.setMonth(e.getMonth()+t),e.setDate(Math.min(i,$e(e))),e}function Ze(e,t){var i=(e=new Date(""+e)).getDate();return e.setDate(1),e.setFullYear(e.getFullYear()+t),e.setDate(Math.min(i,$e(e))),e}function Je(e,t,i){var n=new Date(e.getTime()),t=(n.setHours(t.getHours()),n.setMinutes(t.getMinutes()),n.setSeconds(t.getSeconds()),new Date(e.getTime()));return 0===i.getHours()?t=Y(t,1):(t.setHours(i.getHours()),t.setMinutes(i.getMinutes()),t.setSeconds(i.getSeconds())),{startHour:n,endHour:t}}function $e(e){return ze(e).getDate()}function et(e,t){e=z(new Date(e)),t=z(new Date(t));return Math.round((t.getTime()-e.getTime())/W)}function tt(e){return-1!==e.indexOf("Date")?new Date(parseInt(e.match(/\d+/g).toString(),10)):-1!==e.indexOf("T")?new Date(e):new Date(e.replace(/-/g,"/"))}var it=null,nt=null;function rt(){if(null!==it)return it;null===nt&&(nt=window.devicePixelRatio||window.screen.availWidth/document.documentElement.clientWidth);var e=B.createElement("div"),t=(e.style.cssText="width:100px;height: 100px;overflow: scroll;position: absolute;top: -9999px;",document.body.appendChild(e),devicePixelRatio?"1.10"===devicePixelRatio.toFixed(2)||devicePixelRatio<=1?Math.ceil(devicePixelRatio%1):Math.floor(devicePixelRatio%1):0),t=e.offsetWidth-e.clientWidth-t|0;return document.body.removeChild(e),it=t}function at(){var e=window.devicePixelRatio||window.screen.availWidth/document.documentElement.clientWidth;nt&&nt!==e&&(it=null,nt=e)}function st(e,t,i,n,r){for(var a=0,s=e.length;a<s;a++)if(e[parseInt(a.toString(),10)][""+t]===i){if(!n)return a;var o=r.slice(-2)[0].field;if((n[""+o]instanceof Array?n[""+o]:[n[""+o]]).join(",").includes(e[parseInt(a.toString(),10)][r.slice(-1)[0].groupIDField]))return a}return-1}function ot(e){var t=getComputedStyle(e);return e.offsetHeight+(parseInt(t.marginTop,10)||0)+(parseInt(t.marginBottom,10)||0)}function lt(e){for(var t=0,i=[].slice.call(e.children);t<i.length;t++){var n=i[t];e.removeChild(n)}}function pt(e){var t=new Date(e.getFullYear(),0,1),i=new Date(e.getFullYear(),6,1);return e.getTimezoneOffset()<Math.max(t.getTimezoneOffset(),i.getTimezoneOffset())}function ct(e){var t=e.getFullYear(),i=e.getMonth(),n=e.getDate(),r=e.getHours(),a=e.getMinutes(),s=e.getSeconds(),e=e.getMilliseconds();return Date.UTC(t,i,n,r,a,s,e)}function ht(){return-1<window.navigator.userAgent.toLowerCase().indexOf("mobi")}function dt(){return-1<window.navigator.userAgent.toLowerCase().indexOf("ipad")}function y(e,t){return"multiple"===t?e=e.split(" ").map(function(e){return e.charAt(0).toLocaleUpperCase()+e.substring(1)}).join(" "):"single"===t&&("0"<=e[0]&&e[0]<="9"&&(t=e.match(/[a-zA-Z]/),e=B.isNullOrUndefined(t)?e:e.slice(0,t.index)+e[t.index].toLocaleUpperCase()+e.slice(t.index+1)),e=e[0].toLocaleUpperCase()+e.slice(1)),e}function ut(e,t){return t?e.offsetWidth:e.getBoundingClientRect().width}function gt(e,t){return t?e.offsetHeight:e.getBoundingClientRect().height}function mt(e,t){return t?e.offsetTop:e.getBoundingClientRect().top}var vt="e-schedule",ft="e-rtl",yt="e-device",Tt="e-adaptive",wt="e-multi-drag",Dt="e-icons",bt="e-enable",d="e-disable",St="e-table-container",Ct="e-schedule-table",w="e-all-day-cells",Ot="e-all-day-row",C="e-content-table",O="e-work-cells",Et="e-work-hours",xt="e-popup-open",Vt="e-date-header-wrap",At="e-date-header-container",It="e-header-cells",Mt="e-work-days",E="e-other-month",kt="e-current-day",Rt="e-current-date",Ht="e-current-panel",Pt="e-previous-panel",jt="e-next-panel",Nt="e-translate",Lt="e-left-indent",qt="e-left-indent-wrap",Ft="e-event-table",Ut="e-resource-group-cells",Bt="e-resource-text",Wt="e-resource-column-wrap",zt="e-resource-column-table",Yt="e-child-node",_t="e-parent-node",Gt="e-resource-expand",Xt="e-resource-collapse",Qt="e-resource-tree-icon",Kt="e-resource-cells",Zt="e-time-cells-wrap",Jt="e-time-cells",$t="e-time-slots",ei="e-alternate-cells",ti="e-current-time",ii="e-current-timeline",ni="e-previous-timeline",ri="e-hide-childs",ai="e-scroll-container",si="e-timeline-wrapper",x="e-appointment-wrapper",oi="e-appointment-wrapper-hidden",li="e-day-wrapper",pi="e-schedule-resource-toolbar-container",ci="e-schedule-toolbar",hi="e-schedule-resource-toolbar",di="e-selected-cell",ui="e-week-number-wrapper",gi="e-week-number",mi="e-appointment-wrap",vi="e-wrapper-container",fi="e-appointment-container",V="e-appointment",yi="e-block-appointment",Ti="e-block-indicator",wi="e-appointment-border",Di="e-appointment-details",bi="e-subject-wrap",Si="e-resource-name",Ci="e-time",Oi="e-table-wrap",Ei="e-outer-table",A="e-content-wrap",xi="e-virtual-track",Vi="e-agenda-cells",Ai="e-current-day",Ii="e-active-appointment-agenda",Mi="e-month-header",ki="e-day-date-header",Ri="e-date-column",Hi="e-navigate",Pi="e-date-header",ji="e-day-border",Ni="e-date-time",Li="e-no-event",qi="e-appointment-indicator",Fi="e-indicator",Ui="e-left-icon",Bi="e-right-icon",Wi="e-event-action",zi="e-new-event",Yi="e-schedule-event-clone",_i="e-clone-time-indicator",Gi="e-drag-clone",Xi="e-event-resize",Qi="e-resize-clone",Ki="e-left-handler",Zi="e-right-handler",Ji="e-top-handler",$i="e-bottom-handler",en="e-recurrence-icon",tn="e-recurrence-edit-icon",nn="e-header-row",rn="e-all-day-appointment-wrapper",an="e-all-day-appointment",sn="e-appointment-hide",on="e-row-count-wrapper",ln="e-all-day-appointment-section",pn="e-appointment-expand",cn="e-appointment-collapse",hn="e-more-indicator",dn="e-cell-popup",un="e-event-popup",gn="e-popup-header",mn="e-header-icon-wrapper",vn="e-popup-footer",fn="e-date-time-details",yn="e-event-details",Tn="e-event-create",wn="e-event-edit",Dn="e-event-delete",bn="e-text-ellipsis",Sn="e-more-popup-wrapper",Cn="e-more-event-popup",On="e-more-event-date-header",En="e-header-day",xn="e-header-date",Vn="e-more-event-close",An="e-more-event-content",In="e-more-appointment-wrapper",Mn="e-quick-dialog",kn="e-quick-dialog-occurrence-event",Rn="e-quick-dialog-series-event",Hn="e-quick-dialog-following-events",Pn="e-following-events-dialog",jn="e-quick-dialog-delete",Nn="e-quick-dialog-cancel",Ln="e-quick-alertok",qn="e-quick-alertcancel",Fn="e-quick-alertfollowing",Un="e-quick-dialog-alert-btn",Bn="e-schedule-dialog",Wn="e-schedule-form",zn="e-all-day",Yn="e-time-zone",_n="e-repeat",Gn="e-subject",Xn="e-location",Qn="e-location-details",Kn="e-start",Zn="e-end",Jn="e-description",$n="e-description-details",er="e-time-zone-row",tr="e-start-time-zone",ir="e-end-time-zone",nr="e-save-icon",rr="e-event-cancel",ar="e-event-save",sr="e-title-text",or="e-icon-disable",lr="e-edit",pr="e-edit-icon",cr="e-delete",hr="e-delete-icon",dr="e-close",ur="e-close-icon",gr="e-schedule-error",mr="e-tooltip-hidden",vr="e-animate",fr="e-hidden",yr="e-disable-dates",Tr="e-quick-popup-wrapper",wr="e-resource-menu",Dr="e-icon-menu",br="e-resource-level-title",Sr="e-resource-tree-popup-overlay",Cr="e-resource-tree-popup",Or="e-resource",Er="e-resource-icon",xr="e-resource-details",Vr="e-date-time-icon",Ar="e-virtual-scroll",Ir="e-icon-disable",Mr="e-auto-height",kr="e-ignore-whitespace",Rr="e-read-only",Hr="e-month-header-wrapper",Pr="e-inline-subject",jr="e-inline-appointment",Nr="e-inline-edit",Lr="e-scroll-hidden",qr="e-all-day-scroll",Fr="e-all-day-auto",Ur=function(){return(Ur=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},Br=(t.prototype.addEventListener=function(){this.parent.on(Re,this.closeHeaderPopup,this)},t.prototype.removeEventListener=function(){this.parent.off(Re,this.closeHeaderPopup)},t.prototype.closeHeaderPopup=function(e){var t,i=B.closest(e.event.target,".e-date-range,.e-header-popup,.e-day,.e-selected"),e=B.closest(e.event.target,".e-hor-nav,.e-toolbar-pop"),n=this.parent.element.querySelector("."+A),r=this.parent.element.querySelector(".e-toolbar-pop");this.parent.isAdaptive&&(B.isNullOrUndefined(e)||!e.classList.contains("e-toolbar-pop")&&!e.classList.contains("e-hor-nav")||e.classList.contains("e-hor-nav")&&r&&r.classList.contains(xt)?(B.removeClass([n],Lr),r=this.element.querySelector(".e-toolbar-pop"),B.isNullOrUndefined(r)||!(t=r.ej2_instances[0])||!B.isNullOrUndefined(e)&&e.classList.contains("e-hor-nav")&&r.classList.contains(xt)||t.hide()):B.addClass([n],Lr)),B.isNullOrUndefined(i)&&this.hideHeaderPopup()},t.prototype.hideHeaderPopup=function(){this.headerPopup&&this.headerPopup.hide()},t.prototype.renderHeader=function(){this.element=B.createElement("div",{className:"e-schedule-toolbar-container"});var e=B.createElement("div",{className:ci});this.element.appendChild(e),this.parent.element.insertBefore(this.element,this.parent.element.firstElementChild),this.renderToolbar()},t.prototype.renderToolbar=function(){var t=this,e=this.parent.toolbarItems&&0<this.parent.toolbarItems.length?this.getToolbarItems():this.getItems();this.parent.trigger(Q,{requestType:"toolbarItemRendering",items:e},function(e){t.toolbarObj=new k.Toolbar({items:e.items,overflowMode:"Popup",clicked:t.toolbarClickHandler.bind(t),created:t.toolbarCreateHandler.bind(t),enableRtl:t.parent.enableRtl,enableHtmlSanitizer:t.parent.enableHtmlSanitizer,locale:t.parent.locale}),t.toolbarObj.isStringTemplate=!0,t.toolbarObj.root=t.parent.root||t.parent,t.toolbarObj.appendTo(t.parent.element.querySelector("."+ci)),t.toolbarObj.element.setAttribute("aria-label","Scheduler");e=t.toolbarObj.element.querySelector(".e-prev"),e&&e.firstElementChild.setAttribute("title",t.l10n.getConstant("previous")),e=t.toolbarObj.element.querySelector(".e-next");e&&e.firstElementChild.setAttribute("title",t.l10n.getConstant("next")),t.updateAddIcon(),t.updateActiveView(),t.parent.trigger(K,{requestType:"toolBarItemRendered",items:t.toolbarObj.items})})},t.prototype.updateItems=function(){var e,t=this;this.toolbarObj&&(e=this.getItems(),this.parent.trigger(Q,{requestType:"toolbarItemRendering",items:e},function(e){t.toolbarObj.items=e.items,t.toolbarObj.dataBind(),t.parent.trigger(K,{requestType:"toolBarItemRendered",items:t.toolbarObj.items})}))},t.prototype.getPopUpRelativeElement=function(){return this.parent.isAdaptive?this.toolbarObj.element:this.element.querySelector(".e-date-range")},t.prototype.setDayOfWeek=function(e){this.headerCalendar&&(this.headerCalendar.firstDayOfWeek=e,this.headerCalendar.dataBind())},t.prototype.setCalendarDate=function(e){this.headerCalendar&&(this.headerCalendar.value=e,this.headerCalendar.dataBind())},t.prototype.setCalendarMinMaxDate=function(){this.headerCalendar&&(this.headerCalendar.min=this.parent.minDate,this.headerCalendar.max=this.parent.maxDate,this.headerCalendar.dataBind())},t.prototype.getCalendarView=function(){return-1<["Month","MonthAgenda","TimelineMonth"].indexOf(this.parent.currentView)?"Year":-1<["Year","TimelineYear"].indexOf(this.parent.currentView)?"Decade":"Month"},t.prototype.setCalendarView=function(){var e;this.headerCalendar&&(e=this.getCalendarView(),this.headerCalendar.depth=e,this.headerCalendar.start=e,this.headerCalendar.refresh())},t.prototype.updateActiveView=function(){var e=[].slice.call(this.toolbarObj.element.querySelectorAll(".e-views"));B.removeClass(e,["e-active-view"]),0<e.length&&e[this.parent.viewIndex]&&B.addClass([e[this.parent.viewIndex]],["e-active-view"])},t.prototype.updateDateRange=function(e){var t,i,n,r=this.toolbarObj.element.querySelector(".e-date-range");r&&(r.firstElementChild.setAttribute("aria-haspopup","true"),t=r.querySelector(".e-tbar-btn-text"),this.parent.activeViewOptions.dateRangeTemplate?(t.textContent="",i={startDate:this.parent.activeView.getStartDate(),endDate:this.parent.activeView.getEndDate(),currentView:this.parent.currentView},n=this.parent.activeViewOptions.dateRangeTemplateName,n=this.parent.element.id+"_"+n+"dateRangeTemplate",i=[].slice.call(this.parent.getDateRangeTemplate()(i,this.parent,"dateRangeTemplate",n,!1,void 0,void 0,this.parent.root)),B.append(i,t)):(n=this.parent.activeView.getDateRangeText(e),r.firstElementChild.setAttribute("aria-label",n),t.textContent=n),this.refresh())},t.prototype.refresh=function(){this.toolbarObj&&this.toolbarObj.refreshOverflow()},t.prototype.updateAddIcon=function(){var e=this.toolbarObj.element.querySelector(".e-add");e&&(this.parent.eventSettings.allowAdding?B.removeClass([e],fr):B.addClass([e],fr))},t.prototype.getDateRangeText=function(){return y(this.parent.globalize.formatDate(this.parent.selectedDate,{format:"MMMM y",calendar:this.parent.getCalendarMode()}),"single")},t.prototype.getItemModel=function(e){var t={};return e.id&&(t.id=e.id),e.text&&(t.text=e.text),e.tooltipText&&(t.tooltipText=e.tooltipText),e.prefixIcon&&(t.prefixIcon=e.prefixIcon),e.cssClass&&(t.cssClass=e.cssClass),"Both"!==e.showTextOn&&(t.showTextOn=e.showTextOn),e.template&&(t.template=e.template),e.disabled&&(t.disabled=e.disabled),"auto"!==e.width&&(t.width=e.width),e.suffixIcon&&(t.suffixIcon=e.suffixIcon),"Left"!==e.align&&(t.align=e.align),"None"!==e.overflow&&(t.overflow=e.overflow),e.htmlAttributes&&(t.htmlAttributes=e.htmlAttributes),"Button"!==e.type&&(t.type=e.type),!0!==e.visible&&(t.visible=e.visible),e.showAlwaysInPopup&&(t.showAlwaysInPopup=e.showAlwaysInPopup),-1!==e.tabIndex&&(t.tabIndex=e.tabIndex),t},t.prototype.getToolbarItems=function(){for(var e=[],t=0,i=this.parent.toolbarItems;t<i.length;t++){var n=i[t],r=this.getItemModel(n),a=void 0;if(n.name)switch(n.name){case"Today":(a={showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-today",text:this.l10n.getConstant("today"),cssClass:"e-today",overflow:"Show"}).align=r.align||n.align,e.push(Ur({},a,r));break;case"Previous":(a={prefixIcon:"e-icon-prev",tooltipText:"Previous",overflow:"Show",cssClass:"e-prev",htmlAttributes:{role:"navigation"}}).align=r.align||n.align,e.push(Ur({},a,r));break;case"Next":(a={prefixIcon:"e-icon-next",tooltipText:"Next",overflow:"Show",cssClass:"e-next",htmlAttributes:{role:"navigation"}}).align=r.align||n.align,e.push(Ur({},a,r));break;case"DateRangeText":(a={text:this.getDateRangeText(),suffixIcon:"e-icon-down-arrow",cssClass:"e-date-range",overflow:"Show",htmlAttributes:{"aria-atomic":"true","aria-live":"assertive",role:"navigation"}}).align=r.align||n.align,e.push(Ur({},a,r));break;case"NewEvent":(a={showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-add",text:this.l10n.getConstant("newEvent"),cssClass:"e-add",overflow:"Show"}).align=r.align||n.align,e.push(Ur({},a,r));break;case"Views":if(!B.isNullOrUndefined(this.parent.views)&&1<this.parent.views.length)for(var s=0,o=this.parent.views;s<o.length;s++){var l=o[s];(a=this.getItemObject(l)).align=r.align||n.align,e.push(Ur({},a,r))}break;case"Custom":e.push(n)}else e.push(n)}return e},t.prototype.getItems=function(){var e=[];if(e.push({align:"Left",prefixIcon:"e-icon-prev",tooltipText:"Previous",overflow:"Show",cssClass:"e-prev"}),e.push({align:"Left",prefixIcon:"e-icon-next",tooltipText:"Next",overflow:"Show",cssClass:"e-next"}),e.push({align:"Left",text:this.getDateRangeText(),suffixIcon:"e-icon-down-arrow",cssClass:"e-date-range",overflow:"Show",htmlAttributes:{"aria-atomic":"true","aria-live":"assertive"}}),this.parent.isAdaptive||this.parent.enableAdaptiveUI?(e.push({align:"Right",showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-add",text:this.l10n.getConstant("newEvent"),cssClass:"e-add",overflow:"Show"}),e.push({align:"Right",showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-today",text:this.l10n.getConstant("today"),cssClass:"e-today",overflow:"Show"})):(e.push({align:"Right",showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-today",text:this.l10n.getConstant("today"),cssClass:"e-today",overflow:"Show"}),!B.isNullOrUndefined(this.parent.views)&&1<this.parent.views.length&&e.push({align:"Right",type:"Separator",cssClass:"e-schedule-seperator"})),!B.isNullOrUndefined(this.parent.views)&&1<this.parent.views.length)for(var t=0,i=this.parent.views;t<i.length;t++){var n=i[t];e.push(this.getItemObject(n))}return e},t.prototype.getItemObject=function(e){var t,i,n="string"==typeof e?(t=e.toLowerCase(),null):(t=e.option.toLowerCase(),e.displayName),r=this.parent.isAdaptive||this.parent.enableAdaptiveUI;switch(t){case"day":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-day",text:n||this.l10n.getConstant("day"),cssClass:"e-views e-day"};break;case"week":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-week",text:n||this.l10n.getConstant("week"),cssClass:"e-views e-week"};break;case"workweek":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-workweek",text:n||this.l10n.getConstant("workWeek"),cssClass:"e-views e-work-week"};break;case"month":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-month",text:n||this.l10n.getConstant("month"),cssClass:"e-views e-month"};break;case"year":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-year",text:n||this.l10n.getConstant("year"),cssClass:"e-views e-year"};break;case"agenda":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-agenda",text:n||this.l10n.getConstant("agenda"),cssClass:"e-views e-agenda"};break;case"monthagenda":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-month-agenda",text:n||this.l10n.getConstant("monthAgenda"),cssClass:"e-views e-month-agenda"};break;case"timelineday":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-day",text:n||this.l10n.getConstant("timelineDay"),cssClass:"e-views e-timeline-day"};break;case"timelineweek":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-week",text:n||this.l10n.getConstant("timelineWeek"),cssClass:"e-views e-timeline-week"};break;case"timelineworkweek":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-workweek",text:n||this.l10n.getConstant("timelineWorkWeek"),cssClass:"e-views e-timeline-work-week"};break;case"timelinemonth":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-month",text:n||this.l10n.getConstant("timelineMonth"),cssClass:"e-views e-timeline-month"};break;case"timelineyear":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-year-"+("Vertical"===e.orientation?"vertical":"horizontal"),text:n||this.l10n.getConstant("timelineYear"),cssClass:"e-views e-timeline-year"}}return i},t.prototype.renderHeaderPopup=function(){var e=B.createElement("div",{className:"e-header-popup"}),t=B.createElement("div",{className:"e-header-calendar"}),e=(e.appendChild(t),this.element.appendChild(e),this.headerPopup=new M.Popup(e,{actionOnScroll:"hide",targetType:"relative",relateTo:this.getPopUpRelativeElement(),position:{X:"left",Y:"bottom"},collision:{X:"fit"},viewPortElement:this.element,enableRtl:this.parent.enableRtl}),this.getCalendarView()),i="Month"===this.parent.currentView&&!B.isNullOrUndefined(this.parent.activeViewOptions.displayDate)&&!this.hasSelectedDate();this.headerCalendar=new R.Calendar({value:i?this.parent.activeViewOptions.displayDate:this.parent.selectedDate,min:this.parent.minDate,max:this.parent.maxDate,firstDayOfWeek:this.parent.activeViewOptions.firstDayOfWeek,weekNumber:this.parent.activeViewOptions.showWeekNumber,enableRtl:this.parent.enableRtl,locale:this.parent.locale,depth:e,start:e,calendarMode:this.parent.calendarMode,change:this.calendarChange.bind(this)}),this.setCalendarTimezone(),this.headerCalendar.appendTo(t),this.headerPopup.hide()},t.prototype.calendarChange=function(e){e.value.getTime()!==this.parent.selectedDate.getTime()&&(e=z(new Date(e.value)),this.parent.changeDate(e)),this.headerPopup.hide()},t.prototype.setCalendarTimezone=function(){this.headerCalendar&&(this.headerCalendar.timezone=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName())},t.prototype.calculateViewIndex=function(e){e=B.closest(e.originalEvent.target,".e-views");return[].slice.call(this.element.querySelectorAll(".e-views")).indexOf(e)},t.prototype.toolbarCreateHandler=function(){this.parent&&this.parent.portals&&this.toolbarObj&&this.toolbarObj.portals&&(this.parent.portals=this.parent.portals.concat(this.toolbarObj.portals),this.parent.renderReactTemplates())},t.prototype.toolbarClickHandler=function(e){if(e.item){var t;switch(e.item.cssClass.replace("e-views ","")){case"e-date-range":this.headerPopup||this.renderHeaderPopup(),this.headerPopup.element.classList.contains(xt)?this.headerPopup.hide():this.headerPopup.show();break;case"e-day":this.parent.changeView("Day",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-week":this.parent.changeView("Week",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-work-week":this.parent.changeView("WorkWeek",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-month":this.parent.changeView("Month",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-year":this.parent.changeView("Year",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-agenda":this.parent.changeView("Agenda",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-month-agenda":this.parent.changeView("MonthAgenda",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-timeline-day":this.parent.changeView("TimelineDay",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-timeline-week":this.parent.changeView("TimelineWeek",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-timeline-work-week":this.parent.changeView("TimelineWorkWeek",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-timeline-month":this.parent.changeView("TimelineMonth",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-timeline-year":this.parent.changeView("TimelineYear",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-today":r=z(this.parent.getCurrentTime()),("Agenda"===this.parent.currentView||"MonthAgenda"===this.parent.currentView||!this.parent.isSelectedDate(r)||"Month"===this.parent.currentView&&this.parent.activeViewOptions.displayDate&&!this.hasSelectedDate()&&z(this.parent.activeViewOptions.displayDate)!==r||"Month"===this.parent.currentView&&0<this.parent.activeViewOptions.numberOfWeeks&&!this.hasSelectedDate()&&z(We(this.parent.selectedDate))!==r)&&this.parent.changeDate(r,e.originalEvent);break;case"e-prev":this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Previous"),e.originalEvent);break;case"e-next":this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Next"),e.originalEvent);break;case"e-add":var i,n,r=this.parent.activeCellsData.startTime.getTime()===this.parent.activeCellsData.endTime.getTime();r=this.parent.activeCellsData&&!r?this.parent.activeCellsData:(r=this.parent.activeViewOptions.timeScale.interval,i=this.parent.activeViewOptions.timeScale.slotCount,r=r*je/i,i=new Date(this.parent.selectedDate.getTime()),n=this.parent.getCurrentTime(),i.setHours(n.getHours(),Math.round(i.getMinutes()/r)*r,0),n=new Date(new Date(i.getTime()).setMilliseconds(i.getMilliseconds()+r)),{startTime:i,endTime:n,isAllDay:!1}),this.parent.eventWindow.openEditor(B.extend(r,{cancel:!1,event:e.originalEvent}),"Add")}B.isNullOrUndefined(this.toolbarObj)||(t=this.toolbarObj.element.querySelector(".e-toolbar-pop"))&&"Input"!==e.item.type&&t.ej2_instances[0].hide({name:"SlideUp",duration:100})}},t.prototype.hasSelectedDate=function(){var e=z(this.parent.selectedDate).getTime();return e>=this.parent.activeView.getStartDate().getTime()&&e<=this.parent.activeView.getEndDate().getTime()},t.prototype.getHeaderElement=function(){return this.toolbarObj.element},t.prototype.updateHeaderItems=function(e){var t=this.toolbarObj.element.querySelector(".e-prev"),i=this.toolbarObj.element.querySelector(".e-next"),n=this.toolbarObj.element.querySelector(".e-date-range");t&&("add"===e?B.addClass([t],fr):B.removeClass([t],fr)),i&&("add"===e?B.addClass([i],fr):B.removeClass([i],fr)),n&&("add"===e?B.addClass([n],bn):B.removeClass([n],bn))},t.prototype.previousNextIconHandler=function(){var e,t="Agenda"===this.parent.currentView?[this.parent.getCurrentViewDates()[0]]:this.parent.getCurrentViewDates(),i=this.toolbarObj.element.querySelector(".e-prev"),n=this.toolbarObj.element.querySelector(".e-next"),r=new Date(t[0].getTime()),t=new Date(t[t.length-1].getTime());"WorkWeek"===this.parent.currentView||"TimelineWorkWeek"===this.parent.currentView?t=Y(r=Ue(z(this.parent.selectedDate),this.parent.activeViewOptions.firstDayOfWeek),7*this.parent.activeViewOptions.interval):"Month"===this.parent.currentView&&(r=(e=!B.isNullOrUndefined(this.parent.activeViewOptions.displayDate)||0<this.parent.activeViewOptions.numberOfWeeks)?this.parent.activeView.getStartDate():We(this.parent.selectedDate),t=e?this.parent.activeView.getEndDate():ze(Ke(r,this.parent.activeViewOptions.interval-1))),B.isNullOrUndefined(i)||this.toolbarObj.enableItems(i,r>z(this.parent.minDate)),B.isNullOrUndefined(n)||this.toolbarObj.enableItems(n,t<z(this.parent.maxDate)),this.setCalendarMinMaxDate()},t.prototype.getModuleName=function(){return"headerbar"},t.prototype.destroy=function(){this.headerPopup&&!this.headerPopup.isDestroyed&&(this.headerPopup.destroy(),this.headerPopup=null),this.headerCalendar&&!this.headerCalendar.isDestroyed&&(this.headerCalendar.destroy(),this.headerCalendar=null),this.toolbarObj&&!this.toolbarObj.isDestroyed&&(this.toolbarObj.destroy(),this.removeEventListener(),B.remove(this.element),this.toolbarObj=null),this.element=null,this.parent=null,this.l10n=null},t);function t(e){this.parent=e,this.l10n=this.parent.localeObj,this.renderHeader(),this.addEventListener()}zr.prototype.getModuleName=function(){return"scroll"},zr.prototype.setWidth=function(){this.parent.element.style.width=B.formatUnit(this.parent.width)},zr.prototype.setHeight=function(){this.parent.element.style.height=B.formatUnit(this.parent.height)},zr.prototype.addEventListener=function(){this.parent.on(Ve,this.setDimensions,this),this.parent.on(ke,this.onPropertyChanged,this)},zr.prototype.removeEventListener=function(){this.parent.off(Ve,this.setDimensions),this.parent.off(ke,this.onPropertyChanged)},zr.prototype.setDimensions=function(){this.setWidth(),this.setHeight();var e={cssProperties:this.parent.getCssProperties(),module:this.getModuleName()};this.parent.notify(Me,e)},zr.prototype.onPropertyChanged=function(){this.setDimensions()},zr.prototype.destroy=function(){this.removeEventListener()};var Wr=zr;function zr(e){this.parent=e,this.addEventListener()}_r.prototype.scrollHandler=function(e){B.isNullOrUndefined(this.parent.eventTooltip)||this.parent.eventTooltip.close();var t,i=!this.parent.isAdaptive&&e.originalEvent&&e.originalEvent.target&&!B.isNullOrUndefined(B.closest(e.originalEvent.target,"."+V));if(this.parent.uiStateValues.isTouchScroll=i&&"touchmove"===e.originalEvent.type&&!this.parent.uiStateValues.action,!i&&"Agenda"!==this.parent.currentView&&!this.parent.uiStateValues.action&&this.parent.allowSwiping&&!this.parent.uiStateValues.isTapHold){if(this.parent.uiStateValues.isSwipeScroll=!0,this.timeStampStart||(this.timeStampStart=Date.now()),this.element.classList.contains(Nt)&&this.onTransitionEnd(),"Left"===e.scrollDirection||"Right"===e.scrollDirection){var i={requestType:"dateNavigate",cancel:!1,event:e.originalEvent};if(this.parent.trigger(Q,i),i.cancel)return;i=this.element.querySelector("."+A);if(i&&i.scrollWidth>i.clientWidth)return;this.isScrollTriggered=!0,e.originalEvent.preventDefault(),e.originalEvent.stopPropagation()}e.scrollDirection===this.touchLeftDirection?(this.nextPanel||(this.renderPanel(jt,"Next"),this.nextPanel={element:this.parent.activeView.getPanel(),selectedDate:new Date(this.parent.selectedDate.getTime()),renderDates:this.parent.activeView.renderDates,colLevels:this.parent.activeView.colLevels},this.setDimensions(this.nextPanel.element)),t=this.parent.enableRtl?e.distanceX:-e.distanceX,this.element.style.transform="translatex("+(this.getTranslateX(this.element)+t)+"px)"):e.scrollDirection===this.touchRightDirection&&(i=0,this.previousPanel||(this.renderPanel(Pt,"Previous"),this.previousPanel={element:this.parent.activeView.getPanel(),selectedDate:new Date(this.parent.selectedDate.getTime()),renderDates:this.parent.activeView.renderDates,colLevels:this.parent.activeView.colLevels},this.setDimensions(this.previousPanel.element),i=this.previousPanel.element.offsetWidth),t=this.parent.enableRtl?i-e.distanceX:-i+e.distanceX,this.element.style.transform="translatex("+(this.getTranslateX(this.element)+t)+"px)")}},_r.prototype.swipeHandler=function(e){var t,i;this.isScrollTriggered&&!this.parent.uiStateValues.action&&this.parent.allowSwiping&&!this.parent.uiStateValues.isTapHold&&(this.isScrollTriggered=!1,t=("Left"===e.swipeDirection?this.parent.activeView.renderDates:this.parent.activeView.renderDates.slice(-1))[0],"Left"===e.swipeDirection&&t<this.parent.maxDate||"Right"===e.swipeDirection&&t>=this.parent.minDate?((t=Date.now()-this.timeStampStart)<(i=e.distanceX*(B.Browser.isDevice?6:1.66))||e.distanceX>this.parent.element.offsetWidth/2?(this.swapPanels(e.swipeDirection),t<i&&e.distanceX>this.parent.element.offsetWidth/2&&(this.element.style.transitionDuration=(B.Browser.isDevice?e.distanceX:i)/t/10+"s"),this.confirmSwipe(e.swipeDirection)):this.cancelSwipe(),i={requestType:"dateNavigate",cancel:!1,event:e.originalEvent},this.parent.trigger(K,i)):this.cancelSwipe(),this.timeStampStart=null)},_r.prototype.tapHoldHandler=function(e){var t=B.closest(e.originalEvent.target,"."+V);B.isNullOrUndefined(t)||(this.parent.uiStateValues.isTapHold=!0,this.parent.isAdaptive?(B.Browser.isIos&&B.EventHandler.add(this.element,"touchend",this.preventEventClick,this),this.parent.quickPopup.tapHoldEventPopup(e.originalEvent),this.triggerResizeStart(e.originalEvent)):["Agenda","MonthAgenda","Year"].indexOf(this.parent.currentView)<0&&(this.parent.selectedElements=[],this.parent.eventBase.getSelectedEventElements(t),this.triggerResizeStart(e.originalEvent)))},_r.prototype.triggerResizeStart=function(e){this.parent.resizeModule&&B.closest(e.target,"."+Xi)&&this.parent.resizeModule.resizeStart(e)},_r.prototype.preventEventClick=function(e){e.preventDefault(),B.EventHandler.remove(this.element,"touchend",this.preventEventClick)},_r.prototype.renderPanel=function(e,t){this.currentPanel?this.parent.setProperties({selectedDate:this.currentPanel.selectedDate},!0):(this.currentPanel={element:this.parent.activeView.getPanel(),selectedDate:new Date(this.parent.selectedDate.getTime()),renderDates:this.parent.activeView.renderDates,colLevels:this.parent.activeView.colLevels},this.setDimensions(this.currentPanel.element)),this.parent.setProperties({selectedDate:this.parent.activeView.getNextPreviousDate(t)},!0),this.parent.headerModule&&this.parent.headerModule.setCalendarDate(this.parent.selectedDate),this.parent.activeView.getRenderDates(),this.parent.activeView.renderLayout(e)},_r.prototype.swapPanels=function(e){var t;e===this.touchLeftDirection?(t=this.nextPanel,this.nextPanel=this.currentPanel):(t=this.previousPanel,this.previousPanel=this.currentPanel),this.currentPanel=t},_r.prototype.confirmSwipe=function(t){var i=this,e={action:"date",cancel:!1,previousDate:(t===this.touchLeftDirection?this.nextPanel:this.previousPanel).selectedDate,currentDate:this.currentPanel.selectedDate};this.parent.trigger(J,e,function(e){e.cancel?(i.swapPanels(t),i.cancelSwipe()):(i.parent.activeView.setPanel(i.currentPanel.element),i.parent.setProperties({selectedDate:i.currentPanel.selectedDate},!0),e=void 0,e=i.parent.enableRtl?t===i.touchLeftDirection?i.previousPanel?i.previousPanel.element.offsetLeft:i.currentPanel.element.offsetWidth:0:t===i.touchLeftDirection?-i.currentPanel.element.offsetLeft:0,i.parent.activeView.renderDates=i.currentPanel.renderDates,i.parent.activeView.colLevels=i.currentPanel.colLevels,B.addClass([i.element],Nt),i.element.style.transform="translatex("+e+"px)",i.parent.headerModule&&i.parent.headerModule.updateDateRange(),i.parent.renderTemplates(),i.parent.crudModule.refreshDataManager())})},_r.prototype.cancelSwipe=function(){var i,n=this,e=(this.parent.activeView.setPanel(this.currentPanel.element),this.parent.setProperties({selectedDate:this.currentPanel.selectedDate},!0),this.parent.activeView.renderDates=this.currentPanel.renderDates,0<this.parent.activeViewOptions.group.resources.length&&0<this.parent.resourceBase.lastResourceLevel.length&&(i=this.parent.resourceBase.resourceCollection[0].workDaysField,this.parent.resourceBase.lastResourceLevel.forEach(function(e){var t;i?(t=e[i],t=Array.isArray(t)&&(!n.parent.showWeekend||"WorkWeek"===n.parent.currentView),e.renderDates=t?n.calculateResourceSpecificDates(e,i):n.currentPanel.renderDates):e.renderDates=n.currentPanel.renderDates})),this.parent.activeView.colLevels=this.currentPanel.colLevels,B.addClass([this.element],Nt),this.previousPanel?this.previousPanel.element.offsetWidth:0);this.element.style.transform="translatex("+(this.parent.enableRtl?e:-this.currentPanel.element.offsetLeft)+"px)"},_r.prototype.calculateResourceSpecificDates=function(e,t){var i=[],n=e[t];return this.currentPanel.renderDates.forEach(function(e){Array.isArray(n)&&-1!==n.indexOf(e.getDay())&&i.push(e)}),i},_r.prototype.onTransitionEnd=function(){(B.isNullOrUndefined(this.element)||this.element.classList.contains(Nt))&&(this.parent.uiStateValues.isSwipeScroll=!1,B.removeClass([this.element],Nt),this.element.style.transitionDuration="",this.element.style.transform="",this.previousPanel&&(B.remove(this.previousPanel.element),this.previousPanel=null,B.removeClass([this.currentPanel.element],Pt),B.addClass([this.currentPanel.element],Ht)),this.nextPanel&&(B.remove(this.nextPanel.element),this.nextPanel=null,B.removeClass([this.currentPanel.element],jt),B.addClass([this.currentPanel.element],Ht)),this.currentPanel=null,this.parent.activeView.getPanel().style.width="")},_r.prototype.getTranslateX=function(e){e=window.getComputedStyle(e);return new WebKitCSSMatrix(e.webkitTransform).m41},_r.prototype.setDimensions=function(e){e.style.width=this.parent.element.clientWidth+"px"},_r.prototype.resetValues=function(){this.currentPanel=null,this.previousPanel=null,this.nextPanel=null,this.timeStampStart=null,this.element.style.transform="",this.element.style.transitionDuration="",lt(this.element),B.removeClass([this.element],Nt)},_r.prototype.destroy=function(){this.touchObj&&(this.touchObj.destroy(),this.touchObj=null),B.EventHandler.remove(this.element,"transitionend",this.onTransitionEnd),this.resetValues()};var Yr=_r;function _r(e){this.parent=e,this.element=this.parent.element.querySelector("."+St),this.touchObj=new B.Touch(this.element,{scroll:this.scrollHandler.bind(this),swipe:this.swipeHandler.bind(this),tapHold:this.tapHoldHandler.bind(this),swipeSettings:{swipeThresholdDistance:1}}),B.EventHandler.add(this.element,"transitionend",this.onTransitionEnd,this),this.touchLeftDirection=this.parent.enableRtl?"Right":"Left",this.touchRightDirection=this.parent.enableRtl?"Left":"Right"}var Gr=function(){return(Gr=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},Xr=(i.prototype.keyActionHandler=function(e){var t=e.target;if(!("home"===e.action&&t&&-1<["INPUT","TEXTAREA","SELECT"].indexOf(t.tagName)&&t.closest(".e-quick-popup-wrapper")))switch(e.action){case"downArrow":case"shiftDownArrow":this.processDown(e,e.shiftKey);break;case"upArrow":case"shiftUpArrow":this.processUp(e,e.shiftKey);break;case"leftArrow":case"shiftLeftArrow":this.processLeft(e,e.shiftKey);break;case"rightArrow":case"shiftRightArrow":this.processRight(e,e.shiftKey);break;case"ctrlLeftArrow":this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Previous"),e),this.parent.headerModule&&this.parent.headerModule.element.querySelector(".e-prev button").focus();break;case"ctrlRightArrow":this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Next"),e),this.parent.headerModule&&this.parent.headerModule.element.querySelector(".e-next button").focus();break;case"altOne":case"altTwo":case"altThree":case"altFour":case"altFive":case"altSix":case"altSeven":case"altEight":case"altNine":this.processViewNavigation(e);break;case"enter":this.processEnter(e);break;case"home":this.focusFirstCell();break;case"tab":case"shiftTab":this.processTab(e,e.shiftKey);break;case"delete":case"backspace":this.processDelete(e);break;case"ctrlShiftUpArrow":case"ctrlShiftDownArrow":case"ctrlShiftLeftArrow":case"ctrlShiftRightArrow":this.processCtrlShiftNavigationArrows(e);break;case"escape":this.processEscape(e);break;case"fTwelve":this.parent.allowInline&&this.parent.inlineModule&&(e.preventDefault(),this.processFTwelve(e));break;case"shiftAltY":this.parent.changeDate(new Date,e);break;case"shiftAltN":"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView&&"Year"!==this.parent.currentView&&this.processShiftAltN(e);break;case"cut":case"cmdCut":(e.ctrlKey||e.metaKey)&&this.processClipboardAction(!0,void 0,e);break;case"copy":case"cmdCopy":(e.ctrlKey||e.metaKey)&&this.processClipboardAction(!1,void 0,e)}},i.prototype.processShiftAltN=function(e){var t=this.parent.getSelectedCells(),i=e.target,n=B.extend({},null,!0),i=(0<t.length&&(B.closest(i,"."+O)||B.closest(i,"."+w)||B.closest(i,"."+It))?n=this.getSelectedElements(i):B.closest(i,"."+V)&&!B.isNullOrUndefined(this.parent.activeEventData.event)?(t=this.parent.activeEventData.event,n.startTime=t.StartTime,n.endTime=t.EndTime,n.isAllDay=t.IsAllDay):(i=this.parent.getStartEndTime(this.parent.workHours.start),t=this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount,n.startTime=new Date(this.parent.selectedDate),n.startTime.setHours(i.getHours(),i.getMinutes(),0,0),n.endTime=new Date(n.startTime.getTime()+6e4*t)),B.extend(n,{cancel:!1,event:e}));null!=i&&this.parent.eventWindow.openEditor(i,"Add")},i.prototype.processFTwelve=function(e){var t=e.target;(t.classList.contains(O)||t.classList.contains(w))&&(this.parent.activeCellsData=this.getSelectedElements(t),e={element:(e=B.extend(this.parent.activeCellsData,{cancel:!1,event:e})).element,groupIndex:e.groupIndex,type:"Cell"},this.parent.notify(ue,e)),t.classList.contains(V)&&t.click()},i.prototype.addEventListener=function(){this.parent.on(Pe,this.onCellMouseDown,this),this.parent.allowClipboard&&this.parent.on(He,this.pasteHandler,this)},i.prototype.removeEventListener=function(){this.parent.off(Pe,this.onCellMouseDown),this.parent.off(He,this.pasteHandler)},i.prototype.onCellMouseDown=function(e){e.event.shiftKey||(this.initialTarget=this.getClosestCell(e.event),!this.parent.activeViewOptions.readonly&&"MonthAgenda"!==this.parent.currentView&&this.initialTarget&&(e.event.target.classList.contains(O)&&3!==e.event.which&&(this.parent.removeSelectedClass(),B.EventHandler.add(this.parent.getContentTable(),"mousemove",this.onMouseSelection,this),B.EventHandler.add(this.parent.getContentTable(),"mouseup mouseleave",this.onMoveUp,this)),e.event.target.classList.contains(w))&&3!==e.event.which&&(this.parent.removeSelectedClass(),e=this.parent.getAllDayRow(),B.EventHandler.add(e,"mousemove",this.onMouseSelection,this),B.EventHandler.add(e,"mouseup mouseleave",this.onMoveUp,this)))},i.prototype.onMouseSelection=function(e){var t,i,n=[].slice.call(this.parent.element.querySelectorAll("."+V)),n=(B.addClass(n,"e-allow-select"),this.parent.boundaryValidation(e.pageY,e.pageX)),r=((n.bottom||n.top||n.left||n.right)&&(r=(t=this.parent.element.querySelector("."+A)).offsetHeight<=t.scrollHeight&&0<=t.scrollTop&&t.scrollTop+t.offsetHeight<=t.scrollHeight,i=t.offsetWidth<=t.scrollWidth&&0<=t.scrollLeft&&t.scrollLeft+t.offsetWidth<=t.scrollWidth,r&&(n.top||n.bottom)&&(t.scrollTop+=n.top?-e.target.offsetHeight:e.target.offsetHeight),i)&&(n.left||n.right)&&(t.scrollLeft+=n.left?-e.target.offsetWidth:e.target.offsetWidth),this.getClosestCell(e));r&&this.selectCells(!0,r)},i.prototype.getClosestCell=function(e){return B.closest(e.target,"."+O+",."+w)},i.prototype.onMoveUp=function(t){var i,n=this,e=[].slice.call(this.parent.element.querySelectorAll("."+V));B.removeClass(e,"e-allow-select"),B.EventHandler.remove(this.parent.getContentTable(),"mousemove",this.onMouseSelection),B.EventHandler.remove(this.parent.getContentTable(),"mouseup mouseleave",this.onMoveUp),t.target.classList.contains(w)&&(e=this.parent.getAllDayRow(),B.EventHandler.remove(e,"mousemove",this.onMouseSelection),B.EventHandler.remove(e,"mouseup mouseleave",this.onMoveUp)),this.isPreventAction(t)||(e=B.closest(t.target,".e-work-cells,.e-all-day-cells,.e-header-cells"))&&(0<(i=this.parent.getSelectedCells()).length&&-1===i.indexOf(e)&&(e=i[i.length-1]),"TimelineYear"===this.parent.currentView&&e.classList.contains(E)||(this.parent.activeCellsData=this.getSelectedElements(e),e={},this.parent.eventWindow&&this.parent.eventWindow.convertToEventData(this.parent.activeCellsData,e),e={data:e,element:this.parent.activeCellsData.element,event:t,requestType:ge,showQuickPopup:!1},this.parent.trigger(G,e,function(e){(e.showQuickPopup||n.parent.quickInfoOnSelectionEnd)&&1<i.length&&(e=B.extend(n.parent.activeCellsData,{cancel:!1,event:t,name:"cellClick"}),n.parent.notify(q,e))})))},i.prototype.processEnter=function(e){var t,i,n;this.parent.activeViewOptions.readonly&&!e.target.classList.contains(V)||this.isPreventAction(e)||"TimelineYear"===this.parent.currentView&&e.target.classList.contains(E)||(t=e.target,B.closest(t,"."+Tr)?t.classList.contains(yn)||t.classList.contains(Tn)||t.classList.contains(wn)||t.classList.contains(Dn)||t.classList.contains(dr)?(t.click(),e.preventDefault()):t.classList.contains(Gn)&&(this.parent.element.querySelector("."+Tn).click(),e.preventDefault()):t.classList.contains(Kt)&&t.classList.contains(_t)?(i=t.querySelector("."+Qt))&&i.click():t.classList.contains(O)||t.classList.contains(w)?(this.parent.activeCellsData=this.getSelectedElements(t),i=B.extend(this.parent.activeCellsData,{cancel:!1,event:e}),this.parent.allowInline?(n={element:i.element,groupIndex:i.groupIndex,type:"Cell"},this.parent.notify(ue,n)):"Year"===this.parent.currentView?t.click():this.parent.notify(q,i)):t.classList.contains(Pr)&&this.parent.inlineModule?this.parent.inlineModule.inlineCrudActions(t):t.classList.contains(V)||t.classList.contains(Vn)||t.classList.contains(ln)||t.classList.contains(hn)?t.click():t.classList.contains(xn)&&(this.parent.setProperties({selectedDate:this.parent.getDateFromElement(t)},!0),this.parent.changeView(this.parent.getNavigateView(),e),this.processEscape(e)))},i.prototype.getSelectedElements=function(e){var t,i=1<this.selectedCells.length&&e.classList.contains(di)?(t=this.parent.getCellDetails(this.selectedCells[0]),i=this.parent.getCellDetails(this.selectedCells.slice(-1)[0]),t.endTime=i.endTime,t.element=e,t):this.parent.getCellDetails(e);return i},i.prototype.getCells=function(e,t,i){var n=this.parent.getContentTable(),r="TimelineYear"===this.parent.currentView,a=[].slice.call(n.querySelectorAll(r&&!e?"."+O+":not(."+E+")":"td")),s=n.rows.length,o=n.rows[0].cells.length,n=(t&&t.classList.contains(w)&&(n=this.parent.getAllDayRow(),a=[].slice.call(n.cells),s=1,o=n.cells.length),a.indexOf(t)),l=a.indexOf(i),p=[];if(e){for(var c=0;c<o;c++)for(var h=0;h<s;h++){var d=a[o*h+c];r&&d.classList.contains(E)||p.push(d)}n=p.indexOf(t),l=p.indexOf(i)}return l<n&&(t=n,n=l,l=t),(e?p:a).slice(n,l+1)},i.prototype.focusFirstCell=function(){var e;"Agenda"===this.parent.currentView?((e=this.parent.getContentTable().querySelector("."+Vi)).setAttribute("tabindex","0"),e.focus()):(this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.activeView.isTimelineView()&&"TimelineYear"!==this.parent.currentView?(e=this.parent.element.querySelector("."+C+" tr:not(."+fr+") ."+O+":not(."+Ut+")"),this.selectCells(!1,e)):-1<this.parent.currentView.indexOf("Year")?(e="."+O+":not(."+E+"):not(."+Ut+")",e+="TimelineYear"===this.parent.currentView&&"Vertical"===this.parent.activeViewOptions.orientation?'[data-date="'+this.parent.activeView.startDate().getTime()+'"]':"",this.selectCells(!1,this.parent.element.querySelector(e))):this.selectCells(!1,this.parent.getWorkCellElements()[0]))},i.prototype.isInverseTableSelect=function(){return this.parent.activeView.isInverseTableSelect},i.prototype.selectCells=function(e,t){var p,c,i,h=this,d=(this.parent.removeSelectedClass(),t instanceof Array?t.slice(-1)[0]:t);e?(c=["Day","Week","WorkWeek","TimelineDay","TimelineWeek","TimelineWorkWeek","TimelineMonth","TimelineYear"],i={element:t,requestType:"mousemove",allowMultipleRow:!0},this.parent.inlineModule.removeInlineAppointmentElement(),this.parent.trigger(G,i,function(e){e.allowMultipleRow&&h.parent.allowMultiRowSelection||((e="TimelineYear"===h.parent.currentView)&&"Horizontal"===h.parent.activeViewOptions.orientation||"Month"===h.parent.currentView?(e=e&&0<h.parent.activeViewOptions.group.resources.length,d=e?h.initialTarget:h.initialTarget.parentElement.children[d.cellIndex]):-1<c.indexOf(h.parent.currentView)&&(d=d.parentElement.children[h.initialTarget.cellIndex]));e=h.getCells(h.isInverseTableSelect(),h.initialTarget,d);if(0<h.parent.activeViewOptions.group.resources.length){p=h.initialTarget.getAttribute("data-group-index");for(var t=[],i=0,n=e;i<n.length;i++)(a=n[i]).getAttribute("data-group-index")===p&&t.push(a);e=t}if(h.parent.allowMultiCellSelection||(e=[h.initialTarget]),2<(h.selectedCells=e).length&&!d.classList.contains(w)){var r=h.getAllDayCells(e);if(0<h.parent.activeViewOptions.group.resources.length){for(var a,s=[],o=0,l=r;o<l.length;o++)(a=l[o]).getAttribute("data-group-index")===p&&s.push(a);r=s}e=e.concat(r)}d.getAttribute("data-group-index")!==p&&0<h.parent.activeViewOptions.group.resources.length&&(d=h.selectedCells[h.selectedCells.length-1]),h.parent.addSelectedClass(e,d)})):(i={element:d,requestType:ge},this.parent.trigger(G,i,function(){h.initialTarget=d,h.selectedCells=[d],h.parent.addSelectedClass([d],d)}))},i.prototype.selectAppointment=function(e,t){var i=this.getAppointmentElements();